{"docstore/metadata": {"/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/conftest.py_os.path_": {"doc_hash": "7160c0f21d3cdf35a31b3395578b40665c63bd78a54894a4cc3269923297555d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/docs/source/conf.py__coding_utf_8___html_show_sphinx_True": {"doc_hash": "f2c82593f4f1b2a9d080cbbbef0cefbfa2f7db061c9d230f9e22e1087c42be0f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/docs/source/conf.py_htmlhelp_basename_": {"doc_hash": "0cd7026cb2861705088a28a8084983b5ee76a3b47c04cd38a6c971d10379715a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/actions_stubs.py__usr_bin_env_python3_apply_all.for_p_d_files_in_os_wal.if_not_recursive_.break": {"doc_hash": "8829686d17eb88f41173f748d54e2a8c4fce08a31e129815a7d81456f3242418"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/actions_stubs.py_confirm_actions._cp_mv_rm_": {"doc_hash": "e36609d9bf9f008bec4823270998b7626f3ff5c11583c97f5635e097418a5e1d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/actions_stubs.py_main_": {"doc_hash": "11fd8e2ebea27bc8ad79adac8c126cf8b0a636443b6c840b34757fb2dce540f3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/analyze_cache.py__usr_bin_env_python_extract_classes.yield_from_extract_chunk": {"doc_hash": "0cc8d9873d6680cb4053d90393780d49167e750629bfb3ac439a1535a1334444"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/analyze_cache.py_load_json_load_json.return.CacheData_data_path_repla": {"doc_hash": "68c1aaf6dc1b727e8c357d819b14978fa256d6a79ebb8b1190c1ea0804cc5cf5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/analyze_cache.py_get_files_report_most_common.report_counter_Counter_st": {"doc_hash": "3cbe12c468e403c2b5072c0c987993b76089f9f6c99ed6249e0cb392bab699b6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/analyze_cache.py_compress_compress.return.out": {"doc_hash": "4a6196b451ba4da91ab205ad15b870c919f7170cc347d8ec2640ff174558c633"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/analyze_cache.py_decompress_decompress.return.helper_chunk_": {"doc_hash": "8652fceb81fe8cb6f685552997cba5321250b1f3873dd925ba247eb33315299f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/analyze_cache.py_main_": {"doc_hash": "c6555a648c396797fcfaebd34e2f1dde33403c88df2266e9c2acd685717ab906"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/apply-cache-diff.py__usr_bin_env_python3_make_cache.if_sqlite_.else_.return.FilesystemMetadataStore_i": {"doc_hash": "07c0cf106e0938a2a399b3e5e3f89397b9b1905e2c7b4ad96b599093e69bbbf7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/apply-cache-diff.py_apply_diff_": {"doc_hash": "9871d43a259c344a32efee494ff0f154d850ea871e817167ffbb9477db38165e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/async_matrix.py__usr_bin_env_python3_decorated_host_coroutine.x_1.await_func_": {"doc_hash": "476daa4487986945fb68bbfafc4e41369276cc7befaa00f04c62845ecf016a6b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/async_matrix.py__Main_driver__": {"doc_hash": "9da8da47925c928f655e524afce1de71f2d3bef204104c1e71573da838d6ee69"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/convert-cache.py__usr_bin_env_python3_": {"doc_hash": "3f2d49ab979357664e17e6a35211f3bd20727c5001cd597ca93265f13a9aeb29"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/diff-cache.py__usr_bin_env_python3_merge_deps.for_k_v_in_new_items_.all_setdefault_k_set_": {"doc_hash": "a188e247657f95881595fd59778446f4aac27ae45e56a03728c5ea823d954b53"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/diff-cache.py_load_load.return.obj": {"doc_hash": "5ef459693f8a9ea304ecc5c0c3923a3d1220b492a814defe7f5f082e4f8b100a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/diff-cache.py_main_": {"doc_hash": "f43c1332362b75643dd313d07c2732f927fe5ada42361c0957764d48abd177c1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/dump-ast.py__usr_bin_env_python3_dump.with_open_fname_rb_as.if_not_quiet_.print_tree_": {"doc_hash": "37afe8677a78c8cde49c41c49e480b69903e06fc061b9cdf7ddb8e141c3445fb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/dump-ast.py_main_": {"doc_hash": "c357c741c17455e40866ec18e782d0fc011a1a4e267b25db563620de4d08c7ea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/fix_annotate.py__Fixer_for_lib2to3_that_from_lib2to3_fixer_util_i": {"doc_hash": "d7ad497a674b3ccdb0d1fae50f9b066afafdd0d40d38057f6587c1cae46c8708"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/fix_annotate.py_FixAnnotate_FixAnnotate.transform.if_Any_in_annot_.touch_import_typing_A": {"doc_hash": "3dc37dd693e32db21fc42f4f8b055f1acc532fe808b07c7bac658bb239650820"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/fix_annotate.py_FixAnnotate.make_annotation_FixAnnotate.make_annotation.return._join_argtypes_": {"doc_hash": "ec99f162715821c414c1cfbebdff82463141962423d940b283600da9662ac46c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/fix_annotate.py_FixAnnotate._The_parse_tree_has_a_di_FixAnnotate.get_decorators.return.decs": {"doc_hash": "264acb7ab4bad460e775e8cbc7b9ec87420c98e25e8a83f640acd7295d844be3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/fix_annotate.py_FixAnnotate.is_method_": {"doc_hash": "4dcf225d03dd227affc1e4116ed78aa939a4e26bf57a4ae01d4db582163430be"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/incremental_checker.py__usr_bin_env_python3_delete_folder.if_os_path_exists_folder_.shutil_rmtree_folder_path": {"doc_hash": "a507c85ed8371910b22277dfe0a0b190da1b9419ca0ec2acf8c98900908248e8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/incremental_checker.py_execute_execute.return.stdout_stderr_proc_retu": {"doc_hash": "7085c0479e4df3d909e7e978263525785e0c3869c2069d0bf0e1ecbc0e634720"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/incremental_checker.py_ensure_environment_is_ready_get_nth_commit.return.get_commits_repo_folder_p": {"doc_hash": "b005cb39ba55076fb9c3ac8983937aadcd5e86f84db0c8bb638c3ffd0365d4c5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/incremental_checker.py_run_mypy_run_mypy.return.runtime_output_stats": {"doc_hash": "a4141a40d37f139f4e61f31b2285c8dfd791bd831369068a960bb82b9dffbd02"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/incremental_checker.py_filter_daemon_stats_filter_daemon_stats.return._n_join_output_lines_": {"doc_hash": "0a59aaef956d7125515dfbf381c07636b0ee40900e6ee4edb6314f6c5ca9e833"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/incremental_checker.py_start_daemon_save_cache.with_open_incremental_cac.json_dump_cache_stream_": {"doc_hash": "0b742f9620d5994b41e74f911c8bf1b16e814a437a74bcbd6d66afebaadf5ae4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/incremental_checker.py_set_expected_set_expected.print_": {"doc_hash": "2f5cd19457ebd2308de7050d9aa59b7aad13d4de93078cfc92c6eb0d9ffbb755"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/incremental_checker.py_test_incremental_test_incremental.if_overall_stats_.print_Overall_stats_o": {"doc_hash": "323b3c6aaedcf93923636a78e915c67179d55bc1e3b94c49d41546f7f5020973"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/incremental_checker.py_combine_stats_cleanup.delete_folder_mypy_cache_": {"doc_hash": "544e78159093cfc50e64d63362edff063b8f734c4e7f3f89938fc549292994f5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/incremental_checker.py_test_repo_test_repo.None_5.stop_daemon_": {"doc_hash": "028df5b2f2a372b06e9386c32ae3d4b1ddaa9801463fe0f04c602044e5aad8a0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/incremental_checker.py_main_": {"doc_hash": "0c377530ef0ba4462c0839b4a682bbd665888498d5a6e3b6121455889abd8375"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/perf_checker.py__usr_bin_env_python3_delete_folder.if_os_path_exists_folder_.shutil_rmtree_folder_path": {"doc_hash": "981cb05ac6d224075938a9fea375f7c55c4f4ea732680a73fa783b19da200064"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/perf_checker.py_execute_execute.if_proc_returncode_0_.raise_RuntimeError_Unexp": {"doc_hash": "de02962cc4c1abf0747c133628893146af9e4b4fc5912a0325f896b6fc9fdb48"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/perf_checker.py_trial_report.print_": {"doc_hash": "3b8102132964bf7877fe069f48870db7b121f84b55d337bf38efe6894cf21f01"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/perf_checker.py_main_": {"doc_hash": "b1cf8ee460696141a0d473e4190518dec8b992a01b34f7eefc17e533179dbd94"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/proper_plugin.py_from_mypy_plugin_import_P_ProperTypePlugin.get_function_hook.return.None": {"doc_hash": "9548a9d05a20b1eb9ddb99d1e8d2a27f4aeabad5074bfac31eadb5f49d93a4a4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/proper_plugin.py_isinstance_proper_hook_isinstance_proper_hook.return.ctx_default_return_type": {"doc_hash": "6632b9042ee381f529e7f511b9ded74768ea3beda82a42c018005e0b214906d8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/proper_plugin.py_is_special_target_is_special_target.return.False": {"doc_hash": "a937eebf60f1a2e5ed563babdfefd6e1d2d19c1f5624a4c5263145805e2c3764"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/proper_plugin.py_is_improper_type_is_dangerous_target.return.False": {"doc_hash": "afca65e49e8a970701b478c56ddb5806f55b235bd3f2cf97f970b6bf40097360"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/proper_plugin.py_proper_type_hook_proper_type_hook.return.ctx_default_return_type": {"doc_hash": "461cbb5e0e3fa4956e64a76a8af991b0b6c27be9c493e3d6708a704b58f4e7b4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/proper_plugin.py_proper_types_hook_": {"doc_hash": "5faf51c8afc02ff8d5b2abe5a57233c72d41540b247ab0a050ac2e0015339ca9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/test_case_to_actual.py_from_typing_import_Iterat_": {"doc_hash": "437b8df4b5b6846b7ee0acdebfaf23e4853edec23a2164866a8e465fb317e678"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/touch_checker.py__usr_bin_env_python3_execute.if_proc_returncode_0_.None_7": {"doc_hash": "c9afdbda72e3fd63f27a530a3cc2491e743551d9c30f1edb8ce683221e953e70"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/touch_checker.py_Command_make_change_wrappers.return.setup_teardown": {"doc_hash": "cf49e465b25b02a2812c338386197acbf918a769ba931bbb5fb5951d09450fa8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/touch_checker.py_main_": {"doc_hash": "58ecd3b6e82eb5e8c3364a8dc092af8243ab38b97309d18e78f221edae287283"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/variadics.py__Example_of_code_genera_prelude.for_i_in_range_LIMIT_.print_T_i_TypeVar_T": {"doc_hash": "96da33fc61e7db9bdcd0542bf95cbd86a9c2c321fb0f0482bc4f4502d0e88c1a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/variadics.py_expand_template_expand_template.print_s_": {"doc_hash": "d2577fcfdfe796d328d843dffedff147b5c048f27ebab70834a42e72231ebe7f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/variadics.py_main_": {"doc_hash": "b36801618284a65596ac4bb075a6db1288799ea52b43605bb73a06af181d64b6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/__init__.py__": {"doc_hash": "a70e4d519010e70b37d454970228ce708a96b66710607285794020f5891e8eff"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/__main__.py__Mypy_type_checker_comm_": {"doc_hash": "7cdf99c04a4d5de02d443024c8d9f26f5cd62e94ad04611ebe1ec386bcd71335"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/api.py__This_module_makes_it_p_run.return._run_lambda_stdout_stder": {"doc_hash": "bed7b03e8436b495028d196550717bc059b1958439d3ec32a0727cdc87143f38"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/api.py_run_dmypy_": {"doc_hash": "b05f6acec14a66d1ff5dd21275b4438099269b9caabdf4f9e58205070b8f5990"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/applytype.py_from_typing_import_Dict__get_target_type.return.type": {"doc_hash": "d5795b1d3d54e985c8e5f7b41d6d702b6f63cc88b494530818009cb6a7ced30f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/applytype.py_apply_generic_arguments_": {"doc_hash": "42c6c4505223ba6c4edbaa3945e6129e4b929371a810bb606afeb8b8ec36a773"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/argmap.py__Utilities_for_mapping__map_actuals_to_formals.for_ai_actual_kind_in_en.if_actual_kind_nodes_A.else_.if_isinstance_actualt_Ty.else_.ambiguous_actual_kwargs_a": {"doc_hash": "0013884f34fb907b5149f9d088fc17841a1589f7dc5656982b5b8725675162c7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/argmap.py_map_actuals_to_formals.if_ambiguous_actual_kwarg_map_actuals_to_formals.return.formal_to_actual": {"doc_hash": "d219bc09f40758a72ee746208a0ec59ed291f82abbc305cb1845a0bb15a187b0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/argmap.py_map_formals_to_actuals_map_formals_to_actuals.return.actual_to_formal": {"doc_hash": "6dce4cc43a4f886ef1d48f7ea1a7d788ea4f4bcbb0162184ea01361b2e01ede9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/argmap.py_ArgTypeExpander_ArgTypeExpander.__init__._type_Set_str_": {"doc_hash": "9db0be4e677e6f2c6ccd3c0e4097180dac5eb03fcf20afde6345076a6ba19b1a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/argmap.py_ArgTypeExpander.expand_actual_type_": {"doc_hash": "1b053df7b355f0a5c2e17788ca224a15a4ff5ba4fbc5e9ed33dc278e5e68c6d4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/binder.py_from_contextlib_import_co_BindableExpression.Union_IndexExpr_MemberEx": {"doc_hash": "0bbef51e8e3c669218fe9fb4053f77f29a05dafad41f960a9da767388a9f561b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/binder.py_Frame_Assigns.DefaultDict_Expression_L": {"doc_hash": "6751e94d49621e26e1e976cbd65d47b90a473d66bd78b75cff7d031f1aee5964"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/binder.py_ConditionalTypeBinder_ConditionalTypeBinder._get.return.None": {"doc_hash": "e056d4444a4951425875ee5c813d752595f09b202cbed83c27f9a929c214dd32"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/binder.py_ConditionalTypeBinder.put_ConditionalTypeBinder._cleanse_key.for_frame_in_self_frames_.if_key_in_frame_types_.del_frame_types_key_": {"doc_hash": "a50bd0a63e2f7f5b74c1f93c02265ec5536a59c833001dd427c89a72bcf25afc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/binder.py_ConditionalTypeBinder.update_from_options_ConditionalTypeBinder.update_from_options.return.changed": {"doc_hash": "60dceaf06cb818977fd522b63ae7d22ecc102d91df5e5b636b3b5df42f5bafd7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/binder.py_ConditionalTypeBinder.pop_frame_ConditionalTypeBinder.accumulate_type_assignments.self.type_assignments_2.old_assignments": {"doc_hash": "7dfdfc634841bdb1d7b9f3d083831f0901b8f33fd319cb8bb749fa0428eb2fc1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/binder.py_ConditionalTypeBinder.assign_type_ConditionalTypeBinder.assign_type.for_i_in_self_try_frames_.self_allow_jump_i_": {"doc_hash": "df1da3b59d89976c12190c7a6085cba30ee314b4b628cd1754027c6bece6e045"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/binder.py_ConditionalTypeBinder.invalidate_dependencies_ConditionalTypeBinder.handle_continue.self_unreachable_": {"doc_hash": "ec054d1ffa82067547057d5c398a140416f32da0463cfa805cf6bdfc21545f81"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/binder.py_ConditionalTypeBinder.frame_context_": {"doc_hash": "996cf05b4c22cfafc6326fd082731416f49f4a49b241b6df9249b447060d5bbe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/bogus_type.py__A_Bogus_T_type_alias__": {"doc_hash": "6c8ce2f14ebd6402844bc4f6a02d924e81cbfcc5c23b08b1b010a8a8aa6b6eef"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py__Facilities_to_analyze__Graph.Dict_str_State_": {"doc_hash": "b3b36ce5aedac0a3866ad2f2a1c0831492a9b09de4c9ed03c381bfc3eebcde6b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py__TODO_Get_rid_of_BuildR_BuildResult.__init__._type_List_str_Fill": {"doc_hash": "fc2b764e91be53269d57734bd91ffc4ff3d33e328015254b92522980ce56a12c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_BuildSourceSet_BuildSourceSet.is_source.if_file_path_and_file_pat.else_.return.False": {"doc_hash": "8a819d6ebc43b0c095a741837d70192f10f9472416398858485d44d35659649d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_build_build.try_.except_CompileError_as_e_.raise": {"doc_hash": "07af80415d995f1673f07e1f112e9e8ae84d65bd46b1dc5dc4095590f949b2c8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_default_data_dir_normpath.if_options_bazel_.else_.return.os_path_abspath_path_": {"doc_hash": "55babd9f97ed1d9d0ede6860800e4bb3ac6e16eba9b07bc914f636ceb48e00a0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_CacheMeta_FgDepMeta.TypedDict_FgDepMeta_": {"doc_hash": "45f2f9e7aca666399ed320db22fdc7795a95c7820a3b485533572ea71bbc9ad2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_cache_meta_from_dict_cache_meta_from_dict.return.CacheMeta_": {"doc_hash": "278f61604a0ac12c930a52f08a55d29b4290790837b9cc33357f3085239a0357"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py__Priorities_used_for_imp_import_priority.return.toplevel_priority": {"doc_hash": "b969203e90dc33e33ef95f50b0cf53415b479efd57777ac453d5098b7ec99614"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_load_plugins_from_config_load_plugins_from_config.return.custom_plugins_snapshot": {"doc_hash": "5441227ec1c825912d684f85792abe2d21b78d6336fa9ae11c248080a8652629"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_load_plugins_load_plugins.return.ChainedPlugin_options_cu": {"doc_hash": "f5eacd530a1be01071f403924bfe08d7179e8151d29b26257f1812725c9dfea1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_take_module_snapshot_take_module_snapshot.return._format_ver_diges": {"doc_hash": "7c550f17380ba573facbb2c81d434a59f7a88a2baa0a5f4bc803b110e8bf223d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_find_config_file_line_number_find_config_file_line_number.return._1": {"doc_hash": "ca970e8ed6a41f7efdac3c23d5f6a4b9ac69ccd229e22ba8fd00deae974bc16b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_BuildManager_BuildManager._This_class_holds_share": {"doc_hash": "5ee066e037d95163c42b3529b386023bfcdb45f19daa474ebdea2a823a1260f9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_BuildManager.dump_stats_BuildManager.maybe_swap_for_shadow_path.return.shadow_file_if_shadow_fil": {"doc_hash": "ddffdac9f3c6b5f2f78a247ba261958bc57302fa2976d5e4703c3f548f00119f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_BuildManager.get_stat_BuildManager.getmtime.if_self_options_bazel_.else_.return.int_self_metastore_getmti": {"doc_hash": "c8924f3e9ceacaf6ff435bb000ca16dfd0c6a66b2c90a19ad33af1fbb1c8d158"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_BuildManager.all_imported_modules_in_file_BuildManager.all_imported_modules_in_file.correct_rel_imp.return.new_id": {"doc_hash": "a8a84ab66d920add748f5d84009fc7db0efad4bb6b42a55b623b9626b17a5a94"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_BuildManager.all_imported_modules_in_file.res_BuildManager.all_imported_modules_in_file.return.res": {"doc_hash": "8934391395ef287501b326aba8a9b842dfd385310146c38e9e99f5658003193a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_BuildManager.is_module_BuildManager.parse_file.return.tree": {"doc_hash": "b97b83cfc6d39cf65911825b2604d940e69c3d908b521eb9f10c9efe694d17f4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_BuildManager.load_fine_grained_deps_BuildManager.load_fine_grained_deps.return.val": {"doc_hash": "8bf4cfe1812e29fdeb4d32c7087a1085a05c9b4fa2119c814959e7c843d4d55c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_BuildManager.report_file_BuildManager.stats_summary.return.self_stats": {"doc_hash": "88c75ef2469b25de76d23432d98d08c6281072593b8dd80b535d1f2e87feeecc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_deps_to_json_FAKE_ROOT_MODULE._root_": {"doc_hash": "6873a22ad798d0c6042c7579787050303b2303e36bbf2b8d29ebf626eeb8d150"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_None_28_write_deps_cache.if_error_.manager_errors_report_0_": {"doc_hash": "0c6e86e53d42d3314870e46b338ac12887e0bf79234df662265a3bce6c219983"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_invert_deps_invert_deps.return.rdeps": {"doc_hash": "d4471646e5bd4bf0e31dfb2798a8d1913e67f69d11fe37a82a84fd75d47e12c6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_generate_deps_for_cache_generate_deps_for_cache.return.rdeps": {"doc_hash": "b9d8a1d371b061741db9d05d448952efa3cc3c39b831af985dbacd3d85174e7c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_PLUGIN_SNAPSHOT_FILE_read_plugins_snapshot.return.snapshot": {"doc_hash": "e90cbd35fd2385d2e882b6652999cb3ec194cd86c3641ce26c06735937137cf9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_read_quickstart_file_read_quickstart_file.return.quickstart": {"doc_hash": "ff225077e75fe885c7d5623d2337b681eb2d7565954efb12d9e871dd90fea679"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_read_deps_cache_read_deps_cache.return.module_deps_metas": {"doc_hash": "96d4720d11c3eb3efc5169954d683f8fbe071d14400cf41111e205554a89feea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py__load_json_file__load_json_file.None_1.else_.return.result": {"doc_hash": "9efbccbff147097a3a1fb5cf96ee31f16eafe2109fb8748559cec7025b3e9425"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py__cache_dir_prefix_add_catch_all_gitignore.try_.except_FileExistsError_.pass": {"doc_hash": "f0d02f1a36ba8b5f7945a363cbf27f42c7dcf0245fb45375724b391ab8fd147b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_exclude_from_backups_create_metastore.return.mds": {"doc_hash": "e482ea9e5bd85afdc227a4f1355c6f50bf6f538bdfc2ce2370eca30be72ccb84"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_get_cache_names_get_cache_names.return._prefix_meta_json_p": {"doc_hash": "f9fb8ebbe46c267ea52d4945e93c9106129a5319843f4999a2b5c8a16cd79081"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_find_cache_meta_find_cache_meta.return.m": {"doc_hash": "4749a3c217acaadb454163ff179fea76972dbdd5cfb884688ebcd56436338767"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_validate_meta_validate_meta.mtime.0_if_bazel_else_int_st_st": {"doc_hash": "aab4fad6584a04e83185eb025f2c39502cf88981cad760caf465b77dc42bc6e0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_validate_meta.if_not_bazel_and_mtime__validate_meta.return.meta": {"doc_hash": "6e8fe07f5fe11ab384e66aa7e0388802c50d2b1f25df8308a354ac59a48881e2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_compute_hash_json_dumps.if_debug_cache_.else_.return.json_dumps_obj_sort_keys": {"doc_hash": "c58c78b9b4bbecc4d2d053c2ddb3b6e785f62728719e7c1d37810699933030b0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_write_cache_write_cache._Note_that_for_Bazel_we_": {"doc_hash": "8fc94aa05bd30900be2c166caf6bc8f8888ef4a813640316aaeb7c10d5c4b085"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_write_cache.if_old_interface_hash__write_cache.return.interface_hash_cache_met": {"doc_hash": "61dd746ccffc3d0345b062ab4cc3f202518d224d178b3256981373e971973a23"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_delete_cache_delete_cache.for_filename_in_cache_pat.try_.except_OSError_as_e_.if_e_errno_errno_ENOEN.manager_log_Error_deleti": {"doc_hash": "de3619e984ff044fb061ec079394aaf21b0129b8d849205fa5e6470534499d4c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py__Dependency_manager__ModuleNotFound._Control_flow_exception": {"doc_hash": "ea6badcad17c94619eec6cb9114470a3f920ec88538e9f42f3f0de0ee837d553"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State_State.fine_grained_deps_loaded.False": {"doc_hash": "3be79b5f816c5521f36921cadc335a2a9f79b77b173ced9e0682ddfdcf1b52c8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.__init___State.__init__.if_self_meta_.else_.self_compute_dependencies": {"doc_hash": "f6f3563a0f9a58dad9b81ae2aa8ecbc838fca5aed642e18e5e1781b58ae6edb9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.xmeta_State.add_ancestors.self.ancestors.ancestors": {"doc_hash": "8bf78d868599e3ffa1eebb626bd9d97efbc60ace12dac3df99c5f55cd56d4cac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.is_fresh_State.check_blockers.if_self_manager_errors_is.self_manager_errors_raise": {"doc_hash": "b9b826b91d053a76133c9357d48e4fc0bf94da445b7f8eb15cba2169f57e5e54"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.wrap_context_State.wrap_context.if_check_blockers_.self_check_blockers_": {"doc_hash": "8cdc9c7a2463963b694344f6e43133481cbd9878190658a7db4f111bab1c338a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.load_fine_grained_deps_State._Methods_for_processing_": {"doc_hash": "9f4300d348c6c70f4c3f681ac3d986803397f8e99832cea9006231e678d7f8b8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.parse_inline_configuration_State.semantic_analysis_pass1.if_options_allow_redefini.self_tree_accept_Variable": {"doc_hash": "8b950a9a2bb8d13342dc8cf3aec6e461cc4d9d814778068e728234ee5bb3e356"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.add_dependency_State.suppress_dependency.if_dep_not_in_self_suppre.self_suppressed_set_add_d": {"doc_hash": "2e3acacfcc1de9148689ad6952a1b6aa82a98f4de1e0812422ac223c57f9af10"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.compute_dependencies_State.compute_dependencies._Can_fail_due_to_bogus_r": {"doc_hash": "6f2ed5b7ac5eb8a98a053537fa7df6164ac6633457393240d67bf8fbfcebef89"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.type_check_first_pass_State.type_check_second_pass.with_self_wrap_context_.return.self_type_checker_check": {"doc_hash": "24fab2317f16974bff7094409006f99ae7885843503e79102cb7f3a4869fa6e5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.finish_passes_State.finish_passes.with_self_wrap_context_.if_not_manager_options_fi.free_tree_self_tree_": {"doc_hash": "1fda7409ee35c5dd5a2944dad0fcb0490276d168169e08e5759cb6fc0859f539"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.free_state_State._patch_indirect_dependencies.for_dep_in_sorted_extra_.if_dep_not_in_self_suppre.elif_dep_not_in_self_supp.self_suppress_dependency_": {"doc_hash": "b00e4d3814bce24d70acd3251abd66f57dc59a3c77da4c93c0e8ad36db7450a3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.compute_fine_grained_deps_State.compute_fine_grained_deps.return.get_dependencies_target_s": {"doc_hash": "b77bd2bdd43f2a3148640f1f26d2fd1b2ac8ffe3ae080b163cb74b2cb21f2c8b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.update_fine_grained_deps_State.valid_references.return.valid_refs": {"doc_hash": "9fc6d1ae22b59e937f6c761b0633aa4b2edd8893ccdc2f299d0a3d8995c5b2ac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.write_cache_State.write_cache.if_new_interface_hash_.else_.self.interface_hash.new_interface_hash": {"doc_hash": "3822afb86306d0ab153d635714f100aa5c0d943a55e7fe3593082afb26725f84"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.verify_dependencies_State.verify_dependencies.for_dep_in_all_deps_.try_.except_ModuleNotFound_C.pass": {"doc_hash": "e51ba879ab2528c99f00b4ee5ac21792c782506ba4591f4bba712bea491c5a35"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.dependency_priorities_State.generate_unused_ignore_notes.if_self_options_warn_unus.self_manager_errors_gener": {"doc_hash": "124898db4f5e544f70b8ba3edb2f03a92d73ce76023c73a4783590b2b39bb063"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py__Module_import_and_diagn_find_module_and_diagnose.result.find_module_with_reason_f": {"doc_hash": "b8b96ea72884a5635451cba00229c2fd913cae7c22547be3842dacc459d04484"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_find_module_and_diagnose.if_isinstance_result_str_find_module_and_diagnose.if_isinstance_result_str.else_.if_caller_state_.else_.raise_ModuleNotFound": {"doc_hash": "c702b6a0dea3bb69448f5274aa2c793fb3d3ad8c93fc36cbf2821474fbf30966"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_exist_added_packages_exist_added_packages.return.False": {"doc_hash": "f8c2332b5002c18d30b3bc82f15bc8cd487770f569078df281fea4f83a22187f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_find_module_simple_find_module_with_reason.return.x": {"doc_hash": "cf5ca42873ca900b4bd9c1cec7f3f8e871d28ab00fa5fd52bd01f735897c90d1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_in_partial_package_in_partial_package.return.False": {"doc_hash": "816ea598601a14ad825b90f4ecbb353f0da0474b8e8e533c9f59cd649c4392a2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_module_not_found_module_not_found.None_2": {"doc_hash": "1aabccf2e0a212c92430fbc82c90bb363442c70f91255b876fa037f4f3d482ee"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_skipping_module_skipping_module.None_4": {"doc_hash": "012bfd6bf310668af34b886bf28ec8cb72858cd313e2de383ee2eafb5ad6560f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_skipping_ancestor_skipping_ancestor.None_3": {"doc_hash": "f494c9cd212701decc00b462f62f508c86cdcd4b084f340a28bb30d8dc62919e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_log_configuration_log_configuration.for_path_type_paths_in_m.for_pth_in_paths_.manager_trace_s_": {"doc_hash": "6c6e8b8113c6d4d00afb8e5f5f984a62b1e295cc6f108dcecfd7dee32097cbe7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py__The_driver_dispatch._graph_we_ll_handle_it": {"doc_hash": "04498075bbe9518f204d2d9fe1d0fc010756b9f5e81e9de07f1543d8e640e158"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_dispatch.if_not_manager_use_fine_g_dispatch.return.graph": {"doc_hash": "95b6c9ab8553384a25fa1b07e5582c445e4f402a8e4ab259db011a86619075db"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_NodeInfo_NodeInfo.dumps.return._s_s_s_n_s_n": {"doc_hash": "7be2272e9d89d44d0df86129f0fd6fca0d6a859e8271119a0e7183d1bfb83e95"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_dump_graph_dump_graph.print_n_join_n": {"doc_hash": "eb07049d85f789933b6ec8c1300e4f0970b6a56006b9130fb21f4ad78946c4fa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_load_graph_load_graph._More_nodes_might_get_ad": {"doc_hash": "01e22f8dc05c49fedfa253bbcee52207cf93cdb6290a7ac0a59f1f0bcc4b7160"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_load_graph.for_st_in_new__load_graph.return.graph": {"doc_hash": "a28b7a74ef7e423e128fafe52529d02add96230bd9ee3dd2fdc91dc9132b5718"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_process_graph_process_graph.for_ascc_in_sccs_.None_6.else_.process_stale_scc_graph_": {"doc_hash": "912eb72293edce57268504dc619abd52e9ef0a1929bc58d1fe6283c93b59b587"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_process_graph.sccs_left_process_graph.if_sccs_left_.else_.manager_log_No_fresh_SCC": {"doc_hash": "100f230a5b7fee02645e489af0ee573e453e7ba1d43d0c35d3511906ec7f73c4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_order_ascc_order_ascc.return._s_for_ss_in_sccs_for_s_i": {"doc_hash": "bd76ecffdd1728fa422e0771360f9cdf3fb1ed8785f6d0fb03d13555d1cd044d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_process_fresh_modules_process_fresh_modules.manager_add_stats_process": {"doc_hash": "e329e5a5e2d49913c751094f7a475f2f25bf1e711cae07bbe2835e64077d604f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_process_stale_scc_process_stale_scc.None_6.graph_id_mark_as_recheck": {"doc_hash": "24a76905bbf4c0b5acd3ec807a2c5778a560f792567cc78fc0293c6521d78091"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_sorted_components_sorted_components.return.res": {"doc_hash": "f9b33d1a5bddfcff97f590235216be4e86403f216e9d2d5085799ae3eb86ae97"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_deps_filtered_strongly_connected_components._type_List_int_": {"doc_hash": "0b615bf803ffa912999c51229c8dbd6570036fe39d4dee19ea4afc67ff66e615"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_strongly_connected_components.dfs_strongly_connected_components.for_v_in_vertices_.if_v_not_in_index_.yield_from_dfs_v_": {"doc_hash": "85e9208ad0b0f12be21e57e02f009a795d8a9c44643ea0e3c89c20537e383ef1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker_TypeChecker._type_Plugin": {"doc_hash": "3742bc51aca89fca68f920a3685d1b34860fa1b230dee028ad5743daa7a461b2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.__init___TypeChecker.type_context.return.self_expr_checker_type_co": {"doc_hash": "556a8440a7cc22043091ef358c1a0a16981711b491644d550642abc4e101a6f8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.reset_TypeChecker.reset.None_4": {"doc_hash": "9345960e222cf65bbb692eaf4fc2156637074a4bf2fb1400f6582798e5675564"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_first_pass_TypeChecker.check_first_pass.with_state_strict_optiona.self_tscope_leave_": {"doc_hash": "1e58f620d0416ac7534045510458b04f3199137d4d9abfc5213bc21aaebe97de"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_second_pass_TypeChecker.check_second_pass.with_state_strict_optiona.return.True": {"doc_hash": "581d07c41619499a80fe8f7164fb26d1736373e6a934b7246a882d6d9b1f99f6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_partial_TypeChecker.check_top_level._TODO_Handle___all__": {"doc_hash": "3308b3759043ae7548c6523a533947838dc43e5098a2fbde99fdf074529c251c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.defer_node_TypeChecker.defer_node.self_deferred_nodes_appen": {"doc_hash": "17900044271f113c2bf6b37eaa2b69978f4312671ac39fb838dfd2f323deadaa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.handle_cannot_determine_type_TypeChecker.handle_cannot_determine_type.if_self_pass_num_self_l.else_.self_msg_cannot_determine": {"doc_hash": "8342e00aa699d5679174d2fb8396d2c7a8c13d5e34e96c007d11e459c8635286"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.accept_TypeChecker.visit_overloaded_func_def.with_self_tscope_function.self__visit_overloaded_fu": {"doc_hash": "7b38eac4812c856110b5659fac1a45df9bf53acdf99468f83f27dc18c76fad16"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker._visit_overloaded_func_def_TypeChecker._visit_overloaded_func_def.return.None": {"doc_hash": "7d362f2da6e92af89a01d61d987b4eefa4875447ec3ea3725ddddc171cc0adaf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_overlapping_overloads_TypeChecker.check_overlapping_overloads.is_descriptor_get.defn_info_and_defn_name_": {"doc_hash": "3099610fabfba3bac9f6a9be46d85c6fc27d78cdc0475a0c069a54a435a65abf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_overlapping_overloads.for_i_item_in_enumerate__TypeChecker.check_overlapping_overloads.for_i_item_in_enumerate_.if_impl_type_is_not_None_.if_not_is_subtype_no_prom.self_msg_overloaded_signa": {"doc_hash": "66c5ae4948cd33f30bcea3a076597c0cb97d9c8d77a5e103d1d3916b4e4b5b12"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker._Here_s_the_scoop_about__TypeChecker._get_generator_return_": {"doc_hash": "577df417054251ce3b1955d07565a66faf3e3325ff22cf3b42ab6a9a3e7ffddb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.is_generator_return_type_TypeChecker.is_generator_return_type.return.isinstance_typ_Instance_": {"doc_hash": "45b643e65cab59f968e58859d0e4063245fd6985949701bccbd16175d8596b76"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.is_async_generator_return_type_TypeChecker.is_async_generator_return_type.return.is_subtype_agt_typ_": {"doc_hash": "f8b0e02a1017f646cde3af663a3180db2026ca1810f4933d7c0bbe93f6228136"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.get_generator_yield_type_TypeChecker.get_generator_yield_type.if_isinstance_return_type.else_.return.AnyType_TypeOfAny_special": {"doc_hash": "502a44f6340b9fd0846fe0ad5c411a6e7cf60188794ea79ba0cf9388ff2759a7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.get_generator_receive_type_TypeChecker.get_generator_receive_type.if_isinstance_return_type.else_.return.NoneType_": {"doc_hash": "7b2537e2aaee71325c8b13180919c478ace3c6b914ac5e6fc4074d8efdbdcf04"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.get_coroutine_return_type_TypeChecker.visit_func_def.with_self_tscope_function.self__visit_func_def_defn": {"doc_hash": "d5f550d4d1116db7aa2abc139214aae0b79f39dd6f650bdb57074d6a42cc3c4a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker._visit_func_def_TypeChecker._visit_func_def.if_defn_original_def_.if_isinstance_defn_origin.else_.if_isinstance_orig_type_.else_.self_check_subtype_new_ty": {"doc_hash": "658e7877a79256ab82e952c85ca48d38b88991b16f38e98b42a7dc1f54b7467a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_func_item_TypeChecker.check_func_def": {"doc_hash": "381c137d87dfeb5f97f451772c187fa412a2890cc5d2ce992dbb68dc60f6bdad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_func_def._Type_check_a_function__TypeChecker.check_func_def.for_item_typ_in_expanded._Type_check_body_in_a_ne": {"doc_hash": "36194391fa7c4f49dcf0306bfbb49368f263feb33f626127878ee4b37fcd6ba6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_func_def.for_item_typ_in_expanded.None_1_TypeChecker.check_func_def.for_item_typ_in_expanded.self.binder_2.old_binder": {"doc_hash": "b9fda6406c90000df1ceff087cfe7a512730c016c970f0bfe94ba4d02ee110b8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_default_args_TypeChecker.is_reverse_op_method.if_self_options_python_ve.else_.return.method_name_in_nodes_reve": {"doc_hash": "0bace5b1979ed6bdff7efc26e4c9df44ba9579504b1d737085fd4ef12a1a9376"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_for_missing_annotations_TypeChecker.check_for_missing_annotations.if_show_untyped_and_self.if_fdef_type_is_None_and_.elif_isinstance_fdef_type.if_any_is_unannotated_any.self_fail_message_registr": {"doc_hash": "b655bb5ab080fbcc3a91742dc1a9a40fbe23e5e7096399304c9274d00ad5d7ce"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check___new___signature_TypeChecker.check___new___signature.if_not_isinstance_get_pro.else_.self_check_subtype_": {"doc_hash": "5326f6e888cc5d183174773b270a717bb929f895885a282251770ffca57b2c81"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.is_trivial_body_TypeChecker.is_trivial_body.return._isinstance_stmt_PassStm": {"doc_hash": "eb9600d1a05b41e1a69be68a17a83ca18c32d8443d771b772ef240deff79979e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_reverse_op_method_TypeChecker.check_reverse_op_method.self_check_overlapping_op": {"doc_hash": "8da758375177faf743098de25da0804e7d4c65af7030c11c4e58a02b58d45f04"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_overlapping_op_methods_TypeChecker.check_overlapping_op_methods.for_forward_item_in_union.if_isinstance_forward_ite.elif_not_isinstance_forwa.self_msg_forward_operator": {"doc_hash": "f3ac0e320679c51b7ebba7cc389c1e82ae8fa887b5fd83357423864efac9d623"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.is_unsafe_overlapping_op_TypeChecker.is_unsafe_overlapping_op.return.is_unsafe_overlapping_ove": {"doc_hash": "5ec017038da5440963ab2b9b48cad0e24bf558342432081ba84d9531cbd34548"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_inplace_operator_method_TypeChecker.check_inplace_operator_method.if_cls_has_readable_membe.if_fail_.self_msg_signatures_incom": {"doc_hash": "7de9cbe9c08fa55394b08afba0651b8d9c7a280b51605b542a3e798e21cc6623"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_getattr_method_TypeChecker.check_getattr_method.if_not_is_subtype_typ_me.self_msg_invalid_signatur": {"doc_hash": "ed10b2535e53f5051238aacebbad4cdeddd5bec3a45ef937e16d9ed5cfd867d3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_setattr_method_TypeChecker.check_setattr_method.if_not_is_subtype_typ_me.self_msg_invalid_signatur": {"doc_hash": "bf3fd35e9c1294ecf197a20542de2bd44f983fe716ab636b6842226e8908b964"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.expand_typevars_TypeChecker.expand_typevars.if_subst_and_not_self_opt.else_.return._defn_typ_": {"doc_hash": "54158e34f9d42b721d751833b352bb5bdfd7f158722bc12520e8dd7b0e1994e0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_method_override_TypeChecker.check_method_override.for_base_in_defn_info_mro.if_self_check_method_or_a.return": {"doc_hash": "eaf2177b3791ada31e86095313137bd0125786fc671fe17e8cbfbdbfa590af39"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_method_or_accessor_override_for_base_TypeChecker.check_method_or_accessor_override_for_base.return.False": {"doc_hash": "378022fa52e499152bb827440d6947cbd3e6bb6fa59c61554c92cc9609da210e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_method_override_for_base_with_name_TypeChecker.check_method_override_for_base_with_name.return.False": {"doc_hash": "492a640c7c9f8ab78787e916e7ba05163fa3d5b2f20b474b17188020811c4771"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.bind_and_map_method_TypeChecker.bind_and_map_method.return.cast_FunctionLike_map_ty": {"doc_hash": "9fd5cf2c34eb4a7b1362728a7ae1d30621b21046a804a0f6bab95a5763fb4a5e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.get_op_other_domain_TypeChecker.get_op_other_domain.if_isinstance_tp_Callabl.else_.assert_False_Need_to_ch": {"doc_hash": "c31d646cfcc2fe61637b6bb79c8e2d912f94d36ab646763e492efdadb216ec45"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_override_TypeChecker.check_override.if_is_private_name_.fail.False": {"doc_hash": "c664cba2b53edbca0ee34c5d9783c947b2dda7371d19327fafc42fb928d6fb42"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_override.if_fail__TypeChecker.check_override.if_fail_.if_op_method_wider_note_.self_note_Overloaded_ope": {"doc_hash": "f0412b987bc9435a7fca5c5a64837f1bcba68f7f76db96c330317f596c02d9b7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check__exit__return_type_TypeChecker.check__exit__return_type.if_all_isinstance_ret_exp.self_msg_incorrect__exit_": {"doc_hash": "3d964fb895f4b879a09cb707323d8334284d4c72469b087644abaad2ef4a4edf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.visit_class_def_TypeChecker.visit_class_def.if_typ_is_protocol_and_ty.self_check_protocol_varia": {"doc_hash": "f4688cc51aed845bf507207c33f33642600f9d23b94b879f4060ddb7d3615685"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_init_subclass_TypeChecker.check_init_subclass.for_base_in_defn_info_mro.break": {"doc_hash": "0bb5ba32d9c8c92c0f06beb3eb332406fda4f96ab42c4b9d002d4844d12798ca"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_protocol_variance_TypeChecker.check_protocol_variance.for_i_tvar_in_enumerate_.if_expected_tvar_varia.self_msg_bad_proto_varian": {"doc_hash": "f1b1630ebfb5c9c25de53ce910492eac29918c3b04e4b6c05b5937943cbcc02e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_multiple_inheritance_TypeChecker.check_multiple_inheritance.for_i_base_in_enumerate_.for_name_in_non_overridde.for_base2_in_mro_i_1_.if_name_in_base2_names_an.self_check_compatibility_": {"doc_hash": "c31e478cb9e871b733c45e3fd2fc0d3b32cb20c47cee2b3ba903c0d795fc9a1f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.determine_type_of_class_member_TypeChecker.determine_type_of_class_member.return.None": {"doc_hash": "c0a113bca58259c7ecb955ff9d4ecf355414786b48c77d4173f6f8899524e437"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_compatibility_TypeChecker.check_compatibility.if_not_ok_.self_msg_base_class_defin": {"doc_hash": "4b9799031a8f2df83db75ef42d7587938ea5ba4e3868380fa8a05aa365ea256e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.visit_import_from_TypeChecker.check_import.for_assign_in_node_assign.self_check_simple_assignm": {"doc_hash": "8e15673c30cb0c56e84ed5ddedb873337556f03efa85979bedc9582ed5b99f01"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.None_92_TypeChecker.should_report_unreachable_issues.return._self_options_warn_unreac": {"doc_hash": "f1c12286a8fa42d7a7b613af58a98e195d3db50b798976e75cdbac6c51414bcd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.is_raising_or_empty_TypeChecker.is_raising_or_empty.return.False": {"doc_hash": "c8f4d8a61ff8a107d47efa978b80b240c4ae33a1ecd6718d1355809c3be49760"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.visit_assignment_stmt_TypeChecker.visit_assignment_stmt.if_s_is_final_def_and_s_.self_fail_message_registr": {"doc_hash": "e8c78a04b270e84a1ea4a77a805c041ee9b0ec889ff098652c70e70315795220"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_assignment_TypeChecker.check_assignment.if_isinstance_lvalue_Tup.else_.if_inferred_.self_infer_variable_type_": {"doc_hash": "55a26b04135c26763627c395aa2fab876203f4e6c4f72f423f7bc86ccb4ead21"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker._type_operator_tuples_TypeChecker.try_infer_partial_generic_type_from_assignment.if_var_is_not_None_.if_isinstance_rvalue_type.elif_isinstance_rvalue_ty.del_partial_types_var_": {"doc_hash": "3e4412acfede87a9c17562883ea0c54527972acc963913082a40865cba187422"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_compatibility_all_supers_TypeChecker.check_compatibility_all_supers.return.False": {"doc_hash": "c8b8ddde3e4a6f84ded4b5a468f085fa1f79bf818e7702b6ef9da0df6c9e0c0e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_compatibility_super_TypeChecker.check_compatibility_super.return.True": {"doc_hash": "00e91a451f4f471ec8cd69f8be756de0b5f2c679fb1568daf84bf6c8462e5ec3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.lvalue_type_from_base_TypeChecker.lvalue_type_from_base.return.None_None": {"doc_hash": "1eb4654c29ea7ebc8cb69be361ce15e0365d80793679567b2a8dce7889382d27"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_compatibility_classvar_super_TypeChecker.check_compatibility_classvar_super.return.True": {"doc_hash": "ced40692d365b8fa0d997183a697ae9f13cf079b2ee10264c7606f6175f9dabb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_compatibility_final_super_TypeChecker.check_compatibility_final_super.return.True": {"doc_hash": "f1cf1eb659f6b898ce1f555bb0140a81aff7c3201861c5bfa8a183ad6a5d8db1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_if_final_var_override_writable_TypeChecker.enter_final_context.try_.finally_.self._is_final_def.old_ctx": {"doc_hash": "ed162ed9562c42efe838a4e6c82f587aabd81ad704dc05d26b0766a8c2be463f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_final_TypeChecker.check_final.for_lv_in_lvs_.if_isinstance_lv_RefExpr.if_lv_node_is_final_and_n.self_msg_cant_assign_to_f": {"doc_hash": "cd6fb474d8859cb85dcaae6095346418a82406ca0e10f2a79daa152f92f37484"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_assignment_to_multiple_lvalues_TypeChecker.check_assignment_to_multiple_lvalues.if_isinstance_rvalue_Tup.else_.self_check_multi_assignme": {"doc_hash": "8fb4e2846851d5f3b6494bb0aa131f860d70054924770fe3d6ab5e2649d379b1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_rvalue_count_in_assignment_TypeChecker.check_rvalue_count_in_assignment.return.True": {"doc_hash": "bc4e9f4ec2a9d01f961d032118a97cf1e7fcd0f446383072f6f8cc8bbe3e1e13"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_multi_assignment_TypeChecker.check_multi_assignment.None_1.else_.self_check_multi_assignme": {"doc_hash": "7da8535728ee632631a89cd8fffeb20d42ddc8dd4c4dbe678d4048a9fa858b80"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_multi_assignment_from_union_TypeChecker.check_multi_assignment_from_union.self.no_partial_types_3.False": {"doc_hash": "00a3c007ec663ef6653cafa46e9dd26dd12d654e59fa9ff682181d59cac62486"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.flatten_lvalues_TypeChecker.check_multi_assignment_from_tuple.if_self_check_rvalue_coun.for_lv_rv_type_in_zip_ri.self_check_assignment_lv_": {"doc_hash": "3cdc00634f7e22e742fb95ad4c93f745d49963111b3963779439576a12fec3d0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.lvalue_type_for_inference_TypeChecker.lvalue_type_for_inference._type_List_Type_": {"doc_hash": "e3a2d1b3ebcbb0c678b0d3f837cef1062cdd5134e9a4ba74009d3c81f8d2b7db"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.lvalue_type_for_inference.append_types_for_inference_TypeChecker.lvalue_type_for_inference.append_types_for_inference.for_lv_rv_type_in_zip_lv.if_sub_lvalue_type_and_no.else_index_lvalue.type_parameters_append_rv": {"doc_hash": "248039fa8c1b54356579f93222fad69ef16ec5b3a03e3dac4d12ac867641c839"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.lvalue_type_for_inference.append_types_for_inferenc_TypeChecker.lvalue_type_for_inference.return.TupleType_type_parameters": {"doc_hash": "f40822a270e456c57c0ba36a2c7b3dbf5055d4102cd02038cb2fc442d6afeb33"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.split_around_star_TypeChecker.split_around_star.return.left_star_right": {"doc_hash": "9dfa27ad7c3d8818b217453385f227feee94ff9bf2ca07848ecd385368bcc688"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.type_is_iterable_TypeChecker.check_multi_assignment_from_iterable.if_self_type_is_iterable_.else_.self_msg_type_not_iterabl": {"doc_hash": "b4f81f80820ad41220fcf9a6c5317f53a98b7f8d4a0378101abf462242500c86"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_lvalue_TypeChecker.check_lvalue.return.lvalue_type_index_lvalue": {"doc_hash": "b0b0e7b315faa79cf53e2c6f3ae73d87e26a6cdbec4778062b3f9ade0fbae7ab"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.is_definition_TypeChecker.is_definition.return.False": {"doc_hash": "8fb91c6f6e04c304c7639fbb9412c5ed03fece040b1b5db73ae8bc0312170b1b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.infer_variable_type_TypeChecker.infer_variable_type.if_isinstance_init_type_.else_.self_set_inferred_type_na": {"doc_hash": "ccead1dd5f9042c785ed34774d65958ee53e67424570e3f6aae61bbea036bbb6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.infer_partial_type_TypeChecker.infer_partial_type.return.True": {"doc_hash": "bf5846307bc8349e19b50f7629a92b9528bf15d0482a8ee8fd938ffaaa570d61"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.is_valid_defaultdict_partial_value_type_TypeChecker.is_valid_defaultdict_partial_value_type.return.False": {"doc_hash": "d01b3b5225cee308565c3efda1fcee7ded3e276e9375cfc6aaad66cb1aa781d7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.set_inferred_type_TypeChecker.set_inferred_type.if_var_and_not_self_curre.self_store_type_lvalue_t": {"doc_hash": "51a3f67d4fa0dba5ecf02d3d1854a9b230f14fe8c03b5663e71d941ec227e270"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.set_inference_error_fallback_type_TypeChecker.inference_error_fallback_type.return.erase_typevars_fallback_": {"doc_hash": "645b637f87077c9655b56e0a0622b95e6045d0b97be6a9b593bbab04ebe23e10"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_simple_assignment_TypeChecker.check_simple_assignment.if_self_is_stub_and_isins.else_.return.rvalue_type": {"doc_hash": "8089720172e2d802f3ccc84df55a537c43261fe690135080c62cb8b59233541b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_indexed_assignment_TypeChecker.check_indexed_assignment.self_expr_checker_check_m": {"doc_hash": "c49f991044a20f3875223ec2689bc46d612ce1dcb617cea1ef446dd73ab380cf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.try_infer_partial_type_from_indexed_assignment_TypeChecker.visit_return_stmt.self_binder_unreachable_": {"doc_hash": "a67c33fc688ba9736aa00504a712a4694d9e8da7dcb92cdb2d7c2711be4d9899"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_return_stmt_TypeChecker.check_return_stmt.if_defn_is_not_None_.if_s_expr_.else_.if_self_in_checked_functi.self_fail_message_registr": {"doc_hash": "30fb2b8fdab1546f0d5cab49b2cf2e0222dead60f7564e68703c355fdb56b9ac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.visit_if_stmt_TypeChecker.visit_while_stmt.self_accept_loop_if_stmt_": {"doc_hash": "8555b7eb079139ed39cd1a324486983ab7b2b45b9a575469b377aac64c3bc539"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.visit_operator_assignment_stmt_TypeChecker.visit_operator_assignment_stmt.self_check_final_s_": {"doc_hash": "f1462fb5c61d890f1bac7ee6251a653c09899892b2ea5f10c177501b0d35c19e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.visit_assert_stmt_TypeChecker.visit_raise_stmt.self_binder_unreachable_": {"doc_hash": "71bfa9d398614b51f579b8d1646f59fd598b43fa528ccbe10ff41a952c3efed1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.type_check_raise_TypeChecker.type_check_raise.self_check_subtype_typ_e": {"doc_hash": "d6f45c4420a9eed625844fadd6a320fd3ecd1cbbb678751e1fc11605d856c19b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.visit_try_stmt_TypeChecker.visit_try_stmt.if_s_finally_body_.if_not_self_binder_is_unr.self_accept_s_finally_bod": {"doc_hash": "7a75a8521d14a0dc3f04edc84d4fd4f555b417bee98ce0261a7355486b4a7963"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.visit_try_without_finally_TypeChecker.visit_try_without_finally.with_self_binder_frame_co.if_s_else_body_.self_accept_s_else_body_": {"doc_hash": "fcc32f9e9fb1e66ba3d3b318b16630fad01a1b43c9cfe229bc8165438f18c205"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_except_handler_test_TypeChecker.check_except_handler_test.return.make_simplified_union_all": {"doc_hash": "2076afddfdd633efe5e15b69d1ff13f0fce7cc8bc8527a58bf0ab61060bc1e01"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.get_types_from_except_handler_TypeChecker.get_types_from_except_handler.if_isinstance_typ_TupleT.else_.return._typ_": {"doc_hash": "3f67138f67b65a847853e3a3b33b31bb372faf3e40fccaf7b35b09add63f43de"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.visit_for_stmt_TypeChecker.visit_for_stmt.self_accept_loop_s_body_": {"doc_hash": "35ac2d55c697f2ab15e0d23c037a9071b38637bf0dc516c1e013083ee15dec53"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.analyze_async_iterable_item_type_TypeChecker.analyze_async_iterable_item_type.return.iterator_item_type": {"doc_hash": "af1156f308eb948f9c6b7e98e2c657882d3e200a5232ec5b5da5eb38e0d37035"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.analyze_iterable_item_type_TypeChecker.analyze_iterable_item_type.if_isinstance_iterable_T.else_.return.iterator_echk_check_meth": {"doc_hash": "72071c6d23caea43c6545c115ba8d1806ccf619e7d57bce36a94c72636959e13"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.analyze_container_item_type_TypeChecker.analyze_container_item_type.return.None": {"doc_hash": "50cfeb4ca9390faf6b8c36db00d74eefd85b1e8fe8c90b750ae2bcaac4e3a26d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.analyze_index_variables_TypeChecker.visit_del_stmt.if_isinstance_s_expr_Ind.else_.for_elt_in_flatten_s_expr.if_isinstance_elt_NameEx.self_binder_assign_type_e": {"doc_hash": "10d413d8c41cea7869a7db7939ac8d2ee790382caf64be1dc51fd659a34a0a57"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.visit_decorator_TypeChecker.visit_decorator.if_e_func_info_and_e_func.if_e_type_and_not_isinsta.self_fail_message_registr": {"doc_hash": "c02123f67a40ebb118fab6b72f75a0abaf6ae2a87a1eb2c7da1fdb2491671aab"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_for_untyped_decorator_TypeChecker.check_incompatible_property_override.if_not_e_var_is_settable_.for_base_in_e_func_info_m.if_isinstance_base_attr_.self_fail_message_registr": {"doc_hash": "8be61d774317f11592b3761fa0feec467be9bcbec65efdae236279d801b21e81"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.visit_with_stmt_TypeChecker.visit_with_stmt.if_exceptions_maybe_suppr.else_.self_accept_s_body_": {"doc_hash": "93de211df920a8af7a478b9ba3731636bbe11f9c72e8c0d9a03dbc6c8b1219f5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_untyped_after_decorator_TypeChecker.check_async_with_item.return.echk_check_awaitable_expr": {"doc_hash": "0e41e2e4b1bfd3fd1ffa6b8472283138a4931e2b85b9721c578eec41d8b96e9a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_with_item_TypeChecker.check_with_item.return.res": {"doc_hash": "ef68e1a2eb1ba19981a4ae4ad69fc0503f3968c0493754bf1b93138006a0acdf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.visit_print_stmt_TypeChecker.visit_continue_stmt.return.None": {"doc_hash": "1df27f28c377ad04423a36c19808c6512eb9ad4eca741253a28dd9ad0c34bb6e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.make_fake_typeinfo_TypeChecker.make_fake_typeinfo.return.cdef_info": {"doc_hash": "2c01cacc6002a3943bb8ccde4a3cd632ee05b07809e24c0857ae0b3b91ba455e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.intersect_instances_TypeChecker.intersect_instances.return.Instance_info_": {"doc_hash": "5bc1d086ea79ed01262d03095a639b4f0feac27c1142f5906bbdae365dfd5026"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.intersect_instance_callable_TypeChecker.intersect_instance_callable.return.Instance_info_": {"doc_hash": "3c03ff498231e61c1a0f85c7e37135cc631e6e571a4dfeb9c035f4e13e916e59"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.make_fake_callable_TypeChecker.make_fake_callable.return.self_intersect_instance_c": {"doc_hash": "0e654da48540c456876773220a46fbb4b35dd5e05b92d34ff51e6d02f3428b82"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.partition_by_callable_TypeChecker.partition_by_callable.if_unsound_partition_.else_.return._typ_typ_": {"doc_hash": "a072536aad7c2addebc573362a4f7144821d05bada26851dabaaf9ae2d65e538"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.conditional_callable_type_map_TypeChecker.conditional_callable_type_map.return.None_": {"doc_hash": "31c24f351758d729f863cb716efe3aa29beaff004837c127e35bffd4a35b0768"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.find_isinstance_check_TypeChecker.find_isinstance_check.return.new_if_map_new_else_map": {"doc_hash": "bd9bf559b767276af36a5f27e9feb205e9f6241039dc945eeec42acf0e0a15b2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.find_isinstance_check_helper.if_is_true_literal_node_.elif_isinstance_node_Com_TypeChecker.find_isinstance_check_helper.if_is_true_literal_node_.elif_isinstance_node_Ref.return.if_map_else_map": {"doc_hash": "dfa6fab67f2ce6555d7b3ad7fca538f76ac9684ee422118cbfe0b3dea8caa1c4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.find_isinstance_check_helper.if_is_true_literal_node_.elif_isinstance_node_OpE_TypeChecker.find_isinstance_check_helper.return._": {"doc_hash": "e2c76d94f63a1fc29cc03f6232a60ac39bad2364c3f9ca8586a1ec27505f6ec0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.propagate_up_typemap_info_TypeChecker.propagate_up_typemap_info.return.output_map": {"doc_hash": "4c2b335b22f6b574a711caea2c8b7012169c7da5c816b17f9c35a2caa3cbc84f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.refine_parent_types_TypeChecker.refine_parent_types._parent_lookup_chain_": {"doc_hash": "70214e9406825f6217cd4f5b1c13d30ad867e986092f49762ae572712ce7c709"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.refine_parent_types.while_True__TypeChecker.refine_parent_types.return.output": {"doc_hash": "8e0f7435c241a3cebed6180bcad83ba73194d5d4c9ba2a98d18d713ccee5d19f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.refine_identity_comparison_expression_TypeChecker.refine_identity_comparison_expression.None_21": {"doc_hash": "4aa667b6e215fcd8a2ec37f7defba36f6138bd32dcf30e07c0b65d199316003e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.refine_identity_comparison_expression._At_this_point_x_and__TypeChecker.refine_identity_comparison_expression.return.reduce_conditional_maps_p": {"doc_hash": "1c39289e33e5c093ef8b39921deb54efceeba01c5c6b1c0cad46e76e6dd03fee"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.refine_away_none_in_comparison_TypeChecker.None_99": {"doc_hash": "c5434bedac5c8d3499ff30ed87e800e3435ea3b337b25f87382e35bc0a0fe489"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_subtype_TypeChecker.check_subtype.return.False": {"doc_hash": "d70d370b47c99e6db24afe1e3630747f1c2972ced9b65ed197aeedbc5e411c64"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.contains_none_TypeChecker.should_suppress_optional_error.return.self_suppress_none_errors": {"doc_hash": "2e3025f7e7aef287ecc37bfff864d5ecc69a8cb6945f452619d50b70fdc645de"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.named_type_TypeChecker.named_type.return.Instance_node_any_type_": {"doc_hash": "8f79f4311fbbd4d8964a7be481e47dfe7137f7c50d64289c2befb3c59d3012ca"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.named_generic_type_TypeChecker.named_generic_type.return.Instance_info_args_": {"doc_hash": "68683c62e129f688fa09b050f17babfe40f1d4d9d7ecb808d1993a3fe5bf8019"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.lookup_typeinfo_TypeChecker.lookup.if_name_in_self_globals_.else_.raise_KeyError_Failed_lo": {"doc_hash": "dffc6bbcf3095f91b283d76f6ad7c1256e3bab02fa6778f9db9118c00ee95afc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.lookup_qualified_TypeChecker.lookup_qualified.if_not_in_name_.else_.if_last_in_n_names_.else_.raise_KeyError_msg_format": {"doc_hash": "f4847d7269f66bede7dc7190c3969324f558538c5ecc3a734ab9a5c6b8ed5f70"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.enter_partial_types_TypeChecker.enter_partial_types.if_not_self_current_node_.for_var_context_in_parti.if_allow_none.else_.if_var_type_.var.type.self_fixup_partial_type_v": {"doc_hash": "0184d01c49e063d300ffbdc874f79af8855ac6ee027b31706202d35ab58c7982"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.handle_partial_var_type_TypeChecker.handle_partial_var_type.if_typ_type_is_None_and_i.else_.return.self_fixup_partial_type_t": {"doc_hash": "cb7fc0433e027b272312f87633885bbba3602aab3a9fb3ca7326fc2378616e5e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.fixup_partial_type_TypeChecker.fixup_partial_type.if_typ_type_is_None_.else_.return.Instance_": {"doc_hash": "789f889f8ca172fc0ec17114fba193d267a50306ee9fe564aeda666867f9714f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.is_defined_in_base_class_TypeChecker.find_partial_types.return.None": {"doc_hash": "1b87da294a3e355b81e999ba6bab71a0242a1442867893e12901e800b1c1490c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.find_partial_types_in_all_scopes_TypeChecker.find_partial_types_in_all_scopes.return.False_False_None": {"doc_hash": "5ab41273a216aa6cfb316afd3564b4fe22499fdb6063ef559662bfd334bc3189"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.temp_node_TypeChecker.note.self_msg_note_msg_contex": {"doc_hash": "d45632d48ce64ea7f5f9f760073b35384a005e207287ecd8b7ce24ea066cdb42"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.iterable_item_type_TypeChecker.push_type_map.if_type_map_is_None_.else_.for_expr_type_in_type_ma.self_binder_put_expr_typ": {"doc_hash": "6e21ae38e3b192f5f28093e9817e31b9529e39b9b179076484dc2ed986371961"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.infer_issubclass_maps_TypeChecker.infer_issubclass_maps.return.yes_map_no_map": {"doc_hash": "93d5b09473e67e49f4f86bdde6bfc8715c765349462b34b5226ca7d801af4864"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.conditional_type_map_with_intersection_TypeChecker.is_writable_attribute.if_isinstance_node_Var_.else_.return.False": {"doc_hash": "bbc29706bf6f117776cde8aceca1b0c687ef4bc76fe9963d7266f4c581863334"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_conditional_type_map_conditional_type_map.if_proposed_type_ranges_.else_.return._": {"doc_hash": "dc5ed548aee1b17ef46045b1955e0509344f8697bf37b509144c420ddd853281"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_gen_unique_name_is_false_literal.return._refers_to_fullname_n_b": {"doc_hash": "b4d0e0d039f32e3e843e8f444030572245f79bee16edd169266e377327a082eb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_is_literal_enum_is_literal_not_implemented.return.isinstance_n_NameExpr_a": {"doc_hash": "2312be4741c67dc78136c92cf6f4e480018dca1f5c83d6f6c4b12ec2da746a4c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_builtin_item_type_builtin_item_type.return.None": {"doc_hash": "ae3183a3e8fbed6159212f2193a19c8f75537a98540a653db7252888e57325f1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_and_conditional_maps_and_conditional_maps.return.result": {"doc_hash": "f57f69b996833cae1c714c01ab12421c69ddec7f9599118efc717db90adf77d3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_or_conditional_maps_or_conditional_maps.return.result": {"doc_hash": "513beda59f37ab1ed5d68e322a548bbbcbb01412e9744ae1c762109cd5736581"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_reduce_conditional_maps_reduce_conditional_maps.if_len_type_maps_0_.else_.return.final_if_map_final_else_": {"doc_hash": "a84c8943ef7b3fcf73a391d4751011acd895a95193257fa44f50af62807b1f4e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_convert_to_typetype_convert_to_typetype.return.converted_type_map": {"doc_hash": "d6e961127d29f52866749c009aa012a7645a8b593804cba2987dcdf329780e97"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_flatten_flatten_types.if_isinstance_t_TupleTyp.else_.return._t_": {"doc_hash": "acd78261286801262ba71818354d1979259df8e71fe883ef69b78c7e2e33bba4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_get_isinstance_type_get_isinstance_type.return.types": {"doc_hash": "4183b99335635f40f0d9d137d652132e27749375801cde2b7a96de3a3d345ee1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_expand_func_are_argument_counts_overlapping.return.min_args_max_args": {"doc_hash": "e18f8363f150c36cfab9927e975d6ce84e7dffd977ebbf2404d895907fd9b8ba"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_is_unsafe_overlapping_overload_signatures_is_unsafe_overlapping_overload_signatures.return._is_callable_compatible_s": {"doc_hash": "54d16cab3f5368d503f1a217af3e55518c2540aa1521b6bc58b294a86302544a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_detach_callable_detach_callable.return.out": {"doc_hash": "e13840da272b0bb62204d3df25fee5220d8fb57bc06ebef55b5cb650a906c34a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_overload_can_never_match_overload_can_never_match.return.is_callable_compatible_ex": {"doc_hash": "3db53b388830ea6ec6ad7501f86e9ee37dd31a54fa5c4e18cc3ffbaf20eeae7f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_is_more_general_arg_prefix_is_more_general_arg_prefix.return.False": {"doc_hash": "3e205184e5b1a6b458d511084cb2ea12543a162812086a070e2f70a5ebef35ba"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_is_same_arg_prefix_infer_operator_assignment_method.return.False_method": {"doc_hash": "e34b8239089e7c96874f8e634b34d3c58ab2fcba0fccd181132b14fab751801d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_is_valid_inferred_type_is_valid_inferred_type.return.not_typ_accept_NothingSee": {"doc_hash": "7b3d2ed21c833cc875cdda4a16b74c01124687e3961bf536c93e75b3b623f823"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_NothingSeeker_is_node_static.return.None": {"doc_hash": "cec30e956db0b765ac6323868cac85303ff56d797063cfac2d70050ffe80a354"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_CheckerScope_TValue.TypeVar_TValue_": {"doc_hash": "cc02b7c5001e9833f97d5615e9ba9d86a52f51014084bb0af3a4d9152a215ac0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_DisjointDict_DisjointDict.__init__._type_Dict_int_Set_TVa": {"doc_hash": "596cb06a102618231ba5c4592cfe63e92930dbf86eedb1869bf6e22aeb6e13fa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_DisjointDict.add_mapping_DisjointDict.add_mapping.for_subtree_root_in_subtr.root_values_update_self__": {"doc_hash": "f214fe50ef3a8fec64877200a3091d701cacdcbd9ef902d3c4d89fbf37fa3b58"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_DisjointDict.items_DisjointDict.items.return.output": {"doc_hash": "547df070e64f480f0824e4df990ad423aa05be4322f7b3e9379501e2f396de3e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_DisjointDict._lookup_or_make_root_id_DisjointDict._lookup_root_id.return.i": {"doc_hash": "57a932dbeac12d0c9b6631b1186148d7892efcd1d37ed4cb5939a8a3ca8bd503"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_group_comparison_operands_group_comparison_operands._type_Set_Key_": {"doc_hash": "4dfcf0fe4ba6d49bb1780acd889c80da95292ae249974816464828d736bc3e23"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_group_comparison_operands.for_i_operator_left_ex_group_comparison_operands.return.simplified_operator_list": {"doc_hash": "6b02ffd92470c7bcc268767f6f62bbbb16ee0e136419d0dd49b1d3039fdc357f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_is_typed_callable_is_untyped_decorator.return.True": {"doc_hash": "27cbeaac271e07852472c6daeb6921293633250c6a193659d4571d3d42d4c179"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_is_static_": {"doc_hash": "15fdad024175fd8081c44200407a9d542e02f110c729a55d88feab158e7f64f2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py__Expression_type_checke_from_mypy_plugin_import_": {"doc_hash": "f7e0ab7ff7c1950092fe0ddff0d90ee96de4fafb49c5ce671ec986f13b12dca7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_from_mypy_typeops_import__TooManyUnions._Indicates_that_we_need": {"doc_hash": "5737bd205a2e9ffaac4571e1442451dd63725cf483899194b2a1126cdb2a3fab"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_extract_refexpr_names_Finished._Raised_if_we_can_termi": {"doc_hash": "244b5bae4a56888a316afe9a587332af3f21d0ad81d777025ea69581e6645935"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker_ExpressionChecker.visit_name_expr.return.self_narrow_type_from_bin": {"doc_hash": "0ea5ae4bb19647e814d68079c115e7c4454035832c35bbc2780be4c75c4819a7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.analyze_ref_expr_ExpressionChecker.analyze_ref_expr.return.result": {"doc_hash": "1fa48118ff68c7f7652ea9e2f9a27a9673f496ef45613f63f839207fb1e091b6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.analyze_var_ref_ExpressionChecker.analyze_var_ref.if_var_type_.else_.return.AnyType_TypeOfAny_special": {"doc_hash": "9f649a1580c877983919eb167d01290701e044683c40f2b592d59994d00ad1aa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_call_expr_ExpressionChecker.visit_call_expr.return.self_visit_call_expr_inne": {"doc_hash": "f8f5230f895b142e9f8814b5f16ae2c51043eb597178ac1a4c7e34e1270e18f2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_call_expr_inner_ExpressionChecker.visit_call_expr_inner.fullname.None": {"doc_hash": "a31380b027e0ef4cc92b887e3dd74ff44620ec509675d628f47250ff3bc5c99d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_str_format_call_ExpressionChecker.check_str_format_call.if_format_value_is_not_No.self_strfrm_checker_check": {"doc_hash": "480478ee0caa15421ae935a520a2264c9118ce3bdec0ebc6186a3483997c5e91"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.method_fullname_ExpressionChecker.method_fullname.if_type_name_is_not_None_.else_.return.None": {"doc_hash": "6ed99ab0c932c4a0da1071eba64a603189a496bb5d34598f022d88be939661d3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.always_returns_none_ExpressionChecker.always_returns_none.return.False": {"doc_hash": "429cfd604d08797c6ad6a57dd1cd066f4ae4e06bc153eead506d727cf01a6e08"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.defn_returns_none_ExpressionChecker.defn_returns_none.return.False": {"doc_hash": "072b320ad2d226007ae9178d848e129f45fab85d385ee53dca27730f04954b5b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_runtime_protocol_test_ExpressionChecker.check_protocol_issubclass.for_expr_in_mypy_checker_.if_isinstance_tp_Callab.if_attr_members_.self_chk_msg_report_non_m": {"doc_hash": "3c01c7468b6ccb70a2263ff0ace68c468c24569f4da23d8416eb80ad3e5ced8b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_typeddict_call_ExpressionChecker.check_typeddict_call.return.AnyType_TypeOfAny_from_er": {"doc_hash": "f2a17fb36c1ca9f7b309736a7b4e036e4f5c13a0f2c05191b4f361b41601920c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.validate_typeddict_kwargs_ExpressionChecker.validate_typeddict_kwargs.return.OrderedDict_zip_item_name": {"doc_hash": "2ae452cec8d7e75d7245c07c7beb1e4f940489a95286c095847f4b7188e41e2e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.match_typeddict_call_with_dict_ExpressionChecker.check_typeddict_call_with_dict.if_validated_kwargs_is_no.else_.return.AnyType_TypeOfAny_from_er": {"doc_hash": "fc64ccf4f1e232154df123536a635502343264af0d46b94c506baec0a1047cd5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_typeddict_call_with_kwargs_ExpressionChecker.check_typeddict_call_with_kwargs.return.callee": {"doc_hash": "4d7d5d7e9a78c056d1cc05d5c7fad240e57f0eaef0c7433c773f4c9a43f69a53"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.get_partial_self_var_ExpressionChecker.get_partial_self_var.return.None": {"doc_hash": "6ebdb6c4d2a5a7ddb80be1e09e24acc4e1daeb152ad75ce0565664ed760c7657"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker._Types_and_methods_that__ExpressionChecker.None_11": {"doc_hash": "801663cf51ba4a2f7b43ab38c82d91356307fab28036975a47fcc12e6b4b5feb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.try_infer_partial_type_ExpressionChecker.get_partial_var.return.var_partial_types": {"doc_hash": "699f31bedb6cb8be87181b8abd220418edbb761932959b7101ec2f3217c0c80d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.try_infer_partial_value_type_from_call_ExpressionChecker.try_infer_partial_value_type_from_call.return.None": {"doc_hash": "8a088514f6a12068745643b0905f757dccee56d50fa6a76b778539125b51dd16"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.apply_function_plugin_ExpressionChecker.apply_function_plugin.if_object_type_is_None_.else_.return.method_callback_": {"doc_hash": "52c88b8de6f518822857427572d5b6a3c50252f5654d3e5f506d0c4ecace885a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.apply_signature_hook_ExpressionChecker.apply_signature_hook.if_isinstance_callee_Cal.else_.return.Overloaded_items_": {"doc_hash": "5011fd4dfc61c32a02d1ac4031065e37996a13600dbec459ec4dbb8bc6349a0b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.apply_function_signature_hook_ExpressionChecker.apply_function_signature_hook.return.self_apply_signature_hook": {"doc_hash": "76b22b2e704a7888f98515198861e4db2e7efb6a1172a397682e53a20902b9d8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.apply_method_signature_hook_ExpressionChecker.apply_method_signature_hook.return.self_apply_signature_hook": {"doc_hash": "dcd4357946881bf0736e48e9efd1c1b3fa5d541b6602d4912a1d2f76174c2839"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.transform_callee_type_ExpressionChecker.transform_callee_type.return.callee": {"doc_hash": "91a6055e8ca02a0179dc2e603740d4c1fff9dec40156cc59e823e1e3c967d7ff"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_call_expr_with_callee_type_ExpressionChecker.check_call_expr_with_callee_type.return.self_check_call_callee_ty": {"doc_hash": "d87211e0cbf8312eb96ab407fca877823af7d779de0f42fe22de216dc0a8e891"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_union_call_expr_ExpressionChecker.check_union_call_expr.return.make_simplified_union_res": {"doc_hash": "a77c955e2f6ece457ff898122bb770a3a9d49ae811f630ed158b05964e6f1909"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_call_ExpressionChecker.check_call.callee.get_proper_type_callee_": {"doc_hash": "260fa7f68dd4fbfd7fb1cd685af91e536135e5aa35680d59814c1eb080d00f5c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_call.if_isinstance_callee_Cal_ExpressionChecker.check_call.if_isinstance_callee_Cal.else_.return.self_msg_not_callable_cal": {"doc_hash": "e265773fc36a27fa044a3fc7fa894cd5867ecae0848851959ec51f9fe64140d1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_callable_call_ExpressionChecker.check_callable_call.return.callee_ret_type_callee": {"doc_hash": "9813e82c81c10522cf20408d8175dd8a6e1ef7ec001a24093d1fb7972edd640b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.analyze_type_type_callee_ExpressionChecker.analyze_type_type_callee.return.AnyType_TypeOfAny_from_er": {"doc_hash": "320cfe50082d52d779ff54065897dd85e7b6044190889b4e379d4d459b70cee5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.infer_arg_types_in_empty_context_ExpressionChecker.infer_arg_types_in_context.return.cast_List_Type_res_": {"doc_hash": "2eed47144c59f26200c0d9e1b738ef29ede064fed11fc55868acbc1e8c20022f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.infer_function_type_arguments_using_context_ExpressionChecker.infer_function_type_arguments_using_context.args.infer_type_arguments_call": {"doc_hash": "faef62d28f1b7c8c3157925512c247bcafc87e19c83964d7d98bfed339dde7dd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.infer_function_type_arguments_using_context._Only_substitute_non_Uni_ExpressionChecker.infer_function_type_arguments_using_context.return.self_apply_generic_argume": {"doc_hash": "2c778e01a15b2b731adf6b165349320b9e8cedd98fc473ee7f17fd8e5fb8cffb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.infer_function_type_arguments_ExpressionChecker.infer_function_type_arguments.return.self_apply_inferred_argum": {"doc_hash": "b4f57f7427ff07f71ca632f59e95769ac3c968cc1e8b3c5d0ab99bbf7fe70bbd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.infer_function_type_arguments_pass2_ExpressionChecker.infer_function_type_arguments_pass2.return.callee_type_inferred_arg": {"doc_hash": "ca7e7512b390f5adc24d9adb540e68d7eb4a83bcafdc4916cf5814e5f79c02b8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.get_arg_infer_passes_ExpressionChecker.get_arg_infer_passes.return.res": {"doc_hash": "2bc2b12044088d5dcbef51c86ed007d398c235475f8c6421c98fc07c08e75628"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.apply_inferred_arguments_ExpressionChecker.apply_inferred_arguments.return.self_apply_generic_argume": {"doc_hash": "dc0cbc5117595666dfe739b59a7f3e1006dbfdde6f8b0ae8d1778d6432b12bcc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_argument_count_ExpressionChecker.check_argument_count.return.ok": {"doc_hash": "434ada8be54fe55a61ab84bc5cbc82d527a4be980e1a92b91279970cd1152f6f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_for_extra_actual_arguments_ExpressionChecker.check_for_extra_actual_arguments.return.ok_is_unexpected_arg_err": {"doc_hash": "27b30f1f07e4d1d6b918797fe070b978a9f925f9b881cbf9361d5014d96bd885"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_argument_types_ExpressionChecker.check_argument_types.for_i_actuals_in_enumera.for_actual_in_actuals_.check_arg_expanded_actual": {"doc_hash": "78363b51d3ee4a3b7ec751df1c86df5c6200ef43b3888ea6f4596ba4302fb890"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_arg_ExpressionChecker.check_arg.if_isinstance_caller_type.elif_not_is_subtype_calle.messages_incompatible_arg": {"doc_hash": "300b7cb893b53f47d3e45d8184605c6d081bf58bd8d050120b809781ded71355"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_overload_call_ExpressionChecker.check_overload_call.None_18": {"doc_hash": "c490115bd03a3ed2682e021b2b003664dce6f2cb4f148756dcd7a5ce82452341"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_overload_call._Neither_alterna_ExpressionChecker.check_overload_call.return.result": {"doc_hash": "b8c85a5004af6f259aadc895abba58270e663a0f661cd353f469f8a524b7ed0b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.plausible_overload_call_targets_ExpressionChecker.plausible_overload_call_targets.return.star_matches_matches": {"doc_hash": "b86820b482b420401f24fce188aa3caff44cee2517e0035c16ec795e98906061"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.infer_overload_return_type_ExpressionChecker.infer_overload_return_type.if_len_matches_0_.else_.return.return_types_0_inferred": {"doc_hash": "e418bd8ee3bcf1f855e4a604188783e3c71087c60b39b9dbd87cd5355a5f905e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.overload_erased_call_targets_ExpressionChecker.overload_erased_call_targets.return.matches": {"doc_hash": "ffe57a24e647d2ebc4ccf95a260a5a6a2326ebf9f8328ad258a409a647f0cb16"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.union_overload_result_ExpressionChecker.union_overload_result.return.result": {"doc_hash": "a44de68669c695e6104365e772dfe89d24454dd0378cf1b18f013273a6de2ec8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.real_union_ExpressionChecker.type_overrides_set.try_.finally_.for_expr_in_exprs_.del_self_type_overrides_e": {"doc_hash": "5618a1027a2b47d531609d6aec876f37e8e9059a5575bc0a66b685ed986046e6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.combine_function_signatures_ExpressionChecker.combine_function_signatures.return.callables_0_copy_modifie": {"doc_hash": "41a67123b2505ed0f883850124536f0ed2a0d6f09c087ab769d0f0901954deb6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.erased_signature_similarity_ExpressionChecker.erased_signature_similarity.try_.except_Finished_.return.False": {"doc_hash": "bf0acbaaaf62b4afaf3241366b5577f777170daf6b5bc8ec586d40f9d38aecab"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.apply_generic_arguments_ExpressionChecker.check_any_type_call.if_isinstance_callee_Any.else_.return.AnyType_TypeOfAny_special": {"doc_hash": "debc79f9b0866f6d0f95e9179b94ffdc42796da2beede5ce254c49a8f3bb3ffe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_union_call_ExpressionChecker.visit_member_expr.return.self_narrow_type_from_bin": {"doc_hash": "f89e4437d3da8d476adc0413d4a6c3f17760d3ef1a30321bf4a166f143ecdf16"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.analyze_ordinary_member_access_ExpressionChecker.analyze_ordinary_member_access.if_e_kind_is_not_None_.else_.return.member_type": {"doc_hash": "864ce97201d23fb3d6a15f3b6c0118d69050246c4b2dcc6f9dcc35570c7c1e52"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.analyze_external_member_access_ExpressionChecker.is_literal_context.return.is_literal_type_like_self": {"doc_hash": "b08e13cd728cab17f83b96990afc9309f588c387c57046286bc720c3e7bcce55"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.infer_literal_expr_type_ExpressionChecker.infer_literal_expr_type.if_self_is_literal_contex.else_.return.typ_copy_modified_last_kn": {"doc_hash": "dadc4ac0470e7f52856074fa5e1a7098e9e54f1e684f85f1cf3a341b057c90da"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.concat_tuples_ExpressionChecker.visit_complex_expr.return.self_named_type_builtins": {"doc_hash": "b683c454859ef8f00d988949f91ed839a71cb6d41296efb099ff8454c36690a2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_ellipsis_ExpressionChecker.visit_ellipsis.if_self_chk_options_pytho.else_.return.self_named_type_builtins": {"doc_hash": "c573d998b660a9c87006e10886378b605ad30fec92809d5c965bf59102eb3a66"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_op_expr_ExpressionChecker.visit_op_expr.if_e_op_in_nodes_op_metho.else_.raise_RuntimeError_Unkno": {"doc_hash": "990fa5dd10cde19a181ead0de1559cc807e069382d7c64e90d6550b8f8efe478"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_comparison_expr_ExpressionChecker.visit_comparison_expr.return.result": {"doc_hash": "a85e6300023f30f06186ce14509c20335b99c5e35b870d20275dc03aa19a08dc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.find_partial_type_ref_fast_path_ExpressionChecker.find_partial_type_ref_fast_path.return.None": {"doc_hash": "7439f9b6943da473c57c05b9817fc6ec4d684283e67b51f6b9684b88bae4ff9d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.dangerous_comparison_ExpressionChecker.dangerous_comparison.return.not_is_overlapping_types_": {"doc_hash": "a3d037a764f4b8cf5f20b34fd345dc07bbb433631df013794f54ac989ff46348"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.get_operator_method_ExpressionChecker.check_method_call_by_name.return.self_check_method_call_": {"doc_hash": "80f796cd53ee27bd47814dd84512ff1a139a2f5d9cc45bf40b478ab8f43cf630"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_union_method_call_by_name_ExpressionChecker.check_union_method_call_by_name.return.make_simplified_union_res": {"doc_hash": "ee707c79548c84932a2db3846fd8e8340b655cc7cc29ef3912e3191c9fcd060b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_method_call_ExpressionChecker.check_method_call.return.self_check_call_method_ty": {"doc_hash": "8495f38c6c565c1fff9ec85beb65f4ff48ce4b0f03945fbf1b333a3bf83ab937"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_op_reversible_ExpressionChecker.check_op_reversible.lookup_operator.if_local_errors_is_errors.else_.return.member": {"doc_hash": "ee9220efe50a7e21fde52a499dda0befd1985102d6bbf55a770f835e0f9a0b93"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_op_reversible.lookup_definer_ExpressionChecker.check_op_reversible.lookup_definer.return.None": {"doc_hash": "1cb21729abc8e44fddc3f25ee1c58e2048a19f3302dc587bec1208cf876c59b3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_op_reversible.left_type_ExpressionChecker.check_op_reversible.is_python_2.self_chk_options_python_v": {"doc_hash": "4fe5b83600800d738952dc9483f97b95bd6477e42d08f03f86054be4b63fa0e7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_op_reversible.if_is_python_2_and_op_nam_ExpressionChecker.check_op_reversible.if_len_results_1_.else_.return.result": {"doc_hash": "1e4cc525d18c1317498ae7f5b5b3df242e8a1973acdf9ea9eb31f50cd648984c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_op_ExpressionChecker.check_op.if_allow_reverse_.else_.return.self_check_method_call_by": {"doc_hash": "e73da7a38a70db43a11df37480b8561d92179db24efa9afc7341dc8cc2f6face"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.get_reverse_op_method_ExpressionChecker.check_boolean_op.if_isinstance_restricted_.else_.return.make_simplified_union_re": {"doc_hash": "4883e79d2d724d590168cfaedb92f3fa8f91f1a45c8c3a42dabcc709c86f6b56"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_list_multiply_ExpressionChecker.check_list_multiply.return.result": {"doc_hash": "e1094959f465e45093a314fbbe157f34e4321973f306e93639b46f426d84f303"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_assignment_expr_ExpressionChecker.visit_index_expr_helper.return.self_visit_index_with_typ": {"doc_hash": "5c276517dd77ae36184d0cacf6fbddecdc582d1c7af9ac4b62b6f7b83bc65ba9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_index_with_type_ExpressionChecker.visit_index_with_type.if_isinstance_left_type_.else_.return.result": {"doc_hash": "337eff389e62b9cb7d630c45083a04463bdfbc7fe2f12c7b9b96066707bb8669"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_tuple_slice_helper_ExpressionChecker.visit_tuple_slice_helper.return.make_simplified_union_ite": {"doc_hash": "7072347d33a3a10ac7a34c177c28084403b2fbed0912203b39188c3cfbe406dd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.try_getting_int_literals_ExpressionChecker.try_getting_int_literals.return.None": {"doc_hash": "7fe11eb7062b741ae98fda35e343ab2099ffdb2b3bf29935d2d70fad8ea01974"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.nonliteral_tuple_index_helper_ExpressionChecker.nonliteral_tuple_index_helper.if_not_self_chk_check_sub.else_.if_isinstance_index_Slic.else_.return.union": {"doc_hash": "acaa55af99b7e91306b2f886aa506edae8be24a8fd5f9c2a4da934711406396d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_typeddict_index_expr_ExpressionChecker.visit_typeddict_index_expr.return.make_simplified_union_val": {"doc_hash": "ab7e1c71b2be2414ee591241d997883aaec3be6cedd5ef234dcf8db7f4169d69"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_enum_index_expr_ExpressionChecker.visit_enum_index_expr.return.Instance_enum_type_": {"doc_hash": "4825af6f20224c632a9f968f35e2c390a96de97df8d2f5a1b752a736cafbd563"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_cast_expr_ExpressionChecker.visit_cast_expr.return.target_type": {"doc_hash": "e72e854de7ad9e44f162658c535519907765aefa69616ea6accb73d758e426a3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_reveal_expr_ExpressionChecker.visit_reveal_expr.if_expr_kind_REVEAL_TY.else_.return.NoneType_": {"doc_hash": "5e3f79a4672cb60a1fa38de68d9267f4448c5410b79cc77b64db557c6327f10d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_type_application_ExpressionChecker.visit_type_application.return.AnyType_TypeOfAny_special": {"doc_hash": "d0137d49f0a472af443541696c9ae740101493e34af141cd8265a7bc9748e250"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_type_alias_expr_ExpressionChecker.visit_type_alias_expr.return.self_alias_type_in_runtim": {"doc_hash": "b2fd8162d3e77472576b0387e8d869b7c01b3caca84895c13d8f946d2f73ab9a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.alias_type_in_runtime_context_ExpressionChecker.alias_type_in_runtime_context.if_isinstance_item_Insta.else_.return.self_named_type_builtins": {"doc_hash": "005ff6ca63d604714496db2afe2d22debf3c3c392914b8eacc84c47532a7e8b7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.apply_type_arguments_to_callable_ExpressionChecker.apply_type_arguments_to_callable.return.AnyType_TypeOfAny_special": {"doc_hash": "1781c1e92a6c962be9dcabcaa114c553b737a51449ce57012e352b4f1bfa45bc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_list_expr_ExpressionChecker.fast_container_type.return.self_chk_named_generic_ty": {"doc_hash": "74a8c4ac34aa6823ac7c1fbec3d19486d15f836ad4ec6d80a392b9253fb3c6cb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_lst_expr_ExpressionChecker.check_lst_expr.return.remove_instance_last_know": {"doc_hash": "36914e0c2cabda3fb077635281460d22d5d62a8ada60f9a39badbb1b18b2ee94"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_tuple_expr_ExpressionChecker.visit_tuple_expr.return.TupleType_items_self_chk": {"doc_hash": "014214ed2b5084fe7eb6056eb0db9d71e85b0379cbc80bd38bcfc6a2d48ea21f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.fast_dict_type_ExpressionChecker.fast_dict_type.return.self_chk_named_generic_ty": {"doc_hash": "a46c00fedfc679cca66cdbb4b3a834c7413e1a61ff72d50b60148da7eb45e429"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_dict_expr_ExpressionChecker.visit_dict_expr.return.rv": {"doc_hash": "1a9b1487667c98f7c28723d4e0b08b1805924642b74ef349c8cdbbf43b4b7f95"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.find_typeddict_context_ExpressionChecker.find_typeddict_context.return.None": {"doc_hash": "53355dff3a91d4ed9fc6ab1323c33d61ac6fb5f1329f64a1ff89785f46c831cc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_lambda_expr_ExpressionChecker.visit_lambda_expr.if_not_inferred_type_.else_.return.replace_callable_return_t": {"doc_hash": "8444f357ef08034afab262a4c6fac86f854faec82525651c15d5e1dea0a226e3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.infer_lambda_type_using_context_ExpressionChecker.infer_lambda_type_using_context.return.callable_ctx_callable_ct": {"doc_hash": "e4d7a8afdefd9ddc54803c1bb61c4272822e61ead9851acd60ea57d569ea72e8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_super_expr_ExpressionChecker.visit_super_expr.assert_False_unreachabl": {"doc_hash": "7ec1a35860948923af1965c07b09522e3765dba1e1abfb2f875edb78117a07bf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker._super_arg_types_ExpressionChecker._super_arg_types.instance_type.get_proper_type_instance_": {"doc_hash": "f41a036790819c73ddaed10204e27020db6e5de61b973121a82aee88e5a9653e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker._super_arg_types.if_isinstance_instance_ty_ExpressionChecker._super_arg_types.return.type_type_instance_type": {"doc_hash": "9af567d4c86f67cb28102d319c6d15ef45d09b7f7ab782c67a563d4c17950068"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_slice_expr_ExpressionChecker.visit_set_comprehension.return.self_check_generator_or_c": {"doc_hash": "2ccd2f5513389e5f8e1523295c710ac0c609deaeb1367d28cbbcafe63c6fa69e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_generator_expr_ExpressionChecker.visit_generator_expr.return.self_check_generator_or_c": {"doc_hash": "19a649332ec39b15cdd3059fe2ae470fe852eee8660ffd6dfdf917399e23b9a9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_generator_or_comprehension_ExpressionChecker.check_generator_or_comprehension.with_self_chk_binder_fram.return.self_check_call_construct": {"doc_hash": "a0d78aa2a5b8797a513078b48497575b94656114ac08bf4b555274eb693bd62b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_dictionary_comprehension_ExpressionChecker.visit_dictionary_comprehension.with_self_chk_binder_fram.return.self_check_call_construct": {"doc_hash": "776b00b56c3dd69406870cf4f7bfd91d48b55a12e977f191a3fa293bb4684320"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_for_comp_ExpressionChecker.check_for_comp.for_index_sequence_cond.for_condition_in_conditio.if_codes_REDUNDANT_EXPR_i.if_true_map_is_None_.elif_false_map_is_None_.self_msg_redundant_condit": {"doc_hash": "e2296e5127e948cca46ed69552df5c4ec01cc0526751ffbae0386bd333b6fc17"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_conditional_expr_ExpressionChecker.visit_conditional_expr.return.res": {"doc_hash": "c9257d554432622c26035825d85315a75fb498c9a56eca59c9fba8409b1bcfd4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.analyze_cond_branch_ExpressionChecker.None_14": {"doc_hash": "fce75a4e81fc3326f16a9f5b5da9054c431bf4ca6a46c7d65a7b04686d014381"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.accept_ExpressionChecker.accept.if_not_self_chk_in_checke.else_.return.typ": {"doc_hash": "f8a20932b87201df02b94f6cd74bdf626012f783ce2676d3c55098e3ce64e2d0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.named_type_ExpressionChecker.is_valid_var_arg.return._isinstance_typ_TupleTyp": {"doc_hash": "9e38877f8ed0bce72de64c7e1d01589cb9b4428a9d689dcd05e01d47a962e39d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.is_valid_keyword_var_arg_ExpressionChecker.is_valid_keyword_var_arg.if_self_chk_options_pytho.else_.return._": {"doc_hash": "d4b443f79b10946f41a86a8abeb6f7015a00c6922e0a92456e9097f6f46d94e3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.has_member_ExpressionChecker.has_member.if_isinstance_typ_Callab.else_.return.False": {"doc_hash": "763287865cf64333bb91974e298bcab226ede2084df8e858304f01e04909a681"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.not_ready_callback_ExpressionChecker.visit_yield_expr.return.self_chk_get_generator_re": {"doc_hash": "3793f37634079188bfbcbe3c0a6c93a279666df999c2eed4b681835eb802d8be"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_await_expr_ExpressionChecker.visit_await_expr.return.self_check_awaitable_expr": {"doc_hash": "8c9a314bf7dde8e5498b159862603e7b0dbe044bef3843453879f512579f12bb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_awaitable_expr_ExpressionChecker.check_awaitable_expr.if_not_self_chk_check_sub.else_.return.self_chk_get_generator_re": {"doc_hash": "269ae6930e7016fed15dc07ec975cd905cd5b2734ef14f73ec1e1335ee4c7833"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_yield_from_expr_ExpressionChecker.visit_yield_from_expr.return.expr_type": {"doc_hash": "40fbf9fcbc39ac6f56d39bb4ba90b1138d05585f55c58dc4532ecfbd15bcc60e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_temp_node_ExpressionChecker.visit_namedtuple_expr.return.AnyType_TypeOfAny_special": {"doc_hash": "de284d4d947cf745111b078fcc2060a634b496c89c41de3e03e144869c0af961"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_enum_call_expr_ExpressionChecker.visit_enum_call_expr.return.AnyType_TypeOfAny_special": {"doc_hash": "baace3e2e7569d277fb2d0212e55c10452d2fe6c87b365471fc7c5816830d77f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_typeddict_expr_ExpressionChecker.narrow_type_from_binder_139._": {"doc_hash": "fb1f06712b0c9c029cac9b2e790b06cd3a7068648366cb3c70c953d93bcc1b10"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.narrow_type_from_binder_140_ExpressionChecker.narrow_type_from_binder_140.return.known_type": {"doc_hash": "f6ca00967eb9d26ebea85c322ed837ba0a5e69eb2752c6e8dc6a558f50c83f78"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_has_any_type_has_coroutine_decorator.return.isinstance_t_Instance_a": {"doc_hash": "51240c26ce9455f683f0493e6bfbc321c106a2cf1603276bc0e94f1b7146f55d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_is_async_def_is_async_def.return.isinstance_t_Instance_a": {"doc_hash": "6e7bee76bb081a0ece36c74e7cf5d5588483248ad2f351870031885661e8b799"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_is_non_empty_tuple_is_duplicate_mapping.return._": {"doc_hash": "e55539f282c23e0d8268350238a762d32fac9781a40743390f02cadb36eeb37b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_replace_callable_return_type_ArgInferSecondPassQuery.visit_callable_type.return.self_query_types_t_arg_ty": {"doc_hash": "3bc35a1daed51bbc75aca4d707c66f8c25013c9dd891776a6f553fbc69c2ade2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_HasTypeVarQuery_HasUninhabitedComponentsQuery.visit_uninhabited_type.return.True": {"doc_hash": "ae9ee224b42ff54fd3e1a221e48fe8712d454d7adf8a95de5fb33ff26e4d642b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_arg_approximate_similarity_arg_approximate_similarity.return.is_subtype_erasetype_eras": {"doc_hash": "6f55caf286a922b1ccf99e40768d2cffc11e235e581bd5c7af216d19484e2bea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_any_causes_overload_ambiguity_any_causes_overload_ambiguity.return.False": {"doc_hash": "7eb13c01dd8a1b6e6335a2216e35324f7f51a70acd69d163b69bfd03e4429754"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_all_same_types_merge_typevars_in_callables_by_name.return.output_variables": {"doc_hash": "487613570b38e0f33d639ef33cc13e6e957ea497fbcb5b4ac46b8869267084d8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_try_getting_literal_is_expr_literal_type.return.False": {"doc_hash": "9fe4a30f5e1a55e90d9eb80bbcb764572dad6390c229cd6524275f2a26d8899e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_has_bytes_component_has_bytes_component.return.False": {"doc_hash": "16897013576b638e08a57b6c589f93d6344ee51c84a05fa1a23d0223d871193d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_type_info_from_type_type_info_from_type.return.None": {"doc_hash": "b45e4fdc073cf58ba0b20798177dde8267480560fb0bedc367462665b2bbda2e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_is_operator_method_": {"doc_hash": "205f41aeb7ee1570b3da1ea10371f504bb49ae1270be00e50fbe2d669faa7bc9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py__Type_checking_of_attri_from_mypy_import_state": {"doc_hash": "c8212dca078078929c5e0a18c2e3c75696aa16fe00986cbfecf9c04a040b00ed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_MemberContext_MemberContext.copy_modified.return.mx": {"doc_hash": "9dc1d565c855eed93252199c9359448562a294b01daea6c0c7992737b44c4750"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_analyze_member_access_analyze_member_access.if_in_literal_context_an.else_.return.result": {"doc_hash": "c45e72efcc80a11af8f0f3b168404052b9a749c5184ac952ab55a34626fafed6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py__analyze_member_access__analyze_member_access.return.mx_msg_has_no_attr_mx_ori": {"doc_hash": "7a661003134bf6fc198da07b85291afdffb07d54bed465864ae4d1a894d22c40"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py__The_several_functions_t_analyze_instance_member_access.if_method_.else_.return.analyze_member_var_access": {"doc_hash": "d18377a8fbe73181a9a3684eb3d6c18e49e10f6ff1ede5d3f217d664dac64533"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_analyze_type_callable_member_access_analyze_type_callable_member_access.if_isinstance_ret_type_I.else_.assert_False_Unexpected": {"doc_hash": "75fd8c5e99fce8e402aea814fd7debf6123d247954d0819a8d3d4395610dd156"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_analyze_type_type_member_access_analyze_type_type_member_access.return._analyze_member_access_na": {"doc_hash": "8bb0a65e5a8278e77fa54f098c6ff64db18c7b369782f235babc9000c68908fa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_analyze_union_member_access_analyze_none_member_access.if_is_python_3_and_name_.else_.return._analyze_member_access_na": {"doc_hash": "81f194ae343e8b072122ed4e63ecfaf3862eb51c4f6bd4be3c880fc8e2f69828"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_analyze_member_var_access_analyze_member_var_access.if_isinstance_vv_TypeAli.v.info.info": {"doc_hash": "0a69f89482737cea78700cf2516e719ad7a028be2f91992e5195721254ebcd00"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_analyze_member_var_access.if_isinstance_v_Var__check_final_member.for_base_in_info_mro_.if_sym_and_is_final_node_.msg_cant_assign_to_final_": {"doc_hash": "6dede94f484db7bb11fb45b3e11d9ddcb00b59099ca15b674631f57e7efbe80c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_analyze_descriptor_access_analyze_descriptor_access.return.inferred_dunder_get_type_": {"doc_hash": "76ef643d7bfbe55ec1c58d506646f3be9ff35178be4ef9f1434842671d58db0a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_instance_alias_type_instance_alias_type.return.expand_type_by_instance_t": {"doc_hash": "b775f39f2be26f64658136aca00d4b632e97c473597d537a3b3e49990d351579"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_analyze_var_analyze_var.return.result": {"doc_hash": "4345d64f89c2308ca4e687180a3554fc0f9601f57f8bcc26f6e5c747c9fde99f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_freeze_type_vars_lookup_member_var_or_accessor.if_node_.else_.return.None": {"doc_hash": "808cc5938d4ae598ffe4b256f36a1e0fa9065f0de0d179000e48d59ce757b3dd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_check_self_arg_check_self_arg.return.Overloaded_new_items_": {"doc_hash": "e884afc4c0c4b7aec574e15d3172d10e3ec13e8e8c373e02eaa05b0c55486076"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_analyze_class_attribute_access_analyze_class_attribute_access.t.node_type": {"doc_hash": "7408be1d1e70210fbf4e4abe6cf1767de1f1231aa4847c0df07e853e21df3884"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_analyze_class_attribute_access.if_t__analyze_class_attribute_access.None_9.return.mx_builtin_type_types_Mo": {"doc_hash": "b994f63227b6a23af44840f59ca7191a589dc0ae7fe00a0822ad29addd33e6ae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_analyze_class_attribute_access.None_10_analyze_class_attribute_access.if_is_decorated_.else_.return.typ": {"doc_hash": "005fe64b95bdb9cf165473b5a39fffd565bd4c96d07d3c27119525287046b2b4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_analyze_enum_class_attribute_access_analyze_enum_class_attribute_access.return.itype_copy_modified_erase": {"doc_hash": "ee4fb26e70a72081fb603539fe45d8a7bc4164184945772a91283c354d7cbd3d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_add_class_tvars_add_class_tvars.return.t": {"doc_hash": "4519ab0cd779140e33fe8237b61e9cef25ea59441c8c77acb1de841dd73cfaed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_type_object_type_": {"doc_hash": "93ceb55daccd0bd17c2794836fb38660a1c4b785780f299b4616eaa21b8bb51e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py___MatchMap.Dict_Tuple_int_int_Mat": {"doc_hash": "f4c388014fcd10b15e74047b5e70da11424bf813d76d982d4556009fcc20d853"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py__span_match_compile_format_re.return.re_compile_format_re_": {"doc_hash": "8baa544ac5a70b55b2d0614d03ca8b971f7a7ad0b756f725b768698826c9e0f9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_compile_new_format_re_compile_new_format_re.return.re_compile_field_conver": {"doc_hash": "48ac03c6bb5fbe99df91963638f3857ea63a85a1139ac18383e05710af975c50"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_FORMAT_RE_FLOAT_TYPES._e_E_f_F_g_": {"doc_hash": "2ae80401cdddc85d23eed50c0c455f7f0c779417c2282ec01c47c3a03eae3b8a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_None_15_ConversionSpecifier.__init__.self.field.field": {"doc_hash": "f998ae3658113c06b9f2f25b0f4717c372cdb2bc6c0fb408c14394565c9d9268"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_ConversionSpecifier.from_match_ConversionSpecifier.has_star.return.self_width_or_self": {"doc_hash": "58d2d87bfcbaf71a4d26797dbf140a7a24308d26215891d8a6de65243f05f137"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker_StringFormatterChecker.__init__.self.unicode_upcast.False": {"doc_hash": "2502b23b09b25266226015ee49136e39bb9c9cd70fff8dcef385c54b731c9ec6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.check_str_format_call_StringFormatterChecker.check_str_format_call.self_check_specs_in_forma": {"doc_hash": "059309cfa24223e9b86c05ac62386282ce465362061235425bd0fbe591deec43"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.parse_format_value_StringFormatterChecker.parse_format_value.return.result": {"doc_hash": "d3d2dee7d4389d1637f6cb68361819a20a86fe6abf5c891ddd0886ac224c2d68"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.find_non_escaped_targets_StringFormatterChecker.find_non_escaped_targets.return.result": {"doc_hash": "c2ef0891cfafb1ba80198acb2999a781b06696df73e91a89564405a9234743c4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.check_specs_in_format_call_StringFormatterChecker.check_specs_in_format_call.for_spec_repl_in_zip_spe.for_a_type_in_actual_item.self_perform_special_form": {"doc_hash": "1596285de6b1efb2dc88077ddc891f741497dc3514c6740e0e8eaaae7209c8c1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.perform_special_format_checks_StringFormatterChecker.perform_special_format_checks.if_spec_flags_.if_spec_type_and_spec_ty.self_msg_fail_Numeric_fl": {"doc_hash": "df07ed14b769d895cb388e5a575864d98e5255af73e893d79adea35ddabbf14c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.find_replacements_in_call_StringFormatterChecker.find_replacements_in_call.return.result": {"doc_hash": "af2451abcdb8f34ab1ab5d11e89e47005d3f71c39a6d9328f166811f39a7adc4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.get_expr_by_position_StringFormatterChecker.get_expr_by_position.return.TempNode_map_instance_to_": {"doc_hash": "199f519dc7e09000de496af49f125ee3fec4000010a97cd85897229c14a3cc2a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.get_expr_by_name_StringFormatterChecker.get_expr_by_name.return.TempNode_map_instance_to_": {"doc_hash": "7e9a82bcd77ae358061bd886262a6759b089aec46f0293a1acd102d2b9bdbb79"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.auto_generate_keys_StringFormatterChecker.auto_generate_keys.return.True": {"doc_hash": "b6e436745918f08b709a5f4a23e4b390cf883acfb7e110789336da6544b12a8a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.apply_field_accessors_StringFormatterChecker.apply_field_accessors.return.temp_ast": {"doc_hash": "deaeb5f5751fab0b8d4b226e2db90ae3e2fd6d1d4462c9cab58ca71d344b6a34"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.validate_and_transform_accessors_StringFormatterChecker.validate_and_transform_accessors.return.self_validate_and_transfo": {"doc_hash": "b0fd4d16f89d09c6d8d776409912b61170d149b04e82cc7209b3bd357c9e2dfa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker._TODO_In_Python_3_the__StringFormatterChecker.check_str_interpolation.None_2.else_.assert_False": {"doc_hash": "4730ca0e05a405300adef20406adeaf934cdf845f2ec67f89950b12294d485f1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.parse_conversion_specifiers_StringFormatterChecker.analyze_conversion_specifiers.return.has_key": {"doc_hash": "b03ea02518c85ed7e96a5ab996b0d90a0fb8931d00bd6a9645a9e9427229e1f9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.check_simple_str_interpolation_StringFormatterChecker.check_simple_str_interpolation.if_len_checkers_len_re.else_.if_len_checkers_1_.else_.for_checks_rep_type_in_z.check_type_rep_type_": {"doc_hash": "8682a580e98f51923cc05e21542775ad181b8cd76ed681f1d8b1ef70f3cc0377"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.check_mapping_str_interpolation_StringFormatterChecker.check_mapping_str_interpolation.if_isinstance_replacemen.else_.self_chk_check_subtype_re": {"doc_hash": "10fb41ecca3a73c614e9e797d8109c49397a620ed3152321cdac3b3ec06b16bc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.build_dict_type_StringFormatterChecker.build_dict_type.if_self_chk_options_pytho.else_.return.UnionType_make_union_str": {"doc_hash": "29b0d33c995e85ffa11d2bbc12d86d5fe883fc542307803fc53e8e5d4c9984d6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.build_replacement_checkers_StringFormatterChecker.replacement_checkers.return.checkers": {"doc_hash": "a8d6b1475cfe7fa4d4bbe48dbbde90bdfdff968544c84021b47b8268f5746430"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.checkers_for_star_StringFormatterChecker.check_placeholder_type.self_chk_check_subtype_ty": {"doc_hash": "e7575e8e27a116558ee791e909d0851cce40d381eef40572c4425913379e1d35"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.checkers_for_regular_type_StringFormatterChecker.checkers_for_regular_type.return.check_expr_check_type": {"doc_hash": "4145b84ebe8dca19d86894712b749cb7705775f6af125b46359e080dc23f91f5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.check_s_special_cases_StringFormatterChecker.check_s_special_cases.if_isinstance_expr_Bytes.if_self_chk_options_pytho.if_has_type_component_typ.self_msg_fail_On_Python_": {"doc_hash": "265936c66434e0605bb1657a846819dcd30126561150948e61301083313a3dc8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.checkers_for_c_type_StringFormatterChecker.checkers_for_c_type.return.check_expr_check_type": {"doc_hash": "c5735c404294d9ff34363864ce0164a273a595886b18f4ac8e479ec7ba0442e7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.conversion_type_StringFormatterChecker.accept.return.self_chk_expr_checker_acc": {"doc_hash": "a010a12bceda400f74c3bbb29f5ddf7b019c16666ad116722f93fc03174301d5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_has_type_component_": {"doc_hash": "6ac63acf301d9980d769e7395a65a8bb5805b64cd6470e4f26d24ef42d80569a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/config_parser.py_argparse_parse_version.return.major_minor": {"doc_hash": "869efdb080af9ff437e6b73ff6047bd34a7b0214c62fdda5c8a70f0b1ed4e6d7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/config_parser.py_expand_path_split_and_match_files.return.expanded_paths": {"doc_hash": "5af9baf67bc54e60dc70f1331c1c69b5dc3737ada87e736765971e4f7c3f5f94"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/config_parser.py_check_follow_imports_config_types._": {"doc_hash": "49a5394e9afe140a23746616ee1367311ed54d65c19b3b12920580b991fcea0a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/config_parser.py__type_Final_parse_config_file.for_name_section_in_pars.if_name_startswith_mypy_.for_glob_in_globs_split_.if_any_c_in_glob_for_c_i.else_.options_per_module_option": {"doc_hash": "832d576e929f9d90164d1b54d881e705b6debbb64a830eff89a46f0340f0c3eb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/config_parser.py_parse_section_parse_section.return.results_report_dirs": {"doc_hash": "88fb38a21392c64cbe03963fd89d69f8928f9da215c047de8b2e9245938e624a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/config_parser.py_split_directive_split_directive.return.parts_errors": {"doc_hash": "ada8ba6ce171412d66efd583950ed7cd557bc10bb4ddcfab65a291cf97e49798"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/config_parser.py_mypy_comments_to_config_map_mypy_comments_to_config_map.return.options_errors": {"doc_hash": "8295a0d0b5a4de27f8bbf8a358644342dd6ad6c66973425253b588488effaf89"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/config_parser.py_parse_mypy_comments_": {"doc_hash": "f671bdc52727948b4a1301bdb903c033b2262a10884be9fa8603b98228e9c88f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py__Type_inference_constra_SUPERTYPE_OF.1": {"doc_hash": "a4e26fe15b6f31551206826d8af287d76b4d7d7acf5fd86ebe8825b0dd23a1c4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_None_2_Constraint.__repr__.return._format_self_ty": {"doc_hash": "9d3538083a4aaf5940ebfabf01826dfe1b2f7c6f54e0e4ca3533e52a7b7c160f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_infer_constraints_for_callable_infer_constraints_for_callable.return.constraints": {"doc_hash": "bec0750a96a337a0b1607669374bcf32fa7792644906f72a2a97a7543427e21e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_infer_constraints_infer_constraints.return._infer_constraints_templa": {"doc_hash": "7e20b3928a02094afbf2b2dd16bd269f14212d4309df9feede659d8109f9010a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py__infer_constraints__infer_constraints.return.template_accept_Constrain": {"doc_hash": "2ef97fa861c9c743ad0a3b9ef876b7cc956e8fdc9667fcc7ced460d6b954e423"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_infer_constraints_if_possible_infer_constraints_if_possible.return.infer_constraints_templat": {"doc_hash": "265bb8166e2b61808ce15bb319062e5d392ab1506372e584b9d373f79f09077a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_any_constraints_any_constraints.return._": {"doc_hash": "25703e4c39f0decd5933121e0ed26f7c1ea33ccfe1efe20479fb8d02d025dac4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_is_same_constraints_CompleteTypeVisitor.visit_uninhabited_type.return.False": {"doc_hash": "cd09817fa362b8670fa01133f456daa064593465327114ee2154cec7231d2e04"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_ConstraintBuilderVisitor_ConstraintBuilderVisitor._Non_leaf_types": {"doc_hash": "32eda2afaac058c93d8a76f8ae55d7ec483d3b78c20aaffe18c3a11fb1be3d80"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_ConstraintBuilderVisitor.visit_instance_ConstraintBuilderVisitor.visit_instance.if_isinstance_actual_Lit.actual.actual_fallback": {"doc_hash": "172750d7872559295e34793f413b4058461cee773fd2da5d583e9185d4bafad1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_ConstraintBuilderVisitor.visit_instance.if_isinstance_actual_Ins_ConstraintBuilderVisitor.visit_instance.if_isinstance_actual_Any.return.self_infer_against_any_te": {"doc_hash": "b836c982e9119e3916f54cc577e59b0bc7f84d5531a1cbb1c8157b9389b19a46"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_ConstraintBuilderVisitor.visit_instance.if_isinstance_actual_Tu_ConstraintBuilderVisitor.visit_instance.if_isinstance_actual_Tu.else_.return._": {"doc_hash": "50c1a33a1d20fb084fe411a6fe44bb9071ebf36dde5b34a29b8a16a8845cf017"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_ConstraintBuilderVisitor.infer_constraints_from_protocol_members_ConstraintBuilderVisitor.infer_constraints_from_protocol_members.for_member_in_protocol_ty.if_mypy_subtypes_IS_SETT.res_extend_infer_constrai": {"doc_hash": "af60d5e279e6f3c1e22caf99829a19548cec21e3d1ebe87e712af0c0ecffa6dc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_ConstraintBuilderVisitor.visit_callable_type_ConstraintBuilderVisitor.visit_callable_type.if_isinstance_self_actual.else_.return._": {"doc_hash": "6d6d332abc2260c7b3b3b1c32b147870b7789c9d102f27d0ef52dfcef8fc849a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_ConstraintBuilderVisitor.infer_against_overloaded_ConstraintBuilderVisitor.visit_tuple_type.if_isinstance_actual_Tup.else_.return._": {"doc_hash": "63e33fc8b7d3629673b3902363ecc1e98e7870642b70bfeca21d6ac2874486f0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_ConstraintBuilderVisitor.visit_typeddict_type_ConstraintBuilderVisitor.visit_typeddict_type.if_isinstance_actual_Typ.else_.return._": {"doc_hash": "8d496f2dcfc9135e78bf9f47f386c4dbd8e1ad436ac1538822677f153abdc9ff"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_ConstraintBuilderVisitor.visit_union_type_ConstraintBuilderVisitor.visit_overloaded.return.res": {"doc_hash": "987b7547ee90da1e997bab9a400bc7fb7064103a7294f7226281ee13ee4dec15"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_ConstraintBuilderVisitor.visit_type_type_neg_op.if_op_SUBTYPE_OF_.else_.raise_ValueError_Invalid": {"doc_hash": "f39bdfc53a938c158ddd09a32775178587296b7c2fb633ea35fbdf23800abd53"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_find_matching_overload_item_": {"doc_hash": "8b6ae7cfb5150594d142f863eb2c7b8c1394484811f503f04b43169f428b8ffb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/defaults.py_os_": {"doc_hash": "1b17a9ca8a7d4ee0b437cc3162e553342a63a7c6c512f8229f55cbe6696b888e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/__main__.py__": {"doc_hash": "9836788378e949347820397ee4cc0afc326a103b636a9622fe99cbd75f3ae61a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py__Client_for_mypy_daemon_p_add_argument_files_m": {"doc_hash": "8790148f718de3b093d38ac1b0749092bb5df475ada6e9852b85fc4b14c92006"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py_run_parser_del_p": {"doc_hash": "ff0b773ba00b87d72b47ab76d05e71cabb6ef51cc473525a32d2a0716437ca40"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py_BadStatus_action.return.register": {"doc_hash": "8386e9e23cde98c1f64cb79af8cdf03bb34c6f970f901b341db909dee4a2e8f0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py__Action_functions_run_i_do_start.start_server_args_": {"doc_hash": "6ccbbcc68bea1ca358ce5ab262760368ef3fc977ef61742de3027b883c025f72"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py_do_restart_start_server.wait_for_server_args_stat": {"doc_hash": "489df107b40cb787b513507c9d9c364df3764ac4b40504909b3e8527eeeace51"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py_wait_for_server_wait_for_server.fail_Timed_out_waiting_f": {"doc_hash": "057db6d2639713d3c355783a1d66c9520835d91cf055763371a7c6240e9be774"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py_do_run_do_run.check_output_response_ar": {"doc_hash": "de68243d68595f5fff694e8160f7e46b7f4a25e878485d6a69ea4abb63cd56d2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py_do_status_do_status.print_Daemon_is_up_and_r": {"doc_hash": "d6faeafc40aa5d681cce731f73e7e38358d619f84ec34dc35966d95c54b4eec0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py_do_stop_do_check.check_output_response_ar": {"doc_hash": "57263672dc9afd1350a09f1c63bd78ee44ebc9f19439c46e7f617f71bfdbbbd7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py_do_recheck_do_recheck.check_output_response_ar": {"doc_hash": "fba2cd28ff39d8727ca04c1f202d1d4f64fe71fb9b6a4110c1f70ecf4a7b7cac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py_do_suggest_do_suggest.check_output_response_ve": {"doc_hash": "e0a011c5ac77b59518343fb7c95797e5dd5e6024715dc753c94b56f910a9bc43"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py_check_output_check_output.if_status_code_.sys_exit_status_code_": {"doc_hash": "db3f747cd27b5a0a7f1d99f0f23cecabaff87b97407e8632cdc4126cb0ceb7f6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py_show_stats_do_hang.print_request_args_status": {"doc_hash": "2b2ecd6f07a208ac90caf11b29f35d16842ab646a1db659a71d87af6b058f71b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py_do_daemon_do_help.parser_print_help_": {"doc_hash": "3fc664c1a7fa029e534c43d146631680671d3292439ca91c9ae83874a938b52e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py__Client_side_infrastruct_request.try_.else_.return.response": {"doc_hash": "e8a6ff53533957983eb15a880f7c8c0d69f2fff17f33db3c95fbef7d1c0f986f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py_get_status_check_status.return.pid_connection_name": {"doc_hash": "b7bceaabd71fee33afb68565f5ea46c10794fbfacc1796a24fb8713b8404373c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py_read_status_": {"doc_hash": "46f481c52408ab5fb40aed69c89cd604f889eb1b682f022d0f6463b2cb6fa17c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_os.py_sys_": {"doc_hash": "b26808a27c382032d7c972f919e73353b730e8236df2d0f24b9a8999e7cf7405"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py__Server_for_mypy_daemon__type_Final_If_True_": {"doc_hash": "28e48dae09f950284f99837fbb17b7e0b8228150bcba789e75a0960aa55ddbc3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_if_sys_platform_win32__Server_code_": {"doc_hash": "93aa9b4d7d146d59aeceec2fb1a8e0e5a953221bcb6caf92b25bab56e989bca3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server_Server._response_metadata.return._": {"doc_hash": "538d9400cb844f9829308a336e3c8faf6929afa9859409c3784508a937482cef"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server.serve_Server.serve.try_.finally_.if_exc_info_0_and_exc_in.traceback_print_exception": {"doc_hash": "18670ebcbaac9d90426aa23dbd75de5da699ceda4cf597909d7dce11a9df9a53"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server.run_command_Server.run_command.if_method_is_None_.else_.return.method_self_data_": {"doc_hash": "58cac8627b5fab756369e99138052c87ba5e384deaf0b51fb161cbaf6e609eda"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server._Command_functions_run__Server.cmd_stop.return._": {"doc_hash": "4b7fd6cff6701ab66bf77753bf42a3101b8082afabbb62e4946c7dc34dbbb994"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server.cmd_run_Server.cmd_check.return.self_check_sources_is_tt": {"doc_hash": "ab63c6a38c7f9e5fb17491b907caa59ced673f6a95567476e83f3ceef850a382"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server.cmd_recheck_Server.cmd_recheck.return.res": {"doc_hash": "38fe646c7f025cb7d4b5d2e4d7f3e89e357b19e0f5f17e638f2c1d3646c29961"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server.initialize_fine_grained_Server.initialize_fine_grained.return._out_join_s_n_": {"doc_hash": "93eb861629f02e4714d77c0583cb95799507fc473ad0952b6989414ce2e01cb4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server.fine_grained_increment_Server.fine_grained_increment.return.messages": {"doc_hash": "f0e9dad449268d5a8a6af521fe71f84f0110228fcd158c68cec158283df24b18"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server.fine_grained_increment_follow_imports_Server.fine_grained_increment_follow_imports.return.messages": {"doc_hash": "03c9350080ed9f48c4b6d8d08ff18962d9ec9505f3b27fc1b109dc12475502d1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server.increment_output_Server.pretty_messages.return.messages": {"doc_hash": "3fa8d5d3f678f8b3d217a77eb05110275309ff1cdc77e5e9974857f2fb4a9ba5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server.update_sources_Server.find_changed.return.self__find_changed_source": {"doc_hash": "80a41d0bf589281e6ad6029bd0e887126ad7fe54902166b8d9b7e25a4114907c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server._find_changed_Server._find_changed.return.changed_removed": {"doc_hash": "5393ad4a80faf98069402b85e260670354d9369682c06c2191a6031be4f47af2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server.cmd_suggest_MiB.2_20": {"doc_hash": "9b25531e687d6638e7243808d04bc8631cc6c12cf8a3e789b9983c169def9963"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_None_5_get_meminfo.return.res": {"doc_hash": "30ae19445728603b5b1861d083d8a569e88ab74f95fa2765c11ae7dea3d685b4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_util.py__Shared_code_between_dm_": {"doc_hash": "08f89d2b63db31329cd72b679f838835f4d3e13694940ee7b33a9c20f6b7eea7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/erasetype.py_from_typing_import_Option_from_mypy_nodes_import_AR": {"doc_hash": "cdf7b177fd432cdee3a8bceeaf13abbe911ec4cf30d27fc67981449ec57c8d18"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/erasetype.py_erase_type_erase_type.return.typ_accept_EraseTypeVisit": {"doc_hash": "da8bfff9f08a2b75beb2f3ab535094e41cba4917dc5a9d401f4d716fd4b008f2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/erasetype.py_EraseTypeVisitor_EraseTypeVisitor.visit_type_alias_type.raise_RuntimeError_Type_": {"doc_hash": "a9f2f0ca0ee5ddeb775d0a9e363ae8ef970061bb6c27a437f33d97e50c15b36f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/erasetype.py_erase_typevars_replace_meta_vars.return.t_accept_TypeVarEraser_la": {"doc_hash": "c5ba58a3c88aa7a276b915515b1e4bcfe3a8d9f3ac5b1179994fcc396413541a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/erasetype.py_TypeVarEraser_remove_instance_last_known_values.return.t_accept_LastKnownValueEr": {"doc_hash": "ce13bbb25d5d747c698b6ea02c1d4f62dfe83c3713bcc0897faa0c40dcf4dfd1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/erasetype.py_LastKnownValueEraser_": {"doc_hash": "62acbf7045d094dd9b1ebbf89e1c7af9b6d48dc8b50e9bd1fd038ed7771383ee"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errorcodes.py__Classification_of_poss_None_25": {"doc_hash": "16c84d9b208ec8ec63a07e3e0c604068d85a16830f6836ff31bfcf7b4ebe7e74"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errorcodes.py_FUNC_RETURNS_VALUE_": {"doc_hash": "b66b47fed3c2d308df244c188411de19b3c3b602b7727802cb2466a65a3f3649"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_os.path_allowed_duplicates._overload_Got_Ex": {"doc_hash": "c43adc6e40207408fedc71e54df5f973e62e6f2eadfb251d1ae1d19a1ce8e852"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py__type_Final_ErrorTuple.Tuple_Optional_str_": {"doc_hash": "296c5348639b13d2b3dec815d15c8d54ab8b7f2950ea507961bc0340ae0d53a3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_Errors_Errors.copy.return.new": {"doc_hash": "7ea91483bba6657020649f445580f7e0b375aec1d04a9b03f4eb0450fc3f25b1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_Errors.total_errors_Errors.simplify_path.if_self_show_absolute_pat.else_.return.remove_path_prefix_file_": {"doc_hash": "6dd7c6abca23d1572ada624034951837abed72b568aef23075ec64f84bd3cd6b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_Errors.set_file_Errors.set_file.self.scope.scope": {"doc_hash": "f2cb5903dc6dd184b77b6c0967aa66b6d4c394625904200a9652dd11600cf520"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_Errors.set_file_ignored_lines_Errors.set_import_context.self.import_ctx.ctx_": {"doc_hash": "f3a9869b7952549fe015d9fb00aaf7c468b9fe3cf3cf179f0c808cfab0ad9b86"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_Errors.report_Errors.report.self_add_error_info_info_": {"doc_hash": "c54370fcc4be75ebaca262e529669126424d609149d35d0caa70aecf37865749"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_Errors._add_error_info_Errors.add_error_info.self__add_error_info_file": {"doc_hash": "72d6c73927320306cdeabe263ec7770b6ceea4b3a281f7bc40e8842378c2d0d5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_Errors.generate_unused_ignore_errors_Errors.generate_unused_ignore_errors.if_not_is_typeshed_file_f.for_line_in_set_ignored_l.self__add_error_info_file": {"doc_hash": "5af83cb6d649dd25d9001dd49da6299674dd003d2d18f66e32269454dd9c6206"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_Errors.num_messages_Errors.raise_error.raise_CompileError_self_n": {"doc_hash": "ef049e42082507c21011ad2dc148e5011e3d00a2a96697b00cdebf2ee4bb315e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_Errors.format_messages_Errors.format_messages.return.a": {"doc_hash": "dcb7b6ea267066ee84ee0e47f30e0061196b752bb9fd3bc1d70f6b4ad793611c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_Errors.file_messages_Errors.targets.return.set_info_target": {"doc_hash": "d70f93aaea13ba7a83938b8677fd8214e4c19d3432fb463fbad1258588a559cc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_Errors.render_messages_Errors.render_messages.return.result": {"doc_hash": "712d7de96de9ada8bb7ad5f37a2bd0f11044bc12c16a3b95ced4873b59b42b58"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_Errors.sort_messages_Errors.sort_messages.return.result": {"doc_hash": "70d33ce4e20562b3abf28e838f7a03d5b4bae86ff9bf69013833ed47c770ba59"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_Errors.remove_duplicates_Errors.remove_duplicates.return.res": {"doc_hash": "a94ae6b3d855ecba21cbbfac3909df21edcf6adb828c541d60b6e37fd11f008a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_CompileError_remove_path_prefix.if_prefix_is_not_None_and.else_.return.path": {"doc_hash": "5c5b922a2339850f18a48e6757d46de1e04e54896eef783f51d319e339a6d462"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_report_internal_error_": {"doc_hash": "5ae1262edc025075f4b582c0425f396e96be181584c59be6a494c1df6b3fe2c2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/expandtype.py_from_typing_import_Dict__expand_type.return.typ_accept_ExpandTypeVisi": {"doc_hash": "ae8e63d6c584cd4cd2f9fa1395c4f46b918d44d37332b25783a5d6890acc499c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/expandtype.py_expand_type_by_instance_F.TypeVar_F_bound_Functi": {"doc_hash": "d5bf2b8b92a959bafc3f2544bd2fa588562ea3617893689ae4d2d82018ee3dc1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/expandtype.py_freshen_function_type_vars_freshen_function_type_vars.if_isinstance_callee_Cal.else_.return.cast_F_fresh_overload_": {"doc_hash": "b1edc5c520e585737748c754a0b2f3e17a46905a0733389c4859da0f9d83269f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/expandtype.py_ExpandTypeVisitor_": {"doc_hash": "c3e7490bc3b898a2e30d08761d1c7f75f66686a32d3c3ba9f5df00e0bd6a0233"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/exprtotype.py__Translate_an_Expressio__extract_argument_name.if_isinstance_expr_NameE.else_.raise_TypeTranslationErro": {"doc_hash": "722ad711008f76f95594db2076e02d3549e90cb9ef23b8570a0e19ba5ba1ad4d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/exprtotype.py_expr_to_unanalyzed_type_": {"doc_hash": "4dad7ebd075f7fdb29a86dedf39c902349276c0f1664d7c5884aafb404fee6b0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_re_from_mypy_reachability_im": {"doc_hash": "61962de8f9c5ac37fa636c20728fc998bf27291a602909988bdeb35a04ba6097"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_try__TYPE_IGNORE_PATTERN.re_compile_r_s_typ": {"doc_hash": "9653a68c560b36177e18dcfd84c25ba4c0131c5851b635bdb087f28d110dbb29"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_parse_parse.return.tree": {"doc_hash": "a795e06dc1264efc98a5d018b3b5d05ed5399a80f6168bb84b1d73a094b09cbd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_parse_type_ignore_tag_parse_type_ignore_tag.return._code_strip_for_code_in": {"doc_hash": "f9d55f593d45896fb426926885d117d3847cdfeef025381632887bfa791242a3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_parse_type_comment_parse_type_comment.try_.else_.return.ignored_converted": {"doc_hash": "ebda9d85d4ff440e72b3ff96e377ea898190c4df32f45c5e58262b42577c4a82"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_parse_type_string_is_no_type_check_decorator.return.False": {"doc_hash": "2471c157e4eaac847d60141f714b43da138b90d49d3a8ce9e3e7e00dbbd1add2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter_ASTConverter.get_lineno.return.node_lineno": {"doc_hash": "087d6e23818553253f510b2a92cd269c72b8ff453994ffd432c69e8a87ed5668"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.translate_stmt_list_ASTConverter.translate_stmt_list.return.res": {"doc_hash": "1d6168cef6cc3ee73c39ed6530a44a1406c160b8d548cfa0e504ffa157de4827"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.translate_type_comment_ASTConverter.as_required_block.return.b": {"doc_hash": "e8ff36f7b2582885d4946c25b8cfb00b77704468a07369372dd68a1f4bbb4178"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.fix_function_overloads_ASTConverter.fix_function_overloads.return.ret": {"doc_hash": "5e6bebe143ec83c5fcfd124f754770056b8486dc62e8b8bb66a042b1c136b841"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.in_method_scope_ASTConverter.translate_module_id.return.id": {"doc_hash": "844b8610fb38f5e1197b25b98362b9e10d6d2f8ec25f284a194b0389b638564c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.visit_Module_ASTConverter.visit_Module.return.MypyFile_body_": {"doc_hash": "5a6c34e954239e380a8a2f987f04c1472292902084363b1f137b4f10581ac917"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter._stmt__ASTConverter.visit_AsyncFunctionDef.return.self_do_func_def_n_is_co": {"doc_hash": "c746d2c4c927f96ea8146220ea75ed4f5f98d974a1bb9223801175fbb935528a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.do_func_def_ASTConverter.do_func_def.func_type.None": {"doc_hash": "8f01140ae2daa56d72c67711b263bc105ce63623837c8a7f7aadc3159f9b6b9d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.do_func_def.if_any_arg_types_or_retu_ASTConverter.do_func_def.return.retval": {"doc_hash": "55ae2fd1ea3ad5a6680e6f9908c3e690dd1602fe86ed34489721d411e3a4c54f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.set_type_optional_ASTConverter.transform_args.return.new_args": {"doc_hash": "9cb04fdb20329116f9f7aa34fce1e92aec70eda34fd0743f9441fe20c2681e25"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.make_argument_ASTConverter._expr_decorator_list_": {"doc_hash": "c1964eb6c6f0ceec029d6f2708fe7855ae0515ec2349129ca1af67ede74943a4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.visit_ClassDef_ASTConverter.visit_ClassDef.return.cdef": {"doc_hash": "68c264244e09b5a11354244a13fa019cf7192efbf7629c8913afa2332c0edb5d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter._Return_expr_value__ASTConverter._AnnAssign_expr_target_": {"doc_hash": "9ef669f0f35b0b8d47fd4f3787b99ae7e6bac1a51d42c9e59e3c6037d452dba1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.visit_AnnAssign_ASTConverter.visit_AnnAssign.return.self_set_line_s_n_": {"doc_hash": "e5eadc5937a558ceca8e3b98da7a04214245eb38172be75e0d07cb53532482bc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter._AugAssign_expr_target__ASTConverter._Try_stmt_body_excepth": {"doc_hash": "c8d0e23d4d1a3b1b52e3fa71c715c8d8363a79522436314c4360e866bea52c9d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.visit_Try_ASTConverter.visit_Try.return.self_set_line_node_n_": {"doc_hash": "cf3d08b10ce3dd1afd85b8776ab5bd9c57bc7e8d7cf48efd08c5cf1c314d26e3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter._Assert_expr_test_expr__ASTConverter.visit_Import.return.self_set_line_i_n_": {"doc_hash": "1852b46c8f44312b8cbd018ea9cb14684bfa9a01e359e106d60bbbaedcad24a9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter._ImportFrom_identifier__ASTConverter.visit_ImportFrom.return.self_set_line_i_n_": {"doc_hash": "746bb975ad2c9076562fa73917056c6d8ef677f56ee22830db07f9fd2c98734f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter._Global_identifier_name_ASTConverter._BoolOp_boolop_op_expr_": {"doc_hash": "5e09e16fd8af4af00cd598ecd6ca0e58f68e6fce52ab2c33f34c3a805f5f6349"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.visit_BoolOp_ASTConverter.visit_BoolOp.return.self_group_op_self_trans": {"doc_hash": "bd330b05c8837f48f9c913769294f059c86573bbe221f76362fc418b5c44d637"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.group_ASTConverter._UnaryOp_unaryop_op_exp": {"doc_hash": "86fa8bf04f2da14183ef697c9e9f3c2bcc03e9625804aa2b55f24fff73006466"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.visit_UnaryOp_ASTConverter.visit_UnaryOp.return.self_set_line_e_n_": {"doc_hash": "3e3be48dc285c3bc2db34609e56708d19d358025a2ac00b462b31a88146997c1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter._Lambda_arguments_args__ASTConverter._DictComp_expr_key_expr": {"doc_hash": "220ec6afca3b11af06bdb8f3ae31c8d25fc2d53eda46d3b1d4e4c53121399929"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.visit_DictComp_ASTConverter.visit_DictComp.return.self_set_line_e_n_": {"doc_hash": "2cf924d1a2f1c6d37127d1db6be10e03f3af1663496d6ad53b35236cde2fdbaa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter._GeneratorExp_expr_elt__ASTConverter.visit_GeneratorExp.return.self_set_line_e_n_": {"doc_hash": "fab889c5c31ce48516c4a7c5e4a66c22f29987628c573998b44f4528793366ab"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter._Await_expr_value__ASTConverter._keyword_identifier_": {"doc_hash": "b9b2e97a9cd17487acdb061019c45b2cd0e7ce08c5d5e3b9a9f25a565026afa9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.visit_Call_ASTConverter._Constant_object_value_": {"doc_hash": "90e5524c29ca254c8191055d0bff2899da5bbace832e55bcac07d9b1ec1af58f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.visit_Constant_ASTConverter.visit_Constant.return.self_set_line_e_n_": {"doc_hash": "38307cb1e1d3c6d675411d69d67a17b93e7a9980570dfe9b3ba7a66fb62dc78b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter._Num_object_n_a_numb_ASTConverter.visit_Num.return.self_set_line_e_n_": {"doc_hash": "9bad209f255d83bd087e11d253982949b0f05bf3768adbd90264bcdc5098a841"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter._Str_string_s__ASTConverter._JoinedStr_expr_values_": {"doc_hash": "e27dfacac202afd3990d8f7c817527536bd910632c98d755b16665b888988865"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.visit_JoinedStr_ASTConverter._FormattedValue_expr_val": {"doc_hash": "6a0538fe4986b5dd95ec84a4d2fb385072a8214918f1be583842893478e34baa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.visit_FormattedValue_ASTConverter.visit_FormattedValue.return.self_set_line_result_expr": {"doc_hash": "2e44a2fdb6d4824b2ba4a2e3bd0ea52bb9688d3d6eac436186e1ee72a8177e3b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter._Bytes_bytes_s__ASTConverter._Attribute_expr_value_i": {"doc_hash": "81f036c37d442a6850a582482285d0df7056f0107f7c12fd7770e066dae2f1e1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.visit_Attribute_ASTConverter._Subscript_expr_value_s": {"doc_hash": "ee8b626d8b5bf52968fe9e86bc7403fc65ef7ae022722515a64db4c052911bd6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.visit_Subscript_ASTConverter.visit_Subscript.return.e": {"doc_hash": "a2282b23a11b07018f53d3e2a9b07b8f6d2fc1f3dcb1f5b86d89aca651bfba9f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter._Starred_expr_value_exp_ASTConverter.visit_List.return.self_set_line_e_n_": {"doc_hash": "c9ab66a716603e663fc281f985d6db7568c47245cdad609a49328e529784dc95"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter._Tuple_expr_elts_expr__ASTConverter.visit_Index.return.self_visit_cast_Any_n_v": {"doc_hash": "891a7f7c517acb69ec0369159d33b258e462a68fa23b65c94443692f414b215c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_TypeConverter_TypeConverter.convert_column.if_self_override_column_.else_.return.self_override_column": {"doc_hash": "fff61496437135da34fa8d731526917a791e4a53f496ebbcfd6896ccf7e793af"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_TypeConverter.invalid_type_TypeConverter.invalid_type.return.RawExpressionType_": {"doc_hash": "19138044fef0b3eab760b0c311ada8579a5b98cd3fadaddc67bccfc5d0585253"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_TypeConverter.visit_TypeConverter.visit_raw_str.return.typ_or_AnyType_TypeOfAny_": {"doc_hash": "ac2755ce837fc1d2b390cf13a1b201e18d2d00ba2e34293f416270f950d37613"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_TypeConverter.visit_Call_TypeConverter.visit_Call.return.CallableArgument_typ_nam": {"doc_hash": "4dc63daa3746006aa9e6dfdc045c16640c4b55fcb15b55f3f67d0003a7ed95ee"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_TypeConverter.translate_argument_list_TypeConverter._Only_for_3_8_and_newer": {"doc_hash": "28027ed99b9c287eff7a9031fa8f81b579a6bf1573352ca85ae66b3265b7d05f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_TypeConverter.visit_Constant_TypeConverter.visit_Constant.return.self_invalid_type_n_": {"doc_hash": "87f12cfa6830c0c17e5041d835ccad5d4fea242a3285dcd546bdd5e358bb2a90"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_TypeConverter._UnaryOp_op_operand__TypeConverter.numeric_type.return.RawExpressionType_": {"doc_hash": "3191ecc7c1dae23b5546424e7e25019f1491f6bf4f6de908ef181d8ebfda80bf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_TypeConverter._These_next_three_method_TypeConverter.visit_Str.if_u_in_kind_or_self_as.else_.return.parse_type_string_n_s_b": {"doc_hash": "38f97ec2f44a94126c4185025d7364816ead32d990d2ed6c68250532506bb17b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_TypeConverter._Bytes_bytes_s__TypeConverter.visit_Subscript.if_isinstance_value_Unbo.else_.return.self_invalid_type_n_": {"doc_hash": "df3f5a54eea2ed723ee3a1bacd66edf0671e57f5fff8aa27cafe9d89b3400599"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_TypeConverter.visit_Tuple_TypeConverter.visit_List.return.self_translate_argument_l": {"doc_hash": "e85b4a3410d70cac250525105e97e63719d0edc8a71c40c96d5469ebb8bebac3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_stringify_name_": {"doc_hash": "0380ddf59ab384eabbda3e9288299c43e002c80930b1d2b303d096b80ba36c73"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py___from_mypy_reachability_im": {"doc_hash": "7e8815182380a657a81aba1143bf8d824af0ba96aabf00b1a1618ad54c3881e2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_try__TYPE_COMMENT_AST_ERROR._invalid_type_comment_": {"doc_hash": "0c9bb49aa27618b1ae231eada173d003eb4519b8d1029d2697e81bc1e5a147c2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_None_7_is_no_type_check_decorator.return.False": {"doc_hash": "2274321955656ba5624332d6f1dea5ac12c8afd85f21228f86e4320704ba7c3e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter_ASTConverter.get_lineno.return.node_lineno": {"doc_hash": "59b73cf2c9ef4779302fe7ed01ac90e138afd4298b98cf70c721c2d98ace881c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.translate_stmt_list_ASTConverter.translate_stmt_list.return.res": {"doc_hash": "1c5e0151e2fe52b2253b29e96fc4bf0fe2094ec73310c186865e2003f19bedf0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.translate_type_comment_ASTConverter.as_required_block.return.b": {"doc_hash": "9e15a4f58f22767b08be2cab33d649011781d9e564c97b32b2f168838d9b530a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.fix_function_overloads_ASTConverter.fix_function_overloads.return.ret": {"doc_hash": "0b67db614f4741fbb4fa482b8490ea73312e3424ff79dfafc34dc3025ad8b731"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.in_method_scope_ASTConverter.translate_module_id.return.id": {"doc_hash": "e99937edbcc8a6e3507f4e05f54d50513b13f7666fc24508df141ac410ce9794"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.visit_Module_ASTConverter._arg_kwarg": {"doc_hash": "ce487655f3a8930e85d110dbfbda69ab037bb6d8f82692baab8b3c8330750301"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.visit_FunctionDef_ASTConverter.visit_FunctionDef.if_any_arg_types_or_retu.if_len_arg_types_1_an.else_.func_type.CallableType_a_if_a_is_n": {"doc_hash": "1361bb7c204891a839ca41f24bdd51d778708306dce8248f273a44f71f61b5dc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.visit_FunctionDef.body_ASTConverter.set_type_optional.if_isinstance_type_Unbou.type.optional.optional": {"doc_hash": "07c7e91d82c0ef8605f1c76bcbefb1afa6cdf463ea153f59550747cb476b02db"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.transform_args_ASTConverter.transform_args.return.new_args_decompose_stmts": {"doc_hash": "9ed3a53b9832e82a2f5f5d310b8834e9d65e85db995ff9c7d1af3b6ccc513e60"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.extract_names_ASTConverter.convert_arg.return.Var_v_": {"doc_hash": "0e1723ab91ca908be9c110bafc45d6ecdcf019437ce9bfdb842e71657d6d3e04"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.get_type_ASTConverter.get_type.return.None": {"doc_hash": "74882a266d651e4c1d708a7202cdeb85c17bd6f6b721634362bb2ce78d754faf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.stringify_name_ASTConverter.visit_ClassDef.return.cdef": {"doc_hash": "0a169619cb9c1715ebe05d78c3f0753878717a2ee80bee536a26ead44360a0b5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter._Return_expr_value__ASTConverter.visit_With.return.self_set_line_stmt_n_": {"doc_hash": "955795d7c213795fcdf388250d14d736e85f0cf1412ef92d6e30beb9214ff3ab"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.visit_Raise_ASTConverter.visit_Raise.return.self_set_line_stmt_n_": {"doc_hash": "ca306f1651ad0dda8d2bc0cd25cc87223539ae14a5086636efead6774f8c4861"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter._TryExcept_stmt_body_e_ASTConverter.visit_TryFinally.return.self_set_line_stmt_n_": {"doc_hash": "5c10d655ff248b6024e236d5defc60c7fb5059e9508a3bc3265f7b37003ef525"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.try_handler_ASTConverter.try_handler.return.TryStmt_self_as_required_": {"doc_hash": "15d1a7aefa857ec0335ded2c012d48d7dbee4d6bf32497891905fa132dda65fd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.visit_Print_ASTConverter._Import_alias_names_": {"doc_hash": "c87c3bbf7d944fd89f09d9027625811081dc6313c061cc6d0597f6b61e59fb44"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.visit_Import_ASTConverter._ImportFrom_identifier_": {"doc_hash": "097456925b6e71e26e29312a74e2a5635a6045db8044d4660f153e8ad89a2a80"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.visit_ImportFrom_ASTConverter.visit_ImportFrom.return.self_set_line_i_n_": {"doc_hash": "3a528797c580d9aa7d188332ef7f9045e1e1cdbfb60e17dbe68406970b2e068b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter._Global_identifier_name_ASTConverter._BoolOp_boolop_op_expr_": {"doc_hash": "11a45535bea0005a3141332874bd3031e6e395b1b8094d1f18eb0d9d7e2b8367"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.visit_BoolOp_ASTConverter.visit_BoolOp.return.self_set_line_e_n_": {"doc_hash": "ff73836d74eb0e224ed634dda5dacaf3f8ea5ef5df53fb1b091329bba3e8bd5b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.group_ASTConverter._UnaryOp_unaryop_op_exp": {"doc_hash": "28e8c0dec7d7d6060f9b5d717e1989d05a27b164b89e3a202003c43ab8534b70"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.visit_UnaryOp_ASTConverter._Lambda_arguments_args_": {"doc_hash": "d95274ece1aacc351032ff3f8c640f4d15417e7c05e32b1570bab7fd2e4af775"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.visit_Lambda_ASTConverter.visit_Lambda.return.e": {"doc_hash": "4e2ea0e65764096eb4b07c4226da7dc98d8c558fbfb7f4e0b6175b518b39ca9d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter._IfExp_expr_test_expr_b_ASTConverter._DictComp_expr_key_expr": {"doc_hash": "4c2788f5940d7d6819d86d7e53e48a4d68f65d79ceb3f32e88440a95ece6260c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.visit_DictComp_ASTConverter.visit_DictComp.return.self_set_line_e_n_": {"doc_hash": "c8b4584ef16f3dcab554cac1969e27667c78853b354d0a241b13ef849ece94ee"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter._GeneratorExp_expr_elt__ASTConverter.visit_GeneratorExp.return.self_set_line_e_n_": {"doc_hash": "abbf1930c64239c48707ac3823fc56ca728d1475a2edfa9bd78925b6c2aed579"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter._Yield_expr_value__ASTConverter._keyword_identifier_": {"doc_hash": "f4fadcc8301ae2adc69b0d6d6cdd91234bdc50852c587c793ce7293f7c99b305"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.visit_Call_ASTConverter.visit_Call.return.self_set_line_e_n_": {"doc_hash": "53d95453e2d2a68ced799fc0674d6eb05ca6568166cc023c14de0ac6c83d6367"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter._Num_object_n_a_numb_ASTConverter.visit_Num.return.self_set_line_expr_n_": {"doc_hash": "afa5ff066a5242bf3f881710a9a459f9db488dec5f984dd1d21ea19cf270cddd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter._Str_string_s__ASTConverter.visit_Str.if_isinstance_n_s_bytes_.else_.return.self_set_line_e_n_": {"doc_hash": "c501a1ece1ffb6acc1bac4037f052a1643782b62fba946e48069ee3e48689523"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter._Ellipsis_ASTConverter.visit_Attribute.return.self_set_line_e_n_": {"doc_hash": "2b2f4bf5405ca1dc2497a5e7313fed0a6f4db964e9d6e004116d44f5e9fa4e25"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter._Subscript_expr_value_s_ASTConverter._List_expr_elts_expr_c": {"doc_hash": "446eff12e4f213798149dde638bd9e88f7e9a0c11ac6d387cd553b2d67e8409a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.visit_List_ASTConverter.visit_List.return.self_set_line_e_n_": {"doc_hash": "f342086d166dffe442d8351f318d1b457053799e6f1bcaca34b482f996c4cf71"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter._Tuple_expr_elts_expr__": {"doc_hash": "478f531465b2c99c71106a437505aa4c02663c9957b57b8df8c28d162418b1c7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/find_sources.py_SourceFinder.get_init_file_": {"doc_hash": "37a76cdb4d2304731eab002e16af3a793627bc1cd7fd3f721eda6b0e4f051a06"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fixup.py__Fix_up_various_things__fixup_module.node_fixer_visit_symbol_t": {"doc_hash": "9cc228a27ecf609a0fd0a2491b1ad57563561aaaf3f4ba841e98c3a00d2c39d6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fixup.py__TODO_Fix_up_info_when_NodeFixer.visit_type_info.try_.finally_.self.current_info.save_info": {"doc_hash": "5652dbdf4480c1fccefec28ee708763c7777a6ae0e88a64ca299d5e9d4e76ef5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fixup.py_NodeFixer._NOTE_This_method_defi_NodeFixer.visit_symbol_table.for_key_value_in_list_sy.if_cross_ref_is_not_None_.else_.if_isinstance_value_node_.else_.assert_False_Unexpected": {"doc_hash": "4ee7b97682cedc680d07f328d49b58b04da477e1f5d271e8bec6dcd78eaf1572"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fixup.py_NodeFixer.visit_func_def_NodeFixer.visit_type_alias.a_target_accept_self_type": {"doc_hash": "e3b0df007e22d02137b1c2a5747ab25499e6e5376e1fc2269c99b18712989a88"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fixup.py_TypeFixer_TypeFixer.visit_instance.if_inst_last_known_value_.inst_last_known_value_acc": {"doc_hash": "2a39509eadcd629229646d83040129003297b963bad101d12400e47aff4b3f79"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fixup.py_TypeFixer.visit_overloaded_TypeFixer.visit_tuple_type.if_tt_partial_fallback_is.tt_partial_fallback_accep": {"doc_hash": "66fae7fa6dbe10f6376ecb6adf0d68386a6545309b48ef05e3f54f237d397445"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fixup.py_TypeFixer.visit_typeddict_type_TypeFixer.visit_typeddict_type.if_tdt_fallback_is_not_No.tdt_fallback_accept_self_": {"doc_hash": "d94f1b88b94c5b8cddf9c2c54ee9dea33d4a6e9ddbf012a9be1bdbc9d6781f89"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fixup.py_TypeFixer.visit_literal_type_TypeFixer.visit_type_type.t_item_accept_self_": {"doc_hash": "46d854f5dd2423c1b6a69e3701264c1f2a94c99bf510cd447126deb0a5155bd4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fixup.py_lookup_qualified_typeinfo_lookup_qualified_typeinfo.if_isinstance_node_TypeI.else_.return.missing_info_modules_": {"doc_hash": "d44fa02b91ce1f7b5425470a176bbe4b40803f9faaf786fc0a40d75f5996643b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fixup.py_lookup_qualified_alias_lookup_qualified_alias.if_isinstance_node_TypeA.else_.return.missing_alias_": {"doc_hash": "3746680eac6925b38def31f067abe8e3397c8bf567d8b77cad9558ab132d51b9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fixup.py_lookup_qualified__SUGGESTION._missing_should_ha": {"doc_hash": "84628c89efb27ec1f1bc4bc0cc2144658269b41863a2c3837c75e195b6a1b529"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fixup.py__type_Final_": {"doc_hash": "ea41a5dac55d793ce1807a5e6b377216bf60053347547ef62ce6e439de14d989"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/freetree.py__Generic_node_traverser_": {"doc_hash": "97bd322214783c7b368cc5d1597950ca06c6a4902631a75ecfe81ce15d7b82e0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fscache.py_FileSystemCache_FileSystemCache.flush._type_Set_str_": {"doc_hash": "101c94d88ffab64b96a660da40e4a0e7a28282bb2ce294227cc3620ccbc3b32a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fscache.py_FileSystemCache.stat_FileSystemCache.stat.return.st": {"doc_hash": "96ee5739355454c9c03cf12be39c19817577ae1d40ad28c25fddebba222ac72d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fscache.py_FileSystemCache.init_under_package_root_FileSystemCache.init_under_package_root.return.ok": {"doc_hash": "a804ba45bd7490d85564ca7b804dbbc54b934b17b46f49be965b9cf28c0c4b8e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fscache.py_FileSystemCache._fake_init_FileSystemCache._fake_init.return.st": {"doc_hash": "595df4a5f8aade57a2840176e0af84ab2970f51382ffd4bc107b9a86c76f161e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fscache.py_FileSystemCache.listdir_FileSystemCache.isfile.return.stat_S_ISREG_st_st_mode_": {"doc_hash": "f06e0f6e724dc88953cc188d910e64d5a43d18ebe02063e720f79fadcf92d51b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fscache.py_FileSystemCache.isfile_case_FileSystemCache.isfile_case.return.res": {"doc_hash": "42d76618854673a18fe469c7c4c29b0b58dee66301ed16689a4650fb40c72151"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fswatcher.py__Watch_parts_of_the_fil_FileSystemWatcher._update.self__file_data_path_F": {"doc_hash": "fac2cfec495aec7c329a80f6fd5cbd28eabe43b3c5150272e4cfef33fe8204e4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fswatcher.py_FileSystemWatcher._find_changed_FileSystemWatcher._find_changed.return.changed": {"doc_hash": "2200813cb2dcac73b2befd82c09fd44c892cca6f32cfa4b6f309eb6f3184f833"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fswatcher.py_FileSystemWatcher.find_changed_": {"doc_hash": "3f191c0131dfef5869ea760815e7fd1830d2e2d3f38cf8a93e04f03f739ec1e7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/gclogger.py_gc_GcLogger.gc_callback.if_phase_start_.else_.assert_False_Unrecogniz": {"doc_hash": "c78f8a723b97b1dfb00066e29ab89f78cc304ac4860fd207f07cea268094788b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/gclogger.py_GcLogger.__exit___": {"doc_hash": "5fc3c03cb296d69932f5177bf7e7d6052ed120b849e84836e13aca4297e77fc1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/indirection.py_from_typing_import_Dict__extract_module_names.if_type_name_is_not_None_.else_.return._": {"doc_hash": "b138b3cec6304548da45ab93de480ab9683d8f6c3c49991cfab2277058f71fb9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/indirection.py_TypeIndirectionVisitor_TypeIndirectionVisitor._visit.return.output": {"doc_hash": "73a7230f27547638774ced500e1871cc779ab2a5e94c38e458c5db751cd0a790"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/indirection.py_TypeIndirectionVisitor.visit_unbound_type_TypeIndirectionVisitor.visit_type_var.return.self__visit_t_values_s": {"doc_hash": "757d95c1c4e412f0210b95118e23bda0c2cfde693b675cd49bb70852d589b7bb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/indirection.py_TypeIndirectionVisitor.visit_instance_TypeIndirectionVisitor.visit_instance.return.out": {"doc_hash": "0da7b3204e0740e99a71c0244722cdf3841a79cb1e7c3e778793d2eccfb4c5b1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/indirection.py_TypeIndirectionVisitor.visit_callable_type_": {"doc_hash": "ca00246f0a045b8762942f541bf88337b8caa7b6448a22c0657276e0f12b6eb3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/infer.py__Utilities_for_type_arg_": {"doc_hash": "0a9f8676242ae81122ff6d4babf3b998f2351939de6692a743671cfddf52da67"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/ipc.py__Cross_platform_abstrac_IPCException.pass": {"doc_hash": "3f64fdd9269bcad41ee1f7c3ac18a474a786ec3acfeb895b6a34352ba08b9ae2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/ipc.py_IPCBase_IPCBase.read.return.bytes_bdata_": {"doc_hash": "f723875dde0267b446fb85947469429ad4dd96fc5d2c25f59e0f729cf3c6568b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/ipc.py_IPCBase.write_IPCBase.close.if_sys_platform_win32.else_.self_connection_close_": {"doc_hash": "2199e1677fd01f4ef58df5b8d940282c61e858312fd848dd6994d7babeeb29b7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/ipc.py_IPCClient_IPCClient.__exit__.self_close_": {"doc_hash": "134730c4f6c37cbd5a06b30acac82464baf4ba7257a3e372247775b9996a7fc2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/ipc.py_IPCServer_IPCServer.__init__.None_1.else_.if_timeout_is_not_None_.self_sock_settimeout_time": {"doc_hash": "b07952b75aaff91066ee6cbbf9b968462a3e62f5f9c26f705e075f248f2c43b6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/ipc.py_IPCServer.__enter___IPCServer.__enter__.return.self": {"doc_hash": "6b8cf1395b158fb98c5f39d7df06078bb48b03c6300888b86a3f8b1b2d461eb8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/ipc.py_IPCServer.__exit___": {"doc_hash": "644c04f74ef13b0f94528aee392b265a18480f59c8ffc32083a4c2d0f7557a88"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py__Calculation_of_the_lea_from_mypy_import_state": {"doc_hash": "bc5377da46ee417c2b3ca83b1d8aabeeffeef96aa4c03526762b241a875be420"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_join_simple_trivial_join.if_is_subtype_s_t_.else_.return.object_or_any_from_type_g": {"doc_hash": "5ed5b6d0a330b066623eb81139fb5ce03fe3b06370817e8958954f80a8aa731f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_join_types_join_types.return.t_accept_TypeJoinVisitor_": {"doc_hash": "341b7005e3b57cdf6ef9868a12017dee8e73931238f81707915c588202305716"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_TypeJoinVisitor_TypeJoinVisitor.visit_type_var.if_isinstance_self_s_Typ.else_.return.self_default_self_s_": {"doc_hash": "97a3f8e8ad7d6908bc5a922210aa2d77b4dfad287ceca2ff3ff988a4791a73dc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_TypeJoinVisitor.visit_instance_TypeJoinVisitor.visit_instance.if_isinstance_self_s_Ins.else_.return.self_default_self_s_": {"doc_hash": "2b8a579d342d870885ba798b6145d73840a7082ced2474ce66a8a31c9fcc68a0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_TypeJoinVisitor.visit_callable_type_TypeJoinVisitor.visit_callable_type.return.join_types_t_fallback_se": {"doc_hash": "dc47c099ff72da042b6b55d911cf4eae6e32cd5faa416f939a3ef731938b60a2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_TypeJoinVisitor.visit_overloaded_TypeJoinVisitor.visit_overloaded.return.join_types_t_fallback_s_": {"doc_hash": "9cbc03ab474b8df7dc75d17b578e180ef40d4654383bc7b099e5bccba226f082"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_TypeJoinVisitor.visit_tuple_type_TypeJoinVisitor.visit_tuple_type.if_isinstance_self_s_Tup.else_.return.join_types_self_s_mypy_t": {"doc_hash": "fed29b94c652d47323c849d72e29f53ef9c8ed222925de747bd67f8e0583da60"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_TypeJoinVisitor.visit_typeddict_type_TypeJoinVisitor.visit_typeddict_type.if_isinstance_self_s_Typ.else_.return.self_default_self_s_": {"doc_hash": "0c18509c90e7f72d8b5296876c220cf34a4fedfdf90ca299257e448c28a3503e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_TypeJoinVisitor.visit_literal_type_TypeJoinVisitor.join.return.join_types_s_t_": {"doc_hash": "9dab7500c157832d1e24761fd630d793cf63d48b8be53456288ea3c3c452fadf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_TypeJoinVisitor.default_TypeJoinVisitor.default.if_isinstance_typ_Instan.else_.return.AnyType_TypeOfAny_special": {"doc_hash": "2f41d49ac238096e197c8d5e42c26d140a3ceee21cacfe5ed738ba93d4942ff3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_join_instances_join_instances.if_t_type_s_type_.else_.return.join_instances_via_supert": {"doc_hash": "b48e04c4d71882ce4e81275f3d17c6201ee98ad6bcedf6f2c1164c16c36909e7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_join_instances_via_supertype_join_instances_via_supertype.return.best": {"doc_hash": "aa44891eadaa90be506f71c507cb25f1d5303352d80920c50220f3ca590ecd9d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_is_better_is_similar_callables.return._len_t_arg_types_len_": {"doc_hash": "eea80d70b4ec31fdc5d27935613984588fca857c24ea8bfde71f8ab65bc62e5c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_join_similar_callables_join_similar_callables.return.t_copy_modified_arg_types": {"doc_hash": "715a8b1c778e10038cd3873b79cdd0e1340dd344509876f34b71970f1ecc5637"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_combine_similar_callables_combine_similar_callables.return.t_copy_modified_arg_types": {"doc_hash": "81eff7025d1686abfd057ed70bdaeecd92510dfb13323f9e6ccb09aa34ade570"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_combine_arg_names_combine_arg_names.return.new_names": {"doc_hash": "59ca64d2e37a6d0f0ba7a9b5a1fab273bfb4d93786ac0c26fc7848d4675f0866"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_object_from_instance_object_or_any_from_type.return.AnyType_TypeOfAny_impleme": {"doc_hash": "4a509622f71a400771c596186bf8fc7cb2e3dd1a9a31e1beef7857fcde16c6a9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_join_type_list_": {"doc_hash": "0deb5881e8baeef84136d715be0854b57605a06a05c12bf0232375c61ab8089b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/literals.py_from_typing_import_Option_from_mypy_visitor_import_": {"doc_hash": "240b2cc421ae7752ea0577db9c815ff4c744f7501dc49590a97cc10f98256ea3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/literals.py__Note_Literals_and_lite_literal_hash.return.e_accept__hasher_": {"doc_hash": "7a2c8c706ec3d3a8bf9b90c460925828cc980a8af1c89a6a2cf3f0757dbb3d8c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/literals.py__Hasher__Hasher.visit_yield_from_expr.return.None": {"doc_hash": "01037caf3ed24fcf1d8e3c4e16d312ca04cfd5d9ec9dc79000331d2f011ddcae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/literals.py__Hasher.visit_yield_expr_": {"doc_hash": "543b2a845d9d6dd5abea9770ba7a970df28b8bc0f0c215470ee1ec9ba0ec384a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/lookup.py___": {"doc_hash": "ea8e1cb6a3b07d08d14cd5ea4fb755ac220bfa4b12f0e3193fa99828e59e0e9e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py__Mypy_type_checker_comm_stat_proxy.try_.else_.return.st": {"doc_hash": "c44655a1816b0fde77dd2bd40838580abe1955610257a02fa20a7c3bde0cc6f8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_main_main.list_res_": {"doc_hash": "09485bb996b2356cc4d81f708d08332843001d6308bf4847f6fbfed469b54977"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py__Make_the_help_output_a__AugmentedHelpFormatter._fill_text.if_n_in_text_.else_.return.argparse_HelpFormatter__f": {"doc_hash": "1afa7594fbcc4814f01d5e0c8acfe8466c53f747a72be15987869c0a4e8da17c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py__Define_pairs_of_flag_pr_PythonExecutableInferenceError._Represents_a_failure_t": {"doc_hash": "88c23611ed4dc849d2f17d52d1499a5b5ec465b034a2d9b5886d53a5b1bc41ab"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_python_executable_prefix_python_executable_prefix.if_sys_platform_win32.else_.return._python_format_v_": {"doc_hash": "1e2c1851b2212e1f0f80fa34d8231d1f85801c175639ec151aa116e2f6a0f1e9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py__python_executable_from_version__python_executable_from_version.try_.except_subprocess_Called.raise_PythonExecutableInf": {"doc_hash": "ee5dbe68ae7328524b12b94a0a2bfd97b22295c5bc9eebe6e7c3f964e580e0ca"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_infer_python_executable_infer_python_executable.options.python_executable.python_executable": {"doc_hash": "67f4b82e22b06af1308f464d7c1e4cd2217cafe1371e7a5aa1e539021b167900"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_HEADER_FOOTER._Environment_variables_": {"doc_hash": "f6de63283e748cf919a96723e137627cbd94ff773275089a441e0baeac055a05"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_None_9_CapturableArgumentParser.exit.sys_exit_status_": {"doc_hash": "33a50394510adbec0332509da7bf752fabf6365e49399aa3e34a37fed7eeb5ac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_CapturableArgumentParser.error_CapturableArgumentParser.error.self_exit_2_gettext_p": {"doc_hash": "917f021d5aa20a0d9adf3a35ac5c16813ad71e404abc1e970d623138ce1d9d03"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_CapturableVersionAction_CapturableVersionAction.__call__.parser_exit_": {"doc_hash": "d9e5a7872ce96dd04e45c126fe1867558b5e8bea6f7ae9ec7ba5ace07159b753"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_process_options_process_options._type_List_Tuple_str_b": {"doc_hash": "dcefe3a2a9de00e9415a13b7cc9443e879c09cce009e236552066abe832b5025"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_process_options.add_invertible_flag_process_options.add_invertible_flag.if_strict_flag_.strict_flag_assignments_a": {"doc_hash": "9a2f1674c4a462481c592abfe8d5e8895ddeefd84cbde29e3927f4e556d6e4a0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_process_options._Unless_otherwise_specif_process_options.platform_group.parser_add_argument_group": {"doc_hash": "6aaaac5a1e921cb3fef0bc317bda211082a8e82f60963cdbecd2c7050b1e87ae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_process_options.platform_group_add_argume_process_options.None_23": {"doc_hash": "aeae231d1d6baca97333ceb95419baf0fc21ccabd982c380f222e5ce7e74dc50"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_process_options.None_24_process_options.strictness_group.parser_add_argument_group": {"doc_hash": "2359877959f51082d7fab5a0314a568639f2a118bbf85a02153a606c9b222a4d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_process_options.add_invertible_flag_al_process_options.incremental_group.parser_add_argument_group": {"doc_hash": "5fa20dd9972b81b2fb01c48781657e4893f56c8ff9c7488e3ad361229fe5cef1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_process_options.incremental_group_add_arg_process_options.other_group.parser_add_argument_group": {"doc_hash": "4e235fa35eebf99403a3f1e4c0594401f92f230296dc538029a3e7246b3e4779"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_process_package_roots_process_package_roots.fscache_set_package_root_": {"doc_hash": "b8a6e131a63387365b580d28ea3f2d676ccba9fe5f3860e4ffc8b32778c16748"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_process_cache_map_process_cache_map.for_i_in_range_0_n_3_.options_cache_map_source_": {"doc_hash": "dd85cfa09fa1a2d94bc3606956a03f9eaaf80c2e59f5eee755dfb238b01a7748"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/maptype.py_from_typing_import_Dict__map_instance_to_supertype.return.map_instance_to_supertype": {"doc_hash": "a543525d0f000d693db2ebf5f8981f25a55ca3d837c2a60d2b43830f1233e9ad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/maptype.py_map_instance_to_supertypes_map_instance_to_supertypes.if_result_.else_.return._Instance_supertype_any": {"doc_hash": "3f05c5d617c3bd6d6ece569f013049be2552e7db35ed6a0133b422f24ee62009"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/maptype.py_class_derivation_paths_class_derivation_paths.return.result": {"doc_hash": "1af530aed95ec60dd4cd40b51b6e4514cbe9b9a4be0cc8e764d30b5e284e8bf3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/maptype.py_map_instance_to_direct_supertypes_map_instance_to_direct_supertypes.if_result_.else_.return._Instance_supertype_any": {"doc_hash": "d77c5ea542cb0bdc5fb416d42560b7a1f259392a3a627097fe420c4030d55efa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/maptype.py_instance_to_type_environment_": {"doc_hash": "4a057ffb2ce58b2e4f4fc183411c6f63982ecf36ea8c8e8f19193952b370551b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_from_mypy_ordered_dict_im_trivial_meet.if_is_subtype_s_t_.else_.if_state_strict_optional_.else_.return.NoneType_": {"doc_hash": "0fa9f17ef7d1ee8c3a320df19f45d1213c69e7e3aa45668d786e94c0a1dac9d2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_meet_types_meet_types.return.t_accept_TypeMeetVisitor_": {"doc_hash": "ec483122e9565675c212e0aabeedc6ad94a102554f464edfed250db94041abb1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_narrow_declared_type_narrow_declared_type.return.narrowed": {"doc_hash": "4fc0a1fea136272f23ed8e04424901e7471f785c8e6b891f37c42b8d83fbfcc7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_get_possible_variants_get_possible_variants.if_isinstance_typ_TypeVa.else_.return._typ_": {"doc_hash": "ae790619c09f1767883d8ca5f658e45243e6a37c9a334534c3a04f54ab289f83"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_is_overlapping_types_is_overlapping_types._we_skip_these_checks_to": {"doc_hash": "8996eca416759b7b3258e516f372f2f8f649255b15e7e8d39486995618cca118"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_is_overlapping_types.is_none_typevar_overlap_is_overlapping_types.if_isinstance_left_TypeT.return._is_overlapping_types_lef": {"doc_hash": "0c0fa3d66fb397123b373341aea0c0372038885c55679ac4e08ca5fa1e970217"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_is_overlapping_types._type_object_overlap_is_overlapping_types._type_object_overlap.return.False": {"doc_hash": "84aa4fbddabb3b45ecb19201962ca1795ddcef6fdb7eca719594bd18bd431f7d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_is_overlapping_types.None_11_is_overlapping_types.return.False": {"doc_hash": "65b3de45531185ba35b3de77589546f1cf46d298559867206bb758c90f5672fa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_is_overlapping_erased_types_are_typed_dicts_overlapping.return.True": {"doc_hash": "5120d675badee23cdfce9acd04d28e8ce6211b05501fc372616024b33b4d4703"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_are_tuples_overlapping_are_tuples_overlapping.return.all_is_overlapping_types_": {"doc_hash": "c646af24b6e513e8e8352b1783ac1b5b43377c4b34a838449bb39757ca7652ae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_adjust_tuple_is_tuple.return._isinstance_typ_TupleTyp": {"doc_hash": "4088b92d3b0fe32c523ce898198e007f648a028f93c083371d34ff1d970ba6bb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_TypeMeetVisitor_TypeMeetVisitor.visit_type_var.if_isinstance_self_s_Typ.else_.return.self_default_self_s_": {"doc_hash": "80a731e497f4cbb1e85c9c47ea430f1fd5f577c32ed6385cf927a31c81b7a8cb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_TypeMeetVisitor.visit_instance_TypeMeetVisitor.visit_instance.return.self_default_self_s_": {"doc_hash": "c5b6828c7e453a3806d0ab12e06c02b5d478716d4a83fd28d7b051c453f2e1ca"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_TypeMeetVisitor.visit_callable_type_TypeMeetVisitor.visit_callable_type.return.self_default_self_s_": {"doc_hash": "6a259da836465dec747435567677ea89790ae403f460545c1509bbbd7fea1ed0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_TypeMeetVisitor.visit_overloaded_TypeMeetVisitor.visit_overloaded.return.meet_types_t_fallback_s_": {"doc_hash": "2f0c7f99714672132eb1150688301c80aa1ad66e8db2197c7f817219061a4f88"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_TypeMeetVisitor.visit_tuple_type_TypeMeetVisitor.visit_tuple_type.return.self_default_self_s_": {"doc_hash": "c64b2f225a275d916c1635e48244fa5e7527ced4f1d66462cd2bdc3cbe10e266"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_TypeMeetVisitor.visit_typeddict_type_TypeMeetVisitor.visit_typeddict_type.if_isinstance_self_s_Typ.else_.return.self_default_self_s_": {"doc_hash": "1207765bba1b9a41044598e3d1b99fedaa78b22907209d5e24af596ae514fa52"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_TypeMeetVisitor.visit_literal_type_TypeMeetVisitor.visit_type_type.if_isinstance_self_s_Typ.else_.return.self_default_self_s_": {"doc_hash": "2c9adfe2fddaba988551f7475bb82b11caf501de0f2d8e03e0508cb1927ef360"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_TypeMeetVisitor.visit_type_alias_type_TypeMeetVisitor.default.if_isinstance_typ_Unboun.else_.if_state_strict_optional_.else_.return.NoneType_": {"doc_hash": "0f6a5a7fedf4a51ad30336c34e41ad324e7c00970195504114aac47ea82eab30"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_meet_similar_callables_meet_type_list.return.met": {"doc_hash": "3cba4993560a7bdb81d74d4497b40c1e9b84c253be93cb0ec4ba5e2ac0a1ecd9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_typed_dict_mapping_pair_typed_dict_mapping_pair.return.isinstance_other_Instanc": {"doc_hash": "ce01829e4bc38f713d1fda2ecd5ec7196e6dd63f83a634055c8990067f5851fe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_typed_dict_mapping_overlap_": {"doc_hash": "05a50bed5fc72bd8ad729781c33232ba59ef28cabc387fb88b30f0d772c866e3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/memprofile.py__Utility_for_dumping_me_collect_memory_stats.return.freqs_memuse": {"doc_hash": "93628db03545f8faf9017b6d837038cac3e8af374343b3d6da33b5b08bbb2a17"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/memprofile.py_print_memory_profile_print_memory_profile.print_Total_reachable_": {"doc_hash": "8af8143c66acce54c33ac7779fb7d1b99b93eb4030bb1950ce3aec736e6237ba"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/memprofile.py_find_recursive_objects_": {"doc_hash": "605dce5ea05de08528ff5e7b80e6e40c93c10e5c9513e7890ccf06f2bd9f19c8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/message_registry.py__Message_constants_for__None_32": {"doc_hash": "aeccac84dc0ba19fa23b41dcbf7d5fbd49012eccd6dc938714979fca5b0d8a4c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/message_registry.py_NON_INSTANCE_NEW_TYPE_None_70": {"doc_hash": "da100fd9c9e8d5447390d00cb029c5ae46edc0ac10978c704c3bb1b36dd1a1d2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/message_registry.py_UNSUPPORTED_ARG_2_FOR_SUPER_": {"doc_hash": "61c05f373fc0df4db78a83e72bba2a69e9591d9e1eece9ea2fc30a8f60e24ffa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py__Facilities_for_generat_SUGGESTED_TEST_FIXTURES._": {"doc_hash": "a9569f7faf6f77daaac3e9817cccb20373c9b75b37eaed6bc92ba66710d616d2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_None_6_MessageBuilder.most_recent_context.return.node": {"doc_hash": "b68e6469457a49ba7d9a1f517f00410645b1c473c6e2615a810b4ed9b9d47d82"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.report_MessageBuilder.report.if_self_disable_count_.self_errors_report_contex": {"doc_hash": "ff6a8dd5e84166653821d939ba113e47178b11346c71829057c61333051a3ccf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.fail_MessageBuilder._on_them_": {"doc_hash": "ddd245b214f48b7b1578d889b67d9b36a0581e9b24df35ce9edee4e60468c6ee"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.has_no_attr_MessageBuilder.has_no_attr.typ.get_proper_type_typ_": {"doc_hash": "e2611a73eb327c640ce1b0e980b7884f340df3eed6e690e767c13f09028a397e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.has_no_attr.if_isinstance_original_t_MessageBuilder.has_no_attr.return.AnyType_TypeOfAny_from_er": {"doc_hash": "f3e92953f69b98910faa56d79c1d99bf3967ea3988dbbc79b2f821c33f5cb8ad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.unsupported_operand_types_MessageBuilder.unsupported_operand_types.self_fail_msg_context_c": {"doc_hash": "5d4f20d3e02904e6dc8e31d44743a5ccbffbf212f4448b8845ec518778f816a7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.unsupported_left_operand_MessageBuilder.untyped_function_call.return.AnyType_TypeOfAny_from_er": {"doc_hash": "5970d8d09427a252255eba9712bd5460a9ddd2e04936d0fc6a33572ea822a8aa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.incompatible_argument_MessageBuilder.incompatible_argument._type_List_str_": {"doc_hash": "2153eb6c5b3162f5045a1652b44048f141f276e61bec2f6a0e3265543e24dd57"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.incompatible_argument.if_callee_name_list__MessageBuilder.incompatible_argument.return.code": {"doc_hash": "a579062a0a85ea8e718d28399c82283135efdd10925ba6dcf604b4b724a6e9b3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.missing_named_argument_MessageBuilder.too_many_positional_arguments.self_fail_msg_context_": {"doc_hash": "b1ad1cc85f17945c61d2740dae6ef9f5ede04ce6820db420f8fd995d002b54bd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.unexpected_keyword_argument_MessageBuilder.unexpected_keyword_argument.if_module_.self_note_defined_her": {"doc_hash": "d353df5cfd4450b51d5fcfdfdc80422f9b4c6beeae2ad899a74f8243e1964159"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.duplicate_argument_value_MessageBuilder.does_not_return_value.if_name_is_not_None_.else_.self_fail_Function_does_": {"doc_hash": "c9d1355eb594ec3117deb811a13388168ef1fdb2e34f416f7a1fb3ae5aaa4c6c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.deleted_as_rvalue_MessageBuilder.deleted_as_lvalue.self_fail_Assignment_to_": {"doc_hash": "4fe8a112e5aa8a3193ae287ce09994429d81d038a58435480789d77f7e6367c4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.no_variant_matches_arguments_MessageBuilder.no_variant_matches_arguments.self_pretty_overload_matc": {"doc_hash": "f71656b250cff6bee19a68bacbb4db977827178a081744926aac519637b2a752"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.wrong_number_values_to_unpack_MessageBuilder.incompatible_operator_assignment.self_fail_Result_type_of": {"doc_hash": "a81ea847402ee7cbf6f12f300adfa113e0923aa8e806e5192a7a23a04155ae8d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.overload_signature_incompatible_with_supertype_MessageBuilder.signature_incompatible_with_supertype.self_fail_Signature_of_": {"doc_hash": "feb3300c3791bdf4789edbe37177d32ef57d3e28a028fdcca181a462a184f2d8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.argument_incompatible_with_supertype_MessageBuilder.argument_incompatible_with_supertype.if_name___eq___and_t.self_note_multiline_multi": {"doc_hash": "2fb813076623cd6081ed11878375e4dceefbfd9a18ab11b24a485c04f5b3be46"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.comparison_method_example_msg_MessageBuilder.return_type_incompatible_with_supertype.self_fail_Return_type_": {"doc_hash": "7f05ce4e21b30279c7e582ec5508c025c98ee506d268904211db0837e1858e97"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.override_target_MessageBuilder.incompatible_type_application.if_expected_arg_count_.else_.self_fail_Type_applicati": {"doc_hash": "d043bc2be2fabaebebba4e1b60717843334ff14f34cb1c8faa2f5312ad7140ed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.could_not_infer_type_arguments_MessageBuilder.undefined_in_superclass.self_fail_undefined": {"doc_hash": "6921a533f961df0cce454f257a878bb1ccb38aad7691de13f6f725d1c009e541"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.first_argument_for_super_must_be_type_MessageBuilder.first_argument_for_super_must_be_type.self_fail_Argument_1_for": {"doc_hash": "2998eba5b45191bb5f8813b1890a6efae0b67540d56a0c52af374ccedc7f29df"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.too_few_string_formatting_arguments_MessageBuilder.base_class_definitions_incompatible.self_fail_Definition_of_": {"doc_hash": "197902806d347b3db558cb32c8ef7bcaa3d0a1bb3a72826da001a8388cc2f17f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.cant_assign_to_method_MessageBuilder.incompatible_typevar_value.self_fail_message_registr": {"doc_hash": "e6e2605ab8c82181e112a2805d9211430058379a1ec7d96705512aa85d7e7968"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.dangerous_comparison_MessageBuilder.dangerous_comparison.self_fail_message_format_": {"doc_hash": "985886f593960e9f02dbb9fad36ba645cb7eae2017ef7d3237a11e97a9d716ba"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.overload_inconsistently_applies_decorator_MessageBuilder.invalid_signature_for_special_method.self_fail_Invalid_signat": {"doc_hash": "905a00db976e2a3216077c4071e197d3bc106085f9e161fb32077c43898bef1d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.reveal_type_MessageBuilder.reveal_locals.for_line_in_.self_note_line_context_": {"doc_hash": "d1e7ce551bc39006d6a08621df403117d252de0812db343a355146ed4e1d16e9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.unsupported_type_type_MessageBuilder.unimported_type_becomes_any.self_fail_becomes_": {"doc_hash": "f1f4271a5b99f03df3277f5b437fad5cbe83776801ff7f8945da191585954a43"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.need_annotation_for_var_MessageBuilder.explicit_any.self_fail_Explicit_Any_": {"doc_hash": "bc34996e3506d64df338c19fb037e8de772a0efecd7d36fbb59e5a9611e9de10"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.unexpected_typeddict_keys_MessageBuilder.unexpected_typeddict_keys.self_fail_Expected_bu": {"doc_hash": "1824f2a617b695b52b12bcbad08d0f24c00e12db8ad158478570714430c8429e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.typeddict_key_must_be_string_literal_MessageBuilder.typeddict_key_not_found.if_typ_is_anonymous_.else_.if_matches_.self_note_Did_you_mean_": {"doc_hash": "7badd56ae9668dc29af3497728e110582b18c59ef11560dbe15051280d63c702"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.typeddict_context_ambiguous_MessageBuilder.incorrectly_returning_any.self_fail_message_contex": {"doc_hash": "72546cfc08272855bce5925751d372654421efbcbc8067a46ccae0ecdd269730"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.incorrect__exit__return_MessageBuilder.incorrect__exit__return.None_2": {"doc_hash": "a4206b56eab8acd1ae626ad93ec03e2011144f88b397abcd724bd2ea405277c8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.untyped_decorated_function_MessageBuilder.redundant_condition_in_comprehension.self_redundant_expr_If_c": {"doc_hash": "cf2d16e2b25151c7098e76bb9035906b1a44010f0542272c5933c44bd2cb57ff"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.redundant_condition_in_if_MessageBuilder.impossible_intersection.self_fail_template_format": {"doc_hash": "d2f23a7d142b5feccc30dc944330f34f0f286d8e2665d163e8f9c04119a19278"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.report_protocol_problems_MessageBuilder.report_protocol_problems.conflict_types.get_conflict_protocol_typ": {"doc_hash": "f5ae7c6bac60609e093b3d500a93d77488cd4b73357094597707c46aa5740fa9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.report_protocol_problems.if_conflict_types_and_no_MessageBuilder.report_protocol_problems.self_print_more_conflict_": {"doc_hash": "3c96f75467576c4acad49e8cfd098f65b6ea8619be19399e6cc5cb4a6fcfb4ec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.pretty_overload_MessageBuilder.pretty_overload.if_left_0_.self_note_msg_context_o": {"doc_hash": "aed95d6f3d4c53bf2b4ba06024097e4100210fce3d4e35d8c8fc5af72825e678"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.pretty_overload_matches_MessageBuilder.print_more.if_len_conflicts_max_i.self_note_more_confl": {"doc_hash": "fbbda03ccf3a44191b946476bbcfc3053ab255fac93b74ae6eaad8eefb8fa901"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.try_report_long_tuple_assignment_error_MessageBuilder.try_report_long_tuple_assignment_error.return.False": {"doc_hash": "e93514aa8901a798b2a35e9e6ebcc69bd441e15a0471f72e39aa035ec27718c4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.format_long_tuple_type_MessageBuilder.add_fixture_note.if_fullname_in_SUGGESTED_.self_note_": {"doc_hash": "424342ba688ee9e800685174dd05250256c81be438b42b49ec1c677ee5865af6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_quote_type_string_quote_type_string.return._format_type_string": {"doc_hash": "0649dfe2ec4d15dfe69efe0f4bdb0cb6b1ddb69e255a8c2da58b2399c1982e0b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_format_type_inner_format_type_inner.if_isinstance_typ_Instan.else_.return._object_": {"doc_hash": "02682eab8f59b4cba083afe81ecfd895beefb792a870892b7292ceb641f95501"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_collect_all_instances_CollectAllInstancesQuery.visit_instance.super_visit_instance_t_": {"doc_hash": "d8d667b607cce9389285a3a23bccfb874295fc14512bb10ebedecfc5a96c4975"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_find_type_overlaps_find_type_overlaps.return.overlaps": {"doc_hash": "1bd16a7a45a4c93ef07f60a67886aab4d76db7b7d2d7536ad132a0294eaa3708"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_format_type_format_type.return.quote_type_string_format_": {"doc_hash": "7e350c1aa3bfe757fbb487f2899357b9f7d3ab852e97d03c32a54f9f6086229f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_format_type_bare_format_type_bare.return.format_type_inner_typ_ve": {"doc_hash": "210eacf8fec8e93f477a1946f3e5655691038260f41e9a1f974d37de2ce1c689"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_format_type_distinctly_format_type_distinctly.if_bare_.else_.return.tuple_quote_type_string_s": {"doc_hash": "f819abe5c68678cc47a118b3b173f305e25a4dc28ae47ccbfa33dff7f062affb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_pretty_callable_pretty_callable.return._def_format_s_": {"doc_hash": "52de72c61e1454ba0492fed725272589831e263e94a78c4b110463297d45f2e1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_variance_string_get_missing_protocol_members.return.missing": {"doc_hash": "382fac9c363ea83fd6c8231c1a5a0dd45e78dcb812b31726343a948ad25dd4d7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_get_conflict_protocol_types_get_conflict_protocol_types.return.conflicts": {"doc_hash": "6874d0577b76deff7327d79ff52852debc15fa86065c893c36be0e6f53f7c821"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_get_bad_protocol_flags_get_bad_protocol_flags.return.bad_flags": {"doc_hash": "dd0e36038cb31e57413f50f179664651f440f28d045726957f76152ffe1192a3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_capitalize_best_matches.return.sorted_o_for_o_in_option": {"doc_hash": "d5647989f27c39697fed20eb74ca12026145438a94b1ddf14c26a073b0b6b138"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_pretty_seq_append_invariance_notes.return.notes": {"doc_hash": "0e7de43bad0f4ffe26c58e9fd03aa25a2496195b29fe01220956455206ee3aec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/metastore.py__Interfaces_for_accessi_if_TYPE_CHECKING_.sqlite3": {"doc_hash": "5ec5f5a033759e21692e34860594511fb7f3451a8790cb97bb5b6b10758e833c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/metastore.py_MetadataStore_MetadataStore.list_all._": {"doc_hash": "7b6d3a074f698683ebdccf77ca995d9006c16e57d59becc1cd78ffbfab91a71c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/metastore.py_random_string_FilesystemMetadataStore.read.with_open_os_path_join_se.return.f_read_": {"doc_hash": "ed24ea8113d42d06bfdc94d9748add8bcdfa4c9b7f1eff65bb920cb27597d490"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/metastore.py_FilesystemMetadataStore.write_FilesystemMetadataStore.list_all.for_dir___files_in_os_w.for_file_in_files_.yield_os_path_join_dir_f": {"doc_hash": "0f3b3d7fb90ea652ea7183b17db512582259f5a2eced62e35bc9ed7daf8450c0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/metastore.py_SCHEMA_connect_db.return.db": {"doc_hash": "b3bab2645ac5c6c270fb5c55263e01bb8a9dbe4b97921b139373c9b4b84ff30e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/metastore.py_SqliteMetadataStore_": {"doc_hash": "3ee3d4a0dff4f9de2d4b73907c61196b7c0b6fc9d39ad1134a94ea88ff10d5e9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/mixedtraverser.py_from_typing_import_Option_": {"doc_hash": "876e9c7b39d6a736b4833ff3f501ef9d8fd8aee40a442ff891f2527cb09c3d86"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_FindModuleCache_FindModuleCache.clear.self_ns_ancestors_clear_": {"doc_hash": "be2a2c39c25fe98a9261c21400c3d9152ddac5bce5ab72557431894bcc6d93c9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_FindModuleCache.find_lib_path_dirs_FindModuleCache.find_lib_path_dirs.return.dirs": {"doc_hash": "8b9813c6f0d3c0f08f2937a4d0335a843055f97be585f2ad57be5ce775c2bae4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_FindModuleCache.get_toplevel_possibilities_FindModuleCache.get_toplevel_possibilities.return.components_get_id_": {"doc_hash": "1182afc4b9e5edb0b01d35871c6a80ffd60240eae527a50ab90b725422183b59"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_FindModuleCache._update_ns_ancestors_FindModuleCache._can_find_module_in_parent_dir.return.False": {"doc_hash": "f5014d22cb6bcb7d5dcd9e5d451db2eeeeca9b0626b2c9475b04299482fea99e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_highest_init_level_mypy_path.return.path_env_split_os_pathsep": {"doc_hash": "1608966b9a4820f104b58c45ee674ef0c89d4da0a785e9d22c83ec19fc59475f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_default_lib_path_default_lib_path.return.path": {"doc_hash": "1ebf3e1e6aabf1168288b3600f602eaf768d4ed288e187a3ee633d17ad6b6248"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_get_site_packages_dirs_get_site_packages_dirs.return.expand_site_packages_site": {"doc_hash": "2a5adc219d4c25897b738e12ab2b036c350ec1bcce13f5e0a50ac82248db42df"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_expand_site_packages_expand_site_packages.return.egg_dirs_site_packages": {"doc_hash": "4c3f93644d41edcc0c6f6ddb094f7185c42463905a73463c9a45d083a8f72b88"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_compute_search_paths_compute_search_paths.egg_dirs_site_packages_": {"doc_hash": "35cebb25e47b63867f9c50306815f54dd23e31267d0c7c6024ac0c18c145261e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/moduleinspect.py__Basic_introspection_of_InspectError.pass": {"doc_hash": "48c11996551be98dbb3ba02c2ec333c946536147d2271e2e2cbadeb631103d71"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/moduleinspect.py_get_package_properties_get_package_properties.return.ModuleProperties_name_nam": {"doc_hash": "907b7b170d7a568ae1fe082c7e12aaa3b97bc29c668ddfde2013cba9474a6026"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/moduleinspect.py_worker_ModuleInspect.close.self_proc_terminate_": {"doc_hash": "9bb1012da26e4a0c561b5ae235755c4330c5edd88c63c222d9860f8b34a178ce"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/moduleinspect.py_ModuleInspect.get_package_properties_ModuleInspect.get_package_properties.return.res": {"doc_hash": "cc1ff2a67ae3c7b68d82963527b5f587c2e956583edb36174067433625fa7114"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/moduleinspect.py_ModuleInspect._get_from_queue_": {"doc_hash": "f2504fc310673572f7017079cea5a50ba3d808f8d88a76a5a1c541c24af8aacf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/mro.py_from_typing_import_Option_MroError._Raised_if_a_consistent": {"doc_hash": "910fb0ea8af54071cc98441453235ed1f0e4bd43e49d93dff9d8afe2a29748da"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/mro.py_linearize_hierarchy_linearize_hierarchy.return._info_merge_lin_bases_": {"doc_hash": "50ee51edf26fcf8e895fb3903ea1b662a157f2928ffd6614dd384fe342a06a1b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/mro.py_merge_": {"doc_hash": "7905690d45cc326a05cb959c42d1ee6a2125d4dd5ca5cfe0a621b1326a9761a8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py__Abstract_syntax_tree_n_from_mypy_bogus_type_impo": {"doc_hash": "8bfddc1b7d2cf055bd40f860c668ca4ae6aeed82f1250b31f92cd9c215d554f9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_Context_Context.get_column.return.self_column": {"doc_hash": "6bb7555d2daed01df01cff9c27fbebd8101502ea3a2e7c9849639084fe557ba8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_SymbolNode_Definition.Tuple_str_SymbolTableNo": {"doc_hash": "31011e232ed1adbf405433e1bea41eb1b11d596b1b541600313c7924bd99b3b4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_MypyFile_MypyFile.deserialize.return.tree": {"doc_hash": "586d3c1da303b6c1238bd3f1ed1551be0f70c079496895598824d0d719cd7cad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_ImportBase_ImportBase.__init__.self.assignments._": {"doc_hash": "e610aa254588facc363f98692f7dee77bf7e1f00defb641f89ee34294472d8ea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_Import_ImportFrom.accept.return.visitor_visit_import_from": {"doc_hash": "032cd511ecc7b926dde272cbc723752e74003f5390e2893123f50451a20f6c33"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_ImportAll_ImportAll.accept.return.visitor_visit_import_all_": {"doc_hash": "8c016f0004be7276f2b252fb1b9de7d6647fae3be23130dfeed061e9983df279"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_ImportedName_FUNCBASE_FLAGS._": {"doc_hash": "4b6ed648d2d8cd19afe0bd6e0e4a70637f80ce4d0f676d92992c4800e52a98a6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_None_35_FuncBase.fullname.return.self__fullname": {"doc_hash": "036b9643e0d3c37bc17fb563aa2750321f84b8afccae5ab3c9b80de4058acd1e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_OverloadPart_OverloadedFuncDef.serialize.return._class_OverloadedFun": {"doc_hash": "ae1760bb1cf325916687dc0dd1d5f7e1c7d40becd863668070bba434244ba555"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_OverloadedFuncDef.deserialize_OverloadedFuncDef.deserialize.return.res": {"doc_hash": "294a628b24e8aa78a7f0eb9e58c17f70dcfd397f1f56953e0f4ce918bf5bb135"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_Argument_FUNCITEM_FLAGS.FUNCBASE_FLAGS_": {"doc_hash": "72205eadd41dfa7c8699906fbfbdfcaebd16251c633d215bb19f368aedad02ec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_None_36_FuncItem.is_dynamic.return.self_type_is_None": {"doc_hash": "48fada2539a767b22a431e6c755c46cbda264d0c5c1e6a1aeb325e7f99d0bd73"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_FUNCDEF_FLAGS_FuncDef.accept.return.visitor_visit_func_def_se": {"doc_hash": "6a8da7850a44f61925105cc19c8db6bc008c8f3ef4b497ddad976893bf23fef4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_FuncDef.serialize_FuncDef.serialize.return._class_FuncDef_": {"doc_hash": "b054daea15d06161bac77580d57e57e934c1005ece9f12e0c1e94c8e4d3873e9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_FuncDef.deserialize_SYMBOL_FUNCBASE_TYPES._OverloadedFuncDef_FuncD": {"doc_hash": "6d5bf735329364166d44408d2049c87e05668fca8a0bcc5329c30a0863b1f763"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_Decorator_VAR_FLAGS._": {"doc_hash": "eb978ffd8636de83332e7cd436669f76e58d0d4c2406ce867dc8d21805d05ab4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_None_40_Var.accept.return.visitor_visit_var_self_": {"doc_hash": "d7167a83b95fbbbfc1047ebbc57911fd626f5774898ec01df162b096e802abec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_Var.serialize_Var.serialize.return.data": {"doc_hash": "88a1439bc6673729c39ade221383e082af7d778e9d3f495c1c0efc50ebc77a12"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_Var.deserialize_Var.deserialize.return.v": {"doc_hash": "246264802813a8d402fa2807f1e7ce55fa4e6ef0ec3171de030cc76f0c1c82da"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_ClassDef_ClassDef.deserialize.return.res": {"doc_hash": "155afa00477b82e535dcc0db236c70a77d306f0f4a17f1cb05a04f7bddd0f454"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_GlobalDecl_NonlocalDecl.accept.return.visitor_visit_nonlocal_de": {"doc_hash": "ad289b1972fe875096898bff38eb766659accdb76df4f45052750461b62027ba"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_Block_ExpressionStmt.accept.return.visitor_visit_expression_": {"doc_hash": "eb91abd2291c561f82c1aa2bfdffe320b68183a9c2e430414d48d01f5f7b18b7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_AssignmentStmt_AssignmentStmt.accept.return.visitor_visit_assignment_": {"doc_hash": "16b350a567b483cf144248902cb42838e4ee066976672343190cea95e329c03e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_OperatorAssignmentStmt_WhileStmt.accept.return.visitor_visit_while_stmt_": {"doc_hash": "52c45bfaace3c12069b4d90f1a4e0fac8868ebadd948947b075fbb57108aedea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_ForStmt_ForStmt.accept.return.visitor_visit_for_stmt_se": {"doc_hash": "ccebb74ea2f127522e71bec22641a891235736edcc4b54b6a38b6d8ae1b81002"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_ReturnStmt_PassStmt.accept.return.visitor_visit_pass_stmt_s": {"doc_hash": "05733d9ae83846dfd6d3b58e6fde67e18d2eac3245f17fa0f9fa6914954679b4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_IfStmt_RaiseStmt.accept.return.visitor_visit_raise_stmt_": {"doc_hash": "d19bea05c397392628c7471239afd8b049704da46ba1e47639d0f0756b03f557"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_TryStmt_TryStmt.accept.return.visitor_visit_try_stmt_se": {"doc_hash": "6ad30b5b00d60ccaf0730473180463c8044f5438e45fc0bffc12366d100f01a6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_WithStmt_WithStmt.accept.return.visitor_visit_with_stmt_s": {"doc_hash": "dabf62dceca83268af727bc3b14d73f32c7095e4313493eaffe3cc3283d680f8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_PrintStmt_PrintStmt.accept.return.visitor_visit_print_stmt_": {"doc_hash": "d0e1764f0c380eba5dcc24e61bbbe556443b1f18a81ff2b95bac65dab9737661"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_ExecStmt_IntExpr.accept.return.visitor_visit_int_expr_se": {"doc_hash": "c52fae6767ef16ae5f310de168fac1812cda01b0da42c4df49907446cf447c42"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py__How_mypy_uses_StrExpr__StrExpr.accept.return.visitor_visit_str_expr_se": {"doc_hash": "78551a8426046f0ab13904eba081684c45aa079295b7c9c47b7d20dac6c2d1f8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_BytesExpr_BytesExpr.accept.return.visitor_visit_bytes_expr_": {"doc_hash": "e295a971427f16e784c88dbdc46d474ff8de4814ccc00ff1844050455ecb2214"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_UnicodeExpr_StarExpr.accept.return.visitor_visit_star_expr_s": {"doc_hash": "f086c7380f46fd12205436a41b82dd93b589d0b12b4616a305fbd25033283c9e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_NameExpr_NameExpr.serialize.assert_False_Serializin": {"doc_hash": "756c8413b4c0b2cf7e9059e6d66801217377b4841ab1698e74094ec90db76918"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_MemberExpr_MemberExpr.accept.return.visitor_visit_member_expr": {"doc_hash": "5db40d840a3d9f6d870a38d0c658a5a8d5c7520a225aaf2197c3cbbfb86474e0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py__Kinds_of_arguments_ARG_NAMED_OPT.5": {"doc_hash": "e82bd53c6a61e26a22291630241a6f4de953fcd43c75190705d7c20246f1120d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_None_65_CallExpr.accept.return.visitor_visit_call_expr_s": {"doc_hash": "8376d6488a93c912ae186157955328504acc8a5d60e20c8213de85d8f6eeb2c0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_YieldFromExpr_YieldExpr.accept.return.visitor_visit_yield_expr_": {"doc_hash": "b0436908ea1ee9b022ca20dfe5a4ce67088bfd645050c6ccbd54718eb1d2ce16"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_IndexExpr_IndexExpr.accept.return.visitor_visit_index_expr_": {"doc_hash": "fa364a8c536fe16d717f2b28cbabdad494d517c5b4ff27d3445441c1c43a82ae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_UnaryExpr__This_shortcut_is_used_o": {"doc_hash": "9b88dd22d4a53c9aa5df860678c4e09fd95157d59fd779325ff34d395816009a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_op_methods_that_shortcut_unary_op_methods._": {"doc_hash": "12e8048166afd5888be8bafc7090df0bc585fd78bc4d8094187275999e2d8af8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_None_80_OpExpr.accept.return.visitor_visit_op_expr_sel": {"doc_hash": "b845c2a3c68bdf0786da1c21ed40ed00e00e2133f39f970baca925aa1dac0cdd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_ComparisonExpr_ComparisonExpr.accept.return.visitor_visit_comparison_": {"doc_hash": "31b3364e584dd71a2a472570a2bee3cb7dad8ec021697b06bc4a8fc9350ad354"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_SliceExpr_SliceExpr.accept.return.visitor_visit_slice_expr_": {"doc_hash": "f445e8169703c84dd9434dd88dca576538b6863a2b1430053ea32f07ca3f340e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_CastExpr_RevealExpr.accept.return.visitor_visit_reveal_expr": {"doc_hash": "1bf1eac56db64d764eb2cc94a85d2db81f808028e9e4a82dd5ac56917b72f0f0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_SuperExpr_LambdaExpr.is_dynamic.return.False": {"doc_hash": "a34fb2f2cbd27f34fb84b458ca5ae55ca651ee5a34c48220c6aa9492ab92efbc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_ListExpr_SetExpr.accept.return.visitor_visit_set_expr_se": {"doc_hash": "3b0af4f617701092cf5af143ec589973cea60101009ab33f636a63c1475c3a07"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_GeneratorExpr_GeneratorExpr.accept.return.visitor_visit_generator_e": {"doc_hash": "4bc10f1d3c55eeca321dbb41e971c79146a26d247dcd645ad6745b935d3a3480"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_ListComprehension_SetComprehension.accept.return.visitor_visit_set_compreh": {"doc_hash": "5809da6bc7b1978c895f2b862b274101582c70938e9315b87d4c6ff50e5b089c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_DictionaryComprehension_DictionaryComprehension.accept.return.visitor_visit_dictionary_": {"doc_hash": "12f3251a366d90f2f1dba9f14a40da1a5e5ff1339b4ed50540ad36c4106246b8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_ConditionalExpr_ConditionalExpr.accept.return.visitor_visit_conditional": {"doc_hash": "ca4b129841a170c473e6c275713eb857c881a641a2c74346a6f2c18c1ff922bf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_BackquoteExpr_CONTRAVARIANT.2": {"doc_hash": "2133177f287f3a99f5b178163e4415ac3644be796531ca3ea438da766c206a12"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_None_92_TypeVarLikeExpr.fullname.return.self__fullname": {"doc_hash": "83d0a72a5fe0cdda9bff29c11a773d9b2588127ecf91417ea3d83ed3cafac487"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_TypeVarExpr_TypeVarExpr.deserialize.return.TypeVarExpr_data_name_": {"doc_hash": "e6447e539bbe0b7963d314f417ffef0f9cdfe57c3729308e73236f5d70925051"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_ParamSpecExpr_ParamSpecExpr.deserialize.return.ParamSpecExpr_": {"doc_hash": "78c673f08b54994a20fcb1523d5e3fe791e0aa3f13379ab3d26fec6ab4b347f3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_TypeAliasExpr_TypeAliasExpr.accept.return.visitor_visit_type_alias_": {"doc_hash": "5f7e320ca3840133d4395c624b440181c84e8dbad9a5e922fe1dba6a791bb5b0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_NamedTupleExpr_TypedDictExpr.accept.return.visitor_visit_typeddict_e": {"doc_hash": "59620533b87b82042289dcd125a0386ba834de0a8892d99a7924c8d45ff70281"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_EnumCallExpr_PromoteExpr.accept.return.visitor_visit__promote_ex": {"doc_hash": "4004e4d6febe3947a907ffcf2148570a5c46585ba2258277c7b6e3ccf37d146b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_NewTypeExpr_AwaitExpr.accept.return.visitor_visit_await_expr_": {"doc_hash": "8fbaa17871aee704e069dc355babe39319125ce9d0b1673bf0b07cc42c97ba42"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py__Constants_TempNode.accept.return.visitor_visit_temp_node_s": {"doc_hash": "702141bc76c8dfabf3eb824b30c5bb9de787a77cc1b0c9d9da8b6cf284db170e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_TypeInfo_TypeInfo._We_make_assuming_and_": {"doc_hash": "d04d9157654812b448b26fbb7f79a16a9441d974c2b4b367ff4721397b211ed4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_TypeInfo._since_this_would_requir_TypeInfo.fullname.return.self__fullname": {"doc_hash": "c3ff1f59bc4991e490b4e5b35300873e666212deeb91bde34bf5279da15ab43e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_TypeInfo.is_generic_TypeInfo.get_containing_type_info.return.None": {"doc_hash": "c9c445386f1e1b7e63ba7d023b2f09c9782d975977b9c131a09afa6dfe265cae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_TypeInfo.protocol_members_TypeInfo.protocol_members.return.sorted_list_members_": {"doc_hash": "d901f101f1aee47d068ce595b30f7d6649abcc58d04e1f984606b47f19f3924c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_TypeInfo.__getitem___TypeInfo.get_method.return.None": {"doc_hash": "fc1e9c771486b0cf7eb493881adbec541efa2e55be4d33e8959771f250dde884"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_TypeInfo.calculate_metaclass_type_TypeInfo.calculate_metaclass_type.return.None": {"doc_hash": "55c925b1f91dca77e992867cacc80ff766cbced7c19861b8777743439a13b387"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_TypeInfo.is_metaclass_TypeInfo.__str__.return.self_dump_": {"doc_hash": "aade022be71b1fad4a722bcf9c68a4d22da361eeed2169b8b51d661177995cd2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_TypeInfo.dump_TypeInfo.dump.return.mypy_strconv_dump_tagged_": {"doc_hash": "e9e730b9ec14d6b9cee9ce5ea13597591f35d44dcc3fc97735a5c2e8c91994fd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_TypeInfo.serialize_TypeInfo.serialize.return.data": {"doc_hash": "9606a580b245af8103a56900461468445b28de52722f30798a5cbb2a28d4d873"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_TypeInfo.deserialize_TypeInfo.deserialize.return.ti": {"doc_hash": "a0a4d4586eec2e40d0e84eb01c6e6a13fd681d604a669dbd1bbd9e5507db7806"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_FakeInfo_FUNC_NO_INFO.FakeInfo_FuncBase_for_no": {"doc_hash": "518c6e603d261ce3d9804622f6d02b93a257b265ddbcf49b5d1abd91ea070262"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_None_96_TypeAlias._": {"doc_hash": "e28258d84383e64bc8fec5c97ce5ef119b58b3f5f01598a74b8963dcef7dfc9d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_TypeAlias.__slots___TypeAlias.accept.return.visitor_visit_type_alias_": {"doc_hash": "a2f83928abfb6d63dbd6f141f14a58ba9a8766a498abd1f86d3dcf4502f22edf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_TypeAlias.deserialize_TypeAlias.deserialize.return.cls_target_fullname_lin": {"doc_hash": "ac9c54571f9fed2c1c19d9bfabb4437d978ad67b4a6c600e2836f8725a3c2965"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_PlaceholderNode_PlaceholderNode.accept.return.visitor_visit_placeholder": {"doc_hash": "e4a5cba41a5a7a679acea5e69cbeecf4b9caf1681b2332e10f2de07d069fd040"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_SymbolTableNode_SymbolTableNode.__slots__._kind_": {"doc_hash": "8a67743b115ad6ada59b4422e6467805f123a7f4cd1793ac4597f58c70a3b386"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_SymbolTableNode.__init___SymbolTableNode.__str__.return.s": {"doc_hash": "7b74cff23045a12e0e8f03c89cd3f415901cad8d67425fc4735cb6c95daecf1f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_SymbolTableNode.serialize_SymbolTableNode.serialize.return.data": {"doc_hash": "4ab0d25900aaea5f7263a81876b6744b4c1dc47358052dec661b06b5089f1917"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_SymbolTableNode.deserialize_SymbolTableNode.deserialize.return.stnode": {"doc_hash": "20210c86d06d4cb486f40375a32953062727b9ed298041a0ed0c4b1ad5ed9079"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_SymbolTable_SymbolTable.copy.return.SymbolTable_key_node_c": {"doc_hash": "edf650ade87a73bf574ad9e1b3a63c4440d186888df90c4336d88a3efac19596"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_SymbolTable.serialize_SymbolTable.deserialize.return.st": {"doc_hash": "b389ca5036f3ee57e3997d4d6926a1dc21acd44353170d51d381163a37fac0ed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_get_flags_deserialize_map._": {"doc_hash": "3efdd983a3fe970da9cf1259e86a87550ed14ba48e19ac918f43b555863acc00"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_None_97_check_arg_kinds.for_kind_node_in_zip_arg.if_kind_ARG_POS_.elif_kind_ARG_STAR2_.is_kw_arg.True": {"doc_hash": "563732501b5b541f32cc3ba9a37c0e53c57367d09450084943e2e1adefb8ba0d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_check_arg_names_is_final_node.return.isinstance_node_Var_Fu": {"doc_hash": "aa442f3b19f7d82eb1dffe537aabfe829e9bbb3eca3fc55a925fdee71a8a8f74"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_local_definitions_": {"doc_hash": "d1d5b2bfc509adf94d96aed6865063d5f0536d26e9103d88029818d6d9ddba7f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/options.py_Options._To_avoid_breaking_plugi_Options.apply_changes.return.new_options": {"doc_hash": "71d1c90d298d91d0d51383a2713b58c4b09a436d13d3e45953b3f9657cf78f1b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/options.py_Options.build_per_module_cache_Options.build_per_module_cache.self_unused_configs_updat": {"doc_hash": "0d24109d3949923c0ff794dfab72a9daefac043bb433824e43464e0519ecf0c1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/options.py_Options.clone_for_module_Options.clone_for_module.return.options": {"doc_hash": "08326f941700c2b7c4d515c2287501277fe291730b7d4d121a77339b685dd0cf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/options.py_Options.compile_glob_": {"doc_hash": "4eda7dfa5b4d34bff618c15c46baaf8989df27dc36e085c5df7707b1eb43a8f1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/ordered_dict.py__": {"doc_hash": "0fbf852be04c74271c95d5e8986460d1c40d2b805e3f7d790b7c68340ec5cc43"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/parse.py_from_typing_import_Union__": {"doc_hash": "c8708d11ee78e1893911dcfba3f8f373d02fa4c32a6f90623cda9964dc7ab542"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py__Plugin_system_for_exte_from_abc_import_abstractm": {"doc_hash": "fab13e1c4c85ecb1baa482125fa04762fca6f0b7f4bde8caa111a5df056cb278"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_from_typing_import_Any_C_from_mypy_errorcodes_impo": {"doc_hash": "0570059ef9962b1dfe189b4c211cdd66561979589860da3cf6a943c498c4b7fe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_TypeAnalyzerPluginInterface_TypeAnalyzerPluginInterface.analyze_callable_args.raise_NotImplementedError": {"doc_hash": "0c71c39f0b26c4cdb7d4825b668c26410f232a37165a682ae692e36eeb141d81"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py__A_context_for_a_hook_th_CommonPluginApi.lookup_fully_qualified.raise_NotImplementedError": {"doc_hash": "ed135e854fcfc43bcc2c260bebfff1f4de3144b6d952104985a86079dbfd5cae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_CheckerPluginInterface_CheckerPluginInterface.named_generic_type.raise_NotImplementedError": {"doc_hash": "867c2c33db5e5c2c3e565dd4f054ec11634116ba01ce910a8a8ffcf5e3917821"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_SemanticAnalyzerPluginInterface_SemanticAnalyzerPluginInterface.fail.raise_NotImplementedError": {"doc_hash": "17d544cf164c63fc3764daea2732a82029dea93686521534b4b7dc35e32f58fd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_SemanticAnalyzerPluginInterface.anal_type_SemanticAnalyzerPluginInterface.anal_type.raise_NotImplementedError": {"doc_hash": "199b3c6411d38c8fe649ca6cc0923891d188ef482d2ed2674f1b9c2b8766cc7f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_SemanticAnalyzerPluginInterface.class_type_SemanticAnalyzerPluginInterface.lookup_qualified.raise_NotImplementedError": {"doc_hash": "71c047b42a9e62f82fb62bcfdda682847d2d8976fa8ac8fb80f7631fc6aa1c05"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_SemanticAnalyzerPluginInterface.add_plugin_dependency_SemanticAnalyzerPluginInterface.add_plugin_dependency.raise_NotImplementedError": {"doc_hash": "4d7c633f285126ee50127e599e0b77718a400e02d07990436704bba2157b5691"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_SemanticAnalyzerPluginInterface.add_symbol_table_node_SemanticAnalyzerPluginInterface.final_iteration.raise_NotImplementedError": {"doc_hash": "554551c8aa0c4829b51fc9d3f91f24551ff92dc0504589464269e81f8d1031c5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py__A_context_for_querying___This_is_very_similar_to": {"doc_hash": "fb3b621a2fe02e08feadf48330a5c3822ca64837cde64b00baf13f3cab860d06"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_MethodContext_DynamicClassDefContext.NamedTuple_": {"doc_hash": "d164d579ad97fdac3069f85a7c3d4fa4eb2f3977cc24f5fd0a545e87e88a78a4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_Plugin_Plugin.lookup_fully_qualified.return.lookup_fully_qualified_fu": {"doc_hash": "1075172b065e4eb185c2410071cb10fc5476d472b630e5d04dc043359f23d2cc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_Plugin.report_config_data_Plugin.report_config_data.return.None": {"doc_hash": "eb8a1d7d48d1141f80f17d7f29552d39d52f7efd3afad111d8a16e4a3c5bfb95"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_Plugin.get_additional_deps_Plugin.get_additional_deps.return._": {"doc_hash": "1e1858299afda314ef0c583fb25ce8b38ac09f1b96011b3a1babadb479616f40"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_Plugin.get_type_analyze_hook_Plugin.get_type_analyze_hook.return.None": {"doc_hash": "22a8216dda3cced8d8817a9ebb8d327b53e5f9b7eede0f257162a463837c4ad7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_Plugin.get_function_signature_hook_Plugin.get_function_hook.return.None": {"doc_hash": "e619bd9cc5288912fe258caebabcfdf6ec351552ad9d22fa02f79e315cd04e37"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_Plugin.get_method_signature_hook_Plugin.get_method_hook.return.None": {"doc_hash": "48f0a47a7aa6b2c2d3a167f7ca7164ca0b8e68d447f767f8302fe0986dff6f03"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_Plugin.get_attribute_hook_Plugin.get_attribute_hook.return.None": {"doc_hash": "2081f088b28359c3b0859c19a37ec91b7d75402d8106f68269d89db5a9ea283c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_Plugin.get_class_decorator_hook_Plugin.get_customize_class_mro_hook.return.None": {"doc_hash": "1ef811070169a5bf05734fc2e962f84a4d24b4fc6f7b4cff3d62d5928b313211"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_Plugin.get_dynamic_class_hook_T.TypeVar_T_": {"doc_hash": "a787e63eaed8ecc9c414a321c59369eafd2f7208e6ac80d70ab46d9bbba4218f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_ChainedPlugin_": {"doc_hash": "d3d01c966b044846874cbc2541d799aa05c47991de2da05e0cf3cf9d8110d3b6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py__Plugin_for_supporting__Converter.__init__.self.is_attr_converters_optional.is_attr_converters_option": {"doc_hash": "0584d7d287832dbbb921b4bf9fe4b2dc22a31f54d8f20973493409337e89b0d3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py_Attribute_Attribute.argument.return.Argument_Var_self_name_ls": {"doc_hash": "38d98a618587270655d4c7685b10886a831a1268d51723eebb0f4432e14fdef7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py__determine_eq_order__determine_eq_order.return.order": {"doc_hash": "d217ab3214aeb2cac5661bb3c86a6cf37cb86e4d0c556daab403a95b77df8d2c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py__get_decorator_optional_bool_argument__get_decorator_optional_bool_argument.if_isinstance_ctx_reason_.else_.return.default": {"doc_hash": "7576676b46ccb1f4b8ab2de6278f15af35eb43cb56823f960c297c8c361ed4a8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py_attr_class_maker_callback__get_frozen.return.False": {"doc_hash": "e0e45041e814ca510a46793001b32cb9f9f559d186de0173609017d864763ca7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py__analyze_class__analyze_class.return.attributes": {"doc_hash": "0d10e4fbffccd61f8ab8d4be83e835eb4a492c6b78bd60c67bc21e6bf84e2dd1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py__attributes_from_assignment__attributes_from_assignment.for_lvalue_in_stmt_lvalue.for_lhs_rvalue_in_zip_lv.if_isinstance_rvalue_Ca.elif_auto_attribs_and_stm.yield__attribute_from_aut": {"doc_hash": "269c317a00d6401033c259c42fbc5719d1aea8048ba23c1d08ffbdad8a6f3182"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py__cleanup_decorator__cleanup_decorator.for_dec_in_remove_me_.stmt_decorators_remove_de": {"doc_hash": "e9c265a71ec036231cf23ca0b2fc76b050283c27aced85338312a2a9c4bf0802"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py__attribute_from_auto_attrib__attribute_from_auto_attrib.return.Attribute_name_ctx_cls_i": {"doc_hash": "99bdada38eabc153141b1e1769db0defb2d2ac025aab499d5aead93b3523c9e8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py__attribute_from_attrib_maker__attribute_from_attrib_maker.return.Attribute_name_ctx_cls_i": {"doc_hash": "3dcc3f0f22678026434ad25a78a7c683c0b3ac2185cc02fd43832234190c64fb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py__parse_converter__parse_converter.return.Converter_None_": {"doc_hash": "5289d3d3193293cad638b9fd7720576f786b40cc540afd7321f63079017e4380"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py_is_valid_overloaded_converter__parse_assignments.return.lvalues_rvalues": {"doc_hash": "c85ef82e2c3dc7f88ede7fb7ee224ed5a1077409ce29f5d312f1a2ee069d4e73"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py__add_order__add_order.for_method_in___lt___.adder_add_method_method_": {"doc_hash": "55304ca13627b3303538f8a39bd2d02eae0c0a0b2d86ba81b1452a722a047c93"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py__make_frozen__make_frozen.for_attribute_in_attribut.if_attribute_name_in_ctx_.else_.var.is_property.True": {"doc_hash": "95008fb0ebc50a2fad00ec40e290e128897fdadfe9f79defcdee7b36b0f77d1f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py__add_init__add_init.adder_add_method___init_": {"doc_hash": "789af370cb13270138d046b284e2266750a4dcb21bf2c1164c743f17b3a9a263"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py_MethodAdder_": {"doc_hash": "4a4bbfac5283997770094ebc92b14b959c352cac48a0738316ae054a2b6e05bc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/common.py_from_typing_import_List___get_decorator_bool_argument.if_isinstance_ctx_reason_.else_.return.default": {"doc_hash": "7dbaeb7f818fb1a22bdb36cc4608f4d7fceb124da3384c5c0bafe5aae23ea27e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/common.py__get_bool_argument__get_bool_argument.return.default": {"doc_hash": "ea7e90c084f5d60589a0daf3180d7608bf15cdaca6feae7b10bae6f99f9ae32c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/common.py__get_argument__get_argument.return.None": {"doc_hash": "cfdb9d4dd177d539c750801a809ff745f13788530ddadeeac41243d7baa82c23"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/common.py_add_method_add_method.add_method_to_class_ctx_a": {"doc_hash": "b0b9e47f26670c9cbdf0f8e0d55455db98c7cc51f369fa6ffc5b3f759b8c468b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/common.py_add_method_to_class_": {"doc_hash": "af7b20be30c367485520aeb794a1d5c9c5a9f25dcbae52d4b507a74bdb7bc6dd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/ctypes.py__Plugin_to_provide_accu__get_text_type.return.api_named_generic_type_": {"doc_hash": "c31fb4a3cca44f44ad8c78f9532230fb43bce1b1894c0257ee1197dc7fdf9e3c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/ctypes.py__find_simplecdata_base_arg__find_simplecdata_base_arg.return.None": {"doc_hash": "6df1d846a2e56cf4a163f89ed27e1d01b91bbecc13fd8169625502df50e09c05"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/ctypes.py__autoconvertible_to_cdata__autoconvertible_to_cdata.return.make_simplified_union_all": {"doc_hash": "3f50a7647b8bbebe8845b92af76cbfe0278b3e8fff8acb798f801793e2eda254"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/ctypes.py__autounboxed_cdata__get_array_element_type.return.None": {"doc_hash": "72021d89cac72dfcbab59213e07d296398d3cdd0b31c28466416c27c14e221e4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/ctypes.py_array_constructor_callback_array_constructor_callback.return.ctx_default_return_type": {"doc_hash": "49a985d2d09dc9616254cf89bef56066e1597c81f8275675d51637d241b7d662"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/ctypes.py_array_getitem_callback_array_getitem_callback.return.ctx_default_return_type": {"doc_hash": "93d8f31e6b54ad4ca3945afb0e152e30466857ef23dec0f0f3f919896031b9a3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/ctypes.py_array_setitem_callback_array_setitem_callback.return.ctx_default_signature": {"doc_hash": "37226f8ec5e90c894fb1fbd2603b45233c2e4e85c077c46ac8a1627cd65e994f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/ctypes.py_array_iter_callback_array_value_callback.return.ctx_default_attr_type": {"doc_hash": "a044379320353cf60bc45ec6f66e06372bb1197140f8dc6606bcf08af51f1ab6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/ctypes.py_array_raw_callback_": {"doc_hash": "aed6ff982395bdc3277421dc2e4e89b28dc0a6ebe09bfe02a448b6cc23d7ccce"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/dataclasses.py__Plugin_that_provides_s_SELF_TVAR_NAME.__DT_": {"doc_hash": "840ca6f08014d8cda5f72124ced0504dc2dc0da61045ebdfe6f890a19649366f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/dataclasses.py_DataclassTransformer_DataclassTransformer.transform.info_metadata_dataclass_": {"doc_hash": "8186b4bd25b4bce54070256aef968c99bc258310b3122fb01343d26f0c75108d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/dataclasses.py_DataclassTransformer.reset_init_only_vars_DataclassTransformer.reset_init_only_vars.for_attr_in_attributes_.if_attr_is_init_var_.for_stmt_in_info_defn_def.if_isinstance_stmt_Assig.if_isinstance_lvalue_Nam.lvalue.node.None": {"doc_hash": "1e01daa1df7bb148e6c810b832130ac56ced4420448b492ce0b2c8edc2430bb1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/dataclasses.py_DataclassTransformer.collect_attributes_DataclassTransformer.collect_attributes.all_attrs.attrs_copy_": {"doc_hash": "8a951b5f2557a06a3ba8d3f048bbd1bf1219b2accb20e5e75e7abc0603c6c579"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/dataclasses.py_DataclassTransformer.collect_attributes.for_info_in_cls_info_mro__DataclassTransformer.collect_attributes.return.all_attrs": {"doc_hash": "79ce16149f08486c039a803373fa7f5a745cdda0f75aa81683c6125ca8cfb85a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py_from_functools_import_par_from_mypy_checkexpr_impor": {"doc_hash": "4d42e64ff586c1754086431993044a603ae4646631ee4a847b535018e85653df"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py_DefaultPlugin_DefaultPlugin.get_method_signature_hook.return.None": {"doc_hash": "3cb88c8edbdd523940e4de11b71998b5892bdce0226b22eb46fb0f11eee69e68"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py_DefaultPlugin.get_method_hook_DefaultPlugin.get_method_hook.return.None": {"doc_hash": "827c89296f1f4222e2983f391245f9d15d3578fe9432b0e2cdbb8ef5370c5a11"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py_DefaultPlugin.get_attribute_hook_DefaultPlugin.get_class_decorator_hook.return.None": {"doc_hash": "1cbc70433ddf9b9585c1d8808a48c395d0a07da58605ccefa39114c2a84a380f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py_open_callback_path_open_callback.return._analyze_open_signature_": {"doc_hash": "fccbf0fe3b58d0cfa074c628336b419e6022721572e5a888cd676151c4fe9038"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py__analyze_open_signature__analyze_open_signature.return.default_return_type": {"doc_hash": "c88a8edea2061584dc43ea2fb3baa747d260811187d27307558416b53eb36eaf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py_contextmanager_callback_contextmanager_callback.return.ctx_default_return_type": {"doc_hash": "04253828a4d6906d0697b2932cb22ab75f269b5d4e901c8fa90f964090073ac5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py_typed_dict_get_signature_callback_typed_dict_get_signature_callback.return.signature": {"doc_hash": "6b4fd2eee260b4d52960ba8c0ae7e32693956503a2748ff2a2726313896b52b7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py_typed_dict_get_callback_typed_dict_get_callback.return.ctx_default_return_type": {"doc_hash": "258e1acb742b089eb915a35200d1105343067c9eddee68acad3b9933e53cb25d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py_typed_dict_pop_signature_callback_typed_dict_pop_signature_callback.return.signature_copy_modified_a": {"doc_hash": "ed174ee0c9efb56d636f5c508d4d592f6c567df70174a730bad00e8bb5d4cf89"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py_typed_dict_pop_callback_typed_dict_pop_callback.return.ctx_default_return_type": {"doc_hash": "032fc3230db110f307579a60a5373de90d98acf2b9a4e599e06fa72f1ec7ed65"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py_typed_dict_setdefault_signature_callback_typed_dict_setdefault_signature_callback.return.signature_copy_modified_a": {"doc_hash": "c7e646d7e51907b982872941bc49e619e1e118e3a4299405b5cc8835f4640815"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py_typed_dict_setdefault_callback_typed_dict_setdefault_callback.return.ctx_default_return_type": {"doc_hash": "9ebfa3ddcc665af73d548816386ee9b9ee1ffc86e3d156756d7f78116ec7a8bf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py_typed_dict_delitem_signature_callback_typed_dict_delitem_callback.return.ctx_default_return_type": {"doc_hash": "29849d6c18093235c72e62bf4f5e61196f19852bdc589640a990412e2c512271"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py_typed_dict_update_signature_callback_typed_dict_update_signature_callback.return.signature": {"doc_hash": "639f8beeedb58ac99b83ee4889a57f76071b5f0fdff4f42a83a72149f936de83"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py_int_pow_callback_int_pow_callback.return.ctx_default_return_type": {"doc_hash": "1d51c0925c6398cb2575d99ab95f03186d9023ffcfe4dbddb202d01c27851d18"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py_int_neg_callback_": {"doc_hash": "1e3ef73437c8eaac4f6420c7f1692fbd1d3b8e184f5d68f5b930e56d5dcaff4a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/enums.py___ENUM_VALUE_ACCESS._": {"doc_hash": "20bb85f844a9f8e11b09a17647b1f30291b16687b9fa695032fc446ad95e1a91"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/enums.py_None_6__first.return.None": {"doc_hash": "160b704e31db8886f0afe9f20b921c4c101f13d77d5af13a2f1b648262772e3b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/enums.py__infer_value_type_with_auto_fallback__infer_value_type_with_auto_fallback.return.ctx_default_attr_type": {"doc_hash": "4af8cee22d1c272426af10142a581e44d8fdff42be08aaa3d572f3ba24dc8f7a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/enums.py_enum_value_callback_enum_value_callback.return.underlying_type": {"doc_hash": "a3093120ba89ff6a9c45ebf72d14346d21ca6ab3d03e71be67d93209b1ec47e8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/enums.py__extract_underlying_field_name_": {"doc_hash": "85bfd95af33acde3564e330b2c1b41732b51c5ab4edacc9defe4af8802e8be4e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/reachability.py_infer_condition_value_infer_condition_value.return.result": {"doc_hash": "87984fed2b6ec529b543fa476ece3dbfca1d37e832dced8e80fa4d481d366e89"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/reachability.py_consider_sys_version_info_consider_sys_version_info.return.TRUTH_VALUE_UNKNOWN": {"doc_hash": "806aa8880d88c08e6df99dc25dbb080002a010696354481ec893467b731519cb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/reachability.py_consider_sys_platform_consider_sys_platform.if_isinstance_expr_Compa.else_.return.TRUTH_VALUE_UNKNOWN": {"doc_hash": "c6320770f653394024e7cb001d330f0b2d8314bb77a029ee83bb518ee58c3217"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/reachability.py_Targ_contains_int_or_tuple_of_ints.return.None": {"doc_hash": "cf041afc1e3690483499fe7177c5b6ff3f5d21c199c0032d69b63960f8d83aec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/reachability.py_contains_sys_version_info_contains_sys_version_info.return.None": {"doc_hash": "dcdfdb135b4101a618985bddafd6cd09c5a58e81a780a0379490ea0cc8a4d9c2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/reachability.py_is_sys_attr_": {"doc_hash": "8bb980f5383d610c0be21f50f9ca60d5af5adfe25c6ccf5dae8464459099c5eb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/renaming.py_from_typing_import_Dict__CLASS.2": {"doc_hash": "afb47d03de0dd72fba04d04f96df32d9beac365c810314dd80d1bc2d0f4b59a8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/renaming.py_None_3_VariableRenameVisitor.visit_mypy_file.self_leave_scope_": {"doc_hash": "30193ce57a90d01a528c4282ca77ad23318b9ee47ad3f73b1cc3afff155ff4fb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/renaming.py_VariableRenameVisitor.visit_func_def_VariableRenameVisitor.visit_func_def.self_leave_scope_": {"doc_hash": "b1668463d834bae6bd305852330d5625e363e9b3aaf014b764bddd9bd1b4b7aa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/renaming.py_VariableRenameVisitor.visit_class_def_VariableRenameVisitor.visit_try_stmt.self_leave_try_": {"doc_hash": "2f52f33a9801bc317f83417eb35debab6d9a16f3a8cb8d96fa166441e1fc7bd9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/renaming.py_VariableRenameVisitor.visit_with_stmt_VariableRenameVisitor.visit_with_stmt.stmt_body_accept_self_": {"doc_hash": "ff71b71c669ed23b2b48e03a68f96284be62243a033afacb834e7301fbbb90e0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/renaming.py_VariableRenameVisitor.visit_import_VariableRenameVisitor.visit_assignment_stmt.for_lvalue_in_s_lvalues_.self_analyze_lvalue_lvalu": {"doc_hash": "e92861d492e3fa3bcaa94de0925e2a78069f0a77ea5edd153af11edb35ebc85e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/renaming.py_VariableRenameVisitor.analyze_lvalue_VariableRenameVisitor.analyze_lvalue.if_isinstance_lvalue_Nam.elif_isinstance_lvalue_S.self_analyze_lvalue_lvalu": {"doc_hash": "0b971018817ba2f84bab94b976d3625751893a9ee4b202001e4c6e9eb26d8992"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/renaming.py_VariableRenameVisitor.visit_name_expr_VariableRenameVisitor.handle_ref.num_reads_name_num_rea": {"doc_hash": "2477c9585149d076060615ff08a8208863eb6268dfa4f79842379ffeaf58f4a4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/renaming.py_VariableRenameVisitor.flush_refs_VariableRenameVisitor.flush_refs.self_refs_pop_": {"doc_hash": "67f8be0c387c6537785318cbc0b6ac13c1b644f2d022bff467e1527ee2c6bfc6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/renaming.py_VariableRenameVisitor.rename_refs_VariableRenameVisitor.is_nested.return.len_self_var_blocks_1": {"doc_hash": "b3f5b15b815bcf37462f52bcd36f520e66626baa1c5c55b934a3aa87382d3964"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/renaming.py_VariableRenameVisitor.reject_redefinition_of_vars_in_scope_VariableRenameVisitor.reject_redefinition_of_vars_in_scope.for_key_in_var_blocks_.var_blocks_key_1": {"doc_hash": "99e5248e55194c11fdc0ba0dc19852f8d8d7245e8665f4923b1a8632383c7121"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/renaming.py_VariableRenameVisitor.reject_redefinition_of_vars_in_loop_VariableRenameVisitor.reject_redefinition_of_vars_in_loop.for_key_block_in_var_blo.if_self_block_loop_depth_.var_blocks_key_1": {"doc_hash": "b40eab0a53b8f7f12f23b270673ae762439a48708ade2a261fb1729dbb05e3ed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/renaming.py_VariableRenameVisitor.record_assignment_": {"doc_hash": "a89a162c4e3bb03738ff3459305fae459e1b4850bdd69d353b5d20c646d27890"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py__Classes_for_producing__reporter_classes._": {"doc_hash": "69acc9e70b31f61f8628ef52e6a27488766a39b224b28f43cd6fc31a5503c068"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py__type_Final_ReporterCla_Reports.finish.for_reporter_in_self_repo.reporter_on_finish_": {"doc_hash": "1b53825208a2fb37a62fec03cefbeebcdbdecda894bbbfb9762fe4b79c910c23"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_AbstractReporter_AbstractReporter.on_finish.pass": {"doc_hash": "19afcfd5b1f6446eec7abebd228107de9031bb4ca21a8c567871251a3927dd5e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_register_reporter_FuncCounterVisitor.visit_func_def.self_counts_defn_type_is_": {"doc_hash": "c0aa586333ee17eed64228a51f32a8520a54c48bad13ad3006b0259510bafce5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_LineCountReporter_LineCountReporter.on_file.self_counts_tree__fullnam": {"doc_hash": "68c11d626dc8b7dacc1147a2e1f5e6aecda4d9dd883392c79ed9cc5258d39c62"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_LineCountReporter.on_finish_register_reporter_lineco": {"doc_hash": "0f7ee899448d9499831ca18f58f099df11202d16c7362cc08cf09be6b0671f98"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_AnyExpressionsReporter_AnyExpressionsReporter.on_finish.self__report_types_of_any": {"doc_hash": "9ba11ac4f44432194f5a4ac9eaccf35a26173b0fbaaa553691c4a45a1015ac42"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_AnyExpressionsReporter._write_out_report_AnyExpressionsReporter._write_out_report.with_open_os_path_join_se.f_writelines_footer_str_": {"doc_hash": "6e72198f4a1744dedf98b3842cc1f03750b7c96dafd26a12e0f4dfca0211ef16"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_AnyExpressionsReporter._report_any_exprs_AnyExpressionsReporter._report_any_exprs.self__write_out_report_a": {"doc_hash": "bce5a316f98d42725a353d29bfdf9ecd0a3f12d80ce12d7b480f90c4c72e2ab7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_AnyExpressionsReporter._report_types_of_anys_register_reporter_any_ex": {"doc_hash": "02b575d07ec9a42aafdcb3b8b91d1dc3642c5b52a1e3e6174194ac9512c7eac0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_LineCoverageVisitor_LineCoverageVisitor._by_PEP_8_": {"doc_hash": "2c623e59646b174dcb331fe62dc551d627ec18c18ba807a210d7276a38349795"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_LineCoverageVisitor.indentation_level_LineCoverageVisitor.indentation_level.return.None": {"doc_hash": "b7ef870c24569c0bcaceaff050f8c286b3f416d03c1aef0a3c9e075c61965e9d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_LineCoverageVisitor.visit_func_def_LineCoverageVisitor.visit_func_def.super_visit_func_def_de": {"doc_hash": "b73bf1d10e3684fed07d7841248f4da0b892d2182a59fcdf1b4abc2c6a5b14a2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_LineCoverageReporter_LineCoverageReporter.__init__._type_Dict_str_List_in": {"doc_hash": "7c5e6f4a04180055d9a340b7b11959bfbb45287533c9652e9d7544cabcf6ce1b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_LineCoverageReporter.on_file_FileInfo.attrib.return._name_str_val_for_name_": {"doc_hash": "2b079f7a60d0fa87b89fa16c1c8f3ddc57c12533526351bdead2096555704e9a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_MemoryXmlReporter_MemoryXmlReporter._type_Final": {"doc_hash": "ec810212c85de273a67c8d3bec3891d1278ec580bbe138c1ba91d5a5f82e59b4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_MemoryXmlReporter.on_file_MemoryXmlReporter.on_file.self_files_append_file_in": {"doc_hash": "f03a1a5e893d886b5e1df4ca18c9d0bdaed8daae0d5b51bb96cc97c65ff22ad8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_MemoryXmlReporter._get_any_info_for_line_MemoryXmlReporter._get_any_info_for_line.if_lineno_in_visitor_any_.else_.return._No_Anys_on_this_line_": {"doc_hash": "fa0827e85e68ee79b213c0aa16fe92937027050fbb38973b61009805f4b9277a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_MemoryXmlReporter.on_finish_get_line_rate.if_total_lines_0_.else_.return._4f_format_covered_l": {"doc_hash": "e4147e86cdef94704503842dea61a47352e997c5e11bd3e749de4bd649dc564f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_CoberturaPackage_CoberturaPackage.add_packages.if_self_packages_.for_package_in_sorted_sel.packages_element_append_p": {"doc_hash": "4a4066bab87c81b25673bf0e66def06c38750470707e5112577fc7b122b142e1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_CoberturaXmlReporter_CoberturaXmlReporter.on_file.with_tokenize_open_path_.current_package_classes_c": {"doc_hash": "50129cf1591f99a6793bd20615490a3dfd1d3396adb27ea6daca80c749045f63"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_CoberturaXmlReporter.on_finish_CoberturaXmlReporter.on_finish.print_Generated_Cobertur": {"doc_hash": "805d142ac2527b9db8764d47ffa99aa6180d4cc8d4d6f957659d87da978e840e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_register_reporter_cobert_AbstractXmlReporter.__init__.self.memory_xml.cast_MemoryXmlReporter_m": {"doc_hash": "4f81085f93cecc797929389689ccd8cdc00600a6e2e55e9246cf6af0546e26f8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_XmlReporter_XmlReporter.on_file.last_xml_write_out_path_": {"doc_hash": "e12dc4e9fb2821dac6d209df398ff3bd866b1eb265bc8c3e9b20b2b18300c904"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_XmlReporter.on_finish_XmlReporter.on_finish.print_Generated_XML_repo": {"doc_hash": "ad56e57cadf8c89abe948f016ddf574fd3adc08d2189cfde6dfeae87d7d41cc8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_register_reporter_xml__XsltHtmlReporter.__init__.self.param_html.etree_XSLT_strparam_html": {"doc_hash": "7c7a5940238a9dca5ffc78f60a93829d2974fb9391d11a8c3a5d1f06def7926a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_XsltHtmlReporter.on_file_XsltHtmlReporter.on_file.with_open_out_path_wb_.out_file_write_transforme": {"doc_hash": "ccef31703c5b81e193e5ccd094d39c72febad93b3035685f7752fd555ac06401"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_XsltHtmlReporter.on_finish_register_reporter_xslt_h": {"doc_hash": "f6da90da15be92bfe48da8cf210332190528b2d93a27d78b3d0a6a6553ad34b9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_XsltTxtReporter_XsltTxtReporter.on_finish.print_Generated_TXT_repo": {"doc_hash": "1aeafb8e3c8c9ba46c226ab5592d4fc7798af1562aada7c12d2d2bd168ba029c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_register_reporter_xslt_t_LinePrecisionReporter.__init__._type_List_FileInfo_": {"doc_hash": "ce1b05831404fb53b81cb08eaf544cdcdb582acb7f3b32a08ded0431cc89b5a5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_LinePrecisionReporter.on_file_LinePrecisionReporter.on_file.self_files_append_file_in": {"doc_hash": "87c9c5f5b5a6adb510712c9d8c058f46810565d66545f0b300ca60b450a9c349"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_LinePrecisionReporter.on_finish_": {"doc_hash": "aaae959df5e831366182d47e248f58e3fc724323a2a5cf43d9570ebc95f7f5ce"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/sametypes.py_from_typing_import_Sequen_is_same_types.return.True": {"doc_hash": "ec04fed80ddc7c7119355492d425b621a6c2000b8b9ca88872df6fd88254a857"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/sametypes.py_SameTypeVisitor_SameTypeVisitor.visit_type_var.return._isinstance_self_right_T": {"doc_hash": "230d97ec95b79905d199bde68c04794f034252ad012487017e00a449f51d9b26"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/sametypes.py_SameTypeVisitor.visit_callable_type_SameTypeVisitor.visit_callable_type.if_isinstance_self_right_.else_.return.False": {"doc_hash": "830fa7ed16a456d2fbee957491b09dc11ddaf773c7c884ddfa9c981598523c15"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/sametypes.py_SameTypeVisitor.visit_tuple_type_SameTypeVisitor.visit_literal_type.if_isinstance_self_right_.else_.return.False": {"doc_hash": "745b39e6de31ddcf3561c055ca47fde2ca30c69030e7a40e0b286adc581c2741"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/sametypes.py_SameTypeVisitor.visit_union_type_SameTypeVisitor.visit_union_type.if_isinstance_self_right_.else_.return.False": {"doc_hash": "14cba3b47d747b2836afa6ffb3aa5e4cc537ac5b6914831f33f2f663c7bbb7b3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/sametypes.py_SameTypeVisitor.visit_overloaded_": {"doc_hash": "d4b006484b503282e6398d49cb920e73e2d797e55b7f4fd6ce83af01cee928e0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/scope.py__Track_current_scope_to_": {"doc_hash": "a9549039d9ac89dd96c011397e1219ca4d5e89d3e038e1f78a40e982a16c88c8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py__The_semantic_analyzer__from_typing_extensions_im": {"doc_hash": "b461c205b7e4617f56c062a3eee831d5548db6d598652d2988a9614852fd53ce"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_from_mypy_nodes_import__from_mypy_semanal_namedtu": {"doc_hash": "4889f0bf6daa450eae0f7eb10614f2a7bf6b68589940986fa7ead98309809215"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_from_mypy_semanal_typeddi_Tag.int": {"doc_hash": "af6f0f6eaaf78dc75aaa994d62fcbe93d3e3be0500a0b834764cb3ff8a3abc83"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer_SemanticAnalyzer._type_Optional_Statemen": {"doc_hash": "e51fdc35369e44ffc35384e4ca92d25f3035767bc5420add7829aa2b878541ef"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.future_import_flags_SemanticAnalyzer.None_65": {"doc_hash": "d324439d723aff2427ece517bcec1518fbda085942b08755891ac542c58b11ba"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.prepare_file_SemanticAnalyzer.prepare_typing_namespace._builtins_typing_import_": {"doc_hash": "79f6752b9e49a5ab47d76031d2bc4e051419de75baea956075a1b72595c9f557"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.prepare_typing_namespace.helper_SemanticAnalyzer.prepare_typing_namespace.helper_file_node_defs_": {"doc_hash": "eb4e6a9877c87a948a60ad4b89d2a783d25748cd6e607781ada114859b92fc59"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.prepare_builtins_namespace_SemanticAnalyzer.prepare_builtins_namespace.for_name_typ_in_special_.file_node_names_name_S": {"doc_hash": "a1b40c7f27c42c9ae2e6cc6894916d7c9d5a5fd6003431fde96ce25d7b831bfe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.None_66_SemanticAnalyzer.refresh_top_level.self.all_exports._": {"doc_hash": "fbec4347aa4071639ef1645ddb6c6b040fd0d30fb31a29d9d3b7940f89017e45"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.add_implicit_module_attrs_SemanticAnalyzer.add_implicit_module_attrs.for_name_t_in_implicit_m.if_an_type_.else_.self_add_symbol_name_": {"doc_hash": "e8264e3b9961e8f9986ce98b40089efe90be25c09897761d45f818da92d6f585"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.add_builtin_aliases_SemanticAnalyzer.add_builtin_aliases.for_alias_target_name_in.if_n_.else_.if_name_in_tree_names_.del_tree_names_name_": {"doc_hash": "b13ee36ad1ee4e486cfce2379db813619ac050c99309ef02c091901d8c0bcf07"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.adjust_public_exports_SemanticAnalyzer.adjust_public_exports.if___all___in_self_glob.for_name_g_in_self_globa.if_name_in_self_all_expor.else_.g.module_public.False": {"doc_hash": "23c5060202bc1053aac2fc5eede7b5ada4f2558dc4824c394675c3b058a9e8ff"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.file_context_SemanticAnalyzer.file_context.del_self_options": {"doc_hash": "e3f52c3c23906e962a9c7ea5e169e16abe4c353ccbf066914110f2294ddb504a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.None_69_SemanticAnalyzer.visit_func_def.with_self_scope_function_.self_analyze_func_def_def": {"doc_hash": "a73a4134aea32a8b0f28397644eee866098052165c1becc89c0521004b16170c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_func_def_SemanticAnalyzer.analyze_func_def.if_defn_is_coroutine_and.if_defn_is_async_generato.else_.self_wrapped_coro_return_": {"doc_hash": "0b48371f754925fb9811bf5b99767d251193f74d367e37cfec7d3a7b37467a2b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.prepare_method_signature_SemanticAnalyzer.prepare_method_signature.if_not_func_is_static_.if_not_func_arguments_.elif_isinstance_functype_.if_isinstance_self_type_.func.type.replace_implicit_first_ty": {"doc_hash": "8112f3d6eea942662e222c7461afad66091f899c6e58b4fb3989ef31051634e8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.set_original_def_SemanticAnalyzer.set_original_def.if_isinstance_previous_.else_.return.False": {"doc_hash": "72a8bbf83682c25c720154fc3fe95c6f2c30770003a5d06c23fbadcecb2455b5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.update_function_type_variables_SemanticAnalyzer.visit_overloaded_func_def.with_self_scope_function_.self_analyze_overloaded_f": {"doc_hash": "2a184cb0008591ae0c26bd3964be10fbfb2242839d37f1dd0566bd2e5346a250"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_overloaded_func_def_SemanticAnalyzer.analyze_overloaded_func_def.self_process_static_or_cl": {"doc_hash": "3f5ad5edec88215a60cda8a2cb6b77bb1bc75679486f40134e81b9db0b87d054"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_overload_sigs_and_impl_SemanticAnalyzer.analyze_overload_sigs_and_impl.return.types_impl_non_overload": {"doc_hash": "766dcbcddba56a3b17ce195c47cb3abd211b80fee4810060d8fad1f14724fbf3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.handle_missing_overload_decorators_SemanticAnalyzer.handle_missing_overload_decorators.for_idx_in_reversed_non_o.del_defn_items_idx_": {"doc_hash": "34b008c30974d10b9fcffeb2109a353daf70543bbabd0d5a694e9a054158a2f2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.handle_missing_overload_implementation_SemanticAnalyzer.handle_missing_overload_implementation.if_not_self_is_stub_file_.if_self_type_and_self_typ.else_.self_fail_": {"doc_hash": "25f2a99bb0d8e20637ffc667cbcbbc2cba46194c0639d340151574bd3ff742f5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.process_final_in_overload_SemanticAnalyzer.process_final_in_overload.if_defn_impl_is_not_None_.defn.is_final.True": {"doc_hash": "cbd1e274167ec809be19c1021ac3ceed0a8e429fc9ae7600d8b44e8c1121e679"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.process_static_or_class_method_in_overload_SemanticAnalyzer.process_static_or_class_method_in_overload.if_len_set_class_status_.else_.defn.is_static.static_status_0_": {"doc_hash": "4ac5973e8aca472f9b46f82fc062a9cfac075d686faca0e70bc014bf44c3d241"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_property_with_multi_part_definition_SemanticAnalyzer.analyze_property_with_multi_part_definition.for_i_in_reversed_deleted.del_items_i_": {"doc_hash": "8c95457310ee90373deee070d772d3f169a94decdd7cf349fc0e79c3e7257d8d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.add_function_to_symbol_table_SemanticAnalyzer.analyze_arg_initializers.with_self_tvar_scope_fram.for_arg_in_defn_arguments.if_arg_initializer_.arg_initializer_accept_se": {"doc_hash": "6249d395eb384514aeeb44463638e21407ad48f9cd1e8c7bbd59217591580fba"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_function_body_SemanticAnalyzer.analyze_function_body.with_self_tvar_scope_fram.self_function_stack_pop_": {"doc_hash": "3575728db2308a7725221712cf772211bd757a8389f7a3dacd41e457f9a1fb09"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.check_classvar_in_signature_SemanticAnalyzer.check_function_signature.if_len_sig_arg_types_l.elif_len_sig_arg_types_.self_fail_Type_signature": {"doc_hash": "15972637a1ad2a6a3c02b1532f171c0b0c058147a4fd2227291f5b3e4086aeec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_decorator_SemanticAnalyzer.visit_class_def.with_self_tvar_scope_fram.self_analyze_class_defn_": {"doc_hash": "6b1f3b77f8a8316ffaef8ffec5bbe5350607f6d0a7fdd3ee7c9c6099872ce2fc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_class_SemanticAnalyzer.analyze_class.with_self_scope_class_sco.self_analyze_class_body_c": {"doc_hash": "80235118530dec6dadee498b3a4b68b4e331d13c36df56ca3d2c5ab5a673682c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.is_core_builtin_class_SemanticAnalyzer.analyze_namedtuple_classdef.return.False": {"doc_hash": "9090b4462fdf36692c36c1d596511caa469e919162d3084ea2222880b658a1ea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.apply_class_plugin_hooks_SemanticAnalyzer.apply_class_plugin_hooks.get_fullname.return.None": {"doc_hash": "b3c49ed7faa76cbcf2d3cb7d326908089173c791343da83e38445f5cc0fc2e57"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.apply_class_plugin_hooks.for_decorator_in_defn_dec_SemanticAnalyzer.apply_class_plugin_hooks.for_base_expr_in_defn_bas.if_base_name_.if_hook_.hook_ClassDefContext_defn": {"doc_hash": "1141dcdad62a8d1e442b3b2388920f2948c512bbb7b5f697f81b9cfe387f534d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_class_keywords_SemanticAnalyzer.analyze_class_decorator.if_isinstance_decorator_.if_decorator_fullname_in_.elif_decorator_fullname_i.defn.info.is_final.True": {"doc_hash": "8809072098dbdc51f5334ce770d93df4e710bf3537c202bf4af7af54d8f621b1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.clean_up_bases_and_infer_type_variables_SemanticAnalyzer.clean_up_bases_and_infer_type_variables.return.base_type_exprs_tvar_def": {"doc_hash": "a02a71a70f96692ba8bb1cb44e5395536e6afef5a9a5854c1cdc428b81b2eaac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_class_typevar_declaration_SemanticAnalyzer.analyze_class_typevar_declaration.return.None": {"doc_hash": "30a414ab3e5078cb68f9d776d6b8b4e59daf82e561738cc2f3835ad869c161a2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_unbound_tvar_SemanticAnalyzer.analyze_unbound_tvar.if_sym_is_None_or_not_isi.else_.return.unbound_name_sym_node": {"doc_hash": "06acaf35b955c526a70217b006364af99dafab402d3f300343832cf68c3d37e8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.get_all_bases_tvars_SemanticAnalyzer.get_all_bases_tvars.return.remove_dups_tvars_": {"doc_hash": "e48ee222367636e916e8f68349b0051ee1097fdde94983d4e0c0dda757ef4daa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.prepare_class_def_SemanticAnalyzer.prepare_class_def.if_self_is_nested_within_.self_globals_local_name_": {"doc_hash": "3f8f1aff8bda25a97d2c36f182d6dde1410e41379cf50c949b2fc5066a9d28bf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.make_empty_type_info_SemanticAnalyzer.get_name_repr_of_expr.return.None": {"doc_hash": "383538490990e47fded7e60280655a0bd85a717eb82c78b35b6b03c57ff24050"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_base_classes_SemanticAnalyzer.analyze_base_classes.return.bases_is_error": {"doc_hash": "1ce3d5b927eebab356cb6f888798db3f6dc31bb3ca1d614ae6e772c2385b4ef0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.configure_base_classes_SemanticAnalyzer.configure_base_classes.self_calculate_class_mro_": {"doc_hash": "e419b6d3b32c7db0b162cb570f9338c09cc5c13d510f679303fcb2d5d4474b52"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.configure_tuple_base_class_SemanticAnalyzer.configure_tuple_base_class.return.base_partial_fallback": {"doc_hash": "bc026d3ae9d480fec6dfc2042e46b07eb46f3a77bd0d18d6505595b7821465bc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.set_dummy_mro_SemanticAnalyzer.calculate_class_mro.if_defn_fullname_.if_hook_.hook_ClassDefContext_defn": {"doc_hash": "80d72cca59c713fcc7bb21cfb6c5b6e9113a1f8b10d5d0441da129dbbfa11ef3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.update_metaclass_SemanticAnalyzer.update_metaclass.defn.metaclass.metas_pop_": {"doc_hash": "ef85eb605c4a974e9a28b7c6c31e2c72772f9ca10d3d0f9aaaa4bcd74c6dcc29"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.verify_base_classes_SemanticAnalyzer.verify_base_classes.return.not_cycle": {"doc_hash": "e65e4a5011758c60d605c344cd14a6ba01975421b310c57f4bb009e8ed179e12"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.is_base_class_SemanticAnalyzer.is_base_class.return.False": {"doc_hash": "9f56e43bf854f9ab82a27e5e1ad5c80de99489a08186104e57e4061c933fdbaf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_metaclass_SemanticAnalyzer.analyze_metaclass.if_defn_info_metaclass_ty.else_.if_defn_info_metaclass_ty.if_defn_type_vars_.self_fail_Enum_class_can": {"doc_hash": "5ca1cdc1e48c7acecbc15ad24367b4fd20353a2b2d9e51a08e5d834621884da7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.None_75_SemanticAnalyzer.visit_import.for_id_as_id_in_i_ids_.self_add_module_symbol_ba": {"doc_hash": "4e016102ba790fef2e48003ea727972f9bf10da139673a53f6f2c58165cc6232"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_import_from_SemanticAnalyzer.visit_import_from.for_id_as_id_in_imp_name.if_node_and_not_node_modu.else_.self_add_unknown_imported": {"doc_hash": "2847c4119f5472844e9e9af958ed253065e13974fbc2011a64acd31537a1d4c2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.process_imported_symbol_SemanticAnalyzer.process_imported_symbol.self_add_imported_symbol_": {"doc_hash": "32c0a0884797cc4baa563ca8f821e96b78c8d965d8fc781721d3c46b4ad2a397"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.report_missing_module_attribute_SemanticAnalyzer.report_missing_module_attribute.if_import_id_typing_.if_self_lookup_fully_qua.self_msg_add_fixture_note": {"doc_hash": "25043137396eec7fe0e296b5fc1983d8f9b8d6db0ff2f810474ce4757faf5b20"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.process_import_over_existing_name_SemanticAnalyzer.correct_relative_import.return.import_id": {"doc_hash": "0772446f9ca6c8f385cb69dc7d34d86b6b8b492c30a09f4e4c4ebd11b54f0e34"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_import_all_SemanticAnalyzer.visit_assignment_expr.self_analyze_lvalue_s_tar": {"doc_hash": "9de5403023212fc378a9d17c46c76c0fa772d3aa22ba706ba665d2f2ae146211"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_assignment_stmt_SemanticAnalyzer.visit_assignment_stmt.self_process__all___s_": {"doc_hash": "a37eca3be983d9e11590ec4ba6764d23119b9716384a4a0c1f8d955d3770fbf3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_identity_global_assignment_SemanticAnalyzer.analyze_identity_global_assignment.if_sym_is_None_.else_.return.True": {"doc_hash": "51b30c13ce76fc850d4010c8f2d373a8065f263839982703e92f81fa707d2245"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.should_wait_rhs_SemanticAnalyzer.should_wait_rhs.return.False": {"doc_hash": "eae982abde5ffaeb87944bb0057d01ba5d90729c91a98aab62abb5ee5e9f157e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.can_be_type_alias_SemanticAnalyzer.can_be_type_alias.return.False": {"doc_hash": "3d98ace6421205593c52c121e8e2379705c7826df1282f3ad0d5d1b495b7f916"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.is_type_ref_SemanticAnalyzer.is_type_ref.return.False": {"doc_hash": "31d61a60ce8890483ca306076af7cdbc5e450ca097aac5a522bb822ea1ed516f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.is_none_alias_SemanticAnalyzer.is_none_alias.return.False": {"doc_hash": "f2caa980fd4c07239da8ec6baa4be868d8a8f8a91a851ab96d77b3f04aba4037"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.record_special_form_lvalue_SemanticAnalyzer.analyze_enum_assign.return.self_enum_call_analyzer_p": {"doc_hash": "b81a9eb543b1b865a2e75202041fe44032fdcc9d0e182b1c6f1126889d357b11"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_namedtuple_assign_SemanticAnalyzer.analyze_namedtuple_assign.return.True": {"doc_hash": "8be9d6a96d460b32175201ee3babc5468c90ba16deb8f313a02e941bf8453e68"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_typeddict_assign_SemanticAnalyzer.analyze_typeddict_assign.return.True": {"doc_hash": "dff432771c8a7b6866c01010655e84cb11a0e8518749a6a6ef9edb20b7995c72"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_lvalues_SemanticAnalyzer.analyze_lvalues.for_lval_in_s_lvalues_.self_analyze_lvalue_lval_": {"doc_hash": "fca5250cf5542ad10f389ac634272b7a9ced25dd5984a741c530fbf263d06343"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.apply_dynamic_class_hook_SemanticAnalyzer.apply_dynamic_class_hook.if_fname_.if_hook_.hook_DynamicClassDefConte": {"doc_hash": "4bfd105908971136146beac43d8678e8db8b6de6f965cfa6250dc10717ce9ccb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.unwrap_final_SemanticAnalyzer.unwrap_final.return.True": {"doc_hash": "91f02d86ce24fedaf29995b7bf5d0853b958eab7a987634bad583d9d731655c4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.check_final_implicit_def_SemanticAnalyzer.check_final_implicit_def.if_isinstance_lval_Membe.if_not_self_is_self_membe.else_.if_self_function_stack_1.return": {"doc_hash": "d01c8cce051854fb5c66343216562a91ebb34942b737534fa2ebd03d285b7b68"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.store_final_status_SemanticAnalyzer.store_final_status.if_s_is_final_def_.else_.for_lval_in_self_flatten_.if_isinstance_lval_Membe.if_cur_node_and_isinstanc.if_top_function_name_.s.is_final_def.True": {"doc_hash": "51b557f0912b10c80a391939b73311b3f85cd8d07bbcb9f159ad0738235f9637"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.flatten_lvalues_SemanticAnalyzer.unbox_literal.return.None": {"doc_hash": "4f57a2f5c793759e623189fd05f4a7e1991b262f37ad60502663642bf21d48d8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.process_type_annotation_SemanticAnalyzer.is_annotated_protocol_member.return.any_": {"doc_hash": "84c620e24d2000443493dd515ebaa28b24ead18387d1a8fd9654c079c53a8b3c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_simple_literal_type_SemanticAnalyzer.analyze_simple_literal_type.return.None": {"doc_hash": "4ccb5a8b58b43c5c36ac7e922162689429e0580d3b04d7a1780d1f4e54880e69"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_alias_SemanticAnalyzer.analyze_alias.return.typ_alias_tvars_depends": {"doc_hash": "ca1898866fe111f5d21d25cab09ff77164753860464e26f9e4a26638e2150961"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.check_and_set_up_type_alias_SemanticAnalyzer.check_and_set_up_type_alias._type_Optional_Type_": {"doc_hash": "d0a76376cbd267f48a21e3894c67091e1289e439ba1faff07ba7e2478b76a24b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.check_and_set_up_type_alias.if_self_is_none_alias_rva_SemanticAnalyzer.check_and_set_up_type_alias.return.True": {"doc_hash": "5b9048ee6cd64c68da4349809fe68be984abb9d0d5fbce008cafcbe34db5e4cc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_lvalue_SemanticAnalyzer.analyze_lvalue.if_isinstance_lval_NameE.else_.self_fail_Invalid_assign": {"doc_hash": "3f32677818f0bfae50a59613d48e94dcd728d8778e6d24a5c0da3b761e96e968"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_name_lvalue_SemanticAnalyzer.analyze_name_lvalue.if_not_existing_or_isins.else_.self_make_name_lvalue_poi": {"doc_hash": "5a9d074a20466980a734bad6e2ca76e0c48959099f18e52964cd879dd28e05a2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.is_final_redefinition_SemanticAnalyzer.is_alias_for_final_name.if_self_is_func_scope_.else_.return.existing_is_not_None_and_": {"doc_hash": "3c5d60a4307ccd2bface79436114b9c18e4b2811e261fbc1e5d0910b0da5236b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.make_name_lvalue_var_SemanticAnalyzer.make_name_lvalue_var.return.v": {"doc_hash": "a9a7b6c403455046ba43f87ad75d1c011ea420d16b2156a18e8c379ec4e56ad1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.make_name_lvalue_point_to_existing_def_SemanticAnalyzer.make_name_lvalue_point_to_existing_def.if_explicit_type_.else_.self_check_lvalue_validit": {"doc_hash": "3628733c829b8bb2cd78f3c951723049d0228798ffd97da3774bc83ad3c554bd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_tuple_or_list_lvalue_SemanticAnalyzer.analyze_tuple_or_list_lvalue.if_len_star_exprs_1_.else_.for_i_in_items_.self_analyze_lvalue_i_ne": {"doc_hash": "d79ba664a123d3bd2f920b3edecef0f243a62679f24674f19a1916e92cb018b6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_member_lvalue_SemanticAnalyzer.analyze_member_lvalue.self_check_lvalue_validit": {"doc_hash": "4b54b3b999be56fa7f29ac607aaf8036901b34f7fc0d019f991f9637f71d7bb2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.is_self_member_ref_SemanticAnalyzer.check_lvalue_validity.if_isinstance_node_TypeV.elif_isinstance_node_Typ.self_fail_message_registr": {"doc_hash": "ac73e409430f57129248802ff442d0866ca4cffd3f0b2fd0ef7f4fcfa9972a46"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.store_declared_types_SemanticAnalyzer.store_declared_types.if_isinstance_lvalue_Ref.else_.pass": {"doc_hash": "a281522672990e568b0b9fc8a8fadf39eccf152a69211035aada9ed88fd7cdb2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.process_typevar_declaration_SemanticAnalyzer.process_typevar_declaration.return.True": {"doc_hash": "9b1bee9f3515ab8d97b6f218f9190672b84c68999adcff03dd5ff1a2a8b6530e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.check_typevarlike_name_SemanticAnalyzer.check_typevarlike_name.return.True": {"doc_hash": "74230ed10576db0a6218b8c5d905bc72d703bd0658c85b9615dbffa19615cf46"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.get_typevarlike_declaration_SemanticAnalyzer.get_typevarlike_declaration.return.call": {"doc_hash": "873117f9ca2b3f69ef923a7abaa6087641ab8ec119e5afcd86e660c889e59500"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.process_typevar_parameters_SemanticAnalyzer.process_typevar_parameters.return.variance_upper_bound": {"doc_hash": "4b5bb0f159878a89d273a246f033822187af4ecc899b3b745bfd09604312c884"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.process_paramspec_declaration_SemanticAnalyzer.process_paramspec_declaration.return.True": {"doc_hash": "4c7152b50ac8f69082a8dfafde9a87253bf5f16cf563aa7d23155882a3df5474"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.basic_new_typeinfo_SemanticAnalyzer.basic_new_typeinfo.return.info": {"doc_hash": "6d2c7e23357dcbe2e0b2911cf68f27b450f2634a03e812b68363f15cfd41a85c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_value_types_SemanticAnalyzer.analyze_value_types.return.result": {"doc_hash": "40cc63e884b258796d74384a95e417fc9bc7c5e8970e7e4d4187ecd856539e05"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.check_classvar_SemanticAnalyzer.check_classvar.if_self_is_class_scope_.elif_not_isinstance_lvalu.self_fail_invalid_classva": {"doc_hash": "bdc0bb351b18be59302275595729329386c66bce57cea2679491871b411422ba"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.is_classvar_SemanticAnalyzer.fail_invalid_classvar.self_fail_ClassVar_can_o": {"doc_hash": "bee6c7088552c04af9bef654038bbdb3e0a1a8af35ebe8349fe2a5a088183d7b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.process_module_assignment_SemanticAnalyzer.process_module_assignment.if_isinstance_rval_Tup.elif_isinstance_rval_Ref.if_rnode_and_isinstance_r.for_lval_in_lvals_.if_lnode_.if_isinstance_lnode_node_.elif_lval_is_inferred_def.lnode.node.rnode_node": {"doc_hash": "018d2ef636560c2ab6ea197f231d7fad4431d006f9afefe29f2df05058f0a61c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.process__all___SemanticAnalyzer.visit_while_stmt.self_visit_block_maybe_s_": {"doc_hash": "575a179ce053b56b573b48b2ab34cd2037c190a84e0a20774d9202e245c7fee6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_for_stmt_SemanticAnalyzer.visit_for_stmt.self_visit_block_maybe_s_": {"doc_hash": "8407ff08bc21612ddae52ebf83e9b2b74b81ca339a262de90bad0d3bd4e9fa71"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_break_stmt_SemanticAnalyzer.analyze_try_stmt.if_s_finally_body_.s_finally_body_accept_vis": {"doc_hash": "da2d62987297912e60822e3564f334c01a0624357ab0d74bbc47c23ee89a27a7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_with_stmt_SemanticAnalyzer.visit_with_stmt.self_visit_block_s_body_": {"doc_hash": "094a2f505a394084c06af04facae516b32f8ec2435f5cf9f5215a7db7988ccab"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_del_stmt_SemanticAnalyzer.visit_global_decl.for_name_in_g_names_.self_global_decls_1_add": {"doc_hash": "9b96fe798b569f4ede4b6e721ed28cc2b773aacc7f2989cb8868c08e9f12a6d0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_nonlocal_decl_SemanticAnalyzer.visit_nonlocal_decl.if_not_self_is_func_scope.else_.for_name_in_d_names_.self_nonlocal_decls_1_a": {"doc_hash": "03f1c560f1cb6a406c10c95edb6bc6d5d5c97164c79a425ddef0af31c382b393"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_print_stmt_SemanticAnalyzer.visit_name_expr.if_n_.self_bind_name_expr_expr_": {"doc_hash": "0f1c2596ea540763e560ed03cf4b7a3cbabd155b42b6a9ae34b1deaa2155021e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.bind_name_expr_SemanticAnalyzer.bind_name_expr.if_isinstance_sym_node_T.else_.expr.fullname.sym_fullname": {"doc_hash": "d9f0159f6ed500cdaf95081bb1a2c9fb46ebd1265eed9a29b726332f2001a8ac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_super_expr_SemanticAnalyzer.visit_yield_from_expr.if_e_expr_.e_expr_accept_self_": {"doc_hash": "7ad2e7bc693f277c893d7549a17150ec737833d5a00e08ef329bb23c582822d7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_call_expr_SemanticAnalyzer.visit_call_expr.if_refers_to_fullname_exp.else_.if_isinstance_expr_calle.if_expr_callee_name_a.elif_expr_callee_name_.self_add_exports_expr_arg": {"doc_hash": "122a760aa2d69fb8769202571d54da31842add8fcd5e2d9f516c8fe0032f2183"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.translate_dict_call_SemanticAnalyzer.translate_dict_call.return.expr": {"doc_hash": "e3bf498103781a132aaa0e6d37c8adf10d82647c824acdab3fb52a51071621cd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.check_fixed_args_SemanticAnalyzer.check_fixed_args.return.True": {"doc_hash": "f8cf8c3fd964c72c4271c4501199f06e1c329beb6e5dde3727ecb6fe83af469f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_member_expr_SemanticAnalyzer.visit_member_expr.if_isinstance_base_RefEx.elif_isinstance_base_Ref.if_type_info_.if_n_is_not_None_and_isin.expr.node.n_node": {"doc_hash": "5907e25b5696adc75db3522224f32245d7da61bb7ecb0156836e53ddfd0f78e9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_op_expr_SemanticAnalyzer.visit_op_expr.expr_right_accept_self_": {"doc_hash": "eec6cef29ca5a80586dbf4c930ee241e92ea96aaaae121ac6b8b4c0945a7cf3d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_comparison_expr_SemanticAnalyzer.visit_index_expr.if_isinstance_base_RefE.else_.expr_index_accept_self_": {"doc_hash": "37244f630bc917844eb5b186a62700202788a7c5bf332ab887beb1a28e7581a5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_type_application_args_SemanticAnalyzer.analyze_type_application_args.return.types": {"doc_hash": "c5385c7f8ab7090e296a5ec5f760054d114f197925559ba1d04ea146af5c95aa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_slice_expr_SemanticAnalyzer.visit_generator_expr.self_analyze_comp_for_2_e": {"doc_hash": "1508db6de3182b642a12c9b4631bc4457fb41d687bb1d89fc43704957c3c5be8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_comp_for_SemanticAnalyzer.analyze_comp_for.for_i_index_sequence_.for_cond_in_conditions_.cond_accept_self_": {"doc_hash": "463f0c83812ed9b22d64551a8dd7afc2b7ea79a74b7641b89fa5182b9e6da66b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_comp_for_2_SemanticAnalyzer.visit__promote_expr.if_analyzed_is_not_None_.expr.type.analyzed": {"doc_hash": "4460b7a5d29d707c69dac6dc310d702b878dbf7e57b996708e3690698c37c8f3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_yield_expr_SemanticAnalyzer.None_89": {"doc_hash": "5051c89491d19ccac7f6f8924936edd42bbadca9c1f5f4a868c2aaa8df92e932"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.lookup_SemanticAnalyzer.lookup.return.None": {"doc_hash": "210190b51bcf4f14a3fa7adb9371f775bc9664de051b743e7dce9a114224698d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.is_active_symbol_in_class_body_SemanticAnalyzer.is_active_symbol_in_class_body.return._node_is_None": {"doc_hash": "c40736b2c4497243d508ea013388e2ef32c91c2eb605098a2e8f0ad9f3acbd77"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.is_textually_before_statement_SemanticAnalyzer.is_textually_before_statement.if_self_is_overloaded_ite.else_.return.line_diff_0": {"doc_hash": "8bfd9ee09f61f6129b4e0f1003ab826181e3a4dfc3db7a34cd1bfe53a9be56a3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.is_overloaded_item_SemanticAnalyzer.is_defined_in_current_module.return.module_prefix_self_module": {"doc_hash": "b07f9a28348deeb05b52f98291154a802c75ef50566edead668e09c8b8598347"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.lookup_qualified_SemanticAnalyzer.lookup_qualified.return.sym": {"doc_hash": "4c42a3cd05ce688623abe165185654c8e5cedfac23afde3d982042a585ef3eb3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.lookup_type_node_SemanticAnalyzer.get_module_symbol.return.sym": {"doc_hash": "f046e9c20421e6d4372b2284900955d9f2ddf9eaf5b308a39858af34eed2d7ee"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.is_missing_module_SemanticAnalyzer.implicit_symbol.return.SymbolTableNode_GDEF_var": {"doc_hash": "f357b2b8c4e6e4c58cdc063c498ec61e6379a2d4be52f2462ae3d10c20babbae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.create_getattr_var_SemanticAnalyzer.create_getattr_var.return.None": {"doc_hash": "96a817ce4885734bd86cf99ab1543e8574ed987ca94742effad034c458ccee06"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.lookup_fully_qualified_SemanticAnalyzer.lookup_fully_qualified.return.n_names_parts_1_": {"doc_hash": "2f2b2765a9e589d395b0b38bb24d93438e19c093a784e75e81ef1ae3412cc748"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.lookup_fully_qualified_or_none_SemanticAnalyzer.lookup_fully_qualified_or_none.return.result": {"doc_hash": "796e1b643d5b71e98c4fffd44de49fdacd1b6e8c2f9791fe04de1145d10d3a1c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.builtin_type_SemanticAnalyzer.named_type.return.Instance_node_AnyType_T": {"doc_hash": "3768d02222779f77316ee44491b9da776087997923c0104e14ba6cf8d4ab1a46"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.named_type_or_none_SemanticAnalyzer.None_92": {"doc_hash": "80bad1a699f571c584aeaecbcc3fe17eef925ff7592daa1208d2ff7e9742ce6c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.add_symbol_SemanticAnalyzer.add_symbol.return.self_add_symbol_table_nod": {"doc_hash": "d62c10a3c538782889473dea1a12be016fb4bb0c4d599ffac32fc10ee0d4d5f6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.add_symbol_skip_local_SemanticAnalyzer.add_symbol_skip_local.names_name_symbol": {"doc_hash": "6c699a51dc74d3e2ee29208ed163e579de7e63084444e93ca688d35ad0a0f257"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.add_symbol_table_node_SemanticAnalyzer.add_symbol_table_node.return.False": {"doc_hash": "b0e038179d517a4b4ff78dc1806ecfeaaf0a8fbfd68a14c5e5a85f1acd8944ce"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.add_redefinition_SemanticAnalyzer.add_redefinition.while_True_.i_1": {"doc_hash": "a463a3662e9b95601aceee8f1b13b163fadceb980896cdd1f7a072fb0b922370"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.add_local_SemanticAnalyzer.add_imported_symbol.self_add_symbol_table_nod": {"doc_hash": "cfb4dbb96b714fceb44da9ce471cdc9a9946b714cb357076b23763ba0175b262"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.add_unknown_imported_symbol_SemanticAnalyzer.add_unknown_imported_symbol.self_add_symbol_": {"doc_hash": "1e79d70e7c3cce891414caeefd47c707140fe501c680f0d4a5a4fb7eaa0142e5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.None_93_SemanticAnalyzer.defer.self_deferral_debug_conte": {"doc_hash": "9e86378e3b714e75c508aa3a457b7a798cdec4f3535b3845bdf3af707818bc1a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.track_incomplete_refs_SemanticAnalyzer.mark_incomplete.self_missing_names_1_ad": {"doc_hash": "81a0f41b33ea445b0d81b4bcfce96153b61ce369a169c4866753523d48faa558"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.is_incomplete_namespace_SemanticAnalyzer.qualified_name.if_self_type_is_not_None_.else_.return.self_cur_mod_id_n": {"doc_hash": "4b75b4b65819c255b6d8290196d09c02e5222ce837ebd61a0fda3f815e20a695"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.enter_SemanticAnalyzer.enter.self_missing_names_append": {"doc_hash": "82057289f39f06afc7574d7313d324644f9f9120f3e8392ea3744c93fbc333d7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.leave_SemanticAnalyzer.current_symbol_kind.return.kind": {"doc_hash": "698ab1edd9005acf1b362a9655e870a7e8019149cbfbe9774cf3564e5d9d4e0e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.current_symbol_table_SemanticAnalyzer.current_symbol_table.return.names": {"doc_hash": "dc8eb4120cdc1083fed18dc7273e2804fb571c0cad3135521b8d3581f54f70d9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.is_global_or_nonlocal_SemanticAnalyzer.add_exports.for_exp_in_exps_.if_isinstance_exp_StrExp.self_all_exports_append_e": {"doc_hash": "6c28161fba2c4ddaebdff0def0c9629787beabef1c9877debc1a2fa6bfd61da7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.check_no_global_SemanticAnalyzer.check_no_global.if_name_in_self_globals_.if_is_overloaded_func_and.else_.self_name_already_defined": {"doc_hash": "d1780f216ffba97bfabe0e9c6be110823654ebc84b1c9f46229424514f78dfda"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.name_not_defined_SemanticAnalyzer.name_not_defined.for_module_in_modules_wit.self_note_hint_ctx_code": {"doc_hash": "c232ed120bb1dc7c58b5da627ce1d59907d53cc78b1e5d739f430f2a0c36742d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.already_defined_SemanticAnalyzer.already_defined.self_fail_alread": {"doc_hash": "8fe7f460b22525fb29e49cf5e3f8b9ee0ad939aedac35e0cb7fb220b4e01f57c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.name_already_defined_SemanticAnalyzer.is_local_name.return.self_is_defined_in_curren": {"doc_hash": "f1e59c1ce1023774823c6e3f0d3d62ba715e71fbfef00bcee871d3a4b38b79ce"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.fail_SemanticAnalyzer.fail.self_errors_report_ctx_ge": {"doc_hash": "60bb1fca10f8be48908fbda210fda87b3b5dce0e2243206b0cf22766205506f4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.fail_blocker_SemanticAnalyzer.accept.try_.except_Exception_as_err_.report_internal_error_err": {"doc_hash": "5d83620d7ee9fe83904f4f9bcaa6079ff0572adbbd0909a22bfa91401dfd181a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.expr_to_analyzed_type_SemanticAnalyzer.expr_to_analyzed_type.return.self_anal_type_typ_repor": {"doc_hash": "26203398a18557abc64375af998c36e87f2c034cad0a677c128961ff18263435"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_type_expr_SemanticAnalyzer.analyze_type_expr.with_self_tvar_scope_fram.expr_accept_self_": {"doc_hash": "7be1d1a44495e624178a75f254cdf8ff141d24360ff4c184921cd43f9a7d86f9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.type_analyzer_SemanticAnalyzer.type_analyzer.return.tpan": {"doc_hash": "720eecae97f90d792d7a49e706e4a399f9c3ddf141ac7c796b6a5156f6fbf315"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.anal_type_SemanticAnalyzer.anal_type.return.typ": {"doc_hash": "c21efbe9fc58a2fa656f1a7fa6f30f0c40ecd4c4e45fc7d5944277fe10725457"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.class_type_SemanticAnalyzer.add_plugin_dependency.self_cur_mod_node_plugin_": {"doc_hash": "c0ba3f64f8102eb6ae64ef86636ab9985fc19b3a3de89bc0cf0ad20b8747e526"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.add_type_alias_deps_SemanticAnalyzer.add_type_alias_deps.self_cur_mod_node_alias_d": {"doc_hash": "f555229e129a784ee0f9eaffb3cb16c317001be66824c6dce33decfa87ef48f9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.is_mangled_global_SemanticAnalyzer.is_future_flag_set.return.flag_in_self_future_impor": {"doc_hash": "15918ae0e7261039d660aedd8a775024832f88110410b6dea824d919bd268cf8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_HasPlaceholders_names_modified_by_assignment.return.result": {"doc_hash": "d67b0300f6ac9619bf2fe47d08223ee707767895d560acf717ffa3b7e9cea4f9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_names_modified_in_lvalue_names_modified_in_lvalue.return._": {"doc_hash": "9d5130717ddfe92f25942d315d7a0df3953136d6d08c4c83a2e2f2f39a64a0b5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_is_same_var_from_getattr_dummy_context.return.TempNode_AnyType_TypeOfAn": {"doc_hash": "fca5bc3743827b5ad2382822460f969f2a942b785b232082f55569f0b10827ca"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_is_valid_replacement_": {"doc_hash": "17b474bdf474baa46f80f6c94d35095500239905eac4887b137d6c948baaa7e7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_classprop.py__Calculate_some_propert_TYPE_PROMOTIONS_PYTHON2_u": {"doc_hash": "a1b896c845fce4a47a43001667fcdd15ecb884c3a974119d6ba093ba7ee835b6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_classprop.py_calculate_class_abstract_status_calculate_class_abstract_status.if_typ_is_final_and_abstr.errors_report_typ_line_t": {"doc_hash": "6ec4b1a771a1eba8168a1e38a67e85b628d3db521cd07f76ca2c89f70f394e09"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_classprop.py_check_protocol_status_calculate_class_vars.for_name_sym_in_info_nam.if_isinstance_node_Var_.for_base_in_info_mro_1_.if_member_is_not_None.node.is_classvar.True": {"doc_hash": "0eae73b27fb961249f571916e98751478d98519b55aace0f4d6c096a219dbdab"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_classprop.py_add_type_promotion_": {"doc_hash": "21e5e4d08e375e16b8c757a5626e581dd1f9d7eb7597c82f4c827a623e5f51f7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_enum.py__Semantic_analysis_of_c_from_mypy_options_import_": {"doc_hash": "9c67f3e9e6839d8ce6915ffc28e3b723088e2a2eaa9847e618ca2f582715393d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_enum.py_EnumCallAnalyzer_EnumCallAnalyzer.process_enum_call.return.True": {"doc_hash": "22c52b5498a1b625afdd22d52e664af20ec5759bcaa272aafc4a8c128c1acd26"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_enum.py_EnumCallAnalyzer.check_enum_call_EnumCallAnalyzer.check_enum_call.return.info": {"doc_hash": "8eb52f022071be31a8fbab0a89ab1c4f552cff27c10011db7ed671b91e81e969"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_enum.py_EnumCallAnalyzer.build_enum_call_typeinfo_EnumCallAnalyzer.build_enum_call_typeinfo.return.info": {"doc_hash": "67dde2bd6ede6a72b1d79be494f26ddac2ffe879f48946e471ed45185e0a9159"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_enum.py_EnumCallAnalyzer.parse_enum_call_args_": {"doc_hash": "8502aafbe34bdb939ad0cf2442cd631e06a6895211fce708fb1dae56b345e8e5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_infer.py__Simple_type_inference__infer_decorator_signature_if_simple.if_dec_decorators_.if_sig_.dec.var.type.sig": {"doc_hash": "740744148ce4c6cc0406bdd7b9d441c676d9f248f9250b293d1e425499fdc20e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_infer.py_is_identity_signature_calculate_return_type.return.None": {"doc_hash": "d18d9b1888bd265030c2a0b8e3369d7126dac8579daa22bf93458d26cdd3b0b3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_infer.py_find_fixed_callable_return_": {"doc_hash": "327392918f4af26b14740ce80ebdf988ca6936bf00211e3d8d5f6c591b9afe06"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_main.py__Top_level_logic_for_th_core_modules._typing_builtins_a": {"doc_hash": "ef6a1f0ee014eb45de3258372e5a28defafd6fb48decd8a9221e82bd44fda4d7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_main.py_semantic_analysis_for_scc_semantic_analysis_for_scc.if_builtins_in_scc_.cleanup_builtin_scc_graph": {"doc_hash": "d523502f65051d5d2caf4323c0331b670cd90f93028d7754f65eafe2338f44b4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_main.py_cleanup_builtin_scc_cleanup_builtin_scc.remove_imported_names_fro": {"doc_hash": "f731510c0e8a0e949e9af89c7ff30a8bd2820e72dcd59fa0c3ab8cbae65f8028"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_main.py_semantic_analysis_for_targets_semantic_analysis_for_targets.calculate_class_propertie": {"doc_hash": "3f100dbec69b8b62ceb6f7f7eec61e0c5cc4436b41f8fe7ac147b5b180373988"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_main.py_restore_saved_attrs_restore_saved_attrs.for_cdef_name_sym_in_.if_existing_is_None_or.info_names_name_sym": {"doc_hash": "180c6a44335e5da8b811fba54dc5bc086b94b53bd009fc6ac9a8aade5f62215d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_main.py_process_top_levels_process_top_levels.while_worklist_.final_iteration.not_any_progress": {"doc_hash": "91c2436b93ae874846e298f185abfafda417a5bb97576e647fcceccaf4ba7940"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_main.py_process_functions_process_functions.for_module_in_scc_.for_target_node_active_.process_top_level_functio": {"doc_hash": "0ffa482faa5634f6a07959eaa2be7406e46581b6e6a5431a33dcc939409022b2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_main.py_process_top_level_function_process_top_level_function.analyzer_saved_locals_cle": {"doc_hash": "4e77abf776987ad6320ed421ad9111ff6e4ead9cc665edd1ede99da5e7394960"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_main.py_TargetInfo_get_all_leaf_targets.return.result": {"doc_hash": "bbd70566a5ac414b3e37380c408afa724f52ae36a93f929914d3b8fa28a22c37"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_main.py_semantic_analyze_target_semantic_analyze_target.if_analyzer_deferred_.else_.return._analyzer_incomplete_": {"doc_hash": "1079b7f637c4e482a14d00b1ce4ede980ae2772b70dc62b1f3d8f79369864241"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_main.py_check_type_arguments_check_type_arguments_in_targets.with_state_wrap_context_.with_strict_optional_set_.for_target_in_targets_.with_errors_scope_saved_s.target_node_accept_analyz": {"doc_hash": "e41a3c291221686bb0eb4e08976dc06c65f99b8fa01f775237d4a0527886bafa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_main.py_calculate_class_properties_": {"doc_hash": "ca900305168dec6ad183f4f95efb1afae80d648afc7280707a14e60820b5a076"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_namedtuple.py__Semantic_analysis_of_n_SELF_TVAR_NAME.__NT_": {"doc_hash": "bc08361d4caca916d1fee644a823cda3b4da2b8198b9ecb75b9bacee7f68629b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_namedtuple.py_None_5_NamedTupleAnalyzer.analyze_namedtuple_classdef.return.False_None": {"doc_hash": "1396e9768a74caf0bf539045bf0d824efb4855b5d3da27e525eeb2b7215f8645"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_namedtuple.py_NamedTupleAnalyzer.check_namedtuple_classdef_NamedTupleAnalyzer.check_namedtuple_classdef.return.items_types_default_ite": {"doc_hash": "51d881fa386f97922f466f35974f59e2436aff03c7116e70ba1b4e4d93356f95"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_namedtuple.py_NamedTupleAnalyzer.check_namedtuple_NamedTupleAnalyzer.check_namedtuple._because_classes_are": {"doc_hash": "801d87e9d3cab314c5a9ae3681d1f6a98032fc77774cdfc2da2b84f1588e2727"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_namedtuple.py_NamedTupleAnalyzer.check_namedtuple._the_name_of_l_h_s__NamedTupleAnalyzer.store_namedtuple_info.call_analyzed_set_line_ca": {"doc_hash": "a1c80a372899e244c409a9e37a501d5aef7bbe91efb54962b021bd875acbca73"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_namedtuple.py_NamedTupleAnalyzer.parse_namedtuple_args_NamedTupleAnalyzer.parse_namedtuple_args.return.items_types_defaults_t": {"doc_hash": "026c2ec97233ee832a99128fe00735c525b7298f8a4767bb67cb91853ab5faf3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_namedtuple.py_NamedTupleAnalyzer.parse_namedtuple_fields_with_types_NamedTupleAnalyzer.parse_namedtuple_fields_with_types.return.items_types_True": {"doc_hash": "5eb0ff33cd8b876621174a99a3be8e7538ec314cd31d5d31b0f9ebc92404598a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_namedtuple.py_NamedTupleAnalyzer.build_namedtuple_typeinfo_NamedTupleAnalyzer.build_namedtuple_typeinfo.selftype.TypeVarType_tvd_": {"doc_hash": "2670cf2236e22da5ce3f139708333422f94834f9a8b6756ff11767e13bbcc0d5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_namedtuple.py_NamedTupleAnalyzer.build_namedtuple_typeinfo.add_method_NamedTupleAnalyzer.build_namedtuple_typeinfo.add_method.info_names_funcname_sy": {"doc_hash": "7d7e99c85bcba7dc9e56f0616c80e5f93eee36b32bc2f700cb2e867272acf185"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_namedtuple.py_NamedTupleAnalyzer.build_namedtuple_typeinfo.add_method__replace_re_NamedTupleAnalyzer.build_namedtuple_typeinfo.return.info": {"doc_hash": "26718a55079d994864bbf7bc26ac4d43fafc171e904d217e8a47ec476b951a10"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_namedtuple.py_NamedTupleAnalyzer.save_namedtuple_body_": {"doc_hash": "31ab7435f35a6caa7e3c655952ffad0087215fa703dd2c50a0553d38beb361a9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_newtype.py__Semantic_analysis_of_N_from_mypy_import_errorcod": {"doc_hash": "c243c2f59710b19c85119a9b81b27d2f2f5780746d00c17bd92518138eba0779"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_newtype.py_NewTypeAnalyzer_NewTypeAnalyzer.process_newtype_declaration.return.True": {"doc_hash": "dfb7af7317ee770ee369fb1af3fdc4b72fe35e760dfbcb5ba9ac09add5fa3108"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_newtype.py_NewTypeAnalyzer.analyze_newtype_declaration_NewTypeAnalyzer.analyze_newtype_declaration.return.name_call": {"doc_hash": "09cb3b2dbf5d44aff1eec8cd272d591e2b3e6376ac45ffa3fc03fae7c78f85a6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_newtype.py_NewTypeAnalyzer.check_newtype_args_NewTypeAnalyzer.check_newtype_args.return.None_if_has_failed_else_o": {"doc_hash": "e820eb2a3e6a0b5432aea305a2f4b8ab90cbf9989fadfb4d543346b1b9f680de"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_newtype.py_NewTypeAnalyzer.build_newtype_typeinfo_": {"doc_hash": "05b405709b0f906c0d4855ae530510ec5283e392580315fae25cb3926bb67734"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_pass1.py__Block_import_reachabil_SemanticAnalyzerPreAnalysis._Analyze_reachability_o": {"doc_hash": "7214ab29ca10fa86d5f90d6d6afe1d84e950afe27efabaf343afc3ed06ef6dea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_pass1.py_SemanticAnalyzerPreAnalysis.visit_file_SemanticAnalyzerPreAnalysis.visit_file.for_i_defn_in_enumerate_.if_isinstance_defn_Asser.break": {"doc_hash": "bb5edf341f30714559cf8be26c7910f800147554ae824dcfe5c3d57d5a4bfe45"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_pass1.py_SemanticAnalyzerPreAnalysis.visit_func_def_SemanticAnalyzerPreAnalysis.visit_func_def.if_self_is_global_scope.file_node.is_partial_stub_package.True": {"doc_hash": "406aa35b4053b2135ac21d20138f10add1f2e2e850ffc3efc33fba85708be388"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_pass1.py_SemanticAnalyzerPreAnalysis.visit_class_def_": {"doc_hash": "626a540bfd79c4b9d7482a3549627630cd4ee328c638b5cc88369be857482a3b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_shared.py__Shared_definitions_use_PRIORITY_FALLBACKS.1": {"doc_hash": "318d58145b99c68f39a9dce7cdc941dd40dfb50599c7cb21da6eb018d6b1007d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_shared.py_SemanticAnalyzerInterface_SemanticAnalyzerInterface.is_func_scope.raise_NotImplementedError": {"doc_hash": "4354e4808de29be29917b696eec9c229a0a566b95e981a53886191fd8385f815"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_shared.py_create_indirect_imported_name_create_indirect_imported_name.return.SymbolTableNode_GDEF_lin": {"doc_hash": "b207b6951b1e093206d826d33a79c9d1ae5b4da41728ea98055a7b360769125d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_shared.py_set_callable_name_set_callable_name.if_isinstance_sig_Functi.else_.return.sig": {"doc_hash": "72097c1d1ddd46aa9006fe089ec9793315e0fcfd306c6f95b6ff8a4525c1ab00"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_shared.py_calculate_tuple_fallback_": {"doc_hash": "8aeeb6857982465920bbcaa29016b70bc1d0600727885c7fff0845f415d320c5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_typeargs.py__Verify_properties_of_t_from_mypy_import_message_": {"doc_hash": "7818672ba7e535367882700143a6d9ec3001369a3dfa43bc6a811cecfd38e052"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_typeargs.py_TypeArgumentAnalyzer_TypeArgumentAnalyzer.visit_type_alias_type.get_proper_type_t_accept": {"doc_hash": "6311d697035964bc5c68f4618f1c0a9211a0337257fa3c43647d721a32982e7e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_typeargs.py_TypeArgumentAnalyzer.visit_instance_TypeArgumentAnalyzer.visit_instance.super_visit_instance_t_": {"doc_hash": "ebc66723dbe362d4f4e01f357fa0223126d2ff1153c0ad58f53edc99d5209c0c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_typeargs.py_TypeArgumentAnalyzer.check_type_var_values_": {"doc_hash": "4aeff2426280d8d5e1e3224fe165de3ae9e3bb0475d29afcf1d23361ec5b7b8c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_typeddict.py__Semantic_analysis_of_T_TPDICT_CLASS_ERROR._Invalid_statement_in_Ty": {"doc_hash": "f1c14ecd5426afe5a12399ad62bce386b595d284a29359cb7f8451de8028f710"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_typeddict.py__type_Final_TypedDictAnalyzer.analyze_typeddict_classdef.return.False_None": {"doc_hash": "d85d9cc7c38c6f3be5553b24be5fbc614e2c770bac1c59dc16e9adbcf1f4877f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_typeddict.py_TypedDictAnalyzer.analyze_typeddict_classdef_fields_TypedDictAnalyzer.analyze_typeddict_classdef_fields.return.fields_types_required_k": {"doc_hash": "6ee101bc41c8c8733d3571f7d8f0bb20954097f1bdfc2604136f4f759da1fd29"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_typeddict.py_TypedDictAnalyzer.check_typeddict_TypedDictAnalyzer.check_typeddict.return.True_info": {"doc_hash": "7bfe3e57c6a0d42a940b5061bc3cd8374ce47167dcd40418c39fd76bd9c32159"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_typeddict.py_TypedDictAnalyzer.parse_typeddict_args_TypedDictAnalyzer.parse_typeddict_args.return.args_0_value_items_typ": {"doc_hash": "837fb69791988122ceb413da3fc2dcccfe712d51e44c4cc6ddc0fcdd702954a4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_typeddict.py_TypedDictAnalyzer.parse_typeddict_fields_with_types_TypedDictAnalyzer.parse_typeddict_fields_with_types.return.items_types_True": {"doc_hash": "230c67259483420fc4ad37d71b7129a24ba0e42894774e2e74fcb0f12a8a925e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_typeddict.py_TypedDictAnalyzer.fail_typeddict_arg_": {"doc_hash": "9517535ac6072fca60bd6505c61e44061b46d1f07cc3408b6903c68222cd7ac1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astdiff.py__Utilities_for_comparin_SnapshotItem.Tuple_object_": {"doc_hash": "75f80dbe03a15b0d1d33d8dfb373bd1a86d54b4d6bcb57cf91945554d6460b16"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astdiff.py_compare_symbol_table_snapshots_compare_symbol_table_snapshots.return.triggers": {"doc_hash": "c6efec1509f680a864de27d76e11f90259a35654b23c352b07dde504ee41f94e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astdiff.py_snapshot_symbol_table_snapshot_symbol_table.return.result": {"doc_hash": "baf38b5a1029c5ecc541b8139377f3983448daf9a9af823dbb1737eab83b2300"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astdiff.py_snapshot_definition_snapshot_definition.if_isinstance_node_FuncB.else_.assert_False_type_node_": {"doc_hash": "46be8605c07be5d317abcff68a8b5b8b646809b39c6000e9643d0fb3a067a30b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astdiff.py_snapshot_type_encode_optional_str.if_s_is_None_.else_.return.s": {"doc_hash": "ff1acf25683b3e9df08d9717ffd42fc076cbc686fe2560d080031311a8a673dc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astdiff.py_SnapshotTypeVisitor_SnapshotTypeVisitor.visit_type_alias_type.return._TypeAliasType_typ_ali": {"doc_hash": "eab485fde17c775b5ed14e47a87dc4fde3a5c570d239dc53413b4119ae660cd2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astdiff.py_snapshot_untyped_signature_": {"doc_hash": "1a7b1e37c20244808e267978b02c7f6b928cffa6cf39a6e0f9128f2fcc6d34fe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astmerge.py__Merge_a_new_version_of_from_mypy_types_import_": {"doc_hash": "7b6c1004b893431c368e4479fca6e96934d91a62c5464c595714b2d2981b38aa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astmerge.py_from_mypy_util_import_get_merge_asts.replace_nodes_in_symbol_t": {"doc_hash": "7a347649d2e7b3c20256248d644167aabe4894c62b1306a23bea65da6373b3d9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astmerge.py_replacement_map_from_symbol_table_replacement_map_from_symbol_table.return.replacements": {"doc_hash": "7d0ba9fe463abde5b7105d49d484df98b87267663cf755f207986616b620104d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astmerge.py_replace_nodes_in_ast_SN.TypeVar_SN_bound_Symbo": {"doc_hash": "eac7927368da84a6d58ae25834d4eacb0cc3bb305d2c0c3ef65f5d8b9301e531"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astmerge.py_NodeReplaceVisitor_NodeReplaceVisitor.visit_call_expr.if_isinstance_node_analyz.node.analyzed.self_fixup_node_analyzed_": {"doc_hash": "d4b7a47635b8c110e61d1615d634386364f1738e4352f83832785927c2424dbe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astmerge.py_NodeReplaceVisitor.visit_newtype_expr_NodeReplaceVisitor.fixup.return.node": {"doc_hash": "53b06e0c345d36788270d73b60b13a6bf18c3639970be09e50b0465a1a2a0e13"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astmerge.py_NodeReplaceVisitor.fixup_and_reset_typeinfo_NodeReplaceVisitor.fixup_type.if_typ_is_not_None_.typ_accept_TypeReplaceVis": {"doc_hash": "cb47188e5c49acc9a1e7cc08c0de2e20191f17c27eaf6d9c4704b5e970879bce"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astmerge.py_NodeReplaceVisitor.process_type_info_NodeReplaceVisitor.process_type_info.for_i_base_in_enumerate_.self_fixup_type_info_base": {"doc_hash": "52f749b093d4f806b57ba50173ad73db6fc4b6b38797bc42214e3ac01211b6a0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astmerge.py_NodeReplaceVisitor.process_synthetic_type_info_NodeReplaceVisitor.replace_statements.return.result": {"doc_hash": "dcf16d0d73aa37f76c08b9751c5550ba9eaaa40d9bfa9ca29f9e8ae55bf26d09"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astmerge.py_TypeReplaceVisitor_TypeReplaceVisitor.visit_none_type.pass": {"doc_hash": "fe08530a94bd6283b98f09218a505cc4b4168bb9d3e6a84656301ba7a639d95e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astmerge.py_TypeReplaceVisitor.visit_callable_type_TypeReplaceVisitor.visit_callable_type.for_tv_in_typ_variables_.if_isinstance_tv_TypeVar.for_value_in_tv_values_.value_accept_self_": {"doc_hash": "a9f788c2920ce262ba75faa8b9f303e4caf909f8cfdc0ff39ceb4b5a3449f98a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astmerge.py_TypeReplaceVisitor.visit_overloaded_TypeReplaceVisitor.fixup.return.node": {"doc_hash": "bc8e165fc8c9aa35fc1db84d90fe492331b9f6c1657f53ba4633f20227e316cf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astmerge.py_replace_nodes_in_symbol_table_": {"doc_hash": "33f8988974d68b02adb7fe71d9a32bdc849fdfaee79ead1bb0b8928c5e9633eb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/aststrip.py__Strip_reset_AST_in_pla_SavedAttributes.Dict_Tuple_ClassDef_str_": {"doc_hash": "6a88e259e6c1721c67159ca3fb14cdb984f439fe1c18c832ff3b4c769406ea92"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/aststrip.py_strip_target_strip_target.if_isinstance_node_MypyF.else_.node_accept_visitor_": {"doc_hash": "9c68b6bebfba206ca6d3c616c1c4e8bb08a755d62924c2e07a964d7fbf23e635"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/aststrip.py_NodeStripVisitor_NodeStripVisitor.__init__.self.saved_class_attrs.saved_class_attrs": {"doc_hash": "fc6fc5b43fd9ae52328e1710b5075a85897ef78d7cd917185bd38f1c99d51ef0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/aststrip.py_NodeStripVisitor.strip_file_top_level_NodeStripVisitor.visit_block.super_visit_block_b_": {"doc_hash": "5d0d401aace9a794b8e608059fb4afa7f41b26f6b010fd739747a657ec400451"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/aststrip.py_NodeStripVisitor.visit_class_def_NodeStripVisitor.visit_class_def.node.info.CLASSDEF_NO_INFO": {"doc_hash": "71d53f0efb57487993b0f79ccb1b8b0b8d95c6a5c77643e13019e43f3af3770b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/aststrip.py_NodeStripVisitor.save_implicit_attributes_NodeStripVisitor.visit_func_def.with_self_enter_method_no.super_visit_func_def_no": {"doc_hash": "8c8716271f0457ec4f7929fffd9e54fd15a26b6d8b447b482e7536dc7f6aa47b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/aststrip.py_NodeStripVisitor.visit_decorator_NodeStripVisitor.visit_super_expr.super_visit_super_expr_": {"doc_hash": "74674eb06fbd8475dd69d7382ebe1e5d203c8361db23f7ffc06c7d148014f8f6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/aststrip.py_NodeStripVisitor.process_lvalue_in_method_NodeStripVisitor.process_lvalue_in_method.if_isinstance_lvalue_Mem.elif_isinstance_lvalue_S.self_process_lvalue_in_me": {"doc_hash": "d20e93d78b2afb32999894b8ec8cf979c2361c4123f0a2204ad78dd066ea3958"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/aststrip.py_NodeStripVisitor.enter_class_": {"doc_hash": "7e81d9fa76e81c265fa80e70c4e43073094240c1e2d1466ddc0169704c501f76"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py__Generate_fine_grained__from_typing_import_Dict_": {"doc_hash": "6c276547b9b5ebb28af3924749b566476b801219a1c120289989c7d34b17aebd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_from_typing_extensions_im_get_dependencies.return.visitor_map": {"doc_hash": "6b03168a18ce951291b142fdffb2bf00df12cc3326a6fcc529b7d32dacf54873"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_get_dependencies_of_target_get_dependencies_of_target.return.visitor_map": {"doc_hash": "d5b595ed61c6365e19af92f3087e7475191e28ef63dc2ae20eef81d94f092fab"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor_DependencyVisitor.visit_mypy_file.self_scope_leave_": {"doc_hash": "3c1d9b4ac3f12706778222bb871f09152e5193ac4611518b0f585b4f66bae867"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.visit_func_def_DependencyVisitor.visit_func_def.self_scope_leave_": {"doc_hash": "ff40355967a69bfbf445bb60bc64b02aedc58ef5068cd9de4519a6bd7be15cef"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.visit_decorator_DependencyVisitor.visit_decorator.super_visit_decorator_o": {"doc_hash": "ce2808f95daa5c11cff5dd700a9327dc9f404624221708373b088d4127ee008a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.visit_class_def_DependencyVisitor.visit_newtype_expr.if_o_info_.self_scope_leave_": {"doc_hash": "7fc846127b90db3455e5025dbd4f48b2d870c063f6882b7552736538948ba5af"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.process_type_info_DependencyVisitor.process_type_info.for_name_node_in_info_na.if_isinstance_node_node_.for_base_info_in_non_triv.self_add_dependency_make_": {"doc_hash": "677b734b379d11a112c085082913c5da220256981525df62bbe7f43e312cbe10"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.process_type_info.for_base_info_in_non_triv_DependencyVisitor.process_type_info.for_base_info_in_non_triv.if_not_self_use_logical_d.None_3": {"doc_hash": "eeb52f293ccb43e24efb33c4d80ccf85c9a01822069a2650ae72503d40644bdb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.visit_import_DependencyVisitor.visit_block.if_not_o_is_unreachable_.super_visit_block_o_": {"doc_hash": "234bb8d359ab517fc3cfd99ea7301f5c8bf8b35409dd499bbaa2896b9b77597f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.visit_assignment_stmt_DependencyVisitor.visit_assignment_stmt.if_isinstance_rvalue_Cal.else_.if_o_type_.self_add_type_dependencie": {"doc_hash": "7e2868d781e0be56956e26012ee0eceda849ee96c3e8c0008afaaae6f36b520a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.visit_assignment_stmt.if_self_use_logical_deps__DependencyVisitor.visit_assignment_stmt.if_self_use_logical_deps_.if_isinstance_rvalue_Ca.for_lv_in_o_lvalues_.if_isinstance_lv_RefExpr.self_add_dependency_make_": {"doc_hash": "04798dfab22f668e9bb36e761c9b008c133d5c28d242c7044f05b4e70c7c8ae7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.process_lvalue_DependencyVisitor.process_lvalue.if_isinstance_lvalue_Ind.elif_isinstance_lvalue_S.self_process_lvalue_lvalu": {"doc_hash": "f0da0ef39ef115d923e20bfd08e07d4583d3c17dd1736eaee00cf3d6f64fa579"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.is_self_member_ref_DependencyVisitor.get_non_partial_lvalue_type.return.lvalue_type": {"doc_hash": "21f7a8df9de73834d9ad738ab4c721816288e9786e2a0e62c00dcf3ee3f4a671"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.visit_operator_assignment_stmt_DependencyVisitor.visit_for_stmt.if_o_index_type_.self_add_type_dependencie": {"doc_hash": "c0ca9bcb5fee9122994a67d2515f6473a411fa50296009a5cfc8b47145b2c7ac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.visit_with_stmt_DependencyVisitor._Expressions": {"doc_hash": "7f7b37fe13c8f50956f9fb9c351ae4f602dc8e03f08dc1494f06b5e9970bb5b9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.process_global_ref_expr_DependencyVisitor.visit_name_expr.self_process_global_ref_e": {"doc_hash": "a1d9137f13af5507bf55f6f715e614d6513b2f3956e01c22f3998e5b24ad4959"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.visit_member_expr_DependencyVisitor.visit_member_expr.if_e_kind_is_not_None_.else_.if_self_use_logical_deps_.if_name_is_not_None_.self_add_dependency_make_": {"doc_hash": "b240e4a4ef0dd7e8d5fb5db8b16c0f34183d06ec89e28aa0c0c9a4044b08f678"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.get_unimported_fullname_DependencyVisitor.get_unimported_fullname.return.None": {"doc_hash": "87874a5df33b2d6a38527db33ba079057cbca7a77749f313e03f89710ba6f66f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.visit_super_expr_DependencyVisitor.visit_call_expr.if_isinstance_e_callee_R.else_.if_typ_is_not_None_.if_not_isinstance_typ_Fu.self_add_attribute_depend": {"doc_hash": "fd24ff2332fa3786942f3c50432d1c8ad3c1a65c6d0bcb1c501ee332b9d24876"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.process_isinstance_call_DependencyVisitor.process_isinstance_call.super_visit_call_expr_e": {"doc_hash": "9126a9df4b0a481856723de914c15645e1c383550041c1b21a28bb5d689bed74"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.visit_cast_expr_DependencyVisitor.visit_op_expr.self_process_binary_op_e_": {"doc_hash": "bd87a5353b9429da7848f095ae7dc128d81558778d57a331193484ce98d6d1c7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.visit_comparison_expr_DependencyVisitor.visit_comparison_expr.for_i_op_in_enumerate_e_.if_self_python2_and_op_in.None_1": {"doc_hash": "e101547bf5897c81f6e2be98ac00a50da25c43f11eb6024fe53a1eca8b04530f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.process_binary_op_DependencyVisitor.add_operator_method_dependency.if_typ_is_not_None_.self_add_operator_method_": {"doc_hash": "bc33cce1a179c32b903bf92f70a4912ddc487e5132f37555ff8680c0159c8106"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.add_operator_method_dependency_for_type_DependencyVisitor.add_operator_method_dependency_for_type.if_isinstance_typ_Instan.elif_isinstance_typ_Type.if_isinstance_typ_item_I.self_add_operator_method_": {"doc_hash": "29f6e9a6ca27b312cc0043415de728f83cdbb133633021689a84ee8030674111"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.visit_generator_expr_DependencyVisitor.add_type_alias_deps.if_target_in_self_alias_d.for_alias_in_self_alias_d.self_add_dependency_make_": {"doc_hash": "8686e65ff8c0b751dc47be97ecad2ab0c74c0162b0578a2e1a5a702ee8c953a4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.add_dependency_DependencyVisitor.add_dependency.self_map_setdefault_trigg": {"doc_hash": "761266ad1ce2ced8b6faf60f15599208f7841ecf803f33f19090edcd7a640009"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.add_type_dependencies_DependencyVisitor.add_attribute_dependency.for_target_in_targets_.self_add_dependency_targe": {"doc_hash": "5ce8e95c333bddad52780f0f9bfd730ef567563962d6b3d60478e180ae416fa0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.attribute_triggers_DependencyVisitor.attribute_triggers.if_isinstance_typ_Instan.else_.return._": {"doc_hash": "bb850200c4eb905d517573ca5ddf6e23289f81c03c56d58dea9f6cbaf5776fed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.add_attribute_dependency_for_expr_get_type_triggers.return.typ_accept_TypeTriggersVi": {"doc_hash": "e5bb6f9edd972b1567595f86dcdcafdf0fb142d6a0c2af3a9a4722a08e57b19c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_TypeTriggersVisitor_TypeTriggersVisitor.visit_instance.return.triggers": {"doc_hash": "342b96effa31e2d4461926c01ab9cc3d2517a655b7061d79015ca0119beb468a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_TypeTriggersVisitor.visit_type_alias_type_TypeTriggersVisitor.visit_type_alias_type.return.triggers": {"doc_hash": "e7cfcbd19d557fa75c53fa41b9fead229e109b79bb3b15c16dd31bf151f27b2f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_TypeTriggersVisitor.visit_any_TypeTriggersVisitor.visit_union_type.return.triggers": {"doc_hash": "6cbcfa17d9f6f6efaae270b2a637ea53fefb3d2e31e3f409cf24286cfcb7042d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_merge_dependencies_has_user_bases.return.any_base_module_name_not_": {"doc_hash": "b218fc5a2fcdf33ccfb3a0d96039815f82f0496469cedcf86030ea0a8943c55a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_dump_all_dependencies_": {"doc_hash": "717a9ec502147769e177ebd7d96a91308713905b0be76c6aae47e92e8b31e493"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/mergecheck.py__Check_for_duplicate_AS_check_consistency.for_sym_in_syms_.assert_sym_fullname_not_i": {"doc_hash": "9d85baa2757af6d185a91438af22c395500f364265a8fe30c45040373e6750a9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/mergecheck.py_path_to_str_": {"doc_hash": "3527a32e90aef31f8f61a64ca364f0c2633d41d840c78ac865e68542be8115b7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/objgraph.py__Find_all_objects_reach_isproperty.return.isinstance_getattr_type_o": {"doc_hash": "091b1d8ba57f5e4e3fa3609aa9c18d40fc2c4e7d21ce68c22dbfbd56f231ca58"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/objgraph.py_get_edge_candidates_get_edge_candidates.if_isinstance_o_Mapping_.elif_isinstance_o_Iterab.for_i_e_in_enumerate_o_.yield_i_e": {"doc_hash": "03ca13d64f6887c505e381d18e04416e85e6767b8121dc795c48ff1ebca7791d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/objgraph.py_get_edges_get_edges.for_s_e_in_get_edge_cand.if_isinstance_e_FUNCTIO.else_.if_not_type_e_in_TYPE_BL.yield_s_e": {"doc_hash": "03441dc8fdcfc6d5bd50c35f9449fd7c2b7ce7d6a4f72557a545de69fc7ba154"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/objgraph.py_get_reachable_graph_": {"doc_hash": "d245dca367657fcebe6780f4da053f807e663cfb619d890fe6b3a49465467067"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/subexpr.py__Find_all_subexpression_get_subexpressions.return.visitor_expressions": {"doc_hash": "90a425bd13f0921e259c23ceb8a57e4a96dc10b3f628bd9285d7930f60eab91b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/subexpr.py_SubexpressionFinder_SubexpressionFinder.visit_generator_expr.super_visit_generator_e": {"doc_hash": "d76e3bf4a2cda9889c85109e2c966638d9359c7561218c2c22c3f3f13dbfd6d3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/subexpr.py_SubexpressionFinder.visit_dictionary_comprehension_": {"doc_hash": "112945b08b5ccba23ebb86b75d3d09b21b71f59d504dfb1fdd8aa5da61fd3a53"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/target.py__": {"doc_hash": "2575bddbd8392f9136c5ceb9b50dc6c776fa807aea6cf7b68836078689f78e57"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/trigger.py__AST_triggers_that_are__": {"doc_hash": "3a789dd4a51dc91615b3691459e9e21d7af04a72ef12ca39795a71381abb08b4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py__Update_build_by_proces_os": {"doc_hash": "a5d606ab96eb3f28c5303556fe4d1e8ab8f9ab658296da6d018858e618e5a170"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_sys_SENSITIVE_INTERNAL_MODULES.tuple_core_modules_m": {"doc_hash": "1719b2181503c3b3d4cba1d2cd63cf21d646b48745ba9262ed6f8e78cc1ffa20"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_FineGrainedBuildManager_FineGrainedBuildManager.__init__.None_16": {"doc_hash": "380ff21d70c3220f758093ad33913fbb0daad225649b31556790f70e8bf25c65"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_FineGrainedBuildManager.update_FineGrainedBuildManager.update.return.messages": {"doc_hash": "de85ad326462e8c298a977e323c2c6c64b35c3d9a7bfb4ef02e89f824949acec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_FineGrainedBuildManager.update_one_FineGrainedBuildManager.update_one.return.changed_modules_next_id": {"doc_hash": "1825f16ceab39f53bfb26ae34a58c59b2e1a9db54a24abd5797cccb70b68f2af"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_FineGrainedBuildManager.update_module_FineGrainedBuildManager.update_module.return.remaining_module_path_": {"doc_hash": "175941958f4fb471222f7a9e96a55e9c6e57a4d6f3192cb7fe6ee6b597360da9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_find_unloaded_deps_find_unloaded_deps.return.unloaded": {"doc_hash": "ce5b4cbd2f6076fe2a8c7a6861bc14c78e264a75b89f40015b087f99d143f108"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_ensure_deps_loaded_ensure_deps_loaded.for_i_in_range_len_parts_.if_base_in_graph_and_not_.graph[base].fine_grained_deps_loaded.True": {"doc_hash": "cd5f2cffca8db5cd00648c31e01ae7a4beeaf72efca048db1f4da7c5352ee977"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_ensure_trees_loaded_ensure_trees_loaded.if_to_process_.process_fresh_modules_gra": {"doc_hash": "5a181a4feb1073cf9d826920b7bf72453b0609eed2fd086b287bb572b322ffee"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_fix_fg_dependencies_UpdateResult.Union_NormalUpdate_Block": {"doc_hash": "bf264adf4f5e3961e1b063c949d49ebe536e399a7afcfc8e1bdf8ba844e9d796"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_update_module_isolated_update_module_isolated.None_1.except_CompileError_as_er.return.BlockedUpdate_module_pat": {"doc_hash": "aabc0f3784b92ace795c950dfb52072d4fbb5c8a70d6d24d220da0ba74399a65"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_update_module_isolated._Merge_old_and_new_ASTs__update_module_isolated.return.NormalUpdate_module_path": {"doc_hash": "4e021c89af4ea2d5bb0604326ed62b058bf0fba45dbc027e1f3766c7cde7c273"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_find_relative_leaf_module_find_relative_leaf_module.return.modules_0_": {"doc_hash": "ecd195e80eebb9889857313093baa0519a147ea572d84ea660829ebccdf55d73"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_delete_module_delete_module.if_manager_fscache_isfile.manager_missing_modules_a": {"doc_hash": "6bffb41c78f617595e4e33f62372a50f972740b146df8af7464a54034278148c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_dedupe_modules_get_sources.return.sources": {"doc_hash": "40ff269b2f979db7ec52e106a70dc51790987725172bbb859b5cd3d69c98d047"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_calculate_active_triggers_calculate_active_triggers.return._make_trigger_name_for_n": {"doc_hash": "d7df89a938287892afbf573258a419de62cd36315ceb6ae787769401e9c610d0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_replace_modules_with_new_variants_replace_modules_with_new_variants.for_id_in_new_modules_.if_preserved_module_and_n.graph[id].tree.preserved_module": {"doc_hash": "10bbdfcd404b9bcfb1a8883645c69f5022fa9f4b54244beac4fae9882d5f4239"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_propagate_changes_using_dependencies_propagate_changes_using_dependencies.return.remaining_modules": {"doc_hash": "e34286699c674fbe7929b32697dc6506073db23b57c83f321bab2d94a9152333"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_find_targets_recursive_find_targets_recursive.return.result_unloaded_files_s": {"doc_hash": "bf611f90f7765261878da557591741833bf4481a41fa821e742ab98df66bd145"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_reprocess_nodes_reprocess_nodes.return.new_triggered": {"doc_hash": "306d087ca9083c6b2d4a273f15d3b211365b51c9667882e60a2257b73e539ec1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_find_symbol_tables_recursive_find_symbol_tables_recursive.return.result": {"doc_hash": "e2301efcff1fba53bc97ddf42e26cf40b3cabf632a838610a5d4a51080b88710"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_update_deps_update_deps.TypeState_update_protocol": {"doc_hash": "e22c1e06c97afe4367fab900f7ae8bcbb767fcf1cbafc15dbbfbcd96a3a2354f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_lookup_target_lookup_target.return._FineGrainedDeferredNode_": {"doc_hash": "c6613cfa6163f09a992aa8cd862973f45c7cd2da150f276cb50b370f4c5e3b21"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_is_verbose_if_sys_platform_win32.else_._type_Final": {"doc_hash": "83964ab544c95a91f2732f7610c4b03cfcbfb5a186066157088dbb4199bd5336"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_refresh_suppressed_submodules_": {"doc_hash": "1f68e9cd4be9ad615b7bd4d5e302d0fd091e96c8ab372ad6cf83a99986f4a1c1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/sharedparse.py_from_typing_import_Option_": {"doc_hash": "706b9702cc4e07b00817c774c2a8ab7218a642ed7a1ddd5b2c568cb642fe1edb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/sitepkgs.py_from___future___import_pr_": {"doc_hash": "5d1a41607f3a4cfc85023e682be2e3eaf19fe19498f2e69b7844205132ee1ad0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/solve.py__Type_inference_constra_": {"doc_hash": "a7097aa229815e2b67a23fd876f3ab430d98da311880c86514c1dceebb2b694c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/split_namespace.py__Split_namespace_for_ar_": {"doc_hash": "9874c7009758c791e646bb6e17346a3d901fd1fe7204137000f8baf76772d732"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/state.py__": {"doc_hash": "a9ac2e69d8a0edb055d65420fae5df1e29d4c450ed29255561a409167200f647"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stats.py__Utilities_for_calculat_precision_names._": {"doc_hash": "8cb031011d5581983989f8fc429efe3a817a0a22c2adbbb6b499ca464f17cfeb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stats.py_None_6_StatisticsVisitor.visit_import.self_record_line_imp_line": {"doc_hash": "6ce0ea10d9dcda78592aa93d844b814b99f07bd6803f15066d6c8240d6223650"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stats.py_StatisticsVisitor.visit_func_def_StatisticsVisitor.visit_func_def.with_self_enter_scope_o_.if_len_o_expanded_1_an.else_.if_not_o_is_dynamic_or_.super_visit_func_def_o_": {"doc_hash": "199f81d86971fe6178b67e41e5fd8177d7a4942449d74895bce5151f94561610"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stats.py_StatisticsVisitor.enter_scope_StatisticsVisitor.visit_class_def.o_defs_accept_self_": {"doc_hash": "25c7d418cd7ae1a50a8ae4f486f3d1d274c5062d3c898d992284b930d029f4c4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stats.py_StatisticsVisitor.visit_type_application_StatisticsVisitor.visit_assignment_stmt.super_visit_assignment_": {"doc_hash": "f7ec90c5e10a58e9ee932143f6226502d5a0634041f9b9d8c4d2b372474bdd67"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stats.py_StatisticsVisitor.visit_expression_stmt_StatisticsVisitor.record_call_target_precision.if_isinstance_callee_type.else_._TODO_Handle_overloaded": {"doc_hash": "b7bf2bda0dd705dab144444073622efa547fc153eef41f501a873c400106b64e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stats.py_StatisticsVisitor.record_callable_target_precision_StatisticsVisitor.record_callable_target_precision.for_formals_in_actual_to_.for_n_in_formals_.if_isinstance_formal_Any.elif_is_imprecise_formal_.self_record_line_o_line_": {"doc_hash": "c2d8cc44da2e6104ee169b7cd822ee8480518a0ff23506cc995184d52f475e33"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stats.py_StatisticsVisitor.visit_member_expr_StatisticsVisitor.record_precise_if_checked_scope.self_record_line_node_lin": {"doc_hash": "430878f9da9146b80940389d1fc8f2b3db5bc92c9130b0be158d1ca970e6b34b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stats.py_StatisticsVisitor.type_StatisticsVisitor.record_line.self_line_map_line_max": {"doc_hash": "3cc59500bbe0e7fac24d62366ac5853863add6724b9f7db73c346cad73155d25"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stats.py_dump_type_stats_dump_type_stats.None_13": {"doc_hash": "8d7f189a342aead16a2a09eb295a682fd89a70cee5e5b7166da3013e5a870218"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stats.py_is_special_module_": {"doc_hash": "149d45b602f3180edc8789bc7f5b1dbbdd6c56289b9ce875427a7f591d999d86"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py__Conversion_of_parse_tr_StrConv.format_id.if_self_id_mapper_.else_.return._": {"doc_hash": "e1294e7f5dcce32a29c82b4f732a1b415f9fae08b467b406db09864ee91105a7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv.dump_StrConv.dump.return.dump_tagged_nodes_tag_s": {"doc_hash": "52c9cae97b2f53e8cf89eb811890ea5442993745681b961d6fe4cdeddf4514c8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv.func_helper_StrConv.func_helper.return.a": {"doc_hash": "beeabedf9f6aa3bb6b5d63f7cae3be4039fd0480f54271ba4ebf94418742b959"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv._Top_level_structures_StrConv.visit_mypy_file.return.self_dump_a_o_": {"doc_hash": "f5c0877ed2dd08a7b75c012a5e3fd60addd9b2c029d7e09a216de19d77e3937e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv.visit_import_StrConv._Definitions": {"doc_hash": "fd00303fb527b6930c45984295e2c3779ea7d73252c3cb7e2a5b41d80515613c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv.visit_func_def_StrConv.visit_overloaded_func_def.return.self_dump_a_o_": {"doc_hash": "a75ca8c8287f7d8409e937218fe7709ddae2ea1c70a663be797d1ee941d7fc61"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv.visit_class_def_StrConv.visit_class_def.return.self_dump_a_o_": {"doc_hash": "0a7cc49c8a875c46c4c92fae505fa9bf928b7cd76a2129c04c5da670cb2d421a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv.visit_var_StrConv.visit_raise_stmt.return.self_dump_o_expr_o_from": {"doc_hash": "10576dfdc8de6f84da4f183cc6c3b3a904551dfa79a65b67ad274af860fb22fb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv.visit_assert_stmt_StrConv.visit_del_stmt.return.self_dump_o_expr_o_": {"doc_hash": "4eb1a59201ba76981f003347c476b8ad87a291eb1feeb8b97905343bca3fdbf1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv.visit_try_stmt_StrConv.visit_try_stmt.return.self_dump_a_o_": {"doc_hash": "6016a3bda67851dd71badce2afdcf43b9676eae78bff5bcb5f71403b101db39c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv.visit_with_stmt_StrConv.visit_name_expr.return.short_type_o_pre": {"doc_hash": "d4f5dd7b12d1f3e08dee9659e0eb819c46c73204a973d6bc762eaf1d0ef7018d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv.pretty_name_StrConv.pretty_name.return.n": {"doc_hash": "c1d71a27ac8599880cc6ef44745579bd8cec8a1fc4e39fe53eae4539792a4280"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv.visit_member_expr_StrConv.visit_yield_from_expr.if_o_expr_.else_.return.self_dump_o_": {"doc_hash": "437e7af0886bad76689b2e8218cbd541b69ff4a8900dc752aded39421bca3448"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv.visit_call_expr_StrConv.visit_call_expr.return.self_dump_a_extra_o_": {"doc_hash": "a1ec3a5c2e88898e68ad81d837afa2dff85d7bef954ba8b0f86097ea91492206"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv.visit_op_expr_StrConv.visit_type_application.return.self_dump_o_expr_Type": {"doc_hash": "d9b5f1f456c11de6655d2d85228fffec816fcdea3ccc5fb6f00c5f9d0bbd71e2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv.visit_type_var_expr_StrConv.visit_type_var_expr.return.self_dump_a_o_": {"doc_hash": "8310311b4912b9431bccb69cf42554214c7476a3fd5c3f491ab9ce64ad3c8629"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv.visit_paramspec_expr_StrConv.visit_paramspec_expr.return.self_dump_a_o_": {"doc_hash": "50cd1991038d2f7d9a473bc00a8f44fe9e9a510d3b80f7fc9db2ea7ac03b6ef8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv.visit_type_alias_expr_StrConv.visit_temp_node.return.self_dump_o_type_o_": {"doc_hash": "3ce75d90102cbd5bf5a4e45e14fe2352d904dabccced81a73d96dbd9ea022bc8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_dump_tagged_": {"doc_hash": "4012777211991cc017547df2effd674362f5afcc5d70285efafeb6fd74ee606c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubdoc.py__Parsing_inferring_sign_is_valid_type.return._TYPE_RE_match_s_is_not_": {"doc_hash": "dd51233d2ed9b3515f2a90722cccf5c037cd04162421f99b7b362b26a4cbfa56"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubdoc.py_ArgSig_ArgSig.__eq__.return.False": {"doc_hash": "bf169c0c8fa1114da45b5eafdfaec43e2564d293c83dbad3d5420da9e4962c00"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubdoc.py_FunctionSig_STATE_OPEN_BRACKET.7": {"doc_hash": "042fba7924ff14015466979083c2fa7e006d263ea4c8a33a5d0fb892fb07a832"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubdoc.py__type_Final_For_gene_DocStringParser.__init__._type_List_FunctionSig_": {"doc_hash": "8e247b6a995e8ca1973e32809d616170ec83d6db15fa8134beaad0b0dbe764d0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubdoc.py_DocStringParser.add_token_DocStringParser.add_token.if_token_type_tokeniz.else_.self_accumulator_token": {"doc_hash": "2ba85cf5671256cab3839e9be6ea4e0ebeb396dadb39ef4634d0d8b56ca41947"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubdoc.py_DocStringParser.reset_DocStringParser.get_signatures.return.list_sorted_self_signatur": {"doc_hash": "169f0ace915786806296c9c6107697a2926633c159eac5f4adc4a3f03f50c831"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubdoc.py_infer_sig_from_docstring_infer_sig_from_docstring.return._sig_for_sig_in_sigs_if_i": {"doc_hash": "da675f40a0ad5f785b3afeff8feacb53effc9423210055bb197793e68dcb58f5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubdoc.py_parse_signature_parse_signature.return.name_positional_optiona": {"doc_hash": "2a0f47c6fd9b9576cdc49a7d9159221ddd6d40f0f47094b8ee3bfa10630f9466"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubdoc.py_build_signature_parse_all_signatures.return.sorted_sigs_sorted_clas": {"doc_hash": "025b822e6411106b9baaead4fda4b5d70b3f4924e3c01c88f87a2bdc712bc678"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubdoc.py_find_unique_signatures_": {"doc_hash": "ae82c8439cca3dd4ef65f6cd3017a788a4498228c68adac31dba0b4b5eb13f79"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py__usr_bin_env_python3_from_mypy_stubutil_import": {"doc_hash": "f727dd31ecd9a017f3f54c96c4b7da8f94f10a8151303db3d84c30637e03c152"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_from_mypy_stubdoc_import__METHODS_WITH_RETURN_VALUE._": {"doc_hash": "ed4781b8992376908c1a151ec82ae4f228887bc4fab163d194c92a7e93b2f376"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_None_11_Options.__init__.self.export_less.export_less": {"doc_hash": "89899fcae2ec91687a4842da27c9ee74d44c0926950056b45b8548f1cc82f0fb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py__What_was_generated_prev_ERROR_MARKER._ERROR_": {"doc_hash": "62a55c81175d3d8ad57db5644390cd5f75e6594cb1ce6efab3b362f14eb1632f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_None_22_AnnotationPrinter.visit_type_list.return._format_self_list_s": {"doc_hash": "76b7fd31a024cdcf6645e82a5ef17804440ed269dce49af3145bd8d724e8619c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_AliasPrinter_AliasPrinter.visit_call_expr.return._format_callee_": {"doc_hash": "abf318d08c3e8b9cd551a5805b13ca75bfdfda35e034f1df008f1cdd84e87310"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_AliasPrinter.visit_name_expr_AliasPrinter.visit_ellipsis.return._": {"doc_hash": "d825961f290f8f4a24aaa1165973f6e040a5b19782818e67a4eee0cdd046b04f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_ImportTracker_ImportTracker.__init__.None_23": {"doc_hash": "ee1d82a836f790fdeb5896f9d24d1323903817cbf344d48fe1430e5c25300f24"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_ImportTracker.add_import_from_ImportTracker.add_import_from.for_name_alias_in_names_.self_direct_imports_pop_a": {"doc_hash": "664defeb1231e0c9ef3614d3eb250df6b3cfffde3d4c6bba947817d38f3bb4a3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_ImportTracker.add_import_ImportTracker.reexport.self_reexports_add_name_": {"doc_hash": "38f287a62a97cd1f5d69742c221c793156f5589862f7f8c9348ee5e273c5ceda"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_ImportTracker.import_lines_ImportTracker.import_lines.return.result": {"doc_hash": "c0b2cd69b4dc390c1a2fc5ea02b132f3140d7176eb5e73e8c691dba6a847b087"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_find_defined_names_find_referenced_names.return.finder_refs": {"doc_hash": "274dda4c91dd7294feebf40eb8b8c71d940acb4e53766d81ea163439ec22a9a3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_ReferenceFinder_ReferenceFinder.add_ref.self_refs_add_fullname_sp": {"doc_hash": "5285e9da5c8097f9ad0628a6d8ea2707268e77db325c98b3921e819d5d9cf7d2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator_StubGenerator.__init__.None_15": {"doc_hash": "f25000f6c0971e59dd3148c904089cabc436d6bf7a68021b52e2a80e387c9551"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.visit_mypy_file_StubGenerator.visit_mypy_file.if_undefined_names_.for_name_in_sorted_undefi.self_add_s_n_nam": {"doc_hash": "347581d2241087e142102ddec3c072601cb4813057c6008b32cdeec87d0deeb9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.visit_func_def_StubGenerator.visit_func_def.self._state.FUNC": {"doc_hash": "ef5368d8206789b443e52648943bea0a44e148624f0809f72a66c589c8447b73"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.process_name_expr_decorator_StubGenerator.refers_to_fullname.return._self_import_tracker_modu": {"doc_hash": "6d29e1293ce45f6cd8b32e0831439b05f49dd59d80de386e7ee4838800e0071d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.visit_class_def_StubGenerator.visit_class_def.self.method_names_5.set_": {"doc_hash": "e7d2226458ed8121b6df67e332814885dc8c6c58189a8eb33c6b4ecbf74295d2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.get_base_types_StubGenerator.visit_block.if_not_o_is_unreachable_.super_visit_block_o_": {"doc_hash": "282f18443fe4c4341b838df9b192711bb9b44b91064cfd21aae59f72f2655f0f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.visit_assignment_stmt_StubGenerator.visit_assignment_stmt.if_all_foundl_.self._state.VAR": {"doc_hash": "d994a0aafaec98d59777f285647ece3fb818fd228f09f4271cd695b35d675ed9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.is_namedtuple_StubGenerator.process_namedtuple.self._state.CLASS": {"doc_hash": "f7cdfadef390813f1f803610be4d3504dc1a9383fbbf29f7e5d180d844f07e0a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.is_alias_expression_StubGenerator.is_alias_expression.if_isinstance_expr_Call.else_.return.False": {"doc_hash": "aef5c3754707d2ed0fb4e871b18a96b4f0596ba16afc785c27e7130af82b5e48"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.process_typealias_StubGenerator.visit_import_all.self_add_import_line_fro": {"doc_hash": "b008b6db3bae007f590440aada5be9777d00aa2388124ca0d178adafdea0a545"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.visit_import_from_StubGenerator.visit_import_from.if_self__all__.exported_names_update_nam": {"doc_hash": "c691860dcfcc6896d4abf03b8d55ed67dda5bfae991d953d72d1f874fe41cd68"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.visit_import_StubGenerator.get_init.return._s_s_s_s_n_self__i": {"doc_hash": "1b3a0fc934d72634e0ba1e473451222c7190623a46378a71489fd796a9ff97a6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.add_StubGenerator.is_private_member.return.False": {"doc_hash": "e8b537c317aff607bbd194bf2110042054b0740f7590e36076bf84f33d34d347"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.get_str_type_of_node_StubGenerator.get_str_type_of_node.return.self_typing_name_Any_": {"doc_hash": "a3d71ed2f866a6fedcdb3fb94a95904458aa892dc027ede7c095fc62c4a44e97"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.print_annotation_StubGenerator.is_recorded_name.return.self_is_top_level_and_n": {"doc_hash": "db2d74cae487c6cc0f18310c3153175d2f1f6d9e7f7eafa2d7415fffdcb4d54b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_find_method_names_SelfTraverser.visit_assignment_stmt.if_isinstance_lvalue_Me.self_results_append_lval": {"doc_hash": "d7b2c8961397c5a6507cca1b4d77255f610c0f892bdd168675303e846f35d026"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_find_self_initializers_normalize_path_separators.return.path": {"doc_hash": "0a025f2ffbec3d917c58b9dcab7fd9424b9fed3367d8afe9d5dbd5453c333aae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_collect_build_targets_collect_build_targets.return.py_modules_c_modules": {"doc_hash": "01ba8a774a8c0f7218f797b31c81aed69b906b9d2b51f0a5d997aed8b0e2dbcb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_find_module_paths_using_imports_find_module_paths_using_imports.with_ModuleInspect_as_i.return.py_modules_c_modules": {"doc_hash": "05c393eefc84a371e47e0fea407f53c7961e88955b5ed669d5446f0d85f2dbbc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_is_non_library_module_translate_module_name.return.module_relative": {"doc_hash": "762937dfefb6a0e3ddfcf7a52c57548f757cf7244c378b65dde91b46ef56d358"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_find_module_paths_using_search_find_module_paths_using_search.return.result": {"doc_hash": "787d46c4c67349871ffbf9d1b1f2d0e0d818d9af4b5c00d1d63df6c1f5d6385f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_mypy_options_parse_source_file.if_errors_is_blockers_.sys_exit_1_": {"doc_hash": "50eeb9a628cbbb5c6346f1f06e816d9f160da28ca2ac052d13e3b32c1800b9de"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_generate_asts_for_modules_generate_asts_for_modules.for_mod_in_py_modules_.if_mod_runtime_all_is_Non.mod.runtime_all.res_manager_semantic_anal": {"doc_hash": "294d96e9646baebd3549c3a1802e0be311c384e10d3725d9b121cccc1ddfe816"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_generate_stub_from_ast_generate_stub_from_ast.with_open_target_w_as.file_write_join_gen_ou": {"doc_hash": "785c43bbece2a662b7d36d06d1f1eee59e5252cd371bf32bc029d2e88b8d59d3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_collect_docs_signatures_collect_docs_signatures.return.sigs_class_sigs": {"doc_hash": "9cd7841f10a67a48d9eca77504b5453a5487489cde2aff835c618289fd29f5b4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_generate_stubs_DESCRIPTION._": {"doc_hash": "e98a06eaa7d48eeb178c52628154cfaff6216af821fa8c5fa442f692e2fad6dd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_parse_options_parse_options.if_not_os_path_exists_ns_.os_makedirs_ns_output_dir": {"doc_hash": "170546362794b9fce4025b95651534dcd8c6ba74c6cecf6e3e1fe9e55b0981ab"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_parse_options.return_": {"doc_hash": "e9d9f7eb460457121c4e646ce78eee0b4fa1c30b699d5ebb1273fa1c2f2a9ea9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgenc.py__usr_bin_env_python3__DEFAULT_TYPING_IMPORTS._": {"doc_hash": "6c5b9841c16038cf0ffe23c0a13e680b9932e623ba102a2eabc5a9e07b438b2e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgenc.py_generate_stub_for_c_module_generate_stub_for_c_module.with_open_target_w_as.for_line_in_output_.file_write_s_n_line_": {"doc_hash": "405ce3f6511dea823da618876a4b8283d28f3e277e3a1623b0a8e97f3740c1ea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgenc.py_generate_c_function_stub_generate_c_function_stub.if_inferred_.for_signature_in_inferred.output_append_def_funct": {"doc_hash": "f5196a85fd43f72f55b8f7230a8ebaeca8fe7ca8f742068d92f137c8fbd8006e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgenc.py_infer_method_sig_": {"doc_hash": "b34e1b5cb1973a88f8f9689b6b4665c913d415336ae074212607f07703e57419"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py__Tests_for_stubs___style.return._formatter_style_message_": {"doc_hash": "56e8332a6049ac8d70ec9e57e3d56028c7977edd96fb5879b2ede012c117708a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_Error_Error.is_positional_only_related.return._leading_double_underscor": {"doc_hash": "9e5f545b7efb080a33afb29cc5df1c5d55e3136d63553c4512edb10c38d51c1e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_Error.get_description_Error.get_description.return._join_output_": {"doc_hash": "12fa776e63e974139715c30ec8fc4a234f97ced165f68d2e9bbe1957560ed237"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_test_module_test_module.with_warnings_catch_warni.yield_from_verify_stub_r": {"doc_hash": "2e816c74a91ac7a410fea94ee91f0007c03ce59b5e64dc4e488b0edf1c236a6f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_verify_verify.yield_Error_object_path_": {"doc_hash": "d3d85d4d8a00c7c5ac89703b149980a9f8f5c608dfba725de20ef9887effc1ff"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_verify_mypyfile_verify_mypyfile.for_entry_in_sorted_to_ch.yield_from_verify_": {"doc_hash": "6f72ff955099d4a45f81f44b642ab2bdcb2dfe8a103d410d8a0e279ac2c5da2c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_verify_typeinfo_verify_typeinfo.for_entry_in_sorted_to_ch.yield_from_verify_": {"doc_hash": "0986d8f8a693203b3cb4ca6f39b3f9e6fe80a02e89a43ec45961a3083faead28"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py__verify_static_class_methods__verify_static_class_methods.None_6.yield_stub_is_a_staticme": {"doc_hash": "fdd423cb62025eb1e443184bb48314cfbe34bf3c6c9b88e1bdfbccd481586278"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py__verify_arg_name__verify_arg_name.yield_": {"doc_hash": "32b81bd1106fed71acf2d51004dfcde0089f628a748de98ba0f04e35f7dadf85"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_Signature_Signature.__str__.return.ret": {"doc_hash": "b69032676bfee1ac62be8dc16e9f1b7e7b57ff8abfb4fbafba49f9c9073e4ddf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_Signature.from_funcitem_Signature.from_funcitem.return.stub_sig": {"doc_hash": "31fd98839d721d3aa9d968252a9e08c9e1f026c106c03d7a019e0b735d529e8f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_Signature.from_inspect_signature_Signature.from_inspect_signature.return.runtime_sig": {"doc_hash": "76927f6bd55996dd21802644db8a45f7abb7d71ef401b570a064600cd343b897"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_Signature.from_overloadedfuncdef_Signature.from_overloadedfuncdef.get_type.with_mypy_state_strict_op.return.mypy_typeops_make_simplif": {"doc_hash": "52261d8666f9138f6ded3edc68aae9fa64101f3833672a5030fc670fe78306de"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_Signature.from_overloadedfuncdef.get_kind_Signature.from_overloadedfuncdef.get_kind.return.nodes_ARG_POS_if_is_pos_e": {"doc_hash": "8fda342f3c6c51637f07150fb55167c7d2b8d5830bda7d3d00042bb585caf176"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_Signature.from_overloadedfuncdef.sig_Signature.from_overloadedfuncdef.return.sig": {"doc_hash": "8c19c213e08dbd87c9997fc2af4809d7d6b9230f357d70492966e51d21df8274"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py__verify_signature__verify_signature._Check_unmatched_keyword": {"doc_hash": "5ce9fbb6132e988a3118069aecbea6020bd7740b751353d55919c39b90fe23b3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py__verify_signature.if_runtime_varkw_is_None___verify_signature.if_stub_varkw_is_not_None.yield_runtime_does_not_h": {"doc_hash": "9c07c97b3806b8a666adf1da424a793028c3744b8da24c86f87d8b57b2f32e00"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_verify_funcitem_verify_funcitem.for_message_in__verify_si.yield_Error_": {"doc_hash": "823a9b08d5fe9e2aeb39993f9f025024b147e71b3703fc8be4102ab59335f259"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_verify_none_verify_var.if_.if_should_error_.yield_Error_": {"doc_hash": "365ee29c79ca9d78680bf70cda899d5062afdcafdce3562f7316c99e273076f4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_verify_overloadedfuncdef_verify_overloadedfuncdef.for_message_in__verify_si.yield_Error_": {"doc_hash": "fc0d07dec38af0e25799456bff94972b46feb5356beac07b7a86119469933482"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_verify_typevarexpr__verify_property.yield_is_inconsistent_c": {"doc_hash": "3e9cde739282826d1b3d028d9f0ef4a4bba5b3b486df677b0b10db3808ba7e53"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py__resolve_funcitem_from_decorator__resolve_funcitem_from_decorator.return.func": {"doc_hash": "40c353068b41d7df7c7162d0a07e0340aa08046df87ee7aa68ac5be63c8ddb28"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_verify_decorator_verify_decorator.if_func_is_not_None_.yield_from_verify_func_r": {"doc_hash": "02e7a8ff7f7d5a4fb45f7f58bd5ac798870728ad2ade3fe17ef31b4e12f2d783"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_verify_typealias_is_dunder.return.name_startswith____and": {"doc_hash": "7c08b54224ac0dcc31250abba8c000e3e6df75b1fb92edf5c1086124b80da35a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_is_subtype_helper_is_subtype_helper.with_mypy_state_strict_op.return.mypy_subtypes_is_subtype_": {"doc_hash": "7ca68f161955717a6749672ed02bdeb5973f65e2df17d43dc1e14557845ad0e0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_get_stub_get_allowlist_entries.with_open_allowlist_file_.for_line_in_f_readlines_.if_entry_.yield_entry": {"doc_hash": "0d7b18ef010015daa76d24063b9083c27e3241e9c65e04fa2e7a2a13574cd798"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_test_stubs_test_stubs.return.exit_code": {"doc_hash": "0e2a5609a1b651fe590aa529356b1c5ceea2819adb9cf14d9c15993281ecd57a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_parse_options_": {"doc_hash": "686f567a3b63febe1fda5919f02b13e77f6d41c2a69a9ecc1615b61e7448fd96"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubutil.py__Utilities_for_mypy_stu_CantImport.__init__.self.message.message": {"doc_hash": "712d2080e59edb60d0cf00017ffe893ea3bf744600dfe2b762bee32231300cd2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubutil.py_default_py2_interpreter_default_py2_interpreter.raise_SystemExit_Can_t_f": {"doc_hash": "f6a51d9721bca0bb38854a9584bf5b40c7e42ef44a39abac9fd59be32cc881ae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubutil.py_walk_packages_walk_packages.for_package_name_in_packa.if_prop_is_c_module_.else_.for_submodule_in_prop_sub.yield_submodule": {"doc_hash": "fdebd9c8966e0999d7dedb51889ee5dbdb439c185e81998d4bc9b0f547a76ef5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubutil.py_find_module_path_and_all_py2_find_module_path_and_all_py2.return.module_path_module_all": {"doc_hash": "db8e7364e19fa9be245fc7bdd4b146510f44526525fcb5642204a8c773850870"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubutil.py_find_module_path_using_py2_sys_path_find_module_path_using_sys_path.return.None": {"doc_hash": "589b1f2033166da4ef9bc8aa7edc44107ad3dbd1f42053de77da346e8681f60e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubutil.py_find_module_path_and_all_py3_find_module_path_and_all_py3.return.mod_file_mod_all": {"doc_hash": "3545a9e030794cf6a0528c23946ab5206e36935d48415257bebd2646324044d3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubutil.py_generate_guarded_generate_guarded.try_.else_.if_verbose_.print_Created_s_targ": {"doc_hash": "d6c5251610ad9ee196730c1bf74516c0366cb881ca9be000d28e3de0d74b3cbe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubutil.py_PY2_MODULES_remove_misplaced_type_comments_10._": {"doc_hash": "225c609853d6139010f17b89ff502b1ec82e562a316aecdf9e4b6141a375c03c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubutil.py_remove_misplaced_type_comments_11_": {"doc_hash": "4a66106cd8b2832d3b1405ed89a3ef1e490bb2f087232ea7af3f03b6542a15e6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_from_contextlib_import_co_ignore_type_parameter.return.True": {"doc_hash": "bd96e912d2f602da2478a1b6f5dbc02f935015923b92d65d1d7e83b0123880c5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_is_subtype_is_subtype.return._is_subtype_left_right_": {"doc_hash": "860a92678307a3c3f1d996d40cb2cece53c09e9ec7470f9375dda1c54393591c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py__is_subtype__is_subtype.return.left_accept_SubtypeVisito": {"doc_hash": "da0762acf8c747f43c26ceb69ed61ffe890b5520f5c51fd56a7dc91aafddf327"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_is_subtype_ignoring_tvars_is_equivalent.return._": {"doc_hash": "caf9664549fd4ed8ff1fed070df186af674906990d48c97c2cdcec1d395a622f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_SubtypeVisitor_SubtypeVisitor.visit_any.return.True": {"doc_hash": "b0c4fa8ca0a6febbcfc1637bc7dc3fb324b1c4b126961e74138a82a6c725e8f4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_SubtypeVisitor.visit_none_type_SubtypeVisitor.visit_deleted_type.return.True": {"doc_hash": "748cb894d9c0bac33b01a85d2eab2daace995376c3f316d045fe2932dcf0de3e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_SubtypeVisitor.visit_instance_SubtypeVisitor.visit_instance.if_isinstance_right_Call.else_.return.False": {"doc_hash": "0a90e77addef8d81117936d28ecd85c94458a1186eb4591ca4879013fa547a9f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_SubtypeVisitor.visit_type_var_SubtypeVisitor.visit_callable_type.if_isinstance_right_Call.else_.return.False": {"doc_hash": "0798ce2d618aa7206164c15c8b533fd92bf7d512d098fd397d8a2f64396c78d9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_SubtypeVisitor.visit_tuple_type_SubtypeVisitor.visit_tuple_type.if_isinstance_right_Inst.else_.return.False": {"doc_hash": "d08fa997338107626a7460a2bb84c61f37a863e69b878626d2541574f9dd8254"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_SubtypeVisitor.visit_typeddict_type_SubtypeVisitor.visit_literal_type.if_isinstance_self_right_.else_.return.self__is_subtype_left_fal": {"doc_hash": "45ba636fdcd150ad968877a62731fe61bd99a80ffeea3e40c5f169fd923ac6bf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_SubtypeVisitor.visit_overloaded_SubtypeVisitor.visit_overloaded.if_isinstance_right_Inst.else_.return.False": {"doc_hash": "e11bf63abcb45c9faf312d6254734a13dc2a69160c6dd786352cc62151838c91"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_SubtypeVisitor.visit_union_type_pop_on_exit.stack_pop_": {"doc_hash": "aa8ae4efddcf6ef8ee5f2d23e225fbc75706774f6e6d65d33fe091ba44df0cb5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_find_member_find_member.return.None": {"doc_hash": "8c9470c75ee29bcb5d236317d854353cb001306382eb1a1accd260a4b48f0895"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_get_member_flags_get_member_flags.return.set_": {"doc_hash": "bda4f25023520dfe549f42573043eebe7fc30cb3f47750502b90d9b8ddfb0693"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_find_node_type_find_node_type.return.typ": {"doc_hash": "c753644cd4999395e8ffdf85478cc9afc678f9d0ec26ea5115dbbfba5c7653bc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_non_method_protocol_members_non_method_protocol_members.return.result": {"doc_hash": "3635a0956cd05e26b089d15fc5bbb52ff812fb065647dea0ecb3be0d4b85bc18"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_is_callable_compatible_is_callable_compatible._Is_the_left_compatible": {"doc_hash": "a60db884885320f8b599f34f3bc8c891cb2a3d60f5ac10e151d276cdff637dfb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_is_callable_compatible.if_is_compat_return_is_No_is_callable_compatible._": {"doc_hash": "5c0d6297527bb802a7ba794d38150f9ad217aea1756f478035f851fc7fdd0a9d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_is_callable_compatible._Furthermore__is_callable_compatible._Phase_2_Left_must_not_": {"doc_hash": "45eaeb2814c34e9791c3d9cfe7929c5fcac1ac0dbad723204b8ad6a6fc2082f3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_is_callable_compatible._Every_require_is_callable_compatible.return.True": {"doc_hash": "5f533f6ae1d82a02eac6aca83f7d681c7d64d897290396d1e5c3f12287ec31ff"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_are_args_compatible_are_args_compatible.is_different.return.left_item_right_item": {"doc_hash": "3415879cea6acacbd216db32600116cfa7a56a29b373bb46efaf0bfd2de8d016"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_are_args_compatible._If_right_has_a_specific_flip_compat_check.return.new_is_compat": {"doc_hash": "5029a22e3693686b97e95a27da5c5bd1e8f0a36faf2318d2fb147ccf991c5bb0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_unify_generic_callable_unify_generic_callable.return.applied": {"doc_hash": "6684fe9c86d07b299395d76f3bfeb01103ad795ec2643a2bca581582f933426f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_restrict_subtype_away_restrict_subtype_away.if_isinstance_t_UnionTyp.else_.return.t": {"doc_hash": "681705ca4c12ae2f13be402224a5c0e14a4d7158d55726b1501c4fd1e09300d8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_covers_at_runtime_covers_at_runtime.return.False": {"doc_hash": "b7c976f016c9f303622677f8c9d488054197a193f626633fb6738fe37a8a0ee5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_is_proper_subtype_is_proper_subtype.return._is_proper_subtype_left_": {"doc_hash": "6b67e745334ce536c029753d2436eb1aeb4ccb2e089fce61cd93602ab86ee51f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py__is_proper_subtype__is_proper_subtype.return.left_accept_ProperSubtype": {"doc_hash": "3f5c213cbd7adb047f0ee3e6a9587b0befa5c1c6536a9bcb5feb179e3504d8ad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_ProperSubtypeVisitor_ProperSubtypeVisitor.visit_deleted_type.return.True": {"doc_hash": "7c1f4771ed17d0738dfef85ff7c5642ca0fcc3e245481ab6df24a90141758c29"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_ProperSubtypeVisitor.visit_instance_ProperSubtypeVisitor.visit_instance.return.False": {"doc_hash": "329386eb3bfa1b439dc4bfd5994b6be758e77888d14eb5c285bc359104319a33"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_ProperSubtypeVisitor.visit_type_var_ProperSubtypeVisitor.visit_callable_type.return.False": {"doc_hash": "66bf043d9705a30fe6ffeb608631a269270c39a2f7ca1fec8ce48a28877faed4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_ProperSubtypeVisitor.visit_tuple_type_ProperSubtypeVisitor.visit_tuple_type.return.False": {"doc_hash": "afad6a6af90ff1bbfb384f1c4ea1761497f9e7faa4b70bda9d4a14403318559b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_ProperSubtypeVisitor.visit_typeddict_type_ProperSubtypeVisitor.visit_partial_type.return.False": {"doc_hash": "13a6bdaf3796b26492cb3a56c69af3f2fd3c9263991501de4f2290c59f28a908"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_ProperSubtypeVisitor.visit_type_type_ProperSubtypeVisitor.visit_type_alias_type.assert_False_This_shoul": {"doc_hash": "15e038b5ccfa97950db5891b418291e328677cfc75a09e62e94af45e788021a8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_is_more_precise_": {"doc_hash": "ce73729d519b2950fd55a6d5f0021123e69babcaa6dc2ffdd713331c06232d7b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py__Mechanisms_for_inferri_Callsite.NamedTuple_": {"doc_hash": "d9f5ae72315eb7c3010656905539839985748eb00f74dcb667ce0368504d133e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionPlugin_SuggestionPlugin.log.return.ctx_default_return_type": {"doc_hash": "283282e80eea777078071fc2d7e085831832304512827401f6dddd0a7cd8a9d4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py__NOTE_We_could_make_thi_get_return_types.return.finder_return_types": {"doc_hash": "6f9035868b56c1f00151c4b05bdab5e267cdf948398f0095f94d85e578de293f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_ArgUseFinder_ArgUseFinder.visit_call_expr.for_i_args_in_enumerate_.for_arg_idx_in_args_.if_isinstance_arg_RefExp.self_arg_types_arg_node_": {"doc_hash": "efe5b5f3d33fe583ea4032dbbd14271aab25749c6ba4dce0eb6dab5887d32c14"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_get_arg_uses_get_arg_uses.return._finder_arg_types_arg_var": {"doc_hash": "44f6744915e25b02fce73ff5c30e3461e4456c866c8b96df48b57c0b622d1de5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionFailure_is_implicit_any.return.isinstance_typ_AnyType_": {"doc_hash": "fa984a172cf8372be6cc151d4b0691a42f6ae988b4bbfe19ec86bbd7a087c7e5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine_SuggestionEngine.suggest.if_self_give_json_.else_.return.self_format_signature_sug": {"doc_hash": "0ef8b99a2aff1dd4f9043c4719742b102afb5f9558cc7ced1d025c854b015e50"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.suggest_callsites_SuggestionEngine.suggest_callsites.return._n_join_dedup_": {"doc_hash": "77f24112b1f86a28b02aa838d94f3c86a6e2f2af949e789b7c3d48c9a7dbb0f5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.restore_after_SuggestionEngine.with_export_types.try_.finally_.self.manager.options.export_types.old": {"doc_hash": "50716301bb6d189f9d1bca9e0750832b24a6f9cfc5f27d945c54d26d483c8949"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.get_trivial_type_SuggestionEngine.get_starting_type.if_isinstance_fdef_type_.else_.return.self_get_trivial_type_fde": {"doc_hash": "f58bd9c15dee1481a9abbcba2e146927d902634416670c7fbcab26870e33bcad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.get_args_SuggestionEngine.get_args.return.types": {"doc_hash": "abdc07153ae813481ea762cd8d7473fe693ef016a23bba4e5c033ae922bb8d7a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.get_default_arg_types_SuggestionEngine.add_adjustments.return.dedup_typs_tp_accept_t": {"doc_hash": "7328a146d436c2bb30d52528eeb733a2065b233cc0226557a24865be26a7a6ea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.get_guesses_SuggestionEngine.get_guesses.return._refine_callable_base_ba": {"doc_hash": "e14fad612782e956bbd75727b68cea63725d151fff7b62edb5c88f93c66a0065"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.get_callsites_SuggestionEngine.filter_options.return._": {"doc_hash": "5be447de21363c61e46f83a8ab81bf1eb3c23384b94dc00149cfa21d2447d975"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.find_best_SuggestionEngine.find_best.return.best_count_errors_errors": {"doc_hash": "99a617c30fcbd6161eefea1c439789c5bb526cb63976677d72f8815de1656b07"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.get_guesses_from_parent_SuggestionEngine.get_guesses_from_parent.return._": {"doc_hash": "536b8831b99aa0cf8eb6878257f3a5f895d37833c7043c7c4761ecbe668e2fd4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.get_suggestion_SuggestionEngine.get_suggestion.return.self_pyannotate_signature": {"doc_hash": "5e33c8709f56647036052cb3c0c63389395b072b830fdf8466a283b192014c8a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.format_args_SuggestionEngine.format_args.return._s_join_args_": {"doc_hash": "c4c944ff8d1cd730121753e018cbc973a899f4a5a897d9eefce04d34fa7e938d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.find_node_SuggestionEngine.find_node.return.modname_tail_node": {"doc_hash": "00914c56a92146794bdb75222d1fa7fdc8245c67f86c2500e359b532d9d78a24"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.find_node_by_module_and_name_SuggestionEngine.find_node_by_module_and_name.return.names_funcname_node": {"doc_hash": "a935034ab882eb026b3501b8002bdde5c1e2e8cd553173cebf2ca8e930ee17ed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.find_node_by_file_and_line_SuggestionEngine.find_node_by_file_and_line.return.modname_node": {"doc_hash": "4059ddd1596c97bbb46d5edde0b735d59be2e1047e57cad3b5a7cdf3d29baf4e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.extract_from_decorator_SuggestionEngine.extract_from_decorator.return.node_func": {"doc_hash": "6120c57035e537b3bc22fc4f76e7cc6fc8bc1a3726b78497e37a87e6972378c4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.try_type_SuggestionEngine.try_type.try_.finally_.func.unanalyzed_type.old": {"doc_hash": "70f1ddea15d3f216766c6390b2b3289afa5e2f1dbc369ee03e5843f28f1c73ad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.reload_SuggestionEngine.builtin_type.return.self_manager_semantic_ana": {"doc_hash": "3d9ca1f2eb6c7e10bed6cefce2efbc0d2c1161c6128084394791c9dbffa58328"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.json_suggestion_SuggestionEngine.json_suggestion.return.json_dumps_obj_sort_ke": {"doc_hash": "710b3b7686036fa81a4ce268756a1b5f49fb33c82b30050386888c705f4db766"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.pyannotate_signature_SuggestionEngine.format_type.return.typ_accept_TypeFormatter_": {"doc_hash": "2732e7bb0e5411c5be677c500a316c867b6bb790fd54d3027dee1c4ec00880af"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.score_type_SuggestionEngine.score_callable.return._sum_self_score_type_x_": {"doc_hash": "e5e0e86c18177b035b315c5a5b87367faa674b287f6951a5b2fcb971ab921420"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_any_score_type_any_score_type.return.1_0": {"doc_hash": "81a48f0c8d04661ac99bbd059c4f2dfefcfafebd68b80d167b5f4fe3a81c5c77"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_any_score_callable_is_tricky_callable.return.t_is_ellipsis_args_or_any": {"doc_hash": "cd9060b728f81989d12a37cb2edfaeccce1a4fc612837c831707df79cbf5e20f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_TypeFormatter_TypeFormatter.visit_instance.if_mod_obj_builtins_.else_.return.mod_delim_obj": {"doc_hash": "5c0bd2371f9a78413ab64d83155d43690097308596a7b365cbcb31d0bee39c44"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_TypeFormatter.visit_tuple_type_TypeFormatter.visit_union_type.if_len_t_items_2_and_.else_.return.super_visit_union_type_": {"doc_hash": "99141e7ff40a240c0b06fa62aeeebb7f9e697fba5e7e7776969f25b5dfac6865"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_TypeFormatter.visit_callable_type_TypeFormatter.visit_callable_type.return._Callable_format": {"doc_hash": "423052e2a99f9cf1c83824bb26cb2e8134b418680edda5e02cd7dd8e55a71c29"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_StrToText_StrToText.visit_instance.if_t_type_fullname_bu.else_.return.super_visit_instance_t_": {"doc_hash": "0fa90f239b00bbc3b46e71aa5aa651768fc44f886ad16226b014953e9d6fb6a0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_TType_count_errors.return.len_x_for_x_in_msgs_if_": {"doc_hash": "fb15844e5558eadc9aeaff3e6d8f137249832d8e1c0b74ce4942e2d1d9c9cd76"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_refine_type_refine_type.return.t": {"doc_hash": "c0ffe41a7284608495739c174240896890770adcb33e9d2fd33096869648710e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_refine_union_refine_union.with_strict_optional_set_.return.make_simplified_union_new": {"doc_hash": "e0ba7cc281e40925bd945aabd3cfc6996d71b86608a1867dbbf6df442b866c6c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_refine_callable_": {"doc_hash": "2c666ebfe2abee314d014a1aa5e8d0b5c9f75a733eb24c77845d20587db14739"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/config.py_os.path_": {"doc_hash": "4e4864d40e0e1afdefb6b18c2c51b9f4dda46e3d0629fe88ecba0ccabf2a579f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py__Utilities_for_processi_FileOperation.Union_UpdateFile_DeleteF": {"doc_hash": "24fa32d91f6b94c50726ca86290367d78adb3b11fa154a7c37d1634b51d0c608"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_parse_test_case_parse_test_case.item.first_item.test_items_0_": {"doc_hash": "e7c42be11a13b16ab2589b3bc84f052337d62548b2abb8d56335de892a1c278f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_parse_test_case.for_item_in_test_items_1__parse_test_case.for_item_in_test_items_1_.if_item_id_file_or_i.else_.raise_ValueError_": {"doc_hash": "fdbb5893857894969c69f0a032214874aad69173430a7e49bb7797d11d0a4984"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_parse_test_case.if_out_section_missing__parse_test_case.case.expected_fine_grained_targets.targets": {"doc_hash": "c300fe4ddea786b410317dd2497f76d2854106bf00c753c8dbc0e4b9cdaa3327"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_DataDrivenTestCase_DataDrivenTestCase.__init__._type_Optional_tempfile": {"doc_hash": "104bd388482ac11f22fdf310e42cf9ab71c39278a87c3af57c08e428eb44a857"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_DataDrivenTestCase.runtest_DataDrivenTestCase.runtest.try_.except_Exception_.raise": {"doc_hash": "0663fea5ff0b59c9afbbe4936b965d936e2285ce825b181d8537561e3a1321cb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_DataDrivenTestCase.setup_DataDrivenTestCase.reportinfo.return.self_file_self_line_sel": {"doc_hash": "8e3c68888bf68fe93e2d027fbdb47c49a6322911fb2e76bf5ae9b8e2c7357d40"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_DataDrivenTestCase.repr_failure_DataDrivenTestCase.repr_failure.return._data_n_format": {"doc_hash": "3a1abe2e2dce6f934f22e53bae47e807547c22aeba661440301acadb1c11d5ce"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_DataDrivenTestCase.find_steps_DataDrivenTestCase.find_steps.return._steps_get_num_for_n": {"doc_hash": "ba68c97ff636c725101e46b2d1efca9b57c964fbc2fb809ca74eb95f1f469661"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_module_from_path_TestItem.__init__.self.line.line": {"doc_hash": "a15f2acc42a14cbe1b9188e6e7b28ddae9d7533cffb3ed71533e3eb4fd934cb9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_parse_test_data_parse_test_data.return.ret": {"doc_hash": "705968126297ca0f3ab140e6158e02b97003ea7f6b839635a86418caf4c6fc4f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_strip_list_expand_variables.return.s_replace_ROOT_root_": {"doc_hash": "6bf05cd176df089909c7e5a3638d69ca6c91666aeb4185ef8faef22d97d71a15"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_expand_errors_expand_errors.for_i_in_range_len_input_.for_possible_err_comment_.if_m_.if_col_is_None_.else_.output_append_": {"doc_hash": "a0678ca9684a492c4abfae8014cdf947d2a50799474cc2ab0b1c782b34996381"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_fix_win_path_fix_win_path.if_not_m_.else_.return._format_filename": {"doc_hash": "7ba78594be93f7a70be435d8080f48fb52f79c30916e103feb82ac33a4c61987"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_fix_cobertura_filename_fix_cobertura_filename.return._format_line_m_s": {"doc_hash": "91dfe6293a86735b60f6548a8c9471804fc2053e922f294379d9d1ca5219dd26"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py___pytest_addoption.group_addoption_mypyc_": {"doc_hash": "a28282470c23b6072f029fae184f0e15c21757d0cf43ddb5bf2bb2b08c9c6e4c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_None_10_pytest_pycollect_makeitem.return.None": {"doc_hash": "01f912f24ee8bd504af53bc335514b055876c010a074cabf0bbae4272d829304"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_split_test_cases_split_test_cases.for_i_in_range_1_len_cas.line_no_data_count_n": {"doc_hash": "7dd4ea384aed4be2b5b73e172b85b66455069494d040268bb9a29c49601541de"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_DataSuiteCollector_add_test_name_suffix.if_m_.else_.return.name_suffix": {"doc_hash": "5732a1a095744664b1d416896bd7942b37d2144b9c1aec0621bf1b01ad88cd56"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_is_incremental_": {"doc_hash": "03e5bf2ba9ffdd4d2b6d6a23a0556f0de8c6dcbbecc8a4fb1d962189371156ac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/helpers.py_os_run_mypy.if_status_0_.pytest_fail_msg_Sample_c": {"doc_hash": "e3370374b50fada619b3ed24352151b7fff809070e59d467d5024fb55582d8a8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/helpers.py_assert_string_arrays_equal_assert_string_arrays_equal.if_actual_expected_.raise_AssertionError_msg_": {"doc_hash": "b51eea236b052cb6685d51d7e44eeec4428c428c035ecf06e2c362cb34a84d73"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/helpers.py_assert_module_equivalence_assert_target_equivalence.assert_string_arrays_equa": {"doc_hash": "88ef6f379254277af08b5c8e1bcdbe86e94c6b98e448132736e141313138b771"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/helpers.py_update_testcase_output_update_testcase_output.None_3.print_data_file_f_": {"doc_hash": "590d93b7b880abd2d628df5aabbeee9a29bab870ce4bac744d5803d045f3ec65"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/helpers.py_show_align_message_show_align_message.sys_stderr_write_n_": {"doc_hash": "630b11dbdcb80e9011b07de4b558557adb98ec21141a1ef3d00dabab08f53f72"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/helpers.py_clean_up_clean_up.return.res": {"doc_hash": "c4b5020f40affde085f024a2a54b25373fc3024b31732a1547aaf3e90de1c73e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/helpers.py_local_sys_path_set_normalize_error_messages.return.a": {"doc_hash": "d43402f838be321ec40044cb2d760c0be707eb0c624730d823dfed18b7d58ce8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/helpers.py_retry_on_error_retry_on_error.while_True_.try_.except_OSError_.time_sleep_wait_time_": {"doc_hash": "3a707ac9e3c932e98f686c08f149cf585b04499b584a9e88e9cdad0440a4f4cf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/helpers.py__TODO_assert_true_and_a_assert_type.if_type_value_typ_.raise_AssertionError_Inv": {"doc_hash": "fbe0aec0177bf5441bf754a259b1274f812a8d57123b2dad28dc16a1088d846f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/helpers.py_parse_options_parse_options.return.options": {"doc_hash": "d84c7c1f2bf01d939b5c16fab2d7a4ac1e9acec9a5b041db3360b96f6a626fe6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/helpers.py_split_lines_copy_and_fudge_mtime.if_new_time_.os_utime_target_path_tim": {"doc_hash": "c8fc41fed70417340a7f33d24fc41d101cc1c7e0b650a2c9ed1300d0fa6c55cd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/helpers.py_check_test_output_files_check_test_output_files.for_path_expected_conten.assert_string_arrays_equa": {"doc_hash": "72e6ee5d809c98c58309b43e0df8e13481e3f4dca77901e9851482712917c9bd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/helpers.py_normalize_file_output_": {"doc_hash": "8a6559d1668947b7932729d7b6d6707b5712d58e119d965d85b9f12112ff486e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testapi.py_from_io_import_StringIO_": {"doc_hash": "91670905600b3712c06c194aa5abe63657ba0357a8edde833da9bd534e389b85"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testargs.py__Ensure_the_argparse_pa_": {"doc_hash": "2ea14a069ee0c017cd70d2f49f7ba433ac05788e7cb21664b07091ec69479a2f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testcheck.py_TypeCheckSuite.verify_cache_TypeCheckSuite.verify_cache.with_open_cachedir_tag_a.assert_f_read_startswit": {"doc_hash": "15378805a44156ae66e788f87a7c5db7e1dcd224d85b0d58433bdf9ef525b44a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testcheck.py_TypeCheckSuite.find_error_message_paths_TypeCheckSuite.find_missing_cache_files.return.set_missing_values_": {"doc_hash": "cd95904a0ae9107370f1b361a11a774a060f288da374b3a5fdcd02776fb3826f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testcheck.py_TypeCheckSuite.parse_module_": {"doc_hash": "f20082c7c5ccc5985c4f431b77e0802800dd63379362c93c16a77486f75f227e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testcmdline.py__Test_cases_for_the_com_PythonCmdlineSuite.run_case.for_step_in_1_sorted_.test_python_cmdline_testc": {"doc_hash": "28366f53353dce7b19b2e07022e51359715d72e1ab483323adca7801c0662d89"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testcmdline.py_test_python_cmdline_test_python_cmdline.if_testcase_output_files_.else_.assert_string_arrays_equa": {"doc_hash": "3b08437997a33a68b9a5c578a27d573929986e873e9d536d1d08852c948c8abc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testcmdline.py_parse_args_": {"doc_hash": "e9ec0ed37797bbd2f0011e7dbde5f4ca9e49ab95de848610eda23b4e2df03a5c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testdaemon.py__End_to_end_test_cases__DaemonSuite.run_case.try_.finally_.run_cmd_dmypy_kill_": {"doc_hash": "f6c6f6ad7ba6c083a5bbdaf818694ef14b15c7d9c79ff7cd2d0d70575e6186f1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testdaemon.py_test_daemon_test_daemon.for_i_step_in_enumerate_.assert_string_arrays_equa": {"doc_hash": "58facba3731ae664bce10df7f0bc17f71b53d4b3ed5e297fefad3c568c90209e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testdaemon.py_parse_script_parse_script.return.steps": {"doc_hash": "dfd0d91adf193f83f1df985f60dfa8c1e60bded8c7048ba358e1eb064c6462b4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testdeps.py__Test_cases_for_generat_dumped_modules.___main___pkg_pkg_": {"doc_hash": "2cce18145f681685bbbcb4c3b1de93c4973a5061ad07548ebfdf2f229ed0512b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testdeps.py_GetDependenciesSuite_GetDependenciesSuite.run_case.assert_string_arrays_equa": {"doc_hash": "6925705d07c5c31bf9e170b29cee12b9c5c1b0f7775596976bb20ef61a14b77d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testdeps.py_GetDependenciesSuite.build_": {"doc_hash": "29a03264eba576785b54ec9a1afdd0e2f6f2dd17dabcb234eccf2102d6c9642a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testdiff.py__Test_cases_for_AST_dif_from_mypy_test_helpers_im": {"doc_hash": "f4d6552600e62f17beee3b7e1af8fff9f195c9ed20ef4ab5a147a968260ffdea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testdiff.py_ASTDiffSuite_ASTDiffSuite.run_case.assert_string_arrays_equa": {"doc_hash": "e8851854d0837d131339ffabaef43008fe61cd6c3665bcfc573cd7478cf20af3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testdiff.py_ASTDiffSuite.build_": {"doc_hash": "08f9c62522acc674efb48d61177e83672cd54bf77cd96c89072e4519cb2b25ae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testerrorstream.py__Tests_for_mypy_increme_ErrorStreamSuite.run_case.test_error_stream_testcas": {"doc_hash": "fc71daa9a3ac5143a88c69e5548908763224229a2e93d75fdd290a05f8595bb0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testerrorstream.py_test_error_stream_": {"doc_hash": "5d37cfacd3b50c9edd36b91a8164ad5684977dee52fa9bf8c4831517539b0feb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testfinegrained.py__Test_cases_for_fine_gr_CHECK_CONSISTENCY.False": {"doc_hash": "f63c21476ba7162903c73b818c0d2160c0d34f489f06ef0f7b069b556e71d90b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testfinegrained.py_FineGrainedSuite_FineGrainedSuite.should_skip.return.False": {"doc_hash": "c4a7cda2d00336d79cf2925c1a6050405d5032ebc79004e6a617b388522b5ea3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testfinegrained.py_FineGrainedSuite.run_case_FineGrainedSuite.run_case.if_testcase_triggered_.assert_string_arrays_equa": {"doc_hash": "e5fd61fc0f996a99f1164044bd1e0a4c2a752679f68bc5ac58524b8581f48659"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testfinegrained.py_FineGrainedSuite.get_options_FineGrainedSuite.get_options.return.options": {"doc_hash": "535b5d7b07fabf6d1ac9327716e15cded5087c9114407bf2dcf56f5cededd28f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testfinegrained.py_FineGrainedSuite.run_check_FineGrainedSuite.get_build_steps.return.1": {"doc_hash": "0288dc0be4d9afb72f9f13e07c774c1545751899d4b23de08ac409c8d7c6693f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testfinegrained.py_FineGrainedSuite.perform_step_FineGrainedSuite.perform_step.return.a_triggered": {"doc_hash": "7fed0e14ff6bc496501f4951c262f065735a527f6e60177f95f66da120675552"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testfinegrained.py_FineGrainedSuite.parse_sources_FineGrainedSuite.parse_sources.if_m_.else_.return._base_create_source_li": {"doc_hash": "2d282254ea93ca7361640e3dca817656dd1bc67ff31c1b39cd90624804f58ae1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testfinegrained.py_FineGrainedSuite.maybe_suggest_FineGrainedSuite.maybe_suggest.return.normalize_messages_output": {"doc_hash": "859b3fb245744c1ca577fc96609d31f22e37fa399180dbc17dffda92e6b3d8dd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testfinegrained.py_FineGrainedSuite.get_suggest_": {"doc_hash": "0773f9c35060d2c2b1f434bf3eedf2ffe0dcf6ea49d70660dd459e35d73fd580"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testfinegrainedcache.py__Tests_for_fine_grained_": {"doc_hash": "43c803d97d171db183975b3c2b555beda7312e4498f056e499fc83cf6295c8a5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testformatter.py_from_unittest_import_Test_FancyErrorFormattingTestCases.test_trim_source.None_8": {"doc_hash": "467c4dece1695390460df3b4f571d18e130b80e5788adf9e545ba8c02eab9ade"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testformatter.py_FancyErrorFormattingTestCases.test_split_words_": {"doc_hash": "4079b82ce636cc22bd99f67c7fb2ff3e55261501d2de1640b533845d9b04b897"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testgraph.py__Test_cases_for_graph_p_from_mypy_fscache_import_": {"doc_hash": "84d1b325636c13815e2203214782ea019447f857d293883559020477fb45ea88"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testgraph.py_GraphSuite_GraphSuite.test_topsort.assert_equal_res_d_": {"doc_hash": "4fd8cbde768ef39322d32dcd62d6636327804cf0e35fae7a16a1d6d7058a6706"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testgraph.py_GraphSuite.test_scc_GraphSuite.test_scc.assert_equal_sccs_": {"doc_hash": "cda209a8536a84977cfebce164d9afc2bc96d52758bf61331115216c9fe0586d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testgraph.py_GraphSuite._make_manager_GraphSuite._make_manager.return.manager": {"doc_hash": "aca01f1601ddf253bb66e160343b2c0b6d85133cb85a9fe205912f09baa69480"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testgraph.py_GraphSuite.test_sorted_components_GraphSuite.test_sorted_components.assert_equal_res_frozen": {"doc_hash": "df376367478e0e5950b62ace6ba0fb61d4ca03d641cd1a3967a4ed10ebf9f7eb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testgraph.py_GraphSuite.test_order_ascc_": {"doc_hash": "9cc28703678f844d27dc68524818fee5d0bae87244359f8441263675a702c24b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py__Test_cases_for_type_in_from_mypy_test_typefixtur": {"doc_hash": "21d9f12b3e11779b54ffd5827cfe5c7207acc1162dfe45a969ce7976c9c49759"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py_MapActualsToFormalsSuite_MapActualsToFormalsSuite.test_too_many_caller_args.None_2": {"doc_hash": "3f049a258bd2c0b5f94d088f27059673d79742e319d9d35c57cab7eee50c6a3b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py_MapActualsToFormalsSuite.test_tuple_star_MapActualsToFormalsSuite.test_tuple_star.None_2": {"doc_hash": "ac58f7621334d261d44b5ef914e099ef007b2e198b220bc521b68f5da5e97d97"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py_MapActualsToFormalsSuite.tuple_MapActualsToFormalsSuite.test_varargs_and_bare_asterisk.None_1": {"doc_hash": "6775c7e0fd1e6a1a862d991c4c87bfe55ec537eb8d9b4850694b6aea886e085c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py_MapActualsToFormalsSuite.test_keyword_varargs_MapActualsToFormalsSuite.test_keyword_varargs.None_3": {"doc_hash": "86f3c84eb9c6e61faa96fe0c1c62b44bf1aaf6eb0fcaf815787066ce9165446a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py_MapActualsToFormalsSuite.test_both_kinds_of_varargs_MapActualsToFormalsSuite.test_special_cases.None_3": {"doc_hash": "85989619a87fe5ed3c706dcc082d5ae9b29ea532a19abe8956b33829a395f1c7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py_MapActualsToFormalsSuite.assert_map_MapActualsToFormalsSuite.assert_vararg_map.assert_equal_result_expe": {"doc_hash": "f14f2861f3e43e5fd256ef894f2de3a7f4674cfa6f7e15e5306b2b14742e220a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py_expand_caller_kinds_expand_callee_kinds.return.kinds_names": {"doc_hash": "0661a3643f769a50a2b0aae6bcb749c825dd111a2d7a30608631778d6a2d1c1f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py_OperandDisjointDictSuite_OperandDisjointDictSuite.test_independent_maps.self_assertEqual_d_items_": {"doc_hash": "5983e5af18d1a9bf0f3c5b172afe6ab1620cd33c5fd68bdee17278096112b312"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py_OperandDisjointDictSuite.test_partial_merging_OperandDisjointDictSuite.test_partial_merging.self_assertEqual_d_items_": {"doc_hash": "ad7ee6f87cd2bd0be8dcb01f904bc16378c14e09247ab7e3415b5a7eca5a42ec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py_OperandDisjointDictSuite.test_full_merging_OperandDisjointDictSuite.test_full_merging.self_assertEqual_d_items_": {"doc_hash": "3491850124ab6bdbccda3058e5d869230520a1361a1e7cc6ff273d13ff67427e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py_OperandDisjointDictSuite.test_merge_with_multiple_overlaps_OperandDisjointDictSuite.test_merge_with_multiple_overlaps.self_assertEqual_d_items_": {"doc_hash": "27c01dca976ad9ffa6d7528d77318130234d304a63802b56550e94b859835cb5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py_OperandComparisonGroupingSuite_OperandComparisonGroupingSuite.test_basic_cases.for_assignable_in_none_a.None_3": {"doc_hash": "49ff9b96c9a44f4de7b8f45dbd656ea691862a2ad48f793a2e8fadf37931ddc8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py_OperandComparisonGroupingSuite.test_multiple_groups_OperandComparisonGroupingSuite.test_multiple_groups.None_3": {"doc_hash": "4fcd418786f8d0883864c43f6508028a5c25e660134987735375098f27a51a88"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py_OperandComparisonGroupingSuite.test_multiple_groups_coalescing_OperandComparisonGroupingSuite.test_multiple_groups_coalescing.None_3": {"doc_hash": "ac1c554f3039d3081d77903a312bde1006744860e634f7854edfb0e0431ef71f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py_OperandComparisonGroupingSuite.test_multiple_groups_different_operators_OperandComparisonGroupingSuite.test_multiple_groups_different_operators.self_assertEqual_": {"doc_hash": "dc8bea60cc4524c381473296ac1e4f17d4d23457fcc1bf03ea8b7a453f154953"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py_OperandComparisonGroupingSuite.test_single_pair_": {"doc_hash": "56368f6e3a3e9aa68b82a87d71576dd97b3507e733bdf04958c22ad587cc411e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testipc.py_from_unittest_import_Test_IPCTests.test_transaction_large.p_join_": {"doc_hash": "1dd1e648f9f10cac9804e91d74b49c84bc38000bf65efe36721f27518b373da4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testipc.py_IPCTests.test_connect_twice_IPCTests.test_connect_twice.assert_p_exitcode_0": {"doc_hash": "ac2cd605028b11b1b97408bb7f24a73b247223a9a861610bd8a30a77ac3ae7e2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testipc.py_IPCTests._Run_test_connect_twice__": {"doc_hash": "9ba6690de8aff92616d955e454b67e7672a975bc2b49ab8bd61c56edc70ce69d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testmerge.py__Test_cases_for_AST_mer_NOT_DUMPED_MODULES._": {"doc_hash": "d852e875d1ab82d660401ad8a67799722b6b0983c88123a878a91b9906ae150a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testmerge.py_ASTMergeSuite_ASTMergeSuite.run_case.assert_string_arrays_equa": {"doc_hash": "c6b0f30cc86a7b6e4238176c38b662d6eae95d9e4d44a4012b9d53657e61a0aa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testmerge.py_ASTMergeSuite.build_ASTMergeSuite.build.return.result": {"doc_hash": "384ed225f052b2dec62b91b47ea3a3156cffd1d7ba01b1fb3513556ec812bc9a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testmerge.py_ASTMergeSuite.build_increment_ASTMergeSuite.dump_symbol_table.return.a": {"doc_hash": "e5a306b7f7580cd1a1feb0b2c1eecff4bb5f3059e0625bde48c0a4b5d6e88f15"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testmerge.py_ASTMergeSuite.format_symbol_table_node_ASTMergeSuite.format_symbol_table_node.return.s": {"doc_hash": "4f0b7b5811f1146e05f496cfe3cf04f0bd03cb37395f5f9d90b719c02655765b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testmerge.py_ASTMergeSuite.dump_typeinfos_ASTMergeSuite.dump_typeinfo.return.s_splitlines_": {"doc_hash": "0e6225daebecb1e65db84ccc11b1c65264ee1703c75117c5c1ba510f1aae8c49"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testmerge.py_ASTMergeSuite.dump_types_": {"doc_hash": "71316ef27c926be85081d44c60920d088606e20d3185b64ffe24c9f253ada314"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testmodulefinder.py_os_ModuleFinderSuite.setUp.self.fmc_nons.FindModuleCache_self_sear": {"doc_hash": "48b9c3beef11deedc553b2d2e2f2aad61a97b083ed8baf8f51532a6908b5be90"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testmodulefinder.py_ModuleFinderSuite.test__no_namespace_packages__nsx_ModuleFinderSuite.test__find_nsy_a__init_pyi.assert_equal_expected_fo": {"doc_hash": "8cb9e63e7434a5aaa0f3100402e8518e68177a9b63e9dc7c85c8d9eb87ce304c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testmodulefinder.py_ModuleFinderSuite.test__find_nsy_b__init_py_ModuleFinderSuite.test__find_nsy_b__init_py.assert_equal_expected_fo": {"doc_hash": "c230965e68bd141bede155b07de9b1fb12eaf20caded20d0b6ddf0dcfb0261fe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testmodulefinder.py_ModuleFinderSuite.test__find_nsy_c_pyi_ModuleFinderSuite.test__find_nsy_c_pyi.assert_equal_expected_fo": {"doc_hash": "f671f8e15452b7cc516527f45fefac751e21da31654a937413cf515b55976f02"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testmodulefinder.py_ModuleFinderSuite.test__find_a_in_pkg1_ModuleFinderSuite.test__find_d_nowhere.assert_equal_ModuleNotFou": {"doc_hash": "facf7a1dc7aaba92533e93642e636c18e26e5bdb5a0a93e70664b7329fab1876"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testmodulefinder.py_ModuleFinderSitePackagesSuite_ModuleFinderSitePackagesSuite.path.return.os_path_join_self_package": {"doc_hash": "a3518a71b0e17664dec8fb822e36b52b4cfe58df04af4ff4969195fceca8d3e5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testmodulefinder.py_ModuleFinderSitePackagesSuite.test__packages_with_ns_ModuleFinderSitePackagesSuite.test__packages_with_ns.for_module_expected_in_c.assert_equal_actual_expe": {"doc_hash": "f59d129b1a4a27d870072a1c72fd6d1c8648223c1297db419ce0d7b2e54d2f1e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testmodulefinder.py_ModuleFinderSitePackagesSuite.test__packages_without_ns_": {"doc_hash": "38e034e531f30fa367f6be5e0bd3621234ca10a85253e567dfb2c123c42d66c5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testmypyc.py__": {"doc_hash": "4bf9d24dc3202eaae505835580d01fbeaa8d756e762206e0b632ce12d6b88b3c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testparse.py__Tests_for_the_mypy_par_ParserSuite.run_case.test_parser_testcase_": {"doc_hash": "2a2bf3dc4d699a6f353f53222b3aad6d55382955f41a024868830239d305a00f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testparse.py_test_parser_ParseErrorSuite.run_case.test_parse_error_testcase": {"doc_hash": "3be34a83c5f546522ebb9bb7532ed137f35c53825ddf8f02a59f799370e90c50"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testparse.py_test_parse_error_": {"doc_hash": "1d639d48daa9403fa2623a35f341d713c3a0194e9270a1c45ecfe69354e8102b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testpep561.py_from_contextlib_import_co_PEP561Suite.run_case.test_pep561_test_case_": {"doc_hash": "b0830d26f885090088d8f9c57a42938c01452d339a8c245e9616c94f9f034998"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testpep561.py_virtualenv_virtualenv.with_tempfile_TemporaryDi.if_sys_platform_win32.else_.yield_venv_dir_os_path_a": {"doc_hash": "26199c386d9164cc30737c6826bfbf91cd514ce4fc2300d45af7e01f6846752f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testpep561.py_install_package_install_package.if_proc_returncode_0_.raise_Exception_proc_stdo": {"doc_hash": "4892fb79cacedefe4c0afd35e74880366e013556819f26ed5e39c47b98345cb1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testpep561.py_test_pep561_test_pep561.with_virtualenv_python_a.try_.finally_.if_venv_dir_is_not_None_.os_chdir_old_dir_": {"doc_hash": "dd8d8ff952bf66525f8a20c4b13ea16cf23dd14cea4b67efc9f4d644597084c3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testpep561.py_parse_pkgs_parse_mypy_args.return.m_group_1_split_": {"doc_hash": "4e9a334c5f6cd4fb48d21ae22729c234c31288f287be9c0f1505b7cfb7265e15"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testpep561.py_test_mypy_path_is_respected_": {"doc_hash": "9dafa5d579df2879f1f495017209d4b91856431774a7e923a6954393ea1f4e6f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testpythoneval.py__Test_cases_for_running_PythonEvaluationSuite.run_case.test_python_evaluation_te": {"doc_hash": "ce8bda11f0db249285a8566afe3a7ab5de193ee2598260e03ed58153164387b5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testpythoneval.py_test_python_evaluation_": {"doc_hash": "672d30999e218e42de0d96728552fff5ad16329e05a6aa4806f1e58a87b78eec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testreports.py__Test_cases_for_reports_": {"doc_hash": "3fb70dd8aa1fde9e88322252261f9b02c50c9f72514967e068b3ab7382ca51b0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsemanal.py__Semantic_analyzer_test_SemAnalSuite.run_case.test_semanal_testcase_": {"doc_hash": "8705182e0202ae5fa607a9aa92a77b022f29a840e57ddf266fa89867161a588d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsemanal.py_test_semanal_test_semanal.assert_string_arrays_equa": {"doc_hash": "c11d88256096e61051f98f28aa20f6fcd74bf2c8a9a8687ee4907d687e900df1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsemanal.py__Semantic_analyzer_error_test_semanal_error.assert_string_arrays_equa": {"doc_hash": "2b2b2eaaa43e35f220a15b6c45a1834fc233e433d11a3adbd5ecb1ca4bf62cbd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsemanal.py__SymbolNode_table_export_SemAnalSymtableSuite.run_case.assert_string_arrays_equa": {"doc_hash": "b88128dd28334fa84bc1e72ff1c046fb50fd0393d3b17adf1db44e662d2a9f55"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsemanal.py__Type_info_export_test_c_SemAnalTypeInfoSuite.run_case.assert_string_arrays_equa": {"doc_hash": "6b5aa594aa3f928d96c69de64010a1abdbcb6cd357f96758438a32c7437214eb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsemanal.py_TypeInfoMap_": {"doc_hash": "6c1c2e199ce31495c7c36a7456c5529398f13de93f5685a5ddad6cf9842efba8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsolve.py__Test_cases_for_the_con_SolveSuite.test_multiple_variables.self_assert_solve_self_f": {"doc_hash": "6cc99cae4424ecc9cda05ae75889ce250cb782a0ee42e5795360e3d39d289258"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsolve.py_SolveSuite.test_no_constraints_for_var_SolveSuite.test_no_constraints_for_var.None_2": {"doc_hash": "24a6aaa20b95d019539065618f130b27deabe01b2b9159ff9e54ab137dc2e7ba"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsolve.py_SolveSuite.test_simple_constraints_with_dynamic_type_SolveSuite.test_simple_constraints_with_dynamic_type._TODO_figure_out_what_t": {"doc_hash": "170236e0f99bd8d45a11ad0b25883c9c2a30fbdb8eeeb23bbe28ad91e7c9bd5c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsolve.py_SolveSuite.test_both_normal_and_any_types_in_results_SolveSuite.test_both_normal_and_any_types_in_results.None_1": {"doc_hash": "419a3285c44cd993b9d6cc6d9142cd9dee4a33688e93878a92288c841c807e0a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsolve.py_SolveSuite.assert_solve_": {"doc_hash": "342cf758586b5d8df860f20ea1902634dd97ab5775eb2200ae5e7214ae10f5d2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_io_from_mypy_moduleinspect_i": {"doc_hash": "d0ea29bea22e75560c6f1a69dddae1434ac9579a46d30c712c6d94d0e96ac6a9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenCmdLineSuite_StubgenCmdLineSuite.test_files_found.with_tempfile_TemporaryDi.try_.finally_.os_chdir_current_": {"doc_hash": "e3dcf23dc12679ff09589342d4f3f97d103a7ea532ad35e4144904b6fe310b04"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenCmdLineSuite.test_packages_found_StubgenCmdLineSuite.test_packages_found.with_tempfile_TemporaryDi.try_.finally_.os_chdir_current_": {"doc_hash": "bdadb1fb0e3fda595e571bcb78c93772df73413776808a90617e3af13793bf10"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenCmdLineSuite.test_module_not_found_StubgenCmdLineSuite.run.with_local_sys_path_set_.return.super_run_result_": {"doc_hash": "160dcf5c4010014a5a5bf6a4ff2d0bc52d53432070bd5bc4ef9935b890a73834"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenCliParseSuite_StubgenCliParseSuite.test_walk_packages.with_ModuleInspect_as_m.self_assertTrue_all_mypy_": {"doc_hash": "e900fc27eeaaeebff00961da2df3d5019161b950d351257a7e605e79aa3dbb8d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenUtilSuite_StubgenUtilSuite.test_find_unique_signatures.assert_equal_find_unique_": {"doc_hash": "ea2fd2b13127b48dd324cb1e0d2bab0672287521516d4b055b215fcd536bda00"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenUtilSuite.test_infer_sig_from_docstring_StubgenUtilSuite.test_infer_sig_from_docstring.None_14": {"doc_hash": "fa512229d8c58903e6758d9922795eb8643dddd161c78537a3ff8b206c470044"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenUtilSuite.test_infer_sig_from_docstring.None_15_StubgenUtilSuite.test_infer_sig_from_docstring.None_19": {"doc_hash": "7f68e9a0e520c915ea771e4785c525210abc2304bb74324e57cb7cf11620da45"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenUtilSuite.test_infer_sig_from_docstring_duplicate_args_StubgenUtilSuite.test_infer_sig_from_docstring_bad_indentation.assert_equal_infer_sig_fr": {"doc_hash": "02b5cd8c04d123f71b4eff0cfd40d36f07f25e7b97b2aeeab0ef38be3e2e4cf7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenUtilSuite.test_infer_arg_sig_from_anon_docstring_StubgenUtilSuite.test_infer_arg_sig_from_anon_docstring.assert_equal_": {"doc_hash": "3aa8c03b58f4b73073d5870d6a4aa52ebfba8ec65e4193c560cbb05d8dd833df"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenUtilSuite.test_infer_prop_type_from_docstring_StubgenUtilSuite.test_remove_misplaced_type_comments_1.assert_equal_remove_mispl": {"doc_hash": "df3eacb5760b87bae15f7d10afeebccbb1001e0dd3a388352cc7489761773b2a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenUtilSuite.test_remove_misplaced_type_comments_2_StubgenUtilSuite.test_remove_misplaced_type_comments_2.assert_equal_remove_mispl": {"doc_hash": "fb0f696cf24e6707974b39b7a9b7b86049258ea65420bb33599b766cea916b4f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenUtilSuite.test_remove_misplaced_type_comments_3_StubgenUtilSuite.test_remove_misplaced_type_comments_3.assert_equal_remove_mispl": {"doc_hash": "ef1e7eac93cae1cdbb9914419ad93009124018e6e2f5bdbb12524334c91f8c33"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenUtilSuite.test_remove_misplaced_type_comments_4_StubgenUtilSuite.test_remove_misplaced_type_comments_4.assert_equal_remove_mispl": {"doc_hash": "4452b29107f510307aba40c2fc150544e458579bf69c58d578e3a148005cbbf1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenUtilSuite.test_remove_misplaced_type_comments_5_StubgenUtilSuite.test_remove_misplaced_type_comments_5.assert_equal_remove_mispl": {"doc_hash": "30100b677937a713371eddbf520442fd9ac322146c27fd8eb6fec2005f75c25e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenUtilSuite.test_remove_misplaced_type_comments_bytes_StubgenUtilSuite.test_remove_misplaced_type_comments_bytes.assert_equal_remove_mispl": {"doc_hash": "3fd8e7871414f09a3db6ac45b2639dd82be0b04ee1be0f34a43d24c7f53c7648"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenUtilSuite.test_common_dir_prefix_unix_StubgenUtilSuite.test_common_dir_prefix_unix.None_12": {"doc_hash": "6c936eb7d22aa65788e3486137be2456ecc560390e6a254d747eb5f6aef051db"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenUtilSuite.test_common_dir_prefix_win_StubgenUtilSuite.test_common_dir_prefix_win.None_12": {"doc_hash": "f91f4fb64e4b80333bfddf51ae02b0d0d87fd70574afa32e378bc3a2881b53a6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenHelpersSuite_StubgenHelpersSuite.test_is_blacklisted_path.None_7": {"doc_hash": "aebc3b6649d99019533a576915344ad374982a28a31f6230724c09099bf5cc80"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenHelpersSuite.test_is_non_library_module_StubgenHelpersSuite.test_is_non_library_module.None_19": {"doc_hash": "44682e483c3cbc100d3cdf649b26c4cd415ef0c32495b9ef90ed48c05ae85c53"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenPythonSuite_StubgenPythonSuite.run_case.with_local_sys_path_set_.self_run_case_inner_testc": {"doc_hash": "b56d93ef99506740d70839901859304636d8dfcc8a13ac25c288414d1d5b6798"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenPythonSuite.run_case_inner_StubgenPythonSuite.run_case_inner.try_.finally_.shutil_rmtree_out_dir_": {"doc_hash": "f263f60a18421ef8a9159238cfc2ebc3cff0510e4a4e2590c1f9ccda03638951"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgencSuite_StubgencSuite.test_generate_c_type_stub_no_crash_for_object.assert_equal_output_0_": {"doc_hash": "feda1b97233a959bb02c5aafabdbb525dc340134976cd23fd6ec4b8786163488"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgencSuite.test_generate_c_type_stub_variable_type_annotation_StubgencSuite.test_generate_c_type_stub_variable_type_annotation.assert_equal_output_cl": {"doc_hash": "6460726cabd827d5a405a182195179e8586c22e34b1f58306fb98e952bd6822d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgencSuite.test_generate_c_type_with_docstring_StubgencSuite.test_generate_c_type_with_docstring.assert_equal_imports_": {"doc_hash": "6a9a471f86adfac62ae43d410bcc112fba76ff8c1a2941cf3ccc32a1fa1d8f63"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgencSuite.test_generate_c_type_with_docstring_empty_default_StubgencSuite.test_generate_c_type_with_docstring_empty_default.assert_equal_imports_": {"doc_hash": "442bfd794ea2830f1670a6594f085397c09e4d82415189e0811b733a91a29e35"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgencSuite.test_generate_c_function_other_module_arg_StubgencSuite.test_generate_c_function_other_module_arg.assert_equal_imports_i": {"doc_hash": "df9909c07629d0ea328f9242e402d2e0d66cb81840ddeb225895933694abb848"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgencSuite.test_generate_c_function_same_module_arg_StubgencSuite.test_generate_c_function_same_module_arg.assert_equal_imports_": {"doc_hash": "ce52b6a026feef8fbe486da5be0cf8d8765caea1b6c7c4581122a81be5039cb5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgencSuite.test_generate_c_function_other_module_ret_StubgencSuite.test_generate_c_function_other_module_ret.assert_equal_imports_i": {"doc_hash": "99387591cf980080f9e4ae552aa458e4e7b91547fd6f0a28c7bc37ebcab32342"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgencSuite.test_generate_c_function_same_module_ret_StubgencSuite.test_generate_c_function_same_module_ret.assert_equal_imports_": {"doc_hash": "be2b708030354198035e989f687879dbdd893969a37005082207b4bf04358a5f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgencSuite.test_generate_c_property_with_pybind11_StubgencSuite.test_generate_c_property_with_pybind11.assert_equal_output_p": {"doc_hash": "95469086cd6824d01f64ab94f39b913b15374b30b2d98b20254046ca3a02289a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgencSuite.test_generate_c_type_with_single_arg_generic_StubgencSuite.test_generate_c_type_with_single_arg_generic.assert_equal_imports_": {"doc_hash": "d84dd3930166acce708f12d801f55b5702fd3ab8a57e7e10b0f8ccbcc82888a3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgencSuite.test_generate_c_type_with_double_arg_generic_StubgencSuite.test_generate_c_type_with_double_arg_generic.assert_equal_imports_": {"doc_hash": "e4fe950c268a4459082c3e9ef2d53c59b3262db44611d529878234cd8f822a02"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgencSuite.test_generate_c_type_with_nested_generic_StubgencSuite.test_generate_c_type_with_nested_generic.assert_equal_imports_": {"doc_hash": "01e329b6631aa52fe74d494d720d4549e6b108f8cc76238ba5b09f4755949483"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgencSuite.test_generate_c_type_with_generic_using_other_module_first_StubgencSuite.test_generate_c_type_with_generic_using_other_module_first.assert_equal_imports_i": {"doc_hash": "4bab42ed5882f5fb86a431047b3a8314f81badc0d90481c2891e898ebdf18afe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgencSuite.test_generate_c_type_with_generic_using_other_module_last_StubgencSuite.test_generate_c_type_with_generic_using_other_module_last.assert_equal_imports_i": {"doc_hash": "66badbbb4299b136d03ffac07234e20193298dd16578730a88aa016c41c3076c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgencSuite.test_generate_c_type_with_overload_pybind11_StubgencSuite.test_generate_c_type_with_overload_pybind11.assert_equal_set_imports_": {"doc_hash": "07e7adeb9b1e26f5c65f09c0e47d181e981b7e25c8bffbbdf6595a6bc88a836e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_ArgSigSuite_ArgSigSuite.test_repr.None_3": {"doc_hash": "b2634262ddccac905b40427566a0a8fec1e1c429c41a819202bc050074162517"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_IsValidTypeSuite_IsValidTypeSuite.test_is_valid_type.None_12": {"doc_hash": "1fd226e3f89366d0895083033990ca05c0e0676ec579937ec5115fca1b5d84d7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_ModuleInspectSuite_": {"doc_hash": "da72802582b66a60da31bee328dc4bb2c12b4636a497eb9712cb18366fb13dc4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_contextlib_stubtest_builtins_stub._": {"doc_hash": "18deb24a456caff685b716af579e6e1515d3e6045aa227fb03a83cf852e76f7e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestUnit_StubtestUnit.test_basic_good.None_1": {"doc_hash": "c819b267ac993f773c69544802f36941c6ebd779e9af58e0a67f40e68b2ae251"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestUnit.test_types_StubtestUnit.test_types.None_2": {"doc_hash": "6ef1ba30a5fc413c5052192d354849d5abb6247f1e684062bb98cef89184fc0c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestUnit.test_arg_name_StubtestUnit.test_arg_name.None_2": {"doc_hash": "d32fff1eae29a741d33329c2092421b0cb4651560f093b835f3a324e05408f48"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestUnit.test_arg_kind_StubtestUnit.test_arg_kind.if_sys_version_info_3.None_1": {"doc_hash": "a40b12dc1ee2bb3edda38035679bc276ed82f5e745df18b2505136a2307713a6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestUnit.test_default_value_StubtestUnit.test_default_value.None_5": {"doc_hash": "9c423452ffed7528a6f89999fd2a39798196b304f5daa4aa234b7e1506a66d1c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestUnit.test_static_class_method_StubtestUnit.test_static_class_method.None_4": {"doc_hash": "8d21630644af3d8ae9676eb45911fd1fdd8b775a3c3bbb62e60ab7feeac6ee81"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestUnit.test_arg_mismatch_StubtestUnit.test_arg_mismatch.None_4": {"doc_hash": "3990068351d210395a1e6c5c3ede4a4cae7e80ddc4d6c869dde381d92a50d400"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestUnit.test_varargs_varkwargs_StubtestUnit.test_varargs_varkwargs.None_16": {"doc_hash": "428bb127867845cf93ede6c28bd02c32b6f2ee56bccc786a9a1ff66936c8090c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestUnit.test_overload_StubtestUnit.test_overload.if_sys_version_info_3.yield_Case_": {"doc_hash": "80d1199d4b1b7da2340a077aaf1353379027435c97a5d3da67e4a4c1457c83b0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestUnit.test_property_StubtestUnit.test_property.None_3": {"doc_hash": "4e4d20ce9850822c88e99bdef9eff1f1a743d7169f6a5c9722c4091901d257b4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestUnit.test_enum_StubtestUnit.test_decorator.yield_Case_": {"doc_hash": "35e016888f424c2757c944eb04a6956a84e38e5e766fb4890316c681ad22729c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestUnit.test_mro_remove_color_code._this_works_": {"doc_hash": "8434e0e9fcc9393aa0c5a379d1c56e568125a27969fe669d0435733d2e5db827"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestMiscUnit_StubtestMiscUnit.test_output.None_1": {"doc_hash": "af4df003c70948d0e4b9b070d73c020f64e05288c7f8a03d5baf9c955422ec92"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestMiscUnit.test_ignore_flags_StubtestMiscUnit.test_ignore_flags.None_2": {"doc_hash": "ec6de860f9af80c7174af66c478cac035a0e5e9d4957120a322375df750d7260"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestMiscUnit.test_allowlist_StubtestMiscUnit.test_allowlist.try_.finally_.os_unlink_allowlist_name_": {"doc_hash": "286c10844d7783e088f292b5f9008dabb8a9b73ab0ced90d8645fa6d4c628435"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestMiscUnit.test_mypy_build_StubtestMiscUnit.test_mypy_build.None_1": {"doc_hash": "e7f47fe0b4ce27107a92d53e5132e848c7f6ad74bb21e2dce1ed7c56635f13c2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestMiscUnit.test_missing_stubs_StubtestMiscUnit.test_signature.assert_": {"doc_hash": "bc254e7fc196b6cd6e6798a8ebaa4b529d3c77a5221bb0a1139e30d52caaa81a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestMiscUnit.test_config_file_": {"doc_hash": "05ee905f111f8a98fbc181b688fdab4076f492f684a7268d329a7b14ea639ec6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsubtypes.py_from_mypy_test_helpers_im_SubtypingSuite.test_generic_interface_subtyping.self_assert_equivalent_fx": {"doc_hash": "a2b58f3cf80c2dc37215aed5f032d37e61a279d23b4e1189ebe981b22f56dd2a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsubtypes.py_SubtypingSuite.test_basic_callable_subtyping_SubtypingSuite.test_basic_callable_subtyping.self_assert_unrelated_": {"doc_hash": "d3c27c64da3ce7fb5528fe8c018f6bd37e76acb13c7bb02a36daccec1e62e23e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsubtypes.py_SubtypingSuite.test_default_arg_callable_subtyping_SubtypingSuite.test_default_arg_callable_subtyping.None_5": {"doc_hash": "62853c7023f34e716c798a8de97b8d0703835a0b25b1b26ceec9efca7433ed5a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsubtypes.py_SubtypingSuite.test_var_arg_callable_subtyping_1_SubtypingSuite.test_var_arg_callable_subtyping_7.self_assert_not_subtype_": {"doc_hash": "38178bb4ef7046b856380cdd16d87a8f8eb4f60719d018fac7b34192a7aca662"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsubtypes.py_SubtypingSuite.test_var_arg_callable_subtyping_8_SubtypingSuite.test_var_arg_callable_subtyping_8.self_assert_subtype_": {"doc_hash": "943fba69d5f66cf500d5c16ae5b43641e42fb7439770f726d5ff453a11c718e2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsubtypes.py_SubtypingSuite.test_var_arg_callable_subtyping_9_SubtypingSuite.test_var_arg_callable_subtyping_9.self_assert_subtype_": {"doc_hash": "a508a51c960faba1391d23e3812a7a7d1033a5c105d1c209757f58bc3f4d5f92"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsubtypes.py_SubtypingSuite.test_type_callable_subtyping_": {"doc_hash": "be2e7e454425ff93fbae3d5dcde57144286ad958b4858bc9b7d62f1ac9d93c8b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtransform.py__Identity_AST_transform_TransformSuite.run_case.test_transform_testcase_": {"doc_hash": "0fc3402446a088d01c3ea0f44b1a80d77dc51f7ef48325c0cbe579158ab9f123"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtransform.py_test_transform_": {"doc_hash": "fab4a28c75e9a26eda0751d1f301cab23be58e558a7ba47e76e96ddd6c1424e9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypegen.py__Test_cases_for_the_typ_from_mypy_options_import_": {"doc_hash": "9d9194499eb2ca7524bcb5508031b0b0760f8ce9739d407a16af99a1d7a73dce"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypegen.py_TypeExportSuite_": {"doc_hash": "ef2ea3a1980700ac066850f0b94e01ae825f7bf152a112030ad52dd5dce28b54"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py__Test_cases_for_mypy_ty_from_mypy_typeops_import_": {"doc_hash": "0c5c4497ae87824bbb8e156cfda16f76720231fae552c039344b4a8e99273c61"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypesSuite_TypesSuite.test_callable_type.assert_equal_str_c2_de": {"doc_hash": "70a11c1b7e4fcdd9c5565fa5149e013a749b52fbfa900b4c34b0353f2946ad82"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypesSuite.test_callable_type_with_default_args_TypesSuite.test_callable_type_with_default_args.assert_equal_str_c2_de": {"doc_hash": "a116cd4c2c199a5bafe81ee1265b257460668fca6bf4ff0692c1d4a2f699da07"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypesSuite.test_callable_type_with_var_args_TypesSuite.test_callable_type_with_var_args.assert_equal_str_c3_de": {"doc_hash": "786ee5d0a1eba721aae7acfc3d199a2be6182020243bab6f7fc5834a1c6824df"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypesSuite.test_tuple_type_TypesSuite.test_type_variable_binding.None_1": {"doc_hash": "69e7936a7b9ce44870fec6e017e2efac626cb4a8f0014dee3c87c49d225ca4b1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypesSuite.test_generic_function_type_TypesSuite.test_type_alias_expand_once.None_5": {"doc_hash": "edcd7827e8204461c40bfcc842f59cbf7503dc5d3b2f32792e677369bb856b04"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypesSuite.test_type_alias_expand_all_TypesSuite.test_indirection_no_infinite_recursion.None_3": {"doc_hash": "770dc5150fd523286a1cbba83dd09e3efe70ac003bb0935f48ff39831126d8e4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypeOpsSuite_TypeOpsSuite.test_erase_with_type_object.self_assert_erase_self_fx": {"doc_hash": "881e45cdf904a13fa70f654821c8e0dcf4406c737aef7dc773d91b2b02450e62"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypeOpsSuite.test_erase_with_type_type_TypeOpsSuite._is_proper_subtype": {"doc_hash": "f51661b1bbb1769b728f760ffc41761e0ce473be6b3709bf40e03ed2cbb21037"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypeOpsSuite.test_is_proper_subtype_TypeOpsSuite.test_is_proper_subtype.None_17": {"doc_hash": "3a12ecdbbd654c1645424efaf537c295c883b0083a1306ba602e7aba745d1750"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypeOpsSuite.test_is_proper_subtype_covariance_TypeOpsSuite.test_is_proper_subtype_invariance.None_4": {"doc_hash": "11a8b20cbc042c3f71a1b7d32a0359d76130d4f3d417ef3a90b414bc2fda88d8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypeOpsSuite.test_is_proper_subtype_and_subtype_literal_types_TypeOpsSuite.test_is_proper_subtype_and_subtype_literal_types.None_19": {"doc_hash": "061b893bb0354829174860b24e2aca67a185e7525a0f1700ff33f5afe292d31a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypeOpsSuite.test_subtype_aliases_TypeOpsSuite.test_subtype_aliases.None_9": {"doc_hash": "2f097ca246aca3ccd9bec749c4d35174a1bb783e6642d73881acb8c950b4a0e9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypeOpsSuite._can_be_true_can_be_fa_TypeOpsSuite.test_true_only_of_instance.assert_true_self_fx_a_can": {"doc_hash": "b7a289b8001faf793faa1211ede00e61a687569cc0aa593796559f4ac15b26ba"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypeOpsSuite.test_true_only_of_union_TypeOpsSuite.test_true_only_of_union.assert_true_to_items_1_i": {"doc_hash": "4ff562cd688982aadb7a627b121aad5dd37efdf5d50769dda070415349a615be"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypeOpsSuite.test_false_only_of_true_type_is_uninhabited_TypeOpsSuite.test_false_only_of_instance.assert_true_self_fx_a_can": {"doc_hash": "b66b5a757476f07462cd4d19a89c1bfd5162ee322a8e0e3da48447896293c94c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypeOpsSuite.test_false_only_of_union_TypeOpsSuite.tuple.return.TupleType_list_a_self_f": {"doc_hash": "585eab5ac40953d2816ef4816a2d62cedff14d488bc3e557604dae8c57c46380"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypeOpsSuite.callable_TypeOpsSuite.callable.return.CallableType_list_a_1_": {"doc_hash": "839bc7ac770ea3737b9fc762c2ff006bcb2540a3ae4e1842876b39a46f02edf6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite_JoinSuite.test_class_subtyping.None_4": {"doc_hash": "8b374bec1a0b531b4586930fb235cbd3747b20fcdc58b58262e5f6cfaf64de52"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite.test_tuples_JoinSuite.test_tuples.None_6": {"doc_hash": "509c0ec303eab5428bc9980546ffe639fafc00b94582fb9fc47898f6184ff872"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite.test_var_tuples_JoinSuite.test_function_types.None_4": {"doc_hash": "3a6f574f442789e02ecf32af5ff61445396577870af8b1e65bd732e94d073cf6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite.test_type_vars_JoinSuite.test_none.for_t_in_NoneType_sel.self_assert_join_t_NoneT": {"doc_hash": "b12035f37b0251b3284e907b79cd5045f14ef4c5e7b0319c8e61a9561521369d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite.test_unbound_type_JoinSuite.test_unbound_type.for_t_in_self_fx_a_self.self_assert_join_t_Unbou": {"doc_hash": "bd7cfd32e45791d46f3811cb1fb4d97731bd0a3e760a041dbbd476ecf30e67f4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite.test_any_type_JoinSuite.test_mixed_truth_restricted_type.assert_true_j_can_be_fals": {"doc_hash": "460bbba07f884aa5e3b24661223e08924edb0ca88af9b0f08d42b3e6cb152e9b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite.test_other_mixed_types_JoinSuite.test_other_mixed_types.for_t1_in_self_fx_a_sel.for_t2_in_self_fx_a_sel.if_str_t1_str_t2_.self_assert_join_t1_t2_": {"doc_hash": "f2b06d19b9218ba6c51f9136de419400fefe5342bfe33195b5d64f4fd354a3a8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite.test_simple_generics_JoinSuite.test_simple_generics.for_t_in_self_fx_a_self.self_assert_join_t_self_": {"doc_hash": "c4a061e3a68f1535e1e711014d8c872bedf3bd34f02ed7f2d9783510f22882d2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite.test_generics_with_multiple_args_JoinSuite.test_callables_with_any.self_assert_join_self_cal": {"doc_hash": "0f504e80b415c8a8bf8fa905febbf772772a4974c5537f37ba7887215d9a9464"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite.test_overloaded_JoinSuite.test_overloaded.None_5": {"doc_hash": "1e8327f8a02ebb566ba82e6cc6e68b6df4e57e6ad6c3cd5777e54f7088737055"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite.test_overloaded_with_any_JoinSuite.test_overloaded_with_any.None_1": {"doc_hash": "95df376a8f3f28627910fd5d6c77708ac7c27bb98e0354acc8fe4e695f14dbdb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite.test_join_interface_types_JoinSuite.test_generic_interfaces.None_3": {"doc_hash": "8f8c11b58857bef221cbc582d8c1ccba072b0a61b6ebcccb8a9936fcb8758640"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite.test_simple_type_objects_JoinSuite.test_simple_type_objects.self_assert_join_self_fx_": {"doc_hash": "581ed9b898053006742339d72ecc7bf55f3d47b9598dfb30bd4fe5a8b8a26ff4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite.test_type_type_JoinSuite.test_type_type.None_6": {"doc_hash": "97db1b42bca2877929bd548bc46147c8bb79e2c923455df8588758bc80a27bcb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite.test_literal_type_JoinSuite.test_literal_type.None_15": {"doc_hash": "53e4325421770a8f21519352b8d8b11919e44b4cfdc1ce414b78137fd13b6d8f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite._There_are_additional_te_JoinSuite.assert_simple_join.assert_true_is_subtype_t_": {"doc_hash": "fbb871303428a416b47dbc7708e7d18f1746b0da8942576dc113299fcb02bb7d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite.tuple_JoinSuite.type_callable.return.CallableType_list_a_1_": {"doc_hash": "2d51633120e508c2a6aa0bbf2907a977b1987e7fbeaec05cbe585b406a157761"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_MeetSuite_MeetSuite.test_class_subtyping.None_4": {"doc_hash": "9813bec93c6c9fddffbdd256852b75df0f94b84f36eb0c26cc9dc5fb35576737"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_MeetSuite.test_tuples_MeetSuite.test_tuples.None_4": {"doc_hash": "23227b8a3a34c30ebd3d0e26f138bf839f9ed85664af180c0e93c0b068176189"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_MeetSuite.test_function_types_MeetSuite.test_function_types.None_2": {"doc_hash": "f6df98f3a8c8bee7a7394f424e2b3c162fa2d08acc7d5676abd02fe68f9c8c34"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_MeetSuite.test_type_vars_MeetSuite.test_none.for_t_in_self_fx_a_self.self_assert_meet_t_NoneT": {"doc_hash": "b0b81bbae616d61025f28f11411320960c2109bb4036d1b46be3d4b78f95a3cf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_MeetSuite.test_unbound_type_MeetSuite.test_dynamic_type.for_t_in_self_fx_anyt_s.self_assert_meet_t_self_": {"doc_hash": "d54a01835bf679d657ea946cab069b0276df544538013210c1dd258746bac9b4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_MeetSuite.test_simple_generics_MeetSuite.test_simple_generics.for_t_in_self_fx_a_self.self_assert_meet_t_self_": {"doc_hash": "00ae476d7cb309a83881e498fd7ce5ac5afd5ede9d3917621530a446545c0cf0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_MeetSuite.test_generics_with_multiple_args_MeetSuite.test_meet_with_generic_interfaces.self_assert_meet_fx_gfb_": {"doc_hash": "1eb2f8e299c2f2a99dda32a6a5fc6db2c72afe12a09b553c74f3263f7ac31292"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_MeetSuite.test_type_type_MeetSuite.test_type_type.None_6": {"doc_hash": "ac5437a08acdc9a85d75a127c95bafd72879fb36a4969a4cdad0cfb6b9fd41c1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_MeetSuite.test_literal_type_MeetSuite.test_literal_type.None_10": {"doc_hash": "19001e320381881d6d1c043d07526a88faf19a58f0292ac00cf4e4b962f8752d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_MeetSuite._FIX_generic_interfaces__MeetSuite.assert_meet.self_assert_simple_meet_t": {"doc_hash": "d3f00d70a00a3f35483dc26ef7e91b7af7b4d2190d3f00740a7bccb625671918"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_MeetSuite.assert_simple_meet_MeetSuite.assert_simple_meet.None_2": {"doc_hash": "f5e65e0958f1680586e302fa4e7d8f08f3870bf4c4b883f48d0dccff80a3adbc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_MeetSuite.tuple_MeetSuite.callable.return.CallableType_list_a_1_": {"doc_hash": "d8b4d1cf3666b730c56294a9b16931e0dea525bd628801d1cf4a91384a81844e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_SameTypeSuite_SameTypeSuite.test_literal_type.None_7": {"doc_hash": "d416bddef48fc06edf2db876fe5d207abca4885d32dddd9487908ef9a940478b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_SameTypeSuite.assert_same_SameTypeSuite.assert_not_same.None_1": {"doc_hash": "4856d17d6ce2222788c23eb19610e4690c750998f8e828d450768e5d4b13a790"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_SameTypeSuite.assert_simple_is_same_": {"doc_hash": "8019928ce3a254f6b87e57e32fd3907a86b4362bb82a269b271d6e602c3db0c9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/typefixture.py__Fixture_used_in_type_r_TypeFixture": {"doc_hash": "5c5a4fd42d0c0f0ec7639a6c37496da19d7fe366767be017d5d7030a02d9ac71"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/typefixture.py_TypeFixture._Helper_class_that_is_u_TypeFixture.__init__._H_B_B_": {"doc_hash": "b26e6766c0e2efff37f198eb3d623e51db58a1911ca85802c2cd01f3f79f4234"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/typefixture.py_TypeFixture.__init__.self.hts_TypeFixture.__init__.self.type_any.TypeType_make_normalized_": {"doc_hash": "44dea9c2ba1e608ed9995df762710b4fb01e59a846e3cadcf2c9f6076bdff959"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/typefixture.py_TypeFixture._Helper_methods_TypeFixture.callable_type.return.CallableType_list_a_1_": {"doc_hash": "b85a9aa42b459110e605ede38f4723b5c109b9b1b4fde8588951f3e6af20e488"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/typefixture.py_TypeFixture.callable_default_TypeFixture.callable_default.return.CallableType_list_a_1_": {"doc_hash": "80c97979958e4fc6db35280fb83233132ce248649bb0ecc76e7f71447c5815af"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/typefixture.py_TypeFixture.callable_var_arg_TypeFixture.callable_var_arg.return.CallableType_list_a_1_": {"doc_hash": "9d33c62cf53af26a826cdee82038620a4f790131caa25c8041c9780aac38ee72"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/typefixture.py_TypeFixture.make_type_info_TypeFixture.make_type_info.return.info": {"doc_hash": "8d48f56486f2c3e80a65e11bf51226453e51b8edc6f5e71823ae049e615625b8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/typefixture.py_TypeFixture.def_alias_1_TypeFixture.non_rec_alias.return.TypeAliasType_AN_": {"doc_hash": "2548b40d13266c3d6a13637ac99b89b1f6ed18833f6caaf54a4e29634c9bb7d4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/typefixture.py_InterfaceTypeFixture_": {"doc_hash": "3f4ce3ca1040715b3af2a97293be1742671af45a0a34814ef08b6a8842e9a5ca"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/visitors.py__Visitor_classes_pulled_from_mypy_types_import_Ty": {"doc_hash": "e24167664fe2f869b00b187889ee3fc0eb55f00c8bde07d77322d853b270c196"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/visitors.py__from_testtypegen_SkippedNodeSearcher.skip_if_typing.if_self_is_typing_.self_nodes_add_n_": {"doc_hash": "4e8138dc081d0e94ebc34910648a6a95ddceac09034e6a541e63da050a7f3176"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/visitors.py_ignore_node_": {"doc_hash": "458befce19df2523e7a4c4ee653d139b25d572087a96fbfaf5bf8550ecec5191"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/traverser.py__Generic_node_traverser_from_mypy_nodes_import_": {"doc_hash": "5368f445196414e51613c8a8f4f83d364da20311120cff4e6e7e343d52b18876"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/traverser.py_TraverserVisitor_TraverserVisitor.visit_raise_stmt.if_o_from_expr_is_not_Non.o_from_expr_accept_self_": {"doc_hash": "d3bc83ed7b74503fdd7002260d1a7611f48225967a9b291988b2f1338da8ffc3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/traverser.py_ReturnSeeker_has_return_statement.return.seeker_found": {"doc_hash": "ac291c578c8217e51d20936cda2b675fa0b2c19cbd9d66b0f36e80001e437935"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/traverser.py_ReturnCollector_": {"doc_hash": "eec4901098ae8c2109135ab44442009d77fe16071eca5d30a1012bd8a56f1037"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/treetransform.py__Base_visitor_that_impl_from_mypy_util_import_rep": {"doc_hash": "0a49c94ba3ce2bfe3a56121205deec5a13fee4c9108b4a5b62e3e7800f806de4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/treetransform.py_TransformVisitor.visit_func_def_TransformVisitor.visit_func_def.if_node_in_self_func_plac.else_.return.new": {"doc_hash": "0d9377f7b24125a70b5b1fd97faa7904ec99bcbab58bf4ae7f6b5c7596539440"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/treetransform.py_TransformVisitor.visit_lambda_expr_TransformVisitor.copy_function_attributes.new.line.original_line": {"doc_hash": "1cc254c1f0ca046cae67c6ba8bf28e4a4ed4766940bb3b9cd1f3710a1b262a37"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/treetransform.py_TransformVisitor.visit_overloaded_func_def_TransformVisitor.visit_overloaded_func_def.return.new": {"doc_hash": "3940fcb8efe5c7d3d5b1d8f9819220e830bdc7b2272018fbaea13a78b5984437"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/treetransform.py_TransformVisitor.visit_class_def_TransformVisitor.visit_decorator.return.new": {"doc_hash": "d347839ca72a1b30953c015d90a9fde3829ab8fa90e1229e293ca8304c7bd5ba"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/treetransform.py_TransformVisitor.visit_var_TransformVisitor.visit_var.return.new": {"doc_hash": "78154476df21dbb311eef826e3b5904d04b249d9b52128caf2f67341d1b8e3f6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/treetransform.py_TransformVisitor.visit_expression_stmt_TransformVisitor.visit_int_expr.return.IntExpr_node_value_": {"doc_hash": "258cf3a5812605fe0829b1f19047c12c109cc065f4a6f9d7f1fdea6d3b94ef67"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/treetransform.py_TransformVisitor.visit_str_expr_TransformVisitor.visit_member_expr.return.member": {"doc_hash": "dc8040baa9e2f79886591047545432886cf52599c2ab74626aeb5d323e0bc67d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/treetransform.py_TransformVisitor.copy_ref_TransformVisitor.copy_ref.new.is_inferred_def.original_is_inferred_def": {"doc_hash": "ed14526b5d8611d378f1d98fac6ec7e192da7c1f0b9b8a1e84769672b3728f65"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/treetransform.py_TransformVisitor.visit_yield_from_expr_TransformVisitor.visit_list_comprehension.return.ListComprehension_generat": {"doc_hash": "920d80a71a04d3a4b607ed7dd5db98bf984ee7d51f048545e2e638ffbaa36ff4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/treetransform.py_TransformVisitor.visit_set_comprehension_TransformVisitor.expr.return.new": {"doc_hash": "1c08be2a5d4f7a195fa0f8952516f39ff5e8a8e21ae4af3222a3777d0be72082"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/treetransform.py_TransformVisitor.stmt_TransformVisitor.types.return._self_type_type_for_type": {"doc_hash": "032cfd76769906e03c283407143c3e5a3e2ed56721817618bc43f5ab336ac546"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/treetransform.py_FuncMapInitializer_": {"doc_hash": "a3884d48493f09f93bc4b559449a5cb757f4f8b498f7ce1ca4cc90a969b866e4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/tvar_scope.py_from_typing_import_Option_TypeVarLikeScope.class_frame.return.TypeVarLikeScope_self_get": {"doc_hash": "75cb6a64cc6d8eae208e319eb114da1525fd43ac0e306840c9db8a86d1da591f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/tvar_scope.py_TypeVarLikeScope.bind_new_TypeVarLikeScope.bind_new.return.tvar_def": {"doc_hash": "d0cd1f5aedb3b26f8c4432f281d0dfff075bbe600a235aa5854c1f7357b11b94"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/tvar_scope.py_TypeVarLikeScope.bind_existing_": {"doc_hash": "8ab5329781905ce5021bb552087a177121d369211c54a3a74967e846f14deac6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/type_visitor.py__Type_visitor_classes__from_mypy_types_import_": {"doc_hash": "3648e2d83489817cba374705dd2606bf65d50f65b34a9fa664c27d4c1aa7521c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/type_visitor.py_TypeVisitor_TypeVisitor.visit_type_alias_type.pass": {"doc_hash": "61401a49678f8cc5eadf28aa59da440cd3e0076073847857e1759529e9943667"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/type_visitor.py_SyntheticTypeVisitor_SyntheticTypeVisitor.visit_placeholder_type.pass": {"doc_hash": "d9be7016e27099bfc9be2461d18c9b5521c3b6ac7f74da42cb8a97af1cfbd04d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/type_visitor.py_TypeTranslator_TypeTranslator.visit_deleted_type.return.t": {"doc_hash": "643b3ee9f8a1ba776f692f185a1263992bb9f92be6ed580dc0248a98287b6a01"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/type_visitor.py_TypeTranslator.visit_instance_TypeTranslator.visit_instance.return.Instance_": {"doc_hash": "04259bf0d871225d74ca65e6584fa0fc5836de7f4ca901f2a5fe1de9b7f261c4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/type_visitor.py_TypeTranslator.visit_type_var_TypeTranslator.visit_type_alias_type.pass": {"doc_hash": "fe0694e34fbb01eb67b54707c43ba52517b115e684acc2dd46073f16bf4bd0c1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/type_visitor.py_TypeQuery_TypeQuery.visit_type_alias_type.return.get_proper_type_t_accept": {"doc_hash": "d6c1e467334c12ed1275e3279abac6a441aa86d49edff4099f63afcf055dcf8a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/type_visitor.py_TypeQuery.query_types_": {"doc_hash": "91bacad2cd8cf545b20d2b6bb4187f503701358f681e1b7997453e3f9b34c16e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py__Semantic_analysis_of_t_GENERIC_STUB_NOT_AT_RUNTIME_TYPES._": {"doc_hash": "08c9ac9f011806251388a5f8000b7abea091e3954172a5ce9217fb2539eec225"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser_TypeAnalyser.visit_unbound_type.return.typ": {"doc_hash": "ddb89f2077c0207accb15d45a8d8dfdedc2dbc093f6950ca29a33a98f04b994f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.visit_unbound_type_nonoptional_TypeAnalyser.cannot_resolve_type.self_api_fail_": {"doc_hash": "81762845648bd8cb4de1c4761e052521f81b234aec99109dfcf1088c3a944725"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.try_analyze_special_unbound_type_TypeAnalyser.try_analyze_special_unbound_type.return.None": {"doc_hash": "e5e3b62c26bda26ff9cff69c832646297c6e183ae1bc33abd1db3a79aef510e6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.get_omitted_any_TypeAnalyser.analyze_type_with_type_info.return.instance": {"doc_hash": "aba0f1a81773cb891f732663ef2840a4fe4af99fe857a6492b4b76e0a5ca0134"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.analyze_unbound_type_without_type_info_TypeAnalyser.analyze_unbound_type_without_type_info._type_List_str_": {"doc_hash": "da501db62455fed1043ed447a77b156cbc949df3e83fbbde5a0c6370a2a290a5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.analyze_unbound_type_without_type_info.None_4_TypeAnalyser.analyze_unbound_type_without_type_info.return.t": {"doc_hash": "7fc332e0c1f57ed299819256ecd1adde6bf96cb04bb88bde8f99a6718ca37f2c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.visit_any_TypeAnalyser.visit_type_var.return.t": {"doc_hash": "83eda6e9f6b05bdad4d4110ac9a60c06925acc2cda4791ab78d6fec82539235e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.visit_tuple_type_TypeAnalyser.visit_typeddict_type.return.TypedDictType_items_set_": {"doc_hash": "99d023c29e538f796a31017f68ac0053e4eb0c48b5c70a6eb6b5be0df9c36d03"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.visit_raw_expression_type_TypeAnalyser.visit_raw_expression_type.return.AnyType_TypeOfAny_from_er": {"doc_hash": "3d52afd1be14ebad19a656937e7186e1c1a59246b4c8c2f6b255cafc1637c60d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.analyze_callable_args_for_paramspec_TypeAnalyser.analyze_callable_args_for_paramspec.return.CallableType_": {"doc_hash": "0d9eeff302f383a75e0c4e1a403250febb603c10c5ae868fceaf31f01e486585"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.analyze_callable_type_TypeAnalyser.analyze_callable_type.return.ret_accept_self_": {"doc_hash": "8e32675daf0a3b866d4d06b31243464f10969538b2c13a241240611004774ec1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.analyze_callable_args_TypeAnalyser.analyze_callable_args.return.args_kinds_names": {"doc_hash": "2ee49fe0cd38d4e9dccdbb37616fd89a3b94958ddf1018ec98f344363efb90f7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.analyze_literal_type_TypeAnalyser.analyze_literal_type.return.UnionType_make_union_outp": {"doc_hash": "433dbfbcfa0b99627517081ffb8d750ac1949b29b136c48474afbfbbcc50868d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.analyze_literal_param_TypeAnalyser.analyze_literal_param.arg.get_proper_type_arg_": {"doc_hash": "9509ce8570ef4fbeba5ccfbf9c1bfb4502f10ba0b6c7dee8e75372bbb65a2f69"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.analyze_literal_param.if_isinstance_arg_AnyTyp_TypeAnalyser.analyze_literal_param.if_isinstance_arg_AnyTyp.else_.return.None": {"doc_hash": "603d1491487344922d4a0f1ab5e70d3764dbbaccdf1744e3f417bb3239a39cf3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.analyze_type_TypeAnalyser.tvar_scope_frame.self.tvar_scope_2.old_scope": {"doc_hash": "51b4df415555f956fbe2ed44835c4a4142714ba006b708efe8398d6d57d19c98"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.infer_type_variables_TypeAnalyser.infer_type_variables.return.list_zip_names_tvars_": {"doc_hash": "c77d47b6bd1ffa08030c5318eea5ef5eec76e8a1001cdefcf2f6d991e71e2922"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.bind_function_type_variables_TypeAnalyser.bind_function_type_variables.return.defs": {"doc_hash": "8699dcf41fcbdf993c95434745e4724e4b92d150c34e5edcf345c55301798002"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.is_defined_type_var_TypeAnalyser.anal_var_defs.return._self_anal_var_def_vd_fo": {"doc_hash": "9a046d821ea648c51598c09ebdbf49032f25cca55762981e316401c014f57acd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.named_type_with_normalized_str_TypeAnalyser.named_type_with_normalized_str.return.self_named_type_fully_qua": {"doc_hash": "f5d5e0088c1f406c1cbd561c88d2fed24c6b81ea27def5afe5a7b04732566392"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.named_type_MsgCallback.Callable_str_Context_D": {"doc_hash": "6dda05e4c2a398a7f45d87c8edf12896237652de25687f2f87b500f04fec02a3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_get_omitted_any_get_omitted_any.return.any_type": {"doc_hash": "54430819df3809fddbaacae5e51a3d71897c378d79d3aaf8e908ebda9839fddf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_fix_instance_fix_instance.t.invalid.True": {"doc_hash": "4d5a8da7573776ebb3f7f5056c3558032cfd18a403335281ac674a0bdf716c06"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_expand_type_alias_expand_type_alias.return.typ": {"doc_hash": "4c1e730739f727c78fbea2add7ba6ad2ba7c7ba6e6cd123df0d556c4c81077d5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_set_any_tvars_set_any_tvars.return.TypeAliasType_node_any_": {"doc_hash": "c54afbaf5ab13d3f1db36882f61d817853e35a8c0754bfbf59aff3795b2df7e0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_remove_dups_TypeVarLikeQuery._seems_like_callable.return.False": {"doc_hash": "a5b6ef09060232ceea76220737370c5f0740fa48905e0155562e5a99564207a0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeVarLikeQuery.visit_unbound_type_TypeVarLikeQuery.visit_callable_type.if_self_include_callables.else_.return._": {"doc_hash": "533fcf0f01c8249380bb7cea467407516b83ce1083f80daf99ed062e1ead9ca0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_check_for_explicit_any_CollectAllInnerTypesQuery.combine_lists_strategy.return.list_itertools_chain_from": {"doc_hash": "e31fd0b1667e962880beff4814481a277d823834887855dbc27ffe846f560fcd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_make_optional_type_make_optional_type.if_isinstance_t_NoneType.else_.return.UnionType_t_NoneType_": {"doc_hash": "657c10561536d2c704affed5a06c2d560f1d06232f58b321f3faf5f17077b343"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_fix_instance_types_": {"doc_hash": "aa3927857df3144ccfb325de0835acc987769347cafa25e5a841e022ef44a32f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py__Miscellaneous_type_ope_try_getting_instance_fallback.if_isinstance_typ_Instan.else_.return.None": {"doc_hash": "9d516396010e3ee699bd30de23d9b385dfb8024bdaac83113acdac96532959a9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_type_object_type_from_function_type_object_type_from_function.if_isinstance_signature_.else_.return.Overloaded_items_": {"doc_hash": "6549d92e57f800e56112fa949d437fc337dd878d6d361285c7f673a06d28e47b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_class_callable_class_callable.return.c": {"doc_hash": "8a862c60783b784f161fa513a029a6cd80db88d3b0ade77c41c46b1c078cf252"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_map_type_from_supertype_map_type_from_supertype.return.expand_type_by_instance_t": {"doc_hash": "87cc99f9297bab5d6ee82c117b54ebe2c6f72053aea5a3748b66261bc959b34b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_supported_self_type_F.TypeVar_F_bound_Functi": {"doc_hash": "d86c50ae0cafc23e9605a8b5376feedfa00228104b672c3d1b83959db23db699"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_bind_self_bind_self.return.cast_F_res_": {"doc_hash": "d3685d2e87512a9a5b795dd6acdc8dfd031d6874d7f93de7437b40d31d7a5512"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_erase_to_bound_callable_corresponding_argument.return.by_name_if_by_name_is_not": {"doc_hash": "d7b70e13140564f00d189bb32bf98cd15b5350b26c7f93da122699275d95d420"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_make_simplified_union_make_simplified_union.return.UnionType_make_union_simp": {"doc_hash": "884a66c9ca6ce48dc54a791168c65d628abd029aa3e75c9b61096b3d214fadf8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_get_type_special_method_bool_ret_type_true_only.if_not_t_can_be_true_.else_.return.new_t": {"doc_hash": "ab3233f8a2dee4562ec00e13248b2701df12f50555e5f866b651e280fa62e4f0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_false_only_false_only.if_not_t_can_be_false_.else_.return.new_t": {"doc_hash": "a4904a21e9f4546277f1edad096313764d53e3d2817bb4b3a13b1bbf86b1afeb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_true_or_false_erase_to_union_or_bound.if_typ_values_.else_.return.get_proper_type_typ_upper": {"doc_hash": "3e22d8938de895ec69ad7a4294dd567b24ba7067a18aa8c2d35c18bb55990def"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_function_type_function_type.if_func_type_.else_.if_isinstance_func_FuncI.else_.return.Overloaded_dummy_": {"doc_hash": "a87919365444a71b79504ef99f03f8da381e27666fe377880fb75bcf2b656429"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_callable_type_callable_type.return.CallableType_": {"doc_hash": "042aee9f77a85bba340d17d84246703becd0398e955dce9c95a12eee877ba768"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_try_getting_str_literals_try_getting_str_literals.return.try_getting_str_literals_": {"doc_hash": "593ee4cb8b68756f5211622e9913bfa35c8011a638545ae078dcf43f6276eeb0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_try_getting_str_literals_from_type_try_getting_str_literals_from_type.return.try_getting_literals_from": {"doc_hash": "baa581e5519080b42e2f5e6bdd8759b36310ecc13ca76954247e1728bed17ef8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_try_getting_int_literals_from_type_T.TypeVar_T_": {"doc_hash": "3a0aa8211fb974566367eb42c7c2b60b3aa18b8bcad8812ec365c19a9283e468"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_try_getting_literals_from_type_try_getting_literals_from_type.return.literals": {"doc_hash": "caed5a826e38a06a1d80537dea6219490c34d30931ed85617a1317acab8e6726"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_is_literal_type_like_get_enum_values.return._name_for_name_sym_in_ty": {"doc_hash": "ba4f91bdd3faaa284a910b0cf198cdc425803576253e097c957b07232c57f733"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_is_singleton_type_is_singleton_type.return._": {"doc_hash": "8889d0a084d98495778ec5d248d1b3c421575eac589453c704c1ba882aaef0c7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_try_expanding_enum_to_union_try_expanding_enum_to_union.if_isinstance_typ_UnionT.else_.return.typ": {"doc_hash": "de43b94847ce756d5eb2464a2891a5507e19aee12f3ece30126266e29167cd72"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_coerce_to_literal_coerce_to_literal.return.original_type": {"doc_hash": "aa36975055b0852d6202fc1daa8dba7a92d506157a941fd1dff574dc210ed12b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_get_type_vars_TypeVarExtractor.visit_type_var.return._t_": {"doc_hash": "af320bdabfb7d3a9856374638647086d266404171998578ac8b74c970af1e4f2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_custom_special_method_": {"doc_hash": "32362228d434c7241e896663ec6793a4ad6a3d3d8274154abe3633758771b2d8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py__Classes_for_representi__dummy.object_": {"doc_hash": "7cc8c62e4b981c5be24dccfc3acd79c43a6c8338c011c8de3f4384051d732a74"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py__type_Final_Any__TypeOfAny.None_22": {"doc_hash": "2ed19e6978011b88f4b7de1d09df7db179ef5063bdbd3ad0c65bd97ebf434ae8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_deserialize_type_Type.deserialize.raise_NotImplementedError": {"doc_hash": "432c6d0df4087a0f9ebf671fc7dd96f0e73157fcfb23a0e9dce87badbaafcbe5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypeAliasType_TypeAliasType.__init__.super___init___line_co": {"doc_hash": "c386d7ebfe2e34e3dab05abb54240e4d0a1cf15588cb913c82aaab4bbf3bef72"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypeAliasType._expand_once_TypeAliasType._expand_once.return.replace_alias_tvars_self_": {"doc_hash": "23976494172a8d6e92c6775422721551cc544dea4a92e4779cce67eb901f3305"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypeAliasType._partial_expansion_TypeAliasType.copy_modified.return.TypeAliasType_": {"doc_hash": "37df3086c042c3e2482435689c3f8613e98c718ccc72d59b83736f8d21c4818e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypeVarLikeDef_TypeVarLikeDef.deserialize.raise_NotImplementedError": {"doc_hash": "74e70ac6f8c508744fcbf62d5b83bfb305cbf8ca3e20520c0c450b9db0503ce3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypeVarDef_TypeVarDef.deserialize.return.TypeVarDef_data_name_": {"doc_hash": "f82d8a7cda21a2135826e9ebb3de9d7fed97ac35427208dc67703b74d977e940"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_ParamSpecDef_ParamSpecDef.deserialize.return.ParamSpecDef_": {"doc_hash": "f9606fabc94aebacc410475386564c5986856342778b24962c72e8b8abbf9e4d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_UnboundType_UnboundType.deserialize.return.UnboundType_data_name_": {"doc_hash": "5c04a5d43f73ae94a6a05f251c6f7738f095eadecd5ce51fd3e4397214c91122"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_CallableArgument_CallableArgument.serialize.assert_False_Synthetic_": {"doc_hash": "77a8b2e242552fc8ae453c7a43ade4f0b81d69e475be46457e7067bcbb2604a2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypeList_TypeList.serialize.assert_False_Synthetic_": {"doc_hash": "6e0adea9822d79f342472616a34d82b538f3ca0261125e880ddd183ed0f9ad07"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_AnyType_AnyType.accept.return.visitor_visit_any_self_": {"doc_hash": "d5d0519ac54e8f5c56552dff87bc8fa65bf3d266fbfb39f683fcaea5db3fe050"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_AnyType.copy_modified_AnyType.copy_modified.return.AnyType_type_of_any_type_": {"doc_hash": "69421613f15de6dcbeee57ef94df1b140a4e34d34e02df22d7780532b71411ec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_AnyType.__hash___AnyType.deserialize.return.AnyType_data_type_of_any": {"doc_hash": "d041c49d34625dab3f41c8c3fa643eabcfe7506b8b3960596d366bb63bd9c49a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_UninhabitedType_UninhabitedType.deserialize.return.UninhabitedType_is_noretu": {"doc_hash": "5efa250bb75fd7f854fef60774513ad3b82a635300cc62f4746a80db031d314a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_NoneType_NoneType.deserialize.return.NoneType_": {"doc_hash": "b33c2fb2045e5591e77c4a95e143c880c08eb1dce955fac78b8d3417458db56e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py__NoneType_used_to_be_cal_NOT_READY.mypy_nodes_FakeInfo_De_s": {"doc_hash": "f766cec8d3ae3f9d34d5abf8d469a9729c479d38ddd3850e718360cc2c89cfa8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_None_43_Instance.__eq__.return._self_type_other_type": {"doc_hash": "df9b24577bd2c2c1db2da2fab853f591ef0928620d7794fa8ebac774138b63f8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_Instance.serialize_Instance.serialize.return.data": {"doc_hash": "0081d61cfc26a43b4ff7e98e41f878d38f7a4cb6f8448cc34a3eac93de3c07ee"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_Instance.deserialize_Instance.deserialize.return.inst": {"doc_hash": "905139bb39c4fc2ef513373a9ebe99fd5ab36051033e5e462c58bb6f818fbc0f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_Instance.copy_modified_Instance.has_readable_member.return.self_type_has_readable_me": {"doc_hash": "58a3ed472171e337a3d0b188c441c0f467cbe8a1705b56257216b1f2d538668d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypeVarType_TypeVarType.deserialize.return.TypeVarType_tvdef_": {"doc_hash": "65319aeb789397b70b5bd1b5d8f4fbdf1d4c84f41829d0a2544d7b83f2b8fe2b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_FunctionLike_FormalArgument.NamedTuple_FormalArgumen": {"doc_hash": "bc70f3eb53a7d2ca1d458cfffd520b1d6d1ce93dfb14ac1b7f901b847e132ede"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_CallableType_CallableType.__slots__._arg_types_Types_of": {"doc_hash": "e2ae323484816ee535b2641fc4140d2b967e2af6b3dfb52e6f9944ac2e0167bb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_CallableType.copy_modified_CallableType.copy_modified.return.CallableType_": {"doc_hash": "3e6d4692c2ab912b4ab419a35f645dd86d4fa8890173549e8e01993973beb4e0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_CallableType.var_arg_CallableType.max_possible_positional_args.return.len_kind_not_in_blacklis": {"doc_hash": "cf59054cd6366d214fe8fbd267813f7b141c0ab9607eb0e42511173b45effb9e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_CallableType.formal_arguments_CallableType.formal_arguments.for_i_in_range_len_self_a.yield_FormalArgument_": {"doc_hash": "7373e6551a99dbe13e6cf0a6f723f2ef5f0a5802fc9d9ef29117eeb07556b4ba"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_CallableType.argument_by_name_CallableType.argument_by_name.return.self_try_synthesizing_arg": {"doc_hash": "e964313288d9a6e33603b2e74e96bebe9cb3c52e0d0fa80de42047407390e27e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_CallableType.argument_by_position_CallableType.argument_by_position.if_kind_in_ARG_POS_ARG_.else_.return.self_try_synthesizing_arg": {"doc_hash": "8ad422d77e36109aea38d882dbcf8daf9615e6626ca3477030c5289f9c4c7b95"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_CallableType.try_synthesizing_arg_from_kwarg_CallableType.__hash__.return.hash_self_ret_type_self": {"doc_hash": "d0fa6ff36c76e9ae59c56e05c43f5548b5262f1237d62ed8e894bb6366356d5e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_CallableType.__eq___CallableType.__eq__.if_isinstance_other_Call.else_.return.NotImplemented": {"doc_hash": "486e33b973f56c51f31cb984bd93cdbe0e77531309cd3dae833c2ed7b42a7f8e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_CallableType.serialize_CallableType.serialize.return._class_CallableType_": {"doc_hash": "22d28c61ae7aaba549fd3d2f15a701c705c621ebd48ffe512e257fbe09b0491d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_CallableType.deserialize_CallableType.deserialize.return.CallableType_deserialize": {"doc_hash": "a3698ca48842f45f99c200573fc9a14a29c623d5af93090066ad8c05f35689a3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_Overloaded_Overloaded.deserialize.return.Overloaded_CallableType_": {"doc_hash": "42acef3ba9ab33f5fddc0bd8cb71a23f4b77b45445ae7284e822cebf878228ff"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TupleType_TupleType.slice.return.TupleType_self_items_begi": {"doc_hash": "6678af9854999b4c179a17a78eccafa7b7d76c4bc06c0de4ede244cae53b3fb9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypedDictType_TypedDictType.as_anonymous.return.self_fallback_type_typedd": {"doc_hash": "c332178d00dc847537481990c8868d96be0d07abebed38d69a5db93ba26ac33f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypedDictType.copy_modified_TypedDictType.copy_modified.return.TypedDictType_items_requ": {"doc_hash": "85669d48002512f30742a2eb6c3a61f6315fcb193e324a4e50dfcde2983d74d4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypedDictType.create_anonymous_fallback_TypedDictType.zip.for_item_name_left_item.if_right_item_type_is_not.yield_item_name_left_it": {"doc_hash": "ebebfc65330a864e887610ac5dff5ec547c186ffaf9fe52e87cd7419b9cf7691"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypedDictType.zipall_TypedDictType.zipall.for_item_name_right_ite.yield_item_name_None_r": {"doc_hash": "19974fba078577f43ae12575ee439b8b35eb3eae7741062f2f6209123a2c8210"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_RawExpressionType_RawExpressionType.__eq__.if_isinstance_other_RawE.else_.return.NotImplemented": {"doc_hash": "f079ca09fe6da0b7a468202526e18467ad00c3aa36d569709a6fc5f3d4a8f607"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_LiteralType_LiteralType.is_enum_literal.return.self_fallback_type_is_enu": {"doc_hash": "789f1fd896a701eb90989d714855788f2941aac30ba85f581dd32b913ee15532"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_LiteralType.value_repr_LiteralType.deserialize.return.LiteralType_": {"doc_hash": "06b80dec0b8fb612b173e6ee8e4cfecffd84fcbe5110f6f1a2a069ea21ac8b4f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_StarType_StarType.serialize.assert_False_Synthetic_": {"doc_hash": "272ba9b9b7973c9a4a88181d2c1d76e15b0c8e625382b5451bbe99b7803d974d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_UnionType_UnionType.accept.return.visitor_visit_union_type_": {"doc_hash": "eb0bd1f097ee9cd9705d2ec7a3c386b35bd2067a33d9166226f8c03699611d5e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_UnionType.has_readable_member_UnionType.has_readable_member.return.all_isinstance_x_UnionT": {"doc_hash": "fc3130c531ea9e707162feb7e31e1fe4be4c39a0fef80a06df0d37dfab2faa2e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_UnionType.relevant_items_UnionType.deserialize.return.UnionType_deserialize_ty": {"doc_hash": "8ad83d134448c772af6cbe1a0ac1c09fb897d0503415d6955343a8d8e470b174"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_PartialType_PartialType.accept.return.visitor_visit_partial_typ": {"doc_hash": "42b8cf5023343ae257d3b634571157cc3951da00f2117f6f7d2d417b5ed6fe68"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_EllipsisType_EllipsisType.serialize.assert_False_Synthetic_": {"doc_hash": "134e5d07517b4bfc0e662a6d7fc11e7405112152d73ad73c88b9b24f7a8d7661"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypeType_TypeType.deserialize.return.TypeType_make_normalized_": {"doc_hash": "98023a30a971150cbd55354b48973f074f24e7ac51644848f75f87bb9676e8da"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_PlaceholderType_PlaceholderType.serialize.assert_False_Internal_e": {"doc_hash": "a72033c936a8cc772072b70e4b18a0b5be6a4930670c186bada6706fe6f9d70b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_get_proper_type_get_proper_type_3.return.typ": {"doc_hash": "6ae002b656bbae9a97c182c8325e0d403fdccdc38d577edd23f5945351350040"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_get_proper_types_from_mypy_type_visitor_im": {"doc_hash": "8f0cc82fb168fd74d456cd155f0c1b41f9fa1dfc1db6c721a242593cd1818ce3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypeStrVisitor_TypeStrVisitor.visit_deleted_type.if_t_source_is_None_.else_.return._Deleted_format_t": {"doc_hash": "10d7ae6061697415581ca22ec25540e4499e3e0a679fda1231e340c42f36f77e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypeStrVisitor.visit_instance_TypeStrVisitor.visit_type_var.return.s": {"doc_hash": "19d1b30dd20097faae36db62939db21b94a19441537ae7366136452863f2aff9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypeStrVisitor.visit_callable_type_TypeStrVisitor.visit_callable_type.return._def_format_s_": {"doc_hash": "9834323dff33ee5a4b3432c9de1cc2b8041d00fd2883de1264657660703193d2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypeStrVisitor.visit_overloaded_TypeStrVisitor.visit_tuple_type.return._Tuple_format_s_": {"doc_hash": "cd678011bf3534c89242b84408378437fb8bf17336554444476f88bf498937c1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypeStrVisitor.visit_typeddict_type_TypeStrVisitor.visit_typeddict_type.return._TypedDict_format_": {"doc_hash": "8b08190d10a6cc97cb79c7a70f33a23feb85fab91b7ab19d3bb85af7f1a3439c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypeStrVisitor.visit_raw_expression_type_TypeStrVisitor.list_str.return._join_res_": {"doc_hash": "a39660200253cbcb9cbe2e2e02b9aeb10108bdf8985822d319c17fc9e0d64957"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_UnrollAliasVisitor_UnrollAliasVisitor.visit_type_alias_type.return.result": {"doc_hash": "e493dfb9947f2caa06c34a87a9cf57ce67fe1038996ff2f89278e0abb88a3694"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_strip_type_copy_type.return.copy_copy_t_": {"doc_hash": "beabcc5001514ee1b2a5241ca1cdd4e7223dbcf0dbd36003a2660a6f1e443e99"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_InstantiateAliasVisitor_InstantiateAliasVisitor.visit_type_var.return.typ": {"doc_hash": "61a7c0c50b3492ab03f28257070466deba8aec2f9be036ddd030f031497ed43f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_replace_alias_tvars_has_type_vars.return.typ_accept_HasTypeVars_": {"doc_hash": "12c5ecbc540b3af659ca3c039d6ae4964d255bdaed798a699045c93dbc9b9b22"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_flatten_nested_unions_flatten_nested_unions.return.flat_items": {"doc_hash": "1460148a77a4299763f26970323743f16ffc25c007bb27fbadf7f779b3158043"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_union_items_": {"doc_hash": "680c20138da8f4879b353c24e09af770d70a07d1af8458080a6ed4df3f7d3ee8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typestate.py___SubtypeCache.Dict_TypeInfo_Dict_Subty": {"doc_hash": "45b9cdc193cf2221cfdc79ad4c1a1e45db39b92eb0fccef9d77ff231039dcc3a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typestate.py_TypeState_TypeState._type_Final_Set_TypeInf": {"doc_hash": "9af88d0294dc7ab21373dbfe9a16d303a936a786a2ba2e2ff7cddea083aeb19e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typestate.py_TypeState._The_two_attributes_belo_TypeState.record_protocol_subtype_check.TypeState__checked_agains": {"doc_hash": "2a8a3462c95e6a6e92b1304a75102395cba96e0a7936f33ebe19c11ec63d397d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typestate.py_TypeState._snapshot_protocol_deps_TypeState._snapshot_protocol_deps.return.deps": {"doc_hash": "a56d7ae293d470729a736e9e4037ee0bc119721723a3597e4ca760f0b4bfc689"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typestate.py_TypeState.update_protocol_deps_": {"doc_hash": "d201add9ea23de1cac42289721da8d4b71d6f584cb5cf281e3ef1c5ccafa3514"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typetraverser.py_from_typing_import_Iterab_from_mypy_types_import_": {"doc_hash": "5d1c2ce9f19dc54272f0027f09563a29505b437d88d7ab9227636932d4dff2d6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typetraverser.py_TypeTraverserVisitor_": {"doc_hash": "d5b55748227b7accdd2fc83c1d6484ec660b35d817fd49bbccad456d4ec4ca44"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typevars.py_from_typing_import_Union__fill_typevars.return.typ_tuple_type_copy_modif": {"doc_hash": "323bf903f0c0c5955bab16665fa9b77271dd723c32db93311572a30d874fc9f1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typevars.py_fill_typevars_with_any_": {"doc_hash": "b3f828147459c3af9fafc297827d6d8455c5a880ceb555f8eab7a3f0f1f6d491"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py__Utility_functions_with_short_type.return.t_split_1_rstrip_": {"doc_hash": "43491a5828614960387ca0e3af29dcc80685b326729b76de3a16458c9e009600"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_find_python_encoding_find_python_encoding.if_result_.else_.return.default_encoding_1": {"doc_hash": "4864af6aca0b92125d809e26392b4a6f5684f72878914b989ff7a9a6d435bbfb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_DecodeError_read_py_file.try_.else_.return.source_lines": {"doc_hash": "5a4be07847ef77018bda2fdf0f73efb4b0ba6e459fbdcfeba29e4363e544eafb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_trim_source_line_trim_source_line.return._line_max_len_": {"doc_hash": "b58afa6fe9a428bfd8519ac74287e47e402a2b3f33f22f2447a5b512e6691b2b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_get_mypy_comments_ERROR_TEMPLATE._xml_version_1_0_en": {"doc_hash": "c4cc3a14c98d37e65730c9a5a27b20a3883cdcfafb1043977c6e6aceabb9af9c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_IdMapper_IdMapper.id.return.self_id_map_o_": {"doc_hash": "86576b914224b9b9ef5f34e91beac7d0999c1832a5f307fa0fa1f54a7c80bf3c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_get_prefix_correct_relative_import.return.cur_mod_id_targ": {"doc_hash": "ce8d761137fb7d82fbc5e9b5bdc3a5c53300ad59bc36697f759d8efbcba9bc2d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_fields_cache_get_class_descriptors.return.fields_cache_cls_": {"doc_hash": "c5e3ef06e3417c52409975ec5ccb972559a64ea9804ecbbc67772dd38bbd8725"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_replace_object_state_replace_object_state.for_attr_in_get_class_des.try_.except_AttributeError_.pass": {"doc_hash": "f7e38ba82ffbdbd7d7962a69b13835d9e9b332f28048a3dae52ead2e93a13a83"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_is_sub_path_unmangle.return.name_rstrip_": {"doc_hash": "7847844fc69609af9766f18f79d2a178dc5d41fc7cadb2aa32ac37cb68dc1a48"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_get_unique_redefinition_name_get_unique_redefinition_name.return.r_name_str_i_": {"doc_hash": "7e3f9348598abe00a7a02a50cc4eb3548597de20da82fcb83bc7176e9f4c0202"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_check_python_version_check_python_version.if_sys_version_info_3_.sys_exit_Running_name_": {"doc_hash": "6a3aa562e1dbd6970d400d947feefea32bb0e48f07cc39dc7834a93b310fbdbc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_soft_wrap_soft_wrap.return.padding_join_lines_": {"doc_hash": "1165122aabf97de8d4a49ad3b5a372e42ca1a6f70fdae5fd849227e4fab9ef11"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_hash_digest_parse_gray_color.return.gray": {"doc_hash": "f282df8e55a3b13b79bd7619411238750289a5e02ea49d1aa8d3c0b6b91b2a17"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_FancyFormatter_FancyFormatter.__init__.if_not_self_dummy_term_.self.colors._red_self_RED_green_": {"doc_hash": "b25466b2255ddbe2ff5d9ac2cd60b37dfecd1b55e3672df1d47ba674d4ba8963"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_FancyFormatter.initialize_win_colors_FancyFormatter.initialize_win_colors.return.False": {"doc_hash": "6229e9e8050832be710c50d9ba899c41573c0b7f029a1fc1cac5f9520b92ff61"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_FancyFormatter.initialize_unix_colors_FancyFormatter.initialize_unix_colors.return.True": {"doc_hash": "91be81529d6bdc957982463efe5975e7ab55c551e36b48282e52cccafa92929a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_FancyFormatter.style_FancyFormatter.style.return.start_self_colors_color": {"doc_hash": "bebe4e02e6137baa7ddd5dfff0d4f9193f17ac9418346c1b80689280fc3b488c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_FancyFormatter.fit_in_terminal_FancyFormatter.fit_in_terminal.return.new_messages": {"doc_hash": "ef36c44671f26597c579ce66e5929275160802299a0e45496f60babfea78f426"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_FancyFormatter.colorize_FancyFormatter.colorize.if_error_in_error_.else_.return.error": {"doc_hash": "a01174f0e3ac365280e3b13a666c9202ef9197c8d1354248fc21d86dc35b14cd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_FancyFormatter.highlight_quote_groups_FancyFormatter.highlight_quote_groups.return.out": {"doc_hash": "ef05faa0a17333cf089b0b489f603fcec89c6a2411f0c050097d6591bfb3ac70"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_FancyFormatter.underline_link_FancyFormatter.format_success.return.self_style_msg_green_": {"doc_hash": "10c08f5c69d02dd2d4b7cdc08cd0dee6992905f888c3ab7879778485da9f3a79"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/version.py_os_": {"doc_hash": "b9e76b34535f0a1b6a125855f4bd8b7106ae4df5166d9736722fe751db309f01"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/visitor.py__Generic_abstract_synta_ExpressionVisitor.visit_dictionary_comprehension.pass": {"doc_hash": "a7fa642d7fcf362c4b864fa82f05d19dc3a2ff94ddc7b4d38e2c913190efa4b5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/visitor.py_ExpressionVisitor.visit_generator_expr_ExpressionVisitor.visit_temp_node.pass": {"doc_hash": "962b3954f3ed3d1bab98922f35e6503d2ce176a837a787067085a5b20745b6f0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/visitor.py_StatementVisitor_StatementVisitor.visit_exec_stmt.pass": {"doc_hash": "659e5cb5ee760f45a3b633fd94e2b084517d06f6051684204fed2770c5e26ce2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py_CFG_CFG.__str__.return._n_join_lines_": {"doc_hash": "800dc6733e60774a7a1f5de88e6cab9062ea81bd65eddbdfb745025bbad528f4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py_get_cfg_get_cfg.return.CFG_succ_map_pred_map_e": {"doc_hash": "3b8c3cf4789d330cf0aa6c7203587b128ae78a998377969e57aec0cf309c9c69"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py_get_real_target_cleanup_cfg.while_changed_.for_i_block_in_enumerate.if_i_0_or_cfg_pred_blo.else_.changed.True": {"doc_hash": "16cb06da59f9adeceda0afbdae941b8633affbef880b5946d4cf5dabc61141d2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py_T_GenAndKill.Tuple_Set_Value_Set_Val": {"doc_hash": "db34fea0235b530bcbd7d3717202b5f1728b6a43fe084b9c0a00c4d53106827f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py_DefinedVisitor_DefinedVisitor.visit_set_mem.return.set_set_": {"doc_hash": "ab25950ee2b19e5baa6ca6633936d5ac424ab935dc369ecc33b24be565a6c3fa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py_analyze_maybe_defined_regs_analyze_maybe_defined_regs.return.run_analysis_blocks_block": {"doc_hash": "4394faa71f5ac2a198fb88c2f77f7dd537e966cc69ee5ffe4ea4577fd0f4b166"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py_analyze_must_defined_regs_analyze_must_defined_regs.return.run_analysis_blocks_block": {"doc_hash": "fac85232aebdde32d5a4358683586fd692841f09cb86386705db1ae0bd677b98"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py_BorrowedArgumentsVisitor_BorrowedArgumentsVisitor.visit_set_mem.return.set_set_": {"doc_hash": "dc04270ae893122a49a8e4be4de923727dfa0fc4c3ef3c8748c7b60d40304cd5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py_analyze_borrowed_arguments_analyze_borrowed_arguments.return.run_analysis_blocks_block": {"doc_hash": "d29a28e972a1c40d13e9e19b77fe2ffc6bcedf8445982726eb156934b1ed28c2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py_UndefinedVisitor_UndefinedVisitor.visit_set_mem.return.set_set_": {"doc_hash": "1ef6a73fea34cbb9facfcb73e08c1ee7c9d52dc015be614a621c8bfe4c996ea8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py_analyze_live_regs_MAYBE_ANALYSIS.1": {"doc_hash": "7ab39cc831b03b7f0da1c47d461d7c638fe060815d8c199f107b0f4aa65e17c1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py__TODO_the_return_type_of_run_analysis.None_8": {"doc_hash": "c80170b4a5adfa1843231de0c2f5221f7f08962f22ca3ffdbd393e8d2621e38e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py_run_analysis.None_5_": {"doc_hash": "bb84d3834c27aa6ecdb193fbea5e108fd6d658872e1e28b8a78e6a1b5219630b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/build.py__Support_for_building_e_get_extension.return.Extension": {"doc_hash": "2d76a321d12af1f198046fbb4054edd241b1e744c5090b308cdf114bd246d042"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/build.py_setup_mypycify_vars_fail.sys_exit_message_": {"doc_hash": "c1f7823e35ca598c5a057b1ac1f3e9b9d49001c3177255cb128476d9c1884d72"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/build.py_get_mypy_config_get_mypy_config.return.mypyc_sources_all_source": {"doc_hash": "ee998cb53976ced8ff27411cc9b1a2f295fa95e9e856a34f4c72ddebeb216082"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/build.py_generate_c_extension_shim_generate_c_extension_shim.return.cpath": {"doc_hash": "c98856356fef95197320ee8e54da0614c6d199121ce3ef7d20fe55890d92dd12"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/build.py_group_name_include_dir.return.os_path_join_os_path_absp": {"doc_hash": "5e9677c13b1e16a9e05c0483be5c12e47bfab9764dae19bc1f63767718369878"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/build.py_generate_c_generate_c.return.ctext_n_join_format_m": {"doc_hash": "352f515b7a36d94d342f4123a7eb21062beb5d31aae708a2bedde9fd8e4eb676"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/build.py_build_using_shared_lib_build_using_shared_lib.return.extensions": {"doc_hash": "50afaef37e46024ce178f45aed29f8fd8d662a7bd8fc4f025d893c43a9bed909"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/build.py_build_single_module_build_single_module.return._get_extension_": {"doc_hash": "704a953937e894eabebd22952677eeab28bf9c4348194a3cf5b799e6ae772e29"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/build.py_write_file_write_file.if_old_contents_encode.os_utime_path_times_new": {"doc_hash": "c5f8e6dd3b67f6afea8fcf675036f4faf82f2eaa3dd6f71b006fe8c3d5e290fa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/build.py_construct_groups_construct_groups.return.groups": {"doc_hash": "dac0ae81c29e45a5b3e062266bc28fae3e6977ce0811820420875886e3f4b4eb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/build.py_get_header_deps_get_header_deps.return.sorted_headers_": {"doc_hash": "c6aa8fbababd4268269f9345846de8f03657dc3a1f7a6925e0d16c66b8bd3132"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/build.py_mypyc_build_mypyc_build.return.groups_group_cfilenames": {"doc_hash": "231483f23fa42dff0aab4fbbfc2a91a4b5309b4956605e0e71fa501f13c0bad5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/build.py_mypycify_mypycify._type_List_str_": {"doc_hash": "8d6dcc70f2f3bdda38c4625cafb1e0cd944d698efb91b61bf8ce08e23b9b5dea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/build.py_mypycify.if_compiler_compiler_type_": {"doc_hash": "a1e268dfa861ef8f53b4147d8b3bac1a442499142f2b7ad106abf9c4d94795aa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/cstring.py__Encode_valid_C_string__": {"doc_hash": "ce829684e1dd6eaebbe330ac252d37307db9a34166509c268884ee8253c57295"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_HeaderDeclaration_HeaderDeclaration.__init__.self.needs_export.needs_export": {"doc_hash": "e90b02bc6995d3adea3515d992c4e9de6abe15b5f468d310554d32e723606204"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter_Emitter.new_label.return.___LL_d_self_context_t": {"doc_hash": "18483815a2d16cd44c8de9a063ebe4497d1e04dcfb2a8f57ac1c710eac0eb4ad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.get_module_group_prefix_Emitter.get_module_group_prefix.if_target_group_name_and_.else_.return._": {"doc_hash": "bf08cd3a35592d42b583960664254b9b5f34c46b692b9740a08982cdda260773"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.get_group_prefix_Emitter.static_name.return._format_star_ma": {"doc_hash": "165a7e8717552d4c2dd16b1f46089fa71b612f9c39522b89a346e97254fc54ee"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.type_struct_name_Emitter.native_function_name.return._format_NATIVE_PREF": {"doc_hash": "f07a6291951a5aa0e32575b45ccf4030092006a14b1ad640c651ce9d365357e7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.tuple_c_declaration_Emitter.tuple_c_declaration.return.result": {"doc_hash": "0be4dbe4e770e62eb9f0f930bf818c651d27a5fa5b378fab5bde54429f4ef367"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.tuple_undefined_check_cond_Emitter.tuple_undefined_check_cond.if_isinstance_item_type_.else_.return._f0_format_": {"doc_hash": "dea6d1fc2c3f1966c051ff0f1c79d132652b2fdb4284a7b3d9a3240d67e8f889"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.tuple_undefined_value_Emitter.tuple_undefined_value_helper.return.res_1_": {"doc_hash": "735cf387d0a0203baa932f1185ebc12e2824b21dda499a5e9159fe6282015765"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter._Higher_level_operations_Emitter.declare_tuple_struct.if_tuple_type_struct_name.self_context_declarations": {"doc_hash": "6d9cca3d9f279e160e6914ef490b11daee2bb10bf1d4a09d085b4b23cc1f70bb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.emit_inc_ref_Emitter.emit_inc_ref._Otherwise_assume_it_s_a": {"doc_hash": "1a7c7bc7f2b3e6ee8bd88cd0ba052636a6b44019d992b1dd6569b6952c51d511"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.emit_dec_ref_Emitter.pretty_name.return.str_typ_": {"doc_hash": "578bebb620d5d66dc798cf4bfde08bec4ad338e2a78bf9a97d12e9289f81f40b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.emit_cast_Emitter.emit_cast._TODO_Verify_refcount_h": {"doc_hash": "f72de9d87a871b69d9c4e372e833221b3020372927c54eed022f2abbc4842da6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.emit_cast.if_is_list_rprimitive_ty_Emitter.emit_cast.if_is_list_rprimitive_ty.else_.assert_False_Cast_not_i": {"doc_hash": "780720078e05114a4db4011844b44c9b6566c873d568c9d0cbdbe90db9f699c3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.emit_union_cast_Emitter.emit_union_cast.self_emit_label_good_labe": {"doc_hash": "29f93918207e0a11206d80b455dfd0500e8b250bc186979474812bda2c8e1ff8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.emit_tuple_cast_Emitter.emit_tuple_cast.self_emit_label_out_label": {"doc_hash": "70927d8d41829fbe369768817cb20142050c7da7beb01e28794921fa8efe6848"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.emit_arg_check_Emitter.emit_unbox.if_custom_failure_is_not_.else_.failure._raise_exc_": {"doc_hash": "e57240081db711991bac75eb46792a75185f660939e3c8982a6adba8dbfd55b3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.emit_unbox.if_is_int_rprimitive_typ__Emitter.emit_unbox.if_is_int_rprimitive_typ_.else_.assert_False_Unboxing_n": {"doc_hash": "5990cd0d2a244bc8ad2e63dea21123089efa770ef281d152bb8c64d0b74842f8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.emit_box_Emitter.emit_box.if_is_int_rprimitive_typ_.else_.self_emit_line_": {"doc_hash": "4abc41b93c28ccda7b3a0125722c606d5e7a391129daab4e1dee9fd948d62980"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.emit_error_check_Emitter.emit_error_check.self_emit_lines_failure_": {"doc_hash": "b89e4e3b811d052592b5c54265f421c4d7b7f72214a81e62adce530a263831c4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.emit_gc_visit_Emitter.emit_gc_visit.if_not_rtype_is_refcounte.else_.assert_False_emit_gc_vi": {"doc_hash": "be4128810e228a6954889cf2a350fab06643bced289da704221dd78010cdccd6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.emit_gc_clear_": {"doc_hash": "08e47e3917c22986c7593926671c4208d7d3e7e3ff37db456b31a20ddf26798d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_slots_generate_slots.return.fields": {"doc_hash": "9e32f9f468fc99c806d59336d065e91c8c7a57492a37e510daa10c5d3c30765d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_class_type_decl_generate_class_type_decl.if_generate_full_.context_declarations_emit": {"doc_hash": "8ad51a31e9febbe74c1d17e91ae4aee3cafa4af1f760156dda20a833ab218e23"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_class_generate_class._XXX_there_is_no_reason": {"doc_hash": "834516c27b9af0389f6127c308accdd6c2e7a23782cd743773f16423e4605155"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_getter_name_generate_object_struct.emitter_context_declarati": {"doc_hash": "fa6bcb4b183e7fdf08a54a114a8508cf8eead27800369a3773d10cbd95b907b3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_vtables_generate_vtables.return.vtable_name_if_not_subtab": {"doc_hash": "cc934ef42b4be24863a6719529837777cb30b2362fffee0141a33c60cdf0b00e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_offset_table_generate_offset_table.emitter_emit_line_memcpy": {"doc_hash": "570b9fd6cb108f5ff69630dcd7ff9c1e925532c45a242fdab9366cea6daa85f0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_vtable_generate_vtable.emitter_emit_line_memcpy": {"doc_hash": "17efb98b1a4fc9b41ee4bcca5b6c35553c3adad71414b4f0a1d3cc030c3b8673"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_setup_for_class_generate_setup_for_class.None_8": {"doc_hash": "c3ec205f166a9aacad1ebadc1fe9fc300bf455aba982b78ef957b1c59932eacb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_constructor_for_class_generate_constructor_for_class.None_6": {"doc_hash": "b0ec71d3cb2d62eed0f0208c8208da585e8c2f6ccd2c67d50c58c94ce3b22703"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_init_for_class_generate_init_for_class.return.func_name": {"doc_hash": "b99310692928dc3ad1dd910f58d1eae2945c70d91a01ccb4509bf0ef228c4652"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_new_for_class_generate_new_for_class.None_4": {"doc_hash": "632b05b578197edc5b8c4eb31770caabf3becb928eb2d47c4b3ab1ad1adf064a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_new_for_trait_generate_new_for_trait.None_9": {"doc_hash": "e6239662cc353332aed9696180305964b60712a974e583e47ef995b35c9a51c7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_traverse_for_class_generate_traverse_for_class.None_4": {"doc_hash": "39ebd9c19c103dfbd32f7e8e9ccef16d06ae18432591779e0dc7696a2fc4ef6d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_clear_for_class_generate_clear_for_class.None_4": {"doc_hash": "04e89d8db67d112efedac243f6e6ed3d19a84077b3f99a8114e7b5670e1f1d96"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_methods_table_generate_methods_table.emitter_emit_line_": {"doc_hash": "0a259f4ec5646975eccf60f257127ea846990dc4e826302787f87ec0d9233bee"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_side_table_for_class_generate_side_table_for_class.return.name": {"doc_hash": "5c0a92a3c2092cc3268ef5c2cabcf41ef4b5010c53d068d77d376d8fb4bb723f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_getseter_declarations_generate_getseter_declarations.for_prop_in_cl_properties.if_cl_properties_prop_1_.emitter_emit_line_": {"doc_hash": "3123c7b6b00a67a69e500da5fb361270597a1cc46c9c97d12d81e06a454f1aab"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_getseters_table_generate_getseters_table.emitter_emit_line_": {"doc_hash": "e65fcc63026f54620d174a312b5f599f697a6f6fbc22116e252a8e7c2b6b94c3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_getseters_generate_getseters.for_prop_getter_setter.if_setter_.generate_property_setter_": {"doc_hash": "bc7742746f2a9530e95d26b876bbb70cf8cd7c44ddc0d811db8d719cab75cec1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_getter_generate_getter.None_11": {"doc_hash": "20abed76b09e50b215f183f79e4ce0f2b85a79ce43d12ecd173ddb6341bce8ae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_setter_generate_setter.None_9": {"doc_hash": "62a6b22a0460e3939ffc514ee06fa0e8533d55b309898166d0a1af455f0ca176"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_readonly_getter_generate_readonly_getter.None_3": {"doc_hash": "cfa0c44225dfe6b4dbf86685354467f02c4951ffd79f1a03e2e13e4a3ade8f69"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_property_setter_": {"doc_hash": "ef38fe0320a32e239493fff7eb868a09a95ccf231e6d43919d684ae456ae8e75"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py__Code_generation_for_na_native_function_header.return._ret_type_name_args_": {"doc_hash": "902c6d3c65e29b3250e4318ef26a5c160ae4aaa722937e4b590a705af258eb2d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_generate_native_function_generate_native_function.None_4": {"doc_hash": "804fc071052c28efe71f5da1fe867e2fb96a2ad57de540e028b5da85e9f21e3b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.get_attr_expr_FunctionEmitterVisitor.get_attr_expr.if_decl_cl_is_trait_and_o.else_.return._format_": {"doc_hash": "8c967f9e5373afd945a716aa8091c66c8aef2170b69f7aacbee73309962bd51e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.visit_get_attr_FunctionEmitterVisitor.visit_get_attr.if_cl_get_method_op_attr_.else_.if_attr_rtype_is_refcount.self_emitter_emit_line_": {"doc_hash": "afeaa32695c952323e1bc70247f8679b3e213aee1fc2c84f97ad2937b41e7095"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.visit_set_attr_FunctionEmitterVisitor.visit_set_attr.if_cl_get_method_op_attr_.else_.self_emitter_emit_lines_": {"doc_hash": "7bf4d7cb58de610f6c22195e92cdaee866557072760e2ef9ee8ffecb332d180f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.PREFIX_MAP_FunctionEmitterVisitor.visit_load_static.self_emit_line_s_s_": {"doc_hash": "5e50d41dcfa3a969808f6f3d575e6eb9c165ab726470a6899d91484f302a7655"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.visit_init_static_FunctionEmitterVisitor.visit_call.self_emit_line_s_s_s_s_": {"doc_hash": "a6fedaae892c063003fe500be3cff5bb87c73b04c0596ab96edb658693e11b7a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.visit_method_call_FunctionEmitterVisitor.visit_method_call.if_is_direct_.else_.self_emit_line_CPY_GET": {"doc_hash": "d753397c94f8d5c39cd96842c684362a56dd8155c6d66b9649a2a882ac6b7fd4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.visit_inc_ref_FunctionEmitterVisitor.visit_unreachable.self_emitter_emit_line_C": {"doc_hash": "e029906070b0ae45afa1e5010d4171c050e6d28153955311ae92d08908159a69"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.visit_raise_standard_error_FunctionEmitterVisitor.visit_raise_standard_error.self_emitter_emit_line_": {"doc_hash": "0dee5dd253b0909ce55377b3d2ba0431d0a725bb1c333e6f5e147ad438fb6d70"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.visit_comparison_op_FunctionEmitterVisitor.visit_comparison_op.self_emit_line_s_s_s": {"doc_hash": "9bf1ecca8f0d4ebba60b7173ec75ab2c9b23c4a3821c4af283007d0eda972538"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.visit_load_mem_FunctionEmitterVisitor.emit_declaration.self_declarations_emit_li": {"doc_hash": "0ae70a7c7dda1517d518bcab8d324bd3f7283071e89b6c93e429cd6553e7b149"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.emit_traceback_": {"doc_hash": "fccf170ad1945e4873c9b502868193ab60940a27a7786e37c416939d1da3674c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_MypycPlugin.report_config_data_MypycPlugin.get_additional_deps.return._10_id_1_for_id_in_s": {"doc_hash": "ac9bfddde23962836cbc2583f4d2e1054f376412ccf0168fa7c72c8b24949a09"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_parse_and_typecheck_parse_and_typecheck.return.result": {"doc_hash": "79fe3096ce1bfc4ba8ba8dba77e7f8209ac59c5d44eeffb4fa57c2cfb6a2dbb2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_compile_scc_to_ir_compile_scc_to_ir.return.modules": {"doc_hash": "77ad5d8385dc0d51ebddd2318f873d6eaf60a90d031f57b21f745deed93bbf9f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_compile_modules_to_ir_compile_modules_to_ir.return.modules": {"doc_hash": "fd0b3b1808d4065605df1633836c42c23cd6aff6ca13b49af043192cfbade97b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_compile_ir_to_c_get_state_ir_cache_name.return.get_ir_cache_name_state_i": {"doc_hash": "650ed86524b26e6cef59b4bffeb20812ee1754542ed20f389b94ac1e01eb3d94"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_write_cache_write_cache.result_manager_metastore_": {"doc_hash": "21febb38222b327934971fcd0a566004220cb76926de870e50d6a8e026961f22"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_load_scc_from_cache_load_scc_from_cache.return.modules": {"doc_hash": "2a4c8bcf944a60c7ad48b2200c599098bb098e921df94c09ee9047b534480297"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_compile_modules_to_c_compile_modules_to_c.return.modules_ctext_name_for": {"doc_hash": "7cbaac407dc338aa77196f6106361eb249eccb818f71662aaf9ec866ebe7f921"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_GroupGenerator_GroupGenerator.short_group_suffix.return.___exported_name_self_": {"doc_hash": "66c7c3c34e36f613570e7d9ea5d98a2717db0cd77eaf2a8e2da07520e32c7f06"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_GroupGenerator.generate_c_for_modules_GroupGenerator.generate_c_for_modules.None_3.for_fn_in_module_function.generate_function_declara": {"doc_hash": "6c7c82359b02f0f7a4e65ac17523ac163004d9093b86d41f1a2d69bcb8806c5a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_GroupGenerator.generate_c_for_modules.for_lib_in_sorted_self_co_GroupGenerator.generate_c_for_modules.return.file_contents_": {"doc_hash": "776b6ef09231926c061f190bab2c418a5a289ee70caae6b98dbea513afe4ab8a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_GroupGenerator.generate_export_table_GroupGenerator.generate_export_table.code_emitter_emit_line_": {"doc_hash": "1f725498ad7c2c6f2ab76aaab16b362c9f1950cc41304a0033ce0eff2c9e363c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_GroupGenerator.generate_shared_lib_init_GroupGenerator.generate_shared_lib_init.None_3": {"doc_hash": "dff48e0981f86c4a788d7ca3ad00afb4340fdf8680e9dda9ace853e532e84d78"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_GroupGenerator.generate_module_def_GroupGenerator.generate_module_def._HACK_Manually_instanti": {"doc_hash": "a8005f48ff64790fd1eb53c9407507f831dcfe6d0f1309ffee93e2504bff575b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_GroupGenerator.generate_module_def.for_cl_in_module_classes__GroupGenerator.generate_module_def.None_15": {"doc_hash": "38d5c176dce75aac3cf3232a27f947cc480c63969aa501c244275c7d31847b90"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_GroupGenerator.generate_top_level_call_GroupGenerator.generate_top_level_call.for_fn_in_reversed_module.if_fn_name_TOP_LEVEL_N.break": {"doc_hash": "18ef5d01e8c00cf3d9f02da6872da17b9ba5c8ebd8d844884222d15481810d6c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_GroupGenerator.toposort_declarations_GroupGenerator.toposort_declarations.return.result": {"doc_hash": "bf5e8fa3c3315483aed000d2d2b412b4881d2fc5580994f1eb587c604c81a9a1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_GroupGenerator.declare_imports_GroupGenerator.declare_finals.for_name_typ_in_final_na.emitter_context_declarati": {"doc_hash": "4eb760f23f1391366c99cd8279039db403d63460b9792693a8a9e860df8a441b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_GroupGenerator.final_definition_GroupGenerator.declare_static_pyobject.self_declare_global_PyOb": {"doc_hash": "8175b1c10527882fb285916b6c033d9d64b7fa1c1218346fe6e2b3125352b30d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_sort_classes_sort_classes.return._mod_name_ir_ir_for_i": {"doc_hash": "ae648cf7727434844e04a8e2306b42caecfeb0ab9443ee04a439c28d85e8e668"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitwrapper.py_generate_richcompare_wrapper_generate_richcompare_wrapper.return.name": {"doc_hash": "e8214d2fc3b3d5140c3bd8f08e97adbd6c8b18c6ac510f437a50a7a8af4c3b95"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitwrapper.py_generate_get_wrapper_generate_get_wrapper.return.name": {"doc_hash": "2e05c44e03a868c24e4713748bddf2962b50f985bf336fc871d968faf1659a36"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitwrapper.py_generate_hash_wrapper_generate_hash_wrapper.return.name": {"doc_hash": "52e5750fa352dc320d923d62d715ef997ddcea0822b4ad5d6e6ae8eb0ba16565"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitwrapper.py_generate_bool_wrapper_generate_bool_wrapper.return.name": {"doc_hash": "821fcc08797fff4ba2b8298899184834edadf0999afe92e95456bf2bf4308021"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitwrapper.py_generate_arg_check_": {"doc_hash": "df0f8225c0dbb2acad748ccf4b5cc98292e0bb4d928382f2c1b6ce3b31a1f0fc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/crash.py_from_typing_import_Iterat_": {"doc_hash": "d9286c7a2273b33a9a1820533e5d185b9ef04a5402380649900f6d1fe9d38da7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/doc/conf.py__Configuration_file_for__": {"doc_hash": "c28756565081b2fc355dc907af86821fd7e5255a40353a63dfa5fecfb6d20c5f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/errors.py_from_typing_import_List_": {"doc_hash": "e602cefe1d3f32f2e10eea5c6475a9c8e6f134d76842a914b874781876a2c6be"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/class_ir.py__Intermediate_represent_VTableMethod.NamedTuple_": {"doc_hash": "d80a0f4294466c68ebb05d3686d7bbd4778002a94e80e4cd8af0d56c566df55f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/class_ir.py_VTableEntries_ClassIR.__init__._type_Optional_List_Cla": {"doc_hash": "d87462223d86b7cddfd78502b994cde687666078830b41f6b1b43ea43a74d4a8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/class_ir.py_ClassIR.fullname_ClassIR.get_method.return.res_0_if_res_else_None": {"doc_hash": "a70a1fd46a277df5fb6336f6e761446bb5c8f15397457af8b0764df36d00b3e3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/class_ir.py_ClassIR.subclasses_ClassIR.subclasses.return.result": {"doc_hash": "e249f23c5a7503c84afc9c34ee4ad663ed5f89b02fc64538ababea9eeba3eb29"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/class_ir.py_ClassIR.concrete_subclasses_ClassIR.concrete_subclasses.return.sorted_concrete_key_lamb": {"doc_hash": "0ccd1515ee3d283d811a54a3160d28b3cf626d1edbe1457881e8f562e1be9b17"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/class_ir.py_ClassIR.serialize_ClassIR.serialize.return._": {"doc_hash": "43b182986935f92e9881dfa9522304b939587b0b39c57f1f310e617c226f1083"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/class_ir.py_ClassIR.deserialize_ClassIR.deserialize.return.ir": {"doc_hash": "97704b33a283b4d5c1fef0ca92e8929a239c86e0e9ad894cc70f28128e6e35f7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/class_ir.py_NonExtClassInfo_": {"doc_hash": "3e52e804534d44f5158b320079b63c6bfbd2a0abe3ad43de1e2085ad377d1b52"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/func_ir.py_FuncSignature_FUNC_CLASSMETHOD.2": {"doc_hash": "10be742e6e24dde716372ab6e517499ca6f32037a8378e0b61ca8e58eba40b6a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/func_ir.py_None_3_FuncDecl.deserialize.return.FuncDecl_": {"doc_hash": "d7a88e740e72be858b93e4810125756121ed261f3bf7e386413496b3784a5edd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/func_ir.py_FuncIR_FuncIR.deserialize.return.FuncIR_": {"doc_hash": "f48ddb09d727d8770986f89e5f00c557a33031e16c038414b157f6af3f4b65e3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/module_ir.py__Intermediate_represent_ModuleIR.deserialize.return.ModuleIR_": {"doc_hash": "73e288318c81ff697b1b552795bc7b4eaa9098dc9c2d2729b78840ed818b30a7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/module_ir.py_deserialize_modules_": {"doc_hash": "69729db697570c1d0f716e86397eea825cf4e5868e3e18c318fa5697288f1b99"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_BasicBlock_BasicBlock.terminated.return.bool_self_ops_and_isinst": {"doc_hash": "4d42b71074a87741d30cfc40458de9f120fb48612743dc51e0e3591f109d7118"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_Op_Op.accept.pass": {"doc_hash": "36c2ffc9803eff0c38a66a89a3ebba5d8a1df155e00f22f6a8b9e450d84f2897"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_ControlOp_Goto.accept.return.visitor_visit_goto_self_": {"doc_hash": "563cc0ed17abe0422bbb1660f8cd1afad47f68afdf94fbe57325c698a8749884"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_RegisterOp_RegisterOp.can_raise.return.self_error_kind_ERR_NE": {"doc_hash": "dee625e101684f7a2b04cc457441dd9f70ce22735927a8759820e6ced93f0255"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_Call_Call.accept.return.visitor_visit_call_self_": {"doc_hash": "3b2f3e85e67ca72bd5b2f795d30f6ef7646270754343ed79b9ba90c621a64e9a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_MethodCall_MethodCall.accept.return.visitor_visit_method_call": {"doc_hash": "3c2d7c8dc6542956f26293863ee2d45c0e75eef1a071c94b0241bacb9c9d6a95"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_Assign_Assign.accept.return.visitor_visit_assign_self": {"doc_hash": "f50b0baaf1eea8832aef12043ad9e19081ffe9d8f09207f6e35af20f56349809"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_LoadErrorValue_LoadErrorValue.accept.return.visitor_visit_load_error_": {"doc_hash": "97c4defc95f8892bef426a074e97082f140db2964b1854bee2b3319012f41fcf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_GetAttr_GetAttr.accept.return.visitor_visit_get_attr_se": {"doc_hash": "4826efddaf47e9eddb94212f9716092797a9194b2af358f3dca8bbccfee78d9a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_SetAttr_NAMESPACE_MODULE._module_": {"doc_hash": "6094c9789948d23a416238e87003319325a54c28c3501caef8d9ee6ce00dcb4c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_InitStatic_InitStatic.accept.return.visitor_visit_init_static": {"doc_hash": "afe0ace552426cf5c30361b757290a39c1843a192fdf498f7306937009f8ab21"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_TupleSet_TupleSet.accept.return.visitor_visit_tuple_set_s": {"doc_hash": "dc7e50b4e8f59aae7b46b89265e237c2f617d194088649e1774f88fb1a23d502"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_TupleGet_TupleGet.accept.return.visitor_visit_tuple_get_s": {"doc_hash": "fc2ff90f23a8e8260f7adce101168304e0b0b3bae33ba10d26ca67b6fbee5bfd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_Cast_Cast.accept.return.visitor_visit_cast_self_": {"doc_hash": "b67b08841f8b58d39f7a7f8f480e669a2b0f721d1cf172fdde3df9f60bbbeaa1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_Box_Box.accept.return.visitor_visit_box_self_": {"doc_hash": "8a87ba013431eead649603ffe4f75a5668ca1d563ce90a744a041724690b048f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_Unbox_Unbox.accept.return.visitor_visit_unbox_self_": {"doc_hash": "8674ab41283de0f6aa8d959e60dd60bd90812203fe98cc7d8c2be383e5922f9d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_CallC_CallC.accept.return.visitor_visit_call_c_self": {"doc_hash": "a4bf39f16bc888797e3b03af514c846ba448d1942999b198c07b749f060bedf8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_Truncate_Truncate.accept.return.visitor_visit_truncate_se": {"doc_hash": "68a3618330183c7b3c16f16975809d83c72a1f19f883687ada6f9ef467ba7290"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_LoadGlobal_LoadGlobal.accept.return.visitor_visit_load_global": {"doc_hash": "b06f6df1d11bb7633d6d8b9007c31a2dbb580a8b4235c93b1962a0aef29de1a1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_LoadMem_LoadMem.accept.return.visitor_visit_load_mem_se": {"doc_hash": "540b12963814fe93d4543b547659a5cc5f6abba747e54b7696a6c7c51439796f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_SetMem_SetMem.accept.return.visitor_visit_set_mem_sel": {"doc_hash": "229cbe15f8c3477bd69faa7b53e620b0e92cf05062c2abc37244a74e0400e597"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_GetElementPtr_GetElementPtr.accept.return.visitor_visit_get_element": {"doc_hash": "e1243fa53d910af8192487bfaa88e712a98d07274ec3298b0659e20b8a988a97"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_LoadAddress_LoadAddress.accept.return.visitor_visit_load_addres": {"doc_hash": "6dc6ff29aad49f6eb0f9dc9e7e4749d6347b6d046f224ee3ba63de263413be86"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder_IRBuilder.accept_2._": {"doc_hash": "e284f87e41cc9f88c32b59ed7be6074aa6d8799ae15a3d8cc7e557a17e3b2782"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.accept_3_IRBuilder.accept_3.with_self_catch_errors_no.if_isinstance_node_Expre.else_.return.None": {"doc_hash": "477663c33f7859adfa753f1b8851dfcd966a2aac63f2cc9c8a0a19367140ecf2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.gen_import_IRBuilder.gen_import.self_goto_and_activate_ou": {"doc_hash": "31d8d39e7804976b676d7c6813c0b2e2a5ac1e2dd89832efdf96423909e99896"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.assign_if_null_IRBuilder.assign_if_null.self_activate_block_body_": {"doc_hash": "8ad93a70d5f50a406ae1bcd4e7955f121efd5f869fcda10f72ba8d8d1380f318"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.maybe_add_implicit_return_IRBuilder.add_implicit_unreachable.if_not_block_terminated_.self_add_Unreachable_": {"doc_hash": "618a7bad5db02497546c704cd557271d061d1f203d08cbd0dfb752bfbffdc90c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.load_final_static_IRBuilder.load_final_literal_value.if_isinstance_val_bool_.else_.assert_False_Unsupporte": {"doc_hash": "d52b0e1f23eeddfeb160923e63be78acf36edf6c63cbdc6c1488495a7de0ffb2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.get_assignment_target_IRBuilder.get_assignment_target.assert_False_Unsupporte": {"doc_hash": "a1dd0799b6d9fb5c434a83ab08265caa00831cce63937a977795b1bdcc41d999"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.read_IRBuilder.read.assert_False_Unsupporte": {"doc_hash": "7b94a2959025a22ed7c82968290d4c4dc16383eca7cb35309ff72d9cc5d85dc4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.assign_IRBuilder.assign.if_isinstance_target_Reg.else_.assert_False_Unsupporte": {"doc_hash": "542fe18bbf517ba57e1f1a97b41044e0e73101cf9f07946f2ea17b5bf6105083"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.process_iterator_tuple_assignment_helper_IRBuilder.process_iterator_tuple_assignment_helper.self_assign_litem_ritem_": {"doc_hash": "6c36157a6bd8dc1ba5ff47bf850e0f24687ab97351d9138363a3d6e8fdc19793"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.process_iterator_tuple_assignment_IRBuilder.process_iterator_tuple_assignment.if_target_star_idx_is_not.else_.self_activate_block_ok_bl": {"doc_hash": "48a226a914b07e37803efcb7f1d5e46a3b530a450c46901112a9931341b46f24"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.push_loop_stack_IRBuilder.maybe_spill.return.value": {"doc_hash": "f20c034ce00fa02d8f18a965dfc0b3e91440ee91735d2840a77baf3332d8ea2c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.maybe_spill_assignable_IRBuilder.maybe_spill_assignable.return.reg": {"doc_hash": "bafd6dd1f1c2f343b3081a296da49b402f68a4a4d9d92e4f753f331faadcc233"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.extract_int_IRBuilder.get_dict_item_type.return.RTuple_key_type_value_t": {"doc_hash": "4bd2b0fa99234ca3f6c99d28a9a252515738545106ff841aa326984f94711efe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder._analyze_iterable_item_type_IRBuilder._analyze_iterable_item_type.if_isinstance_iterable_T.else_.return.echk_check_method_call_by": {"doc_hash": "ca8c943af99a6f0debe6a0e4935602bf679797abad7d3e804a8c623481238f44"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.is_native_module_IRBuilder.is_synthetic_type.return.typ_is_named_tuple_or_typ": {"doc_hash": "505c46dc8b0c53f1d6c2de86cef0319d001114fc3ba891acb9251da37bbfc42e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.get_final_ref_IRBuilder.get_final_ref.return.None": {"doc_hash": "0f55d32eb43f09d033eacd20c898474cfc7715ec8d607d7f203558b626442e81"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.emit_load_final_IRBuilder.is_module_member_expr.return.isinstance_expr_expr_Ref": {"doc_hash": "b024da348d0a85bb7a9bec6996099c20d45aa8b76fcdc77c46b2a25341ed78e2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.call_refexpr_with_args_IRBuilder.call_refexpr_with_args.return.self_py_call_function_ar": {"doc_hash": "b8708d72b47f481f8c74186d52360fa53dd4677ef94da8601404f7dc28d1bad1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.shortcircuit_expr_IRBuilder.process_conditional.if_isinstance_e_OpExpr_.else_.self_add_bool_branch_reg_": {"doc_hash": "80271b4f9bd94c6ca119df183e9e046f6fdaeefd192f6fec56fba93a114b794d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.maybe_process_conditional_comparison_IRBuilder.maybe_process_conditional_comparison.return.True": {"doc_hash": "052492a91cc0c46f8acf001cb3e5396a87ebbe5dfde7d222303275bff9e87dd0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder._Basic_helpers_IRBuilder.flatten_classes.if_isinstance_arg_RefExp.else_.return.res": {"doc_hash": "66cec58c8c42db7c230198d928f7e9ba34d8484e4db73566fe9f28836e1ff90a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.enter_IRBuilder.enter.self_activate_block_Basic": {"doc_hash": "bb69937039f8b741619c40d95e949baa0fc12fe9b5947fe26922def82072c50d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.is_builtin_ref_expr_IRBuilder.load_global.return.self_load_global_str_expr": {"doc_hash": "e05efb388e6f2672013b38c5877f5c082ed824ba1ddabbf4e839b8968888c302"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.load_global_str_IRBuilder.error.self_errors_error_msg_se": {"doc_hash": "7b834f1bd01ca5ab0c4b64e7116bea6e603b7470d6b997673fc4e0e35956e49e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_gen_arg_defaults_": {"doc_hash": "af8fa5dbd1cfeeefb60f4718d0e7bb1c666f5d64c3a87dbb0082724eba427749"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/callable_class.py__Generate_a_class_that__from_mypyc_primitives_mis": {"doc_hash": "23406af9bac34dd35173b3bdf409a3a17075555284c9886015977e4892302a84"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/callable_class.py_setup_callable_class_setup_callable_class.builder.fn_info.callable_class.self_reg.builder_read_self_target_": {"doc_hash": "5884dfdd852a466269bf568c9723d04ae48193e77821caf8dd6e42dfc0007b1b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/callable_class.py_add_call_to_callable_class_add_call_to_callable_class.return.call_fn_ir": {"doc_hash": "9a2bd8754625ef77d2ec3f117e5011b35a540a2223ebf2f3a2e86b23cb8ae03e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/callable_class.py_instantiate_callable_class_": {"doc_hash": "6b8ba95154157adec4e01ca671d8022893f2e5690f48a510006cd7945b3d4a9e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/classdef.py__Transform_class_defini_from_mypyc_irbuild_functi": {"doc_hash": "f61081f284b5029ca7bce126e9b4e6347a00e38732e63a5abd7a308130f17b6d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/classdef.py_transform_class_def.for_stmt_in_cdef_defs_bod_transform_class_def.if_not_non_ext_That_i.else_.cache_class_attrs_builder": {"doc_hash": "c31786a82edf52e5ad9f9a900700c929287dc8b94e48269305866b2e8691cfee"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/classdef.py_setup_non_ext_dict_setup_non_ext_dict.return.non_ext_dict": {"doc_hash": "b268048cadceffdcd15f7049d45a9d4a1bd9ab3dce9390504920e87f2d97d6bc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/classdef.py_load_non_ext_class_load_decorated_class.return.dec_class": {"doc_hash": "3cc78f44c2e7cd0ad8d75c65acba1089070d62f97d1dee060eb71fe7c219756e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/classdef.py_cache_class_attrs_create_mypyc_attrs_tuple.return.builder_new_tuple_items_": {"doc_hash": "edce34f9e8b0f865d186654793f64173b32e0420dd4ff033bc5292a74dab97e7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/classdef.py_finish_non_ext_dict_finish_non_ext_dict.None_2": {"doc_hash": "86a24ee451efcde3152e48343d41586881f4789e0c4a4c3ed83af8608ba61904"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/classdef.py_dataclass_finalize_dataclass_finalize.builder_call_c_": {"doc_hash": "ec35e303abea240fc20c6e96bf65be90be8725a44a03be9e065bf33e2900f8eb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/classdef.py_dataclass_non_ext_info_": {"doc_hash": "13706620304a2319889e02989954a9691b3af5ce0d924d16a53b96105fbdaaa9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/context.py__Helpers_that_store_inf_FuncInfo.curr_env_reg.return.self__curr_env_reg": {"doc_hash": "12d32a73caf0b21fd64ec0877f72969a37c15753dfd2185cc6d8071222f32f04"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/context.py_ImplicitClass_ImplicitClass.prev_env_reg_5.self._prev_env_reg.reg": {"doc_hash": "ea655ab0ac1834464626df29499a54291afac5258835566f72da0cbcbb6b28f6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/context.py_GeneratorClass_": {"doc_hash": "3dc546a14034b082594af2f0ff46b3acf31a2caa20b57b37df96e6a6ca2df8b5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/env_class.py__Generate_classes_repre_from_mypyc_irbuild_contex": {"doc_hash": "92c10ba0ccf55399336eeff08f4bd370f3f8d35a2140fbbc7f300e594a52ae57"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/env_class.py_setup_env_class_setup_env_class.return.env_class": {"doc_hash": "8613e2f278b70f7241754294743dfbc02d8520cfc3e3c5c4567945178ec9befc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/env_class.py_finalize_env_class_finalize_env_class.if_builder_fn_info_is_nes.else_.add_args_to_env_builder_": {"doc_hash": "4dc86fb577900684481a33a58536c0975faadc9886fa988a04261b72c9ce8a11"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/env_class.py_instantiate_env_class_instantiate_env_class.return.curr_env_reg": {"doc_hash": "d00e0972f94bfe40ead5af3697bdef1790336734d7fc18b64b91e1c1371eaafe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/env_class.py_load_env_registers_load_env_registers.if_fn_info_is_nested_.if_isinstance_fitem_Func.setup_func_for_recursive_": {"doc_hash": "6e7f266fe9c14bbded8d7ab896fc365e14e9e41187a84fbc2e7d6a906e174796"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/env_class.py_load_outer_env_load_outer_env.return.env": {"doc_hash": "2c0b116ae2799e919045fb2b8613b5e9923b868ebadd3fdb4a59d9cdd4c78f30"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/env_class.py_load_outer_envs_load_outer_envs.while_index_1_.index_1": {"doc_hash": "f22708830a47ee0bbc775faf011b308dd3c0c5fe24eddf1ea9f8d22524d02b25"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/env_class.py_add_args_to_env_add_args_to_env.if_local_.else_.for_arg_in_fn_info_fitem_.if_is_free_variable_build.builder_add_var_to_env_cl": {"doc_hash": "dbcc91533cfffeec45c3adfa2c2f8e399d54a94bbd211bc8c59a51ea3f829c3a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/env_class.py_setup_func_for_recursive_call_": {"doc_hash": "8ba4efa22263402f87d0dc0cbf8426d0aa4fbf56a538cf13904932afe772e43a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py__Transform_mypy_express_from_mypyc_irbuild_for_he": {"doc_hash": "288b0cd77efde70395abf82a4af1badd3d3f4bb919336f0e43095d1c7ec0be81"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py__Name_and_attribute_refe_transform_name_expr.return.builder_load_global_expr_": {"doc_hash": "25f3b15fb96aacec86e6edde8c7d2113e953601ed24e4dae5e8218f8d6e84a07"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py_transform_member_expr_transform_member_expr.return.builder_builder_get_attr_": {"doc_hash": "2fa75538676b2453b2d254b4b10f8ae1229cfc7b1a552c6ebe2438273aa1ef6b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py_transform_super_expr_transform_super_expr.return.builder_py_get_attr_res_": {"doc_hash": "4cb47d2f580626e1f9a586d00b15e773aed5e01f4281953cd2633caa4b61af34"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py__Calls_translate_call.return.builder_py_call_function_": {"doc_hash": "1cd45fc41e8ce6ba1b3daf3dc19ac8a6158277fb09d8b3b2da42d078f773f806"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py_translate_refexpr_call_translate_refexpr_call.return.builder_call_refexpr_with": {"doc_hash": "6f16795e7a0a222f5c0d426cc22b30b6cd37fb6c5159dbad24e2dc0900504c8c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py_translate_method_call_translate_method_call.if_builder_is_native_ref_.else_.return.builder_gen_method_call_o": {"doc_hash": "233a463b00130b666192df5f732cf0ab4b2584e18bd8ea3860a4821f7a228944"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py_translate_super_method_call_translate_super_method_call.return.builder_builder_call_decl": {"doc_hash": "8aa34b057b1e957f9c6aba3e1fd86f8a2fcc87c34773e407a71b52aba5dc6a4b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py_translate_cast_expr_transform_op_expr.return.builder_binary_op_": {"doc_hash": "7b7e7db35336509f8352372c491ae59d62ac59b629506ee2a289a63f2beae11f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py_transform_index_expr_transform_index_expr.return.builder_gen_method_call_": {"doc_hash": "231bd696ce9d65d9f87baa6cfa6ceca7077192e13bd6d1fde6da1af15e7f2ef3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py_try_gen_slice_op_try_gen_slice_op.return.None": {"doc_hash": "310d4cbfb803d00fa8bd21cd140987f9496ab814d36174e7070e705a02376f97"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py_transform_conditional_expr_transform_conditional_expr.return.target": {"doc_hash": "99801fba44943629b0cbec3bbadbdf9af855a9101d0d99f48c16966465090d7d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py_transform_comparison_expr_transform_comparison_expr._assuming_that_prev_cont": {"doc_hash": "a01dbbe90ff437b8fb54936101c79fba029c736bc48730fb17c758508e3c500e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py_transform_comparison_expr.go_transform_comparison_expr.return.go_0_builder_accept_e_op": {"doc_hash": "a3c0749fc8940288ec154a966f92405ce47e96b11b5539f673a04c1d8ddce377"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py_transform_basic_comparison_transform_basic_comparison.return.target": {"doc_hash": "bb3957d2a1e97f8a8b56b6eff4bb846db955c6af7c4de10e9ecf85c25e4dc112"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py__Literals__visit_list_display.return._visit_display_": {"doc_hash": "330f03a1a3af8c35fa78bc6c41814c2560d542af7a5e2858bdc6424f7b4b8b13"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py_transform_tuple_expr_transform_tuple_expr.return.builder_add_TupleSet_item": {"doc_hash": "4aebda507eca9f46834fa2775766f5ebee3a9afee0e50ef8f5fdcb46c8f32cf3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py__visit_tuple_display_transform_set_expr.return._visit_display_": {"doc_hash": "c1479be06f0297fbe04f24fcffa179fa90e2b93db1bfd2a4d421463e01bdf662"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py__visit_display__visit_display.return.result": {"doc_hash": "be8ea5f6c2055545e35616a5c097bdcb2bcc9ad8f9bad3cf01df7f6abd22244f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py__Misc_": {"doc_hash": "9a672488337d8198e512536210656e83a80e9ea5c87dbed0b226c59045ba9dd7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py__Helpers_for_generating_GenFunc.Callable_None_": {"doc_hash": "b2b404ab0a8a1c15c63859cb5b144557478928693535160489779cb65f000014"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_for_loop_helper_for_loop_helper.builder_activate_block_ex": {"doc_hash": "9a28c7b25899adb30d8339beac3bfbd0d27caa2915af2cad1b5a9a1e57a269bc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_comprehension_helper.loop_contents_comprehension_helper.handle_loop_loop_params_": {"doc_hash": "0e499ff62a0b0257df40b7e1a7c5b077a024c46d2881e034a0e3f985a3c285ea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_make_for_loop_generator.None_3_make_for_loop_generator.return.for_obj": {"doc_hash": "bac2fd874433d183930d8b5cd7d481aecdc2e50a7116d19ade563fffebd81687"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForGenerator_ForGenerator.load_len.return.self_builder_builder_buil": {"doc_hash": "bfe2c247e430bccd02cec0288ea0db74713a981b3eec8bff5130c7a37cbf8fe1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForIterable_ForIterable.init.self.target_type.target_type": {"doc_hash": "fcb8134961a9bc6a13f83b7efeee34977fa711ce5e61617ef0db35ea0c7624a3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForIterable.gen_condition_ForIterable.gen_condition.builder_add_Branch_self_n": {"doc_hash": "ecdfe3c486eba2ec3ec056b1d3c817133eff75b3be98ca7ed1c9639340538e56"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForIterable.begin_body_ForIterable.gen_cleanup.self_builder_call_c_no_er": {"doc_hash": "43e850c96e06c5a050f9c615795528377ce271e2922d98f2b31a2bfce9e3067b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_unsafe_index_unsafe_index.if_is_list_rprimitive_tar.else_.return.builder_gen_method_call_t": {"doc_hash": "93756c6e242fcb391122c267c4968b695d85afe610d223dc3764c4e0644a725c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForSequence_ForSequence.init.self.target_type.target_type": {"doc_hash": "4a9c14d680fbba7260474ee664ac2941d806e2653ba2c8da48cef7472d1a679c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForSequence.gen_condition_ForSequence.gen_condition.builder_add_bool_branch_c": {"doc_hash": "8a58954679b2d3f293f5971aad09ad68008040257db3d8beb267c13335f16348"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForSequence.begin_body_ForSequence.gen_step.builder_assign_self_index": {"doc_hash": "5ac10da8ee29c46c6955d58b8b8be39cdc7633b11386e9d61ec4fea053a7f9bd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForDictionaryCommon_ForDictionaryCommon.need_cleanup.return.True": {"doc_hash": "29f68e34c77054439dc71449e39e455d18cbfebe6fa4bc5d0deb0d0929001c65"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForDictionaryCommon.init_ForDictionaryCommon.init.self.iter_target.builder_maybe_spill_iter_": {"doc_hash": "c1345060e2a83e80667f3d7b539f96204fe2106fc21c9d50165ce0d4bc2a7b9d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForDictionaryCommon.gen_condition_ForDictionaryCommon.gen_condition.builder_add_": {"doc_hash": "2e67c42cf1302248a533e6b8c2188dd95b09709a48b8b27e34041f60328a5199"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForDictionaryCommon.gen_step_ForDictionaryCommon.gen_cleanup.self_builder_call_c_no_er": {"doc_hash": "379109304b6840f2115afcfebbd0b83ede321759ce1b0d07782c2bd76150aa85"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForDictionaryKeys_ForDictionaryKeys.begin_body.builder_assign_builder_ge": {"doc_hash": "0a9f07312cae3576dfbbd8495471be0dc7f226539114c7bce8d31c533c77cd62"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForDictionaryValues_ForDictionaryValues.begin_body.builder_assign_builder_ge": {"doc_hash": "2b7936adba2eb50567736d9bcf9d73d9e8c70530d708d6a23ec1499d12519448"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForDictionaryItems_ForDictionaryItems.begin_body.if_isinstance_target_Ass.else_.builder_assign_target_rv": {"doc_hash": "4723d73c8189dbf0f9516f2d4d23dc434bef20b5bed663e069d569c6a013400d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForRange_ForRange.init.builder_assign_self_index": {"doc_hash": "623810d213233930c1b0645ef921ab2390d71bcecbeace0cdbeca4e63682e866"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForRange.gen_condition_ForRange.gen_step.None_1": {"doc_hash": "f6b2f2a9a61559fa21372d75b724a58684c997a6d75c412aedbe089964a2574a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForInfiniteCounter_ForInfiniteCounter.init.builder_assign_self_index": {"doc_hash": "cae5444bcd0e55f50936a84e8d2ebb4515df5ca5f966407fcde50506e0c600df"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForInfiniteCounter.gen_step_ForInfiniteCounter.gen_step.None_1": {"doc_hash": "98cb5d48afc00d9b9c2cece2c886818b2489a04c05844b11cc1f9cda65d7ee6a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForEnumerate_ForEnumerate.gen_cleanup.self_main_gen_gen_cleanup": {"doc_hash": "f6340e519f38cf96f64f41c76f84965d937c7b4d8a88cc7d2a753e7f86c3b5c9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForZip_ForZip.init.for_index_expr_next_blo.self_gens_append_gen_": {"doc_hash": "8f764aa503f0f78492e00340d382383cd184367581af74798db6cab5fc636799"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForZip.gen_condition_": {"doc_hash": "2c58ef804d88d03a6765b1582a982642316e2d82ef546f17864f7c1474968b21"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py__Transform_mypy_AST_fun_from_mypyc_irbuild_env_cl": {"doc_hash": "937db0eea514c7c993af359639a2eda9b2aae27f7392da48239653105b484d48"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py__Top_level_transform_fun_transform_overloaded_func_def.builder_accept_o_impl_": {"doc_hash": "005b309c4f99187e9d5fb55b1b15008fe4f2ac8f3602ce66a0a580a47761bf19"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_transform_decorator_transform_decorator.builder_functions_append_": {"doc_hash": "27dcd8adcc4089c0430d2301c6cd5bb24eacf465e2ac856806d5620768989974"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_transform_method_transform_lambda_expr.return.func_reg": {"doc_hash": "0616ddd995fe5cacef8442f507c31de27f4fdbe1c08a552f70123193d5d4b017"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_transform_yield_expr_transform_await_expr.return.handle_yield_from_and_awa": {"doc_hash": "1096a27a12936965c59f4498bf8ee6c94ea06905c82e6ef4c254f23623a91435"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_gen_func_ir_gen_func_ir.return._func_ir_func_reg_": {"doc_hash": "f8997441503f44d9a857342925d6aa72e7fffcfe1124a8dc7bae4c462508a302"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_handle_ext_method_handle_ext_method.if_class_ir_allow_interpr.builder_functions_append_": {"doc_hash": "3433ff72c5b4d5ab55d1849c2f69a024ac736354186d513b38240a9462a2f78f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_handle_non_ext_method_handle_non_ext_method.builder_add_to_non_ext_di": {"doc_hash": "b981ad82fd39c7c03c01b189df4dcc118165b27bb9981a559862edb0e6a98774"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_calculate_arg_defaults_calculate_arg_defaults.for_arg_in_fitem_argument.if_arg_initializer_and_no.if_not_fn_info_is_nested_.else_.builder_add_SetAttr_func_": {"doc_hash": "a6688237df4ad34f1a89230ec00a3d8104890e9686a0eb4bfc626e989213e9f5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_gen_func_ns_emit_yield.return.cls_send_arg_reg": {"doc_hash": "c368751179d2a3d8a36ef5e9636c969f7731826240baefe1e6555500c93dcc71"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_handle_yield_from_and_await_handle_yield_from_and_await.try_body.builder_assign_": {"doc_hash": "54d82014b7522ee732bfb9cde137ca737acadf832862fb6d99b15c12dd798ea7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_handle_yield_from_and_await.except_body_handle_yield_from_and_await.except_body.None_6": {"doc_hash": "04b19692ef92a806340bd4e516b351d9c892652308adeb22f1553fede77d04d6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_handle_yield_from_and_await.else_body_handle_yield_from_and_await.return.builder_read_result_": {"doc_hash": "ef72023fb1598ee205d4673a74975661b2bfd9d0c619fafcf5141f8e78fcdc4c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_load_decorated_func_is_decorated.return.fdef_in_builder_fdefs_to_": {"doc_hash": "6986e1fac56040521e7855f2ef8dba9a16095f88aa3e30056941370ee24ff7eb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_gen_glue_gen_glue.if_fdef_is_property_.else_.return.gen_glue_method_builder_": {"doc_hash": "094613e4b155e123ebf9998b659f03e013b3ed3d25a372f3db474c160ed31a9a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_gen_glue_method_gen_glue_method.return.FuncIR_": {"doc_hash": "71625dfa792bac08b58a587deb296a1ff69d79eb70380d73136ce4e1fcc3d42e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_gen_glue_property_gen_glue_property.return.FuncIR_": {"doc_hash": "f70f109ac26731e5df6a6a0f1b1a1c57d07919f7e960310d74273c1382d2345b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_get_func_target_": {"doc_hash": "312e110ea0f4acd75f9343a8975c5634db5cb60e9cad488504bab7fe4e54343f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/generator.py__Generate_IR_for_genera_gen_generator_func.builder_add_Return_instan": {"doc_hash": "e921351537734f02e0f9eb7e8c9367fa4d36e0a852ff2f203876fc0e5eaa4b3e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/generator.py_instantiate_generator_class_instantiate_generator_class.return.generator_reg": {"doc_hash": "2ade0622253adb65d169690d98f2640f3739b97c1eb3787046c70ef0fbbf68e9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/generator.py_setup_generator_class_create_switch_for_generator_class.builder_activate_block_bl": {"doc_hash": "807e6adcba8c7adf53dd27fd7d3d18b295a4a4aa48fe60812b485ccb9565a421"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/generator.py_populate_switch_for_generator_class_populate_switch_for_generator_class.builder_add_Unreachable_": {"doc_hash": "8baad78eb3151a973b2d860ea498ec65abda8b6bedfb046f4e1e0db3ce8c124f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/generator.py_add_raise_exception_blocks_to_generator_class_add_raise_exception_blocks_to_generator_class.builder_goto_and_activate": {"doc_hash": "49c83ed6256360911af0b8f561a703c9bac8575e2bcd067c8c5fd3199ee6c67e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/generator.py_add_methods_to_generator_class_add_methods_to_generator_class.if_is_coroutine_.add_await_to_generator_cl": {"doc_hash": "85f841e5ff035afc8aff8d7d3ccd9057986f0f56c8f6be7efd62bb1c56a1094c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/generator.py_add_helper_to_generator_class_add_helper_to_generator_class.return.helper_fn_decl": {"doc_hash": "1a90971ffe1b98dba11e8dabed772f521d0e847cbdbf4f4429cb784efade3bc1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/generator.py_setup_env_for_generator_class_": {"doc_hash": "e86f700406a86ea5de24287a35d6d419723b6b597945ee1dc9499e1828e7c6aa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.coerce_LowLevelIRBuilder.coerce.return.src": {"doc_hash": "2f70735f31932154b8133b103f8fdb70b71245af4ff442f5899372726286d27a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder._Attribute_access_LowLevelIRBuilder.get_attr.if_isinstance_obj_type_.else_.return.self_py_get_attr_obj_att": {"doc_hash": "4dcf3ade20e221f640ea457ec91f631e8ba9d008a8d9c4899fe7423c6754339f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.union_get_attr_LowLevelIRBuilder._isinstance_checks": {"doc_hash": "1c1733ea12aa1987e28e84cc5ca168404a9fd6871020cec74e55a48a42fde8fd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.isinstance_helper_LowLevelIRBuilder.type_is_op.return.self_add_ComparisonOp_ob_": {"doc_hash": "84329c5f43b67a0b9dba4e1711a3fb0fa2ea35eabad813da0946ed3601de3c37"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.isinstance_native_LowLevelIRBuilder._Calls": {"doc_hash": "5590be2e4f2512cc0ea5d116d0fab1c1dc528026b5fbea772a26b8ed519cf777"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.py_call_LowLevelIRBuilder.py_call.return.self_call_c_": {"doc_hash": "0c166f026298b79d08ebd7563503e0f115ac2a99fe677a0b381a53d5739f327e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.native_args_to_positional_LowLevelIRBuilder.native_args_to_positional.return.output_args": {"doc_hash": "9d9efd6d6f37f8105d2be2ce53df46d111bf4ebc6d6b6e6740faddde3b780892"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.gen_method_call_LowLevelIRBuilder.gen_method_call.return.self_py_method_call_base_": {"doc_hash": "25d5d42dd7205ab83442fd3997424343bbdcb82fb691377c2fcb2c0365b7b739"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.union_method_call_LowLevelIRBuilder.union_method_call.return.self_decompose_union_help": {"doc_hash": "880402dea58c6d05c786f7fd512f9a437a166d5e0ee792f2e11d5728ba74f8c4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.load_static_checked_LowLevelIRBuilder.load_static_checked.return.value": {"doc_hash": "10a5be4b26f83ecbeeb7da5fc3d7b32118118143908f332be34b6b7d20d9ec23"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.binary_op_LowLevelIRBuilder.binary_op.return.target": {"doc_hash": "2cf98e77987f9d203fbdd69f7850109621d2ef207f1102fcb09a075b5704abc2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.check_tagged_short_int_LowLevelIRBuilder.check_tagged_short_int.return.check": {"doc_hash": "1a233f08de27b1c6801590d6798c92650256a418f593abe57a1418dfaeab8330"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.compare_tagged_LowLevelIRBuilder.compare_tagged.return.result": {"doc_hash": "5ff0cd7e99dc75e8c0d5901966b177de57761793c474f956fdcf9b85a5c8bb29"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.compare_tagged_condition_LowLevelIRBuilder.compare_tagged_condition.self_add_Branch_eq_true_": {"doc_hash": "4e63ac1a1450bf7ea8822481da18e14fdae3c2fcb95a082657cbcf342861aa2a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.compare_strings_LowLevelIRBuilder.compare_strings.return.self_add_ComparisonOp_com": {"doc_hash": "5ee8e3c38446f8f9ca854d95e810f298469751639f364ea80a9f14ffd316d1ba"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.compare_tuples_LowLevelIRBuilder.compare_tuples.return.result": {"doc_hash": "e8372e2d45cb0bfffbd595013a790410f566fb2d9054f2fb5c387bbe60037957"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.unary_op_LowLevelIRBuilder.unary_op.return.target": {"doc_hash": "4d251c4646f1054567d5cc2615670f8895a51fa0c2628d162bb1d9b3d1388421"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.make_dict_LowLevelIRBuilder.make_dict.return.result": {"doc_hash": "5934ee981623d88b240058104d46122e099ecc2b28a8aed1f27b689c72f4ad8a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.new_list_op_LowLevelIRBuilder.new_list_op.return.result_list": {"doc_hash": "98bdc125f607389355756611a93edab684ecef02fade32e8814bf9d9fe454a85"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.new_set_op_LowLevelIRBuilder.builtin_call.return.target": {"doc_hash": "e439dbbd2ee2494e0c3f4211ee3d894fe7039a2e0cae7e38d2289e4d383f919f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.shortcircuit_helper_LowLevelIRBuilder.shortcircuit_helper.return.target": {"doc_hash": "35d1014b2826d4cc015ec41f5eb60f4825a9d9dedd6c9c022feaf0f4bfac07eb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.add_bool_branch_LowLevelIRBuilder.add_bool_branch.self_add_Branch_value_tr": {"doc_hash": "45d1662c66f2a5613348ecde87036a398651edd51074886653ac0e35f4c905b1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.call_c_LowLevelIRBuilder.call_c.return.result": {"doc_hash": "2aa0bbe6b4bddea49f1f379c1f12e22f9b62f18090e8ec4fda2256c2f79e18a1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.matching_call_c_LowLevelIRBuilder.comparison_op.return.self_add_ComparisonOp_lhs": {"doc_hash": "9729019a45a77172d5db623b378802afa3ce97a656b37c4795f8cfed152dcef8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.decompose_union_helper_LowLevelIRBuilder.decompose_union_helper.return.result": {"doc_hash": "4d1df8ca783da0f6cfb242aa3fb86c771fa77785f7838f7b13a57b8c5c6383ad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.translate_eq_cmp_LowLevelIRBuilder.translate_eq_cmp.return.self_gen_method_call_": {"doc_hash": "efc5f6bd91b24f9e549f92000c82381a0f434692057c98bdd0041aedd9c6d0a9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.translate_is_op_LowLevelIRBuilder.translate_is_op.return.self_add_ComparisonOp_lhs": {"doc_hash": "c302e711cf6536b85a5d86da399e8baec65063cac820d5f3a9ce7cd98895e3c3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder._create_dict_": {"doc_hash": "d23b8b17e848188ca21f7fadda1eb1010b26b80a8fc2733a5da6bee4b387cd01"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/main.py__Transform_a_mypy_AST_t_strict_optional_dec.cast_Callable_F_F_st": {"doc_hash": "79f77387455daff68e3a3f9d5dc5cde2ac7600988b706e7b481cb292c62df9d3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/main.py_build_ir_build_ir.return.result": {"doc_hash": "b6ad0d5ba3ca33ae42180823ac7880fd94f0a65078eb31b29630fc8e4be93fe3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/main.py_transform_mypy_file_": {"doc_hash": "8f92f6b469138af96becb4b78a7ba74656322d184e4dbb7ba21e836e8c2e7d5f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/mapper.py__Maintain_a_mapping_fro_from_mypyc_ir_class_ir_im": {"doc_hash": "b5a3c1849c8b324981bb285363a8c1a8408f455add61ac28565dca580e1c1412"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/mapper.py_Mapper.type_to_rtype_Mapper.type_to_rtype.assert_False_unexpected": {"doc_hash": "60752dec5ea3fcf63cf39804376f1bf9f85e19ad937807905fc042a57e6d2d62"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/nonlocalcontrol.py__Helpers_for_dealing_wi_if_TYPE_CHECKING_.from_mypyc_irbuild_builde": {"doc_hash": "231a978bf980d55636a2cdc6220aff1d2ea928953cadc659c2c4d49b7342908f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/nonlocalcontrol.py_NonlocalControl_NonlocalControl.gen_return.pass": {"doc_hash": "6940862f97247685c09b374564c39d1b6c1684383e968e86da6eff69ca13893f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/nonlocalcontrol.py_BaseNonlocalControl_BaseNonlocalControl.gen_return.builder_add_Return_value_": {"doc_hash": "7542c5cf4dcd4c44a0c9ae36e3c4a956247b55fe2451107195f0cfd3cc805f97"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/nonlocalcontrol.py_LoopNonlocalControl_LoopNonlocalControl.gen_return.self_outer_gen_return_bui": {"doc_hash": "2cc61d3bde4daef5b1809276c7796db24bf13ce8c17a7b6bc308db71040dbbf7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/nonlocalcontrol.py_GeneratorNonlocalControl_GeneratorNonlocalControl.gen_return.builder_builder_pop_error": {"doc_hash": "ab337f1914385f98e415e5c2173bfe0f6365038bc6027427cd456ea0ca66c4d4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/nonlocalcontrol.py_CleanupNonlocalControl_CleanupNonlocalControl.gen_return.self_outer_gen_return_bui": {"doc_hash": "3fecabd7db9366db70745231ac21c0ac3f71505f8262e877a9096f7570788908"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/nonlocalcontrol.py_TryFinallyNonlocalControl_TryFinallyNonlocalControl.gen_return.builder_add_Goto_self_tar": {"doc_hash": "b472ca4be232d227959739dbc432b908bc2ba70825b839b9fc690414d2040dd4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/nonlocalcontrol.py_ExceptNonlocalControl_ExceptNonlocalControl.gen_cleanup.builder_call_c_restore_ex": {"doc_hash": "a40789a10b655dd5bc93490816bb686c0aca2eded7b296881daa45fddc2192c6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/nonlocalcontrol.py_FinallyNonlocalControl_": {"doc_hash": "38961748f6b107944c7b7631005328f7885da97677e3aeee160d541e541ec359"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/prebuildvisitor.py_from_typing_import_Dict__PreBuildVisitor.__init__._type_Dict_FuncDef_Lis": {"doc_hash": "d44e32cfc10b1b7957e56969e5c09fe79bfe3c9b4cc8d10a92b157a5e43777f4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/prebuildvisitor.py_PreBuildVisitor.visit_decorator_PreBuildVisitor.visit_decorator.super_visit_decorator_d": {"doc_hash": "b4159db1fd9bee38b42a1bd9eb1c18212d417980a08931db410fd3ada8376d06"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/prebuildvisitor.py_PreBuildVisitor.visit_func_def_PreBuildVisitor.visit_var.self_visit_symbol_node_va": {"doc_hash": "5b7ce31e00f15b301810d1a3500ff3944e241cb4cc261feaa9650da9ffa01ce1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/prebuildvisitor.py_PreBuildVisitor.visit_symbol_node_PreBuildVisitor.visit_symbol_node.if_symbol_in_self_symbols.else_.self_symbols_to_funcs_sym": {"doc_hash": "f4e11fb0c83f670af9c019194c72940fadb2591175c4f499fc609fc0beda8f92"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/prebuildvisitor.py_PreBuildVisitor.is_parent_": {"doc_hash": "3cd5b324dcf426e9b462784f1f9dd91fca9cc919e3125cb06bcf6a89901b9c5b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/specialize.py__Special_case_IR_genera_translate_globals.return.None": {"doc_hash": "ea8f86971a16ed475fce6e657a76c22fe5138813a0337c6cd70ac4aa3ac37022"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/specialize.py_translate_len_translate_len.return.None": {"doc_hash": "8b00d567d1648260796121d087809180d47637b2543098d30184c2d7f4253403"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/specialize.py_dict_methods_fast_path_dict_methods_fast_path.if_attr_keys_.else_.return.builder_call_c_dict_items": {"doc_hash": "66efe6f470988b9b34320e98ff2569df219881c2709211486fa595a320e0c2a5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/specialize.py_translate_safe_generator_call_translate_safe_generator_call.return.None": {"doc_hash": "7c22332c6152b738b93977aa817a9de3c355ffb9afc0c991927d786595d5a08f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/specialize.py_translate_any_call_translate_all_call.return.None": {"doc_hash": "eb5e79c58bd5faa7f3f75cbbd73e584c59e2b3e6e577aed29903a4e061e8c365"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/specialize.py_any_all_helper_any_all_helper.return.retval": {"doc_hash": "d16e7124631dc755bcc749fc91473c2314e6dac9e4ac5ba72191dceb50ccf242"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/specialize.py_translate_dataclasses_field_call_translate_dataclasses_field_call.return.None": {"doc_hash": "51b79c87600be9f985edeaffa3168edcd8f09da8cddc24a61908a9f88306d191"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/specialize.py_translate_next_call_translate_next_call.return.retval": {"doc_hash": "20a56a10f03850c1ff1a901989248085a9ce361bf7036335de208b7afefb3eae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/specialize.py_translate_isinstance_": {"doc_hash": "9c5eaef33d41c4da65d26a1204791a39925cde7a0b428e2f4ec6ef75d2873831"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py__Transform_mypy_stateme_GenFunc.Callable_None_": {"doc_hash": "a1d1790646e474fa3135dbf776f14560c8d7fee1db0e9a092f503513d4be1897"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_block_transform_block.if_not_block_is_unreachab.elif_block_body_.builder_add_Unreachable_": {"doc_hash": "27d41d4e51630da50023acd95e2d592274a0483756ffe8538ac5ff0fe323314a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_expression_stmt_transform_return_stmt.builder_nonlocal_control_": {"doc_hash": "4366f896066ee4eda1e6e3df928aedd688aa1016c80d4432fdc9f0e0afa69d92"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_import_transform_import.for_node_id_as_name_in_n.builder_gen_method_call_": {"doc_hash": "08b78e627b937f92b608cd6e3675d1b84abb56e14a3e270969b4054f546c5f58"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_import_from_transform_import_from.for_name_maybe_as_name_i.builder_gen_method_call_": {"doc_hash": "3508ef2a772b54219244d09c0d8f19de934fc55e5c9e77fbc7f200d97de1f2ec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_import_all_transform_if_stmt.builder_activate_block_ne": {"doc_hash": "0089c979c85f3bc333e92139a4a95dd8ffd3514b6ca2aa17486423a8153c6659"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_while_stmt_transform_while_stmt.builder_activate_block_ne": {"doc_hash": "509551a3292ee16c302d64e15ebcd7a6ddf9b1026c8994f2030a869962a09d79"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_for_stmt_transform_raise_stmt.builder_add_Unreachable_": {"doc_hash": "6f158de2bcbd5eab80f7e9e4572b2e34f1267fd907a1adfddda077449ee7ce83"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_try_except_transform_try_except.None_17": {"doc_hash": "8d47e6c68ab21f5a75cee34e1a74a85eb88ee376f9bf38e2078bc04dcbb72994"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_try_except_stmt_transform_try_except_stmt.transform_try_except_buil": {"doc_hash": "72d16a441f3e2f113fb8a899c5d4dacbc6bdb0570975d3e71dbde82fe92f88ef"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_try_finally_try_try_finally_try.return.control_ret_reg": {"doc_hash": "fb8605be8d8a9ce686e11ceb9556db5daf922005aff81ffa46f362e544438f19"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_try_finally_entry_blocks_try_finally_entry_blocks.return.old_exc": {"doc_hash": "5a8f8c35626349ffe4fb16b5aa6a720ea99dcd3f6cb8bd0fa155f72f8dc9fc59"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_try_finally_body_try_finally_body.return.cleanup_block_finally_co": {"doc_hash": "8e530e1e3a49e8a7bfaaaf91c49d84d8677a363d3a27083b821b20b170a4c0b7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_try_finally_resolve_control_try_finally_resolve_control.return.out_block": {"doc_hash": "94913e76d6904ed2f875d6d1b14e48e27476fa7824c6b9263bafd17cce12e7b4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_try_finally_stmt_transform_try_finally_stmt.builder_activate_block_ou": {"doc_hash": "ad81de91f868ba9134fc6556e39fdec9a3c560f28b464f9f36edfbcabed5a20e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_try_stmt_get_sys_exc_info.return._builder_add_TupleGet_exc": {"doc_hash": "a58e3d7fd3d34cc29ec902b1933f85ecd55e54cf392ba72c4caaa476b6bea63d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_with_transform_with.try_body.body_": {"doc_hash": "cf1a2cbe0d2af0807bc86af9ba02b593dba622cef5c7de82f88867f71b46435e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_with.except_body_transform_with.except_body.builder_activate_block_ou": {"doc_hash": "6b438a7a8c8481060b90a0730cf7cfd8a2a38b15597a2dd9308ce83a1fdb9687"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_with.finally_body_transform_with_stmt.generate_0_": {"doc_hash": "86be8297fe310206f956d4fd26137349ed670a263bbd03eed51b590501201e7b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_assert_stmt_transform_assert_stmt.builder_activate_block_ok": {"doc_hash": "2104c7108492a341b52cbccba65a8437cbff3363d83205b292be849369e7bb8c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_del_stmt_": {"doc_hash": "e57f04815cda0ac573ad5ecde2cc3cd4ddf8e2531d5763fb87e6156c2daa82ed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/util.py__Various_utilities_that_is_dataclass.return.any_is_dataclass_decorato": {"doc_hash": "96534f8772cbefd6488e390c4f6e12946a4be8aa3023f1d16ad0905c370e0718"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/util.py_get_mypyc_attr_literal_get_mypyc_attr_call.return.None": {"doc_hash": "fb85f47ec43971045ea634b3f1e82d792cf41f1eb9dd059648968c51f46608df"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/util.py_get_mypyc_attrs_get_mypyc_attrs.return.attrs": {"doc_hash": "1395b5b1c1827eb41491036608ad5743d42483b908d0189a711bd453c14d4b09"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/util.py_is_constant_": {"doc_hash": "4bc635c4410f27b2d1a8f29ea5dc7e15b05f23d43a70cc26e03ce27457ee94a1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/visitor.py__Dispatcher_used_when_t_from_mypyc_irbuild_expres": {"doc_hash": "6ee2208c2a179caf8429a36ef9d7fba5be71f87580907c2c64fefa98b83dc692"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/visitor.py_IRBuilderVisitor_IRBuilderVisitor.visit_name_expr.return.transform_name_expr_self_": {"doc_hash": "182ed98548ee53543f5295d3c4764b213a783e88a2d63b95d2a2a3da235155c5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/visitor.py_IRBuilderVisitor.visit_member_expr_IRBuilderVisitor.visit_backquote_expr.self_bail_Python_2_featu": {"doc_hash": "e51635de16496cb5601192491aa04c3013f8b077519fcdbe5129960a88f1b4a3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/visitor.py_IRBuilderVisitor.visit_exec_stmt_": {"doc_hash": "77787bff589b43a58b8f7d8fc74c712e47d2c703b3d60aa39114a767f8173429"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/vtable.py__Compute_vtables_of_nat_compute_vtable.if_not_cls_is_trait_.for_trait_in_all_traits_.cls_trait_vtables_trait_": {"doc_hash": "46f22e4dbfd9999e902ba6eeed81a10466faca8737293b7cbe57692a7fd10cb4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/vtable.py_specialize_parent_vtable_": {"doc_hash": "f5b36c65972baf3c9fcd98d1d6d0844fea92cbb38ed9aa702cf31bbf5628a63b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/lib-rt/setup.py__Build_script_for_mypyc_": {"doc_hash": "9a5bf071e064f065be9b6d6352f6bf1f3f7d57edfa076d81dd1cfc13b6a6f10b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/namegen.py_from_typing_import_List__NameGenerator.__init__._type_Set_str_": {"doc_hash": "f2c539073a3e696f021df38601afa0acf07b43fbfc65f6086cc038474a0d7541"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/namegen.py_NameGenerator.private_name_NameGenerator.private_name.return.actual": {"doc_hash": "74007dbae1a24c760f221758e7e1427611107efddf1bba30ecc75c4a6477c7e4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/namegen.py_exported_name_": {"doc_hash": "747e9ff7eefd5dfdd171d65595c95cec2e848a5f67b1fa8923e7f837d4543e71"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/options.py_from_typing_import_Option_": {"doc_hash": "c5875aa284e865dc9617fb5683307b3a01406688cdd8f5e1aef7f3f9b462d24c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/exc_ops.py__Exception_related_prim_": {"doc_hash": "4f7c931d1d876abe3fcf8b2bb6e5653d88548f902a9f63e4fef6bb4dd2ba92e9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/misc_ops.py__Miscellaneous_primitiv__Arguments_are_metaclas": {"doc_hash": "b3c68d16d0dec398e321e3370c4e92b8f44a0e77184fbbcfe6d0588846f19caf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/misc_ops.py_py_calc_meta_op_": {"doc_hash": "0aecbc7d4fdf939fc605a5688f56eb465522cac463efac84aff3dd77230416b0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/set_ops.py__Primitive_set_and_fro_": {"doc_hash": "0325195690a44a807a0ac342a972f061850c0941417454a00eb1aa2012ec342b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/tuple_ops.py__Primitive_tuple_ops_fo_": {"doc_hash": "1b83f3e6fc0b194e1136864b5417f697b44cf4ed92886807e11abd6d196654d0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/rt_subtype.py__Runtime_subtype_chec_is_runtime_subtype.return.left_accept_RTSubtypeVisi": {"doc_hash": "83bfcabdc581e39adf492a383f49335814e44902c55e86398158013bd561b2fc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/rt_subtype.py_RTSubtypeVisitor_": {"doc_hash": "0bce442e52fe04d94aee2109a7c69af7a3f00f76b9b0a06bb0d144a02f8f40c4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/sametype.py__Same_type_check_for_RT_is_same_method_signature.return._len_a_args_len_b_arg": {"doc_hash": "a8e4e5909a432636494dbac3c24325c63744e3bb44e2c2f79afa937ff7d4dcce"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/sametype.py_SameTypeVisitor_": {"doc_hash": "b50753aa5bc3bcd6f0455580b3039f2221869d1d94b5d552d5a4f0a84d26f0c3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/subtype.py__Subtype_check_for_RTyp_is_subtype.return.left_accept_SubtypeVisito": {"doc_hash": "0d4400c324cb37127f6582824c5875395f7c34ea4d67b98e2a3f03b8887a6b2f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/subtype.py_SubtypeVisitor_": {"doc_hash": "e2eed186b080054b68888ae3e2f5ae273f11408ae9ba38c34fbc3f8644e5dfda"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/config.py__": {"doc_hash": "bbd4d1c8cd31851bb08d06de39aba76c70b3a4b9bfd36d0337b36e028ad8c942"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_analysis.py__Test_runner_for_data_f_files._": {"doc_hash": "2cf2dde254a9ece1ea4fd6f8eca5af3a7ecc175c77d850a5e7d50890ccc3457f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_analysis.py_TestAnalysis_": {"doc_hash": "388cc9149ab4a8caf6b17d3c9e9fe5454b42776488f355a21877df745e78a515"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_commandline.py__Test_cases_for_invokin_python3_path.sys_executable": {"doc_hash": "d9822734d46187ec8f279e7376ee913d1d686d34a2053ad78aac30c163f3cd90"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_commandline.py_TestCommandLine_": {"doc_hash": "a4acce920e6c8bede77ccdab72d12755706ed3876d2f303afde8f469374613a8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emit.py_unittest_": {"doc_hash": "373db557f645d4b7a4500fba0b58f089d45dad869f423b18570bb99af352d334"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_unittest_from_mypyc_namegen_import": {"doc_hash": "3b8b63126e1ccad4ee24cd099f86df748ba31cb4948a0a7540cc39a7c8f82544"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor.test_goto_TestFunctionEmitterVisitor.test_int_neg.self_assert_emit_CallC_in": {"doc_hash": "1347bb210fac03e8a05a78071adffc0c3821535fec1f04cf90ac11a2e55c9378"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor.test_branch_TestFunctionEmitterVisitor.test_branch.self_assert_emit_b_": {"doc_hash": "e0c57d067a96cf6fc208100ff58242d0357496caba49b5123b546f46aa7f4c37"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor.test_call_TestFunctionEmitterVisitor.test_list_append.self_assert_emit_CallC_li": {"doc_hash": "515e44d9695e8cc3f122d25c772315bfc3f8c239b401868b3204bb662ec67f98"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor.test_get_attr_TestFunctionEmitterVisitor.test_get_attr.self_assert_emit_": {"doc_hash": "5b7e91d5953fdd2e6d28134abbac4448d322a0f67fe777cd2f0a5e364c9888b9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor.test_set_attr_TestFunctionEmitterVisitor.test_set_attr.self_assert_emit_": {"doc_hash": "0368537cc21639fe6648d752803733667fab6eac021354eab4dc5e9f32f19eae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor.test_dict_get_item_TestFunctionEmitterVisitor.test_dict_contains.self_assert_emit_binary_o": {"doc_hash": "5cfeee4d813c37649d81310342ebaa4a39c17cf9c083c2f3c846da1d950dd327"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor.test_comparison_op_TestFunctionEmitterVisitor.test_comparison_op.None_7": {"doc_hash": "3f58e700a3f99a27320a8aa817850bd40cc8a962340c389bd53c8f9bfaaa4518"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestGenerateFunction_TestGenerateFunction.test_simple.assert_string_arrays_equa": {"doc_hash": "08128f100677766960ec1dcc375344ca44736cbffa9997f1bcb6f02da78aed4e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestGenerateFunction.test_register_": {"doc_hash": "0b0019defa0124883da727fdde1d41cc5505433d27329e539516b84084478a1f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitwrapper.py_unittest_TestArgCheck.test_check_list.self_assert_lines_": {"doc_hash": "c09632dcf18506d49480d84319a656ca8008c87564e7b1370b81645b75ec9f5b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitwrapper.py_TestArgCheck.test_check_int_": {"doc_hash": "c21863e0f68b12e71af61496e48ec07e78a7d4d64b62fa46c5694eaff88f298b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_exceptions.py__Test_runner_for_except_files._": {"doc_hash": "4043d295bc764cedc2f4eb7fe531241430adeec850334a29e8b8caa35495740d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_exceptions.py_TestExceptionTransform_": {"doc_hash": "1a108bb274b7521aa33b6c1071ab8335f8200164aaa9fa443fcdb081ee93091a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_external.py__Test_cases_that_run_te_": {"doc_hash": "1ec6630a010b139b20d62ee29dd2d5c304b83456a1dfa0aa8f75c2ee390b162c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_irbuild.py__Test_cases_for_IR_gene_files._": {"doc_hash": "d47a32eff594bdd18dbb7c593de408ad7db6b6e08efa2926e259057b10400bb0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_irbuild.py_TestGenOps_": {"doc_hash": "070763ed05b09e50b28dc6ed415e9f48c101e30ae9ca78fde078d9f4cea22a8b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_namegen.py_unittest_TestNameGen.test_make_module_translation_map.None_3": {"doc_hash": "2e4e22b6e72bd05e98809d85b098d0a5e722fa56066c295ca92337936ee85610"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_namegen.py_TestNameGen.test_name_generator_": {"doc_hash": "33ea68c633f3c53a1e0d31381950a760e13731a3835b8445878385713f115744"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_refcount.py__Test_runner_for_refere_files._": {"doc_hash": "3fbb9b4092e93d442da41ccbfc7990c285026b74f34ca1712ff9d691f20f39ad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_refcount.py_TestRefCountTransform_": {"doc_hash": "da6a02378907e821a44c98b5a1862e58d72357e8be8399b3df51506d57f5fe4e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_run.py__Test_cases_for_buildin_WORKDIR._build_": {"doc_hash": "43e98cdb277b007519bbaf87a05d6030663069928e4d3aee2fb67071ae79eef6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_run.py_run_setup_run_setup.return.True": {"doc_hash": "ac6451aa05a57117785209707fa96e7f01f13733adadcf875d2dc35fbdd19fc5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_run.py_chdir_manager_TestRun.run_case.with_use_custom_builtins_.self_run_case_inner_testc": {"doc_hash": "516abef18b4ea89b16ae7a25a5805a97c3df83150db4ad0d4ec68d0175a95fca"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_run.py_TestRun.run_case_inner_TestRun.run_case_inner.for_operations_in_steps_.self_run_case_step_testca": {"doc_hash": "67158d88a58d61a549a4b275ee14bd32b6cbcb753c9a261ea82ee4ece69e9ad8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_run.py_TestRun.run_case_step_TestRun.run_case_step._Assert_that_an_output_f": {"doc_hash": "97647cec8f030bd493ccade3f1140d3cb8454ed78f7b77c38a6ddab9bdc589f2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_run.py_TestRun.run_case_step.suffix_TestRun.get_separate.if_m_.else_.return.True": {"doc_hash": "ce08ae4f9066b5b3ac4205419ac32970c81f3940b85ec75849240e00462383d5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_run.py_TestRunMultiFile_TestRunSeparate.files._": {"doc_hash": "4359137bfa69c7ddde3e0e58d2c11e2391b5f4a2e8fea09e0d6eb934f21d64d8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_run.py_fix_native_line_number_": {"doc_hash": "25c0da1f4fa0d79c14e673b04887708a31ec88b8fac746dc621d3d0fb7d890dc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_serialization.py__Functions_to_check_tha_get_function_dict.return.d": {"doc_hash": "3686ef1e4f461ed053ec9031aa6567719bf5efbc225d8a14f24ab1968e860e22"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_serialization.py_assert_blobs_same_assert_blobs_same.if_isinstance_x_FuncDec.else_.assert_x_y_Value_mis": {"doc_hash": "efa74322b4d03788de9ad743393ae349345e2898be869848c053b3bedcbcc020"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_serialization.py_assert_modules_same_": {"doc_hash": "8ca77071fd752bf7848f8359cb4f826247d85dfb146a8699f371c0194f29d660"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_struct.py_unittest_TestStruct.test_struct_offsets.assert_r7_size_12": {"doc_hash": "cc1012cf559f9e1704c84af3c18fe1923729b77abc12bd573a0ec61101f5bb06"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_struct.py_TestStruct.test_struct_str_TestStruct.test_struct_str.assert_repr_r2_RStr": {"doc_hash": "9504d452ad3394589869a1395daf2c3a354ef4cf0ec3338e78ebabba89b7bf8d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_struct.py_TestStruct.test_runtime_subtype_TestStruct.test_runtime_subtype.None_4": {"doc_hash": "6ca7dac6553e3e8a78dee7822b1d419a95fe3c4b3d61e1939a19002d24ff8f48"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_struct.py_TestStruct.test_eq_and_hash_": {"doc_hash": "8bbbb1350d855b1b759c4c1bf155cd38e5284035c336829a522123e9ccfd95e9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_subtype.py__Test_cases_for_is_subt_": {"doc_hash": "ad8045de4862cba8dc5095c672fb50fe01a0e67dd722b43651c7a5a6a8de5a5e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_tuplename.py_unittest_": {"doc_hash": "33b031015cc8b04143e525bd5efdb6b8c1cb10ce163c5465792f605f9ae3355d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/testutil.py__Helpers_for_writing_te_builtins_wrapper.return.lambda_testcase_perform_": {"doc_hash": "db59638debb32efc86c42822d9128f3a80e0214e718f595bab3e5a92fd0f97d8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/testutil.py_use_custom_builtins_use_custom_builtins.if_default_builtins_.os_remove_builtins_": {"doc_hash": "c6899e6d4dd86410c257afc183b7754c1ce4ad64b52aa8ce389ed73224db5a7c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/testutil.py_perform_test_perform_test.if_default_builtins_.os_remove_builtins_": {"doc_hash": "104f6fcb917311e3261352255b5f14044ad2017a59edeca05a34b4cd53d4c7f2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/testutil.py_build_ir_for_single_file_build_ir_for_single_file.return.module_functions": {"doc_hash": "13649e03a69923fb8b5acdb0f05ac555c8da1e0ba758fa7452fb2f2982b64af5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/testutil.py_update_testcase_output_update_testcase_output.None_3.print_data_file_f_": {"doc_hash": "c3549c1a653090e85a2fc287ecee60a15736c1d4dff1cca320e9f77c75c2c64e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/testutil.py_assert_test_output_assert_test_output.assert_string_arrays_equa": {"doc_hash": "601c86e3265205281f4f190e0e7d3002012455b733e5c30647330235c1719cf5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/testutil.py_get_func_names_replace_native_int.return._s_replace_native_int_": {"doc_hash": "6d8c1d4cafa27f00eb9b5c433c351cb37c242ad73f5420a44af9f16d00e5e834"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test-data/driver/driver.py__Default_driver_for_run_": {"doc_hash": "3af36ebf11ab8e8cd76a5f6410adbd600d7384f51b6b5103befdf5ef93f4ff1c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test-data/fixtures/ir.py__These_builtins_stubs_ar_ellipsis.pass": {"doc_hash": "ed9c66131866a55e952801dafffefc58c0dce9ebdf58744fd91a19b0494d3110"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test-data/fixtures/ir.py__Primitive_types_are_spe_int.__ge__.pass": {"doc_hash": "e0cc4f55884706c82f8969a81c6c759b862cf70e749e275b203eaa113dd0488f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test-data/fixtures/ir.py_float_bytes.join.pass": {"doc_hash": "55ec44316630029228de517b0243f0a2664041d1faf3ce5f5c2e7d3a171dad84"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test-data/fixtures/ir.py_bool_bool.__xor___5._": {"doc_hash": "973e26991b240cbd548cb2739dc35436aa467c56ba8f8503ad63469b653c07b3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test-data/fixtures/ir.py_tuple_function.pass": {"doc_hash": "a5cdf56a366a4405e20103d623339e1d81a92167fcd7ef791c8cbf739da11ef1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test-data/fixtures/ir.py_set_slice.pass": {"doc_hash": "0487bb45052b641631a1ac5088d9d7566236449d1f7b9558dab7c8ad1c2b3746"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test-data/fixtures/ir.py_property_property.fdel._": {"doc_hash": "7219137a932ec25108d03f1caabc4cd76fdc3783474bf1f340c26b26cf6e10d0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test-data/fixtures/ir.py_BaseException_": {"doc_hash": "60ea3b9158df63c74ab334bc465dda1e63abb15a00841ac41b36db5e2a2e2d7d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test-data/fixtures/testutil.py__Simple_support_library__V.TypeVar_V_": {"doc_hash": "41451c406750ff9d81c41f5b709b2936bb551540932e9b22e91dbff599167f64"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test-data/fixtures/testutil.py_run_generator_": {"doc_hash": "d3875ac44a57221b2d8a6d2bdd659311e4fee9a380754d6a845db5bcc5e68d88"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/transform/exceptions.py__Transform_that_inserts_from_mypyc_ir_rtypes_impo": {"doc_hash": "b8effadaaf2d3f2c0f8b72e282abdf9bc9ef0c1bb7ab3eccedf05cdc052e34cd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/transform/exceptions.py_insert_exception_handling_add_handler_block.return.block": {"doc_hash": "89b985f8941bf1395d863bd866e49aae5a3058ef2b8242e5edbbd48c17028f55"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/transform/exceptions.py_split_blocks_at_errors_": {"doc_hash": "3f7ef747f2fc84a9c003932d136be51ddf716bca62c9812c4b28f712c8f36543"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/transform/refcount.py__Transformation_for_ins_BlockCache.Dict_Tuple_BasicBlock_De": {"doc_hash": "e821b9be405c21b33e011579574ee09daaa9e7c222c6daee42cab53048ea2371"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/transform/refcount.py_insert_ref_count_opcodes_insert_ref_count_opcodes.cleanup_cfg_ir_blocks_": {"doc_hash": "20f6b168af8c7fab372ab72937f936ab4b699be4082b2e39285bf932c8f12c15"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/transform/refcount.py_is_maybe_undefined_maybe_append_inc_ref.if_dest_type_is_refcounte.ops_append_IncRef_dest_": {"doc_hash": "ec4beaca55ae3df24375ec49ab810b047fc4d526cfbf80a2281a82b06e2acffb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/transform/refcount.py_transform_block_transform_block.block.ops.ops": {"doc_hash": "845ecabcdfc2d88a64398c72da2f843c9e384a349b47f6cbf0bc583af207de19"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/transform/refcount.py_insert_branch_inc_and_decrefs_insert_branch_inc_and_decrefs.if_isinstance_block_ops_.elif_isinstance_block_ops.goto.label.add_block_new_decincs_ca": {"doc_hash": "2a83d2c3abafd7af1b7b34865390d9d7040b56902f01bab2b15bd029a4236309"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/transform/refcount.py_after_branch_decrefs_after_branch_decrefs.return._": {"doc_hash": "03f4a558c0777d6ccc57841327712457c0b4e5224932b569c7e823cb71f3fd5b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/transform/refcount.py_after_branch_increfs_after_branch_increfs.return._": {"doc_hash": "1f36b1bba651a3d1707622e04371d90a6a1667e43c239500a12e33ae1ee510ee"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/transform/uninit.py__Insert_checks_for_unin_insert_uninit_checks.ir.blocks.split_blocks_at_uninits_i": {"doc_hash": "7611ce368cdf5b16c188732114ed96a9a1b5da1964a04f4573a56c5ff078892a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/transform/uninit.py_split_blocks_at_uninits_": {"doc_hash": "2b0ee6ba6711cb238b55d63e9438867ecc2170951171a35e18270b047a0aca74"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/runtests.py_main_": {"doc_hash": "8f41a59a7cc3f56f0b9453bbc190c80a800bda26f95c4dc3e85800441677b84a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/scripts/find_type.py__usr_bin_env_python3_process_output._finding_no_reveal_type_": {"doc_hash": "3c117aa0bf51f2f25a850ef7d065a1fe360c1f482188f14e8ba5cf83a247646d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/scripts/find_type.py_main_": {"doc_hash": "a46801b04372d2955aa5b7488b74b615d1daad3062515a4612be518ca31ae8ac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/setup.py__usr_bin_env_python_long_description._": {"doc_hash": "0d2c184c4bdb9e55bf332ea0de0c897cc61f265006be87ca87767fa7fcf39f58"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/setup.py_find_package_data_find_package_data.return.rv": {"doc_hash": "4b039f75a65c30809b4789f293432c6048ecc556020bf8d2022f9b66e87d4871"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/setup.py_CustomPythonBuild_if_os_getenv_MYPY_USE_MY.USE_MYPYC.True": {"doc_hash": "612ed869428a06c32d8ccc59c4d852a03934f548be18af087dc1f7f4f642494f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/setup.py_if_USE_MYPYC__if_USE_MYPYC_.else_.ext_modules._": {"doc_hash": "41b937b09d6abea1a1f988d00876c3745b3068f31f63235594742dd260ab59f7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/setup.py_classifiers_": {"doc_hash": "e778e1b75009b5ad2e1e63ef95710cd5587b4ab225d362d98b244efaa5887b3c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/modulefinder-site-packages/foo/bar.py__bar_var._bar_": {"doc_hash": "5ed6be4134a19a983656a900fef95c52bc2bb5979a83052d3a7c9589a4e0385e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/modulefinder-site-packages/ns_pkg_typed/a.py__a_var._a_": {"doc_hash": "9c503f5cf2e3f1ca1decfb027ed234bd5918729da095b7aae60b4b58a4b78972"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/modulefinder-site-packages/ns_pkg_typed/b/c.py__c_var._c_": {"doc_hash": "1510c514f1a16b32c882adefc51f3a994765a7b2773bd10ab36086ab0fbcc2dd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/modulefinder-site-packages/ns_pkg_untyped/a.py__a_var._a_": {"doc_hash": "aabf048d8dffc710fcda9d6c1ba9f5920b729a4898c9993a740d0616706a6d70"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/modulefinder-site-packages/ns_pkg_untyped/b/c.py__c_var._c_": {"doc_hash": "d73c6ebf3a518c232774c6d09434b7db3ac807d4e6e4a7ffd190e3c67fcd9ac6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/modulefinder-site-packages/pkg_typed/__init__.py__pkg_typed_var._pkg_typed_": {"doc_hash": "31086001a9553499abf0c6b6c6b59919c972e1beb8fe84358567cc82353c1089"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/modulefinder-site-packages/pkg_typed/a.py__a_var._a_": {"doc_hash": "082cb5afb1a51539516a11031fec103a772d3e07e6bf9a69ed27f29e8c6bb3bc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/modulefinder-site-packages/pkg_typed/b/__init__.py__b_var._b_": {"doc_hash": "c0956bae8a09b42d52bd2a911926817d3cf7f3f4f199d10be418df508c5d0c9b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/modulefinder-site-packages/pkg_typed/b/c.py__c_var._c_": {"doc_hash": "7b148b9ba07b30f145db0fa06c363eafb375585365aa5e6990645c27cb583fcc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/modulefinder-site-packages/pkg_untyped/__init__.py__pkg_untyped_var._pkg_untyped_": {"doc_hash": "a973afff198b0050f9681837c956ebc129c8847f2e72d89af7a954aad78f44d2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/modulefinder-site-packages/pkg_untyped/a.py__a_var._a_": {"doc_hash": "0bc66eb1d521b69a03393b32daf5f16409effcee774a3f40663d492c14837794"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/modulefinder-site-packages/pkg_untyped/b/__init__.py__b_var._b_": {"doc_hash": "0b034a1c665376bc225e8acd92ab4031f74e7d07f05d6be07805aa3103289d53"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/modulefinder-site-packages/pkg_untyped/b/c.py__c_var._c_": {"doc_hash": "ff3f13fc1e45dbdb450ede21fb989b5f11424aa7d419aeadbaaa4765512912de"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/modulefinder-site-packages/standalone.py__standalone_var._standalone_": {"doc_hash": "8e5e1abb9a93a00b144999ee736e9528ca654fc74e1ca559751ca8858122438d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/typedpkg/setup.py__": {"doc_hash": "e41ad5fba82adb2d632a65be6fb92552165d7c07874c6056af6d17cb9f1f8862"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/typedpkg/typedpkg/pkg/aaa.py__": {"doc_hash": "a9f89e345984386bad54d9b0f8c0aee2bbcb0f30b206d201d80882f511496c38"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/typedpkg/typedpkg/sample.py__": {"doc_hash": "879433147ff369f2fb9fe35ef9e619af7b59efad3293219f0e32bddab04d2e0c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/typedpkg-stubs/setup.py__": {"doc_hash": "8e8dd2a07388349b3fb3997417e4ec675729506bcc313533535e84b8449c8180"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/typedpkg_ns/setup.py__": {"doc_hash": "38e24b61e6f940e0313d11a5eee8cc895d1a19ef106053e162280f0bdb444c24"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/typedpkg_ns/typedpkg_ns/__init__.py__": {"doc_hash": "07ba5a430399ffbe3c705f2132f836ff1f6cae57ed4a202ce06edbef8e1df5a5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/typedpkg_ns/typedpkg_ns/ns/bbb.py__": {"doc_hash": "9be4acbe640a5c1bf8ab4710e4d19bc41b6504f09d0b1535f97e41dd4f16413f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/bottles.py__": {"doc_hash": "5f3b5e9541b5ae2ab855fcd0543c562fbbdcf75500a0f827d5f2fb912ae68547"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/class.py__": {"doc_hash": "96474c8fff6d4ea76d04b7ca35ee116d095fdd77aad64611163ea8a3f67cf44b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/cmdline.py__": {"doc_hash": "3582bffadc182068acaeca7264392f9bcbb4d328bdfdc768a4f37d38759ff52a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py__usr_bin_env_python3_4_fix_url.return.url": {"doc_hash": "01011bc30e4c928974058ea4808eea125671a6ac6e3acc3281e199074c08e751"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Logger_KeyTuple.Tuple_str_int_bool_": {"doc_hash": "dea5e09552df2345eb525b90d0dc483af6f77bd6f1cd8c1b568d801a613493b0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_ConnectionPool_ConnectionPool.close.self_queue_clear_": {"doc_hash": "f5902f1aa85c754f684c5760cca8ab1935c5c7084da4d309150735f1ec44a08e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_ConnectionPool.get_connection_ConnectionPool.get_connection.return.conn": {"doc_hash": "2a61116718b847a7bdba834ff2516112a95560f76fae14fb3544cf94d4bfb812"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_ConnectionPool.recycle_connection_ConnectionPool.recycle_connection.while_len_self_queue_s.conn_close_": {"doc_hash": "bc8968ef80d29f7b4187bd90bfd97e033186acaa135483167870aa94bd62c0c6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Connection_Connection.close.if_recycle_and_not_self_s.else_.self.pool.self.reader.self.writer.None": {"doc_hash": "17ad9d59d34efc120e4cbba0997b76f85c13c6d9c87141d3210a369cdc068c0a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Request_Request.putline.self_conn_writer_write_li": {"doc_hash": "e6af4d58d6de0841af51c23e22288e579a50acc2c44c66a228f3c1c64322fa0b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Request.send_request_Request.get_response.return.response": {"doc_hash": "8b0bdb12bb4fe2aeccf887a4dfde0613e052be80104d5abab46dc1905dee41d9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Response_Response.getline.return.line": {"doc_hash": "a473aa2895ee22245024f941a21fc9af95f607b1b9108dd00158b9774f937191"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Response.read_headers_Response.read_headers.while_True_.self_headers_append_key_": {"doc_hash": "a47ec8d65425a74151e5ab2626cf3c5bfccf5f9bb4b40fb85005fa9b48f5b932"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Response.get_redirect_url_Response.get_header.return.default": {"doc_hash": "16b3b4e7d847c39b8800add3bea0154187cafeea97b37b56584d02091296fcab"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Response.read_Response.read.return.body": {"doc_hash": "af3510ae00a71991edc00abe68eddbf0eb3f5fc68453676e269fbb71eb73ea2e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Fetcher_Fetcher.__init__.None_14": {"doc_hash": "44a14876f836cd560b6cb92f84ceecc9f0a0dcc2f51e1f74a803674f6c397ff3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Fetcher.fetch_Fetcher.fetch.if_next_url_.else_.if_self_response_status_.if_self_ctype_text_ht.for_url_in_self_urls_.if_self_crawler_add_url_u.self_new_urls_add_url_": {"doc_hash": "6dfce8feab8d699122d7777527e19baf84628be3b8017f746b817183dc26cbd9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Fetcher.report_Fetcher.report.if_len_self_exceptions_.else_.print_self_url_self_resp": {"doc_hash": "12365c9b03fae575c1793c1e225c17f2db18d4c047e88c3df61d74353d1c9960"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Stats_Stats.report.for_key_count_in_sorted_.print_10d_count_key": {"doc_hash": "18296d4328c95ade75ec9074a684470a34f46de997ad9ec2bca714c5eebc286c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Crawler_Crawler.close.self_pool_close_": {"doc_hash": "11493f5814b468abe2b7058d94eaedf5c338ef8fe86b8619c9221f0f1e6ba41c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Crawler.host_okay_Crawler.host_okay.if_self_strict_.else_.return.self__host_okay_lenient_h": {"doc_hash": "feec6190eebd1dfa9dabdcd9e62807012c36cc3b87a3ce1aa5e364100aa17471"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Crawler._host_okay_strictish_Crawler._host_okay_lenient.return.host_in_self_root_domains": {"doc_hash": "78d64aecb6288201b0ec9c5a65ed87d9e9597269e9cc8793aea2912dcfc48983"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Crawler.add_url_Crawler.add_url.return.True": {"doc_hash": "75e01106d381f07e61eef6e7093eec86ccead3c2e37f8190dbffcbb5664f69be"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Crawler.crawl_Crawler.crawl.self.t1.time_time_": {"doc_hash": "5114788b7a49c1dc21c8c9c3ba46e7a702308404820b0ad119df657473ee1388"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Crawler.fetch_Crawler.fetch.with_await_self_terminat.self_termination_notify_": {"doc_hash": "8478eeb456f8a6b279a9b083d9219ba140997c5c98122a2d84596f00727ace0d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Crawler.report_Crawler.report.print_Date_time_ctime": {"doc_hash": "eb43e768d182ce691a8f1812f5a84fd7fce2b6e422df136f4d43907beaa852bf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_main_": {"doc_hash": "51a05e9d2198318047bb2a99b25d28464eeae8052b1357c6d37f8903ebd16bad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/dict.py__": {"doc_hash": "2c592c31c398c26bedf70efba04aafed9230e9a01123d1bd9b87a55f93ec13bc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/fib.py__": {"doc_hash": "d4a582d83cae2f1a545d3eea7c0d0b556ee6022855b56653a387393993f1191b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/files.py__": {"doc_hash": "ef83af6e343556a723b29067ac992ead83d9cb5ae2ef9cbb81a74eee57c070aa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/for.py__": {"doc_hash": "dc58e4add4b5ec17d71c2b7651aece684fac3231beaaa9454b93dfa9fcf4ae4c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/generators.py__Prime_number_sieve_with_": {"doc_hash": "3f775786babefe170464b43fefac1590d8bea8f7e0cd267cdbc999e64b121a51"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/greet.py__": {"doc_hash": "379baef6aa267287076f9c5283b80e0a577d0d94d8a8d9f779d4b9f500a01de9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/guess.py__Guess_the_Number_Game_": {"doc_hash": "f0562b25304abe627861d337c00d58efdc9c0175e16e71c13e88604ab06bd159"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/hello.py__": {"doc_hash": "53a29d8a28b31db6fabd63037b6783b79b54b60842c816818b085bb183431e3f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/input.py__": {"doc_hash": "795f6e90375c0e92496866330d5b778db116f20cdec5a2a3f36ff40083a57ccd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/itertool.py__": {"doc_hash": "c1194177bba91a0c9c52c6a23a44da006dcc318c073f35d590d384ba22492637"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/regexp.py__": {"doc_hash": "941e3f33d24dfd81b0ef79e86cce0280b5c03ac94174506b16e05343504bf16c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/base64.py__usr_bin_env_python3__translate.return.s_translate_translation_": {"doc_hash": "4b9ce984c6473853628945751e3a36222e595b1e9d705b7e0842dae85d31afc7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/base64.py__Base64_encoding_decodin_b64encode.return.encoded": {"doc_hash": "fdd8ebed3ef23024fe935088a9a4b2e688a9951686a2b2c43f31ef8fcac331e4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/base64.py_b64decode_b64decode.return.binascii_a2b_base64_s_": {"doc_hash": "817b697525a7425f3ace3f9d90e80d7bedd860c055c983ff324e3032670697ca"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/base64.py_standard_b64encode__b32rev.dict_v_0_k_for_k_v_": {"doc_hash": "bbc97d367592765340aeea8211f0de5989a1ee283dbf982999e1d9075e629156"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/base64.py_b32encode_b32encode.return.encoded": {"doc_hash": "fd6ca3f92e62172838506235a4d3a6c5d5f1b68290e77b0e6487812755abcd17"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/base64.py_b32decode_b32decode.return.b_join_parts_": {"doc_hash": "c5a11cd18df01ed7382d983efe3029442d3a35152adf652a168bcf82b75b7dd8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/base64.py__RFC_3548_Base_16_Alpha_b16encode.return.binascii_hexlify_s_upper": {"doc_hash": "b5b27bb58bf0b90553b5e80840c40d5b1f82d07c6e7ed654e4a1a1d2ab144286"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/base64.py_b16decode_b16decode.return.binascii_unhexlify_s_": {"doc_hash": "9d85734ef8a8201e22c0b1d53757d7a2b46e145dbac348222d8188b96df256b1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/base64.py__Legacy_interface_This_decode.while_True_.output_write_s_": {"doc_hash": "7dc3b0d948b1a2d8bed36fdc5ca89443b397e1a9fc34dc6cb7462e023caf7c4c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/base64.py_encodebytes_encodebytes.return.b_join_pieces_": {"doc_hash": "9946c1784c2f65f5e5744887661338f2d51ebc8110b63e7d62ea2b9cae013953"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/base64.py_encodestring_decodestring.return.decodebytes_s_": {"doc_hash": "1e6e3d9f2b468d22edf75f0586126d199cc49777e0d9f13e09f6e9cf540c31c4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/base64.py__Usable_as_a_script__": {"doc_hash": "62bb5f15781e3ccaa9377c2534b264779553908b6323dd0d2187e421541d362b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/fnmatch.py__Filename_matching_with___all__._filter_fnmatch_fn": {"doc_hash": "bfe77ac2f68b2501c3ba15c1bc5e6b9595c8df0c3f7c79bc47a823f34520c10b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/fnmatch.py_fnmatch_fnmatch.return.fnmatchcase_name_pat_": {"doc_hash": "c28e1a82c59d9aff3f25a68762dd7b348b38c9c2a7737e9f1a397e3049b05798"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/fnmatch.py__compile_pattern_fnmatchcase.return.match_name_is_not_None": {"doc_hash": "ce91d91ccca2441cae864c1d1ec95659ead13309ff473cf83df207dd24c7b577"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/fnmatch.py_translate_": {"doc_hash": "bb3252434a9e00896aeae56e829b71cdeba0d4aad1b7999234c9b88050f83639"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/genericpath.py___commonprefix.return.s1": {"doc_hash": "a4858592fe35b87a3e7c6317602ed56a4465ede8ab503e8dd05e110cf6f6e75d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/genericpath.py__Split_a_path_in_root_an_": {"doc_hash": "ff2b81be4d7e5135a0d23c6f034787bcabd709068a3b03ddeed94e8c1ab83b05"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/getopt.py__Parser_for_command_lin_error.GetoptError": {"doc_hash": "1dc65e84bdb6d13280dbb789eb75697c32bd41cb79889fb1f7cb9a3d08585863"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/getopt.py__backward_compatibility_getopt.return.opts_args": {"doc_hash": "a40b4281ca0d8592d2dd66624a6779b6df51e91b8e76b81e3333dbb1e0b7ab7e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/getopt.py_gnu_getopt_gnu_getopt.return.opts_prog_args": {"doc_hash": "139bf49be6fd24087d057e88c11a690efdb307527d0dd2b13d3ef6d2b42f4958"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/getopt.py_do_longs_do_longs.return.opts_args": {"doc_hash": "8029507a80ee6c6be40a40c15ed5e91eb8156b1f5163aeb8522c7516ed9c6a3c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/getopt.py__Return__long_has_args.return.has_arg_unique_match": {"doc_hash": "697a87e0badb98dbe7301f3be8395f1705420b1d1bcca9e80844d15f6503bfb1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/getopt.py_do_shorts_": {"doc_hash": "fc1d134a8d5604c236ba7ff6430bc96e00b3de3559f0720b13c2b349700d6b67"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/glob.py__Filename_globbing_util_iglob.for_dirname_in_dirs_.for_name_in_glob_in_dir_d.yield_os_path_join_dirnam": {"doc_hash": "a5a6a24f285b04fee310fc55b45a89c135471634ccd307610127d4974bd21c6c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/glob.py__These_2_helper_function_": {"doc_hash": "5e3ed2e3251a9d58b2fd9db2a0b1e31d14eb628b928a1237669e729d51e4d603"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/posixpath.py__Common_operations_on_P__Trailing_es_are_stri": {"doc_hash": "1552e4f61909c61900925c4656d11b7737e5397aa3875a4e9edc4d05159f2692"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/posixpath.py_split__describing_the_same_fil": {"doc_hash": "f216a452e4571bcd683b89c0babd8efe70fbb783ad60b785974ba32725978dc7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/posixpath.py_samestat_ismount.return.False": {"doc_hash": "ca412c628e5973046d782d0a457915d80ddb107e3820399d0936ec458b9332aa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/posixpath.py__Expand_paths_beginning__expanduser.return._userhome_path_i_or_": {"doc_hash": "b83257eecb0e16cbbdae92bbb8fe018e90e29c76a15110aa41208e696334ff25"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/posixpath.py__Expand_paths_containing_expandvars.return.path": {"doc_hash": "02ca35fcd6f00f76e06811965ad546a5da141084fcfef9c2ef7414e02c3502e3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/posixpath.py__Normalize_a_path_e_g__normpath.return.path_or_dot": {"doc_hash": "28caffd89bc393ad560e6a102b916b02254d44e42d361ed8a5b56a91c9d631ce"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/posixpath.py_abspath_realpath.return.abspath_filename_": {"doc_hash": "1e3d98b32815863230af19ac93ed9b425680e15ea665a581371664ab00c0fc0e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/posixpath.py__resolve_link_supports_unicode_filenames._sys_platform_darwin_": {"doc_hash": "c8bd5853c0932af1122a7dc1ce5b4a76ff4165ee523112fda84f3baf83f46bdf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/posixpath.py_relpath_": {"doc_hash": "ba8c51803b0b03d8acc7463dd8c6997e95a8f5b7a7c8db19296caef62b3667fe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/pprint.py__sys_isrecursive.return._safe_repr_object_No": {"doc_hash": "ca281d78af8996534d00c7675543c844628dcdc29d86c7163fc0f78bb140b03a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/pprint.py__safe_key__safe_tuple.return._safe_key_t_0__safe_ke": {"doc_hash": "70d742a1b2e39cc88faafc819a4333f4f5e9362af4beae892eaaf9d6d5737f4d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/pprint.py_PrettyPrinter_PrettyPrinter.isreadable.return.readable_and_not_recursiv": {"doc_hash": "87ee1bae6ce94c7e1404766af8c6401215116e0477f709337a61d61f67444b61"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/pprint.py_PrettyPrinter._format_PrettyPrinter._format.write_rep_": {"doc_hash": "2f7464c02f56e3c2cffe14c0922c994a33e2d731463d385962de43619692d6fa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/pprint.py_PrettyPrinter._repr_PrettyPrinter.format.return._safe_repr_object_contex": {"doc_hash": "55cb470eec63cb75b082b32ca9e3a8a4fec337ea2518bb276aa18a6d774749c2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/pprint.py__Return_triple_repr_str__safe_repr.return.rep_bool_rep_and_not_rep": {"doc_hash": "dda30c094db38fa3cdde9234a6cca7819fe3375d4aced2d6fbc49cf2f0f2b59d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/pprint.py__recursion_": {"doc_hash": "6cd9b0ca304057fa96b7692fce7c51540e4143a49bfa315ee6f4ca47e4deff7f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py__Random_variable_genera_T.TypeVar_T_": {"doc_hash": "3116213d4d38a16c55b2972150da1ef354d47e7f8c32e1260f01ef276a4b7df3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random_Random.__init__.self.gauss_next.None": {"doc_hash": "9b530cba7d031819ab5c06e2783a5acdcb7ee712a164937143b523c959b0de69"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random.seed_Random.seed.self.gauss_next.None": {"doc_hash": "10ceab2586c61833bfd4f28992c2dda223718a926b00a42fa792c7ab503aa9ab"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random.getstate_Random.setstate.if_version_3_.else_.raise_ValueError_state_w": {"doc_hash": "a3d2a6972f1b613f764114d83af74e67c68f06b92280abeef2a394ed561c1cd5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random._Methods_below_thi_Random._i": {"doc_hash": "193e8a4522fdf9e711484e45ff706cd7f23ad1d08e8be1fdbf0ac0403577090d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random.randrange_Random.randrange.return.istart_istep_self__rand": {"doc_hash": "fad95eca3cd1d24b8864463452069cb118ef1e3096c5faa7bca056d48763a2f8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random.randint_Random._randbelow.return.int_s_maxsize_n": {"doc_hash": "077cff828e44898d48e5b4aadd22fb145643465fe9be2cea5322e99cded834f0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random._s_Random.shuffle.for_i_in_reversed_range_1.x_i_x_j_x_j_x_i_": {"doc_hash": "c010c87da25c106646de21c925c8c7daaf0b16b4bc11d02dace6d74188169f6f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random.sample_Random.sample.return.result": {"doc_hash": "4a976ca87817b62af3a5f478c198054ea9bf56ecf74d301b7132f5f97de633e4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random._r_Random.triangular.return.low_high_low_u_": {"doc_hash": "10fd6a6620edadf92dda85f3bce06bb81d59f574d44bd76d6bca9ff1858771a5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random._n_Random.normalvariate.return.mu_z_sigma": {"doc_hash": "3afdc89d6069cf77839f176ce079d63af1c61a2e24c0efdb2e8703fd933707d6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random._l_Random._v": {"doc_hash": "e9a3694b9f706349aff06d4bac4ad234195187c12680084ea11e9a9c0445ac57"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random.vonmisesvariate_Random._g": {"doc_hash": "2857b37cba6edc061bb7e9b99ac606bd38e750b4bf500140229f5c75a234587a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random.gammavariate_Random.gammavariate.if_alpha_1_0_.else_alpha_is_betwee.return.x_beta": {"doc_hash": "ba64741a6c3fc80bf1740eca864dc0e66c759aff553d8e16083a3de7ad43fcad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random._G_Random.gauss.return.mu_z_sigma": {"doc_hash": "1d1eed8f3ab17bb4f72e25f3594145192df657d568368ebac9796cee2229183a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random._b_Random._was_dead_wrong_and_ho": {"doc_hash": "18c9f11e52e684f45bcf573277adc25cb596a9421843c64cce18e1306c3145ec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random.betavariate_Random.betavariate.if_y_0_.else_.return.y_y_self_gammavariat": {"doc_hash": "eadea7a7b4ee971b0c61e0e483c39768dfb63fd692721854ada9d43c2984d691"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random._P_Random.weibullvariate.return.alpha__log_u_1_": {"doc_hash": "812fbb2107eebbc8d3efe5486ead070e4c88b10a271071e427b4e495e3519b68"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py__Operat_SystemRandom.getstate.setstate._notimplemented": {"doc_hash": "ba00333dde04ab043b4901f142f44bd310481b18702b32be8064f4ff9f994df5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py__Create_one_instance_se_getrandbits._inst_getrandbits": {"doc_hash": "45a08029d45b1c3f6694f6db52b66a286f6a927dd291b6098628b9c3f618f62f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py__t__test_generator.print_avg_g_stddev_g_": {"doc_hash": "c5dbe420a1f8bd05ff84e5cedb273e7bcbd3b2c1cb15828239ac0ca38af0cbb3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py__test_": {"doc_hash": "1d0eb486d14ac87cc1e29ee84e6b66d683b76ae2b289917bf174b8e886ed35e8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py__Utility_functions_for___samefile.return._os_path_normcase_os_path": {"doc_hash": "39147d565aee67281127972b122ecfe6e7dc745c14152c1b9a64dbfa86ff99e9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py_copyfile_copyfile.with_open_src_rb_as_f.with_open_dst_wb_as_f.copyfileobj_fsrc_fdst_": {"doc_hash": "2aaf72294546d57729fbb76aaea12d9bc0ee0bcfe767141618c4a433572c01a2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py_copymode_copystat.if_hasattr_os_chflags_.try_.except_OSError_as_why_.if_not_hasattr_errno_E.raise": {"doc_hash": "d4a6a72f7c0fcb697b5ef79257fd7b048433b582e9cc9f79bb3d5498e757c7fc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py_copy_copy2.copystat_src_dst_": {"doc_hash": "759f6d4135da00487a34acf96cc3bb57854c6193538cd0bdc6d9ebf0bb38d2ef"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py_ignore_patterns_ignore_patterns.return._ignore_patterns": {"doc_hash": "23a9e0a6871aa0f9d89d2a045e9ed68057f6a4ac28ca46cf18d3c6fc3e9f7484"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py_copytree_copytree.if_errors_.raise_Error_errors_": {"doc_hash": "35d2d4716c6a35a569781ed85665209b7bcab8ac1c7ed8bd129c025ec17fbe88"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py_rmtree_rmtree.None_2.except_os_error_.onerror_os_rmdir_path_s": {"doc_hash": "6d52eedc1081b1ef4ee64e00d261b787abfce96607fa430d0df237b38137b0d5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py__basename_move.try_.except_OSError_as_exc_.if_os_path_isdir_src_.else_.os_unlink_src_": {"doc_hash": "6b9f4e8240dc4eeec0f7de9fbc879c8b952e7a0fad80f0f51ef7e94f6656572a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py__destinsrc__get_uid.return.None": {"doc_hash": "f53869eacc35727a418286d2a5c34fcf824ca0524a0709f66735ab7c68ffa463"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py__make_tarball__make_tarball.return.archive_name": {"doc_hash": "7e34f36ae717b6f771e81dce911b5640be3d8e672e0bda43252bb49ef59a87ee"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py__call_external_zip__call_external_zip.try_.except_DistutilsExecError.raise_ExecError_unable_": {"doc_hash": "4f00fc039ab0b53a5c508503c551812154b379839763e303e61e0c329342a995"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py__make_zipfile__make_zipfile.return.zip_filename": {"doc_hash": "161f62a565832706cff99edd2daad4eb0f3527a3268db87c5ee2b9f08c682902"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py__ARCHIVE_FORMATS_get_archive_formats.return.formats": {"doc_hash": "2590953dc4e1168e2cebf8bf2ae60c96a2a06dc324a068d90c18b630ac01278f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py_register_archive_format_unregister_archive_format.del__ARCHIVE_FORMATS_name": {"doc_hash": "a61f3af0d09814e6d7882b26e46af3669b6e2b18bb024b6003149a4eea0f2d01"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py_make_archive_make_archive.return.filename": {"doc_hash": "8acb862231530f815a88ab593e9e3be87c284c3528af136b51b88d79b81e4a47"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py_get_unpack_formats__check_unpack_options.if_not_callable_function_.raise_TypeError_The_regi": {"doc_hash": "a79b84062c3d939d437561271b593ce104894c8f3a29600fdc1869cf2dced917"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py_register_unpack_format_register_unpack_format._UNPACK_FORMATS_name_e": {"doc_hash": "30d2f002409ab04988dff89bd2dda0451daad3daf5514db5becf9b5ae3395ddd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py_unregister_unpack_format__unpack_zipfile.None_1.finally_.zip_close_": {"doc_hash": "3ff47d0e259d57c777400df64f2f1ff18c9371ca49a427a7522550f483bb643d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py__unpack_tarfile__find_unpack_format.return.None": {"doc_hash": "089969d827203f5fa038127928563435df3df9521b0df1fd3578992b9ab1315c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py_unpack_archive_": {"doc_hash": "121577703fee41d6a582cc235c1bcced6d8072043117c3c0c3a403cc124a4412"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/tempfile.py__Temporary_files___exists.try_.else_.return.True": {"doc_hash": "26c554d6d0c19841a8dccd8449ed73fd79eabde051768232a1b53d7ec42a5072"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/tempfile.py__RandomNameSequence__RandomNameSequence.__next__.return._join_letters_": {"doc_hash": "06ab41a17b12bd63748587f187a05f05eaef08151c8c55822e16bdf8d9bb6de5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/tempfile.py__candidate_tempdir_list__candidate_tempdir_list.return.dirlist": {"doc_hash": "a0b2cc8872c5031ac36c351ee2477a8728b461139e2bcadf530b3c41f15dabcf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/tempfile.py__get_default_tempdir__get_default_tempdir.raise_IOError__errno_ENOE": {"doc_hash": "e5a9b57bbf75b02a3fc79697d2d194b63eccb82360a787609426d697203b48cd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/tempfile.py__name_sequence_gettempdir.return.tempdir": {"doc_hash": "b46e2859522a49f21523b79124acf125dc251793c9fc17687d234fb568fdb218"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/tempfile.py_mkstemp_mkstemp.return._mkstemp_inner_dir_prefi": {"doc_hash": "fd7d3615ada3d1dcdd9402159fe5459810b707ae1ed030698c3487a45524d2e7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/tempfile.py_mkdtemp_mkdtemp.raise_IOError__errno_EEXI": {"doc_hash": "31fec297b43aabe7d9ecaafd379b437a067cb14adedc2baca627ce8dbc165b8c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/tempfile.py_mktemp_mktemp.raise_IOError__errno_EEXI": {"doc_hash": "f758ff6c0455b1a05bde10b34abd002688c2f71cc4fbefd1dc1e629b9483aa6f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/tempfile.py__TemporaryFileWrapper__TemporaryFileWrapper.if__os_name_nt_.else_.__exit__.return.False": {"doc_hash": "b15eaf0e6ec83447bf825c34d330e9448baaf6c7a2b73010671b0c02356a5dc7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/tempfile.py_NamedTemporaryFile_NamedTemporaryFile.return._cast__IO__Any__Tempora": {"doc_hash": "564fa1f74316586ba6d90bda062ca0fa3c6e8a3aff71d29483d569e7438ab057"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/tempfile.py_if__os_name_posix_or_if__os_name_posix_or.else_.TemporaryFile._TemporaryFile": {"doc_hash": "1ad4085a487b56a3c0a319d1f4fe0cf4bfd69b342806fd5f7a413a921c1a83ee"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/tempfile.py_SpooledTemporaryFile_SpooledTemporaryFile.seek.self__file_seek_offset_w": {"doc_hash": "bb7c08d538f2fd01f08baf62b98c714e8dc8ea4327fc7f99beadc69469c8c494"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/tempfile.py_SpooledTemporaryFile.softspace_SpooledTemporaryFile._return_self__file_xr": {"doc_hash": "7b10786b9dfb4b698dec5611cd919da5d3d5577024913c9beb5f58e646f5e145"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/tempfile.py_TemporaryDirectory_TemporaryDirectory.__enter__.return.self_name": {"doc_hash": "112b4967839e3c336e9dfee8c7fe2072f57aa9ca544d098e0877618d4e68347c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/tempfile.py_TemporaryDirectory.cleanup_TemporaryDirectory.__del__.self_cleanup__warn_True_": {"doc_hash": "3a24a5e656beef7016723e76256a805f22408da94d748d009201993a0abe43e9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/tempfile.py_TemporaryDirectory._rmtree_": {"doc_hash": "32351e7e5ef38fa5e84be7a14d6eed75a2954af550e5668b8fedb0c338148828"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/subprocessdata/fd_status.py__When_called_as_a_scrip_": {"doc_hash": "06cd2090a34f91b8e75e348a1c43bae03aaa405bf15540665a4578cf6bb2fe23"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/subprocessdata/input_reader.py__": {"doc_hash": "8403ad5df89600ff0e5b82c37cf5985ddbf92208c7f89431b3739755798a773c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/subprocessdata/qcat.py__": {"doc_hash": "e7cb7f88da205df42c085ad0c430049e5a33c953049e54cad092b83d0f100e05"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/subprocessdata/qgrep.py__": {"doc_hash": "9c6e61e97c7a026a4ab1f5e971efac646124a8a8a611318158f00b9d3a289bdf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/subprocessdata/sigchild_ignore.py__": {"doc_hash": "77c2449d0f97581cb391d61cfedf120721bd305eebd3c02222fdd0923323817b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py__Supporting_definitions_import_module.with__ignore_deprecated_i.try_.except_ImportError_as_msg.raise_unittest_SkipTest_s": {"doc_hash": "fc89daed0e46fe822aca079af905ae072b9a86176fa8896c008a208f3c4b6211"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py__save_and_remove_module__save_and_block_module.return.saved": {"doc_hash": "6e61e665ca00573de42cc4de1094cc2ec732742f5adbcdee61b5d016b1632109"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_import_fresh_module_import_fresh_module.with__ignore_deprecated_i.return.fresh_module": {"doc_hash": "fa9fb36ae844cc9793b9cfcfcb1ce639c10b727021f975f907ff498ac0b0e3b4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_get_attribute_rmtree.try_.except_OSError_as_error_.if_error_errno_not_in_er.raise": {"doc_hash": "11d146076d0706188ce60c2ae1992860b43d77ad14dca82c422ff97bbeda158f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_make_legacy_pyc_make_legacy_pyc.return.legacy_pyc": {"doc_hash": "bff4c7b415ca1c458c0732a1c9fb757e805fd3e8a89afb54e59111e841c5fad8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_forget_forget.for_dirname_in_sys_path_.None_3": {"doc_hash": "d2a1d3db21d00d871353f5aafb603ffc9ca4329e2657c8670b934f5bdd540846"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py__On_some_platforms_shou_is_resource_enabled.return.use_resources_is_not_None": {"doc_hash": "121621f842ab8c1e8ee97be5206410a485f02ddb203d4939636e2c54b77fd753"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_requires_requires.if_not_is_resource_enable.raise_ResourceDenied_msg_": {"doc_hash": "9c3c517c50bbd8a6c460c3827c0227936abe5998f97260935432dc4bfeb34f5a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_requires_mac_ver_HOST._localhost_": {"doc_hash": "aac996796d829f1a4c084453b743e72dac241484ed88ccf2993b4c2e07259d20"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_find_unused_port_find_unused_port.return.port": {"doc_hash": "f7a787bc6b409b72f0c6194ec17cd9ebb1bcc0513232a9c34ad1f61992a6b960"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_bind_port_bind_port.return.port": {"doc_hash": "ff9c4c58b022346e24778b94e9543ab857cd9683ae8e29c53b522d4c03b3006a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_FUZZ_fcmp.return._x_y_x_y_": {"doc_hash": "6e4a374916d933744f843acb44d4c56ea92d5a1b7def89e778462b19303d66fe"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py__decorator_for_skipping__SAVEDCWD.os_getcwd_": {"doc_hash": "987d12a90566ce0ed230f0c711997e3f9dc6b455835b4cf3726570fe363b3400"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_temp_cwd_temp_cwd.None_1.finally_.if_is_temporary_.rmtree_name_": {"doc_hash": "eeabfc54eeda441784cab039a9f1f0f853b2d2209720b9238be77dca74f0359f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_temp_umask_findfile.return.file": {"doc_hash": "8e8340559cc72cc0eaa6d07234092ec28da9e3cf9c6e514490d8ba737794353d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_sortdict_check_syntax_error._": {"doc_hash": "5cb407420ad424112fe2e4c8a136c2ad2ad7c8747d1e5792bf062f2c7a609473"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_open_urlresource_open_urlresource.raise_TestFailed_invalid": {"doc_hash": "c4917f511dcb24a6bef91b2a96b5107b1ea4504e7e833c6686cd170bcc4403f8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_WarningsRecorder_WarningsRecorder.reset.self._last.len_self__warnings_": {"doc_hash": "ea37ca41ac09c2c691ea7304929cac9abed9403062d9c092726ce49c3ba481bc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py__filterwarnings__filterwarnings.if_missing_.raise_AssertionError_fil": {"doc_hash": "4bd84e4561e4d343bb398d670c7f9701ffc508d60ad17ea767e931a31d41eaef"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_check_warnings_check_warnings.return._filterwarnings_filters_": {"doc_hash": "21ade3f4cd39eb5a0df2d91407b11eb3e01e0da006288b47cb368a1fbab47eec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_CleanImport_CleanImport.__exit__.sys_modules_update_self_o": {"doc_hash": "0c535d87708ba8b7cbb8acf2d70ff65a46b64625c51711e0be7ac5d3ae51ce84"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_EnvironmentVarGuard_EnvironmentVarGuard.__exit__.os.environ.self__environ": {"doc_hash": "4a3f26d4aab69f508870f4b91ff0890c1731f2a4d81910bb29a976d6a054f551"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_DirsOnSysPath_DirsOnSysPath.__exit__.sys_path_self_origin": {"doc_hash": "9fa12d57bb84c04cbd61668ae209689c4d10c6db5b8e196a0d0ff8a5f17806ed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_TransientResource_ioerror_peer_reset.TransientResource_IOError": {"doc_hash": "d61fccbcced3fb5929241dcb2fe95ab406b6f84945ffeb375c39d856a936ae80"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_transient_internet_transient_internet.try_.finally_.socket_setdefaulttimeout_": {"doc_hash": "9fd4f3f3a780e97b55a4cd7ec4e5ae8d4318b2eb0204df39de46fa42ee1dd2ab"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_captured_output_captured_stdin.return.captured_output_stdin_": {"doc_hash": "6c52a887421280e41b615068c04eebbb893c51e44066753299d608d73e0e6a94"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_gc_collect_python_is_optimized.return.final_opt_and_final_opt_": {"doc_hash": "30cfad515581ddcc90c81d7d67f9b5c5118428e52d661a0a665ba2a7ac598c2f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py___MAX_Py_ssize_t.sys_maxsize": {"doc_hash": "48b162e56e81d1577db1784220e2ab04498ee4aa57fa80e3852b5309af6bf1a2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_set_memlimit_set_memlimit.max_memuse.memlimit": {"doc_hash": "b899a8191584372cfb5b9cee5bb67019697fa6b986edb3224740b2e0d46d03a5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py__memory_watchdog__memory_watchdog.with_f_.while_not_finish_evt_wait.if_data_old_data_.print_process_data_": {"doc_hash": "db45d7554842f128768e2c9dfa1f973dedadf658690d46a39adb7cc5c1020255"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_bigmemtest_bigmemtest.return.decorator": {"doc_hash": "78de7cabe2f7ef2f89f6eab71b3e074137623e17d83f91a6d400a1b976460d16"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_bigaddrspacetest_bigaddrspacetest.return.wrapper": {"doc_hash": "de06cac47946a1820baaa0c227e1fae19a398eb64309cda214f4cc0d97fe8c22"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_None_62__filter_suite.suite._tests.newtests": {"doc_hash": "d7a48487ff5a057fd8e3f16739a953129200d7120b276cedd02c94e658612fe7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py__run_suite__run_suite.if_not_result_wasSuccessf.raise_TestFailed_err_": {"doc_hash": "61d2245bcaf8a4dfd106c868f1a8a3ac96d60cb78a14efb753f2f021d383cc84"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_run_unittest_run_unittest._run_suite_suite_": {"doc_hash": "e0322b7efb35c35c53e80b115f6cf276b87fbba10c815bf17999f6ec84513fff"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_None_66_modules_setup.return.sys_modules_copy_": {"doc_hash": "886dab8a21ca3285d7b1af948def1c2544f6f89de01d7727ebfcc50f6f8b7456"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_modules_cleanup_modules_cleanup.sys_modules_update_oldmod": {"doc_hash": "5869fc34e11e298badfbad9abfc6477444cb458eabe6520f7cc244352bf69c14"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_None_70_reap_threads.return.decorator": {"doc_hash": "91d8dcb0dc1fac197bd98be8976383f8c90a42061de39e0e976452c6ffbc471d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_reap_children_reap_children.if_hasattr_os_waitpid_.while_True_.try_.except_.break": {"doc_hash": "d04359614ea0f3252825a34c970d7c3a3a96ee3059c05af725a136e040ea3831"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_swap_attr_swap_attr.if_hasattr_obj_attr_.else_.try_.finally_.delattr_obj_attr_": {"doc_hash": "b9b262318396ea7d2227032281bed685a5624e4b5b1659a1c4d27344e0df4f57"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_swap_item_swap_item.if_item_in_obj_.else_.try_.finally_.del_obj_item_": {"doc_hash": "3362d7ab232a7e109e16a90f191e07aa6c1a19780a9142de072293c31321b96b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_strip_python_stderr_args_from_interpreter_flags.return.args": {"doc_hash": "c7006860dd12b8ce66738e4007b16a539c74a9f4d851c13e968d5db3e58c99e2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_None_79_TestHandler.matches.return.result": {"doc_hash": "5ccd94122fb3f3d4bbf6aca094b34923da9596efedfbdd63936005b62139d010"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_Matcher_Matcher.match_value.return.result": {"doc_hash": "c1b296873805513f6ac0667ed46a8c45f446d6602e1e7b65ddf74425bd7dadde"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py__can_symlink_skip_unless_symlink.if_ok_.else_.return.unittest_skip_msg_test_": {"doc_hash": "09968dbb417d156924fd0613c5fb8d78a8f03d28945a64147bac43f5ec68024a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_patch_": {"doc_hash": "5632758d05d6cfde61ed508419e27f153235bad3fecd7904a14e3e70548e44a8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_base64.py_unittest_LegacyBase64TestCase.test_encodebytes.self_assertRaises_TypeErr": {"doc_hash": "ed79e030da40d4faf0b8950415d3f6178090c138eda1242a931a5e99c9eecf89"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_base64.py_LegacyBase64TestCase.test_decodebytes_LegacyBase64TestCase.test_decodebytes.self_assertRaises_TypeErr": {"doc_hash": "6095471ecf2ae25091b68d607976e05722509d8af73321f4b45b8d413e16a4e6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_base64.py_LegacyBase64TestCase.test_encode_LegacyBase64TestCase.test_decode.self_assertEqual_outfp_ge": {"doc_hash": "c17b85c397703ac8336f2b37bedac87dbe91992bb440ff76eb14d45861856ed8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_base64.py_BaseXYTestCase_BaseXYTestCase.test_b64encode.None_19": {"doc_hash": "55b628a6d4fb00a4c6dab28178a3ce458b189f5f8fbc97e2177aa7799665c8c3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_base64.py_BaseXYTestCase.test_b64decode_BaseXYTestCase.test_b64decode.None_19": {"doc_hash": "0420ea3a3fe3b0ccf0d833d42ecf780e2eefd9badf6863c949619746fc6b8347"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_base64.py_BaseXYTestCase.test_b64decode_padding_error_BaseXYTestCase.test_b64decode_invalid_chars.for_bstr_res_in_tests_.with_self_assertRaises_bi.base64_b64decode_bstr_va": {"doc_hash": "9e85896bad767a886636e4f2f15190c1a9bb61437e943747d95274eec4668c27"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_base64.py_BaseXYTestCase.test_b32encode_BaseXYTestCase.test_b32encode.self_assertRaises_TypeErr": {"doc_hash": "10a0c4cec9073de25958f68ae24b8fc1c5fa42fcf5b9b9b5f48ea8b759bd7abd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_base64.py_BaseXYTestCase.test_b32decode_BaseXYTestCase.test_b32decode.self_assertRaises_TypeErr": {"doc_hash": "f893f5eac83e039415b09ca9bf987ea62bdf556d0df6a1cd4b1ae650c2734fca"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_base64.py_BaseXYTestCase.test_b32decode_casefold_BaseXYTestCase.test_b32decode_casefold.None_15": {"doc_hash": "0be21e8fcadc178e63f53a253d591a9fc84442a866b8716e0d101e5b0af6032e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_base64.py_BaseXYTestCase.test_b32decode_error_BaseXYTestCase.test_b16encode.self_assertRaises_TypeErr": {"doc_hash": "05f3da420b3103bcf28c3a74892be59709f5dcd1166d3d64576abebefed30606"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_base64.py_BaseXYTestCase.test_b16decode_BaseXYTestCase.test_ErrorHeritage.self_assertTrue_issubclas": {"doc_hash": "e62699b8fabc13ee1c24d5b2ef47bd934d0a30550ba3d712fbf3df94e3d85bc2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_base64.py_TestMain_": {"doc_hash": "417ca75a2f11d651f615b522df715e1920059d11d3b0a7a93571eb089c0c8fcc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_fnmatch.py__Test_cases_for_the_fnm_FnmatchTestCase.test_fnmatch.check_n_": {"doc_hash": "dd75dc3a93bf5596e35fa7d583b6fbca3a9fc35f4585090a493d1e9892a5620b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_fnmatch.py_FnmatchTestCase.test_mix_bytes_str_FnmatchTestCase.test_bytes.self_check_match_b_foo_nb": {"doc_hash": "dc46419e7faaed0164d9ab81c06bc9599cafeb13a9d0066d27d480cbf45db6b0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_fnmatch.py_TranslateTestCase_": {"doc_hash": "43fffde09a7442ecdfb2071f8d0bf70c942031828151f3eac4c56c107989a701"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_genericpath.py___GenericTest.test_no_argument.for_attr_in_self_common_a.with_self_assertRaises_Ty.self_fail_did_no": {"doc_hash": "efe6425e0a514a6a94968d11a216628a45a43f085158444e013a2d22532dac4f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_genericpath.py_GenericTest.test_commonprefix_GenericTest.test_commonprefix.for_s1_in_testlist_.for_s2_in_testlist_.if_s1_s2_.self_assertNotEqual_s1_n_": {"doc_hash": "6b401fa6ecacbc4df39ea404f40bedb8ad29ecc22d440bc834fb2dfee359050c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_genericpath.py_GenericTest.test_getsize_GenericTest.test_time.try_.finally_.support_unlink_support_TE": {"doc_hash": "80e3255966e51d6c1008f2f7952727309520f86ce95d16b02b51004927f8b108"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_genericpath.py_GenericTest.test_exists_GenericTest.test_isdir.try_.finally_.safe_rmdir_support_TESTFN": {"doc_hash": "db07fc6daf00b53744103871004cc677ed38e7466826db99a7e4bb2587515893"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_genericpath.py_GenericTest.test_isfile_GenericTest.test_isfile.try_.finally_.safe_rmdir_support_TESTFN": {"doc_hash": "4fc1661c97da3c564462f1572163ee324609843198697d61cba919817d5bfaed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_genericpath.py__Following_TestCase_is_n_CommonTest.common_attributes.GenericTest_common_attrib": {"doc_hash": "8d55b7e13119357f2aa009f5d678470d6a2642f4e558f7624e0a462ed97588c3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_genericpath.py_CommonTest.test_normcase_CommonTest.test_normcase.for_path_in_None_True_.self_assertRaises_TypeErr": {"doc_hash": "39843fe3891c4b22cfb7fdd889515545df9045c5a989ff5a07c542af9694d753"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_genericpath.py_CommonTest.test_splitdrive_CommonTest.test_splitdrive.None_5": {"doc_hash": "f58605bc8590905019f8376051726896e9d3eb82bc61eda612ebf49985bc3775"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_genericpath.py_CommonTest.test_expandvars_CommonTest.test_expandvars.with_support_EnvironmentV.None_24": {"doc_hash": "1dbde153f032377157906aef32ef35d7ff09f87164d53d51f0c1f8056fbd38ec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_genericpath.py_CommonTest.test_abspath_CommonTest.test_normpath_issue5827.for_path_in_.self_assertIsInstance_sel": {"doc_hash": "fe6171707c4c2b331c7b4eb830db9c612a214f67d555b2c7876334fb8a9258f8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_genericpath.py_CommonTest.test_abspath_issue3426_": {"doc_hash": "71c7f356837ba3631ac82b64836df8cab448b3756cdd886a11d75e24c6d95a26"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_getopt.py__test_getopt_py_GetoptTests.test_short_has_arg.self_assertError_getopt_s": {"doc_hash": "1d4f9a8545a25ee280bdaa1530099bba52cdf2fad7553d6fb7617d944f479632"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_getopt.py_GetoptTests.test_long_has_args_GetoptTests.test_long_has_args.None_8": {"doc_hash": "8df0f089e7831f3b39233da0c0af5a994655671884f148b8764843e7daf09580"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_getopt.py_GetoptTests.test_do_shorts_GetoptTests.test_do_shorts.None_9": {"doc_hash": "4072933c89f2818e111400c4249083aaf2684b5165884d688c5f0808626d2c0d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_getopt.py_GetoptTests.test_do_longs_GetoptTests.test_do_longs.None_11": {"doc_hash": "ba47a85f1822cd90bea7489a7aae88db951ff571958a8bba05bd94c4a4c1dd2f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_getopt.py_GetoptTests.test_getopt_GetoptTests.test_getopt.self_assertError_getopt_g": {"doc_hash": "f396d445b679a472498272ea1342f2dcb076d010537f28d387c5224dce9f6732"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_getopt.py_GetoptTests.test_gnu_getopt_GetoptTests.test_gnu_getopt.None_7": {"doc_hash": "b7be658f7072537c3d637f766227c8e5eb6c566ea9dcdf44ba350f20304aaa1d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_getopt.py_GetoptTests.test_libref_examples_": {"doc_hash": "04b3158f05b3023ecace411a7056aff0a4c77eef5445be7c011c7bfdfd021760"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_glob.py_unittest_GlobTests.setUp.if_can_symlink_.None_1": {"doc_hash": "3f2e296dea6f58b8a177698571a109d36ce713d329964226077eef2ec46f3b47"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_glob.py_GlobTests.tearDown_GlobTests.assertSequencesEqual_noorder.self_assertEqual_set_l1_": {"doc_hash": "5f34f4ff2779f4cf69c1753bbb4276a372d8c014a9dad26d712b533780419955"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_glob.py_GlobTests.test_glob_literal_GlobTests.test_glob_literal.if_set_type_x_for_x_in_t.None_1": {"doc_hash": "149cebed7b30626643e5176b5c2e6fefde8d0974df32504bb5fef78d15eca7a4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_glob.py_GlobTests.test_glob_one_directory_GlobTests.test_glob_one_directory._JLe_work_around_230": {"doc_hash": "60bd761627894835280d57b9e8e806260194faf1d7d238c42a1fd611b41575a2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_glob.py_GlobTests.test_glob_nested_directory_GlobTests.test_glob_nested_directory.eq_self_glob_a_bcd_": {"doc_hash": "2c9de321b2deafd25a7eba4e2d0406b3d660847ee0a8a7dcf4c630e62f98cc1e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_glob.py_GlobTests.test_glob_directory_names_GlobTests.test_glob_directory_names.eq_self_glob_a_F_": {"doc_hash": "e5bbb9ce5b20693c850e3256a94bc6e13fb3ce2730ee059d42352e382cf35308"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_glob.py_GlobTests.test_glob_directory_with_trailing_slash_": {"doc_hash": "77525035ffc4554bdfc6fbe1540cfcecb00aec25c4aaf8241bc29835db79d8dc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_unittest_ABSTFN.abspath_support_TESTFN_": {"doc_hash": "e1585547e9c68566a1f836f8b4b64d1fcd6366908e25560eb334c7cdfbdac3a3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_skip_if_ABSTFN_contains_backslash_safe_rmdir.try_.except_OSError_.pass": {"doc_hash": "4e63048567e2d84c79e6bacde4d6096cdf603dd21702b150f2f3448f20184d13"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest_PosixPathTest.test_join.None_7": {"doc_hash": "2a277514a680e9e95fe5787adaf3c20c75d660189fa7cf258aa3f3ff917b7288"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_split_PosixPathTest.test_split.None_9": {"doc_hash": "ce08069db04699d83674d5924a657e1be58a50b44a343c91c3d90e5a2865d9e9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.splitextTest_PosixPathTest.splitextTest.None_11": {"doc_hash": "0b321bd0c28f74a9fb7c8397ef1525f3b82257178308e116981b5d0394d72625"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_splitext_PosixPathTest.test_splitext.None_11": {"doc_hash": "2695f373bb1a99cc4c68d0d975123cb4682cd19caa779730fffb6dc542f7e39d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_isabs_PosixPathTest.test_isabs.None_9": {"doc_hash": "ca9e466ad72dfeb1f2f8ba0cc8f917ea9186e19ea30e5767684b4dee87ef7968"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_basename_PosixPathTest.test_basename.None_9": {"doc_hash": "33c99e46ed94015572f4075418cc3292b38264d84e34175625bdc84ca8c4dc75"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_dirname_PosixPathTest.test_dirname.None_9": {"doc_hash": "a3507420117e344199c4130609766847ce1fcd468cd0ba1ace8b36e699d6694f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_islink_PosixPathTest.test_islink.try_.finally_.if_not_f_closed_.f_close_": {"doc_hash": "b76fd985662c58220af9a85c06c92341ceac3ae1a6fbe4a3b52c8c517fab4abc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest._create_file_PosixPathTest.test_samefile_on_links.self_assertFalse_posixpat": {"doc_hash": "cd6e80c0e72275dee02043b2577342c53b608f808984533ce692e4898d60a9e6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_samestat_PosixPathTest.test_samestat_on_links.self_assertRaises_TypeErr": {"doc_hash": "53595a5cab94a9db34ae22b4ec513f1c37972ed6def92a7559958e4b81e1dc94"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_ismount_PosixPathTest.test_ismount_symlinks.try_.finally_.os_unlink_ABSTFN_": {"doc_hash": "6124df3a3ad3227ce177555bffaabd2c0248e662f40c3cc4a65eb22147810a78"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_ismount_different_device_PosixPathTest.test_ismount_different_device.try_.finally_.setattr_os_lstat_save": {"doc_hash": "f99ab66f6efc86ed24a4e55a242aa0b1fb8f4f68115d9dc85c6e8035e2f625cc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_expanduser_PosixPathTest.test_expanduser.try_.else_.with_support_EnvironmentV.None_1": {"doc_hash": "35d519f0b8700cebe8b58ddd4adac42b1cb9bdd3591f68e1b34f8bddf88f6c22"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_normpath_PosixPathTest.test_normpath.None_13": {"doc_hash": "05e2a0a79111e1bd5a70f6599a44b91a91b721819e7e509782f9a3bbb7095060"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_realpath_basic_PosixPathTest.test_realpath_relative.try_.finally_.support_unlink_ABSTFN_": {"doc_hash": "2b24f07275643b8b5fcc6333b03501798859f9a1365a562465e3443aaa710d91"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_realpath_symlink_loops_PosixPathTest.test_realpath_symlink_loops.try_.finally_.support_unlink_ABSTFN_2_": {"doc_hash": "6453e7c0369453bda8611d8f12983d74f6a5699f258edbe6ce255c7bc9ccb157"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_realpath_resolve_parents_PosixPathTest.test_realpath_resolve_parents.try_.finally_.safe_rmdir_ABSTFN_": {"doc_hash": "34097f5bb965bd774526e810144fe083dc9916efbca2464dc72f45a9ad164089"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_realpath_resolve_before_normalizing_PosixPathTest.test_realpath_resolve_before_normalizing.try_.finally_.safe_rmdir_ABSTFN_": {"doc_hash": "7f74a8cd9186a5cc956bc212bd45d8df416b21ba7da24765d81a941e9ccf3606"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_realpath_resolve_first_PosixPathTest.test_realpath_resolve_first.try_.finally_.safe_rmdir_ABSTFN_": {"doc_hash": "cd9413fe1d0e79aadf47e1e1ce7caba4c13cae1d6c60c6edd8c5f4fc3970c55b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_relpath_PosixPathTest.test_relpath.try_.finally_.setattr_os_getcwd_rea": {"doc_hash": "b9fb51168473e3e4256cf1399445651fc0a3ec71b193d63b273b304bed454ac8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_relpath_bytes_": {"doc_hash": "b0ae70da11a76ddc591bc634a2d9c4174e236d582a5c2437885ca0dcdf59d01d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_pprint.py_pprint_Unorderable.__repr__.return.str_id_self_": {"doc_hash": "d9d2e192400f10357530da1106cf9f17aea1848c604eb5a206518882cb616036"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_pprint.py_QueryTestCase_QueryTestCase.test_basic.for_safe_in_2_2_0_comp.self_assertTrue_pp_isread": {"doc_hash": "a0b5e443f8b40b27952a922a9cd06dff6216716e98c2a38c335df95b49cd7014"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_pprint.py_QueryTestCase.test_knotted_QueryTestCase.test_knotted.for_safe_in_self_a_self_.self_assertTrue_pp_isread": {"doc_hash": "39b4dcc26341bf43494d93c6e43a21568c16f16fc5215cf52521e8f9abb049e7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_pprint.py_QueryTestCase.test_unreadable_QueryTestCase.test_unreadable.for_unreadable_in_type_3_.self_assertFalse_pp_isrea": {"doc_hash": "667558e4ee4194480d1b4103bb0349d7824d1c74e7a426b94c956fc682dc9881"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_pprint.py_QueryTestCase.test_same_as_repr_QueryTestCase.test_same_as_repr.for_simple_in_0_0_comp.for_function_in_pformat_.self_assertEqual_native_": {"doc_hash": "69586d7d1a1ee42929c1ef09469ba844e5a0d4e97b9804d7f86571dd5069a995"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_pprint.py_QueryTestCase.test_basic_line_wrap_QueryTestCase.test_basic_line_wrap.None_3.self_assertEqual_pprint_p": {"doc_hash": "1c88155feb679483b14cc398c580d2a2e9de212af47761f1678f5ac17f77614f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_pprint.py_QueryTestCase.test_nested_indentations_QueryTestCase.test_nested_indentations.self_assertEqual_pprint_p": {"doc_hash": "e412a4a8ddc1b5839af8b2a5669acab4527cb2ae65a39814c9b228384cb5a83a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_pprint.py_QueryTestCase.test_sorted_dict_QueryTestCase.test_sorted_dict.None_2": {"doc_hash": "3a9bcb953a36b7bda33220ba75e5f306178b079ecd5162a7b787259051021101"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_pprint.py_QueryTestCase.test_ordered_dict_QueryTestCase.test_subclassing.self_assertEqual_DottedPr": {"doc_hash": "0d873918c3f70f72dceaad773344f0aff26b87b06bf59669ff4bb1eee6ce91cd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_pprint.py_QueryTestCase.test_set_reprs_QueryTestCase.test_set_reprs.cubo_repr_tgt": {"doc_hash": "901839f44b0365245d348803ab58b7d40ec83041b90cdb9b024fe909c36ba3f0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_pprint.py_QueryTestCase.test_set_reprs.cubo_repr_tgt.__QueryTestCase.test_set_reprs.None_5": {"doc_hash": "3a36515a448bb38829994c45fa72240908a71384ec5c68b93a82fe436d44697c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_pprint.py_QueryTestCase.test_depth_QueryTestCase.test_depth.None_5": {"doc_hash": "51e507310dfb2f88d32b441ceb95ea4845545323fa84a011742226896b8b2308"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_pprint.py_QueryTestCase.test_sort_unorderable_values_QueryTestCase.test_sort_unorderable_values.None_3": {"doc_hash": "de7b38ab5549456b7d4ecf869da277b45131d087e22ab02610df9abfcac0a869"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_pprint.py_DottedPrettyPrinter_": {"doc_hash": "da38ecdc8d6d3a272ca19439c4dbeaaa9a0e5ef3592755e487a264f168aa12a9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py__usr_bin_env_python3_TestBasicOps.test_saverestore.self_assertEqual_randseq_": {"doc_hash": "779451cb7243bb40135115b5d8fa2ab06fddd5de212ecb89ff1f85a78130af55"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_TestBasicOps.test_seedargs_TestBasicOps.test_seedargs._type_ignore_mypy_is": {"doc_hash": "c58f8715c645a7d91bdce1c5ed9b633d460bc6b3778ce36f9575cb9991f061c3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_TestBasicOps.test_choice_TestBasicOps.test_sample._test_edge_case_N_k_0": {"doc_hash": "dfbe48786782bf15bdd379002ae22bfeeefde767a59e575bec9e0661f686ea93"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_TestBasicOps.test_sample_distribution_TestBasicOps.test_sample_distribution.for_k_in_range_n_.for_i_in_range_trials_.else_.self_fail_": {"doc_hash": "9f42b880861745d5e7636d68ba0d65fb133fcab49f11408fb21aa6b5b02fdade"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_TestBasicOps.test_sample_inputs_TestBasicOps.test_sample_on_dicts.self_assertRaises_TypeErr": {"doc_hash": "5f580018960c79260304179da69a2a2304fa6f883650c2fce913c308f5b97b38"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_TestBasicOps.test_gauss_TestBasicOps.test_pickling.self_assertEqual_origseq_": {"doc_hash": "abd1c96b6f1f1fc08f881dce92de66db27b22906b992149ea200003e1f79d85d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_TestBasicOps.test_bug_1727780_TestBasicOps.test_bug_9025.self_assertTrue_0_30_k_": {"doc_hash": "f5705c66c250ac030933cd9a60ad2558bb483f2c6a4a787de0b3c6cd195805f1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_SystemRandom_TestBasicOps_SystemRandom_TestBasicOps.test_rangelimits.for_start_stop_in_2_0.self_assertEqual_set_rang": {"doc_hash": "c08c320e226c1cbf1be91868ad5fe8582d41e368d13207da1c72ddecb8135fac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_SystemRandom_TestBasicOps.test_genrandbits_SystemRandom_TestBasicOps.test_genrandbits.None_4": {"doc_hash": "0856edad3a915b29ccbba0d4d7a36f3ee14c038a8ec2ff6798faefa56cd5ac40"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_SystemRandom_TestBasicOps.test_randbelow_logic_SystemRandom_TestBasicOps.test_randbelow_logic.for_i_in_range_1_1000_.None_4": {"doc_hash": "952ceb6e36f483c5a9e3c2e70e27950a4ba25af8e1651d2c54239f1089a31d9a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_MersenneTwister_TestBasicOps_MersenneTwister_TestBasicOps.test_guaranteed_stable.None_3": {"doc_hash": "8e2a8a3979a46f69190cc5266c6d93531f659307d6e3b5e6c6dac350c5858603"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_MersenneTwister_TestBasicOps.test_setstate_first_arg_MersenneTwister_TestBasicOps.test_setstate_middle_arg.None_3": {"doc_hash": "aae00b1bdaf2d67c3514a9c6357af4a278d1f6bbc29b51c814cd5e3047ee2013"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_MersenneTwister_TestBasicOps.test_referenceImplementation_MersenneTwister_TestBasicOps.test_referenceImplementation.for_a_e_in_zip_actual_e.self_assertAlmostEqual_a_": {"doc_hash": "b0c51e207dfb42740445fa87fdbfcf9c215825a857e62c7f6c3fa01299d96085"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_MersenneTwister_TestBasicOps.test_strong_reference_implementation_MersenneTwister_TestBasicOps.test_strong_reference_implementation.for_a_e_in_zip_actual_e.self_assertEqual_int_ldex": {"doc_hash": "ede503693df05c5a1110b648a6dfa5ec6806f25fc8dbb17fc9cd048d8eb981f6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_MersenneTwister_TestBasicOps.test_long_seed_MersenneTwister_TestBasicOps.test_rangelimits.for_start_stop_in_2_0.self_assertEqual_set_rang": {"doc_hash": "f10434df9a1732639f8b13c8932e23877faaed14da492ba4dcb79c1c2142926f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_MersenneTwister_TestBasicOps.test_genrandbits_MersenneTwister_TestBasicOps.test_genrandbits.None_6": {"doc_hash": "6e1e9b76c1592e2df5e6ba75d171863a87e8eaa31cede534cd12d45ee6c71844"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_MersenneTwister_TestBasicOps.test_randbelow_logic_MersenneTwister_TestBasicOps.test_randrange_bug_1590891.self_assertEqual_x_stop_": {"doc_hash": "8ba1ab1c464c00484465137efd2b7261d03d493bcadd24496f89a856cd88207b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_gamma_gamma.return.az_z_0_5_exp_az_": {"doc_hash": "57a467d2224684c80f193e46cd22e114daf1cdf31278f02b9338e0e02f27db63"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_TestDistributions_TestDistributions.test_zeroinputs.g_triangular_0_0_1_0_1_": {"doc_hash": "424c9f5eeae278a3fb20e9276bb716600d1927c24157838fe7c7ede40f416a9a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_TestDistributions.test_avg_std_TestDistributions.test_avg_std.for_variate_args_mu_si.self_assertAlmostEqual_s2": {"doc_hash": "defdf237b26556c1b2e0ae6799c002c06428f573f7a97d286a38f40d468a82e4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_TestModule_TestModule.test_random_subclass_with_kwargs.Subclass_newarg_1_": {"doc_hash": "7442620f589fc692f819cc8bfc152f9a36c6083abd0905226ed036b2cf3a97d1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_test_main_": {"doc_hash": "cb84a5f29be00a19f50dcdabd1cc153220db871ea8f60635c78bc4e2f1f4a6ed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_unittest_ReprWrapper.__repr__.return.repr_self_value_": {"doc_hash": "d36288a76eb46fc56a4200a6bc8cf893463ec94345335fc8b0a71df6043b2dbf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py__class_HashCountingInt_in_TestJointOps.test_contains.self_assertIn_self_thetyp": {"doc_hash": "918c1b5edecbc4bc54a462c505406e7b33706d03e48521c8d8b7093842ff0212"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestJointOps.test_union_TestJointOps.test_union.self_assertEqual_x_union_": {"doc_hash": "f6c6d6e62dd6844da5d508f7ebcdbbf905396b88c15a6c00452378fb49d17681"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestJointOps.test_or_TestJointOps.test_intersection.if_self_thetype_frozen.else_.self_assertNotEqual_id_s_": {"doc_hash": "08e8802d0961dde08d50e30c678f0ef812dc59684c6aedc6dacdc70331cfd6e2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestJointOps.test_isdisjoint_TestJointOps.test_and.try_.else_.self_fail_s_t_did_not_sc": {"doc_hash": "2a48740cf3b4ec29b36b4efbff461a9a12f4e9395dc8d0132070c819a7bca15e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestJointOps.test_difference_TestJointOps.test_difference.for_C_in_set_frozenset_.None_5": {"doc_hash": "f5a16833df86dd0e4db17fe8538663c328b945fca97c06cab07c08d30de94375"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestJointOps.test_sub_TestJointOps.test_symmetric_difference.for_C_in_set_frozenset_.None_3": {"doc_hash": "d2630c51522b84e3a41f0045445d5ea1a2b5324564579b56901abe50eac3d623"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestJointOps.test_xor_TestJointOps.test_setOfFrozensets.self_assertEqual_len_s_": {"doc_hash": "52f4cd4a81ccb7e28d0ffb1e99a5ffc2cf61b61e8f4875e6bd76e5432a4e0a99"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestJointOps.test_sub_and_super_TestJointOps.test_sub_and_super.self_assertFalse_set_cbs": {"doc_hash": "6a8da0613d9d93909b6911f74a32a8bdb77e9fca0ff39d836f9616b14e36db06"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestJointOps.test_pickling_TestJointOps.test_deepcopy.self_assertEqual_t_value_": {"doc_hash": "d443dbe0c1604715bcdaab3d7c6a577587f3edb23e8f0ebd999ad64cf0f6eb9f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestJointOps.test_gc_TestJointOps.test_subclass_with_custom_hash.f_discard_s_": {"doc_hash": "ec58dc60027cc9e636b5e5e2dadb36f0058f7b23cb0f659b83cb19d5c92613f7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestJointOps.test_badcmp_TestJointOps.test_badcmp.if_hasattr_s_add_.None_2": {"doc_hash": "8966ce6043747077a2f730b9283bc101836c0e31f0167e30c727145300280531"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestJointOps.test_cyclical_repr_TestJointOps.test_cyclical_print.try_.finally_.support_unlink_support_TE": {"doc_hash": "2b54387bb010f5973849b5ff229214140042393c82041d7e77f00740910eb4a6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestJointOps.test_do_not_rehash_dict_keys_TestJointOps.test_container_iterator.self_assertTrue_ref_is_": {"doc_hash": "08cbe8146ffbfa9fd57e551e8d00b61013ab8d7484f53ee51aec2845f6b7d1b8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestSet_TestSet.test_pop.self_assertRaises_KeyErro": {"doc_hash": "b4b7cf828041d6ecf60254853226d39a875d442421ca295a4d1f97d6d9beb318"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestSet.test_update_TestSet.test_update.for_p_in_cdc_efgfe_.for_C_in_set_frozenset_.self_assertEqual_s_set_s": {"doc_hash": "09ec6f7f8e32c9d7d78ffbed53168f124067ca4cf8d254009c30d6304a5ef792"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestSet.test_ior_TestSet.test_iand.for_c_in_self_word_sel.if_c_in_self_otherword_an.else_.self_assertNotIn_c_self_": {"doc_hash": "61059629d6e376e00650e81c4f6dcde67ae63a0b73d8b04b0b81509f554c7b7f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestSet.test_difference_update_TestSet.test_difference_update.for_p_q_in_cdc_ab_.for_C_in_set_frozenset_.None_7": {"doc_hash": "b474b5e240f4445661f159cbd2f24caaa7475bba8ef972570da3fd6b7a152ae8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestSet.test_isub_TestSet.test_symmetric_difference_update.for_p_q_in_cdc_abd.for_C_in_set_frozenset_.self_assertEqual_s_set_q": {"doc_hash": "ea59eca1fa700c4aa71a4f6ebbdbb409c18547745e17906a7c5c70ff4ac11734"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestSet.test_ixor_TestSet.test_weakref.self_assertRaises_Referen": {"doc_hash": "eaf66a6d8cda3018dd24b6cc3706cd0193c7f8d9a3ea525c606fc2b63a9847d4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestSet.test_rich_compare_TestSet.if_hasattr_set_test_c_a.test_c_api.self_assertEqual_set_te": {"doc_hash": "83cee2d9b2a2e6589ad15ff0e43689fb9c3d4f64abbe2a2d220da605f8295547"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_SetSubclass_TestSetSubclassWithKeywordArgs.test_keywords_in_subclass.SetSubclassWithKeywordArg": {"doc_hash": "0985370c04b15d56d2fb3ec7c6a47afada3f8cdc72b5d103e3be855d55fc3622"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestFrozenSet_TestFrozenSet.test_singleton_empty_frozenset.self_assertEqual_len_set_": {"doc_hash": "43a33198f49f08116772834b2f69b8a456d72439875ebf824cd693cc0adb1199"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestFrozenSet.test_constructor_identity_TestFrozenSet.test_hash_effectiveness.self_assertEqual_len_hash": {"doc_hash": "09a615ce7000d2c40f0b78ee1ebe990d232b1cfe530bd56462255a718639e98a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_FrozenSetSubclass_empty_set.set_": {"doc_hash": "496063c155fb6e3540596e6c8cd079679691e5a059a551f423ac01ec3acbf41d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py__type_Any_TestBasicOps.test_pickling.self_assertEqual_self_set": {"doc_hash": "9a3438b8c54595f235bde720166b839b26e4f331e0520bfa7731b27e29b5f05e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_None_10_TestBasicOpsBytes.test_repr.self_check_repr_against_v": {"doc_hash": "53ff308b29b0d28b93c41e1229686755364cd54e37338076df9d801c3da00cd5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_None_16_gooditer.yield_True": {"doc_hash": "25f61e4ced6331c81d1f8fc029430d4b1c3810f1ecdb98f3077f2b4b32a21c0e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestExceptionPropagation_TestSetOfSets.test_constructor._Absence_of_KeyError_ind": {"doc_hash": "33c817bbde3b6a80ad34ba1cbdb34731aedc4559277f0d51a73f1d90e89fccd2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_None_19_TestBinaryOps.test_sym_difference_non_overlap.self_assertEqual_result_": {"doc_hash": "ba76093f2035febca42358e698fd7966f6128fd18a1740f397819ae1ca056104"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_None_20_TestUpdateOps.test_difference_method_call.self_assertEqual_self_set": {"doc_hash": "ddf3f1293d68600de5ef32bd5e1cfcb8667632ec0c7188cbcb0b6383ed108622"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_None_21_TestMutate.test_update_unit_tuple_non_overlap.self_assertEqual_self_set": {"doc_hash": "973771d31841b830fb4492774c0eee3deea21bacb42de6a312bbd07028ea75f4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_None_22_TestSubsets.test_issubset.for_case_in_.if_rcase_in_TestSubsets_c.self_assertEqual_result_": {"doc_hash": "76269f758d33604f25c4b08f3704780834ddc205b12a2ce534f592ab5114f709"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_None_23_TestSubsetNonOverlap.cases._": {"doc_hash": "97f38b3f4cdcc81f32d40b5ffb7d4c1af0e297dd2dd831bd067f560eb7d24688"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_None_28_TestOnlySetsInBinaryOps.test_ge_gt_le_lt.None_7": {"doc_hash": "89d7d9e4cdd3a9a4ff51b7c48cc56686266dd53ba3b5b83fb82d30c75df9bf78"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestOnlySetsInBinaryOps.test_update_operator_TestOnlySetsInBinaryOps.test_difference.if_self_otherIsIterable_.else_.self_assertRaises_TypeErr": {"doc_hash": "f05495e25f70f95f619460c39a8b5c915a1d826bbcf486936112d6b69454a96f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_None_29_TestOnlySetsGenerator.setUp.self.otherIsIterable.True": {"doc_hash": "8daa4b472fdb9b308158508bb0e71a4fdc76e0b38de1f62639789a03d89be891"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_None_35_TestCopying.test_deep_copy.for_i_in_range_len_dup_li.self_assertEqual_dup_list": {"doc_hash": "d8c591ba3014a5e667f015ea652bf2570d625e323ce1bb6e94b65c0ba5aec769"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_None_36_TestCopyingNested.setUp.self.set.set_1_2_3_4_": {"doc_hash": "c5636a99fc3c063659b7d52b37a5c40dce44841d159f5158ae51c5524fb57af7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_None_41_TestIdentities.test_commutativity.if_a_b_.self_assertNotEqual_a_b_": {"doc_hash": "e28032b430fe1035194dbf7b53e19202d364cc2e54a29006b9a4048a477aa715"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestIdentities.test_summations_TestIdentities.test_exclusion.self_assertEqual_a_b_a": {"doc_hash": "ed4cc10603ca4b5e0fec909dbb16a104edcd7059a2f3242270c79f8038264992"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py__Tests_derived_from_test_L.return.chain_map_lambda_x_x_R_I": {"doc_hash": "0704b894c19d64fa55593974e96a60522bd7086811338f55d0a5f91e55d17d13"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestVariousIteratorArgs_TestVariousIteratorArgs.test_constructor.for_cons_in_set_frozens.for_s_in_123_rang.self_assertRaises_ZeroDiv": {"doc_hash": "31a4e342b7fb579b84ce5f932cbbbd864372120e8d9b7c3a70b0718c042f32c1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestVariousIteratorArgs.test_inline_methods_TestVariousIteratorArgs.test_inline_methods.for_data_in_123_r.for_meth_in_s_union_s_i.self_assertRaises_ZeroDiv": {"doc_hash": "d3ccccb117018219e257f1a68692dd20c70bef90f7b4ee933773c61776a44516"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestVariousIteratorArgs.test_inplace_methods_TestVariousIteratorArgs.test_inplace_methods.for_data_in_123_r.for_methname_in_update_.self_assertRaises_ZeroDiv": {"doc_hash": "02cd8f7e44a31feff6fe53b700d26c7dc59c92c0d9cd923f63cf641b4578cb6c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_be_bad_TestWeirdBugs.test_8420_set_merge.set1_symmetric_difference": {"doc_hash": "8a59d0a27834a97929e053b77554eca179454efcb2ee5d9f843a3e89420c2a9f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py__Application_tests_base_cube.return.dict_x_frozenset_x_s_": {"doc_hash": "1caa2b9c4b675e013eef9a64b2c84b10bf7b4aab255639d0d9a6c87055b0e1a5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_linegraph_linegraph.return.L": {"doc_hash": "7eb4a1899b62a4e47ed375a20789790d98a51661aa4248f0f9351eaad2bdf71a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_faces_faces.return.f": {"doc_hash": "11fb9d4336de1da671343b70b495adce8a0a584fac2639548baedb03af988e3b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestGraphs_TestGraphs.test_cube.for_face_in_cubefaces_._each_face_is_a_square": {"doc_hash": "66e66ce21e33872a5308a79e3c3f3691c70e4da6a6adf150bbf964a5a9d4abe4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestGraphs.test_cuboctahedron_TestGraphs.test_cuboctahedron.for_vertex_in_cuboctahedr.for_cubevert_in_edge_.self_assertIn_cubevert_g": {"doc_hash": "3d40b81d5a7fb34aa9ba63867dd51d8dfbc5b3bc12658298cf2acfee198de172"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_None_45_": {"doc_hash": "a590987dda9df9c1e9251698ba6cee90403956c6187b56b53d21bafd133c00be"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_unittest_mock_rename.return.wrap": {"doc_hash": "7e400382145903e57cc046a0122e5529bf01b20e706cd374de304ac268866ea5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil_TestShutil.if_hasattr_os_chmod_.test_on_error.shutil_rmtree_TESTFN_": {"doc_hash": "ab9f625b54d8f146c9b1271670762321049f31540d1dacb6627d5078ca030ffa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.check_args_to_onerror_TestShutil._write_data.f_close_": {"doc_hash": "b9cb0beb83c11ff44e154aeb7b8317c346308a45376abeacb81277ff86534ec7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.test_copytree_simple_TestShutil.test_copytree_simple.try_.finally_.for_path_in_src_dir_.if_os_path_exists_path_.shutil_rmtree_path_": {"doc_hash": "72ae81eb5952085bb150ddbaac860dea2c4199fa9c482399a206cc6666d676e5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.test_copytree_with_exclude_TestShutil.test_copytree_with_exclude.try_.finally_.shutil_rmtree_os_path_dir": {"doc_hash": "732261188bac3ba84e8d8a469253d687ee61c35c059cbf277da114e1bdf3d4c0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.test_dont_copy_file_onto_link_to_itself_TestShutil.test_dont_copy_file_onto_link_to_itself.try_.finally_.shutil_rmtree_TESTFN_ign": {"doc_hash": "81095e4d35855bb2efbc8375ce836e221c1606db654dc00e83fb4a4e1fae9ab7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.test_dont_copy_file_onto_symlink_to_itself_TestShutil.test_dont_copy_file_onto_symlink_to_itself.try_.finally_.shutil_rmtree_TESTFN_ign": {"doc_hash": "833d9b6756947420737bb285c6e0ae53713008d06e0826c764561be849cfed0f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.test_rmtree_on_symlink_TestShutil.if_hasattr_os_mkfifo_.test_copytree_named_pipe.try_.finally_.shutil_rmtree_TESTFN2_ig": {"doc_hash": "1d973c2833365a9184b57c47b70eb46da77d739230dc876949d49855b522cec7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.test_copytree_special_func_TestShutil.test_copytree_special_func.self_assertEqual_len_copi": {"doc_hash": "5a9b3ce51ba262c44aeb0b2a32321b53599895588ff8a318d6c15151439ea9ee"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.test_copytree_dangling_symlinks_TestShutil.test_copytree_dangling_symlinks.self_assertIn_test_txt_": {"doc_hash": "d81bb61e73f646377c4ae0221b690e84341fb4e7ef47c04a68ad4cd6a5ea342e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil._copy_file_TestShutil.test_copy.self_assertEqual_os_stat_": {"doc_hash": "0a98f2e0ce519e920ec745491e52b521497e43a9313181f5eded29933945ffe0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.test_copy2_TestShutil.test_copy2.if_hasattr_os_chflags_.self_assertEqual_getattr_": {"doc_hash": "1ceedaca66e7e68522aeff423e8d692956d0c07e2b284f9f2829e75738d100fa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.test_make_tarball_TestShutil.test_make_tarball.None_9": {"doc_hash": "6423ca5755e8899f200bd8c7e270865e5c3dfabdbe2ecd206e4105d77fcdff46"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil._tarinfo_TestShutil._create_files.return.tmpdir_tmpdir2_base_nam": {"doc_hash": "f80b8b78d5c578a0f5bc0d698a65e708f6b6b91cb00c930e8037a18df64b036d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.test_tarfile_vs_tar_TestShutil.test_tarfile_vs_tar.None_8": {"doc_hash": "49c58e19d220b2fa1307a98c4a5fa83d0d2e72d755d37957b73b7e8ccd1e2386"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.test_make_zipfile_TestShutil.test_make_archive.self_assertRaises_ValueEr": {"doc_hash": "29bead5814a60de11fa2ba6d0a4f759bed5684162c96850254f41ac79f378432"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.test_make_archive_owner_group_TestShutil.test_make_archive_owner_group.None_3": {"doc_hash": "2eecb10d9b6a53db2f37f30cf807ef6b6bf47939a3deb64c19dd218df948dba4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.test_tarfile_root_owner_TestShutil.test_tarfile_root_owner.None_1.finally_.archive_close_": {"doc_hash": "59ed48de60a482ce5b1e7782e449361a5484f74f8c1c73960bfa8a905d3ca6d6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.test_make_archive_cwd_TestShutil.test_register_archive_format.self_assertNotIn_xxx_f": {"doc_hash": "249cdd5288a357edf0990ccb58af38effe3b5abb30eed406d94dd3d3411ddf92"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil._compare_dirs_TestShutil._compare_dirs.return.diff": {"doc_hash": "21a5ee3105abc3f1fdb1e691dff3e0ddbe71b0a4a35f9c0b8c53e7767526ef12"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.test_unpack_archive_TestShutil.test_unpack_archive.self_assertRaises_ValueEr": {"doc_hash": "e0fa3939d466cdaa2bdf8c691f8645746e3023f93cb82b038df6bcd8bd09d8a3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.test_unpack_registery_TestShutil.test_unpack_registery.self_assertEqual_get_unpa": {"doc_hash": "2c5d9922d8e4551d4586fb07e9a4f3fd95f279c24e6102d0bd1f5d04536595bc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestMove_TestMove.test_dont_move_dir_in_itself.self_assertRaises_shutil_": {"doc_hash": "52020bf7051c5eea4350821aed2af3d0e88970d64e70b78345b0fa3521216796"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestMove.test_destinsrc_false_negative_TestMove.test_destinsrc_false_negative.try_.finally_.shutil_rmtree_TESTFN_ign": {"doc_hash": "842dfb0bd28a728483d1e593621a2a540bf489c5c259307c4758b17437a8bf98"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestMove.test_destinsrc_false_positive_TestMove.test_destinsrc_false_positive.try_.finally_.shutil_rmtree_TESTFN_ign": {"doc_hash": "238855ed4722c0b8de28bad80b54f3f4c9115b755f22103c15517f6fc33cc386"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestCopyFile_TestCopyFile.Faux.__exit__.return.self__suppress_at_exit": {"doc_hash": "f6e24e1d23d8100fc192aa22218ce53953b7dd50c43a44c3dd39fed7ef434f19"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestCopyFile.tearDown_TestCopyFile.test_w_source_open_fails.self_assertRaises_IOError": {"doc_hash": "d1aa20f0bf6dc27b8d8856244ca9032d5ee19d0cff62483264dd164b09670cd0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestCopyFile.test_w_dest_open_fails_TestCopyFile.test_w_dest_open_fails.self_assertEqual_srcfile_": {"doc_hash": "9e919b61f4df84ef41868e8869591d86f26eb2b817c7f68393035f0a5f123ac7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestCopyFile.test_w_dest_close_fails_TestCopyFile.test_w_dest_close_fails.self_assertEqual_srcfile_": {"doc_hash": "17afcbbbeef9f2d7510207cb93c72bccdfa03cd470bf3e15eeb76613280eac89"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestCopyFile.test_w_source_close_fails_TestCopyFile.test_w_source_close_fails.None_6": {"doc_hash": "f49439b751b7590d1d75efb8b9d5ad76742d004122836017584de5301ef5e7ad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestCopyFile.test_move_dir_caseinsensitive_": {"doc_hash": "905b6a373cb679e607e51529b907fb716b2bbaee3d1fc241f0c1e5c18e6c757c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py__tempfile_py_unit_tests__if_sys_platform_in_open.else_.TEST_FILES.100": {"doc_hash": "b207c44e1bf05cab954c8945c069eafc68ea3e147a186d9a53b1bf7364fcaac0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py__This_is_organized_as_on_TC.failOnException.self_fail_s_raised_s_": {"doc_hash": "020e9026f6cfbac19f2e5542a9176604207b30bcf2f6800470237fce0ad371fd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_TC.nameCheck_test_classes._": {"doc_hash": "bd0fd3953de65351415178a56beb2f7ac448862c4f2a13f3946a46cc6aab67d0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py__type_List_type__test_exports.test_exports.self_assertTrue_len_unexp": {"doc_hash": "caeea9f93f228575cd0335637b4206fcfd0b025f280fd697375b39dcdc6c1aec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_classes_append_test__test__RandomNameSequence.supports_iter.try_.except_.self_failOnException_ite": {"doc_hash": "841e3cb1560545e12f5ec5652d7dfaf918a91efd1baec26532fea7714e6b6b04"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test__RandomNameSequence.test_process_awareness_None_1": {"doc_hash": "76d84beaa28ad98a77ac67915192610ba36904a4f81a5c3f8f9b275bea7a634b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test__candidate_tempdir_list_test__candidate_tempdir_list.test_wanted_dirs.with_support_EnvironmentV._paths_in_this_list_": {"doc_hash": "7d4f4dacec136b3d529a940baeb79a82d6c60f5acc41d56994bc83819cf4497e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_None_2_None_3": {"doc_hash": "6a9a23258b852f7dc8fd51ecc514f83f8db592a4445f81c6e8fa91849f92b263"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test__mkstemp_inner_test__mkstemp_inner.mkstemped.__del__.self__unlink_self_name_": {"doc_hash": "2147ab1d99a670378df9ed941fbd5f1d0fb9540f26058e75c7e7f4e83ca4559f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test__mkstemp_inner.do_create_test__mkstemp_inner.test_choose_directory.try_.finally_.os_rmdir_dir_": {"doc_hash": "6d05194ffcdac60f467ce2cd8912937a0c2fe583c7abde05bb24605cffb783f8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test__mkstemp_inner.test_file_mode_test__mkstemp_inner.test_file_mode.self_assertEqual_mode_ex": {"doc_hash": "1783636717cb1e594b3ba5c1c7a7ba72c719b10d0822ef9046d2ee36941f1e38"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test__mkstemp_inner.test_noinherit_test__mkstemp_inner.test_noinherit.None_1": {"doc_hash": "489aed0bbda715ce28bf5331d5b62440c0a2114c22ce57a414584c0d4964ad5b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test__mkstemp_inner.test_textmode_None_4": {"doc_hash": "103b19cb437d856e76d98703f854bc6e6733818e91e3d56b4c6a375c29643214"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_gettempprefix_None_5": {"doc_hash": "737ad83d6f294db87e138421c1d1604888f3621a45f5448428e3b6b926554787"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_gettempdir_test_gettempdir.test_same_thing.self_assertTrue_a_is_b_": {"doc_hash": "56e2aaf520ef31a91d9285ab97ea9a232e522d836c60c54948daa5502ca24f9c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_None_6_test_mkstemp.do_create.None_1.finally_.os_unlink_name_": {"doc_hash": "182ca6e116f975068bc4df94cf2a52a93ac6d108e30f29aaf0ddc621ff963dcd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_mkstemp.test_basic_None_7": {"doc_hash": "451a1c191e7fba71ddeca680c15fcf3aa3fe82ff31d9ff23056e722f51e9d06c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_mkdtemp_test_mkdtemp.test_choose_directory.try_.finally_.os_rmdir_dir_": {"doc_hash": "faf1bb4917ed7a493c2deebb7541b9b631f776f91361a492f6fa63266d74af07"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_mkdtemp.test_mode_None_8": {"doc_hash": "7ec946ad8b933a580576160c28e84f42a446908058d91ffbf1e5daf40e5de35f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_mktemp_test_mktemp.mktemped.__del__.self__unlink_self_name_": {"doc_hash": "2ccb41d56b47e8e9408d8d91c3fba736d5fd45c7c0dea6f0a4db032feec1c41d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_mktemp.do_create_None_9": {"doc_hash": "eea8f8243bfb99c5e509fa221b00ed38c8f9260da7fe0c8770e7c9fbd4dab738"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py__We_test__TemporaryFileW_test_NamedTemporaryFile.test_del_on_close.try_.finally_.os_rmdir_dir_": {"doc_hash": "5ed75ec6fdf46297057b708d8db137eb2e12c45abf95ac382647c130ecf31c7b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_NamedTemporaryFile.test_dis_del_on_close_test_NamedTemporaryFile.test_dis_del_on_close.try_.finally_.os_rmdir_dir_": {"doc_hash": "6052c211fe16f3acc7bad46969bf4623a9d825da7eed3dcba4d9a804fd9df23c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_NamedTemporaryFile.test_multiple_close_None_10": {"doc_hash": "a15630764d17ecd12db9ee8f7b595e57f7e451abb067479d40435addfe51338b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_SpooledTemporaryFile_test_SpooledTemporaryFile.test_basic.None_1": {"doc_hash": "71d28f986a4068f049f06a32bd1eb53737157e85dad9db39d4670c3dfb675aa4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_SpooledTemporaryFile.test_del_on_close_test_SpooledTemporaryFile.test_del_on_close.try_.finally_.os_rmdir_dir_": {"doc_hash": "ce3c2eee1d6ce151c960ee5b95dc01c5f41a25554d3014d98ece62f651948cb7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_SpooledTemporaryFile.test_rewrite_small_test_SpooledTemporaryFile.test_multiple_close_after_rollover.try_.except_.self_failOnException_clo": {"doc_hash": "e5bb951a82e5d54c9983bb07763461e86f93fa9011ea138e69171131c9e8cf8d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_SpooledTemporaryFile.test_bound_methods_test_SpooledTemporaryFile.test_bound_methods.self_assertEqual_read_70_": {"doc_hash": "a37b3dd4aee5d6298b6128b0262d7086456306a77740717ecd0df5a335f95f7e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_SpooledTemporaryFile.test_text_mode_test_SpooledTemporaryFile.test_text_mode.None_11": {"doc_hash": "56734aa7530af0e4407303bb31ef79e7f798843d52667b4508b88f0723d3a669"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_SpooledTemporaryFile.test_text_newline_and_encoding_test_SpooledTemporaryFile.test_text_newline_and_encoding.self_assertTrue_f__rolled": {"doc_hash": "b4002bd854f570f02f5683558607f386ac80946c7a5d3e0045c5fee9e848f92d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_SpooledTemporaryFile.test_context_manager_before_rollover_test_SpooledTemporaryFile.test_context_manager_after_rollover.self_assertRaises_ValueEr": {"doc_hash": "8bedfb774d4995c0248c6e6363190112db3921c944f5db5152099a5148a8c3b6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_None_11_test_TemporaryFile.test_has_no_name.try_.except_.self_failOnException_rmd": {"doc_hash": "c25b9e866bd4420e355af4f63544604915dda91b6aea9e733297b4e3ec8fd04f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_TemporaryFile.test_multiple_close_test_TemporaryFile.test_mode_and_encoding.roundtrip_foo_r_n_w_": {"doc_hash": "2adf8865d26a9caaebed3c9598841fdd68d6ac7361afd8599ee82b29c45736c2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_if_tempfile_NamedTemporar_NulledModules.__exit__.for_d_c_in_zip_self_refs.d_update_c_": {"doc_hash": "38b7560d83be6e4ad2dae44dc5e9a21a3a88d65856e940b888290964d3725b35"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_TemporaryDirectory_test_TemporaryDirectory.do_create.return.tmp": {"doc_hash": "8a8e3c3855a14965f29b3c609b2102889de6635371ee6b942c45d5e2730ea761"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_TemporaryDirectory.test_mkdtemp_failure_test_TemporaryDirectory.test_explicit_cleanup.try_.finally_.os_rmdir_dir_": {"doc_hash": "3708385767215725152aa81b7619f7f549437ff05831281d3a1614d553baedb6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_TemporaryDirectory.test_cleanup_with_symlink_to_a_directory_test_TemporaryDirectory.test_del_on_collection.try_.finally_.os_rmdir_dir_": {"doc_hash": "a988417cae682a3dd640fef28b5ca480652a9eea32b3bf2a2d681314ab64a9f6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_TemporaryDirectory.test_del_on_shutdown_test_TemporaryDirectory.test_del_on_shutdown.with_self_do_create_as_.self_assertFalse_os_path_": {"doc_hash": "935fa640940ee877af6af36147661c56fc1c09e240a55421a7fe8769f9ba4afb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_TemporaryDirectory.test_warnings_on_cleanup_": {"doc_hash": "43f83fca1bdc2c53fa221bc3a61d28b27739de54f2561bdcbd9070e3ff92dddc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py___BaseTestCase.check_split.self_assertEqual_result_": {"doc_hash": "1a7bc2d85df126af3c129a05a0b0f5581200f63fe93fa043cc271fe925ec44ae"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_WrapTestCase_WrapTestCase.test_simple.self_check_wrap_text_80_": {"doc_hash": "550c29079d4b0a55b5404b4146d4fb8e559dbfef1272454ff7107ec96200d2b8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_WrapTestCase.test_whitespace_WrapTestCase.test_whitespace.self_check_results_n_": {"doc_hash": "f7c5c37049299fa8c32497f8e439e7459b54d60df4f0a0459538395305f277f3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_WrapTestCase.test_fix_sentence_endings_WrapTestCase.test_fix_sentence_endings.None_7": {"doc_hash": "cfe3a6e04e9faa7adb9184257a96a6eb89f2f9ca2542d8369b4586b44a714a71"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_WrapTestCase.test_wrap_short_WrapTestCase.test_wrap_short_1line.None_1": {"doc_hash": "5d00de05df188450f67d8371240251a87b264578f1e4ecb8b68b1d56505844f4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_WrapTestCase.test_hyphenated_WrapTestCase.test_hyphenated.self_check_wrap_text_42_": {"doc_hash": "b82c8ccdc371abdb19d09f5a969d33150e622759d663787d360138df7639254e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_WrapTestCase.test_hyphenated_numbers_WrapTestCase.test_hyphenated_numbers.self_check_wrap_text_29_": {"doc_hash": "1f3ad1b04ae9cbad067c0a907c8de0c4b4a21bb7354aaabd5e93721259516140"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_WrapTestCase.test_em_dash_WrapTestCase.test_em_dash.None_14": {"doc_hash": "486b1224bf2d9c135e3efa1d4cf311a74070976203b4908dfc53e148f57e4ea7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_WrapTestCase.test_unix_options_WrapTestCase.test_unix_options.self_check_split_text_ex": {"doc_hash": "6c677f3ec9e9288e52e9b683291d54654760e831b6186bbf500a78a8b1317062"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_WrapTestCase.test_funky_hyphens_WrapTestCase.test_funky_hyphens.self_check_split_foo_o": {"doc_hash": "6904270d8c9b25c533acc617916673d2f3dab8b26d33e1996fb0fd9d9988cce7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_WrapTestCase.test_punct_hyphens_WrapTestCase.test_punct_hyphens.self_check_split_the_w": {"doc_hash": "90ea502f464412faf4f691884f41d39a86bed9218a1206ffc90049057e9e70c1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_WrapTestCase.test_funky_parens_WrapTestCase.test_funky_parens.self_check_split_blah_d": {"doc_hash": "067f43f9e2de26a541416e33ce912ec684b5ecc68ff14aa94f356d12af56f2e1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_WrapTestCase.test_initial_whitespace_WrapTestCase.test_no_drop_whitespace.self_check_wrap_text_10_": {"doc_hash": "3506ee49ca412c7e20e188f2eece372f6a31ec1c295035537d3bf1093004858e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_WrapTestCase.test_split_WrapTestCase.test_split.self_check_result_": {"doc_hash": "e728f2dc973074f7123c1bbab375f35763f1bf32e83ebb6fab21a8bde4ce897b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_WrapTestCase.test_break_on_hyphens_WrapTestCase.test_umlaut_followed_by_dash.self_check_wrap_text_7_": {"doc_hash": "6f48eec11a6d7552a40381f987851d895decde73cbc62f8232d5bcfad2f3822b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_LongWordTestCase_LongWordTestCase.test_break_long.None_3": {"doc_hash": "ad29a16d9910223f285457738e6817100aa30e0bb51f510c7b2e65790989b092"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_LongWordTestCase.test_nobreak_long_LongWordTestCase.test_nobreak_long.None_1": {"doc_hash": "3625039171117353c5c5729bdebdbac41abb33f4de1def326164579aac5f263a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_IndentTestCases_IndentTestCases.test_subsequent_indent.self_check_result_expect": {"doc_hash": "374815a0e6e1609298e46f23eb4241d032703dd80bfd90e240cf5cface552efa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py__Despite_the_similar_nam_DedentTestCase.test_dedent_nomargin.None_3": {"doc_hash": "e5bf393c825b7570626dd4b6c3c99f83db3531fd4cc132fc2f2128481b0bc2d2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_DedentTestCase.test_dedent_even_DedentTestCase.test_dedent_even.None_2": {"doc_hash": "8bb8ed33e517f0d6cc4a6dc32452e49e1fbce4e6aef4333fe0856995e1398919"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_DedentTestCase.test_dedent_uneven_DedentTestCase.test_dedent_uneven.None_2": {"doc_hash": "711489a07ef64ba34200589f2f383e4f2f698ed5b1be71eedbe6e33b5e41809c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_DedentTestCase._dedent_should_not_man_DedentTestCase._considered_equivalent_": {"doc_hash": "bbad99ebe20db27dfb0a06a77c17b06aabba0fd75ed636077fc0abfc4fb8e29a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_DedentTestCase.test_dedent_preserve_margin_tabs_": {"doc_hash": "57919eb58d0b223e9c96832f06c84818bb4f39ac2944293e9c1279ca9d7e441e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/tf_inherit_check.py__Helper_script_for_test__": {"doc_hash": "5f63da61ef0851f243fb8545a956534faf18c0594448cec0306255f513c35348"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/textwrap.py__Text_wrapping_and_fill__whitespace._t_n_x0b_x0c_r_": {"doc_hash": "6c601527a3e6bd59dfece0bccd6c3eb076f164b4e507403a4e6a87fccd103449"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/textwrap.py_TextWrapper_TextWrapper._is_US_ASCII_only_and_t": {"doc_hash": "ae37b69ab2208d6e7657a890c1218babb096be444540f81fa723c07e77e2545a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/textwrap.py_TextWrapper.sentence_end_re_TextWrapper._munge_whitespace.return.text": {"doc_hash": "3a9d2d320c3dd29b9e8fcd21727043d7b101ac500f2ae5ef1372105179283acc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/textwrap.py_TextWrapper._split_TextWrapper._split.return.chunks": {"doc_hash": "ce8f2f5fa97e26b02ba71a0811a53f451e9fa9c8c62fc9dd0f87910bfd4e5730"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/textwrap.py_TextWrapper._fix_sentence_endings_TextWrapper._fix_sentence_endings.while_i_len_chunks_1_.if_chunks_i_1_and.else_.i_1": {"doc_hash": "2d3fa30f79d07b0e3caa08094ff31e53e17148f51f9fddf8fdf1f1f442e7256c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/textwrap.py_TextWrapper._handle_long_word_TextWrapper._handle_long_word._devoted_to_the_long_wor": {"doc_hash": "1a97baa6aee1373e6527aeba501c93bd9ed7c0ea72774657f181f0735ef2494d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/textwrap.py_TextWrapper._wrap_chunks_TextWrapper._wrap_chunks.return.lines": {"doc_hash": "affe7d888db03dbb6edbabf1b700e89e7e44a256bf0c5c51c5284a8c16285a6b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/textwrap.py_TextWrapper._Public_interface__TextWrapper.fill.return._n_join_self_wrap_text_": {"doc_hash": "09145fb0fbbbcc872e3c0736ce896df858c080f15c9da0485380b5558e959dc5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/textwrap.py__Convenience_interfac_wrap.return.w_wrap_text_": {"doc_hash": "4315ae138f792f8acff838c9460b9d29aaa5ceec0123bb16eb0075f2a21c9c9b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/textwrap.py_fill__leading_whitespace_re.re_compile_t_": {"doc_hash": "f63a352a17e9d5f371dfda694f92faf4362d15504e9ed597bab0670a2ddccfcd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/textwrap.py_dedent_": {"doc_hash": "af10c4f4dd3a08b0ef5c9c0be2a9516322cb04cf7258e48bbbb23c51319b4b63"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/arg_kinds.py_sys_": {"doc_hash": "9f82823ae16dc2c1a1fca1efbd07392634e1612e21dc35bd080311476376ee6a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/arg_names.py_from_typing_import_Option_ArgNamesPlugin.get_method_hook.return.None": {"doc_hash": "c6f9eb91dc252cc00456ce9b73b29ce367cb48f7f5d5c3879531adc9802511c3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/arg_names.py_extract_classname_and_set_as_return_type_function_": {"doc_hash": "1bea884edd5eedee9234b0636fa6bded7710770ac23876962bb17e41c3eecd1b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/attrhook.py_from_typing_import_Option_": {"doc_hash": "0767400c1c6fb688dc6c8a1fc380e5952a44f5bf309fc734e304f89b23fc83a1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/attrhook2.py_from_typing_import_Option_": {"doc_hash": "186e339ec22c31a924fa6e2083a8c5b0cfbbb2eff8e1180c1b70168c862274b7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/badreturn.py__": {"doc_hash": "0cecbdf091e38cc3a5666c24c33e5ab774129b1c43f91873854841d8710069c9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/badreturn2.py__": {"doc_hash": "7d74a32695feb0d22b260b68c5e2087130ef092dace671cf7f749ea6ec430769"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/callable_instance.py_from_mypy_plugin_import_M_": {"doc_hash": "db9e5802a1135e03407a9497d3848dcfdbb29e84da57e0d95f2ea0be9d829d48"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/class_callable.py_from_mypy_plugin_import_P_": {"doc_hash": "96a959827b900d5a17c6e4fa6032f9b5f88ea07b418dda05fea7e5a47c197d3d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/common_api_incremental.py_from_mypy_plugin_import_P_DynPlugin.get_base_class_hook.return.None": {"doc_hash": "16e1b120d4f7cbe444f26468a3b32a4d02343ebbc57fb590999ec2ee1f8fd956"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/common_api_incremental.py_add_info_hook_": {"doc_hash": "b1148c58058ec62f1364b204d9cd88f1ce2a33366c9a908a448b6c174dc85c4b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/config_data.py__": {"doc_hash": "52f8e135fff72a0c40b76507aad3d702fb49fb0424fd4efc7cffe8fbcfdf5fc2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/customentry.py__": {"doc_hash": "e97148b7c1b4a89980c99f1056aab0d71ca7001317b993f670d144b4b37918d9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/customize_mro.py__": {"doc_hash": "1d4a4318d4c5648f5925121ad561f5266b96a585aa2140a11b3a24096eb1412c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/decimal_to_int.py__": {"doc_hash": "1b84492d6e5272a3b468c8fb25aa85122b364731d99d5ad2e9d7da28b7562368"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/depshook.py__": {"doc_hash": "10ac488b8847fbfbe7c5246f81780585dda30d25e9c2ee1c4760f80c4532cb87"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/descriptor.py_from_mypy_plugin_import_P_": {"doc_hash": "09a54d6e41aa48ee070a2f1174e2c18ac9a6d95602057be4482b64f78db8e4a7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/dyn_class.py_from_mypy_plugin_import_P_DynPlugin.get_base_class_hook.return.None": {"doc_hash": "2f06596f0dffce67b06fb5a71c80020498199bebe6b04b114066ae0b99bb9492"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/dyn_class.py_add_info_hook_add_info_hook.DECL_BASES_add_class_def_": {"doc_hash": "f46c72c5aa0f992c6a7b55396cf39efe539b574b25114e0573de17ac3516fef0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/dyn_class.py_replace_col_hook_": {"doc_hash": "63bfc9c6d5145391ac6632b6dbe068eed54d4a4b537593758d31caf4c50ee36d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/dyn_class_from_method.py_from_mypy_nodes_import_B_": {"doc_hash": "be9fb063ea86bab13d03845475f1c3d256da878f29b5c1d385b3c4716fea20ce"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/fnplugin.py__": {"doc_hash": "345feffe67031d2bf5c692482f72077f2f6dcc7782ecca4687756bca1c6c9cc2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/fully_qualified_test_hook.py_from_mypy_plugin_import_C_": {"doc_hash": "f04558b3a497e3923fc99228c3e23279be37806eea1f4dcc3e8533511a371b40"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/function_sig_hook.py_from_mypy_plugin_import_C_": {"doc_hash": "09a5c886cb50af9fd0431ac1e8ba030b5fd6b434b473509cd24033d808fbe113"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/method_sig_hook.py_from_mypy_plugin_import_C_": {"doc_hash": "3baa46a68018a116d8cedf24b4adf38df4394b94b8dc0f2a89297af3d2929b4d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/named_callable.py_from_mypy_plugin_import_P_": {"doc_hash": "863a9a7cb7df78e3f4306c93231a7f4b3b069a82a0cc2b7627b5f5fd1a96bc81"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/noentry.py__": {"doc_hash": "6ff5dff964e3a31bd5282bb85ad393f2c9fa8ac5b08394c7e0b5c87ae55e91e9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/plugin2.py__": {"doc_hash": "f08d92506312ed6241d2db79a44e336071ec47e7a25a16d80ff38ed01ef1fbc7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/type_anal_hook.py_from_typing_import_Option_TypeAnalyzePlugin.get_type_analyze_hook.return.None": {"doc_hash": "159ed12292e0fce56e877704eece528d5be81beb820305144038005ca575ce97"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/type_anal_hook.py_signal_type_analyze_callback_": {"doc_hash": "1b9b5bdfb97a094cd1f6cd5652c93b3b1156e21be116c64d5fd6dcd955e3279b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/union_method.py_from_mypy_plugin_import__": {"doc_hash": "3c48d94e65af0131a43cbd182e4500d1cad25b80f44077ee6cff08342741b37c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestUnit.test_missing_StubtestUnit.test_missing_no_runtime_all.None_1": {"doc_hash": "d8395c2f0cfc12c7d6ba22c0d1fb1ebec1b4a86d3382052be08240582f23133f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestUnit.test_special_dunders_StubtestUnit.test_special_dunders.None_1.yield_Case_": {"doc_hash": "8aa0736e5f6415669b6468b6683fe0866e7b28c9aab436b3651673b22b08b627"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestUnit.test_name_mangling_StubtestUnit.test_name_mangling.yield_Case_": {"doc_hash": "d8671b89b4f8f1316515d528de5435314a88925e205e9cd349248ada285e2496"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/upload-pypi.py__usr_bin_env_python3_download_all_release_assets.with_ThreadPoolExecutor_.for_asset_in_e_map_lambda.print_f_Downloaded_asset": {"doc_hash": "cddbd3fe1b9eb94e0b4627108576f75408a56d0b386a327839aa6e408bdd3984"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/upload-pypi.py_check_sdist_check_sdist.with_tarfile_open_sdist_.assert_": {"doc_hash": "d33f8259f1938f0da04818b1b9bdfac74b175ee66132494f16add7e19a9b9ba7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/upload-pypi.py_spot_check_dist_upload_dist.with_tmp_twine_as_twine.if_dry_run_.else_.subprocess_check_call_cmd": {"doc_hash": "3574193f1103c6fb80cc8bd65167594925ec832b8ce5d4e72a38df60bd4693a0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/upload-pypi.py_upload_to_pypi_": {"doc_hash": "a84b27fe84f664c8da11138650436ba5cb3e150434bdeec8d1132da3a04394c7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_Errors.is_ignored_error_Errors.is_ignored_error.return.False": {"doc_hash": "2cdfede306cac72c36d32adf432c9bf6f85adec3db72846f75178ba67586674d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_Errors.is_error_code_enabled_Errors.clear_errors_in_targets.if_path_in_self_error_inf.self_error_info_map_path_": {"doc_hash": "be21df4ab3e993d6b3df0ec80814cedd3a041d0eb0a669778162eb8d1ae3e654"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/find_sources.py_keyfunc_normalise_package_base.return.root": {"doc_hash": "2295165d7801b109731b134cd9c5c8cdeaa7e286533d37fd1f7e8a3887977437"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/find_sources.py_get_explicit_package_bases_get_explicit_package_bases.return._normalise_package_base_r": {"doc_hash": "5e5b997c2003b6762f6f1fc53c522428a98304d5695a830504046ab2c12e0ca9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/find_sources.py_SourceFinder_SourceFinder.find_sources_in_dir.return.sources": {"doc_hash": "a35d1d886acd1d63a16cad24b1219c120dc24ac223ebfc70338a9183b17a5b5a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/find_sources.py_SourceFinder.crawl_up_SourceFinder.crawl_up_dir.return.self__crawl_up_helper_dir": {"doc_hash": "b335c7c5ecd5ba202c9987a1cf7bf6407abc392a49228e12e89a16e0c506afb4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/find_sources.py_SourceFinder._crawl_up_helper_SourceFinder._crawl_up_helper.return.module_join_mod_prefix_n": {"doc_hash": "ddda112214c70394c449b4e4fda8c1e2c5af1b0c72367114b79ac7342573cfff"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fscache.py__Interface_for_accessin_from_mypy_extensions_impo": {"doc_hash": "8219119b806b29c4bd90d8d0a7fa51f0f3c0d8c32c4ece98205f9d61553018f2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_FindModuleCache.find_modules_recursive_FindModuleCache.find_modules_recursive.return.sources": {"doc_hash": "eafa8109b7d238cf0c9b99982181b261faef9f656d2ac5675a96ef3a06611dea"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_if_TYPE_CHECKING__del__nongen_builtins_col": {"doc_hash": "9bf50cb06364797babfc07a4ee7dd0d8cbd74dd0b619d921ef7c36c63945efc6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_get_nongen_builtins_Lvalue.Expression": {"doc_hash": "c0fa9ee7c7831ef46e3bddc4ff647064663d150de17daeb5bb80e19fa60067bf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/options.py_from_mypy_ordered_dict_im_Options": {"doc_hash": "644f6125a859a7e7f28baa98bffe4eced376078f52fd87b1c13d0870761d0453"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py_Attribute.serialize_Attribute.serialize.return._": {"doc_hash": "7f7f409a83cbbd6d434c5130aeb4cf53fe9bf809f84cd020ea690caf63d1cd41"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py_Attribute.deserialize_Attribute.expand_typevar_from_subtype.self.init_type.map_type_from_supertype_s": {"doc_hash": "b7118d8918b0bd23b45f047ff30e415cc17a6f441d87406368172d10c046385f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py__detect_auto_attribs__detect_auto_attribs.return.True": {"doc_hash": "e30c81e18a75c99055d87ea331f78ef85bd7806df93c7ed73c86bc75ea7dabf6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/dataclasses.py_None_3_DataclassAttribute.expand_typevar_from_subtype.self.type.map_type_from_supertype_s": {"doc_hash": "7e0c0a6a879fa36d868d1112363f8e4755d746a6c4aa820112e19e694c037c9d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_type_application_SemanticAnalyzer.analyze_type_application.if_isinstance_base_RefEx.else_.if_n_and_n_fullname_in_ge.self_fail_no_subscript_bu": {"doc_hash": "23ba7adc2283036041d4a0b5a2558cf9bc41547ebf9eaf9b2f606faf8327cf8c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_shared.py__type_Final_SemanticAnalyzerCoreInterface.is_stub_file.raise_NotImplementedError": {"doc_hash": "7dac458e1fafdc59b42898ab09f8fea0406b25e3eb13ba43a1e5914d86d84a95"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_get_mypy_type_of_runtime_value_get_mypy_type_of_runtime_value.try_.except_TypeError_.return.fallback": {"doc_hash": "ead53bd42ec0a29e35dea7d4e1bf88e2c693e64c91f726a517ec14ff7f256599"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py__all_stubs_build_stubs.return.all_modules": {"doc_hash": "14dd050cec5454f49a80ac3ca6039852929c6fc191e6998605d070cefb3ae67c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/test_find_sources.py_normalise_path_find_sources.return.normalise_build_source_li": {"doc_hash": "731ab09d5034d03ecc167fa341665b5a46a063d18a269d2b9f66f58211b135b8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/test_find_sources.py_SourceFinderSuite_SourceFinderSuite.test_crawl_no_namespace.None_6": {"doc_hash": "870aad9926fd2edaa31900a2fd9accda2ebc96ce800ef51fb6e3678de3abd0be"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/test_find_sources.py_SourceFinderSuite.test_crawl_namespace_SourceFinderSuite.test_crawl_namespace.None_6": {"doc_hash": "f519f66921fed75f21ed317683c329d15eea0219b8866e6ba531acf600696892"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/test_find_sources.py_SourceFinderSuite.test_crawl_namespace_explicit_base_SourceFinderSuite.test_crawl_namespace_explicit_base.None_9": {"doc_hash": "31824227001482b1ca7a79b7afd8bf4c1428b3220a97fc90007d2910801799e6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/test_find_sources.py_SourceFinderSuite.test_crawl_namespace_multi_dir_SourceFinderSuite.test_crawl_namespace_multi_dir.assert_crawl_finder_b_": {"doc_hash": "8f0388e9042f026e9cb4cd9ee4d70f0dfd66de91a1897be4261aeba46a618601"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestUnit.test_var_StubtestUnit.test_var.None_7": {"doc_hash": "c92135844e64da650dace47130a8642a433ea31d8db90e6d578e570aa4f42f70"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testutil.py_os_": {"doc_hash": "3a5831ab25c213d93a5f399d8e91426fec17d1ff09b744b79e9b1134a33b6553"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/treetransform.py_TransformVisitor_TransformVisitor.__init__._type_Dict_FuncDef_Fun": {"doc_hash": "df81cb1c4a22fc098bb994ece52eb4b4e2eff84c313dc08c7059c4ef6409152a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/treetransform.py_TransformVisitor.visit_mypy_file_TransformVisitor.visit_mypy_file.return.new": {"doc_hash": "508eabafc9c67769e2604606a65e29d7827c4fef6c3d4a798eda5651d2be833b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/treetransform.py_TransformVisitor.visit_import_TransformVisitor.copy_argument.return.arg": {"doc_hash": "a547f2da7165b2ea6198881a69787c108696c1cef2d1fad2431604ed7ab0a128"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_None_3_analyze_type_alias.return.res_analyzer_aliases_use": {"doc_hash": "d9636bd39fa55a9361e27945a6867181906e64344bb1ddf7f25da8ea842cb88a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_no_subscript_builtin_alias_no_subscript_builtin_alias.return.msg": {"doc_hash": "571469abbdfad81e7cd98e2061e968f2b2e54564d989978f7b6e560c5a22c7d6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.visit_literal_type_TypeAnalyser.visit_union_type.return.UnionType_self_anal_array": {"doc_hash": "5b5aa663c91a08e5876fba1f06a7b03d4b23723ac3c9407ee7bc9475adab5510"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.visit_partial_type_TypeAnalyser.visit_placeholder_type.if_not_n_or_isinstance_n_.else_.return.self_analyze_type_with_ty": {"doc_hash": "9b9e3cae16bd78564745f6120e2128946ff2ff0f5bb7a7fa82989b7b21ca2f2b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_None_14_write_junit_xml.with_open_path_wb_as_.f_write_xml_encode_utf_8": {"doc_hash": "5fe23b6f2fc0367be9320054c9890f6d5cf234dc2170262f78639490d6e1f6fc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_count_stats_get_terminal_width.return._int_os_getenv_MYPY_FORC": {"doc_hash": "9ba81fb8bbe6c8af0977b4a496d1aa008484dbc7afc991766a87d0f6fbae69aa"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py__Data_flow_analyses__from_mypyc_ir_func_ir_imp": {"doc_hash": "200a6f137c6f189e91baf599e01f553ebe4c7f045a7e99fcd724de42189a302e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py_analyze_undefined_regs_non_trivial_sources.return.result": {"doc_hash": "e7e0a27f5d5d44a4681cfe68569301cf91e1de9b553dfd3eef551019b6c41ce1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py_LivenessVisitor_LivenessVisitor.visit_set_mem.return.non_trivial_sources_op_": {"doc_hash": "f67065102344c7625eaff1530995951a184d4f138ea519a391781de69ccc2987"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_dealloc_for_class_generate_dealloc_for_class.None_8": {"doc_hash": "17770a8359fbae0d50dd1f95f27ef322d681c8fcb82ee87c752d247d9c01d143"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.visit_return_FunctionEmitterVisitor.visit_tuple_set.self_emit_inc_ref_dest_t": {"doc_hash": "a9eb982ac04e8c6a7869bca5485ff364fe9692404b956e322b758941a42e0bc2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.visit_call_c_FunctionEmitterVisitor.visit_int_op.self_emit_line_s_s_": {"doc_hash": "e851426abadcab933fdd400c84912d7fbfd0d16c55b746ab728704dbc4946162"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/func_ir.py_INVALID_FUNC_DEF_all_values.return.values": {"doc_hash": "0f954f645bc02bbb2b748cc74ef346973ad6ce12f253c0da795ec7dd59847d27"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/func_ir.py_all_values_full_": {"doc_hash": "68f237fdcf69236d62dd99c84f7fd75e21ec5a65e539e3bdf9b6a2c4c0626f8e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py__Low_level_opcodes_for__T.TypeVar_T_": {"doc_hash": "b5813ffb13cd6b42774f0c264b523c7f9e66e0dd349c1b60bc03fe9160178817"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py__Never_generates_an_exce_Value.is_void.return.isinstance_self_type_RVo": {"doc_hash": "017fd65449c5a098d7a0e36c1407e4356adcfd1c105190c4a6a1eb655eb6f531"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_Register_Register.__repr__.return._Register_r_at_s_": {"doc_hash": "f726571fd709b491cdde5544421aacd5621fb09f351e0c70e6704439cbcfcc95"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_Integer_Integer.__init__.self.line.line": {"doc_hash": "b6254a4737c98abb2e3dcc613271f8ee049891cbfacffa40d47e02ddd504faf7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_Branch_Branch.accept.return.visitor_visit_branch_self": {"doc_hash": "6b80e768aec7454539352e0737a9dc3c3873d3c1f4a54e62bc0f72e593c1d946"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_Return_Unreachable.accept.return.visitor_visit_unreachable": {"doc_hash": "269191bb2883b01bfed20edff3c503d96543e6076d04d6ded1027b0eabeb3458"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_IncRef_DecRef.accept.return.visitor_visit_dec_ref_sel": {"doc_hash": "bcb90cf0acbc06937a09178b269ed22f6aab6557a6cc4d2aec5cd5e48bbbd816"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_None_15_LoadStatic.accept.return.visitor_visit_load_static": {"doc_hash": "7fe216631dc083d45ed520a3875d3161cf74dd24caf9c112ba9ed7caf8b5e54d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_RaiseStandardError_StealsDescription.Union_bool_List_bool_": {"doc_hash": "91bbce7fc191332206452f0206e6453a35f99c00272cbb020b8bec5a73b4d228"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_IntOp_IntOp.accept.return.visitor_visit_int_op_self": {"doc_hash": "1a7326024dce24158d654838d597a41c9c3279d76424937ced669968993df130"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_ComparisonOp_ComparisonOp.accept.return.visitor_visit_comparison_": {"doc_hash": "eeb9c465b6d9662476eabda735dc2a0a1fc7903e531505ecd76f9574e85c2f1f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py__TODO_Should_the_follow_": {"doc_hash": "f899a06f43970b9e7f1cc0f51a263f0c9d1a2a11b5ca765d71914c10c1984b41"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/pprint.py__Utilities_for_pretty_p_from_mypyc_ir_rtypes_impo": {"doc_hash": "2f2b10b3b813f0f730c33f85a29f56e95ea02cb5797427d70ae9d04b57dbcc81"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/pprint.py_IRPrettyPrintVisitor_IRPrettyPrintVisitor._type_Final": {"doc_hash": "591fe4c9352416b997ae9d0135d153c77708e50e2cb7ecdfae9ec9d2c4b6b15b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/pprint.py_IRPrettyPrintVisitor.visit_branch_IRPrettyPrintVisitor.visit_branch.return.self_format_fmt_op_true_": {"doc_hash": "ef97162ec18cd786880cc9dc364ce932d52bbbfc1acde8582a5d49fdeb25b99f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/pprint.py_IRPrettyPrintVisitor.visit_call_c_IRPrettyPrintVisitor.visit_int_op.return.self_format_r_r_s_": {"doc_hash": "a444acfd11c4e206e6e00fe4c705ff41f597fc7e11b3d5f5c090ed5f57470c9e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/pprint.py_IRPrettyPrintVisitor.visit_comparison_op_IRPrettyPrintVisitor.visit_comparison_op.return.self_format_r_r_s_": {"doc_hash": "3304412be7d37c7e77d8308c6379a0ca3c9ba5adc12649e51b012e810bac1f7b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/pprint.py_IRPrettyPrintVisitor.visit_load_mem_IRPrettyPrintVisitor._Helpers": {"doc_hash": "5c20d9bcf6d6bbe2d39eb768b01862fc12211b59d034c2bfd8b68188dd520a3c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/pprint.py_IRPrettyPrintVisitor.format_IRPrettyPrintVisitor.format.return._join_result_": {"doc_hash": "742fc56f4bbbc6ececd54c7837a570e007beecfc7c62ab90defc3a8b807979a0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/pprint.py_format_registers_format_registers.return.result": {"doc_hash": "cca2e63953aae3c341cb63d971223a22b4db44dc9ce811e2a8b7e1a09dcf3667"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/pprint.py_format_blocks_format_blocks.return.lines": {"doc_hash": "5a5934c9df96f2dc7e05991da144a768ecf84a7d609fb16a062e51025303048d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/pprint.py_format_func_format_modules.return.ops": {"doc_hash": "dc3260a5c263c0d420a67cf3cc9086e68995b610f9192f2cd10f0f54611c9e47"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/pprint.py_generate_names_for_ir_": {"doc_hash": "bf035d947e98efe4c0cc6a55c0743160e845c68ebae5b1d5488702d4364fff9f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py__Builder_class_used_to__SymbolTarget.Union_AssignmentTargetReg": {"doc_hash": "08e3b8da8aa3b979a9c8dfa9fa77f97dbaf8696fb83230bb441358901652ede6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder._Pass_through_methods_fo_IRBuilder.call_c.return.self_builder_call_c_desc_": {"doc_hash": "07eabaa86352d05b49bea1e606710f593c1bde1a8edaed4bbecaa0e0cee2410b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.int_op_IRBuilder.add_to_non_ext_dict.self_call_c_dict_set_item": {"doc_hash": "a565f26e5fb97988efc42b5662c833f091e181efe1663e6d3e94acd4896c97a3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.process_sequence_assignment_IRBuilder.process_sequence_assignment.for_lvalue_value_in_zip_.self_assign_lvalue_value": {"doc_hash": "1142aef1a0e1054fd8a2e3f3d1e42ecc71d288e1584a4132db3e471982b84369"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.leave_IRBuilder.leave.return.builder_args_runtime_arg": {"doc_hash": "bb019424be84c3551946924aec4e397dba5a5acecfcfb315d94151d0f53eba54"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.enter_method_IRBuilder.enter_method.self_add_argument_SELF_NA": {"doc_hash": "94ec821b6946ff44d2d64d246ae9a22f83fcc992844aff5573ab76421910ca75"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.add_argument_IRBuilder.leave_method.self_functions_append_ir_": {"doc_hash": "6e244edcec65d30abf99c31ce006f71cb413183eed874fdae086451357297368"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.lookup_IRBuilder.add_local.return.reg": {"doc_hash": "bbe5f4823895796d8f271a45495fe3221598989f725e62ba684921333789e10e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.add_local_reg_IRBuilder.node_type.return.self_type_to_rtype_mypy_t": {"doc_hash": "02fce7977bfa17fe21ea3cf7956cc982e00d4462982ee9ddb249c0c3b23c99e9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.add_var_to_env_class_IRBuilder.add_var_to_env_class.return.self_add_target_var_attr": {"doc_hash": "0d567e8b97201c6970e7b7b8a51a6b68b8cfa2d3e88b5a895eba4d08c7b2354f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/callable_class.py_add_get_to_callable_class_add_get_to_callable_class.builder_leave_method_": {"doc_hash": "6e2970f88253b6eed891f43663bae8917541b6993f7431a235b4b4ae109018bf"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/classdef.py_find_non_ext_metaclass_find_non_ext_metaclass.return.builder_call_c_py_calc_me": {"doc_hash": "81a41c41fc1cc9544da9d626f4419f5371002b8e327a08c41f9fbbdba2aeb36d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/classdef.py_generate_attr_defaults_generate_attr_defaults.builder_leave_method_": {"doc_hash": "56acdf562850995d87a40eaa1d571291373d10a0e702ce653b45659aa4181eb0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/classdef.py_create_ne_from_eq_gen_glue_ne_method.builder_leave_method_": {"doc_hash": "0ab15fd25affbe9ce0e2ba7c123d2f65f192e39f02e059bbed958ca93ad1c50e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_is_range_ref_make_for_loop_generator.if_is_dict_rprimitive_rty.return.for_dict": {"doc_hash": "799bdcc097b2e1dc57c1911b08159ef4efad8f4288ddbe8ba656db634721778e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_make_for_loop_generator.if_isinstance_expr_Call_make_for_loop_generator.if_isinstance_expr_Call.if_expr_callee_fullname_.return.for_list": {"doc_hash": "1ede562c658573b20ad75e44d055b69f1e6ecd6b0b51f76fe2eb97c17717e595"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py__Internal_functions_gen_func_item.if_builder_fn_info_is_gen.else_.gen_arg_defaults_builder_": {"doc_hash": "72c23d2a2d581da3dea32e4cbe639eb9eb3abfe467b9e31b225f0d18671a1a42"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_gen_func_item.None_4_gen_func_item.return._func_ir_func_reg_": {"doc_hash": "5897f259d0dcda9c4c2cc66620504ba64dad7751717435e6de32f864d2765c49"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/generator.py_add_iter_to_generator_class_add_next_to_generator_class.builder_leave_method_": {"doc_hash": "c4b622046495c4e2606884080d87ca74bd5b580b8f42e906b7f57bb30cc40eec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/generator.py_add_send_to_generator_class_add_send_to_generator_class.builder_leave_method_": {"doc_hash": "44e10397d5807a8707103086603fd18f482f3705a59bac07a16f72bb6e54c273"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/generator.py_add_throw_to_generator_class_add_throw_to_generator_class.builder_leave_method_": {"doc_hash": "2cbfc1b8cbc004729b15d98b0ea9c4095377c56bb19626c504e06adb97493190"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/generator.py_add_close_to_generator_class_add_await_to_generator_class.builder_leave_method_": {"doc_hash": "261902b50f225e52d0bc74d4b35a8b7fd13aa2b53fae116e0a8f9a9e6c8124a2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.load_module_LowLevelIRBuilder._Other_primitive_operati": {"doc_hash": "5929ede11b34a64f2b462cbc12d151a3556e58a69493e5d186e17a0dd8f29077"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.bool_bitwise_op_LowLevelIRBuilder.unary_not.return.self_int_op_value_type_v": {"doc_hash": "a384000a21674eb33fae2b907c5efc7fc8f48b05198f61615d57d726f90a8c84"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.translate_special_method_call_LowLevelIRBuilder.translate_special_method_call.return.call_c_op": {"doc_hash": "b941bf39f86b5d609a3fe2cf1cfbd47c07a4b00efafec6f58215d8ee36555f83"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_assignment_stmt_transform_assignment_stmt.for_lvalue_in_lvalues_.builder_assign_target_rv": {"doc_hash": "24c27c98a598731e0aaa08f27423b8b986f992a30cedbc9807e8347d2354a3be"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_is_simple_lvalue_transform_operator_assignment_stmt.builder_assign_target_re": {"doc_hash": "3daf557530c1a16042a8719a2f2df94986d7c240aefdc4c8fe8d31a46fcbd6af"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/targets.py_from_typing_import_List__AssignmentTargetIndex.__init__.self.type.object_rprimitive": {"doc_hash": "d37fbb221c85f50da6fbf48d82b3a54fccb1b18f7b7ed311904712fe0cca80a6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/targets.py_AssignmentTargetAttr_": {"doc_hash": "fbe6024a43f14ef9e8d7984b67d9228161fe84d4874dd721368c1e0b291007ff"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/float_ops.py__Primitive_float_ops__": {"doc_hash": "2b3c7a81e1238fbd3c8b784b1de59d69ed6cb66692f52d2fba53c283866ec2a0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/int_ops.py__Arbitrary_precision_in_int_binary_op_CPyT": {"doc_hash": "b0d1f3e0447e9d13833a82f044724488ae0339dd25168d83e0d85b2f5c5991b9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/int_ops.py_None_13_": {"doc_hash": "34c732ba96c7248e6aafaab37670866f9856c66c6bfb61a2a34bde4a444aa128"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor_TestFunctionEmitterVisitor.setUp.self.context.EmitterContext_NameGenera": {"doc_hash": "14a7f07ffd3db81a14e7fd2bbf3610025de1e6a721fa0c6956c8999e9fe5fced"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor.test_int_op_TestFunctionEmitterVisitor.test_int_op.None_9": {"doc_hash": "d74d4e8f2dcf9e444312237dafccec91e9a7aef63e376ad2ddd93ad552ed5aa9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor.assert_emit_TestFunctionEmitterVisitor.assert_emit.assert_string_arrays_equa": {"doc_hash": "af903a2cf32840dd44da4ea2294c2f7e64855d88715ababd4e855254490099bc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor.assert_emit_binary_op_TestFunctionEmitterVisitor.assert_emit_binary_op.if_op_in_binary_ops_.else_.assert_False_Could_not_": {"doc_hash": "153df698d5d26cff93e85e924ace1040c71a0b7998d5ccaf272f7bc7cd8b5bf6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_pprint.py_unittest_make_block.return.block": {"doc_hash": "31b4af8051059d20b19b4e225a0775c25471903096a590deb361abf35cb5b4fb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_pprint.py_TestGenerateNames_": {"doc_hash": "b965ddfd903c07dff8c99db5b598468a87e034a31873e3de3b00174ca09f0e5a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/transform/refcount.py_add_block_add_block.return.block": {"doc_hash": "06ed6c42e2708826cc11457b3e55915f5a514a8c056313c2e79f9c1efb86e20a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/transform/refcount.py_make_value_ordering_": {"doc_hash": "2a2113d416df324c1537fb2872324fa6002f82ae5ee882c566931c709607ce8d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/runtests.py__usr_bin_env_python3_assert_all_cmd_in_cmds_fo": {"doc_hash": "11b771719b9af68a7abfc0ca5594d86ae5eca37401171799b024bacec63c710f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/runtests.py_run_cmd_wait_background_cmd.return.status": {"doc_hash": "03719375d5e2e29ef9de9fe768f931104673f79e4629b4bf41cd28db27d27e95"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/build_wheel.py__Script_to_build_compil_ROOT_DIR.os_path_dirname_os_path_d": {"doc_hash": "4e8c9c25fa8bca83bcf47adc2ad3b0ea93f46e9e0d58e2064231f07df3693938"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/build_wheel.py_create_environ_create_environ._the_venv_Ew_ew_ew_": {"doc_hash": "c191d83f84f48aba6ea5eddf518dd7cc0fa2826ee3ba98b53980bca8b46669ac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/build_wheel.py_create_environ.env_CIBW_TEST_COMMAND__create_environ.return.env": {"doc_hash": "1bd0dc9efd427e858ce9f4b5f001763b6b5981fd4d68e548a25064fa8c21c762"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/build_wheel.py_main_": {"doc_hash": "a0f2a74c14a6e10360343f73309b7fa2a25bdf10faf75f3fac2bedfe028250ad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/sync-typeshed.py__Sync_stdlib_stubs_from_check_state.if_out_.sys_exit_error_Output_o": {"doc_hash": "fe104bc1106232f5db213b5adfb046b9b3aa977bbe27d02f2daf2c2d68b583cb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/sync-typeshed.py_update_typeshed_git_head_commit.return.commit_strip_": {"doc_hash": "c3376f1ed20f107c40167da091a6503a2a06377164e25920bc267a4f745af455"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/sync-typeshed.py_main_": {"doc_hash": "5ed102c749fe499ba1a7fac4a37d09af6afb9f3049a15fe5850475c78840a126"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py__build__build.try_.finally_.if_os_path_isdir_options_.record_missing_stub_packa": {"doc_hash": "1d929aa38bd3d6556a821eb917dbde27350db990993a9a7484515d3f448b0131"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_BuildManager.__init___BuildManager.__init__._type_Dict_str_Tuple_M": {"doc_hash": "7bd68156805255eea368a18156cc9a60584bd12aca9ea3667cd9c670873d3571"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.parse_file_State.parse_file.manager_ast_cache_self_id": {"doc_hash": "9b7eaf0d47bede790e49aa61ee416861a0682b497486e216391f81308fb45330"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_topsort_topsort.assert_not_data_A_cycli": {"doc_hash": "5fbbc3c0192d03907b3bf1afb604cd48bdcd1f3277c320c306e8aba052d18d4c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_missing_stubs_file_": {"doc_hash": "c132255e2f7166aefe2593fb2904453a06a54ea66cfe23a956c0c5863ee3cc3b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py__Mypy_type_checker__from_mypy_maptype_import_": {"doc_hash": "7a9f8a5e6ee7172451c27bcd84c33ad0f2e6b0c544bfa8bed12033415ad8c2a5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_from_mypy_typevars_import_PartialTypeScope.NamedTuple_PartialTypeSc": {"doc_hash": "d97af80256e5caf82bf7668eaf90cda7b41de5cc95d57212d9f0c79ec91e84e7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_member_assignment_TypeChecker.check_member_assignment._And_now_we_in_fact_type": {"doc_hash": "d4b52661ccc40b9f7961a3bffff0792972b6d8af90a7eb557eb7079d5b58e45a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_member_assignment._count_etc_replacing__TypeChecker.check_member_assignment.return.rvalue_type_if_infer_else": {"doc_hash": "f98e4da2d44cebd39a1f72c0fc19d15ba9b397704e2b63b4747c9c1b374d5fcb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.find_isinstance_check_helper_TypeChecker.find_isinstance_check_helper.if_is_true_literal_node_.elif_isinstance_node_Cal.if_refers_to_fullname_nod.elif_isinstance_node_call.if_node_callee_type_guard.if_literal_expr_LITER.return._expr_TypeGuardType_node": {"doc_hash": "7b86c59aa93a8825a17190afc05f5a7d6c9a8955c7b0b3c87d590df7d98066f6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_call_expr_inner.None_5_ExpressionChecker.visit_call_expr_inner.return.ret_type": {"doc_hash": "2fc815e0421d1a51c18f36bbf150379da1cb2ea692a769b41f40704fec9362a6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_CONNECTION_NAME_process_start_options.return.options": {"doc_hash": "9178b58d1d0272340e64cbc3af290bf5ecc7e25251782554ced51be0c8846d65"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_ignore_suppressed_imports_ChangesAndRemovals.Tuple_ModulePathPairs_Mo": {"doc_hash": "9b01260161015524405e584b5599a82358d0e80c3599a71c36039b85d1a82639"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server.check_Server.check.return.res": {"doc_hash": "7df3fd2f916aba29dd8ea6d35470674b3acaf4692e1c718ba59fa83d84164f02"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server.flush_caches_Server.following_imports.return.self_options_follow_impor": {"doc_hash": "5cd424161a56556786e8579d5594caaf3c22c7b2fc2e0a9eb3c0197663e9fcd7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server.find_reachable_changed_modules_Server.direct_imports.return._BuildSource_graph_dep_p": {"doc_hash": "a244e9bb0d190ae853656fd215047e6de0b2d73633b5dc9cb5d9062fff437533"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server.find_added_suppressed_Server.find_added_suppressed.return.found": {"doc_hash": "e8c0fa310e7148379a1ceb3a8a26c5f4e4c5985b5ed30b680f763037ad2b6955"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_find_all_sources_in_build_fix_module_deps.for_module_state_in_grap.state.suppressed_set.set_new_suppressed_": {"doc_hash": "266a44fac3a24c33ca5aadf32323f81cb7662a80d5ef39583c11c2812e89ade6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_filter_out_missing_top_level_packages_": {"doc_hash": "bfdf3bb361c9c49c6757512c7dd63eaa5317e463ac3d19da7ba66d4e870aea2c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/find_sources.py__Routines_for_finding_t_InvalidSourceList._Exception_indicating_a": {"doc_hash": "e7a5ece49163d2384b796d62ad3ca4749fc3ed68e4ca3d005eb99fc36cba6ecc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/find_sources.py_create_source_list_create_source_list.return.sources": {"doc_hash": "79d0c3b59809ab5201b2f26c19bbeb0f12d342a041708541a97b74b955c41b3a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fixup.py_TypeFixer.visit_type_alias_type_TypeFixer.visit_callable_type.if_ct_type_guard_is_not_N.ct_type_guard_accept_self": {"doc_hash": "ee51e7876f9a6fed5af145eeb95d17ae021031bfba76f1d554b43f254a12b850"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fscache.py_FileSystemCache._exists_case_FileSystemCache.exists.return.True": {"doc_hash": "4e3f980e7a75acae54b9045f12d76bd58784c509c082cdc981907827ef3d4f44"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fscache.py_FileSystemCache.read_": {"doc_hash": "94604dee41156364ce1e1e75d131b8fb5514de90ecb596a6035145bc8de296e2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/git.py__Git_utilities__": {"doc_hash": "30088a1ee8c1e555359400099d1b9a90325e158fe692ddf6e87e844f0829efa9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_process_options.other_group_add_argument__process_options.None_78": {"doc_hash": "22279168c3f7846a56ec96bcb1d545ba680f3cc1bd07d8f3f4b774882d57c759"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_process_options._bazel_changes_some_be_process_options._This_lets_config_fil": {"doc_hash": "9f781a6517db267c45f1aaccbc28799ce8f41e60298e60a9eaf7b07ef42947b8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_process_options.if_config_file_and_not_os_process_options.options_disabled_error_co": {"doc_hash": "2293f708fd75c152c303c6860e0ec7e06b8c3ff4e87c24daae18203cbfb1a2a0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_process_options.options_enabled_error_cod_process_options.if_special_opts_modules_.else_.return.targets_options": {"doc_hash": "5492c8ce10201b63d6a26a70e9e90cea68fd2602fcb0eb322d451021797cb77c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_maybe_write_junit_xml_fail.sys_exit_2_": {"doc_hash": "e54098eec0c37752dc0c55db6b226f8c1fde357fd8ae0c70061eacc41f6c62da"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_install_types_": {"doc_hash": "88f9e2d1c84bb358260d09aa1f7b0fd2564e439e55284222bb556cf651ffa5f8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.incompatible_argument_note_MessageBuilder.incompatible_argument_note.if_isinstance_callee_typ.if_call_.self_note_call_original_c": {"doc_hash": "d2c214583be032a4227982b30cbb07dcb1058722408df6112c1d9d8033132fad"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.invalid_index_type_MessageBuilder.too_few_arguments.self_fail_msg_context_c": {"doc_hash": "4e24bf33f1162482bbaac0a3d9a310b441ea0b8bd771e14e6eabe9de5575cf50"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py__Low_level_infrastructu_PYTHON2_STUB_DIR._python2_": {"doc_hash": "fbfd09ec30c739ca6208a4459309d02dc0442bf2b99b2f1d7c869074f834fb3d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_None_4_ModuleNotFoundReason.STUBS_NOT_INSTALLED.3": {"doc_hash": "7c26c8e81fd63dd7fd2819e5ffe0e948f4206ef638d0839afe230b669860d26f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_ModuleNotFoundReason.error_message_templates_ModuleNotFoundReason.error_message_templates.return.msg_notes": {"doc_hash": "29a1e7333c9adc4625049627a5a0fa43d97ce3193a52077ec8d467de7e8faab8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py__If_we_found_the_module__BuildSource.__repr__.return._BuildSource_path_r_mod": {"doc_hash": "0ec55124237ff2bb5e70d37fc0a68296b3b7b5bf973d8be54e6e0bfb27179c5b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_FindModuleCache._find_module_non_stub_helper_FindModuleCache._find_module_non_stub_helper.if_components_0_in_legac.else_.return.ModuleNotFoundReason_NOT_": {"doc_hash": "5ac6376957f0e1ec8254e3a3da7dd9b824b9fc3c8edec1976be00cd30bc3dbe8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_FindModuleCache._find_module_FindModuleCache._find_module.candidate_base_dirs.self_find_lib_path_dirs_i": {"doc_hash": "10ad2c9cf37e8b606ec3ffbc0e110110c47f8e6a3066a14753c626da355916d1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_FindModuleCache._find_module.if_use_typeshed__FindModuleCache._find_module.None_30": {"doc_hash": "79db74a2ed6a775ce21de9e1b46184537f843b25bb3686d7cd0f2978d2794aed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_FindModuleCache._find_module._The_helper_function_hig_FindModuleCache._find_module.if_need_installed_stubs_.else_.return.ModuleNotFoundReason_NOT_": {"doc_hash": "1189073083e492f5548c4c4812db888e9fcc1162ac65db7bf2ba29e65fd01e16"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_FindModuleCache._is_compatible_stub_package_FindModuleCache._is_compatible_stub_package.return.True": {"doc_hash": "0d5fe5c3d29b598eb8812d9fafb430d38853075ee060e89bfbd3cccbca79f3eb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_matches_exclude_verify_module.return.True": {"doc_hash": "5a0dae038063f0979c76837867c88c803c0ccfecbc2ae3835114265bd7f74d69"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_compute_search_paths.for_site_dir_in_site_pack_compute_search_paths.return.SearchPaths_python_path_t": {"doc_hash": "7a33765848ea19880aac4390f36530e282bb8ca5bc67ab1622f8dada879850b5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_RefExpr_RefExpr.__init__._type_Optional_mypy_typ": {"doc_hash": "951da3ad53c15c83af46a3388814f1e5c4b45d119ebc06416310b373758f1fe1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/options.py_Options._Options_collected_from_Options.__init__.self.raise_exceptions.False": {"doc_hash": "05e204715f2b2fe06ca87f1b39634cd16177e2fc0be17627de03bb98d85dd252"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/options.py_Options.__init__.self.dump_type_stats_Options.__init__.self.install_types.False": {"doc_hash": "39c2f6441df85f268b562ae72cde59d41c9022cfaf4cfb781c9b0352b8380951"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_FineGrainedBuildManager.trigger_FineGrainedBuildManager.flush_cache.self_manager_ast_cache_cl": {"doc_hash": "dd18ddfdde99567fd7e4eac6f63d5c3b1ede570cca3636363ea36f7a93efee39"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubdoc.py_infer_arg_sig_from_anon_docstring_infer_ret_type_sig_from_anon_docstring.return.infer_ret_type_sig_from_d": {"doc_hash": "6d51f2305ec44a6a298d961bfaa1666d3b4b33885476443c878d45ff7b67f05d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubSource_StubSource.path.return.self_source_path": {"doc_hash": "e0559c7601993a5b203eb525a3978311e32ac8af4e3067ad376a59686f2abc63"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.visit_overloaded_func_def_StubGenerator.visit_overloaded_func_def.for_item_in_o_items_.if_not_overload_chain_.else_.self_clear_decorators_": {"doc_hash": "ddaad161c05aaa81612a40da4f7e15731edf3fe99bc48fd4fb1397e50e3630bb"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.visit_decorator_StubGenerator.process_decorator.return.is_abstract_is_overload": {"doc_hash": "37383c887b40eab321c5c590cf6b3183047511808ef34bdf5b272600600b5ece"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.process_member_expr_decorator_StubGenerator.process_member_expr_decorator.return.is_abstract_is_overload": {"doc_hash": "e5185a007e24d4a01099b11528bc33562badd69aaee49ee3693ebf6cec424f82"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgenc.py_add_typing_import_is_pybind11_overloaded_function_docstring.return.docstr_startswith_ar": {"doc_hash": "914db16293011ec8aef2d469933376a86001244c795dc52408e884456a6a647e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgenc.py_strip_or_import_is_static_property.return.type_obj___name___py": {"doc_hash": "f9065d8ae3fe1e3c08c65bde65d2ddaa1d0fb87eb9c5d7aab757bd78baaadf85"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgenc.py_generate_c_property_stub_generate_c_property_stub.if_is_static_property_obj.else_regular_property.if_readonly_.else_.rw_properties_append_": {"doc_hash": "9dac71bc5ee1c6db3fe25805bf41a3008eb9be9b1790acea281f5e797cb9f73c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgenc.py_generate_c_type_stub_generate_c_type_stub.if_bases_.else_.bases_str._": {"doc_hash": "f717aeb79815ee831da029738941dc8ab5308ab75852d65fe041ccea0d84a544"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgenc.py_generate_c_type_stub.if_types_or_static_proper_generate_c_type_stub.if_types_or_static_proper.else_.output_append_class_s_s": {"doc_hash": "11cfcdb1d003dcec4d2aedabf4b4eb1d9efcbc1350f8e698e01dfffd14677f1f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgenc.py_get_type_fullname_is_skipped_attribute.return._attr_in___getattribute": {"doc_hash": "1a2f2ae4b43e5376bd135221a8df8cc7e92c0f33e20790c89efd0b7362f7c934"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubinfo.py_legacy_bundled_packages_": {"doc_hash": "baa6d4089976a6be4a6f7f29a32da5c3524b1564299c1ab20a0e9bbe3490a454"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py__verify_arg_default_value_maybe_strip_cls.return.args": {"doc_hash": "8a1b32f7d5ee7104d79eb06b86faf1ca73069f4272489b9f49c684de23660d8e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/test_find_sources.py_os_FakeFSCache.init_under_package_root.return.False": {"doc_hash": "cdf589ccde35773a5e959ff324919de65381bf6d922fd2dd918d9f05a7b67ee4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/test_find_sources.py_SourceFinderSuite.test_find_sources_in_dir_no_namespace_SourceFinderSuite.test_find_sources_in_dir_no_namespace.assert_find_sources_in_di": {"doc_hash": "a9157b35c82805fb3e7c337b299d2e65a4553415441bb5e07304eab10c664e36"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/test_find_sources.py_SourceFinderSuite.test_find_sources_in_dir_namespace_SourceFinderSuite.test_find_sources_in_dir_namespace.assert_find_sources_in_di": {"doc_hash": "13f6b8efa9bdac25db520481bdfab6d4ae741ce666617d44460150912a1bb16e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/test_find_sources.py_SourceFinderSuite.test_find_sources_in_dir_namespace_explicit_base_SourceFinderSuite.test_find_sources_in_dir_namespace_multi_dir.assert_find_sources_in_di": {"doc_hash": "27d3bb788f75d54bf918f476441737c87001c591d229b331d23f3affadf3232a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/test_find_sources.py_SourceFinderSuite.test_find_sources_exclude_SourceFinderSuite.test_find_sources_exclude.fscache_13.FakeFSCache_files_": {"doc_hash": "fd0b6b1c05fcaff3322ab6202efe1e4b42bbeb6d169a0d5fb9f05e726ddd44be"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/test_find_sources.py_SourceFinderSuite.test_find_sources_exclude.None_7_": {"doc_hash": "42590831cb5d860b07985d0a66a6ff1d7b3e5059c62fa61f829e224f8154f6a6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testcheck.py_TypeCheckSuite.run_case_once_TypeCheckSuite.run_case_once.if_output_a_and_testca.update_testcase_output_te": {"doc_hash": "874027353237552d9549758f8355b39a1e7eedbb83a6e5f3766b1730bcf9254a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testcheck.py_TypeCheckSuite.run_case_once.assert_string_arrays_equa_TypeCheckSuite.run_case_once.if_testcase_output_files_.check_test_output_files_t": {"doc_hash": "f05d695c47d877431e0ea7be1577cf2989f783fa35ee0b9e5bdcd019618def8d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testdaemon.py_run_cmd_run_cmd.try_.except_subprocess_CalledP.return.err_returncode_err_outpu": {"doc_hash": "41e788da00d02bb2708c078c5c5d3e1e058aa8c392d07bbd85500aa9c8e6325d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testdaemon.py_DaemonUtilitySuite_": {"doc_hash": "6e20f55b777601f8fcc89b3dd19617d420ce6ae4e071f3d0894bc9a0db0d8925"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testfscache.py__Unit_tests_for_file_sy_TestFileSystemCache.test_isfile_case_1.None_1.None_3": {"doc_hash": "f5467a875d722eb03754dc7948b4e2e793e03a13776fc59b7d67fd7f4566685b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testfscache.py_TestFileSystemCache.test_isfile_case_2_TestFileSystemCache.test_isfile_case_2.None_1.None_4": {"doc_hash": "9863bee7e93994a60035273954cf24e0ddd417c7dc8cb6b6aac6fbf4286b2dde"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testfscache.py_TestFileSystemCache.test_isfile_case_3_TestFileSystemCache.test_isfile_case_3.for_i_in_range_2_.None_8": {"doc_hash": "bf3d87a1f216babda83ddd78c90f71e5c547843eee99055b5234d22bd780e04e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testfscache.py_TestFileSystemCache.test_isfile_case_other_directory_TestFileSystemCache.test_isfile_case_other_directory.with_tempfile_TemporaryDi.if_sys_platform_in_win3.assert_self_isfile_case_o": {"doc_hash": "ff637cd276aba7c7505b636bba562b84fd75bd17fbbf4252ec9f39ff12660510"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testfscache.py_TestFileSystemCache.make_file_": {"doc_hash": "9c16f80ad15c195ae1f2a2b7c6403680db2e6e733349b0596a748d7bff57656f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsamples.py_os.path_SamplesSuite.test_samples.for_f_in_find_files_os_pa.run_mypy_mypy_args_f_": {"doc_hash": "dc16a1e026b501cfdb82fb7883dda4b63e075555b42467927a3b96b22fc16fd1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsamples.py_SamplesSuite.test_stdlibsamples_": {"doc_hash": "9219af4727f84202e43bd09a4b0bb6e81409ebd71c07def5d1b8e752fa8d4744"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenPythonSuite.parse_flags_TestClass.pass": {"doc_hash": "4e980ef09cbd9b2f62a06d7f4549d2098585d0866bafa24fa2f5a383db8b3069"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgencSuite.test_generate_c_type_inheritance_StubgencSuite.test_generate_c_type_inheritance_builtin_type.assert_equal_imports_": {"doc_hash": "e5a0ff7fdd4d5a388e71f47abc29aedd8ac854b204b799c834776b9978801d3c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/traverser.py_TraverserVisitor.visit_try_stmt_TraverserVisitor.visit_generator_expr.o_left_expr_accept_self_": {"doc_hash": "26e0723e830b24fd58a16fb09446b7f51f6612cdd1509ff139dd534eb1d8ad2e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/traverser.py_TraverserVisitor.visit_dictionary_comprehension_TraverserVisitor.visit_exec_stmt.if_o_locals_.o_locals_accept_self_": {"doc_hash": "f5bfa67ce32e6ebcae166019259f710cdbf842b10263266c3e7d72dc604ec231"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.visit_callable_type_TypeAnalyser.visit_callable_type.return.ret": {"doc_hash": "4dda28dfec66c78ccbde4b53c900fcd1220265c128d25064bbbb06b6f95ee5b4"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.anal_type_guard_TypeAnalyser.visit_overloaded.return.t": {"doc_hash": "92f4a4f9082ff58d985a758299f31b51ae7896802800675b69c0e1eea9c4f0b7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypeGuardType_TypeVarId.is_meta_var.return.self_meta_level_0": {"doc_hash": "156a3add69bcd1dff17e75219aecf454055e4152518a6b8214de8f0e5460cba2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_CallableType.__init___CallableType.__init__.self.type_guard.type_guard": {"doc_hash": "3d61bbc86ee74e41ebf109a7e6165d6bd77ec6fdf2f3e55c4e2c34d608fadd15"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_FancyFormatter.format_error_FancyFormatter.format_error.return.self_style_msg_red_bo": {"doc_hash": "61901701bee1fb601f103517b931e4a0afd654527d84a77c70fee1f7582d450f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_is_typeshed_file_": {"doc_hash": "acb1be61d68fc493aeae7c606a0d9a3c8d71ab3463a74042cd4488545585f367"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/visitor.py_NodeVisitor_NodeVisitor.visit_exec_stmt.pass": {"doc_hash": "39c68ae05c5b5a97b8ac0bfd2a99bbf0c85acc6a062aa086e74a3db806a10d60"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/visitor.py_NodeVisitor._Expressions_default_no_NodeVisitor.visit_type_var_expr.pass": {"doc_hash": "7508d0558bc461d461e4761239cad173ffdf36402f61678f491affa055d38e02"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/visitor.py_NodeVisitor.visit_paramspec_expr_": {"doc_hash": "a676868d78b6824ee7116e1fc502bb11c7e6421c236c9ecc2d40b4a425747df1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py__Utilities_for_emitting_from_mypyc_codegen_litera": {"doc_hash": "2208cffe8bab671d1ecd2fdcacc622b3a054ae095a184049f0695f3281379cf2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_EmitterContext_EmitterContext.__init__.self.literals.Literals_": {"doc_hash": "58b466a82d7a32297d1503e58bc90b5d1faefd55d21ffcd8ea1be807ed80427d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_class.if_cl_has_dict__generate_class.None_14.generate_getseters_cl_em": {"doc_hash": "8a4095f5d3aa600ea267ca836d9f815256f89d0b6317a023ba29d8ff75a7562e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.visit_load_literal_FunctionEmitterVisitor.visit_load_literal.if_not_is_int_rprimitive_.else_.self_emit_line_s_CPy": {"doc_hash": "bc952497e94aeb2681938b062c7eace06f0a0287cc99a3bfcc2daa6dae9a14bc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py__Generate_C_code_for_a__FileContents.List_Tuple_str_str_": {"doc_hash": "9c4512126bdb3b8f6d33cb4245c1204a4f53e4660984faa4d5342950d127dc0a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_MarkedDeclaration_MypycPlugin.__init__.self.metastore.create_metastore_options_": {"doc_hash": "b476b2312f1cb32c96872dc3d1df9c198fadfa81bf1a69e9fbf4f82bf18c69cd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_generate_function_declaration_generate_function_declaration.if_fn_name_TOP_LEVEL_N.if_is_fastcall_supported_.else_.emitter_context_declarati": {"doc_hash": "6f7806cae95a5726274803fa6d8b905a435042e734bf50cdb107e59ea953d887"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_pointerize_group_dir.return.os_sep_join_group_name_sp": {"doc_hash": "d7e4a76e2030f6662da70e7190cb1643e7ff0cfaea5cb524ed757128a08b1c0a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_GroupGenerator.generate_literal_tables_GroupGenerator.generate_literal_tables.None_6": {"doc_hash": "43712cdbe26bd763791261388e34d04a5d2a50538928b43fae423b85a860c875"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_GroupGenerator.generate_globals_init_GroupGenerator.generate_globals_init.None_3": {"doc_hash": "13f16a926c12971763450c3ff80402480fb80370abe6ca66e86bc7c94f694549"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_GroupGenerator.declare_global_GroupGenerator.declare_global.if_name_not_in_self_conte.self_context_declarations": {"doc_hash": "52d5b58c5ee9fd5bb86de18a765d983d63932a16b3fd0131b929b834ffb950c0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_GroupGenerator.declare_internal_globals_GroupGenerator.declare_module.self_simple_inits_append_": {"doc_hash": "44aeacb797b611cc9a28b54a292de11c482b07f56fc4cceff411ebc4d03c8ca0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_T_collect_literals.for_block_in_fn_blocks_.for_op_in_block_ops_.if_isinstance_op_LoadLit.literals_record_literal_o": {"doc_hash": "1545501b152c2b279303296415106d28936c62f537a7a53336fb978387fc0ccd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_c_array_initializer_": {"doc_hash": "83493e25265cbfe036a8995f3eb58ffe14446311f38c3d364cf871c8ad50e97a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitwrapper.py__Generate_CPython_API_w_wrapper_function_header.return._": {"doc_hash": "b0f816f9bc263a99df73213a6b77607c4b66250a471fd7117d310f6577669745"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitwrapper.py_generate_traceback_code_generate_traceback_code.return.traceback_code": {"doc_hash": "cd8c892dace1bda73539ef41d061b2095270cba2ef1276e29f1fcb90e8f46ee7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitwrapper.py_make_arg_groups_make_static_kwlist.return._static_const_char_cons": {"doc_hash": "bd5f03cce7f8066ff67ca28b9118153c1c4ec725db007c60e351c52dfa5b09e2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitwrapper.py_generate_wrapper_function_generate_wrapper_function.None_5": {"doc_hash": "9702451acc0953132178d9f3937448e4290a330803975503dfa70cc8806e84e6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitwrapper.py__Legacy_generic_wrapper__legacy_wrapper_function_header.return._PyObject_prefix_name_": {"doc_hash": "96fdd146e3bcb6dc9217f8515c5749ae3b91f2e8a327e5e0e4fbea1080d92e15"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitwrapper.py_generate_legacy_wrapper_function_generate_legacy_wrapper_function.None_4": {"doc_hash": "40b794bc6be4b5c6fdef8593fbeb73a8bda6aaab444ebd8e4cf7efa04cf6e6f5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitwrapper.py__Specialized_wrapper_fun_RICHCOMPARE_OPS._": {"doc_hash": "ed85caacd6c18c153f1a4ed5f0787241cb6673bfeeb278bd12ca850093479e80"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitwrapper.py__Helpers_generate_wrapper_core.if_use_goto_.emitter_emit_lines_retur": {"doc_hash": "a58fd93b465a47d58a8291807e9a274cba02e9390ae8b4359dd2bda05bf0923a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/literals.py_from_typing_import_Dict__Literals.__init__._type_Dict_Tuple_object": {"doc_hash": "8ac23b1dfd1a246ec15c72ef561ddff0f7c5eeb7281633c9cbf718b8d63d77e0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/literals.py_Literals.record_literal_Literals.record_literal.if_isinstance_value_str_.else_.assert_False_invalid_li": {"doc_hash": "71cd1fc5927b077c93f4ff6ccb007643f04fd8186ca6dfad2bb221c3d753a038"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/literals.py_Literals.literal_index_Literals.literal_index.assert_False_invalid_li": {"doc_hash": "80a7c4758e46127be5f25ac1bcec2aff1db540363a0f1a75281ef14da72b0ed0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/literals.py_Literals.num_literals_Literals.encoded_complex_values.return._encode_complex_values_se": {"doc_hash": "ba45e9a6629a22858d6b4fdeb3ec2ed7e684cca348942521961e8507887f9a3c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/literals.py_Literals.encoded_tuple_values_Literals.encoded_tuple_values.return.result": {"doc_hash": "7f146624a6724eb08ed1a5bfdc35b6bdf4f209ffa723813e5e15a087a50e55c2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/literals.py__encode_str_values__encode_str_values.return.result": {"doc_hash": "453cbb4d26a1e0099f404b78a18725d1d8911badc4a7629ac8fe8826553951bc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/literals.py__encode_bytes_values__encode_bytes_values.return.result": {"doc_hash": "3d14b922c0386957639d755f2e7890530372ffa3f19c38beca97b4b5a440deb2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/literals.py_format_int_format_str_literal.return.format_int_len_utf8_u": {"doc_hash": "464fd92db4a9209a9ee90285bbdd50e821d2f6c4ba9a8f093eb280e2479455a2"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/literals.py__encode_int_values__encode_int_values.return.result": {"doc_hash": "6f4b84f9725b3e1d5e072d0e5a8b1a082add50969b63e9a23abffd45ee563129"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/literals.py_float_to_c__encode_float_values.return.result": {"doc_hash": "ebd6e719724592e6e0e1fbbe55472630473eb6e12858e1ca51e396030d643d69"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/literals.py__encode_complex_values_": {"doc_hash": "a5123f88f0b16a3661593dd2f8e594536e4ca2e063e02ab3561be08b14f0b51d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_LoadLiteral_LoadLiteral.accept.return.visitor_visit_load_litera": {"doc_hash": "bc71193a72808a9546e32dd5346741673cb3d62310600cc1d0b238614a7e8386"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/pprint.py_IRPrettyPrintVisitor.visit_raise_standard_error_IRPrettyPrintVisitor.visit_raise_standard_error.if_op_value_is_not_None_.else_.return.self_format_r_raise_": {"doc_hash": "53f7299c0a630de6d0599362036049d3612bff26bd41ce26eb8dc0a2544dc07f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder._Loading_various_values_LowLevelIRBuilder.load_complex.return.self_add_LoadLiteral_valu": {"doc_hash": "0bbaf4d5f59ad463b4b7aceeabf5fd09f5ca6a15c42be119ae2e76169bf23d30"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/mapper.py_Mapper_Mapper.__init__._type_Dict_SymbolNode_": {"doc_hash": "dcb7d96aae4422664793d8f10bd8fe144ad353231871bf809f42316de8729727"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/mapper.py_Mapper.get_arg_rtype_": {"doc_hash": "d88bd0612654bbe4ada0e37964407714411a2b2db279098b55cbe7baf301aaa7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/str_ops.py__Primitive_str_ops___str_begin_end_": {"doc_hash": "2a139e33ebfdaba2ef0621714491d20bea7811def40dc3b48f66b75ff4268d4c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/str_ops.py_str_slice_op_": {"doc_hash": "c5fa8af9a3d00e0839090b85f0c034539287400e258e095986ac405f5cdffbb5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_literals.py__Test_code_geneneration_TestLiterals.test_format_str_literal.None_4": {"doc_hash": "a69363e281d1fc540b537717f1864610dfa34ba6acde21c0575c945f20c26c1b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_literals.py_TestLiterals.test_encode_str_values_TestLiterals.test_encode_str_values.None_4": {"doc_hash": "c30ae08258ec54afb0c179a0d8af47513729a113d51ac2205fc0b6f3fdadb56c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_literals.py_TestLiterals.test_encode_bytes_values_TestLiterals.test_encode_bytes_values.None_4": {"doc_hash": "b1d98a26de90514acb1afb9ba0f44d25f0e078294094b4fc63228796488607dc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_literals.py_TestLiterals.test_encode_int_values_TestLiterals.test_simple_literal_index.None_4": {"doc_hash": "af487e003d8471b73ccca11fb2f777dd1ba08de55e5a79fa2c5c0cf2dc4da0be"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_literals.py_TestLiterals.test_tuple_literal_": {"doc_hash": "f20745b55711a7a7bb02d909dcc150442099efca0fd45a25c0598f9253b499a5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test-data/fixtures/ir.py_str_str.replace.pass": {"doc_hash": "c76d112d5b0543294932a9ba1bafb0d44f6c7b0e738346626c07afe1852fcd1b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test-data/fixtures/ir.py_list_list.index.pass": {"doc_hash": "5108216408d4dfaf54edb0409db68c1b22f1766e78ff60db50ab9c42b6679a60"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py_BaseAnalysisVisitor_BaseAnalysisVisitor.visit_keep_alive.return.self_visit_register_op_op": {"doc_hash": "2a0a6a6952cbf68ea34236a8c67924fb0ab631ec20bfed3bef777d0c45fa1c2e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.use_vectorcall_Emitter.emit_undefined_attr_check.self_emit_line_if_": {"doc_hash": "d169363ac9231c84ea584b1901cf901734f711d2759b09e4935b844fd819db51"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py__Code_generation_for_na_generate_call_wrapper.if_emitter_use_vectorcall.else_.return.wrapper_slot_cl_fn_emit": {"doc_hash": "1b69855f9761d8420bcff8accb6036ad2a2a5f7ae9566cc6f77cef59e8bf9f9c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor_FunctionEmitterVisitor.visit_goto.if_op_label_is_not_self_n.self_emit_line_goto_s_": {"doc_hash": "6a2863fa6b4c4dc437f602bf552be25997f8290fc97fcb46831b6f6c962da955"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.visit_branch_FunctionEmitterVisitor.visit_branch.if_false_is_self_next_blo.else_.self_emit_lines_": {"doc_hash": "56639280cc2d504598e6bed92151da9a5d190c3d81321c5ef9ea843a32eeb9de"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.visit_assign_FunctionEmitterVisitor.visit_assign_multi.self_emit_line_s_s_d_": {"doc_hash": "68c41e0986e50211b3c677f93518bef5f369e21dac4891a59179f025867684c6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.visit_load_error_value_FunctionEmitterVisitor.visit_load_error_value.if_isinstance_op_type_RT.else_.self_emit_line_s_s_": {"doc_hash": "12674593599c1e63042affb3b3b0d32e7643bf26ab2b283bd396059a5bbfbe04"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitwrapper.py_make_format_string_make_format_string.return.format": {"doc_hash": "9ad6b6480ee5320ef7b4e005c5509a1c61ab5a5b58b2d6fb4bd56912f9262475"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/common.py_sys_decorator_helper_name.return.___mypyc___decorator_hel": {"doc_hash": "328fe8e98cb0df05f225ddecde6c3a00e43c29a8d7c6eb8544730e9d1f39ddb7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/common.py_shared_lib_name_": {"doc_hash": "e3d730d365372e5ce647d99496067669749a807684068c6952bc74009f5d4c9f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/func_ir.py__Intermediate_represent_from_mypyc_namegen_import": {"doc_hash": "8d7ac4b9eaea83c8f492efcd23d66df31b2b473f67c36b8785a89e563d6d829f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/func_ir.py_RuntimeArg_RuntimeArg.deserialize.return.RuntimeArg_": {"doc_hash": "696c4e1917c06c88d5c9d55ce34318b10c1b15d43416d4274564237fe42835b7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_AssignMulti_AssignMulti.accept.return.visitor_visit_assign_mult": {"doc_hash": "8f9fb702dc3e3d23d8c7d0a1c78cf233fd40e65bb4bd4b9f278b54517771160c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_KeepAlive_KeepAlive.accept.return.visitor_visit_keep_alive_": {"doc_hash": "b41f7f1cc12d7452f5743a3f2eeb640f514ab63ed3d0bd02734970d15a8a2d9c"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_OpVisitor_OpVisitor.visit_keep_alive.raise_NotImplementedError": {"doc_hash": "9bf4ee3c1ead33e660029c24675e9fc97eb8ef7022d18a4d8de9ab8a7fe96074"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/pprint.py_IRPrettyPrintVisitor.visit_return_IRPrettyPrintVisitor.visit_dec_ref.return.s": {"doc_hash": "4d41176f05b6960507a26914d27e352b5a24642e582899847fc7de17257768e7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/pprint.py_IRPrettyPrintVisitor.visit_call_IRPrettyPrintVisitor.visit_unbox.return.self_format_r_unbox_": {"doc_hash": "e591e33153a6f0b97b6d38301b50794b37818bbb0b2bed98c5fd5b4deac90e2a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.get_module_IRBuilder.get_module_attr.return.self_py_get_attr_module_o": {"doc_hash": "8acf40c92888fdfdbd6dfa61cdd8a0ce046228ec15ef495c61c890c23c11768e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.disallow_class_assignments_IRBuilder.non_function_scope.return.len_self_fn_infos_2": {"doc_hash": "3c9bc1b72f35f78e79f24f8a7d770026cb7759c325200631f152c516a6ce08ab"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.init_final_static_IRBuilder.init_final_static.if_lvalue_node_final_valu.self_add_InitStatic_coerc": {"doc_hash": "1f6da07e83c8ecca471d1a489739c051cabd3332080989f537b394a314f16056"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/classdef.py_transform_class_def_transform_class_def._type_List_Tuple_Lvalue": {"doc_hash": "5a0a80adf4e6a2b5192a7dab9ddb1c4d00e2b1f179fb5582c6fd8646bf1cded5"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/classdef.py_add_non_ext_class_attr_add_non_ext_class_attr.if_not_isinstance_stmt_rv.if_.attr_to_cache_append_lva": {"doc_hash": "9ecf8dcffd7100c53aad5b6e455fb8241ac3dbe0b1ad77a9175fda7d44d05476"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py__Comprehensions_transform_dictionary_comprehension.return.d": {"doc_hash": "27b9d1e5c90cfe1ee00bf01ea6413f0ce7cb8897c3e43ea0505949b0253eab79"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_for_loop_helper_with_index_for_loop_helper_with_index.builder_activate_block_ex": {"doc_hash": "0d306050dffec96bd282293d8ea0d28edb7e6f34ee84cb3b321acfc7cd781ff9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_translate_list_comprehension_translate_set_comprehension.return.set_ops": {"doc_hash": "e8e642b2530c0cfb814c7ca4ee94db1177636e81bc4cf7e53fb16bb3a4162eb0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_comprehension_helper_comprehension_helper.handle_loop.for_loop_helper_builder_": {"doc_hash": "16879c2a64b9019af46df72e57cad2e57f081f71ef394b77e239472da30ab1b9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder._py_vector_call_LowLevelIRBuilder._py_vector_call.return.None": {"doc_hash": "02ef09301284a82b701c0d329fc9ca496948225992b1cf835083004914e11f80"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder._vectorcall_keywords_LowLevelIRBuilder.py_method_call.if_arg_kinds_is_None_or_a.else_.return.self_py_call_method_arg_": {"doc_hash": "676ce1bfbd8a89d0f3449fb4764b1fc42d731058c9b0bd9bc4fdd1707b228dc0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder._py_vector_method_call_LowLevelIRBuilder.call.return.self_add_Call_decl_args_": {"doc_hash": "8659b35096d6ff943c5ceff8b9f2d55c80a410f4a6b6c4037df2c39c70b7f5fd"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.builtin_len_LowLevelIRBuilder.builtin_len.if_is_list_rprimitive_typ.else_.if_use_pyssize_t_.else_.return.self_call_c_generic_len_o": {"doc_hash": "8e14ef062aa6000bd89a69727251518e721f94a208ce20849c30e2ebc74a1f5b"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.new_tuple_LowLevelIRBuilder._Internal_helpers": {"doc_hash": "aaafc8f600c33819559ade6da0d5e7e45a1b6a842a8c93ecf3dd6f99ce02f07f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/specialize.py_translate_set_from_generator_call_translate_set_from_generator_call.return.None": {"doc_hash": "e820d767ddbfbbd53b35c98617f212e2f11908b163f3e645c35a8b6c91af3e4e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/util.py_is_extension_class_is_extension_class.return.True": {"doc_hash": "da662fdb17663233c0cc2c3a38d158459e2a3dfd16d8d90d20e8b22bb30c8d66"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/util.py_get_func_def_concrete_arg_kind.if_kind_ARG_OPT_.else_.return.kind": {"doc_hash": "b5f2a1c3ec4dc986ccb3e1fe2b26d8e0143d102d3643c0c8806862ff59c1acc1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/generic_ops.py__Fallback_primitive_ope_None_2.binary_op_name_op_": {"doc_hash": "93835e44f206046914b704387d4abd2ac5e158dadc0699ab7302f9f9e053f118"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/generic_ops.py_binary_op_name___del_obj_attr": {"doc_hash": "92957a3857eb180d94b3505e86564cf812de82fd541d222367a1db197c21beb0"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/generic_ops.py_py_delattr_op_": {"doc_hash": "1b24c494a8e89d51bcfc488c59b2610ca776ca0c77b8aaabd1f1e367a41b20a1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor.test_branch_no_else_TestFunctionEmitterVisitor.test_branch_no_else.None_1": {"doc_hash": "2a48fb66a70077154f6c2f89187e44fd7543a3707592e29b716317c2018faf6f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor.test_branch_no_else_negated_TestFunctionEmitterVisitor.test_branch_no_else_negated.None_1": {"doc_hash": "9351ef2f37c7c7fb508d5e2e9c9a302c72014021e78a8c0792fffc00059301c9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor.test_branch_is_error_TestFunctionEmitterVisitor.test_branch_is_error.None_1": {"doc_hash": "6cf2d0de4786a38aeba2d07397e32638154a3bc8cc8b4ad5fc467b0467b74924"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor.test_branch_is_error_next_block_TestFunctionEmitterVisitor.test_branch_is_error_next_block.None_1": {"doc_hash": "c41e64211b2014b62cacf03d2d8d92cd3aaf92526ebb9fb08ee654e32f7e713e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor.test_load_mem_TestFunctionEmitterVisitor.test_get_element_ptr.None_2": {"doc_hash": "9d690d6d39e542042ef1f5633a71579ff67b7316cd5e89a1daf23d10e3d3ba2f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor.test_load_address_TestFunctionEmitterVisitor.test_long_unsigned.None_1": {"doc_hash": "3101c117dde049d7503975fc6c0411c28c373c0cddd27c7d46a9cf8ce874820d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_rarray.py__Unit_tests_for_RArray__": {"doc_hash": "e50b4f1a8bc5a34e37216560391584fe298b4b3d7471896e030c222df2a6f75f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/testutil.py_replace_word_size_replace_word_size.return.result": {"doc_hash": "67455f786ec228502375b90b34bf649b81683131d165f5bb3bc2fe53191d8aec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/testutil.py_infer_ir_build_options_from_test_name_": {"doc_hash": "5f4c103f4c33704f12bfcb2fa8e761ae400ea17032a15e2396100fe2f33eeee9"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/reachability.py__Utilities_related_to_d_reverse_op._": {"doc_hash": "8a197c75e2e6017da25148cead85fc95adf6f58e4fceaa42a21bb8caa87adf46"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/reachability.py_None_8_assert_will_always_fail.return.infer_condition_value_s_e": {"doc_hash": "4cb5e05b2e4e50c5e3adde795362fc45be2a2a325c141277b5741c1a1204b844"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.find_type_equals_check_TypeChecker.find_type_equals_check.return.if_map_else_map": {"doc_hash": "7e5923bead22882ed8941364a2f2c432987b8762203757e1642c964bd3224b75"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_make_inferred_type_note_make_inferred_type_note.return._": {"doc_hash": "005620015dd7d7d1098e2f65dcca5cbb99e5fcba4aad0039e2207c643149fe8d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_format_key_list_": {"doc_hash": "fae44fc8f31d13c01bd52ce4859edf373ba3f9e2ab40c6adb834246fbbc71947"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/dataclasses.py_DataclassTransformer._freeze_DataclassTransformer._freeze.for_attr_in_attributes_.if_sym_node_is_not_None_.else_.info_names_var_name_Sy": {"doc_hash": "7f1149e8bc8629905684f6b3432c4924bb95ba1a2f5a96bbbc6b1e10965e617e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/dataclasses.py_DataclassTransformer._propertize_callables_DataclassTransformer._propertize_callables.for_attr_in_attributes_.if_isinstance_get_proper_.info_names_var_name_Sy": {"doc_hash": "a5c19aacd7a64edf6af75f58b316824087e9f34453d1ba22792b0cccbac71154"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/dataclasses.py_dataclass_class_maker_callback_": {"doc_hash": "a650fe73d4c4ff9d0198d752889ca9df3066614ceefe0c0ad1b403901230be0e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/functools.py__Plugin_for_supporting___MethodInfo.NamedTuple__MethodInfo_": {"doc_hash": "a27ed1205420a3c96057dfb5281c47a95d75f5ed6c412dbf58b9fc306603e935"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/functools.py_functools_total_ordering_maker_callback_functools_total_ordering_maker_callback.for_additional_op_in__ORD.if_not_comparison_methods.add_method_to_class_ctx_a": {"doc_hash": "a1a5ecb00af096d24bffbc3815591cb5d9163c9f654317233df01e736841564f"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/functools.py__find_other_type__find_other_type.return.other_arg": {"doc_hash": "a583ba891f2e88084423668a2fcbc53dd0aff06170109aa804ba75e8708ca250"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/functools.py__analyze_class_": {"doc_hash": "2fcea277cfcde471ba75f073590916180f68400c47b43a0694178d81dcc9dd6a"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_is_protocol_implementation_is_protocol_implementation.for_l_r_in_reversed_as.if_mypy_sametypes_is_sam.return.True": {"doc_hash": "16e997959a08139457aa27b6a32cb6ee9b206b999100b02e974a80950679913d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_is_protocol_implementation.with_pop_on_exit_assuming_is_protocol_implementation.return.True": {"doc_hash": "ea7abb3c267863deeb3ffa387ce71dcdc5a7a8e6781149a94fa871fb50214711"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testcheck.py__Type_checker_test_case_if_sys_version_info_3.typecheck_files_append_c": {"doc_hash": "368593b166045abffd8f2c67fa4c718b070a0bd58331f4da96d678c68aee897d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testcheck.py_None_1_TypeCheckSuite.run_case.if_incremental_.else_.self_run_case_once_testca": {"doc_hash": "6b25655a3732d34634f06819c72670ed7b29b0a9e964ef17bdd60f4762cf1cff"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/classdef.py_allocate_class_MAGIC_TYPED_DICT_CLASSES._": {"doc_hash": "85db26d1792e213f598007e3ffa7c8031b2b6c033d981da4e6a9da4299c1ebcc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/classdef.py__type_Final_Tuple_str__populate_non_ext_bases.return.builder_new_tuple_bases_": {"doc_hash": "b9efa5ed2807da3099b74f8952c5e2d993f6326dccbcc4fe694cbae2fe0e17ed"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_sequence_from_generator_preallocate_helper_sequence_from_generator_preallocate_helper.return.None": {"doc_hash": "68a3936730c8ed04a95e3c5238f53422a78d9f91a4b5a9c69763c03e8b8b7fdc"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py__A_low_level_IR_build_from_mypyc_primitives_exc": {"doc_hash": "b5e33967833e9ed671a390efb9339139189b1967e11c0f3242f6abd3cdb9d560"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_from_mypyc_primitives_str_PY_VECTORCALL_ARGUMENTS_OFFSET.1_PLATFORM_SIZE_8_": {"doc_hash": "f2a117f4f2caea7d42696a1f92c95daccf236afad6f9acfa7acc45f3695a00f6"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py__type_Final_LowLevelIRBuilder.unbox_or_cast.if_target_type_is_unboxed.else_.return.self_add_Cast_src_target": {"doc_hash": "d1f9b48dfd2200a42d6d3d10ae0a06e037282d9f663d928fb72b38c5e3d29e03"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.new_list_op_with_length_LowLevelIRBuilder.new_list_op_with_length.return.self_call_c_new_list_op_": {"doc_hash": "c4f714212eeac3d7c25ff2d2efccdc76aa024d255364b14ad1d5899df582016d"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/dict_ops.py__Primitive_dict_ops___dict_update_obj_": {"doc_hash": "35488148f8a8e35b879810b3eba3b164c97700a16ca98b082e3b2ce8f4b2ecac"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/dict_ops.py_method_op__dict_value_iter_op.custom_op_": {"doc_hash": "19a9133ea37a9eb07541b680c9eac3e9bac71f2c7df0b7a1458e24e857c116b8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/dict_ops.py_dict_item_iter_op_": {"doc_hash": "5f4a7a608461feef46b28f13a786fabf4ed1edb63d3e4c92c3993f3e2e8181a8"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/list_ops.py__List_primitive_ops___list_pop_index_": {"doc_hash": "5cd32a575dcff46be78c59cde622fde076111135ca362902d65e29203a029630"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/list_ops.py_list_pop_": {"doc_hash": "dddcab8c89a481318c8b33c4dd9bc2b1407afe9238aa6bbcf3fef71f87901090"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test-data/fixtures/ir.py_dict_dict.setdefault.pass": {"doc_hash": "b46514c4041aef6bab49c70a7d8a9995f375aeba8cd5b5b18a0e70118a884391"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_try_contracting_literals_in_union_try_contracting_literals_in_union.return.list_itertools_compress_p": {"doc_hash": "0f2c296c66fce5c68354b3b84fa37aa2645420f164016def5e9d685a779485ec"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py__parse_pth_file__parse_pth_file.with_f_.for_line_in_f_readlines_.yield__make_abspath_line_": {"doc_hash": "9dc0aae67000adf9f7231edde4a9fece2b307757a51f109fe9f438681141c287"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py__make_abspath_add_py2_mypypath_entries.return.result": {"doc_hash": "01e2a37d0fcfcb1cb68a976ebd633e10aaa69a3afb0c0c1b8a0315fc390f01e7"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_FindModuleCache.find_module_FindModuleCache._typeshed_has_version.return.version_min_version_an": {"doc_hash": "62935d608a5d631370361ec5ed2185cfa540705a99a0d38e69f3e4b63357a6a3"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_load_stdlib_py_versions_load_stdlib_py_versions.return.result": {"doc_hash": "0312d0dd126719e9414f59e1438fd7c54d1638f5c35c34a639ef320bb6c1e035"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_parse_version_typeshed_py_version.if_options_python_version.else_.return.options_python_version": {"doc_hash": "d9518e628421fac604c8e6c15be69884dd50d9d53876c0194ac82c32b697a619"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_filter_redundant_py2_dirs_": {"doc_hash": "3a1b99762a924fba47a825955f4ccaef3904f3becbca34f8566be63c44bc7f20"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/enums.py__implements_new__implements_new.return.type_with_new_fullname_no": {"doc_hash": "6bb290453cf5e314a833810c13f1b7a528ac1ef1f5237ede77494e217b774f2e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_run_stubtest_run_stubtest.with_use_tmp_dir_.return.output_getvalue_replace": {"doc_hash": "790c953fbe878373312ea3098e6d10a929e7fc3c578d2cbcbf1993138d2c9e5e"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_Case_collect_cases.return.test": {"doc_hash": "40020c4248a1347bee497548cd99900072f8807f2645a294732982f233f3c25e"}}, "docstore/data": {"/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/conftest.py_os.path_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/conftest.py_os.path_", "embedding": null, "metadata": {"file_path": "conftest.py", "file_name": "conftest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 19, "span_ids": ["imports", "pytest_addoption", "pytest_configure"], "tokens": 123}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os.path\n\npytest_plugins = [\n 'mypy.test.data',\n]\n\n\ndef pytest_configure(config):\n mypy_source_root = os.path.dirname(os.path.abspath(__file__))\n if os.getcwd() != mypy_source_root:\n os.chdir(mypy_source_root)\n\n\n# This function name is special to pytest. See\n# http://doc.pytest.org/en/latest/writing_plugins.html#initialization-command-line-and-configuration-hooks\ndef pytest_addoption(parser) -> None:\n parser.addoption('--bench', action='store_true', default=False,\n help='Enable the benchmark test runs')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/docs/source/conf.py__coding_utf_8___html_show_sphinx_True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/docs/source/conf.py__coding_utf_8___html_show_sphinx_True", "embedding": null, "metadata": {"file_path": "docs/source/conf.py", "file_name": "conf.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 176, "span_ids": ["docstring:42", "docstring:82", "docstring"], "tokens": 1319}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# -*- coding: utf-8 -*-\n#\n# Mypy documentation build configuration file, created by\n# sphinx-quickstart on Sun Sep 14 19:50:35 2014.\n#\n# This file is execfile()d with the current directory set to its\n# containing dir.\n#\n# Note that not all possible configuration values are present in this\n# autogenerated file.\n#\n# All configuration values have a default; values that are commented out\n# serve to show the default.\n\nimport sys\nimport os\n\nfrom sphinx.application import Sphinx\nfrom sphinx.util.docfields import Field\n\n# If extensions (or modules to document with autodoc) are in another directory,\n# add these directories to sys.path here. If the directory is relative to the\n# documentation root, use os.path.abspath to make it absolute, like shown here.\nsys.path.insert(0, os.path.abspath('../..'))\n\nfrom mypy.version import __version__ as mypy_version\n\n# -- General configuration ------------------------------------------------\n\n# If your documentation needs a minimal Sphinx version, state it here.\n#needs_sphinx = '1.0'\n\n# Add any Sphinx extension module names here, as strings. They can be\n# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom\n# ones.\nextensions = ['sphinx.ext.intersphinx']\n\n# Add any paths that contain templates here, relative to this directory.\ntemplates_path = ['_templates']\n\n# The suffix of source filenames.\nsource_suffix = '.rst'\n\n# The encoding of source files.\n#source_encoding = 'utf-8-sig'\n\n# The master toctree document.\nmaster_doc = 'index'\n\n# General information about the project.\nproject = u'Mypy'\ncopyright = u'2016, Jukka Lehtosalo'\n\n# The version info for the project you're documenting, acts as replacement for\n# |version| and |release|, also used in various other places throughout the\n# built documents.\n#\n# The short X.Y version.\nversion = mypy_version.split('-')[0]\n# The full version, including alpha/beta/rc tags.\nrelease = mypy_version\n\n# The language for content autogenerated by Sphinx. Refer to documentation\n# for a list of supported languages.\n#language = None\n\n# There are two options for replacing |today|: either, you set today to some\n# non-false value, then it is used:\n#today = ''\n# Else, today_fmt is used as the format for a strftime call.\n#today_fmt = '%B %d, %Y'\n\n# List of patterns, relative to source directory, that match files and\n# directories to ignore when looking for source files.\nexclude_patterns = []\n\n# The reST default role (used for this markup: `text`) to use for all\n# documents.\n#default_role = None\n\n# If true, '()' will be appended to :func: etc. cross-reference text.\n#add_function_parentheses = True\n\n# If true, the current module name will be prepended to all description\n# unit titles (such as .. function::).\n#add_module_names = True\npygments_style = 'sphinx'\n\n# A list of ignored prefixes for module index sorting.\n#modindex_common_prefix = []\n\n# If true, keep warnings as \"system message\" paragraphs in the built documents.\n#keep_warnings = False\n\n\n# -- Options for HTML output ----------------------------------------------\n\n# The theme to use for HTML and HTML Help pages. See the documentation for\n# a list of builtin themes.\ntry:\n import sphinx_rtd_theme\nexcept:\n html_theme = 'default'\nelse:\n html_theme = 'sphinx_rtd_theme'\n html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]\n\n# Theme options are theme-specific and customize the look and feel of a theme\n# further. For a list of options available for each theme, see the\n# documentation.\n#html_theme_options = {}\n\n# Add any paths that contain custom themes here, relative to this directory.\n#html_theme_path = []\n\n# The name for this set of Sphinx documents. If None, it defaults to\n# \" v documentation\".\n#html_title = None\n\n# A shorter title for the navigation bar. Default is the same as html_title.\n#html_short_title = None\n\n# The name of an image file (relative to this directory) to place at the top\n# of the sidebar.\n#html_logo = None\n\n# The name of an image file (within the static path) to use as favicon of the\n# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32\n# pixels large.\n#html_favicon = None\n\n# Add any paths that contain custom static files (such as style sheets) here,\n# relative to this directory. They are copied after the builtin static files,\n# so a file named \"default.css\" will overwrite the builtin \"default.css\".\n#html_static_path = ['_static']\n\n# Add any extra paths that contain custom files (such as robots.txt or\n# .htaccess) here, relative to this directory. These files are copied\n# directly to the root of the documentation.\n#html_extra_path = []\n\n# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,\n# using the given strftime format.\n#html_last_updated_fmt = '%b %d, %Y'\n\n# If true, SmartyPants will be used to convert quotes and dashes to\n# typographically correct entities.\n#html_use_smartypants = True\n\n# Custom sidebar templates, maps document names to template names.\n#html_sidebars = {}\n\n# Additional templates that should be rendered to pages, maps page names to\n# template names.\n#html_additional_pages = {}\n\n# If false, no module index is generated.\n#html_domain_indices = True\n\n# If false, no index is generated.\n#html_use_index = True\n\n# If true, the index is split into individual pages for each letter.\n#html_split_index = False\n\n# If true, links to the reST sources are added to the pages.\n#html_show_sourcelink = True\n\n# If true, \"Created using Sphinx\" is shown in the HTML footer. Default is True.\n#html_show_sphinx = True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/docs/source/conf.py_htmlhelp_basename_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/docs/source/conf.py_htmlhelp_basename_", "embedding": null, "metadata": {"file_path": "docs/source/conf.py", "file_name": "conf.py", "file_type": "text/x-python", "category": "implementation", "start_line": 190, "end_line": 294, "span_ids": ["docstring:82", "docstring:121", "setup"], "tokens": 717}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "htmlhelp_basename = 'Mypydoc'\n\n\n# -- Options for LaTeX output ---------------------------------------------\n\nlatex_elements = {\n# The paper size ('letterpaper' or 'a4paper').\n#'papersize': 'letterpaper',\n\n# The font size ('10pt', '11pt' or '12pt').\n#'pointsize': '10pt',\n\n# Additional stuff for the LaTeX preamble.\n#'preamble': '',\n}\n\n# Grouping the document tree into LaTeX files. List of tuples\n# (source start file, target name, title,\nlatex_documents = [\n ('index', 'Mypy.tex', u'Mypy Documentation',\n u'Jukka', 'manual'),\n]\n\n# The name of an image file (relative to this directory) to place at the top of\n# the title page.\n#latex_logo = None\n\n# For \"manual\" documents, if this is true, then toplevel headings are parts,\n# not chapters.\n#latex_use_parts = False\n\n# If true, show page references after internal links.\n#latex_show_pagerefs = False\n\n# If true, show URL addresses after external links.\n#latex_show_urls = False\n\n# Documents to append as an appendix to all manuals.\n#latex_appendices = []\n\n# If false, no module index is generated.\n#latex_domain_indices = True\n\n\n# -- Options for manual page output ---------------------------------------\n\n# One entry per manual page. List of tuples\nman_pages = [\n ('index', 'mypy', u'Mypy Documentation',\n [u'Jukka Lehtosalo'], 1)\n]\n\n# If true, show URL addresses after external links.\n#man_show_urls = False\n\n\n# -- Options for Texinfo output -------------------------------------------\n\n# Grouping the document tree into Texinfo files. List of tuples\ntexinfo_documents = [\n ('index', 'Mypy', u'Mypy Documentation',\n u'Jukka', 'Mypy', 'One line description of project.',\n 'Miscellaneous'),\n]\n\n# Documents to append as an appendix to all manuals.\n#texinfo_appendices = []\n\n# If false, no module index is generated.\n#texinfo_domain_indices = True\n\n# How to display URL addresses: 'footnote', 'no', or 'inline'.\n#texinfo_show_urls = 'footnote'\n\n# If true, do not generate a @detailmenu in the \"Top\" node's menu.\n#texinfo_no_detailmenu = False\n\nrst_prolog = '.. |...| unicode:: U+2026 .. ellipsis\\n'\n\nintersphinx_mapping = {\n 'python': ('https://docs.python.org/3', None),\n 'six': ('https://six.readthedocs.io', None),\n 'attrs': ('http://www.attrs.org/en/stable', None),\n 'cython': ('http://docs.cython.org/en/latest', None),\n 'monkeytype': ('https://monkeytype.readthedocs.io/en/latest', None),\n 'setuptools': ('https://setuptools.readthedocs.io/en/latest', None),\n}\n\n\ndef setup(app: Sphinx) -> None:\n app.add_object_type(\n 'confval',\n 'confval',\n objname='configuration value',\n indextemplate='pair: %s; configuration value',\n doc_field_types=[\n Field('type', label='Type', has_arg=False, names=('type',)),\n Field('default', label='Default', has_arg=False, names=('default',)),\n ]\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/actions_stubs.py__usr_bin_env_python3_apply_all.for_p_d_files_in_os_wal.if_not_recursive_.break": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/actions_stubs.py__usr_bin_env_python3_apply_all.for_p_d_files_in_os_wal.if_not_recursive_.break", "embedding": null, "metadata": {"file_path": "misc/actions_stubs.py", "file_name": "actions_stubs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 31, "span_ids": ["apply_all", "docstring"], "tokens": 224}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "#!/usr/bin/env python3\nimport os\nimport shutil\nfrom typing import Tuple, Any\ntry:\n import click\nexcept ImportError:\n print(\"You need the module \\'click\\'\")\n exit(1)\n\nbase_path = os.getcwd()\n\n# I don't know how to set callables with different args\ndef apply_all(func: Any, directory: str, extension: str,\n to_extension: str='', exclude: Tuple[str]=('',),\n recursive: bool=True, debug: bool=False) -> None:\n excluded = [x+extension for x in exclude] if exclude else []\n for p, d, files in os.walk(os.path.join(base_path,directory)):\n for f in files:\n if \"{}\".format(f) in excluded:\n continue\n inner_path = os.path.join(p,f)\n if not inner_path.endswith(extension):\n continue\n if to_extension:\n new_path = \"{}{}\".format(inner_path[:-len(extension)],to_extension)\n func(inner_path,new_path)\n else:\n func(inner_path)\n if not recursive:\n break", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/actions_stubs.py_confirm_actions._cp_mv_rm_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/actions_stubs.py_confirm_actions._cp_mv_rm_", "embedding": null, "metadata": {"file_path": "misc/actions_stubs.py", "file_name": "actions_stubs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 33, "end_line": 50, "span_ids": ["confirm", "impl:7"], "tokens": 195}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def confirm(resp: bool=False, **kargs) -> bool:\n kargs['rest'] = \"to this {f2}/*{e2}\".format(**kargs) if kargs.get('f2') else ''\n prompt = \"{act} all files {rec}matching this expression {f1}/*{e1} {rest}\".format(**kargs)\n prompt.format(**kargs)\n prompt = \"{} [{}]|{}: \".format(prompt, 'Y' if resp else 'N', 'n' if resp else 'y')\n while True:\n ans = input(prompt).lower()\n if not ans:\n return resp\n if ans not in ['y','n']:\n print( 'Please, enter (y) or (n).')\n continue\n if ans == 'y':\n return True\n else:\n return False\n\nactions = ['cp', 'mv', 'rm']", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/actions_stubs.py_main_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/actions_stubs.py_main_", "embedding": null, "metadata": {"file_path": "misc/actions_stubs.py", "file_name": "actions_stubs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 51, "end_line": 112, "span_ids": ["impl:9", "main"], "tokens": 700}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@click.command(context_settings=dict(help_option_names=['-h', '--help']))\n@click.option('--action', '-a', type=click.Choice(actions), required=True, help=\"What do I have to do :-)\")\n@click.option('--dir', '-d', 'directory', default='stubs', help=\"Directory to start search!\")\n@click.option('--ext', '-e', 'extension', default='.py', help=\"Extension \\\"from\\\" will be applied the action. Default .py\")\n@click.option('--to', '-t', 'to_extension', default='.pyi', help=\"Extension \\\"to\\\" will be applied the action if can. Default .pyi\")\n@click.option('--exclude', '-x', multiple=True, default=('__init__',), help=\"For every appear, will ignore this files. (can set multiples times)\")\n@click.option('--not-recursive', '-n', default=True, is_flag=True, help=\"Set if don't want to walk recursively.\")\ndef main(action: str, directory: str, extension: str, to_extension: str,\n exclude: Tuple[str], not_recursive: bool) -> None:\n \"\"\"\n This script helps to copy/move/remove files based on their extension.\n\n The three actions will ask you for confirmation.\n\n Examples (by default the script search in stubs directory):\n\n - Change extension of all stubs from .py to .pyi:\n\n python -a mv\n\n - Revert the previous action.\n\n python -a mv -e .pyi -t .py\n\n - If you want to ignore \"awesome.py\" files.\n\n python -a [cp|mv|rm] -x awesome\n\n - If you want to ignore \"awesome.py\" and \"__init__.py\" files.\n\n python -a [cp|mv|rm] -x awesome -x __init__\n\n - If you want to remove all \".todo\" files in \"todo\" directory, but not recursively:\n\n python -a rm -e .todo -d todo -r\n\n \"\"\"\n if action not in actions:\n print(\"Your action have to be one of this: {}\".format(', '.join(actions)))\n return\n\n rec = \"[Recursively] \" if not_recursive else ''\n if not extension.startswith('.'):\n extension = \".{}\".format(extension)\n if not to_extension.startswith('.'):\n to_extension = \".{}\".format(to_extension)\n if directory.endswith('/'):\n directory = directory[:-1]\n if action == 'cp':\n if confirm(act='Copy',rec=rec, f1=directory, e1=extension, f2=directory, e2=to_extension):\n apply_all(shutil.copy, directory, extension, to_extension, exclude, not_recursive)\n elif action == 'rm':\n if confirm(act='Remove',rec=rec, f1=directory, e1=extension):\n apply_all(os.remove, directory, extension, exclude=exclude, recursive=not_recursive)\n elif action == 'mv':\n if confirm(act='Move',rec=rec, f1=directory, e1=extension, f2=directory, e2=to_extension):\n apply_all(shutil.move, directory, extension, to_extension, exclude, not_recursive)\n\n\nif __name__ == '__main__':\n main()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/analyze_cache.py__usr_bin_env_python_extract_classes.yield_from_extract_chunk": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/analyze_cache.py__usr_bin_env_python_extract_classes.yield_from_extract_chunk", "embedding": null, "metadata": {"file_path": "misc/analyze_cache.py", "file_name": "analyze_cache.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 36, "span_ids": ["CacheData.total_size", "CacheData.__init__", "extract_classes", "CacheData", "docstring"], "tokens": 233}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "#!/usr/bin/env python\n\nfrom typing import Any, Dict, Iterable, List, Optional\nfrom collections import Counter\n\nimport os\nimport os.path\nimport json\n\nROOT = \".mypy_cache/3.5\"\n\nJsonDict = Dict[str, Any]\n\nclass CacheData:\n def __init__(self, filename: str, data_json: JsonDict, meta_json: JsonDict,\n data_size: int, meta_size: int) -> None:\n self.filename = filename\n self.data = data_json\n self.meta = meta_json\n self.data_size = data_size\n self.meta_size = meta_size\n\n @property\n def total_size(self):\n return self.data_size + self.meta_size\n\n\ndef extract_classes(chunks: Iterable[CacheData]) -> Iterable[JsonDict]:\n def extract(chunks: Iterable[JsonDict]) -> Iterable[JsonDict]:\n for chunk in chunks:\n if isinstance(chunk, dict):\n yield chunk\n yield from extract(chunk.values())\n elif isinstance(chunk, list):\n yield from extract(chunk)\n yield from extract([chunk.data for chunk in chunks])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/analyze_cache.py_load_json_load_json.return.CacheData_data_path_repla": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/analyze_cache.py_load_json_load_json.return.CacheData_data_path_repla", "embedding": null, "metadata": {"file_path": "misc/analyze_cache.py", "file_name": "analyze_cache.py", "file_type": "text/x-python", "category": "implementation", "start_line": 39, "end_line": 50, "span_ids": ["load_json"], "tokens": 108}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def load_json(data_path: str, meta_path: str) -> CacheData:\n with open(data_path, 'r') as ds:\n data_json = json.load(ds)\n\n with open(meta_path, 'r') as ms:\n meta_json = json.load(ms)\n\n data_size = os.path.getsize(data_path)\n meta_size = os.path.getsize(meta_path)\n\n return CacheData(data_path.replace(\".data.json\", \".*.json\"),\n data_json, meta_json, data_size, meta_size)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/analyze_cache.py_get_files_report_most_common.report_counter_Counter_st": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/analyze_cache.py_get_files_report_most_common.report_counter_Counter_st", "embedding": null, "metadata": {"file_path": "misc/analyze_cache.py", "file_name": "analyze_cache.py", "file_type": "text/x-python", "category": "implementation", "start_line": 53, "end_line": 74, "span_ids": ["pluck", "report_counter", "get_files", "report_most_common"], "tokens": 203}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_files(root: str) -> Iterable[CacheData]:\n for (dirpath, dirnames, filenames) in os.walk(root):\n for filename in filenames:\n if filename.endswith(\".data.json\"):\n meta_filename = filename.replace(\".data.json\", \".meta.json\")\n yield load_json(\n os.path.join(dirpath, filename),\n os.path.join(dirpath, meta_filename))\n\n\ndef pluck(name: str, chunks: Iterable[JsonDict]) -> Iterable[JsonDict]:\n return (chunk for chunk in chunks if chunk['.class'] == name)\n\n\ndef report_counter(counter: Counter, amount: Optional[int] = None) -> None:\n for name, count in counter.most_common(amount):\n print(' {: <8} {}'.format(count, name))\n print()\n\n\ndef report_most_common(chunks: List[JsonDict], amount: Optional[int] = None) -> None:\n report_counter(Counter(str(chunk) for chunk in chunks), amount)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/analyze_cache.py_compress_compress.return.out": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/analyze_cache.py_compress_compress.return.out", "embedding": null, "metadata": {"file_path": "misc/analyze_cache.py", "file_name": "analyze_cache.py", "file_type": "text/x-python", "category": "implementation", "start_line": 77, "end_line": 105, "span_ids": ["compress"], "tokens": 182}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def compress(chunk: JsonDict) -> JsonDict:\n cache = {} # type: Dict[int, JsonDict]\n counter = 0\n def helper(chunk: Any) -> Any:\n nonlocal counter\n if not isinstance(chunk, dict):\n return chunk\n\n if len(chunk) <= 2:\n return chunk\n id = hash(str(chunk))\n\n if id in cache:\n return cache[id]\n else:\n cache[id] = {'.id': counter}\n chunk['.cache_id'] = counter\n counter += 1\n\n for name in sorted(chunk.keys()):\n value = chunk[name]\n if isinstance(value, list):\n chunk[name] = [helper(child) for child in value]\n elif isinstance(value, dict):\n chunk[name] = helper(value)\n\n return chunk\n out = helper(chunk)\n return out", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/analyze_cache.py_decompress_decompress.return.helper_chunk_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/analyze_cache.py_decompress_decompress.return.helper_chunk_", "embedding": null, "metadata": {"file_path": "misc/analyze_cache.py", "file_name": "analyze_cache.py", "file_type": "text/x-python", "category": "implementation", "start_line": 107, "end_line": 131, "span_ids": ["decompress"], "tokens": 170}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def decompress(chunk: JsonDict) -> JsonDict:\n cache = {} # type: Dict[int, JsonDict]\n def helper(chunk: Any) -> Any:\n if not isinstance(chunk, dict):\n return chunk\n if '.id' in chunk:\n return cache[chunk['.id']]\n\n counter = None\n if '.cache_id' in chunk:\n counter = chunk['.cache_id']\n del chunk['.cache_id']\n\n for name in sorted(chunk.keys()):\n value = chunk[name]\n if isinstance(value, list):\n chunk[name] = [helper(child) for child in value]\n elif isinstance(value, dict):\n chunk[name] = helper(value)\n\n if counter is not None:\n cache[counter] = chunk\n\n return chunk\n return helper(chunk)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/analyze_cache.py_main_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/analyze_cache.py_main_", "embedding": null, "metadata": {"file_path": "misc/analyze_cache.py", "file_name": "analyze_cache.py", "file_type": "text/x-python", "category": "implementation", "start_line": 136, "end_line": 190, "span_ids": ["impl:5", "main"], "tokens": 458}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def main() -> None:\n json_chunks = list(get_files(ROOT))\n class_chunks = list(extract_classes(json_chunks))\n\n total_size = sum(chunk.total_size for chunk in json_chunks)\n print(\"Total cache size: {:.3f} megabytes\".format(total_size / (1024 * 1024)))\n print()\n\n class_name_counter = Counter(chunk[\".class\"] for chunk in class_chunks)\n print(\"Most commonly used classes:\")\n report_counter(class_name_counter)\n\n print(\"Most common literal chunks:\")\n report_most_common(class_chunks, 15)\n\n build = None\n for chunk in json_chunks:\n if 'build.*.json' in chunk.filename:\n build = chunk\n break\n original = json.dumps(build.data, sort_keys=True)\n print(\"Size of build.data.json, in kilobytes: {:.3f}\".format(len(original) / 1024))\n\n build.data = compress(build.data)\n compressed = json.dumps(build.data, sort_keys=True)\n print(\"Size of compressed build.data.json, in kilobytes: {:.3f}\".format(len(compressed) / 1024))\n\n build.data = decompress(build.data)\n decompressed = json.dumps(build.data, sort_keys=True)\n print(\"Size of decompressed build.data.json, in kilobytes: {:.3f}\".format(len(decompressed) / 1024))\n\n print(\"Lossless conversion back\", original == decompressed)\n\n\n '''var_chunks = list(pluck(\"Var\", class_chunks))\n report_most_common(var_chunks, 20)\n print()\n\n #for var in var_chunks:\n # if var['fullname'] == 'self' and not (isinstance(var['type'], dict) and var['type']['.class'] == 'AnyType'):\n # print(var)\n #argument_chunks = list(pluck(\"Argument\", class_chunks))\n\n symbol_table_node_chunks = list(pluck(\"SymbolTableNode\", class_chunks))\n report_most_common(symbol_table_node_chunks, 20)\n\n print()\n print(\"Most common\")\n report_most_common(class_chunks, 20)\n print()'''\n\n\nif __name__ == '__main__':\n main()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/apply-cache-diff.py__usr_bin_env_python3_make_cache.if_sqlite_.else_.return.FilesystemMetadataStore_i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/apply-cache-diff.py__usr_bin_env_python3_make_cache.if_sqlite_.else_.return.FilesystemMetadataStore_i", "embedding": null, "metadata": {"file_path": "misc/apply-cache-diff.py", "file_name": "apply-cache-diff.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 22, "span_ids": ["make_cache", "docstring"], "tokens": 132}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "#!/usr/bin/env python3\n\"\"\"Script for applying a cache diff.\n\nWith some infrastructure, this can allow for distributing small cache diffs to users in\nmany cases instead of full cache artifacts.\n\"\"\"\n\nimport argparse\nimport json\nimport os\nimport sys\n\nsys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))\n\nfrom mypy.metastore import MetadataStore, FilesystemMetadataStore, SqliteMetadataStore\n\n\ndef make_cache(input_dir: str, sqlite: bool) -> MetadataStore:\n if sqlite:\n return SqliteMetadataStore(input_dir)\n else:\n return FilesystemMetadataStore(input_dir)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/apply-cache-diff.py_apply_diff_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/apply-cache-diff.py_apply_diff_", "embedding": null, "metadata": {"file_path": "misc/apply-cache-diff.py", "file_name": "apply-cache-diff.py", "file_type": "text/x-python", "category": "implementation", "start_line": 25, "end_line": 61, "span_ids": ["impl:2", "apply_diff", "main"], "tokens": 245}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def apply_diff(cache_dir: str, diff_file: str, sqlite: bool = False) -> None:\n cache = make_cache(cache_dir, sqlite)\n with open(diff_file, \"r\") as f:\n diff = json.load(f)\n\n old_deps = json.loads(cache.read(\"@deps.meta.json\"))\n\n for file, data in diff.items():\n if data is None:\n cache.remove(file)\n else:\n cache.write(file, data)\n if file.endswith('.meta.json') and \"@deps\" not in file:\n meta = json.loads(data)\n old_deps[\"snapshot\"][meta[\"id\"]] = meta[\"hash\"]\n\n cache.write(\"@deps.meta.json\", json.dumps(old_deps))\n\n cache.commit()\n\n\ndef main() -> None:\n parser = argparse.ArgumentParser()\n parser.add_argument('--sqlite', action='store_true', default=False,\n help='Use a sqlite cache')\n parser.add_argument('cache_dir',\n help=\"Directory for the cache\")\n parser.add_argument('diff',\n help=\"Cache diff file\")\n args = parser.parse_args()\n\n apply_diff(args.cache_dir, args.diff, args.sqlite)\n\n\nif __name__ == '__main__':\n main()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/async_matrix.py__usr_bin_env_python3_decorated_host_coroutine.x_1.await_func_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/async_matrix.py__usr_bin_env_python3_decorated_host_coroutine.x_1.await_func_", "embedding": null, "metadata": {"file_path": "misc/async_matrix.py", "file_name": "async_matrix.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 86, "span_ids": ["plain_generator", "It", "decorated_generator", "plain_coroutine", "It.__iter__", "plain_host_coroutine", "decorated_host_coroutine", "other_coroutine", "decorated_coroutine", "It.__next__", "plain_host_generator", "Aw", "decorated_host_generator", "docstring", "other_iterator", "Aw.__await__"], "tokens": 465}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "#!/usr/bin/env python3\n\"\"\"Test various combinations of generators/coroutines.\n\nThis was used to cross-check the errors in the test case\ntestFullCoroutineMatrix in test-data/unit/check-async-await.test.\n\"\"\"\n\nimport sys\nfrom types import coroutine\nfrom typing import Any, Awaitable, Generator, Iterator\n\n# The various things you might try to use in `await` or `yield from`.\n\ndef plain_generator() -> Generator[str, None, int]:\n yield 'a'\n return 1\n\nasync def plain_coroutine() -> int:\n return 1\n\n@coroutine\ndef decorated_generator() -> Generator[str, None, int]:\n yield 'a'\n return 1\n\n@coroutine\nasync def decorated_coroutine() -> int:\n return 1\n\nclass It(Iterator[str]):\n stop = False\n def __iter__(self) -> 'It':\n return self\n def __next__(self) -> str:\n if self.stop:\n raise StopIteration('end')\n else:\n self.stop = True\n return 'a'\n\ndef other_iterator() -> It:\n return It()\n\nclass Aw(Awaitable[int]):\n def __await__(self) -> Generator[str, Any, int]:\n yield 'a'\n return 1\n\ndef other_coroutine() -> Aw:\n return Aw()\n\n# The various contexts in which `await` or `yield from` might occur.\n\ndef plain_host_generator(func) -> Generator[str, None, None]:\n yield 'a'\n x = 0\n f = func()\n try:\n x = yield from f\n finally:\n try:\n f.close()\n except AttributeError:\n pass\n\nasync def plain_host_coroutine(func) -> None:\n x = 0\n x = await func()\n\n@coroutine\ndef decorated_host_generator(func) -> Generator[str, None, None]:\n yield 'a'\n x = 0\n f = func()\n try:\n x = yield from f\n finally:\n try:\n f.close()\n except AttributeError:\n pass\n\n@coroutine\nasync def decorated_host_coroutine(func) -> None:\n x = 0\n x = await func()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/async_matrix.py__Main_driver__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/async_matrix.py__Main_driver__", "embedding": null, "metadata": {"file_path": "misc/async_matrix.py", "file_name": "async_matrix.py", "file_type": "text/x-python", "category": "implementation", "start_line": 88, "end_line": 121, "span_ids": ["decorated_host_coroutine", "impl", "main"], "tokens": 203}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Main driver.\n\ndef main():\n verbose = ('-v' in sys.argv)\n for host in [plain_host_generator, plain_host_coroutine,\n decorated_host_generator, decorated_host_coroutine]:\n print()\n print(\"==== Host:\", host.__name__)\n for func in [plain_generator, plain_coroutine,\n decorated_generator, decorated_coroutine,\n other_iterator, other_coroutine]:\n print(\" ---- Func:\", func.__name__)\n try:\n f = host(func)\n for i in range(10):\n try:\n x = f.send(None)\n if verbose:\n print(\" yield:\", x)\n except StopIteration as e:\n if verbose:\n print(\" stop:\", e.value)\n break\n else:\n if verbose:\n print(\" ???? still going\")\n except Exception as e:\n print(\" error:\", repr(e))\n\n# Run main().\n\nif __name__ == '__main__':\n main()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/convert-cache.py__usr_bin_env_python3_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/convert-cache.py__usr_bin_env_python3_", "embedding": null, "metadata": {"file_path": "misc/convert-cache.py", "file_name": "convert-cache.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 41, "span_ids": ["main", "impl:2", "docstring"], "tokens": 299}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "#!/usr/bin/env python3\n\"\"\"Script for converting between cache formats.\n\nWe support a filesystem tree based cache and a sqlite based cache.\nSee mypy/metastore.py for details.\n\"\"\"\n\nimport sys\nimport os\nsys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))\n\nimport argparse\nfrom mypy.metastore import FilesystemMetadataStore, SqliteMetadataStore\n\n\ndef main() -> None:\n parser = argparse.ArgumentParser()\n parser.add_argument('--to-sqlite', action='store_true', default=False,\n help='Convert to a sqlite cache (default: convert from)')\n parser.add_argument('--output_dir', action='store', default=None,\n help=\"Output cache location (default: same as input)\")\n parser.add_argument('input_dir',\n help=\"Input directory for the cache\")\n args = parser.parse_args()\n\n input_dir = args.input_dir\n output_dir = args.output_dir or input_dir\n if args.to_sqlite:\n input, output = FilesystemMetadataStore(input_dir), SqliteMetadataStore(output_dir)\n else:\n input, output = SqliteMetadataStore(input_dir), FilesystemMetadataStore(output_dir)\n\n for s in input.list_all():\n if s.endswith('.json'):\n assert output.write(s, input.read(s), input.getmtime(s)), \"Failed to write cache file!\"\n output.commit()\n\n\nif __name__ == '__main__':\n main()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/diff-cache.py__usr_bin_env_python3_merge_deps.for_k_v_in_new_items_.all_setdefault_k_set_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/diff-cache.py__usr_bin_env_python3_merge_deps.for_k_v_in_new_items_.all_setdefault_k_set_", "embedding": null, "metadata": {"file_path": "misc/diff-cache.py", "file_name": "diff-cache.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 30, "span_ids": ["make_cache", "merge_deps", "docstring"], "tokens": 191}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "#!/usr/bin/env python3\n\"\"\"Produce a diff between mypy caches.\n\nWith some infrastructure, this can allow for distributing small cache diffs to users in\nmany cases instead of full cache artifacts.\n\"\"\"\n\nimport argparse\nimport json\nimport os\nimport sys\n\nfrom collections import defaultdict\nfrom typing import Any, Dict, Optional, Set\n\nsys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))\n\nfrom mypy.metastore import FilesystemMetadataStore, MetadataStore, SqliteMetadataStore\n\n\ndef make_cache(input_dir: str, sqlite: bool) -> MetadataStore:\n if sqlite:\n return SqliteMetadataStore(input_dir)\n else:\n return FilesystemMetadataStore(input_dir)\n\n\ndef merge_deps(all: Dict[str, Set[str]], new: Dict[str, Set[str]]) -> None:\n for k, v in new.items():\n all.setdefault(k, set()).update(v)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/diff-cache.py_load_load.return.obj": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/diff-cache.py_load_load.return.obj", "embedding": null, "metadata": {"file_path": "misc/diff-cache.py", "file_name": "diff-cache.py", "file_type": "text/x-python", "category": "implementation", "start_line": 33, "end_line": 57, "span_ids": ["load"], "tokens": 260}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def load(cache: MetadataStore, s: str) -> Any:\n data = cache.read(s)\n obj = json.loads(data)\n if s.endswith(\".meta.json\"):\n # For meta files, zero out the mtimes and sort the\n # dependencies to avoid spurious conflicts\n obj[\"mtime\"] = 0\n obj[\"data_mtime\"] = 0\n if \"dependencies\" in obj:\n all_deps = obj[\"dependencies\"] + obj[\"suppressed\"]\n num_deps = len(obj[\"dependencies\"])\n thing = list(zip(all_deps, obj[\"dep_prios\"], obj[\"dep_lines\"]))\n\n def unzip(x: Any) -> Any:\n return zip(*x) if x else ((), (), ())\n\n obj[\"dependencies\"], prios1, lines1 = unzip(sorted(thing[:num_deps]))\n obj[\"suppressed\"], prios2, lines2 = unzip(sorted(thing[num_deps:]))\n obj[\"dep_prios\"] = prios1 + prios2\n obj[\"dep_lines\"] = lines1 + lines2\n if s.endswith(\".deps.json\"):\n # For deps files, sort the deps to avoid spurious mismatches\n for v in obj.values():\n v.sort()\n return obj", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/diff-cache.py_main_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/diff-cache.py_main_", "embedding": null, "metadata": {"file_path": "misc/diff-cache.py", "file_name": "diff-cache.py", "file_type": "text/x-python", "category": "implementation", "start_line": 60, "end_line": 148, "span_ids": ["impl:2", "main"], "tokens": 712}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def main() -> None:\n parser = argparse.ArgumentParser()\n parser.add_argument(\n \"--verbose\", action=\"store_true\", default=False, help=\"Increase verbosity\"\n )\n parser.add_argument(\n \"--sqlite\", action=\"store_true\", default=False, help=\"Use a sqlite cache\"\n )\n parser.add_argument(\"input_dir1\", help=\"Input directory for the cache\")\n parser.add_argument(\"input_dir2\", help=\"Input directory for the cache\")\n parser.add_argument(\"output\", help=\"Output file\")\n args = parser.parse_args()\n\n cache1 = make_cache(args.input_dir1, args.sqlite)\n cache2 = make_cache(args.input_dir2, args.sqlite)\n\n type_misses: Dict[str, int] = defaultdict(int)\n type_hits: Dict[str, int] = defaultdict(int)\n\n updates: Dict[str, Optional[str]] = {}\n\n deps1: Dict[str, Set[str]] = {}\n deps2: Dict[str, Set[str]] = {}\n\n misses = hits = 0\n cache1_all = list(cache1.list_all())\n for s in cache1_all:\n obj1 = load(cache1, s)\n try:\n obj2 = load(cache2, s)\n except FileNotFoundError:\n obj2 = None\n\n typ = s.split(\".\")[-2]\n if obj1 != obj2:\n misses += 1\n type_misses[typ] += 1\n\n # Collect the dependencies instead of including them directly in the diff\n # so we can produce a much smaller direct diff of them.\n if \".deps.\" not in s:\n if obj2 is not None:\n updates[s] = json.dumps(obj2)\n else:\n updates[s] = None\n elif obj2:\n merge_deps(deps1, obj1)\n merge_deps(deps2, obj2)\n else:\n hits += 1\n type_hits[typ] += 1\n\n cache1_all_set = set(cache1_all)\n for s in cache2.list_all():\n if s not in cache1_all_set:\n updates[s] = cache2.read(s)\n\n # Compute what deps have been added and merge them all into the\n # @root deps file.\n new_deps = {k: deps1.get(k, set()) - deps2.get(k, set()) for k in deps2}\n new_deps = {k: v for k, v in new_deps.items() if v}\n try:\n root_deps = load(cache1, \"@root.deps.json\")\n except FileNotFoundError:\n root_deps = {}\n merge_deps(new_deps, root_deps)\n\n new_deps_json = {k: list(v) for k, v in new_deps.items() if v}\n updates[\"@root.deps.json\"] = json.dumps(new_deps_json)\n\n # Drop updates to deps.meta.json for size reasons. The diff\n # applier will manually fix it up.\n updates.pop(\"./@deps.meta.json\", None)\n updates.pop(\"@deps.meta.json\", None)\n\n ###\n\n print(\"Generated incremental cache:\", hits, \"hits,\", misses, \"misses\")\n if args.verbose:\n print(\"hits\", type_hits)\n print(\"misses\", type_misses)\n\n with open(args.output, \"w\") as f:\n json.dump(updates, f)\n\n\nif __name__ == \"__main__\":\n main()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/dump-ast.py__usr_bin_env_python3_dump.with_open_fname_rb_as.if_not_quiet_.print_tree_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/dump-ast.py__usr_bin_env_python3_dump.with_open_fname_rb_as.if_not_quiet_.print_tree_", "embedding": null, "metadata": {"file_path": "misc/dump-ast.py", "file_name": "dump-ast.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 25, "span_ids": ["dump", "docstring"], "tokens": 138}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "#!/usr/bin/env python3\n\"\"\"\nParse source files and print the abstract syntax trees.\n\"\"\"\n\nfrom typing import Tuple\nimport sys\nimport argparse\n\nfrom mypy.errors import CompileError\nfrom mypy.options import Options\nfrom mypy import defaults\nfrom mypy.parse import parse\n\n\ndef dump(fname: str,\n python_version: Tuple[int, int],\n quiet: bool = False) -> None:\n options = Options()\n options.python_version = python_version\n with open(fname, 'rb') as f:\n s = f.read()\n tree = parse(s, fname, None, errors=None, options=options)\n if not quiet:\n print(tree)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/dump-ast.py_main_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/dump-ast.py_main_", "embedding": null, "metadata": {"file_path": "misc/dump-ast.py", "file_name": "dump-ast.py", "file_type": "text/x-python", "category": "implementation", "start_line": 28, "end_line": 56, "span_ids": ["impl", "main"], "tokens": 214}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def main() -> None:\n # Parse a file and dump the AST (or display errors).\n parser = argparse.ArgumentParser(\n description=\"Parse source files and print the abstract syntax tree (AST).\",\n )\n parser.add_argument('--py2', action='store_true', help='parse FILEs as Python 2')\n parser.add_argument('--quiet', action='store_true', help='do not print AST')\n parser.add_argument('FILE', nargs='*', help='files to parse')\n args = parser.parse_args()\n\n if args.py2:\n pyversion = defaults.PYTHON2_VERSION\n else:\n pyversion = defaults.PYTHON3_VERSION\n\n status = 0\n for fname in args.FILE:\n try:\n dump(fname, pyversion, args.quiet)\n except CompileError as e:\n for msg in e.messages:\n sys.stderr.write('%s\\n' % msg)\n status = 1\n sys.exit(status)\n\n\nif __name__ == '__main__':\n main()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/fix_annotate.py__Fixer_for_lib2to3_that_from_lib2to3_fixer_util_i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/fix_annotate.py__Fixer_for_lib2to3_that_from_lib2to3_fixer_util_i", "embedding": null, "metadata": {"file_path": "misc/fix_annotate.py", "file_name": "fix_annotate.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 38, "span_ids": ["docstring"], "tokens": 259}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Fixer for lib2to3 that inserts mypy annotations into all methods.\n\nThe simplest way to run this is to copy it into lib2to3's \"fixes\"\nsubdirectory and then run \"2to3 -f annotate\" over your files.\n\nThe fixer transforms e.g.\n\n def foo(self, bar, baz=12):\n return bar + baz\n\ninto\n\n def foo(self, bar, baz=12):\n # type: (Any, int) -> Any\n return bar + baz\n\nIt does not do type inference but it recognizes some basic default\nargument values such as numbers and strings (and assumes their type\nimplies the argument type).\n\nIt also uses some basic heuristics to decide whether to ignore the\nfirst argument:\n\n - always if it's named 'self'\n - if there's a @classmethod decorator\n\nFinally, it knows that __init__() is supposed to return None.\n\"\"\"\n\nfrom __future__ import print_function\n\nimport os\nimport re\n\nfrom lib2to3.fixer_base import BaseFix\nfrom lib2to3.patcomp import compile_pattern\nfrom lib2to3.pytree import Leaf, Node\nfrom lib2to3.fixer_util import token, syms, touch_import", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/fix_annotate.py_FixAnnotate_FixAnnotate.transform.if_Any_in_annot_.touch_import_typing_A": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/fix_annotate.py_FixAnnotate_FixAnnotate.transform.if_Any_in_annot_.touch_import_typing_A", "embedding": null, "metadata": {"file_path": "misc/fix_annotate.py", "file_name": "fix_annotate.py", "file_type": "text/x-python", "category": "implementation", "start_line": 41, "end_line": 100, "span_ids": ["FixAnnotate", "FixAnnotate.transform"], "tokens": 553}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FixAnnotate(BaseFix):\n\n # This fixer is compatible with the bottom matcher.\n BM_compatible = True\n\n # This fixer shouldn't run by default.\n explicit = True\n\n # The pattern to match.\n PATTERN = \"\"\"\n funcdef< 'def' name=any parameters< '(' [args=any] ')' > ':' suite=any+ >\n \"\"\"\n\n counter = None if not os.getenv('MAXFIXES') else int(os.getenv('MAXFIXES'))\n\n def transform(self, node, results):\n if FixAnnotate.counter is not None:\n if FixAnnotate.counter <= 0:\n return\n suite = results['suite']\n children = suite[0].children\n\n # NOTE: I've reverse-engineered the structure of the parse tree.\n # It's always a list of nodes, the first of which contains the\n # entire suite. Its children seem to be:\n #\n # [0] NEWLINE\n # [1] INDENT\n # [2...n-2] statements (the first may be a docstring)\n # [n-1] DEDENT\n #\n # Comments before the suite are part of the INDENT's prefix.\n #\n # \"Compact\" functions (e.g. \"def foo(x, y): return max(x, y)\")\n # have a different structure that isn't matched by PATTERN.\n\n ## print('-'*60)\n ## print(node)\n ## for i, ch in enumerate(children):\n ## print(i, repr(ch.prefix), repr(ch))\n\n # Check if there's already an annotation.\n for ch in children:\n if ch.prefix.lstrip().startswith('# type:'):\n return # There's already a # type: comment here; don't change anything.\n\n # Compute the annotation\n annot = self.make_annotation(node, results)\n\n # Insert '# type: {annot}' comment.\n # For reference, see lib2to3/fixes/fix_tuple_params.py in stdlib.\n if len(children) >= 2 and children[1].type == token.INDENT:\n children[1].prefix = '%s# type: %s\\n%s' % (children[1].value, annot, children[1].prefix)\n children[1].changed()\n if FixAnnotate.counter is not None:\n FixAnnotate.counter -= 1\n\n # Also add 'from typing import Any' at the top.\n if 'Any' in annot:\n touch_import('typing', 'Any', node)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/fix_annotate.py_FixAnnotate.make_annotation_FixAnnotate.make_annotation.return._join_argtypes_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/fix_annotate.py_FixAnnotate.make_annotation_FixAnnotate.make_annotation.return._join_argtypes_", "embedding": null, "metadata": {"file_path": "misc/fix_annotate.py", "file_name": "fix_annotate.py", "file_type": "text/x-python", "category": "implementation", "start_line": 102, "end_line": 163, "span_ids": ["FixAnnotate.make_annotation"], "tokens": 520}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FixAnnotate(BaseFix):\n\n def make_annotation(self, node, results):\n name = results['name']\n assert isinstance(name, Leaf), repr(name)\n assert name.type == token.NAME, repr(name)\n decorators = self.get_decorators(node)\n is_method = self.is_method(node)\n if name.value == '__init__' or not self.has_return_exprs(node):\n restype = 'None'\n else:\n restype = 'Any'\n args = results.get('args')\n argtypes = []\n if isinstance(args, Node):\n children = args.children\n elif isinstance(args, Leaf):\n children = [args]\n else:\n children = []\n # Interpret children according to the following grammar:\n # (('*'|'**')? NAME ['=' expr] ','?)*\n stars = inferred_type = ''\n in_default = False\n at_start = True\n for child in children:\n if isinstance(child, Leaf):\n if child.value in ('*', '**'):\n stars += child.value\n elif child.type == token.NAME and not in_default:\n if not is_method or not at_start or 'staticmethod' in decorators:\n inferred_type = 'Any'\n else:\n # Always skip the first argument if it's named 'self'.\n # Always skip the first argument of a class method.\n if child.value == 'self' or 'classmethod' in decorators:\n pass\n else:\n inferred_type = 'Any'\n elif child.value == '=':\n in_default = True\n elif in_default and child.value != ',':\n if child.type == token.NUMBER:\n if re.match(r'\\d+[lL]?$', child.value):\n inferred_type = 'int'\n else:\n inferred_type = 'float' # TODO: complex?\n elif child.type == token.STRING:\n if child.value.startswith(('u', 'U')):\n inferred_type = 'unicode'\n else:\n inferred_type = 'str'\n elif child.type == token.NAME and child.value in ('True', 'False'):\n inferred_type = 'bool'\n elif child.value == ',':\n if inferred_type:\n argtypes.append(stars + inferred_type)\n # Reset\n stars = inferred_type = ''\n in_default = False\n at_start = False\n if inferred_type:\n argtypes.append(stars + inferred_type)\n return '(' + ', '.join(argtypes) + ') -> ' + restype", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/fix_annotate.py_FixAnnotate._The_parse_tree_has_a_di_FixAnnotate.get_decorators.return.decs": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/fix_annotate.py_FixAnnotate._The_parse_tree_has_a_di_FixAnnotate.get_decorators.return.decs", "embedding": null, "metadata": {"file_path": "misc/fix_annotate.py", "file_name": "fix_annotate.py", "file_type": "text/x-python", "category": "implementation", "start_line": 165, "end_line": 190, "span_ids": ["FixAnnotate.get_decorators", "FixAnnotate.make_annotation", "FixAnnotate:11"], "tokens": 227}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FixAnnotate(BaseFix):\n\n # The parse tree has a different shape when there is a single\n # decorator vs. when there are multiple decorators.\n DECORATED = \"decorated< (d=decorator | decorators< dd=decorator+ >) funcdef >\"\n decorated = compile_pattern(DECORATED)\n\n def get_decorators(self, node):\n \"\"\"Return a list of decorators found on a function definition.\n\n This is a list of strings; only simple decorators\n (e.g. @staticmethod) are returned.\n\n If the function is undecorated or only non-simple decorators\n are found, return [].\n \"\"\"\n if node.parent is None:\n return []\n results = {}\n if not self.decorated.match(node.parent, results):\n return []\n decorators = results.get('dd') or [results['d']]\n decs = []\n for d in decorators:\n for child in d.children:\n if isinstance(child, Leaf) and child.type == token.NAME:\n decs.append(child.value)\n return decs", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/fix_annotate.py_FixAnnotate.is_method_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/fix_annotate.py_FixAnnotate.is_method_", "embedding": null, "metadata": {"file_path": "misc/fix_annotate.py", "file_name": "fix_annotate.py", "file_type": "text/x-python", "category": "implementation", "start_line": 192, "end_line": 220, "span_ids": ["FixAnnotate.is_method", "FixAnnotate.has_return_exprs", "FixAnnotate:15"], "tokens": 225}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FixAnnotate(BaseFix):\n\n def is_method(self, node):\n \"\"\"Return whether the node occurs (directly) inside a class.\"\"\"\n node = node.parent\n while node is not None:\n if node.type == syms.classdef:\n return True\n if node.type == syms.funcdef:\n return False\n node = node.parent\n return False\n\n RETURN_EXPR = \"return_stmt< 'return' any >\"\n return_expr = compile_pattern(RETURN_EXPR)\n\n def has_return_exprs(self, node):\n \"\"\"Traverse the tree below node looking for 'return expr'.\n\n Return True if at least 'return expr' is found, False if not.\n (If both 'return' and 'return expr' are found, return True.)\n \"\"\"\n results = {}\n if self.return_expr.match(node, results):\n return True\n for child in node.children:\n if child.type not in (syms.funcdef, syms.classdef):\n if self.has_return_exprs(child):\n return True\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/incremental_checker.py__usr_bin_env_python3_delete_folder.if_os_path_exists_folder_.shutil_rmtree_folder_path": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/incremental_checker.py__usr_bin_env_python3_delete_folder.if_os_path_exists_folder_.shutil_rmtree_folder_path", "embedding": null, "metadata": {"file_path": "misc/incremental_checker.py", "file_name": "incremental_checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 65, "span_ids": ["print_offset", "delete_folder", "docstring"], "tokens": 430}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "#!/usr/bin/env python3\n\"\"\"\nThis file compares the output and runtime of running normal vs incremental mode\non the history of any arbitrary git repo as a way of performing a sanity check\nto make sure incremental mode is working correctly and efficiently.\n\nIt does so by first running mypy without incremental mode on the specified range\nof commits to find the expected result, then rewinds back to the first commit and\nre-runs mypy on the commits with incremental mode enabled to make sure it returns\nthe same results.\n\nThis script will download and test the official mypy repo by default. Running:\n\n python3 misc/incremental_checker.py last 30\n\nis equivalent to running\n\n python3 misc/incremental_checker.py last 30 \\\\\n --repo_url https://github.com/python/mypy.git \\\\\n --file-path mypy\n\nYou can chose to run this script against a specific commit id or against the\nlast n commits.\n\nTo run this script against the last 30 commits:\n\n python3 misc/incremental_checker.py last 30\n\nTo run this script starting from the commit id 2a432b:\n\n python3 misc/incremental_checker.py commit 2a432b\n\"\"\"\n\nfrom typing import Any, Dict, List, Optional, Tuple\n\nfrom argparse import ArgumentParser, RawDescriptionHelpFormatter, Namespace\nimport base64\nimport json\nimport os\nimport random\nimport re\nimport shutil\nimport subprocess\nimport sys\nimport textwrap\nimport time\n\n\nCACHE_PATH = \".incremental_checker_cache.json\"\nMYPY_REPO_URL = \"https://github.com/python/mypy.git\"\nMYPY_TARGET_FILE = \"mypy\"\nDAEMON_CMD = [\"python3\", \"-m\", \"mypy.dmypy\"]\n\nJsonDict = Dict[str, Any]\n\n\ndef print_offset(text: str, indent_length: int = 4) -> None:\n print()\n print(textwrap.indent(text, ' ' * indent_length))\n print()\n\n\ndef delete_folder(folder_path: str) -> None:\n if os.path.exists(folder_path):\n shutil.rmtree(folder_path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/incremental_checker.py_execute_execute.return.stdout_stderr_proc_retu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/incremental_checker.py_execute_execute.return.stdout_stderr_proc_retu", "embedding": null, "metadata": {"file_path": "misc/incremental_checker.py", "file_name": "incremental_checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 68, "end_line": 85, "span_ids": ["execute"], "tokens": 168}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def execute(command: List[str], fail_on_error: bool = True) -> Tuple[str, str, int]:\n proc = subprocess.Popen(\n ' '.join(command),\n stderr=subprocess.PIPE,\n stdout=subprocess.PIPE,\n shell=True)\n stdout_bytes, stderr_bytes = proc.communicate() # type: Tuple[bytes, bytes]\n stdout, stderr = stdout_bytes.decode('utf-8'), stderr_bytes.decode('utf-8')\n if fail_on_error and proc.returncode != 0:\n print('EXECUTED COMMAND:', repr(command))\n print('RETURN CODE:', proc.returncode)\n print()\n print('STDOUT:')\n print_offset(stdout)\n print('STDERR:')\n print_offset(stderr)\n raise RuntimeError('Unexpected error from external tool.')\n return stdout, stderr, proc.returncode", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/incremental_checker.py_ensure_environment_is_ready_get_nth_commit.return.get_commits_repo_folder_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/incremental_checker.py_ensure_environment_is_ready_get_nth_commit.return.get_commits_repo_folder_p", "embedding": null, "metadata": {"file_path": "misc/incremental_checker.py", "file_name": "incremental_checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 88, "end_line": 119, "span_ids": ["ensure_environment_is_ready", "get_commits", "initialize_repo", "get_commits_starting_at", "get_nth_commit"], "tokens": 358}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def ensure_environment_is_ready(mypy_path: str, temp_repo_path: str, mypy_cache_path: str) -> None:\n os.chdir(mypy_path)\n delete_folder(temp_repo_path)\n delete_folder(mypy_cache_path)\n\n\ndef initialize_repo(repo_url: str, temp_repo_path: str, branch: str) -> None:\n print(\"Cloning repo {0} to {1}\".format(repo_url, temp_repo_path))\n execute([\"git\", \"clone\", repo_url, temp_repo_path])\n if branch is not None:\n print(\"Checking out branch {}\".format(branch))\n execute([\"git\", \"-C\", temp_repo_path, \"checkout\", branch])\n\n\ndef get_commits(repo_folder_path: str, commit_range: str) -> List[Tuple[str, str]]:\n raw_data, _stderr, _errcode = execute([\n \"git\", \"-C\", repo_folder_path, \"log\", \"--reverse\", \"--oneline\", commit_range])\n output = []\n for line in raw_data.strip().split('\\n'):\n commit_id, _, message = line.partition(' ')\n output.append((commit_id, message))\n return output\n\n\ndef get_commits_starting_at(repo_folder_path: str, start_commit: str) -> List[Tuple[str, str]]:\n print(\"Fetching commits starting at {0}\".format(start_commit))\n return get_commits(repo_folder_path, '{0}^..HEAD'.format(start_commit))\n\n\ndef get_nth_commit(repo_folder_path: str, n: int) -> Tuple[str, str]:\n print(\"Fetching last {} commits (or all, if there are fewer commits than n)\".format(n))\n return get_commits(repo_folder_path, '-{}'.format(n))[0]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/incremental_checker.py_run_mypy_run_mypy.return.runtime_output_stats": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/incremental_checker.py_run_mypy_run_mypy.return.runtime_output_stats", "embedding": null, "metadata": {"file_path": "misc/incremental_checker.py", "file_name": "incremental_checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 122, "end_line": 160, "span_ids": ["run_mypy"], "tokens": 353}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def run_mypy(target_file_path: Optional[str],\n mypy_cache_path: str,\n mypy_script: Optional[str],\n *,\n incremental: bool = False,\n daemon: bool = False,\n verbose: bool = False) -> Tuple[float, str, Dict[str, Any]]:\n \"\"\"Runs mypy against `target_file_path` and returns what mypy prints to stdout as a string.\n\n If `incremental` is set to True, this function will use store and retrieve all caching data\n inside `mypy_cache_path`. If `verbose` is set to True, this function will pass the \"-v -v\"\n flags to mypy to make it output debugging information.\n\n If `daemon` is True, we use daemon mode; the daemon must be started and stopped by the caller.\n \"\"\"\n stats = {} # type: Dict[str, Any]\n if daemon:\n command = DAEMON_CMD + [\"check\", \"-v\"]\n else:\n if mypy_script is None:\n command = [\"python3\", \"-m\", \"mypy\"]\n else:\n command = [mypy_script]\n command.extend([\"--cache-dir\", mypy_cache_path])\n if incremental:\n command.append(\"--incremental\")\n if verbose:\n command.extend([\"-v\", \"-v\"])\n if target_file_path is not None:\n command.append(target_file_path)\n start = time.time()\n output, stderr, _ = execute(command, False)\n if stderr != \"\":\n output = stderr\n else:\n if daemon:\n output, stats = filter_daemon_stats(output)\n runtime = time.time() - start\n return runtime, output, stats", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/incremental_checker.py_filter_daemon_stats_filter_daemon_stats.return._n_join_output_lines_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/incremental_checker.py_filter_daemon_stats_filter_daemon_stats.return._n_join_output_lines_", "embedding": null, "metadata": {"file_path": "misc/incremental_checker.py", "file_name": "incremental_checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 163, "end_line": 176, "span_ids": ["filter_daemon_stats"], "tokens": 118}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def filter_daemon_stats(output: str) -> Tuple[str, Dict[str, Any]]:\n stats = {} # type: Dict[str, Any]\n lines = output.splitlines()\n output_lines = []\n for line in lines:\n m = re.match(r'(\\w+)\\s+:\\s+(.*)', line)\n if m:\n key, value = m.groups()\n stats[key] = value\n else:\n output_lines.append(line)\n if output_lines:\n output_lines.append('\\n')\n return '\\n'.join(output_lines), stats", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/incremental_checker.py_start_daemon_save_cache.with_open_incremental_cac.json_dump_cache_stream_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/incremental_checker.py_start_daemon_save_cache.with_open_incremental_cac.json_dump_cache_stream_", "embedding": null, "metadata": {"file_path": "misc/incremental_checker.py", "file_name": "incremental_checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 179, "end_line": 198, "span_ids": ["start_daemon", "stop_daemon", "load_cache", "save_cache"], "tokens": 172}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def start_daemon(mypy_cache_path: str) -> None:\n cmd = DAEMON_CMD + [\"restart\", \"--log-file\", \"./@incr-chk-logs\", \"--\", \"--cache-dir\", mypy_cache_path]\n execute(cmd)\n\n\ndef stop_daemon() -> None:\n execute(DAEMON_CMD + [\"stop\"])\n\n\ndef load_cache(incremental_cache_path: str = CACHE_PATH) -> JsonDict:\n if os.path.exists(incremental_cache_path):\n with open(incremental_cache_path, 'r') as stream:\n return json.load(stream)\n else:\n return {}\n\n\ndef save_cache(cache: JsonDict, incremental_cache_path: str = CACHE_PATH) -> None:\n with open(incremental_cache_path, 'w') as stream:\n json.dump(cache, stream, indent=2)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/incremental_checker.py_set_expected_set_expected.print_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/incremental_checker.py_set_expected_set_expected.print_", "embedding": null, "metadata": {"file_path": "misc/incremental_checker.py", "file_name": "incremental_checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 201, "end_line": 228, "span_ids": ["set_expected"], "tokens": 310}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def set_expected(commits: List[Tuple[str, str]],\n cache: JsonDict,\n temp_repo_path: str,\n target_file_path: Optional[str],\n mypy_cache_path: str,\n mypy_script: Optional[str]) -> None:\n \"\"\"Populates the given `cache` with the expected results for all of the given `commits`.\n\n This function runs mypy on the `target_file_path` inside the `temp_repo_path`, and stores\n the result in the `cache`.\n\n If `cache` already contains results for a particular commit, this function will\n skip evaluating that commit and move on to the next.\"\"\"\n for commit_id, message in commits:\n if commit_id in cache:\n print('Skipping commit (already cached): {0}: \"{1}\"'.format(commit_id, message))\n else:\n print('Caching expected output for commit {0}: \"{1}\"'.format(commit_id, message))\n execute([\"git\", \"-C\", temp_repo_path, \"checkout\", commit_id])\n runtime, output, stats = run_mypy(target_file_path, mypy_cache_path, mypy_script,\n incremental=False)\n cache[commit_id] = {'runtime': runtime, 'output': output}\n if output == \"\":\n print(\" Clean output ({:.3f} sec)\".format(runtime))\n else:\n print(\" Output ({:.3f} sec)\".format(runtime))\n print_offset(output, 8)\n print()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/incremental_checker.py_test_incremental_test_incremental.if_overall_stats_.print_Overall_stats_o": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/incremental_checker.py_test_incremental_test_incremental.if_overall_stats_.print_Overall_stats_o", "embedding": null, "metadata": {"file_path": "misc/incremental_checker.py", "file_name": "incremental_checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 231, "end_line": 271, "span_ids": ["test_incremental"], "tokens": 453}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_incremental(commits: List[Tuple[str, str]],\n cache: JsonDict,\n temp_repo_path: str,\n target_file_path: Optional[str],\n mypy_cache_path: str,\n *,\n mypy_script: Optional[str] = None,\n daemon: bool = False,\n exit_on_error: bool = False) -> None:\n \"\"\"Runs incremental mode on all `commits` to verify the output matches the expected output.\n\n This function runs mypy on the `target_file_path` inside the `temp_repo_path`. The\n expected output must be stored inside of the given `cache`.\n \"\"\"\n print(\"Note: first commit is evaluated twice to warm up cache\")\n commits = [commits[0]] + commits\n overall_stats = {} # type: Dict[str, float]\n for commit_id, message in commits:\n print('Now testing commit {0}: \"{1}\"'.format(commit_id, message))\n execute([\"git\", \"-C\", temp_repo_path, \"checkout\", commit_id])\n runtime, output, stats = run_mypy(target_file_path, mypy_cache_path, mypy_script,\n incremental=True, daemon=daemon)\n relevant_stats = combine_stats(overall_stats, stats)\n expected_runtime = cache[commit_id]['runtime'] # type: float\n expected_output = cache[commit_id]['output'] # type: str\n if output != expected_output:\n print(\" Output does not match expected result!\")\n print(\" Expected output ({:.3f} sec):\".format(expected_runtime))\n print_offset(expected_output, 8)\n print(\" Actual output: ({:.3f} sec):\".format(runtime))\n print_offset(output, 8)\n if exit_on_error:\n break\n else:\n print(\" Output matches expected result!\")\n print(\" Incremental: {:.3f} sec\".format(runtime))\n print(\" Original: {:.3f} sec\".format(expected_runtime))\n if relevant_stats:\n print(\" Stats: {}\".format(relevant_stats))\n if overall_stats:\n print(\"Overall stats:\", overall_stats)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/incremental_checker.py_combine_stats_cleanup.delete_folder_mypy_cache_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/incremental_checker.py_combine_stats_cleanup.delete_folder_mypy_cache_", "embedding": null, "metadata": {"file_path": "misc/incremental_checker.py", "file_name": "incremental_checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 274, "end_line": 289, "span_ids": ["cleanup", "combine_stats"], "tokens": 155}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def combine_stats(overall_stats: Dict[str, float],\n new_stats: Dict[str, Any]) -> Dict[str, float]:\n INTERESTING_KEYS = ['build_time', 'gc_time']\n # For now, we only support float keys\n relevant_stats = {} # type: Dict[str, float]\n for key in INTERESTING_KEYS:\n if key in new_stats:\n value = float(new_stats[key])\n relevant_stats[key] = value\n overall_stats[key] = overall_stats.get(key, 0.0) + value\n return relevant_stats\n\n\ndef cleanup(temp_repo_path: str, mypy_cache_path: str) -> None:\n delete_folder(temp_repo_path)\n delete_folder(mypy_cache_path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/incremental_checker.py_test_repo_test_repo.None_5.stop_daemon_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/incremental_checker.py_test_repo_test_repo.None_5.stop_daemon_", "embedding": null, "metadata": {"file_path": "misc/incremental_checker.py", "file_name": "incremental_checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 292, "end_line": 356, "span_ids": ["test_repo"], "tokens": 718}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_repo(target_repo_url: str, temp_repo_path: str,\n target_file_path: Optional[str],\n mypy_path: str, incremental_cache_path: str, mypy_cache_path: str,\n range_type: str, range_start: str, branch: str,\n params: Namespace) -> None:\n \"\"\"Tests incremental mode against the repo specified in `target_repo_url`.\n\n This algorithm runs in five main stages:\n\n 1. Clones `target_repo_url` into the `temp_repo_path` folder locally,\n checking out the specified `branch` if applicable.\n 2. Examines the repo's history to get the list of all commits to\n to test incremental mode on.\n 3. Runs mypy WITHOUT incremental mode against the `target_file_path` (which is\n assumed to be located inside the `temp_repo_path`), testing each commit\n discovered in stage two.\n - If the results of running mypy WITHOUT incremental mode on a\n particular commit are already cached inside the `incremental_cache_path`,\n skip that commit to save time.\n - Cache the results after finishing.\n 4. Rewind back to the first commit, and run mypy WITH incremental mode\n against the `target_file_path` commit-by-commit, and compare to the expected\n results found in stage 3.\n 5. Delete all unnecessary temp files.\n \"\"\"\n # Stage 1: Clone repo and get ready to being testing\n ensure_environment_is_ready(mypy_path, temp_repo_path, mypy_cache_path)\n initialize_repo(target_repo_url, temp_repo_path, branch)\n\n # Stage 2: Get all commits we want to test\n if range_type == \"last\":\n start_commit = get_nth_commit(temp_repo_path, int(range_start))[0]\n elif range_type == \"commit\":\n start_commit = range_start\n else:\n raise RuntimeError(\"Invalid option: {}\".format(range_type))\n commits = get_commits_starting_at(temp_repo_path, start_commit)\n if params.limit:\n commits = commits[:params.limit]\n if params.sample:\n seed = params.seed or base64.urlsafe_b64encode(os.urandom(15)).decode('ascii')\n random.seed(seed)\n commits = random.sample(commits, params.sample)\n print(\"Sampled down to %d commits using random seed %s\" % (len(commits), seed))\n\n # Stage 3: Find and cache expected results for each commit (without incremental mode)\n cache = load_cache(incremental_cache_path)\n set_expected(commits, cache, temp_repo_path, target_file_path, mypy_cache_path,\n mypy_script=params.mypy_script)\n save_cache(cache, incremental_cache_path)\n\n # Stage 4: Rewind and re-run mypy (with incremental mode enabled)\n if params.daemon:\n print('Starting daemon')\n start_daemon(mypy_cache_path)\n test_incremental(commits, cache, temp_repo_path, target_file_path, mypy_cache_path,\n mypy_script=params.mypy_script, daemon=params.daemon,\n exit_on_error=params.exit_on_error)\n\n # Stage 5: Remove temp files, stop daemon\n if not params.keep_temporary_files:\n cleanup(temp_repo_path, mypy_cache_path)\n if params.daemon:\n print('Stopping daemon')\n stop_daemon()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/incremental_checker.py_main_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/incremental_checker.py_main_", "embedding": null, "metadata": {"file_path": "misc/incremental_checker.py", "file_name": "incremental_checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 359, "end_line": 436, "span_ids": ["impl:11", "main"], "tokens": 816}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def main() -> None:\n help_factory = (lambda prog: RawDescriptionHelpFormatter(prog=prog, max_help_position=32)) # type: Any\n parser = ArgumentParser(\n prog='incremental_checker',\n description=__doc__,\n formatter_class=help_factory)\n\n parser.add_argument(\"range_type\", metavar=\"START_TYPE\", choices=[\"last\", \"commit\"],\n help=\"must be one of 'last' or 'commit'\")\n parser.add_argument(\"range_start\", metavar=\"COMMIT_ID_OR_NUMBER\",\n help=\"the commit id to start from, or the number of \"\n \"commits to move back (see above)\")\n parser.add_argument(\"-r\", \"--repo_url\", default=MYPY_REPO_URL, metavar=\"URL\",\n help=\"the repo to clone and run tests on\")\n parser.add_argument(\"-f\", \"--file-path\", default=MYPY_TARGET_FILE, metavar=\"FILE\",\n help=\"the name of the file or directory to typecheck\")\n parser.add_argument(\"-x\", \"--exit-on-error\", action='store_true',\n help=\"Exits as soon as an error occurs\")\n parser.add_argument(\"--keep-temporary-files\", action='store_true',\n help=\"Keep temporary files on exit\")\n parser.add_argument(\"--cache-path\", default=CACHE_PATH, metavar=\"DIR\",\n help=\"sets a custom location to store cache data\")\n parser.add_argument(\"--branch\", default=None, metavar=\"NAME\",\n help=\"check out and test a custom branch\"\n \"uses the default if not specified\")\n parser.add_argument(\"--sample\", type=int, help=\"use a random sample of size SAMPLE\")\n parser.add_argument(\"--seed\", type=str, help=\"random seed\")\n parser.add_argument(\"--limit\", type=int,\n help=\"maximum number of commits to use (default until end)\")\n parser.add_argument(\"--mypy-script\", type=str, help=\"alternate mypy script to run\")\n parser.add_argument(\"--daemon\", action='store_true',\n help=\"use mypy daemon instead of incremental (highly experimental)\")\n\n if len(sys.argv[1:]) == 0:\n parser.print_help()\n parser.exit()\n\n params = parser.parse_args(sys.argv[1:])\n\n # Make all paths absolute so we avoid having to worry about being in the right folder\n\n # The path to this specific script (incremental_checker.py).\n script_path = os.path.abspath(sys.argv[0])\n\n # The path to the mypy repo.\n mypy_path = os.path.abspath(os.path.dirname(os.path.dirname(script_path)))\n\n # The folder the cloned repo will reside in.\n temp_repo_path = os.path.abspath(os.path.join(mypy_path, \"tmp_repo\"))\n\n # The particular file or package to typecheck inside the repo.\n if params.file_path:\n target_file_path = os.path.abspath(os.path.join(temp_repo_path, params.file_path))\n else:\n # Allow `-f ''` to clear target_file_path.\n target_file_path = None\n\n # The path to where the incremental checker cache data is stored.\n incremental_cache_path = os.path.abspath(params.cache_path)\n\n # The path to store the mypy incremental mode cache data\n mypy_cache_path = os.path.abspath(os.path.join(mypy_path, \"misc\", \".mypy_cache\"))\n\n print(\"Assuming mypy is located at {0}\".format(mypy_path))\n print(\"Temp repo will be cloned at {0}\".format(temp_repo_path))\n print(\"Testing file/dir located at {0}\".format(target_file_path))\n print(\"Using cache data located at {0}\".format(incremental_cache_path))\n print()\n\n test_repo(params.repo_url, temp_repo_path, target_file_path,\n mypy_path, incremental_cache_path, mypy_cache_path,\n params.range_type, params.range_start, params.branch,\n params)\n\n\nif __name__ == '__main__':\n main()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/perf_checker.py__usr_bin_env_python3_delete_folder.if_os_path_exists_folder_.shutil_rmtree_folder_path": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/perf_checker.py__usr_bin_env_python3_delete_folder.if_os_path_exists_folder_.shutil_rmtree_folder_path", "embedding": null, "metadata": {"file_path": "misc/perf_checker.py", "file_name": "perf_checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 27, "span_ids": ["delete_folder", "docstring", "Command.__init__", "print_offset", "Command"], "tokens": 136}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "#!/usr/bin/env python3\n\nfrom typing import Callable, List, Tuple\n\nimport os\nimport shutil\nimport statistics\nimport subprocess\nimport textwrap\nimport time\n\n\nclass Command:\n def __init__(self, setup: Callable[[], None], command: Callable[[], None]) -> None:\n self.setup = setup\n self.command = command\n\n\ndef print_offset(text: str, indent_length: int = 4) -> None:\n print()\n print(textwrap.indent(text, ' ' * indent_length))\n print()\n\n\ndef delete_folder(folder_path: str) -> None:\n if os.path.exists(folder_path):\n shutil.rmtree(folder_path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/perf_checker.py_execute_execute.if_proc_returncode_0_.raise_RuntimeError_Unexp": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/perf_checker.py_execute_execute.if_proc_returncode_0_.raise_RuntimeError_Unexp", "embedding": null, "metadata": {"file_path": "misc/perf_checker.py", "file_name": "perf_checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 30, "end_line": 46, "span_ids": ["execute"], "tokens": 142}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def execute(command: List[str]) -> None:\n proc = subprocess.Popen(\n ' '.join(command),\n stderr=subprocess.PIPE,\n stdout=subprocess.PIPE,\n shell=True)\n stdout_bytes, stderr_bytes = proc.communicate() # type: Tuple[bytes, bytes]\n stdout, stderr = stdout_bytes.decode('utf-8'), stderr_bytes.decode('utf-8')\n if proc.returncode != 0:\n print('EXECUTED COMMAND:', repr(command))\n print('RETURN CODE:', proc.returncode)\n print()\n print('STDOUT:')\n print_offset(stdout)\n print('STDERR:')\n print_offset(stderr)\n raise RuntimeError('Unexpected error from external tool.')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/perf_checker.py_trial_report.print_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/perf_checker.py_trial_report.print_", "embedding": null, "metadata": {"file_path": "misc/perf_checker.py", "file_name": "perf_checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 49, "end_line": 65, "span_ids": ["report", "trial"], "tokens": 122}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def trial(num_trials: int, command: Command) -> List[float]:\n trials = []\n for i in range(num_trials):\n command.setup()\n start = time.time()\n command.command()\n delta = time.time() - start\n trials.append(delta)\n return trials\n\n\ndef report(name: str, times: List[float]) -> None:\n print(\"{}:\".format(name))\n print(\" Times: {}\".format(times))\n print(\" Mean: {}\".format(statistics.mean(times)))\n print(\" Stdev: {}\".format(statistics.stdev(times)))\n print()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/perf_checker.py_main_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/perf_checker.py_main_", "embedding": null, "metadata": {"file_path": "misc/perf_checker.py", "file_name": "perf_checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 68, "end_line": 94, "span_ids": ["impl", "main"], "tokens": 203}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def main() -> None:\n trials = 3\n\n print(\"Testing baseline\")\n baseline = trial(trials, Command(\n lambda: None,\n lambda: execute([\"python3\", \"-m\", \"mypy\", \"mypy\"])))\n report(\"Baseline\", baseline)\n\n print(\"Testing cold cache\")\n cold_cache = trial(trials, Command(\n lambda: delete_folder(\".mypy_cache\"),\n lambda: execute([\"python3\", \"-m\", \"mypy\", \"-i\", \"mypy\"])))\n report(\"Cold cache\", cold_cache)\n\n print(\"Testing warm cache\")\n execute([\"python3\", \"-m\", \"mypy\", \"-i\", \"mypy\"])\n warm_cache = trial(trials, Command(\n lambda: None,\n lambda: execute([\"python3\", \"-m\", \"mypy\", \"-i\", \"mypy\"])))\n report(\"Warm cache\", warm_cache)\n\n\nif __name__ == '__main__':\n main()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/proper_plugin.py_from_mypy_plugin_import_P_ProperTypePlugin.get_function_hook.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/proper_plugin.py_from_mypy_plugin_import_P_ProperTypePlugin.get_function_hook.return.None", "embedding": null, "metadata": {"file_path": "misc/proper_plugin.py", "file_name": "proper_plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 33, "span_ids": ["imports", "ProperTypePlugin.get_function_hook", "ProperTypePlugin"], "tokens": 257}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from mypy.plugin import Plugin, FunctionContext\nfrom mypy.types import (\n Type, Instance, CallableType, UnionType, get_proper_type, ProperType,\n get_proper_types, TupleType, NoneTyp, AnyType\n)\nfrom mypy.nodes import TypeInfo\nfrom mypy.subtypes import is_proper_subtype\n\nfrom typing_extensions import Type as typing_Type\nfrom typing import Optional, Callable\n\n\nclass ProperTypePlugin(Plugin):\n \"\"\"\n A plugin to ensure that every type is expanded before doing any special-casing.\n\n This solves the problem that we have hundreds of call sites like:\n\n if isinstance(typ, UnionType):\n ... # special-case union\n\n But after introducing a new type TypeAliasType (and removing immediate expansion)\n all these became dangerous because typ may be e.g. an alias to union.\n \"\"\"\n def get_function_hook(self, fullname: str\n ) -> Optional[Callable[[FunctionContext], Type]]:\n if fullname == 'builtins.isinstance':\n return isinstance_proper_hook\n if fullname == 'mypy.types.get_proper_type':\n return proper_type_hook\n if fullname == 'mypy.types.get_proper_types':\n return proper_types_hook\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/proper_plugin.py_isinstance_proper_hook_isinstance_proper_hook.return.ctx_default_return_type": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/proper_plugin.py_isinstance_proper_hook_isinstance_proper_hook.return.ctx_default_return_type", "embedding": null, "metadata": {"file_path": "misc/proper_plugin.py", "file_name": "proper_plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 36, "end_line": 47, "span_ids": ["isinstance_proper_hook"], "tokens": 155}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def isinstance_proper_hook(ctx: FunctionContext) -> Type:\n right = get_proper_type(ctx.arg_types[1][0])\n for arg in ctx.arg_types[0]:\n if (is_improper_type(arg) or\n isinstance(get_proper_type(arg), AnyType) and is_dangerous_target(right)):\n if is_special_target(right):\n return ctx.default_return_type\n ctx.api.fail('Never apply isinstance() to unexpanded types;'\n ' use mypy.types.get_proper_type() first', ctx.context)\n ctx.api.note('If you pass on the original type' # type: ignore[attr-defined]\n ' after the check, always use its unexpanded version', ctx.context)\n return ctx.default_return_type", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/proper_plugin.py_is_special_target_is_special_target.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/proper_plugin.py_is_special_target_is_special_target.return.False", "embedding": null, "metadata": {"file_path": "misc/proper_plugin.py", "file_name": "proper_plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 50, "end_line": 79, "span_ids": ["is_special_target"], "tokens": 290}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_special_target(right: ProperType) -> bool:\n \"\"\"Whitelist some special cases for use in isinstance() with improper types.\"\"\"\n if isinstance(right, CallableType) and right.is_type_obj():\n if right.type_object().fullname == 'builtins.tuple':\n # Used with Union[Type, Tuple[Type, ...]].\n return True\n if right.type_object().fullname in (\n 'mypy.types.Type',\n 'mypy.types.ProperType',\n 'mypy.types.TypeAliasType'\n ):\n # Special case: things like assert isinstance(typ, ProperType) are always OK.\n return True\n if right.type_object().fullname in (\n 'mypy.types.UnboundType',\n 'mypy.types.TypeVarType',\n 'mypy.types.RawExpressionType',\n 'mypy.types.EllipsisType',\n 'mypy.types.StarType',\n 'mypy.types.TypeList',\n 'mypy.types.CallableArgument',\n 'mypy.types.PartialType',\n 'mypy.types.ErasedType'\n ):\n # Special case: these are not valid targets for a type alias and thus safe.\n # TODO: introduce a SyntheticType base to simplify this?\n return True\n elif isinstance(right, TupleType):\n return all(is_special_target(t) for t in get_proper_types(right.items))\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/proper_plugin.py_is_improper_type_is_dangerous_target.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/proper_plugin.py_is_improper_type_is_dangerous_target.return.False", "embedding": null, "metadata": {"file_path": "misc/proper_plugin.py", "file_name": "proper_plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 82, "end_line": 99, "span_ids": ["is_dangerous_target", "is_improper_type"], "tokens": 192}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_improper_type(typ: Type) -> bool:\n \"\"\"Is this a type that is not a subtype of ProperType?\"\"\"\n typ = get_proper_type(typ)\n if isinstance(typ, Instance):\n info = typ.type\n return info.has_base('mypy.types.Type') and not info.has_base('mypy.types.ProperType')\n if isinstance(typ, UnionType):\n return any(is_improper_type(t) for t in typ.items)\n return False\n\n\ndef is_dangerous_target(typ: ProperType) -> bool:\n \"\"\"Is this a dangerous target (right argument) for an isinstance() check?\"\"\"\n if isinstance(typ, TupleType):\n return any(is_dangerous_target(get_proper_type(t)) for t in typ.items)\n if isinstance(typ, CallableType) and typ.is_type_obj():\n return typ.type_object().has_base('mypy.types.Type')\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/proper_plugin.py_proper_type_hook_proper_type_hook.return.ctx_default_return_type": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/proper_plugin.py_proper_type_hook_proper_type_hook.return.ctx_default_return_type", "embedding": null, "metadata": {"file_path": "misc/proper_plugin.py", "file_name": "proper_plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 102, "end_line": 113, "span_ids": ["proper_type_hook"], "tokens": 149}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def proper_type_hook(ctx: FunctionContext) -> Type:\n \"\"\"Check if this get_proper_type() call is not redundant.\"\"\"\n arg_types = ctx.arg_types[0]\n if arg_types:\n arg_type = get_proper_type(arg_types[0])\n proper_type = get_proper_type_instance(ctx)\n if is_proper_subtype(arg_type, UnionType.make_union([NoneTyp(), proper_type])):\n # Minimize amount of spurious errors from overload machinery.\n # TODO: call the hook on the overload as a whole?\n if isinstance(arg_type, (UnionType, Instance)):\n ctx.api.fail('Redundant call to get_proper_type()', ctx.context)\n return ctx.default_return_type", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/proper_plugin.py_proper_types_hook_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/proper_plugin.py_proper_types_hook_", "embedding": null, "metadata": {"file_path": "misc/proper_plugin.py", "file_name": "proper_plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 116, "end_line": 138, "span_ids": ["proper_types_hook", "get_proper_type_instance", "plugin"], "tokens": 217}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def proper_types_hook(ctx: FunctionContext) -> Type:\n \"\"\"Check if this get_proper_types() call is not redundant.\"\"\"\n arg_types = ctx.arg_types[0]\n if arg_types:\n arg_type = arg_types[0]\n proper_type = get_proper_type_instance(ctx)\n item_type = UnionType.make_union([NoneTyp(), proper_type])\n ok_type = ctx.api.named_generic_type('typing.Iterable', [item_type])\n if is_proper_subtype(arg_type, ok_type):\n ctx.api.fail('Redundant call to get_proper_types()', ctx.context)\n return ctx.default_return_type\n\n\ndef get_proper_type_instance(ctx: FunctionContext) -> Instance:\n types = ctx.api.modules['mypy.types'] # type: ignore\n proper_type_info = types.names['ProperType']\n assert isinstance(proper_type_info.node, TypeInfo)\n return Instance(proper_type_info.node, [])\n\n\ndef plugin(version: str) -> typing_Type[ProperTypePlugin]:\n return ProperTypePlugin", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/test_case_to_actual.py_from_typing_import_Iterat_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/test_case_to_actual.py_from_typing_import_Iterat_", "embedding": null, "metadata": {"file_path": "misc/test_case_to_actual.py", "file_name": "test_case_to_actual.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 72, "span_ids": ["normalize", "produce_chunks", "Chunk", "main", "imports", "help", "impl", "Chunk.__init__", "is_header", "write_out", "write_tree"], "tokens": 470}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from typing import Iterator, List\nimport sys\nimport os\nimport os.path\n\n\nclass Chunk:\n def __init__(self, header_type: str, args: str) -> None:\n self.header_type = header_type\n self.args = args\n self.lines = [] # type: List[str]\n\n\ndef is_header(line: str) -> bool:\n return line.startswith('[') and line.endswith(']')\n\n\ndef normalize(lines: Iterator[str]) -> Iterator[str]:\n return (line.rstrip() for line in lines)\n\n\ndef produce_chunks(lines: Iterator[str]) -> Iterator[Chunk]:\n current_chunk = None # type: Chunk\n for line in normalize(lines):\n if is_header(line):\n if current_chunk is not None:\n yield current_chunk\n parts = line[1:-1].split(' ', 1)\n args = parts[1] if len(parts) > 1 else ''\n current_chunk = Chunk(parts[0], args)\n else:\n current_chunk.lines.append(line)\n if current_chunk is not None:\n yield current_chunk\n\n\ndef write_out(filename: str, lines: List[str]) -> None:\n os.makedirs(os.path.dirname(filename), exist_ok=True)\n with open(filename, 'w') as stream:\n stream.write('\\n'.join(lines))\n\n\ndef write_tree(root: str, chunks: Iterator[Chunk]) -> None:\n init = next(chunks)\n assert init.header_type == 'case'\n\n root = os.path.join(root, init.args)\n write_out(os.path.join(root, 'main.py'), init.lines)\n\n for chunk in chunks:\n if chunk.header_type == 'file' and chunk.args.endswith('.py'):\n write_out(os.path.join(root, chunk.args), chunk.lines)\n\n\ndef help() -> None:\n print(\"Usage: python misc/test_case_to_actual.py test_file.txt root_path\")\n\n\ndef main() -> None:\n if len(sys.argv) != 3:\n help()\n return\n\n test_file_path, root_path = sys.argv[1], sys.argv[2]\n with open(test_file_path, 'r') as stream:\n chunks = produce_chunks(iter(stream))\n write_tree(root_path, chunks)\n\n\nif __name__ == '__main__':\n main()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/touch_checker.py__usr_bin_env_python3_execute.if_proc_returncode_0_.None_7": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/touch_checker.py__usr_bin_env_python3_execute.if_proc_returncode_0_.None_7", "embedding": null, "metadata": {"file_path": "misc/touch_checker.py", "file_name": "touch_checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 42, "span_ids": ["execute", "print_offset", "delete_folder", "docstring"], "tokens": 240}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "#!/usr/bin/env python3\n\nfrom typing import Callable, List, Tuple, Optional\n\nimport sys\nimport glob\nimport os\nimport shutil\nimport statistics\nimport subprocess\nimport textwrap\nimport time\n\n\ndef print_offset(text: str, indent_length: int = 4) -> None:\n print()\n print(textwrap.indent(text, ' ' * indent_length))\n print()\n\n\ndef delete_folder(folder_path: str) -> None:\n if os.path.exists(folder_path):\n shutil.rmtree(folder_path)\n\n\ndef execute(command: List[str]) -> None:\n proc = subprocess.Popen(\n ' '.join(command),\n stderr=subprocess.PIPE,\n stdout=subprocess.PIPE,\n shell=True)\n stdout_bytes, stderr_bytes = proc.communicate() # type: Tuple[bytes, bytes]\n stdout, stderr = stdout_bytes.decode('utf-8'), stderr_bytes.decode('utf-8')\n if proc.returncode != 0:\n print('EXECUTED COMMAND:', repr(command))\n print('RETURN CODE:', proc.returncode)\n print()\n print('STDOUT:')\n print_offset(stdout)\n print('STDERR:')\n print_offset(stderr)\n print()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/touch_checker.py_Command_make_change_wrappers.return.setup_teardown": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/touch_checker.py_Command_make_change_wrappers.return.setup_teardown", "embedding": null, "metadata": {"file_path": "misc/touch_checker.py", "file_name": "touch_checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 45, "end_line": 83, "span_ids": ["test", "make_change_wrappers", "make_touch_wrappers", "impl"], "tokens": 241}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "Command = Callable[[], None]\n\n\ndef test(setup: Command, command: Command, teardown: Command) -> float:\n setup()\n start = time.time()\n command()\n end = time.time() - start\n teardown()\n return end\n\n\ndef make_touch_wrappers(filename: str) -> Tuple[Command, Command]:\n def setup() -> None:\n execute([\"touch\", filename])\n def teardown() -> None:\n pass\n return setup, teardown\n\n\ndef make_change_wrappers(filename: str) -> Tuple[Command, Command]:\n copy = None # type: Optional[str]\n\n def setup() -> None:\n nonlocal copy\n with open(filename, 'r') as stream:\n copy = stream.read()\n with open(filename, 'a') as stream:\n stream.write('\\n\\nfoo = 3')\n\n def teardown() -> None:\n assert copy is not None\n with open(filename, 'w') as stream:\n stream.write(copy)\n\n # Re-run to reset cache\n execute([\"python3\", \"-m\", \"mypy\", \"-i\", \"mypy\"]),\n\n return setup, teardown", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/touch_checker.py_main_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/touch_checker.py_main_", "embedding": null, "metadata": {"file_path": "misc/touch_checker.py", "file_name": "touch_checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 85, "end_line": 152, "span_ids": ["impl:3", "main"], "tokens": 519}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def main() -> None:\n if len(sys.argv) != 2 or sys.argv[1] not in {'touch', 'change'}:\n print(\"First argument should be 'touch' or 'change'\")\n return\n\n if sys.argv[1] == 'touch':\n make_wrappers = make_touch_wrappers\n verb = \"Touching\"\n elif sys.argv[1] == 'change':\n make_wrappers = make_change_wrappers\n verb = \"Changing\"\n else:\n raise AssertionError()\n\n print(\"Setting up...\")\n\n baseline = test(\n lambda: None,\n lambda: execute([\"python3\", \"-m\", \"mypy\", \"mypy\"]),\n lambda: None)\n print(\"Baseline: {}\".format(baseline))\n\n cold = test(\n lambda: delete_folder(\".mypy_cache\"),\n lambda: execute([\"python3\", \"-m\", \"mypy\", \"-i\", \"mypy\"]),\n lambda: None)\n print(\"Cold cache: {}\".format(cold))\n\n warm = test(\n lambda: None,\n lambda: execute([\"python3\", \"-m\", \"mypy\", \"-i\", \"mypy\"]),\n lambda: None)\n print(\"Warm cache: {}\".format(warm))\n\n print()\n\n deltas = []\n for filename in glob.iglob(\"mypy/**/*.py\", recursive=True):\n print(\"{} {}\".format(verb, filename))\n\n setup, teardown = make_wrappers(filename)\n delta = test(\n setup,\n lambda: execute([\"python3\", \"-m\", \"mypy\", \"-i\", \"mypy\"]),\n teardown)\n print(\" Time: {}\".format(delta))\n deltas.append(delta)\n print()\n\n print(\"Initial:\")\n print(\" Baseline: {}\".format(baseline))\n print(\" Cold cache: {}\".format(cold))\n print(\" Warm cache: {}\".format(warm))\n print()\n print(\"Aggregate:\")\n print(\" Times: {}\".format(deltas))\n print(\" Mean: {}\".format(statistics.mean(deltas)))\n print(\" Median: {}\".format(statistics.median(deltas)))\n print(\" Stdev: {}\".format(statistics.stdev(deltas)))\n print(\" Min: {}\".format(min(deltas)))\n print(\" Max: {}\".format(max(deltas)))\n print(\" Total: {}\".format(sum(deltas)))\n print()\n\nif __name__ == '__main__':\n main()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/variadics.py__Example_of_code_genera_prelude.for_i_in_range_LIMIT_.print_T_i_TypeVar_T": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/variadics.py__Example_of_code_genera_prelude.for_i_in_range_LIMIT_.print_T_i_TypeVar_T", "embedding": null, "metadata": {"file_path": "misc/variadics.py", "file_name": "variadics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 14, "span_ids": ["prelude", "docstring"], "tokens": 144}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Example of code generation approach to variadics.\n\nSee https://github.com/python/typing/issues/193#issuecomment-236383893\n\"\"\"\n\nLIMIT = 5\nBOUND = 'object'\n\ndef prelude(limit: int, bound: str) -> None:\n print('from typing import Callable, Iterable, Iterator, Tuple, TypeVar, overload')\n print('Ts = TypeVar(\\'Ts\\', bound={bound})'.format(bound=bound))\n print('R = TypeVar(\\'R\\')')\n for i in range(LIMIT):\n print('T{i} = TypeVar(\\'T{i}\\', bound={bound})'.format(i=i+1, bound=bound))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/variadics.py_expand_template_expand_template.print_s_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/variadics.py_expand_template_expand_template.print_s_", "embedding": null, "metadata": {"file_path": "misc/variadics.py", "file_name": "variadics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 35, "span_ids": ["expand_template"], "tokens": 234}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def expand_template(template: str,\n arg_template: str = 'arg{i}: {Ts}',\n lower: int = 0,\n limit: int = LIMIT) -> None:\n print()\n for i in range(lower, limit):\n tvs = ', '.join('T{i}'.format(i=j+1) for j in range(i))\n args = ', '.join(arg_template.format(i=j+1, Ts='T{}'.format(j+1))\n for j in range(i))\n print('@overload')\n s = template.format(Ts=tvs, argsTs=args)\n s = s.replace('Tuple[]', 'Tuple[()]')\n print(s)\n args_l = [arg_template.format(i=j+1, Ts='Ts') for j in range(limit)]\n args_l.append('*' + (arg_template.format(i='s', Ts='Ts')))\n args = ', '.join(args_l)\n s = template.format(Ts='Ts, ...', argsTs=args)\n s = s.replace('Callable[[Ts, ...]', 'Callable[...')\n print('@overload')\n print(s)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/variadics.py_main_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/variadics.py_main_", "embedding": null, "metadata": {"file_path": "misc/variadics.py", "file_name": "variadics.py", "file_type": "text/x-python", "category": "implementation", "start_line": 37, "end_line": 55, "span_ids": ["impl:5", "main"], "tokens": 164}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def main():\n prelude(LIMIT, BOUND)\n\n # map()\n expand_template('def map(func: Callable[[{Ts}], R], {argsTs}) -> R: ...',\n lower=1)\n # zip()\n expand_template('def zip({argsTs}) -> Tuple[{Ts}]: ...')\n\n # Naomi's examples\n expand_template('def my_zip({argsTs}) -> Iterator[Tuple[{Ts}]]: ...',\n 'arg{i}: Iterable[{Ts}]')\n expand_template('def make_check({argsTs}) -> Callable[[{Ts}], bool]: ...')\n expand_template('def my_map(f: Callable[[{Ts}], R], {argsTs}) -> Iterator[R]: ...',\n 'arg{i}: Iterable[{Ts}]')\n\n\nmain()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/__init__.py__", "embedding": null, "metadata": {"file_path": "mypy/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 2, "span_ids": ["docstring"], "tokens": 6}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# This page intentionally left blank", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/__main__.py__Mypy_type_checker_comm_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/__main__.py__Mypy_type_checker_comm_", "embedding": null, "metadata": {"file_path": "mypy/__main__.py", "file_name": "__main__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 24, "span_ids": ["console_entry", "impl", "docstring"], "tokens": 130}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Mypy type checker command line tool.\"\"\"\n\nimport sys\nimport os\n\nfrom mypy.main import main\n\n\ndef console_entry() -> None:\n try:\n main(None, sys.stdout, sys.stderr)\n sys.stdout.flush()\n sys.stderr.flush()\n except BrokenPipeError:\n # Python flushes standard streams on exit; redirect remaining output\n # to devnull to avoid another BrokenPipeError at shutdown\n devnull = os.open(os.devnull, os.O_WRONLY)\n os.dup2(devnull, sys.stdout.fileno())\n sys.exit(2)\n\n\nif __name__ == '__main__':\n console_entry()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/api.py__This_module_makes_it_p_run.return._run_lambda_stdout_stder": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/api.py__This_module_makes_it_p_run.return._run_lambda_stdout_stder", "embedding": null, "metadata": {"file_path": "mypy/api.py", "file_name": "api.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 70, "span_ids": ["_run", "run", "docstring"], "tokens": 501}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"This module makes it possible to use mypy as part of a Python application.\n\nSince mypy still changes, the API was kept utterly simple and non-intrusive.\nIt just mimics command line activation without starting a new interpreter.\nSo the normal docs about the mypy command line apply.\nChanges in the command line version of mypy will be immediately useable.\n\nJust import this module and then call the 'run' function with a parameter of\ntype List[str], containing what normally would have been the command line\narguments to mypy.\n\nFunction 'run' returns a Tuple[str, str, int], namely\n(, , ),\nin which is what mypy normally writes to sys.stdout,\n is what mypy normally writes to sys.stderr and exit_status is\nthe exit status mypy normally returns to the operating system.\n\nAny pretty formatting is left to the caller.\n\nThe 'run_dmypy' function is similar, but instead mimics invocation of\ndmypy. Note that run_dmypy is not thread-safe and modifies sys.stdout\nand sys.stderr during its invocation.\n\nNote that these APIs don't support incremental generation of error\nmessages.\n\nTrivial example of code using this module:\n\nimport sys\nfrom mypy import api\n\nresult = api.run(sys.argv[1:])\n\nif result[0]:\n print('\\nType checking report:\\n')\n print(result[0]) # stdout\n\nif result[1]:\n print('\\nError report:\\n')\n print(result[1]) # stderr\n\nprint('\\nExit status:', result[2])\n\n\"\"\"\n\nimport sys\n\nfrom io import StringIO\nfrom typing import List, Tuple, TextIO, Callable\n\n\ndef _run(main_wrapper: Callable[[TextIO, TextIO], None]) -> Tuple[str, str, int]:\n\n stdout = StringIO()\n stderr = StringIO()\n\n try:\n main_wrapper(stdout, stderr)\n exit_status = 0\n except SystemExit as system_exit:\n exit_status = system_exit.code\n\n return stdout.getvalue(), stderr.getvalue(), exit_status\n\n\ndef run(args: List[str]) -> Tuple[str, str, int]:\n # Lazy import to avoid needing to import all of mypy to call run_dmypy\n from mypy.main import main\n return _run(lambda stdout, stderr: main(None, args=args,\n stdout=stdout, stderr=stderr))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/api.py_run_dmypy_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/api.py_run_dmypy_", "embedding": null, "metadata": {"file_path": "mypy/api.py", "file_name": "api.py", "file_type": "text/x-python", "category": "implementation", "start_line": 73, "end_line": 92, "span_ids": ["run_dmypy"], "tokens": 161}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def run_dmypy(args: List[str]) -> Tuple[str, str, int]:\n from mypy.dmypy.client import main\n\n # A bunch of effort has been put into threading stdout and stderr\n # through the main API to avoid the threadsafety problems of\n # modifying sys.stdout/sys.stderr, but that hasn't been done for\n # the dmypy client, so we just do the non-threadsafe thing.\n def f(stdout: TextIO, stderr: TextIO) -> None:\n old_stdout = sys.stdout\n old_stderr = sys.stderr\n try:\n sys.stdout = stdout\n sys.stderr = stderr\n main(args)\n finally:\n sys.stdout = old_stdout\n sys.stderr = old_stderr\n\n return _run(f)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/applytype.py_from_typing_import_Dict__get_target_type.return.type": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/applytype.py_from_typing_import_Dict__get_target_type.return.type", "embedding": null, "metadata": {"file_path": "mypy/applytype.py", "file_name": "applytype.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 53, "span_ids": ["imports", "get_target_type"], "tokens": 444}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from typing import Dict, Sequence, Optional, Callable\n\nimport mypy.subtypes\nimport mypy.sametypes\nfrom mypy.expandtype import expand_type\nfrom mypy.types import (\n Type, TypeVarId, TypeVarType, CallableType, AnyType, PartialType, get_proper_types,\n TypeVarDef, TypeVarLikeDef, ProperType\n)\nfrom mypy.nodes import Context\n\n\ndef get_target_type(\n tvar: TypeVarLikeDef,\n type: ProperType,\n callable: CallableType,\n report_incompatible_typevar_value: Callable[[CallableType, Type, str, Context], None],\n context: Context,\n skip_unsatisfied: bool\n) -> Optional[Type]:\n # TODO(shantanu): fix for ParamSpecDef\n assert isinstance(tvar, TypeVarDef)\n values = get_proper_types(tvar.values)\n if values:\n if isinstance(type, AnyType):\n return type\n if isinstance(type, TypeVarType) and type.values:\n # Allow substituting T1 for T if every allowed value of T1\n # is also a legal value of T.\n if all(any(mypy.sametypes.is_same_type(v, v1) for v in values)\n for v1 in type.values):\n return type\n matching = []\n for value in values:\n if mypy.subtypes.is_subtype(type, value):\n matching.append(value)\n if matching:\n best = matching[0]\n # If there are more than one matching value, we select the narrowest\n for match in matching[1:]:\n if mypy.subtypes.is_subtype(match, best):\n best = match\n return best\n if skip_unsatisfied:\n return None\n report_incompatible_typevar_value(callable, type, tvar.name, context)\n else:\n upper_bound = tvar.upper_bound\n if not mypy.subtypes.is_subtype(type, upper_bound):\n if skip_unsatisfied:\n return None\n report_incompatible_typevar_value(callable, type, tvar.name, context)\n return type", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/applytype.py_apply_generic_arguments_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/applytype.py_apply_generic_arguments_", "embedding": null, "metadata": {"file_path": "mypy/applytype.py", "file_name": "applytype.py", "file_type": "text/x-python", "category": "implementation", "start_line": 56, "end_line": 102, "span_ids": ["apply_generic_arguments"], "tokens": 440}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def apply_generic_arguments(\n callable: CallableType, orig_types: Sequence[Optional[Type]],\n report_incompatible_typevar_value: Callable[[CallableType, Type, str, Context], None],\n context: Context,\n skip_unsatisfied: bool = False) -> CallableType:\n \"\"\"Apply generic type arguments to a callable type.\n\n For example, applying [int] to 'def [T] (T) -> T' results in\n 'def (int) -> int'.\n\n Note that each type can be None; in this case, it will not be applied.\n\n If `skip_unsatisfied` is True, then just skip the types that don't satisfy type variable\n bound or constraints, instead of giving an error.\n \"\"\"\n tvars = callable.variables\n assert len(tvars) == len(orig_types)\n # Check that inferred type variable values are compatible with allowed\n # values and bounds. Also, promote subtype values to allowed values.\n types = get_proper_types(orig_types)\n\n # Create a map from type variable id to target type.\n id_to_type = {} # type: Dict[TypeVarId, Type]\n\n for tvar, type in zip(tvars, types):\n assert not isinstance(type, PartialType), \"Internal error: must never apply partial type\"\n if type is None:\n continue\n\n target_type = get_target_type(\n tvar, type, callable, report_incompatible_typevar_value, context, skip_unsatisfied\n )\n if target_type is not None:\n id_to_type[tvar.id] = target_type\n\n # Apply arguments to argument types.\n arg_types = [expand_type(at, id_to_type) for at in callable.arg_types]\n\n # The callable may retain some type vars if only some were applied.\n remaining_tvars = [tv for tv in tvars if tv.id not in id_to_type]\n\n return callable.copy_modified(\n arg_types=arg_types,\n ret_type=expand_type(callable.ret_type, id_to_type),\n variables=remaining_tvars,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/argmap.py__Utilities_for_mapping__map_actuals_to_formals.for_ai_actual_kind_in_en.if_actual_kind_nodes_A.else_.if_isinstance_actualt_Ty.else_.ambiguous_actual_kwargs_a": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/argmap.py__Utilities_for_mapping__map_actuals_to_formals.for_ai_actual_kind_in_en.if_actual_kind_nodes_A.else_.if_isinstance_actualt_Ty.else_.ambiguous_actual_kwargs_a", "embedding": null, "metadata": {"file_path": "mypy/argmap.py", "file_name": "argmap.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 82, "span_ids": ["map_actuals_to_formals", "docstring"], "tokens": 826}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Utilities for mapping between actual and formal arguments (and their types).\"\"\"\n\nfrom typing import List, Optional, Sequence, Callable, Set\n\nfrom mypy.types import (\n Type, Instance, TupleType, AnyType, TypeOfAny, TypedDictType, get_proper_type\n)\nfrom mypy import nodes\n\n\ndef map_actuals_to_formals(actual_kinds: List[int],\n actual_names: Optional[Sequence[Optional[str]]],\n formal_kinds: List[int],\n formal_names: Sequence[Optional[str]],\n actual_arg_type: Callable[[int],\n Type]) -> List[List[int]]:\n \"\"\"Calculate mapping between actual (caller) args and formals.\n\n The result contains a list of caller argument indexes mapping to each\n callee argument index, indexed by callee index.\n\n The caller_arg_type argument should evaluate to the type of the actual\n argument type with the given index.\n \"\"\"\n nformals = len(formal_kinds)\n formal_to_actual = [[] for i in range(nformals)] # type: List[List[int]]\n ambiguous_actual_kwargs = [] # type: List[int]\n fi = 0\n for ai, actual_kind in enumerate(actual_kinds):\n if actual_kind == nodes.ARG_POS:\n if fi < nformals:\n if formal_kinds[fi] in [nodes.ARG_POS, nodes.ARG_OPT,\n nodes.ARG_NAMED, nodes.ARG_NAMED_OPT]:\n formal_to_actual[fi].append(ai)\n fi += 1\n elif formal_kinds[fi] == nodes.ARG_STAR:\n formal_to_actual[fi].append(ai)\n elif actual_kind == nodes.ARG_STAR:\n # We need to know the actual type to map varargs.\n actualt = get_proper_type(actual_arg_type(ai))\n if isinstance(actualt, TupleType):\n # A tuple actual maps to a fixed number of formals.\n for _ in range(len(actualt.items)):\n if fi < nformals:\n if formal_kinds[fi] != nodes.ARG_STAR2:\n formal_to_actual[fi].append(ai)\n else:\n break\n if formal_kinds[fi] != nodes.ARG_STAR:\n fi += 1\n else:\n # Assume that it is an iterable (if it isn't, there will be\n # an error later).\n while fi < nformals:\n if formal_kinds[fi] in (nodes.ARG_NAMED, nodes.ARG_NAMED_OPT, nodes.ARG_STAR2):\n break\n else:\n formal_to_actual[fi].append(ai)\n if formal_kinds[fi] == nodes.ARG_STAR:\n break\n fi += 1\n elif actual_kind in (nodes.ARG_NAMED, nodes.ARG_NAMED_OPT):\n assert actual_names is not None, \"Internal error: named kinds without names given\"\n name = actual_names[ai]\n if name in formal_names:\n formal_to_actual[formal_names.index(name)].append(ai)\n elif nodes.ARG_STAR2 in formal_kinds:\n formal_to_actual[formal_kinds.index(nodes.ARG_STAR2)].append(ai)\n else:\n assert actual_kind == nodes.ARG_STAR2\n actualt = get_proper_type(actual_arg_type(ai))\n if isinstance(actualt, TypedDictType):\n for name, value in actualt.items.items():\n if name in formal_names:\n formal_to_actual[formal_names.index(name)].append(ai)\n elif nodes.ARG_STAR2 in formal_kinds:\n formal_to_actual[formal_kinds.index(nodes.ARG_STAR2)].append(ai)\n else:\n # We don't exactly know which **kwargs are provided by the\n # caller, so we'll defer until all the other unambiguous\n # actuals have been processed\n ambiguous_actual_kwargs.append(ai)\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/argmap.py_map_actuals_to_formals.if_ambiguous_actual_kwarg_map_actuals_to_formals.return.formal_to_actual": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/argmap.py_map_actuals_to_formals.if_ambiguous_actual_kwarg_map_actuals_to_formals.return.formal_to_actual", "embedding": null, "metadata": {"file_path": "mypy/argmap.py", "file_name": "argmap.py", "file_type": "text/x-python", "category": "implementation", "start_line": 84, "end_line": 99, "span_ids": ["map_actuals_to_formals"], "tokens": 235}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def map_actuals_to_formals(actual_kinds: List[int],\n actual_names: Optional[Sequence[Optional[str]]],\n formal_kinds: List[int],\n formal_names: Sequence[Optional[str]],\n actual_arg_type: Callable[[int],\n Type]) -> List[List[int]]:\n # ... other code\n\n if ambiguous_actual_kwargs:\n # Assume the ambiguous kwargs will fill the remaining arguments.\n #\n # TODO: If there are also tuple varargs, we might be missing some potential\n # matches if the tuple was short enough to not match everything.\n unmatched_formals = [fi for fi in range(nformals)\n if (formal_names[fi]\n and (not formal_to_actual[fi]\n or actual_kinds[formal_to_actual[fi][0]] == nodes.ARG_STAR)\n and formal_kinds[fi] != nodes.ARG_STAR)\n or formal_kinds[fi] == nodes.ARG_STAR2]\n for ai in ambiguous_actual_kwargs:\n for fi in unmatched_formals:\n formal_to_actual[fi].append(ai)\n\n return formal_to_actual", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/argmap.py_map_formals_to_actuals_map_formals_to_actuals.return.actual_to_formal": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/argmap.py_map_formals_to_actuals_map_formals_to_actuals.return.actual_to_formal", "embedding": null, "metadata": {"file_path": "mypy/argmap.py", "file_name": "argmap.py", "file_type": "text/x-python", "category": "implementation", "start_line": 102, "end_line": 119, "span_ids": ["map_formals_to_actuals"], "tokens": 174}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def map_formals_to_actuals(actual_kinds: List[int],\n actual_names: Optional[Sequence[Optional[str]]],\n formal_kinds: List[int],\n formal_names: List[Optional[str]],\n actual_arg_type: Callable[[int],\n Type]) -> List[List[int]]:\n \"\"\"Calculate the reverse mapping of map_actuals_to_formals.\"\"\"\n formal_to_actual = map_actuals_to_formals(actual_kinds,\n actual_names,\n formal_kinds,\n formal_names,\n actual_arg_type)\n # Now reverse the mapping.\n actual_to_formal = [[] for _ in actual_kinds] # type: List[List[int]]\n for formal, actuals in enumerate(formal_to_actual):\n for actual in actuals:\n actual_to_formal[actual].append(formal)\n return actual_to_formal", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/argmap.py_ArgTypeExpander_ArgTypeExpander.__init__._type_Set_str_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/argmap.py_ArgTypeExpander_ArgTypeExpander.__init__._type_Set_str_", "embedding": null, "metadata": {"file_path": "mypy/argmap.py", "file_name": "argmap.py", "file_type": "text/x-python", "category": "implementation", "start_line": 122, "end_line": 148, "span_ids": ["ArgTypeExpander.__init__", "ArgTypeExpander"], "tokens": 254}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ArgTypeExpander:\n \"\"\"Utility class for mapping actual argument types to formal arguments.\n\n One of the main responsibilities is to expand caller tuple *args and TypedDict\n **kwargs, and to keep track of which tuple/TypedDict items have already been\n consumed.\n\n Example:\n\n def f(x: int, *args: str) -> None: ...\n f(*(1, 'x', 1.1))\n\n We'd call expand_actual_type three times:\n\n 1. The first call would provide 'int' as the actual type of 'x' (from '1').\n 2. The second call would provide 'str' as one of the actual types for '*args'.\n 2. The third call would provide 'float' as one of the actual types for '*args'.\n\n A single instance can process all the arguments for a single call. Each call\n needs a separate instance since instances have per-call state.\n \"\"\"\n\n def __init__(self) -> None:\n # Next tuple *args index to use.\n self.tuple_index = 0\n # Keyword arguments in TypedDict **kwargs used.\n self.kwargs_used = set() # type: Set[str]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/argmap.py_ArgTypeExpander.expand_actual_type_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/argmap.py_ArgTypeExpander.expand_actual_type_", "embedding": null, "metadata": {"file_path": "mypy/argmap.py", "file_name": "argmap.py", "file_type": "text/x-python", "category": "implementation", "start_line": 150, "end_line": 207, "span_ids": ["ArgTypeExpander.expand_actual_type"], "tokens": 529}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ArgTypeExpander:\n\n def expand_actual_type(self,\n actual_type: Type,\n actual_kind: int,\n formal_name: Optional[str],\n formal_kind: int) -> Type:\n \"\"\"Return the actual (caller) type(s) of a formal argument with the given kinds.\n\n If the actual argument is a tuple *args, return the next individual tuple item that\n maps to the formal arg.\n\n If the actual argument is a TypedDict **kwargs, return the next matching typed dict\n value type based on formal argument name and kind.\n\n This is supposed to be called for each formal, in order. Call multiple times per\n formal if multiple actuals map to a formal.\n \"\"\"\n actual_type = get_proper_type(actual_type)\n if actual_kind == nodes.ARG_STAR:\n if isinstance(actual_type, Instance):\n if actual_type.type.fullname == 'builtins.list':\n # List *arg.\n return actual_type.args[0]\n elif actual_type.args:\n # TODO: Try to map type arguments to Iterable\n return actual_type.args[0]\n else:\n return AnyType(TypeOfAny.from_error)\n elif isinstance(actual_type, TupleType):\n # Get the next tuple item of a tuple *arg.\n if self.tuple_index >= len(actual_type.items):\n # Exhausted a tuple -- continue to the next *args.\n self.tuple_index = 1\n else:\n self.tuple_index += 1\n return actual_type.items[self.tuple_index - 1]\n else:\n return AnyType(TypeOfAny.from_error)\n elif actual_kind == nodes.ARG_STAR2:\n if isinstance(actual_type, TypedDictType):\n if formal_kind != nodes.ARG_STAR2 and formal_name in actual_type.items:\n # Lookup type based on keyword argument name.\n assert formal_name is not None\n else:\n # Pick an arbitrary item if no specified keyword is expected.\n formal_name = (set(actual_type.items.keys()) - self.kwargs_used).pop()\n self.kwargs_used.add(formal_name)\n return actual_type.items[formal_name]\n elif (isinstance(actual_type, Instance)\n and (actual_type.type.fullname == 'builtins.dict')):\n # Dict **arg.\n # TODO: Handle arbitrary Mapping\n return actual_type.args[1]\n else:\n return AnyType(TypeOfAny.from_error)\n else:\n # No translation for other kinds -- 1:1 mapping.\n return actual_type", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/binder.py_from_contextlib_import_co_BindableExpression.Union_IndexExpr_MemberEx": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/binder.py_from_contextlib_import_co_BindableExpression.Union_IndexExpr_MemberEx", "embedding": null, "metadata": {"file_path": "mypy/binder.py", "file_name": "binder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 19, "span_ids": ["imports"], "tokens": 164}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from contextlib import contextmanager\nfrom collections import defaultdict\n\nfrom typing import Dict, List, Set, Iterator, Union, Optional, Tuple, cast\nfrom typing_extensions import DefaultDict\n\nfrom mypy.types import (\n Type, AnyType, PartialType, UnionType, TypeOfAny, NoneType, get_proper_type\n)\nfrom mypy.subtypes import is_subtype\nfrom mypy.join import join_simple\nfrom mypy.sametypes import is_same_type\nfrom mypy.erasetype import remove_instance_last_known_values\nfrom mypy.nodes import Expression, Var, RefExpr\nfrom mypy.literals import Key, literal, literal_hash, subkeys\nfrom mypy.nodes import IndexExpr, MemberExpr, NameExpr\n\n\nBindableExpression = Union[IndexExpr, MemberExpr, NameExpr]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/binder.py_Frame_Assigns.DefaultDict_Expression_L": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/binder.py_Frame_Assigns.DefaultDict_Expression_L", "embedding": null, "metadata": {"file_path": "mypy/binder.py", "file_name": "binder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 22, "end_line": 47, "span_ids": ["Frame", "impl:3", "Frame.__init__"], "tokens": 230}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Frame:\n \"\"\"A Frame represents a specific point in the execution of a program.\n It carries information about the current types of expressions at\n that point, arising either from assignments to those expressions\n or the result of isinstance checks. It also records whether it is\n possible to reach that point at all.\n\n This information is not copied into a new Frame when it is pushed\n onto the stack, so a given Frame only has information about types\n that were assigned in that frame.\n \"\"\"\n\n def __init__(self) -> None:\n self.types = {} # type: Dict[Key, Type]\n self.unreachable = False\n\n # Should be set only if we're entering a frame where it's not\n # possible to accurately determine whether or not contained\n # statements will be unreachable or not.\n #\n # Long-term, we should improve mypy to the point where we no longer\n # need this field.\n self.suppress_unreachable_warnings = False\n\n\nAssigns = DefaultDict[Expression, List[Tuple[Type, Optional[Type]]]]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/binder.py_ConditionalTypeBinder_ConditionalTypeBinder._get.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/binder.py_ConditionalTypeBinder_ConditionalTypeBinder._get.return.None", "embedding": null, "metadata": {"file_path": "mypy/binder.py", "file_name": "binder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 50, "end_line": 128, "span_ids": ["ConditionalTypeBinder._add_dependencies", "ConditionalTypeBinder._get", "ConditionalTypeBinder._put", "ConditionalTypeBinder", "ConditionalTypeBinder.__init__", "ConditionalTypeBinder.push_frame"], "tokens": 756}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ConditionalTypeBinder:\n \"\"\"Keep track of conditional types of variables.\n\n NB: Variables are tracked by literal expression, so it is possible\n to confuse the binder; for example,\n\n ```\n class A:\n a = None # type: Union[int, str]\n x = A()\n lst = [x]\n reveal_type(x.a) # Union[int, str]\n x.a = 1\n reveal_type(x.a) # int\n reveal_type(lst[0].a) # Union[int, str]\n lst[0].a = 'a'\n reveal_type(x.a) # int\n reveal_type(lst[0].a) # str\n ```\n \"\"\"\n # Stored assignments for situations with tuple/list lvalue and rvalue of union type.\n # This maps an expression to a list of bound types for every item in the union type.\n type_assignments = None # type: Optional[Assigns]\n\n def __init__(self) -> None:\n # The stack of frames currently used. These map\n # literal_hash(expr) -- literals like 'foo.bar' --\n # to types. The last element of this list is the\n # top-most, current frame. Each earlier element\n # records the state as of when that frame was last\n # on top of the stack.\n self.frames = [Frame()]\n\n # For frames higher in the stack, we record the set of\n # Frames that can escape there, either by falling off\n # the end of the frame or by a loop control construct\n # or raised exception. The last element of self.frames\n # has no corresponding element in this list.\n self.options_on_return = [] # type: List[List[Frame]]\n\n # Maps literal_hash(expr) to get_declaration(expr)\n # for every expr stored in the binder\n self.declarations = {} # type: Dict[Key, Optional[Type]]\n # Set of other keys to invalidate if a key is changed, e.g. x -> {x.a, x[0]}\n # Whenever a new key (e.g. x.a.b) is added, we update this\n self.dependencies = {} # type: Dict[Key, Set[Key]]\n\n # Whether the last pop changed the newly top frame on exit\n self.last_pop_changed = False\n\n self.try_frames = set() # type: Set[int]\n self.break_frames = [] # type: List[int]\n self.continue_frames = [] # type: List[int]\n\n def _add_dependencies(self, key: Key, value: Optional[Key] = None) -> None:\n if value is None:\n value = key\n else:\n self.dependencies.setdefault(key, set()).add(value)\n for elt in subkeys(key):\n self._add_dependencies(elt, value)\n\n def push_frame(self) -> Frame:\n \"\"\"Push a new frame into the binder.\"\"\"\n f = Frame()\n self.frames.append(f)\n self.options_on_return.append([])\n return f\n\n def _put(self, key: Key, type: Type, index: int = -1) -> None:\n self.frames[index].types[key] = type\n\n def _get(self, key: Key, index: int = -1) -> Optional[Type]:\n if index < 0:\n index += len(self.frames)\n for i in range(index, -1, -1):\n if key in self.frames[i].types:\n return self.frames[i].types[key]\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/binder.py_ConditionalTypeBinder.put_ConditionalTypeBinder._cleanse_key.for_frame_in_self_frames_.if_key_in_frame_types_.del_frame_types_key_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/binder.py_ConditionalTypeBinder.put_ConditionalTypeBinder._cleanse_key.for_frame_in_self_frames_.if_key_in_frame_types_.del_frame_types_key_", "embedding": null, "metadata": {"file_path": "mypy/binder.py", "file_name": "binder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 130, "end_line": 172, "span_ids": ["ConditionalTypeBinder._cleanse_key", "ConditionalTypeBinder.get", "ConditionalTypeBinder.unreachable", "ConditionalTypeBinder.is_unreachable", "ConditionalTypeBinder.is_unreachable_warning_suppressed", "ConditionalTypeBinder.cleanse", "ConditionalTypeBinder.suppress_unreachable_warnings", "ConditionalTypeBinder.put"], "tokens": 389}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ConditionalTypeBinder:\n\n def put(self, expr: Expression, typ: Type) -> None:\n if not isinstance(expr, (IndexExpr, MemberExpr, NameExpr)):\n return\n if not literal(expr):\n return\n key = literal_hash(expr)\n assert key is not None, 'Internal error: binder tried to put non-literal'\n if key not in self.declarations:\n self.declarations[key] = get_declaration(expr)\n self._add_dependencies(key)\n self._put(key, typ)\n\n def unreachable(self) -> None:\n self.frames[-1].unreachable = True\n\n def suppress_unreachable_warnings(self) -> None:\n self.frames[-1].suppress_unreachable_warnings = True\n\n def get(self, expr: Expression) -> Optional[Type]:\n key = literal_hash(expr)\n assert key is not None, 'Internal error: binder tried to get non-literal'\n return self._get(key)\n\n def is_unreachable(self) -> bool:\n # TODO: Copy the value of unreachable into new frames to avoid\n # this traversal on every statement?\n return any(f.unreachable for f in self.frames)\n\n def is_unreachable_warning_suppressed(self) -> bool:\n # TODO: See todo in 'is_unreachable'\n return any(f.suppress_unreachable_warnings for f in self.frames)\n\n def cleanse(self, expr: Expression) -> None:\n \"\"\"Remove all references to a Node from the binder.\"\"\"\n key = literal_hash(expr)\n assert key is not None, 'Internal error: binder tried cleanse non-literal'\n self._cleanse_key(key)\n\n def _cleanse_key(self, key: Key) -> None:\n \"\"\"Remove all references to a key from the binder.\"\"\"\n for frame in self.frames:\n if key in frame.types:\n del frame.types[key]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/binder.py_ConditionalTypeBinder.update_from_options_ConditionalTypeBinder.update_from_options.return.changed": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/binder.py_ConditionalTypeBinder.update_from_options_ConditionalTypeBinder.update_from_options.return.changed", "embedding": null, "metadata": {"file_path": "mypy/binder.py", "file_name": "binder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 174, "end_line": 212, "span_ids": ["ConditionalTypeBinder.update_from_options"], "tokens": 371}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ConditionalTypeBinder:\n\n def update_from_options(self, frames: List[Frame]) -> bool:\n \"\"\"Update the frame to reflect that each key will be updated\n as in one of the frames. Return whether any item changes.\n\n If a key is declared as AnyType, only update it if all the\n options are the same.\n \"\"\"\n\n frames = [f for f in frames if not f.unreachable]\n changed = False\n keys = set(key for f in frames for key in f.types)\n\n for key in keys:\n current_value = self._get(key)\n resulting_values = [f.types.get(key, current_value) for f in frames]\n if any(x is None for x in resulting_values):\n # We didn't know anything about key before\n # (current_value must be None), and we still don't\n # know anything about key in at least one possible frame.\n continue\n\n type = resulting_values[0]\n assert type is not None\n declaration_type = get_proper_type(self.declarations.get(key))\n if isinstance(declaration_type, AnyType):\n # At this point resulting values can't contain None, see continue above\n if not all(is_same_type(type, cast(Type, t)) for t in resulting_values[1:]):\n type = AnyType(TypeOfAny.from_another_any, source_any=declaration_type)\n else:\n for other in resulting_values[1:]:\n assert other is not None\n type = join_simple(self.declarations[key], type, other)\n if current_value is None or not is_same_type(type, current_value):\n self._put(key, type)\n changed = True\n\n self.frames[-1].unreachable = not frames\n\n return changed", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/binder.py_ConditionalTypeBinder.pop_frame_ConditionalTypeBinder.accumulate_type_assignments.self.type_assignments_2.old_assignments": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/binder.py_ConditionalTypeBinder.pop_frame_ConditionalTypeBinder.accumulate_type_assignments.self.type_assignments_2.old_assignments", "embedding": null, "metadata": {"file_path": "mypy/binder.py", "file_name": "binder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 214, "end_line": 246, "span_ids": ["ConditionalTypeBinder.accumulate_type_assignments", "ConditionalTypeBinder.pop_frame"], "tokens": 239}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ConditionalTypeBinder:\n\n def pop_frame(self, can_skip: bool, fall_through: int) -> Frame:\n \"\"\"Pop a frame and return it.\n\n See frame_context() for documentation of fall_through.\n \"\"\"\n\n if fall_through > 0:\n self.allow_jump(-fall_through)\n\n result = self.frames.pop()\n options = self.options_on_return.pop()\n\n if can_skip:\n options.insert(0, self.frames[-1])\n\n self.last_pop_changed = self.update_from_options(options)\n\n return result\n\n @contextmanager\n def accumulate_type_assignments(self) -> 'Iterator[Assigns]':\n \"\"\"Push a new map to collect assigned types in multiassign from union.\n\n If this map is not None, actual binding is deferred until all items in\n the union are processed (a union of collected items is later bound\n manually by the caller).\n \"\"\"\n old_assignments = None\n if self.type_assignments is not None:\n old_assignments = self.type_assignments\n self.type_assignments = defaultdict(list)\n yield self.type_assignments\n self.type_assignments = old_assignments", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/binder.py_ConditionalTypeBinder.assign_type_ConditionalTypeBinder.assign_type.for_i_in_self_try_frames_.self_allow_jump_i_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/binder.py_ConditionalTypeBinder.assign_type_ConditionalTypeBinder.assign_type.for_i_in_self_try_frames_.self_allow_jump_i_", "embedding": null, "metadata": {"file_path": "mypy/binder.py", "file_name": "binder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 248, "end_line": 319, "span_ids": ["ConditionalTypeBinder.assign_type"], "tokens": 742}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ConditionalTypeBinder:\n\n def assign_type(self, expr: Expression,\n type: Type,\n declared_type: Optional[Type],\n restrict_any: bool = False) -> None:\n # We should erase last known value in binder, because if we are using it,\n # it means that the target is not final, and therefore can't hold a literal.\n type = remove_instance_last_known_values(type)\n\n type = get_proper_type(type)\n declared_type = get_proper_type(declared_type)\n\n if self.type_assignments is not None:\n # We are in a multiassign from union, defer the actual binding,\n # just collect the types.\n self.type_assignments[expr].append((type, declared_type))\n return\n if not isinstance(expr, (IndexExpr, MemberExpr, NameExpr)):\n return None\n if not literal(expr):\n return\n self.invalidate_dependencies(expr)\n\n if declared_type is None:\n # Not sure why this happens. It seems to mainly happen in\n # member initialization.\n return\n if not is_subtype(type, declared_type):\n # Pretty sure this is only happens when there's a type error.\n\n # Ideally this function wouldn't be called if the\n # expression has a type error, though -- do other kinds of\n # errors cause this function to get called at invalid\n # times?\n return\n\n enclosing_type = get_proper_type(self.most_recent_enclosing_type(expr, type))\n if isinstance(enclosing_type, AnyType) and not restrict_any:\n # If x is Any and y is int, after x = y we do not infer that x is int.\n # This could be changed.\n # Instead, since we narrowed type from Any in a recent frame (probably an\n # isinstance check), but now it is reassigned, we broaden back\n # to Any (which is the most recent enclosing type)\n self.put(expr, enclosing_type)\n # As a special case, when assigning Any to a variable with a\n # declared Optional type that has been narrowed to None,\n # replace all the Nones in the declared Union type with Any.\n # This overrides the normal behavior of ignoring Any assignments to variables\n # in order to prevent false positives.\n # (See discussion in #3526)\n elif (isinstance(type, AnyType)\n and isinstance(declared_type, UnionType)\n and any(isinstance(get_proper_type(item), NoneType) for item in declared_type.items)\n and isinstance(get_proper_type(self.most_recent_enclosing_type(expr, NoneType())),\n NoneType)):\n # Replace any Nones in the union type with Any\n new_items = [type if isinstance(get_proper_type(item), NoneType) else item\n for item in declared_type.items]\n self.put(expr, UnionType(new_items))\n elif (isinstance(type, AnyType)\n and not (isinstance(declared_type, UnionType)\n and any(isinstance(get_proper_type(item), AnyType)\n for item in declared_type.items))):\n # Assigning an Any value doesn't affect the type to avoid false negatives, unless\n # there is an Any item in a declared union type.\n self.put(expr, declared_type)\n else:\n self.put(expr, type)\n\n for i in self.try_frames:\n # XXX This should probably not copy the entire frame, but\n # just copy this variable into a single stored frame.\n self.allow_jump(i)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/binder.py_ConditionalTypeBinder.invalidate_dependencies_ConditionalTypeBinder.handle_continue.self_unreachable_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/binder.py_ConditionalTypeBinder.invalidate_dependencies_ConditionalTypeBinder.handle_continue.self_unreachable_", "embedding": null, "metadata": {"file_path": "mypy/binder.py", "file_name": "binder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 321, "end_line": 363, "span_ids": ["ConditionalTypeBinder.invalidate_dependencies", "ConditionalTypeBinder.handle_break", "ConditionalTypeBinder.allow_jump", "ConditionalTypeBinder.handle_continue", "ConditionalTypeBinder.most_recent_enclosing_type"], "tokens": 363}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ConditionalTypeBinder:\n\n def invalidate_dependencies(self, expr: BindableExpression) -> None:\n \"\"\"Invalidate knowledge of types that include expr, but not expr itself.\n\n For example, when expr is foo.bar, invalidate foo.bar.baz.\n\n It is overly conservative: it invalidates globally, including\n in code paths unreachable from here.\n \"\"\"\n key = literal_hash(expr)\n assert key is not None\n for dep in self.dependencies.get(key, set()):\n self._cleanse_key(dep)\n\n def most_recent_enclosing_type(self, expr: BindableExpression, type: Type) -> Optional[Type]:\n type = get_proper_type(type)\n if isinstance(type, AnyType):\n return get_declaration(expr)\n key = literal_hash(expr)\n assert key is not None\n enclosers = ([get_declaration(expr)] +\n [f.types[key] for f in self.frames\n if key in f.types and is_subtype(type, f.types[key])])\n return enclosers[-1]\n\n def allow_jump(self, index: int) -> None:\n # self.frames and self.options_on_return have different lengths\n # so make sure the index is positive\n if index < 0:\n index += len(self.options_on_return)\n frame = Frame()\n for f in self.frames[index + 1:]:\n frame.types.update(f.types)\n if f.unreachable:\n frame.unreachable = True\n self.options_on_return[index].append(frame)\n\n def handle_break(self) -> None:\n self.allow_jump(self.break_frames[-1])\n self.unreachable()\n\n def handle_continue(self) -> None:\n self.allow_jump(self.continue_frames[-1])\n self.unreachable()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/binder.py_ConditionalTypeBinder.frame_context_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/binder.py_ConditionalTypeBinder.frame_context_", "embedding": null, "metadata": {"file_path": "mypy/binder.py", "file_name": "binder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 365, "end_line": 432, "span_ids": ["ConditionalTypeBinder.top_frame_context", "get_declaration", "ConditionalTypeBinder.frame_context"], "tokens": 564}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ConditionalTypeBinder:\n\n @contextmanager\n def frame_context(self, *, can_skip: bool, fall_through: int = 1,\n break_frame: int = 0, continue_frame: int = 0,\n try_frame: bool = False) -> Iterator[Frame]:\n \"\"\"Return a context manager that pushes/pops frames on enter/exit.\n\n If can_skip is True, control flow is allowed to bypass the\n newly-created frame.\n\n If fall_through > 0, then it will allow control flow that\n falls off the end of the frame to escape to its ancestor\n `fall_through` levels higher. Otherwise control flow ends\n at the end of the frame.\n\n If break_frame > 0, then 'break' statements within this frame\n will jump out to the frame break_frame levels higher than the\n frame created by this call to frame_context. Similarly for\n continue_frame and 'continue' statements.\n\n If try_frame is true, then execution is allowed to jump at any\n point within the newly created frame (or its descendants) to\n its parent (i.e., to the frame that was on top before this\n call to frame_context).\n\n After the context manager exits, self.last_pop_changed indicates\n whether any types changed in the newly-topmost frame as a result\n of popping this frame.\n \"\"\"\n assert len(self.frames) > 1\n\n if break_frame:\n self.break_frames.append(len(self.frames) - break_frame)\n if continue_frame:\n self.continue_frames.append(len(self.frames) - continue_frame)\n if try_frame:\n self.try_frames.add(len(self.frames) - 1)\n\n new_frame = self.push_frame()\n if try_frame:\n # An exception may occur immediately\n self.allow_jump(-1)\n yield new_frame\n self.pop_frame(can_skip, fall_through)\n\n if break_frame:\n self.break_frames.pop()\n if continue_frame:\n self.continue_frames.pop()\n if try_frame:\n self.try_frames.remove(len(self.frames) - 1)\n\n @contextmanager\n def top_frame_context(self) -> Iterator[Frame]:\n \"\"\"A variant of frame_context for use at the top level of\n a namespace (module, function, or class).\n \"\"\"\n assert len(self.frames) == 1\n yield self.push_frame()\n self.pop_frame(True, 0)\n\n\ndef get_declaration(expr: BindableExpression) -> Optional[Type]:\n if isinstance(expr, RefExpr) and isinstance(expr.node, Var):\n type = get_proper_type(expr.node.type)\n if not isinstance(type, PartialType):\n return type\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/bogus_type.py__A_Bogus_T_type_alias__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/bogus_type.py__A_Bogus_T_type_alias__", "embedding": null, "metadata": {"file_path": "mypy/bogus_type.py", "file_name": "bogus_type.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 25, "span_ids": ["docstring"], "tokens": 189}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"A Bogus[T] type alias for marking when we subvert the type system\n\nWe need this for compiling with mypyc, which inserts runtime\ntypechecks that cause problems when we subvert the type system. So\nwhen compiling with mypyc, we turn those places into Any, while\nkeeping the types around for normal typechecks.\n\nSince this causes the runtime types to be Any, this is best used\nin places where efficient access to properties is not important.\nFor those cases some other technique should be used.\n\"\"\"\n\nfrom mypy_extensions import FlexibleAlias\nfrom typing import TypeVar, Any\n\nT = TypeVar('T')\n\n# This won't ever be true at runtime, but we consider it true during\n# mypyc compilations.\nMYPYC = False\nif MYPYC:\n Bogus = FlexibleAlias[T, Any]\nelse:\n Bogus = FlexibleAlias[T, T]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py__Facilities_to_analyze__Graph.Dict_str_State_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py__Facilities_to_analyze__Graph.Dict_str_State_", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 84, "span_ids": ["imports:39", "docstring"], "tokens": 690}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Facilities to analyze entire programs, including imported modules.\n\nParse and analyze the source files of a program in the correct order\n(based on file dependencies), and collect the results.\n\nThis module only directs a build, which is performed in multiple passes per\nfile. The individual passes are implemented in separate modules.\n\nThe function build() is the main interface to this module.\n\"\"\"\n# TODO: More consistent terminology, e.g. path/fnam, module/id, state/file\n\nimport contextlib\nimport errno\nimport gc\nimport json\nimport os\nimport re\nimport stat\nimport sys\nimport time\nimport types\n\nfrom typing import (AbstractSet, Any, Dict, Iterable, Iterator, List, Sequence,\n Mapping, NamedTuple, Optional, Set, Tuple, Union, Callable, TextIO)\nfrom typing_extensions import ClassVar, Final, TYPE_CHECKING\nfrom mypy_extensions import TypedDict\n\nfrom mypy.nodes import MypyFile, ImportBase, Import, ImportFrom, ImportAll, SymbolTable\nfrom mypy.semanal_pass1 import SemanticAnalyzerPreAnalysis\nfrom mypy.semanal import SemanticAnalyzer\nimport mypy.semanal_main\nfrom mypy.checker import TypeChecker\nfrom mypy.indirection import TypeIndirectionVisitor\nfrom mypy.errors import Errors, CompileError, ErrorInfo, report_internal_error\nfrom mypy.util import (\n DecodeError, decode_python_encoding, is_sub_path, get_mypy_comments, module_prefix,\n read_py_file, hash_digest, is_typeshed_file, is_stub_package_file\n)\nif TYPE_CHECKING:\n from mypy.report import Reports # Avoid unconditional slow import\nfrom mypy.fixup import fixup_module\nfrom mypy.modulefinder import (\n BuildSource, compute_search_paths, FindModuleCache, SearchPaths, ModuleSearchResult,\n ModuleNotFoundReason\n)\nfrom mypy.nodes import Expression\nfrom mypy.options import Options\nfrom mypy.parse import parse\nfrom mypy.stats import dump_type_stats\nfrom mypy.types import Type\nfrom mypy.version import __version__\nfrom mypy.plugin import Plugin, ChainedPlugin, ReportConfigContext\nfrom mypy.plugins.default import DefaultPlugin\nfrom mypy.fscache import FileSystemCache\nfrom mypy.metastore import MetadataStore, FilesystemMetadataStore, SqliteMetadataStore\nfrom mypy.typestate import TypeState, reset_global_state\nfrom mypy.renaming import VariableRenameVisitor\nfrom mypy.config_parser import parse_mypy_comments\nfrom mypy.freetree import free_tree\nfrom mypy.stubinfo import legacy_bundled_packages\nfrom mypy import errorcodes as codes\n\n\n# Switch to True to produce debug output related to fine-grained incremental\n# mode only that is useful during development. This produces only a subset of\n# output compared to --verbose output. We use a global flag to enable this so\n# that it's easy to enable this when running tests.\nDEBUG_FINE_GRAINED = False # type: Final\n\n# These modules are special and should always come from typeshed.\nCORE_BUILTIN_MODULES = {\n 'builtins',\n 'typing',\n 'types',\n 'typing_extensions',\n 'mypy_extensions',\n '_importlib_modulespec',\n 'sys',\n 'abc',\n}\n\n\nGraph = Dict[str, 'State']", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py__TODO_Get_rid_of_BuildR_BuildResult.__init__._type_List_str_Fill": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py__TODO_Get_rid_of_BuildR_BuildResult.__init__._type_List_str_Fill", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 87, "end_line": 105, "span_ids": ["BuildResult.__init__", "BuildResult", "imports:39"], "tokens": 182}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# TODO: Get rid of BuildResult. We might as well return a BuildManager.\nclass BuildResult:\n \"\"\"The result of a successful build.\n\n Attributes:\n manager: The build manager.\n files: Dictionary from module name to related AST node.\n types: Dictionary from parse tree node to its inferred type.\n used_cache: Whether the build took advantage of a pre-existing cache\n errors: List of error messages.\n \"\"\"\n\n def __init__(self, manager: 'BuildManager', graph: Graph) -> None:\n self.manager = manager\n self.graph = graph\n self.files = manager.modules\n self.types = manager.all_types # Non-empty if export_types True in options\n self.used_cache = manager.cache_enabled\n self.errors = [] # type: List[str] # Filled in by build if desired", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_BuildSourceSet_BuildSourceSet.is_source.if_file_path_and_file_pat.else_.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_BuildSourceSet_BuildSourceSet.is_source.if_file_path_and_file_pat.else_.return.False", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 109, "end_line": 133, "span_ids": ["BuildSourceSet.is_source", "BuildSourceSet.__init__", "BuildSourceSet"], "tokens": 183}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BuildSourceSet:\n \"\"\"Efficiently test a file's membership in the set of build sources.\"\"\"\n\n def __init__(self, sources: List[BuildSource]) -> None:\n self.source_text_present = False\n self.source_modules = set() # type: Set[str]\n self.source_paths = set() # type: Set[str]\n\n for source in sources:\n if source.text is not None:\n self.source_text_present = True\n elif source.path:\n self.source_paths.add(source.path)\n else:\n self.source_modules.add(source.module)\n\n def is_source(self, file: MypyFile) -> bool:\n if file.path and file.path in self.source_paths:\n return True\n elif file._fullname in self.source_modules:\n return True\n elif self.source_text_present:\n return True\n else:\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_build_build.try_.except_CompileError_as_e_.raise": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_build_build.try_.except_CompileError_as_e_.raise", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 136, "end_line": 193, "span_ids": ["build"], "tokens": 498}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def build(sources: List[BuildSource],\n options: Options,\n alt_lib_path: Optional[str] = None,\n flush_errors: Optional[Callable[[List[str], bool], None]] = None,\n fscache: Optional[FileSystemCache] = None,\n stdout: Optional[TextIO] = None,\n stderr: Optional[TextIO] = None,\n extra_plugins: Optional[Sequence[Plugin]] = None,\n ) -> BuildResult:\n \"\"\"Analyze a program.\n\n A single call to build performs parsing, semantic analysis and optionally\n type checking for the program *and* all imported modules, recursively.\n\n Return BuildResult if successful or only non-blocking errors were found;\n otherwise raise CompileError.\n\n If a flush_errors callback is provided, all error messages will be\n passed to it and the errors and messages fields of BuildResult and\n CompileError (respectively) will be empty. Otherwise those fields will\n report any error messages.\n\n Args:\n sources: list of sources to build\n options: build options\n alt_lib_path: an additional directory for looking up library modules\n (takes precedence over other directories)\n flush_errors: optional function to flush errors after a file is processed\n fscache: optionally a file-system cacher\n\n \"\"\"\n # If we were not given a flush_errors, we use one that will populate those\n # fields for callers that want the traditional API.\n messages = []\n\n def default_flush_errors(new_messages: List[str], is_serious: bool) -> None:\n messages.extend(new_messages)\n\n flush_errors = flush_errors or default_flush_errors\n stdout = stdout or sys.stdout\n stderr = stderr or sys.stderr\n extra_plugins = extra_plugins or []\n\n try:\n result = _build(\n sources, options, alt_lib_path, flush_errors, fscache, stdout, stderr, extra_plugins\n )\n result.errors = messages\n return result\n except CompileError as e:\n # CompileErrors raised from an errors object carry all of the\n # messages that have not been reported out by error streaming.\n # Patch it up to contain either none or all none of the messages,\n # depending on whether we are flushing errors.\n serious = not e.use_stdout\n flush_errors(e.messages, serious)\n e.messages = messages\n raise", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_default_data_dir_normpath.if_options_bazel_.else_.return.os_path_abspath_path_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_default_data_dir_normpath.if_options_bazel_.else_.return.os_path_abspath_path_", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 275, "end_line": 292, "span_ids": ["default_data_dir", "normpath"], "tokens": 149}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def default_data_dir() -> str:\n \"\"\"Returns directory containing typeshed directory.\"\"\"\n return os.path.dirname(__file__)\n\n\ndef normpath(path: str, options: Options) -> str:\n \"\"\"Convert path to absolute; but to relative in bazel mode.\n\n (Bazel's distributed cache doesn't like filesystem metadata to\n end up in output files.)\n \"\"\"\n # TODO: Could we always use relpath? (A worry in non-bazel\n # mode would be that a moved file may change its full module\n # name without changing its size, mtime or hash.)\n if options.bazel:\n return os.path.relpath(path)\n else:\n return os.path.abspath(path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_CacheMeta_FgDepMeta.TypedDict_FgDepMeta_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_CacheMeta_FgDepMeta.TypedDict_FgDepMeta_", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 295, "end_line": 320, "span_ids": ["impl:8"], "tokens": 283}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "CacheMeta = NamedTuple('CacheMeta',\n [('id', str),\n ('path', str),\n ('mtime', int),\n ('size', int),\n ('hash', str),\n ('dependencies', List[str]), # names of imported modules\n ('data_mtime', int), # mtime of data_json\n ('data_json', str), # path of .data.json\n ('suppressed', List[str]), # dependencies that weren't imported\n ('options', Optional[Dict[str, object]]), # build options\n # dep_prios and dep_lines are in parallel with\n # dependencies + suppressed.\n ('dep_prios', List[int]),\n ('dep_lines', List[int]),\n ('interface_hash', str), # hash representing the public interface\n ('version_id', str), # mypy version for cache invalidation\n ('ignore_all', bool), # if errors were ignored\n ('plugin_data', Any), # config data from plugins\n ])\n# NOTE: dependencies + suppressed == all reachable imports;\n# suppressed contains those reachable imports that were prevented by\n# silent mode or simply not found.\n\n# Metadata for the fine-grained dependencies file associated with a module.\nFgDepMeta = TypedDict('FgDepMeta', {'path': str, 'mtime': int})", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_cache_meta_from_dict_cache_meta_from_dict.return.CacheMeta_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_cache_meta_from_dict_cache_meta_from_dict.return.CacheMeta_", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 323, "end_line": 348, "span_ids": ["cache_meta_from_dict"], "tokens": 234}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def cache_meta_from_dict(meta: Dict[str, Any], data_json: str) -> CacheMeta:\n \"\"\"Build a CacheMeta object from a json metadata dictionary\n\n Args:\n meta: JSON metadata read from the metadata cache file\n data_json: Path to the .data.json file containing the AST trees\n \"\"\"\n sentinel = None # type: Any # Values to be validated by the caller\n return CacheMeta(\n meta.get('id', sentinel),\n meta.get('path', sentinel),\n int(meta['mtime']) if 'mtime' in meta else sentinel,\n meta.get('size', sentinel),\n meta.get('hash', sentinel),\n meta.get('dependencies', []),\n int(meta['data_mtime']) if 'data_mtime' in meta else sentinel,\n data_json,\n meta.get('suppressed', []),\n meta.get('options'),\n meta.get('dep_prios', []),\n meta.get('dep_lines', []),\n meta.get('interface_hash', ''),\n meta.get('version_id', sentinel),\n meta.get('ignore_all', True),\n meta.get('plugin_data', None),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py__Priorities_used_for_imp_import_priority.return.toplevel_priority": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py__Priorities_used_for_imp_import_priority.return.toplevel_priority", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 351, "end_line": 371, "span_ids": ["cache_meta_from_dict", "import_priority", "impl:12"], "tokens": 259}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Priorities used for imports. (Here, top-level includes inside a class.)\n# These are used to determine a more predictable order in which the\n# nodes in an import cycle are processed.\nPRI_HIGH = 5 # type: Final # top-level \"from X import blah\"\nPRI_MED = 10 # type: Final # top-level \"import X\"\nPRI_LOW = 20 # type: Final # either form inside a function\nPRI_MYPY = 25 # type: Final # inside \"if MYPY\" or \"if TYPE_CHECKING\"\nPRI_INDIRECT = 30 # type: Final # an indirect dependency\nPRI_ALL = 99 # type: Final # include all priorities\n\n\ndef import_priority(imp: ImportBase, toplevel_priority: int) -> int:\n \"\"\"Compute import priority from an import node.\"\"\"\n if not imp.is_top_level:\n # Inside a function\n return PRI_LOW\n if imp.is_mypy_only:\n # Inside \"if MYPY\" or \"if typing.TYPE_CHECKING\"\n return max(PRI_MYPY, toplevel_priority)\n # A regular import; priority determined by argument.\n return toplevel_priority", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_load_plugins_from_config_load_plugins_from_config.return.custom_plugins_snapshot": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_load_plugins_from_config_load_plugins_from_config.return.custom_plugins_snapshot", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 374, "end_line": 458, "span_ids": ["load_plugins_from_config"], "tokens": 750}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def load_plugins_from_config(\n options: Options, errors: Errors, stdout: TextIO\n) -> Tuple[List[Plugin], Dict[str, str]]:\n \"\"\"Load all configured plugins.\n\n Return a list of all the loaded plugins from the config file.\n The second return value is a snapshot of versions/hashes of loaded user\n plugins (for cache validation).\n \"\"\"\n import importlib\n snapshot = {} # type: Dict[str, str]\n\n if not options.config_file:\n return [], snapshot\n\n line = find_config_file_line_number(options.config_file, 'mypy', 'plugins')\n if line == -1:\n line = 1 # We need to pick some line number that doesn't look too confusing\n\n def plugin_error(message: str) -> None:\n errors.report(line, 0, message)\n errors.raise_error(use_stdout=False)\n\n custom_plugins = [] # type: List[Plugin]\n errors.set_file(options.config_file, None)\n for plugin_path in options.plugins:\n func_name = 'plugin'\n plugin_dir = None # type: Optional[str]\n if ':' in os.path.basename(plugin_path):\n plugin_path, func_name = plugin_path.rsplit(':', 1)\n if plugin_path.endswith('.py'):\n # Plugin paths can be relative to the config file location.\n plugin_path = os.path.join(os.path.dirname(options.config_file), plugin_path)\n if not os.path.isfile(plugin_path):\n plugin_error(\"Can't find plugin '{}'\".format(plugin_path))\n # Use an absolute path to avoid populating the cache entry\n # for 'tmp' during tests, since it will be different in\n # different tests.\n plugin_dir = os.path.abspath(os.path.dirname(plugin_path))\n fnam = os.path.basename(plugin_path)\n module_name = fnam[:-3]\n sys.path.insert(0, plugin_dir)\n elif re.search(r'[\\\\/]', plugin_path):\n fnam = os.path.basename(plugin_path)\n plugin_error(\"Plugin '{}' does not have a .py extension\".format(fnam))\n else:\n module_name = plugin_path\n\n try:\n module = importlib.import_module(module_name)\n except Exception as exc:\n plugin_error(\"Error importing plugin '{}': {}\".format(plugin_path, exc))\n finally:\n if plugin_dir is not None:\n assert sys.path[0] == plugin_dir\n del sys.path[0]\n\n if not hasattr(module, func_name):\n plugin_error('Plugin \\'{}\\' does not define entry point function \"{}\"'.format(\n plugin_path, func_name))\n\n try:\n plugin_type = getattr(module, func_name)(__version__)\n except Exception:\n print('Error calling the plugin(version) entry point of {}\\n'.format(plugin_path),\n file=stdout)\n raise # Propagate to display traceback\n\n if not isinstance(plugin_type, type):\n plugin_error(\n 'Type object expected as the return value of \"plugin\"; got {!r} (in {})'.format(\n plugin_type, plugin_path))\n if not issubclass(plugin_type, Plugin):\n plugin_error(\n 'Return value of \"plugin\" must be a subclass of \"mypy.plugin.Plugin\" '\n '(in {})'.format(plugin_path))\n try:\n custom_plugins.append(plugin_type(options))\n snapshot[module_name] = take_module_snapshot(module)\n except Exception:\n print('Error constructing plugin instance of {}\\n'.format(plugin_type.__name__),\n file=stdout)\n raise # Propagate to display traceback\n\n return custom_plugins, snapshot", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_load_plugins_load_plugins.return.ChainedPlugin_options_cu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_load_plugins_load_plugins.return.ChainedPlugin_options_cu", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 461, "end_line": 482, "span_ids": ["load_plugins"], "tokens": 175}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def load_plugins(options: Options,\n errors: Errors,\n stdout: TextIO,\n extra_plugins: Sequence[Plugin],\n ) -> Tuple[Plugin, Dict[str, str]]:\n \"\"\"Load all configured plugins.\n\n Return a plugin that encapsulates all plugins chained together. Always\n at least include the default plugin (it's last in the chain).\n The second return value is a snapshot of versions/hashes of loaded user\n plugins (for cache validation).\n \"\"\"\n custom_plugins, snapshot = load_plugins_from_config(options, errors, stdout)\n\n custom_plugins += extra_plugins\n\n default_plugin = DefaultPlugin(options) # type: Plugin\n if not custom_plugins:\n return default_plugin, snapshot\n\n # Custom plugins take precedence over the default plugin.\n return ChainedPlugin(options, custom_plugins + [default_plugin]), snapshot", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_take_module_snapshot_take_module_snapshot.return._format_ver_diges": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_take_module_snapshot_take_module_snapshot.return._format_ver_diges", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 485, "end_line": 497, "span_ids": ["take_module_snapshot"], "tokens": 122}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def take_module_snapshot(module: types.ModuleType) -> str:\n \"\"\"Take plugin module snapshot by recording its version and hash.\n\n We record _both_ hash and the version to detect more possible changes\n (e.g. if there is a change in modules imported by a plugin).\n \"\"\"\n if hasattr(module, '__file__'):\n with open(module.__file__, 'rb') as f:\n digest = hash_digest(f.read())\n else:\n digest = 'unknown'\n ver = getattr(module, '__version__', 'none')\n return '{}:{}'.format(ver, digest)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_find_config_file_line_number_find_config_file_line_number.return._1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_find_config_file_line_number_find_config_file_line_number.return._1", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 500, "end_line": 520, "span_ids": ["find_config_file_line_number"], "tokens": 184}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def find_config_file_line_number(path: str, section: str, setting_name: str) -> int:\n \"\"\"Return the approximate location of setting_name within mypy config file.\n\n Return -1 if can't determine the line unambiguously.\n \"\"\"\n in_desired_section = False\n try:\n results = []\n with open(path) as f:\n for i, line in enumerate(f):\n line = line.strip()\n if line.startswith('[') and line.endswith(']'):\n current_section = line[1:-1].strip()\n in_desired_section = (current_section == section)\n elif in_desired_section and re.match(r'{}\\s*='.format(setting_name), line):\n results.append(i + 1)\n if len(results) == 1:\n return results[0]\n except OSError:\n pass\n return -1", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_BuildManager_BuildManager._This_class_holds_share": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_BuildManager_BuildManager._This_class_holds_share", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 524, "end_line": 566, "span_ids": ["BuildManager"], "tokens": 478}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BuildManager:\n \"\"\"This class holds shared state for building a mypy program.\n\n It is used to coordinate parsing, import processing, semantic\n analysis and type checking. The actual build steps are carried\n out by dispatch().\n\n Attributes:\n data_dir: Mypy data directory (contains stubs)\n search_paths: SearchPaths instance indicating where to look for modules\n modules: Mapping of module ID to MypyFile (shared by the passes)\n semantic_analyzer:\n Semantic analyzer, pass 2\n semantic_analyzer_pass3:\n Semantic analyzer, pass 3\n all_types: Map {Expression: Type} from all modules (enabled by export_types)\n options: Build options\n missing_modules: Set of modules that could not be imported encountered so far\n stale_modules: Set of modules that needed to be rechecked (only used by tests)\n fg_deps_meta: Metadata for fine-grained dependencies caches associated with modules\n fg_deps: A fine-grained dependency map\n version_id: The current mypy version (based on commit id when possible)\n plugin: Active mypy plugin(s)\n plugins_snapshot:\n Snapshot of currently active user plugins (versions and hashes)\n old_plugins_snapshot:\n Plugins snapshot from previous incremental run (or None in\n non-incremental mode and if cache was not found)\n errors: Used for reporting all errors\n flush_errors: A function for processing errors after each SCC\n cache_enabled: Whether cache is being read. This is set based on options,\n but is disabled if fine-grained cache loading fails\n and after an initial fine-grained load. This doesn't\n determine whether we write cache files or not.\n quickstart_state:\n A cache of filename -> mtime/size/hash info used to avoid\n needing to hash source files when using a cache with mismatching mtimes\n stats: Dict with various instrumentation numbers, it is used\n not only for debugging, but also required for correctness,\n in particular to check consistency of the fine-grained dependency cache.\n fscache: A file system cacher\n ast_cache: AST cache to speed up mypy daemon\n \"\"\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_BuildManager.dump_stats_BuildManager.maybe_swap_for_shadow_path.return.shadow_file_if_shadow_fil": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_BuildManager.dump_stats_BuildManager.maybe_swap_for_shadow_path.return.shadow_file_if_shadow_fil", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 646, "end_line": 671, "span_ids": ["BuildManager.use_fine_grained_cache", "BuildManager.dump_stats", "BuildManager.maybe_swap_for_shadow_path"], "tokens": 208}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BuildManager:\n\n def dump_stats(self) -> None:\n if self.options.dump_build_stats:\n print(\"Stats:\")\n for key, value in sorted(self.stats_summary().items()):\n print(\"{:24}{}\".format(key + \":\", value))\n\n def use_fine_grained_cache(self) -> bool:\n return self.cache_enabled and self.options.use_fine_grained_cache\n\n def maybe_swap_for_shadow_path(self, path: str) -> str:\n if not self.shadow_map:\n return path\n\n path = normpath(path, self.options)\n\n previously_checked = path in self.shadow_equivalence_map\n if not previously_checked:\n for source, shadow in self.shadow_map.items():\n if self.fscache.samefile(path, source):\n self.shadow_equivalence_map[path] = shadow\n break\n else:\n self.shadow_equivalence_map[path] = None\n\n shadow_file = self.shadow_equivalence_map.get(path)\n return shadow_file if shadow_file else path", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_BuildManager.get_stat_BuildManager.getmtime.if_self_options_bazel_.else_.return.int_self_metastore_getmti": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_BuildManager.get_stat_BuildManager.getmtime.if_self_options_bazel_.else_.return.int_self_metastore_getmti", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 673, "end_line": 685, "span_ids": ["BuildManager.getmtime", "BuildManager.get_stat"], "tokens": 114}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BuildManager:\n\n def get_stat(self, path: str) -> os.stat_result:\n return self.fscache.stat(self.maybe_swap_for_shadow_path(path))\n\n def getmtime(self, path: str) -> int:\n \"\"\"Return a file's mtime; but 0 in bazel mode.\n\n (Bazel's distributed cache doesn't like filesystem metadata to\n end up in output files.)\n \"\"\"\n if self.options.bazel:\n return 0\n else:\n return int(self.metastore.getmtime(path))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_BuildManager.all_imported_modules_in_file_BuildManager.all_imported_modules_in_file.correct_rel_imp.return.new_id": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_BuildManager.all_imported_modules_in_file_BuildManager.all_imported_modules_in_file.correct_rel_imp.return.new_id", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 687, "end_line": 715, "span_ids": ["BuildManager.all_imported_modules_in_file"], "tokens": 248}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BuildManager:\n\n def all_imported_modules_in_file(self,\n file: MypyFile) -> List[Tuple[int, str, int]]:\n \"\"\"Find all reachable import statements in a file.\n\n Return list of tuples (priority, module id, import line number)\n for all modules imported in file; lower numbers == higher priority.\n\n Can generate blocking errors on bogus relative imports.\n \"\"\"\n\n def correct_rel_imp(imp: Union[ImportFrom, ImportAll]) -> str:\n \"\"\"Function to correct for relative imports.\"\"\"\n file_id = file.fullname\n rel = imp.relative\n if rel == 0:\n return imp.id\n if os.path.basename(file.path).startswith('__init__.'):\n rel -= 1\n if rel != 0:\n file_id = \".\".join(file_id.split(\".\")[:-rel])\n new_id = file_id + \".\" + imp.id if imp.id else file_id\n\n if not new_id:\n self.errors.set_file(file.path, file.name)\n self.errors.report(imp.line, 0,\n \"No parent module -- cannot perform relative import\",\n blocker=True)\n\n return new_id\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_BuildManager.all_imported_modules_in_file.res_BuildManager.all_imported_modules_in_file.return.res": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_BuildManager.all_imported_modules_in_file.res_BuildManager.all_imported_modules_in_file.return.res", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 717, "end_line": 762, "span_ids": ["BuildManager.all_imported_modules_in_file"], "tokens": 523}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BuildManager:\n\n def all_imported_modules_in_file(self,\n file: MypyFile) -> List[Tuple[int, str, int]]:\n # ... other code\n\n res = [] # type: List[Tuple[int, str, int]]\n for imp in file.imports:\n if not imp.is_unreachable:\n if isinstance(imp, Import):\n pri = import_priority(imp, PRI_MED)\n ancestor_pri = import_priority(imp, PRI_LOW)\n for id, _ in imp.ids:\n # We append the target (e.g. foo.bar.baz)\n # before the ancestors (e.g. foo and foo.bar)\n # so that, if FindModuleCache finds the target\n # module in a package marked with py.typed\n # underneath a namespace package installed in\n # site-packages, (gasp), that cache's\n # knowledge of the ancestors can be primed\n # when it is asked to find the target.\n res.append((pri, id, imp.line))\n ancestor_parts = id.split(\".\")[:-1]\n ancestors = []\n for part in ancestor_parts:\n ancestors.append(part)\n res.append((ancestor_pri, \".\".join(ancestors), imp.line))\n elif isinstance(imp, ImportFrom):\n cur_id = correct_rel_imp(imp)\n pos = len(res)\n all_are_submodules = True\n # Also add any imported names that are submodules.\n pri = import_priority(imp, PRI_MED)\n for name, __ in imp.names:\n sub_id = cur_id + '.' + name\n if self.is_module(sub_id):\n res.append((pri, sub_id, imp.line))\n else:\n all_are_submodules = False\n # Add cur_id as a dependency, even if all of the\n # imports are submodules. Processing import from will try\n # to look through cur_id, so we should depend on it.\n # As a workaround for for some bugs in cycle handling (#4498),\n # if all of the imports are submodules, do the import at a lower\n # priority.\n pri = import_priority(imp, PRI_HIGH if not all_are_submodules else PRI_LOW)\n res.insert(pos, ((pri, cur_id, imp.line)))\n elif isinstance(imp, ImportAll):\n pri = import_priority(imp, PRI_HIGH)\n res.append((pri, correct_rel_imp(imp), imp.line))\n\n return res", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_BuildManager.is_module_BuildManager.parse_file.return.tree": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_BuildManager.is_module_BuildManager.parse_file.return.tree", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 764, "end_line": 787, "span_ids": ["BuildManager.is_module", "BuildManager.parse_file"], "tokens": 218}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BuildManager:\n\n def is_module(self, id: str) -> bool:\n \"\"\"Is there a file in the file system corresponding to module id?\"\"\"\n return find_module_simple(id, self) is not None\n\n def parse_file(self, id: str, path: str, source: str, ignore_errors: bool,\n options: Options) -> MypyFile:\n \"\"\"Parse the source of a file with the given name.\n\n Raise CompileError if there is a parse error.\n \"\"\"\n t0 = time.time()\n tree = parse(source, path, id, self.errors, options=options)\n tree._fullname = id\n self.add_stats(files_parsed=1,\n modules_parsed=int(not tree.is_stub),\n stubs_parsed=int(tree.is_stub),\n parse_time=time.time() - t0)\n\n if self.errors.is_blockers():\n self.log(\"Bailing due to parse errors\")\n self.errors.raise_error()\n\n self.errors.set_file_ignored_lines(path, tree.ignored_lines, ignore_errors)\n return tree", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_BuildManager.load_fine_grained_deps_BuildManager.load_fine_grained_deps.return.val": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_BuildManager.load_fine_grained_deps_BuildManager.load_fine_grained_deps.return.val", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 789, "end_line": 798, "span_ids": ["BuildManager.load_fine_grained_deps"], "tokens": 114}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BuildManager:\n\n def load_fine_grained_deps(self, id: str) -> Dict[str, Set[str]]:\n t0 = time.time()\n if id in self.fg_deps_meta:\n # TODO: Assert deps file wasn't changed.\n deps = json.loads(self.metastore.read(self.fg_deps_meta[id]['path']))\n else:\n deps = {}\n val = {k: set(v) for k, v in deps.items()}\n self.add_stats(load_fg_deps_time=time.time() - t0)\n return val", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_BuildManager.report_file_BuildManager.stats_summary.return.self_stats": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_BuildManager.report_file_BuildManager.stats_summary.return.self_stats", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 800, "end_line": 843, "span_ids": ["BuildManager.add_stats", "BuildManager.log", "BuildManager.stats_summary", "BuildManager.trace", "BuildManager.report_file", "BuildManager.log_fine_grained", "BuildManager.verbosity"], "tokens": 337}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BuildManager:\n\n def report_file(self,\n file: MypyFile,\n type_map: Dict[Expression, Type],\n options: Options) -> None:\n if self.reports is not None and self.source_set.is_source(file):\n self.reports.file(file, self.modules, type_map, options)\n\n def verbosity(self) -> int:\n return self.options.verbosity\n\n def log(self, *message: str) -> None:\n if self.verbosity() >= 1:\n if message:\n print('LOG: ', *message, file=self.stderr)\n else:\n print(file=self.stderr)\n self.stderr.flush()\n\n def log_fine_grained(self, *message: str) -> None:\n import mypy.build\n if self.verbosity() >= 1:\n self.log('fine-grained:', *message)\n elif mypy.build.DEBUG_FINE_GRAINED:\n # Output log in a simplified format that is quick to browse.\n if message:\n print(*message, file=self.stderr)\n else:\n print(file=self.stderr)\n self.stderr.flush()\n\n def trace(self, *message: str) -> None:\n if self.verbosity() >= 2:\n print('TRACE:', *message, file=self.stderr)\n self.stderr.flush()\n\n def add_stats(self, **kwds: Any) -> None:\n for key, value in kwds.items():\n if key in self.stats:\n self.stats[key] += value\n else:\n self.stats[key] = value\n\n def stats_summary(self) -> Mapping[str, object]:\n return self.stats", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_deps_to_json_FAKE_ROOT_MODULE._root_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_deps_to_json_FAKE_ROOT_MODULE._root_", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 846, "end_line": 857, "span_ids": ["impl:24", "deps_to_json"], "tokens": 130}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def deps_to_json(x: Dict[str, Set[str]]) -> str:\n return json.dumps({k: list(v) for k, v in x.items()})\n\n\n# File for storing metadata about all the fine-grained dependency caches\nDEPS_META_FILE = '@deps.meta.json' # type: Final\n# File for storing fine-grained dependencies that didn't a parent in the build\nDEPS_ROOT_FILE = '@root.deps.json' # type: Final\n\n# The name of the fake module used to store fine-grained dependencies that\n# have no other place to go.\nFAKE_ROOT_MODULE = '@root'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_None_28_write_deps_cache.if_error_.manager_errors_report_0_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_None_28_write_deps_cache.if_error_.manager_errors_report_0_", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 857, "end_line": 921, "span_ids": ["impl:24", "write_deps_cache"], "tokens": 616}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": " # type: Final\n\n\ndef write_deps_cache(rdeps: Dict[str, Dict[str, Set[str]]],\n manager: BuildManager, graph: Graph) -> None:\n \"\"\"Write cache files for fine-grained dependencies.\n\n Serialize fine-grained dependencies map for fine grained mode.\n\n Dependencies on some module 'm' is stored in the dependency cache\n file m.deps.json. This entails some spooky action at a distance:\n if module 'n' depends on 'm', that produces entries in m.deps.json.\n When there is a dependency on a module that does not exist in the\n build, it is stored with its first existing parent module. If no\n such module exists, it is stored with the fake module FAKE_ROOT_MODULE.\n\n This means that the validity of the fine-grained dependency caches\n are a global property, so we store validity checking information for\n fine-grained dependencies in a global cache file:\n * We take a snapshot of current sources to later check consistency\n between the fine-grained dependency cache and module cache metadata\n * We store the mtime of all of the dependency files to verify they\n haven't changed\n \"\"\"\n metastore = manager.metastore\n\n error = False\n\n fg_deps_meta = manager.fg_deps_meta.copy()\n\n for id in rdeps:\n if id != FAKE_ROOT_MODULE:\n _, _, deps_json = get_cache_names(id, graph[id].xpath, manager.options)\n else:\n deps_json = DEPS_ROOT_FILE\n assert deps_json\n manager.log(\"Writing deps cache\", deps_json)\n if not manager.metastore.write(deps_json, deps_to_json(rdeps[id])):\n manager.log(\"Error writing fine-grained deps JSON file {}\".format(deps_json))\n error = True\n else:\n fg_deps_meta[id] = {'path': deps_json, 'mtime': manager.getmtime(deps_json)}\n\n meta_snapshot = {} # type: Dict[str, str]\n for id, st in graph.items():\n # If we didn't parse a file (so it doesn't have a\n # source_hash), then it must be a module with a fresh cache,\n # so use the hash from that.\n if st.source_hash:\n hash = st.source_hash\n else:\n assert st.meta, \"Module must be either parsed or cached\"\n hash = st.meta.hash\n meta_snapshot[id] = hash\n\n meta = {'snapshot': meta_snapshot, 'deps_meta': fg_deps_meta}\n\n if not metastore.write(DEPS_META_FILE, json.dumps(meta)):\n manager.log(\"Error writing fine-grained deps meta JSON file {}\".format(DEPS_META_FILE))\n error = True\n\n if error:\n manager.errors.set_file(_cache_dir_prefix(manager.options), None)\n manager.errors.report(0, 0, \"Error writing fine-grained dependencies cache\",\n blocker=True)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_invert_deps_invert_deps.return.rdeps": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_invert_deps_invert_deps.return.rdeps", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 924, "end_line": 948, "span_ids": ["invert_deps"], "tokens": 263}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def invert_deps(deps: Dict[str, Set[str]],\n graph: Graph) -> Dict[str, Dict[str, Set[str]]]:\n \"\"\"Splits fine-grained dependencies based on the module of the trigger.\n\n Returns a dictionary from module ids to all dependencies on that\n module. Dependencies not associated with a module in the build will be\n associated with the nearest parent module that is in the build, or the\n fake module FAKE_ROOT_MODULE if none are.\n \"\"\"\n # Lazy import to speed up startup\n from mypy.server.target import trigger_to_target\n\n # Prepopulate the map for all the modules that have been processed,\n # so that we always generate files for processed modules (even if\n # there aren't any dependencies to them.)\n rdeps = {id: {} for id, st in graph.items() if st.tree} # type: Dict[str, Dict[str, Set[str]]]\n for trigger, targets in deps.items():\n module = module_prefix(graph, trigger_to_target(trigger))\n if not module or not graph[module].tree:\n module = FAKE_ROOT_MODULE\n\n mod_rdeps = rdeps.setdefault(module, {})\n mod_rdeps.setdefault(trigger, set()).update(targets)\n\n return rdeps", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_generate_deps_for_cache_generate_deps_for_cache.return.rdeps": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_generate_deps_for_cache_generate_deps_for_cache.return.rdeps", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 951, "end_line": 977, "span_ids": ["generate_deps_for_cache"], "tokens": 274}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_deps_for_cache(manager: BuildManager,\n graph: Graph) -> Dict[str, Dict[str, Set[str]]]:\n \"\"\"Generate fine-grained dependencies into a form suitable for serializing.\n\n This does a couple things:\n 1. Splits fine-grained deps based on the module of the trigger\n 2. For each module we generated fine-grained deps for, load any previous\n deps and merge them in.\n\n Returns a dictionary from module ids to all dependencies on that\n module. Dependencies not associated with a module in the build will be\n associated with the nearest parent module that is in the build, or the\n fake module FAKE_ROOT_MODULE if none are.\n \"\"\"\n from mypy.server.deps import merge_dependencies # Lazy import to speed up startup\n\n # Split the dependencies out into based on the module that is depended on.\n rdeps = invert_deps(manager.fg_deps, graph)\n\n # We can't just clobber existing dependency information, so we\n # load the deps for every module we've generated new dependencies\n # to and merge the new deps into them.\n for module, mdeps in rdeps.items():\n old_deps = manager.load_fine_grained_deps(module)\n merge_dependencies(old_deps, mdeps)\n\n return rdeps", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_PLUGIN_SNAPSHOT_FILE_read_plugins_snapshot.return.snapshot": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_PLUGIN_SNAPSHOT_FILE_read_plugins_snapshot.return.snapshot", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 980, "end_line": 1002, "span_ids": ["impl:30", "read_plugins_snapshot", "write_plugins_snapshot"], "tokens": 209}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "PLUGIN_SNAPSHOT_FILE = '@plugins_snapshot.json' # type: Final\n\n\ndef write_plugins_snapshot(manager: BuildManager) -> None:\n \"\"\"Write snapshot of versions and hashes of currently active plugins.\"\"\"\n if not manager.metastore.write(PLUGIN_SNAPSHOT_FILE, json.dumps(manager.plugins_snapshot)):\n manager.errors.set_file(_cache_dir_prefix(manager.options), None)\n manager.errors.report(0, 0, \"Error writing plugins snapshot\",\n blocker=True)\n\n\ndef read_plugins_snapshot(manager: BuildManager) -> Optional[Dict[str, str]]:\n \"\"\"Read cached snapshot of versions and hashes of plugins from previous run.\"\"\"\n snapshot = _load_json_file(PLUGIN_SNAPSHOT_FILE, manager,\n log_success='Plugins snapshot ',\n log_error='Could not load plugins snapshot: ')\n if snapshot is None:\n return None\n if not isinstance(snapshot, dict):\n manager.log('Could not load plugins snapshot: cache is not a dict: {}'\n .format(type(snapshot)))\n return None\n return snapshot", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_read_quickstart_file_read_quickstart_file.return.quickstart": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_read_quickstart_file_read_quickstart_file.return.quickstart", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1005, "end_line": 1022, "span_ids": ["read_quickstart_file"], "tokens": 192}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def read_quickstart_file(options: Options,\n stdout: TextIO,\n ) -> Optional[Dict[str, Tuple[float, int, str]]]:\n quickstart = None # type: Optional[Dict[str, Tuple[float, int, str]]]\n if options.quickstart_file:\n # This is very \"best effort\". If the file is missing or malformed,\n # just ignore it.\n raw_quickstart = {} # type: Dict[str, Any]\n try:\n with open(options.quickstart_file, \"r\") as f:\n raw_quickstart = json.load(f)\n\n quickstart = {}\n for file, (x, y, z) in raw_quickstart.items():\n quickstart[file] = (x, y, z)\n except Exception as e:\n print(\"Warning: Failed to load quickstart file: {}\\n\".format(str(e)), file=stdout)\n return quickstart", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_read_deps_cache_read_deps_cache.return.module_deps_metas": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_read_deps_cache_read_deps_cache.return.module_deps_metas", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1025, "end_line": 1063, "span_ids": ["read_deps_cache"], "tokens": 367}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def read_deps_cache(manager: BuildManager,\n graph: Graph) -> Optional[Dict[str, FgDepMeta]]:\n \"\"\"Read and validate the fine-grained dependencies cache.\n\n See the write_deps_cache documentation for more information on\n the details of the cache.\n\n Returns None if the cache was invalid in some way.\n \"\"\"\n deps_meta = _load_json_file(DEPS_META_FILE, manager,\n log_success='Deps meta ',\n log_error='Could not load fine-grained dependency metadata: ')\n if deps_meta is None:\n return None\n meta_snapshot = deps_meta['snapshot']\n # Take a snapshot of the source hashes from all of the metas we found.\n # (Including the ones we rejected because they were out of date.)\n # We use this to verify that they match up with the proto_deps.\n current_meta_snapshot = {id: st.meta_source_hash for id, st in graph.items()\n if st.meta_source_hash is not None}\n\n common = set(meta_snapshot.keys()) & set(current_meta_snapshot.keys())\n if any(meta_snapshot[id] != current_meta_snapshot[id] for id in common):\n # TODO: invalidate also if options changed (like --strict-optional)?\n manager.log('Fine-grained dependencies cache inconsistent, ignoring')\n return None\n\n module_deps_metas = deps_meta['deps_meta']\n if not manager.options.skip_cache_mtime_checks:\n for id, meta in module_deps_metas.items():\n try:\n matched = manager.getmtime(meta['path']) == meta['mtime']\n except FileNotFoundError:\n matched = False\n if not matched:\n manager.log('Invalid or missing fine-grained deps cache: {}'.format(meta['path']))\n return None\n\n return module_deps_metas", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py__load_json_file__load_json_file.None_1.else_.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py__load_json_file__load_json_file.None_1.else_.return.result", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1066, "end_line": 1093, "span_ids": ["_load_json_file"], "tokens": 249}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _load_json_file(file: str, manager: BuildManager,\n log_success: str, log_error: str) -> Optional[Dict[str, Any]]:\n \"\"\"A simple helper to read a JSON file with logging.\"\"\"\n t0 = time.time()\n try:\n data = manager.metastore.read(file)\n except IOError:\n manager.log(log_error + file)\n return None\n manager.add_stats(metastore_read_time=time.time() - t0)\n # Only bother to compute the log message if we are logging it, since it could be big\n if manager.verbosity() >= 2:\n manager.trace(log_success + data.rstrip())\n try:\n result = json.loads(data)\n except ValueError: # TODO: JSONDecodeError in 3.5\n manager.errors.set_file(file, None)\n manager.errors.report(-1, -1,\n \"Error reading JSON file;\"\n \" you likely have a bad cache.\\n\"\n \"Try removing the {cache_dir} directory\"\n \" and run mypy again.\".format(\n cache_dir=manager.options.cache_dir\n ),\n blocker=True)\n return None\n else:\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py__cache_dir_prefix_add_catch_all_gitignore.try_.except_FileExistsError_.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py__cache_dir_prefix_add_catch_all_gitignore.try_.except_FileExistsError_.pass", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1096, "end_line": 1118, "span_ids": ["add_catch_all_gitignore", "_cache_dir_prefix"], "tokens": 186}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _cache_dir_prefix(options: Options) -> str:\n \"\"\"Get current cache directory (or file if id is given).\"\"\"\n if options.bazel:\n # This is needed so the cache map works.\n return os.curdir\n cache_dir = options.cache_dir\n pyversion = options.python_version\n base = os.path.join(cache_dir, '%d.%d' % pyversion)\n return base\n\n\ndef add_catch_all_gitignore(target_dir: str) -> None:\n \"\"\"Add catch-all .gitignore to an existing directory.\n\n No-op if the .gitignore already exists.\n \"\"\"\n gitignore = os.path.join(target_dir, \".gitignore\")\n try:\n with open(gitignore, \"x\") as f:\n print(\"# Automatically created by mypy\", file=f)\n print(\"*\", file=f)\n except FileExistsError:\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_exclude_from_backups_create_metastore.return.mds": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_exclude_from_backups_create_metastore.return.mds", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1133, "end_line": 1155, "span_ids": ["exclude_from_backups", "create_metastore"], "tokens": 215}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def exclude_from_backups(target_dir: str) -> None:\n \"\"\"Exclude the directory from various archives and backups supporting CACHEDIR.TAG.\n\n If the CACHEDIR.TAG file exists the function is a no-op.\n \"\"\"\n cachedir_tag = os.path.join(target_dir, \"CACHEDIR.TAG\")\n try:\n with open(cachedir_tag, \"x\") as f:\n f.write(\"\"\"Signature: 8a477f597d28d172789f06886806bc55\n# This file is a cache directory tag automatically created by mypy.\n# For information about cache directory tags see https://bford.info/cachedir/\n\"\"\")\n except FileExistsError:\n pass\n\n\ndef create_metastore(options: Options) -> MetadataStore:\n \"\"\"Create the appropriate metadata store.\"\"\"\n if options.sqlite_cache:\n mds = SqliteMetadataStore(_cache_dir_prefix(options)) # type: MetadataStore\n else:\n mds = FilesystemMetadataStore(_cache_dir_prefix(options))\n return mds", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_get_cache_names_get_cache_names.return._prefix_meta_json_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_get_cache_names_get_cache_names.return._prefix_meta_json_p", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1146, "end_line": 1179, "span_ids": ["get_cache_names"], "tokens": 320}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_cache_names(id: str, path: str, options: Options) -> Tuple[str, str, Optional[str]]:\n \"\"\"Return the file names for the cache files.\n\n Args:\n id: module ID\n path: module path\n cache_dir: cache directory\n pyversion: Python version (major, minor)\n\n Returns:\n A tuple with the file names to be used for the meta JSON, the\n data JSON, and the fine-grained deps JSON, respectively.\n \"\"\"\n if options.cache_map:\n pair = options.cache_map.get(normpath(path, options))\n else:\n pair = None\n if pair is not None:\n # The cache map paths were specified relative to the base directory,\n # but the filesystem metastore APIs operates relative to the cache\n # prefix directory.\n # Solve this by rewriting the paths as relative to the root dir.\n # This only makes sense when using the filesystem backed cache.\n root = _cache_dir_prefix(options)\n return (os.path.relpath(pair[0], root), os.path.relpath(pair[1], root), None)\n prefix = os.path.join(*id.split('.'))\n is_package = os.path.basename(path).startswith('__init__.py')\n if is_package:\n prefix = os.path.join(prefix, '__init__')\n\n deps_json = None\n if options.cache_fine_grained:\n deps_json = prefix + '.deps.json'\n return (prefix + '.meta.json', prefix + '.data.json', deps_json)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_find_cache_meta_find_cache_meta.return.m": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_find_cache_meta_find_cache_meta.return.m", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1182, "end_line": 1263, "span_ids": ["find_cache_meta"], "tokens": 834}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def find_cache_meta(id: str, path: str, manager: BuildManager) -> Optional[CacheMeta]:\n \"\"\"Find cache data for a module.\n\n Args:\n id: module ID\n path: module path\n manager: the build manager (for pyversion, log/trace, and build options)\n\n Returns:\n A CacheMeta instance if the cache data was found and appears\n valid; otherwise None.\n \"\"\"\n # TODO: May need to take more build options into account\n meta_json, data_json, _ = get_cache_names(id, path, manager.options)\n manager.trace('Looking for {} at {}'.format(id, meta_json))\n t0 = time.time()\n meta = _load_json_file(meta_json, manager,\n log_success='Meta {} '.format(id),\n log_error='Could not load cache for {}: '.format(id))\n t1 = time.time()\n if meta is None:\n return None\n if not isinstance(meta, dict):\n manager.log('Could not load cache for {}: meta cache is not a dict: {}'\n .format(id, repr(meta)))\n return None\n m = cache_meta_from_dict(meta, data_json)\n t2 = time.time()\n manager.add_stats(load_meta_time=t2 - t0,\n load_meta_load_time=t1 - t0,\n load_meta_from_dict_time=t2 - t1)\n\n # Don't check for path match, that is dealt with in validate_meta().\n if (m.id != id or\n m.mtime is None or m.size is None or\n m.dependencies is None or m.data_mtime is None):\n manager.log('Metadata abandoned for {}: attributes are missing'.format(id))\n return None\n\n # Ignore cache if generated by an older mypy version.\n if ((m.version_id != manager.version_id and not manager.options.skip_version_check)\n or m.options is None\n or len(m.dependencies) + len(m.suppressed) != len(m.dep_prios)\n or len(m.dependencies) + len(m.suppressed) != len(m.dep_lines)):\n manager.log('Metadata abandoned for {}: new attributes are missing'.format(id))\n return None\n\n # Ignore cache if (relevant) options aren't the same.\n # Note that it's fine to mutilate cached_options since it's only used here.\n cached_options = m.options\n current_options = manager.options.clone_for_module(id).select_options_affecting_cache()\n if manager.options.skip_version_check:\n # When we're lax about version we're also lax about platform.\n cached_options['platform'] = current_options['platform']\n if 'debug_cache' in cached_options:\n # Older versions included debug_cache, but it's silly to compare it.\n del cached_options['debug_cache']\n if cached_options != current_options:\n manager.log('Metadata abandoned for {}: options differ'.format(id))\n if manager.options.verbosity >= 2:\n for key in sorted(set(cached_options) | set(current_options)):\n if cached_options.get(key) != current_options.get(key):\n manager.trace(' {}: {} != {}'\n .format(key, cached_options.get(key), current_options.get(key)))\n return None\n if manager.old_plugins_snapshot and manager.plugins_snapshot:\n # Check if plugins are still the same.\n if manager.plugins_snapshot != manager.old_plugins_snapshot:\n manager.log('Metadata abandoned for {}: plugins differ'.format(id))\n return None\n # So that plugins can return data with tuples in it without\n # things silently always invalidating modules, we round-trip\n # the config data. This isn't beautiful.\n plugin_data = json.loads(json.dumps(\n manager.plugin.report_config_data(ReportConfigContext(id, path, is_check=True))\n ))\n if m.plugin_data != plugin_data:\n manager.log('Metadata abandoned for {}: plugin configuration differs'.format(id))\n return None\n\n manager.add_stats(fresh_metas=1)\n return m", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_validate_meta_validate_meta.mtime.0_if_bazel_else_int_st_st": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_validate_meta_validate_meta.mtime.0_if_bazel_else_int_st_st", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1266, "end_line": 1334, "span_ids": ["validate_meta"], "tokens": 721}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def validate_meta(meta: Optional[CacheMeta], id: str, path: Optional[str],\n ignore_all: bool, manager: BuildManager) -> Optional[CacheMeta]:\n '''Checks whether the cached AST of this module can be used.\n\n Returns:\n None, if the cached AST is unusable.\n Original meta, if mtime/size matched.\n Meta with mtime updated to match source file, if hash/size matched but mtime/path didn't.\n '''\n # This requires two steps. The first one is obvious: we check that the module source file\n # contents is the same as it was when the cache data file was created. The second one is not\n # too obvious: we check that the cache data file mtime has not changed; it is needed because\n # we use cache data file mtime to propagate information about changes in the dependencies.\n\n if meta is None:\n manager.log('Metadata not found for {}'.format(id))\n return None\n\n if meta.ignore_all and not ignore_all:\n manager.log('Metadata abandoned for {}: errors were previously ignored'.format(id))\n return None\n\n t0 = time.time()\n bazel = manager.options.bazel\n assert path is not None, \"Internal error: meta was provided without a path\"\n if not manager.options.skip_cache_mtime_checks:\n # Check data_json; assume if its mtime matches it's good.\n # TODO: stat() errors\n data_mtime = manager.getmtime(meta.data_json)\n if data_mtime != meta.data_mtime:\n manager.log('Metadata abandoned for {}: data cache is modified'.format(id))\n return None\n\n if bazel:\n # Normalize path under bazel to make sure it isn't absolute\n path = normpath(path, manager.options)\n try:\n st = manager.get_stat(path)\n except OSError:\n return None\n if not stat.S_ISREG(st.st_mode):\n manager.log('Metadata abandoned for {}: file {} does not exist'.format(id, path))\n return None\n\n manager.add_stats(validate_stat_time=time.time() - t0)\n\n # When we are using a fine-grained cache, we want our initial\n # build() to load all of the cache information and then do a\n # fine-grained incremental update to catch anything that has\n # changed since the cache was generated. We *don't* want to do a\n # coarse-grained incremental rebuild, so we accept the cache\n # metadata even if it doesn't match the source file.\n #\n # We still *do* the mtime/hash checks, however, to enable\n # fine-grained mode to take advantage of the mtime-updating\n # optimization when mtimes differ but hashes match. There is\n # essentially no extra time cost to computing the hash here, since\n # it will be cached and will be needed for finding changed files\n # later anyways.\n fine_grained_cache = manager.use_fine_grained_cache()\n\n size = st.st_size\n # Bazel ensures the cache is valid.\n if size != meta.size and not bazel and not fine_grained_cache:\n manager.log('Metadata abandoned for {}: file {} has different size'.format(id, path))\n return None\n\n # Bazel ensures the cache is valid.\n mtime = 0 if bazel else int(st.st_mtime)\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_validate_meta.if_not_bazel_and_mtime__validate_meta.return.meta": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_validate_meta.if_not_bazel_and_mtime__validate_meta.return.meta", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1335, "end_line": 1399, "span_ids": ["validate_meta"], "tokens": 729}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def validate_meta(meta: Optional[CacheMeta], id: str, path: Optional[str],\n ignore_all: bool, manager: BuildManager) -> Optional[CacheMeta]:\n # ... other code\n if not bazel and (mtime != meta.mtime or path != meta.path):\n if manager.quickstart_state and path in manager.quickstart_state:\n # If the mtime and the size of the file recorded in the quickstart dump matches\n # what we see on disk, we know (assume) that the hash matches the quickstart\n # data as well. If that hash matches the hash in the metadata, then we know\n # the file is up to date even though the mtime is wrong, without needing to hash it.\n qmtime, qsize, qhash = manager.quickstart_state[path]\n if int(qmtime) == mtime and qsize == size and qhash == meta.hash:\n manager.log('Metadata fresh (by quickstart) for {}: file {}'.format(id, path))\n meta = meta._replace(mtime=mtime, path=path)\n return meta\n\n t0 = time.time()\n try:\n source_hash = manager.fscache.hash_digest(path)\n except (OSError, UnicodeDecodeError, DecodeError):\n return None\n manager.add_stats(validate_hash_time=time.time() - t0)\n if source_hash != meta.hash:\n if fine_grained_cache:\n manager.log('Using stale metadata for {}: file {}'.format(id, path))\n return meta\n else:\n manager.log('Metadata abandoned for {}: file {} has different hash'.format(\n id, path))\n return None\n else:\n t0 = time.time()\n # Optimization: update mtime and path (otherwise, this mismatch will reappear).\n meta = meta._replace(mtime=mtime, path=path)\n # Construct a dict we can pass to json.dumps() (compare to write_cache()).\n meta_dict = {\n 'id': id,\n 'path': path,\n 'mtime': mtime,\n 'size': size,\n 'hash': source_hash,\n 'data_mtime': meta.data_mtime,\n 'dependencies': meta.dependencies,\n 'suppressed': meta.suppressed,\n 'options': (manager.options.clone_for_module(id)\n .select_options_affecting_cache()),\n 'dep_prios': meta.dep_prios,\n 'dep_lines': meta.dep_lines,\n 'interface_hash': meta.interface_hash,\n 'version_id': manager.version_id,\n 'ignore_all': meta.ignore_all,\n 'plugin_data': meta.plugin_data,\n }\n if manager.options.debug_cache:\n meta_str = json.dumps(meta_dict, indent=2, sort_keys=True)\n else:\n meta_str = json.dumps(meta_dict)\n meta_json, _, _ = get_cache_names(id, path, manager.options)\n manager.log('Updating mtime for {}: file {}, meta {}, mtime {}'\n .format(id, path, meta_json, meta.mtime))\n t1 = time.time()\n manager.metastore.write(meta_json, meta_str) # Ignore errors, just an optimization.\n manager.add_stats(validate_update_time=time.time() - t1,\n validate_munging_time=t1 - t0)\n return meta\n\n # It's a match on (id, path, size, hash, mtime).\n manager.log('Metadata fresh for {}: file {}'.format(id, path))\n return meta", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_compute_hash_json_dumps.if_debug_cache_.else_.return.json_dumps_obj_sort_keys": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_compute_hash_json_dumps.if_debug_cache_.else_.return.json_dumps_obj_sort_keys", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1402, "end_line": 1415, "span_ids": ["json_dumps", "compute_hash"], "tokens": 144}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def compute_hash(text: str) -> str:\n # We use a crypto hash instead of the builtin hash(...) function\n # because the output of hash(...) can differ between runs due to\n # hash randomization (enabled by default in Python 3.3). See the\n # note in\n # https://docs.python.org/3/reference/datamodel.html#object.__hash__.\n return hash_digest(text.encode('utf-8'))\n\n\ndef json_dumps(obj: Any, debug_cache: bool) -> str:\n if debug_cache:\n return json.dumps(obj, indent=2, sort_keys=True)\n else:\n return json.dumps(obj, sort_keys=True)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_write_cache_write_cache._Note_that_for_Bazel_we_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_write_cache_write_cache._Note_that_for_Bazel_we_", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1418, "end_line": 1484, "span_ids": ["write_cache"], "tokens": 597}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def write_cache(id: str, path: str, tree: MypyFile,\n dependencies: List[str], suppressed: List[str],\n dep_prios: List[int], dep_lines: List[int],\n old_interface_hash: str, source_hash: str,\n ignore_all: bool, manager: BuildManager) -> Tuple[str, Optional[CacheMeta]]:\n \"\"\"Write cache files for a module.\n\n Note that this mypy's behavior is still correct when any given\n write_cache() call is replaced with a no-op, so error handling\n code that bails without writing anything is okay.\n\n Args:\n id: module ID\n path: module path\n tree: the fully checked module data\n dependencies: module IDs on which this module depends\n suppressed: module IDs which were suppressed as dependencies\n dep_prios: priorities (parallel array to dependencies)\n dep_lines: import line locations (parallel array to dependencies)\n old_interface_hash: the hash from the previous version of the data cache file\n source_hash: the hash of the source code\n ignore_all: the ignore_all flag for this module\n manager: the build manager (for pyversion, log/trace)\n\n Returns:\n A tuple containing the interface hash and CacheMeta\n corresponding to the metadata that was written (the latter may\n be None if the cache could not be written).\n \"\"\"\n metastore = manager.metastore\n # For Bazel we use relative paths and zero mtimes.\n bazel = manager.options.bazel\n\n # Obtain file paths.\n meta_json, data_json, _ = get_cache_names(id, path, manager.options)\n manager.log('Writing {} {} {} {}'.format(\n id, path, meta_json, data_json))\n\n # Update tree.path so that in bazel mode it's made relative (since\n # sometimes paths leak out).\n if bazel:\n tree.path = path\n\n # Serialize data and analyze interface\n data = tree.serialize()\n data_str = json_dumps(data, manager.options.debug_cache)\n interface_hash = compute_hash(data_str)\n\n plugin_data = manager.plugin.report_config_data(ReportConfigContext(id, path, is_check=False))\n\n # Obtain and set up metadata\n try:\n st = manager.get_stat(path)\n except OSError as err:\n manager.log(\"Cannot get stat for {}: {}\".format(path, err))\n # Remove apparently-invalid cache files.\n # (This is purely an optimization.)\n for filename in [data_json, meta_json]:\n try:\n os.remove(filename)\n except OSError:\n pass\n # Still return the interface hash we computed.\n return interface_hash, None\n\n # Write data cache file, if applicable\n # Note that for Bazel we don't record the data file's mtime.\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_write_cache.if_old_interface_hash__write_cache.return.interface_hash_cache_met": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_write_cache.if_old_interface_hash__write_cache.return.interface_hash_cache_met", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1485, "end_line": 1541, "span_ids": ["write_cache"], "tokens": 669}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def write_cache(id: str, path: str, tree: MypyFile,\n dependencies: List[str], suppressed: List[str],\n dep_prios: List[int], dep_lines: List[int],\n old_interface_hash: str, source_hash: str,\n ignore_all: bool, manager: BuildManager) -> Tuple[str, Optional[CacheMeta]]:\n # ... other code\n if old_interface_hash == interface_hash:\n # If the interface is unchanged, the cached data is guaranteed\n # to be equivalent, and we only need to update the metadata.\n data_mtime = manager.getmtime(data_json)\n manager.trace(\"Interface for {} is unchanged\".format(id))\n else:\n manager.trace(\"Interface for {} has changed\".format(id))\n if not metastore.write(data_json, data_str):\n # Most likely the error is the replace() call\n # (see https://github.com/python/mypy/issues/3215).\n manager.log(\"Error writing data JSON file {}\".format(data_json))\n # Let's continue without writing the meta file. Analysis:\n # If the replace failed, we've changed nothing except left\n # behind an extraneous temporary file; if the replace\n # worked but the getmtime() call failed, the meta file\n # will be considered invalid on the next run because the\n # data_mtime field won't match the data file's mtime.\n # Both have the effect of slowing down the next run a\n # little bit due to an out-of-date cache file.\n return interface_hash, None\n data_mtime = manager.getmtime(data_json)\n\n mtime = 0 if bazel else int(st.st_mtime)\n size = st.st_size\n # Note that the options we store in the cache are the options as\n # specified by the command line/config file and *don't* reflect\n # updates made by inline config directives in the file. This is\n # important, or otherwise the options would never match when\n # verifying the cache.\n options = manager.options.clone_for_module(id)\n assert source_hash is not None\n meta = {'id': id,\n 'path': path,\n 'mtime': mtime,\n 'size': size,\n 'hash': source_hash,\n 'data_mtime': data_mtime,\n 'dependencies': dependencies,\n 'suppressed': suppressed,\n 'options': options.select_options_affecting_cache(),\n 'dep_prios': dep_prios,\n 'dep_lines': dep_lines,\n 'interface_hash': interface_hash,\n 'version_id': manager.version_id,\n 'ignore_all': ignore_all,\n 'plugin_data': plugin_data,\n }\n\n # Write meta cache file\n meta_str = json_dumps(meta, manager.options.debug_cache)\n if not metastore.write(meta_json, meta_str):\n # Most likely the error is the replace() call\n # (see https://github.com/python/mypy/issues/3215).\n # The next run will simply find the cache entry out of date.\n manager.log(\"Error writing meta JSON file {}\".format(meta_json))\n\n return interface_hash, cache_meta_from_dict(meta, data_json)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_delete_cache_delete_cache.for_filename_in_cache_pat.try_.except_OSError_as_e_.if_e_errno_errno_ENOEN.manager_log_Error_deleti": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_delete_cache_delete_cache.for_filename_in_cache_pat.try_.except_OSError_as_e_.if_e_errno_errno_ENOEN.manager_log_Error_deleti", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1544, "end_line": 1563, "span_ids": ["delete_cache"], "tokens": 210}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def delete_cache(id: str, path: str, manager: BuildManager) -> None:\n \"\"\"Delete cache files for a module.\n\n The cache files for a module are deleted when mypy finds errors there.\n This avoids inconsistent states with cache files from different mypy runs,\n see #4043 for an example.\n \"\"\"\n # We don't delete .deps files on errors, since the dependencies\n # are mostly generated from other files and the metadata is\n # tracked separately.\n meta_path, data_path, _ = get_cache_names(id, path, manager.options)\n cache_paths = [meta_path, data_path]\n manager.log('Deleting {} {} {}'.format(id, path, \" \".join(x for x in cache_paths if x)))\n\n for filename in cache_paths:\n try:\n manager.metastore.remove(filename)\n except OSError as e:\n if e.errno != errno.ENOENT:\n manager.log(\"Error deleting cache file {}: {}\".format(filename, e.strerror))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py__Dependency_manager__ModuleNotFound._Control_flow_exception": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py__Dependency_manager__ModuleNotFound._Control_flow_exception", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1566, "end_line": 1704, "span_ids": ["delete_cache", "ModuleNotFound"], "tokens": 1165}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Dependency manager.\n\nDesign\n======\n\nIdeally\n-------\n\nA. Collapse cycles (each SCC -- strongly connected component --\n becomes one \"supernode\").\n\nB. Topologically sort nodes based on dependencies.\n\nC. Process from leaves towards roots.\n\nWrinkles\n--------\n\na. Need to parse source modules to determine dependencies.\n\nb. Processing order for modules within an SCC.\n\nc. Must order mtimes of files to decide whether to re-process; depends\n on clock never resetting.\n\nd. from P import M; checks filesystem whether module P.M exists in\n filesystem.\n\ne. Race conditions, where somebody modifies a file while we're\n processing. Solved by using a FileSystemCache.\n\n\nSteps\n-----\n\n1. For each explicitly given module find the source file location.\n\n2. For each such module load and check the cache metadata, and decide\n whether it's valid.\n\n3. Now recursively (or iteratively) find dependencies and add those to\n the graph:\n\n - for cached nodes use the list of dependencies from the cache\n metadata (this will be valid even if we later end up re-parsing\n the same source);\n\n - for uncached nodes parse the file and process all imports found,\n taking care of (a) above.\n\nStep 3 should also address (d) above.\n\nOnce step 3 terminates we have the entire dependency graph, and for\neach module we've either loaded the cache metadata or parsed the\nsource code. (However, we may still need to parse those modules for\nwhich we have cache metadata but that depend, directly or indirectly,\non at least one module for which the cache metadata is stale.)\n\nNow we can execute steps A-C from the first section. Finding SCCs for\nstep A shouldn't be hard; there's a recipe here:\nhttp://code.activestate.com/recipes/578507/. There's also a plethora\nof topsort recipes, e.g. http://code.activestate.com/recipes/577413/.\n\nFor single nodes, processing is simple. If the node was cached, we\ndeserialize the cache data and fix up cross-references. Otherwise, we\ndo semantic analysis followed by type checking. We also handle (c)\nabove; if a module has valid cache data *but* any of its\ndependencies was processed from source, then the module should be\nprocessed from source.\n\nA relatively simple optimization (outside SCCs) we might do in the\nfuture is as follows: if a node's cache data is valid, but one or more\nof its dependencies are out of date so we have to re-parse the node\nfrom source, once we have fully type-checked the node, we can decide\nwhether its symbol table actually changed compared to the cache data\n(by reading the cache data and comparing it to the data we would be\nwriting). If there is no change we can declare the node up to date,\nand any node that depends (and for which we have cached data, and\nwhose other dependencies are up to date) on it won't need to be\nre-parsed from source.\n\nImport cycles\n-------------\n\nFinally we have to decide how to handle (c), import cycles. Here\nwe'll need a modified version of the original state machine\n(build.py), but we only need to do this per SCC, and we won't have to\ndeal with changes to the list of nodes while we're processing it.\n\nIf all nodes in the SCC have valid cache metadata and all dependencies\noutside the SCC are still valid, we can proceed as follows:\n\n 1. Load cache data for all nodes in the SCC.\n\n 2. Fix up cross-references for all nodes in the SCC.\n\nOtherwise, the simplest (but potentially slow) way to proceed is to\ninvalidate all cache data in the SCC and re-parse all nodes in the SCC\nfrom source. We can do this as follows:\n\n 1. Parse source for all nodes in the SCC.\n\n 2. Semantic analysis for all nodes in the SCC.\n\n 3. Type check all nodes in the SCC.\n\n(If there are more passes the process is the same -- each pass should\nbe done for all nodes before starting the next pass for any nodes in\nthe SCC.)\n\nWe could process the nodes in the SCC in any order. For sentimental\nreasons, I've decided to process them in the reverse order in which we\nencountered them when originally constructing the graph. That's how\nthe old build.py deals with cycles, and at least this reproduces the\nprevious implementation more accurately.\n\nCan we do better than re-parsing all nodes in the SCC when any of its\ndependencies are out of date? It's doubtful. The optimization\nmentioned at the end of the previous section would require re-parsing\nand type-checking a node and then comparing its symbol table to the\ncached data; but because the node is part of a cycle we can't\ntechnically type-check it until the semantic analysis of all other\nnodes in the cycle has completed. (This is an important issue because\nDropbox has a very large cycle in production code. But I'd like to\ndeal with it later.)\n\nAdditional wrinkles\n-------------------\n\nDuring implementation more wrinkles were found.\n\n- When a submodule of a package (e.g. x.y) is encountered, the parent\n package (e.g. x) must also be loaded, but it is not strictly a\n dependency. See State.add_ancestors() below.\n\"\"\"\n\n\nclass ModuleNotFound(Exception):\n \"\"\"Control flow exception to signal that a module was not found.\"\"\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State_State.fine_grained_deps_loaded.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State_State.fine_grained_deps_loaded.False", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1707, "end_line": 1775, "span_ids": ["State"], "tokens": 742}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class State:\n \"\"\"The state for a module.\n\n The source is only used for the -c command line option; in that\n case path is None. Otherwise source is None and path isn't.\n \"\"\"\n\n manager = None # type: BuildManager\n order_counter = 0 # type: ClassVar[int]\n order = None # type: int # Order in which modules were encountered\n id = None # type: str # Fully qualified module name\n path = None # type: Optional[str] # Path to module source\n abspath = None # type: Optional[str] # Absolute path to module source\n xpath = None # type: str # Path or ''\n source = None # type: Optional[str] # Module source code\n source_hash = None # type: Optional[str] # Hash calculated based on the source code\n meta_source_hash = None # type: Optional[str] # Hash of the source given in the meta, if any\n meta = None # type: Optional[CacheMeta]\n data = None # type: Optional[str]\n tree = None # type: Optional[MypyFile]\n # We keep both a list and set of dependencies. A set because it makes it efficient to\n # prevent duplicates and the list because I am afraid of changing the order of\n # iteration over dependencies.\n # They should be managed with add_dependency and suppress_dependency.\n dependencies = None # type: List[str] # Modules directly imported by the module\n dependencies_set = None # type: Set[str] # The same but as a set for deduplication purposes\n suppressed = None # type: List[str] # Suppressed/missing dependencies\n suppressed_set = None # type: Set[str] # Suppressed/missing dependencies\n priorities = None # type: Dict[str, int]\n\n # Map each dependency to the line number where it is first imported\n dep_line_map = None # type: Dict[str, int]\n\n # Parent package, its parent, etc.\n ancestors = None # type: Optional[List[str]]\n\n # List of (path, line number) tuples giving context for import\n import_context = None # type: List[Tuple[str, int]]\n\n # The State from which this module was imported, if any\n caller_state = None # type: Optional[State]\n\n # If caller_state is set, the line number in the caller where the import occurred\n caller_line = 0\n\n # If True, indicate that the public interface of this module is unchanged\n externally_same = True\n\n # Contains a hash of the public interface in incremental mode\n interface_hash = \"\" # type: str\n\n # Options, specialized for this file\n options = None # type: Options\n\n # Whether to ignore all errors\n ignore_all = False\n\n # Whether the module has an error or any of its dependencies have one.\n transitive_error = False\n\n # Errors reported before semantic analysis, to allow fine-grained\n # mode to keep reporting them.\n early_errors = None # type: List[ErrorInfo]\n\n # Type checker used for checking this file. Use type_checker() for\n # access and to construct this on demand.\n _type_checker = None # type: Optional[TypeChecker]\n\n fine_grained_deps_loaded = False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.__init___State.__init__.if_self_meta_.else_.self_compute_dependencies": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.__init___State.__init__.if_self_meta_.else_.self_compute_dependencies", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1777, "end_line": 1876, "span_ids": ["State.__init__"], "tokens": 1016}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class State:\n\n def __init__(self,\n id: Optional[str],\n path: Optional[str],\n source: Optional[str],\n manager: BuildManager,\n caller_state: 'Optional[State]' = None,\n caller_line: int = 0,\n ancestor_for: 'Optional[State]' = None,\n root_source: bool = False,\n # If `temporary` is True, this State is being created to just\n # quickly parse/load the tree, without an intention to further\n # process it. With this flag, any changes to external state as well\n # as error reporting should be avoided.\n temporary: bool = False,\n ) -> None:\n if not temporary:\n assert id or path or source is not None, \"Neither id, path nor source given\"\n self.manager = manager\n State.order_counter += 1\n self.order = State.order_counter\n self.caller_state = caller_state\n self.caller_line = caller_line\n if caller_state:\n self.import_context = caller_state.import_context[:]\n self.import_context.append((caller_state.xpath, caller_line))\n else:\n self.import_context = []\n self.id = id or '__main__'\n self.options = manager.options.clone_for_module(self.id)\n self.early_errors = []\n self._type_checker = None\n if not path and source is None:\n assert id is not None\n try:\n path, follow_imports = find_module_and_diagnose(\n manager, id, self.options, caller_state, caller_line,\n ancestor_for, root_source, skip_diagnose=temporary)\n except ModuleNotFound:\n if not temporary:\n manager.missing_modules.add(id)\n raise\n if follow_imports == 'silent':\n self.ignore_all = True\n self.path = path\n if path:\n self.abspath = os.path.abspath(path)\n self.xpath = path or ''\n if path and source is None and self.manager.fscache.isdir(path):\n source = ''\n self.source = source\n if path and source is None and self.manager.cache_enabled:\n self.meta = find_cache_meta(self.id, path, manager)\n # TODO: Get mtime if not cached.\n if self.meta is not None:\n self.interface_hash = self.meta.interface_hash\n self.meta_source_hash = self.meta.hash\n self.add_ancestors()\n t0 = time.time()\n self.meta = validate_meta(self.meta, self.id, self.path, self.ignore_all, manager)\n self.manager.add_stats(validate_meta_time=time.time() - t0)\n if self.meta:\n # Make copies, since we may modify these and want to\n # compare them to the originals later.\n self.dependencies = list(self.meta.dependencies)\n self.dependencies_set = set(self.dependencies)\n self.suppressed = list(self.meta.suppressed)\n self.suppressed_set = set(self.suppressed)\n all_deps = self.dependencies + self.suppressed\n assert len(all_deps) == len(self.meta.dep_prios)\n self.priorities = {id: pri\n for id, pri in zip(all_deps, self.meta.dep_prios)}\n assert len(all_deps) == len(self.meta.dep_lines)\n self.dep_line_map = {id: line\n for id, line in zip(all_deps, self.meta.dep_lines)}\n if temporary:\n self.load_tree(temporary=True)\n if not manager.use_fine_grained_cache():\n # Special case: if there were a previously missing package imported here\n # and it is not present, then we need to re-calculate dependencies.\n # This is to support patterns like this:\n # from missing_package import missing_module # type: ignore\n # At first mypy doesn't know that `missing_module` is a module\n # (it may be a variable, a class, or a function), so it is not added to\n # suppressed dependencies. Therefore, when the package with module is added,\n # we need to re-calculate dependencies.\n # NOTE: see comment below for why we skip this in fine grained mode.\n if exist_added_packages(self.suppressed, manager, self.options):\n self.parse_file() # This is safe because the cache is anyway stale.\n self.compute_dependencies()\n else:\n # When doing a fine-grained cache load, pretend we only\n # know about modules that have cache information and defer\n # handling new modules until the fine-grained update.\n if manager.use_fine_grained_cache():\n manager.log(\"Deferring module to fine-grained update %s (%s)\" % (path, id))\n raise ModuleNotFound\n\n # Parse the file (and then some) to get the dependencies.\n self.parse_file()\n self.compute_dependencies()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.xmeta_State.add_ancestors.self.ancestors.ancestors": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.xmeta_State.add_ancestors.self.ancestors.ancestors", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1878, "end_line": 1897, "span_ids": ["State.xmeta", "State.add_ancestors"], "tokens": 156}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class State:\n\n @property\n def xmeta(self) -> CacheMeta:\n assert self.meta, \"missing meta on allegedly fresh module\"\n return self.meta\n\n def add_ancestors(self) -> None:\n if self.path is not None:\n _, name = os.path.split(self.path)\n base, _ = os.path.splitext(name)\n if '.' in base:\n # This is just a weird filename, don't add anything\n self.ancestors = []\n return\n # All parent packages are new ancestors.\n ancestors = []\n parent = self.id\n while '.' in parent:\n parent, _ = parent.rsplit('.', 1)\n ancestors.append(parent)\n self.ancestors = ancestors", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.is_fresh_State.check_blockers.if_self_manager_errors_is.self_manager_errors_raise": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.is_fresh_State.check_blockers.if_self_manager_errors_is.self_manager_errors_raise", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1899, "end_line": 1926, "span_ids": ["State.check_blockers", "State.mark_interface_stale", "State.is_fresh", "State.is_interface_fresh", "State.mark_as_rechecked"], "tokens": 271}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class State:\n\n def is_fresh(self) -> bool:\n \"\"\"Return whether the cache data for this file is fresh.\"\"\"\n # NOTE: self.dependencies may differ from\n # self.meta.dependencies when a dependency is dropped due to\n # suppression by silent mode. However when a suppressed\n # dependency is added back we find out later in the process.\n return (self.meta is not None\n and self.is_interface_fresh()\n and self.dependencies == self.meta.dependencies)\n\n def is_interface_fresh(self) -> bool:\n return self.externally_same\n\n def mark_as_rechecked(self) -> None:\n \"\"\"Marks this module as having been fully re-analyzed by the type-checker.\"\"\"\n self.manager.rechecked_modules.add(self.id)\n\n def mark_interface_stale(self, *, on_errors: bool = False) -> None:\n \"\"\"Marks this module as having a stale public interface, and discards the cache data.\"\"\"\n self.externally_same = False\n if not on_errors:\n self.manager.stale_modules.add(self.id)\n\n def check_blockers(self) -> None:\n \"\"\"Raise CompileError if a blocking error is detected.\"\"\"\n if self.manager.errors.is_blockers():\n self.manager.log(\"Bailing due to blocking errors\")\n self.manager.errors.raise_error()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.wrap_context_State.wrap_context.if_check_blockers_.self_check_blockers_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.wrap_context_State.wrap_context.if_check_blockers_.self_check_blockers_", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1928, "end_line": 1951, "span_ids": ["State.wrap_context"], "tokens": 224}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class State:\n\n @contextlib.contextmanager\n def wrap_context(self, check_blockers: bool = True) -> Iterator[None]:\n \"\"\"Temporarily change the error import context to match this state.\n\n Also report an internal error if an unexpected exception was raised\n and raise an exception on a blocking error, unless\n check_blockers is False. Skipping blocking error reporting is used\n in the semantic analyzer so that we can report all blocking errors\n for a file (across multiple targets) to maintain backward\n compatibility.\n \"\"\"\n save_import_context = self.manager.errors.import_context()\n self.manager.errors.set_import_context(self.import_context)\n try:\n yield\n except CompileError:\n raise\n except Exception as err:\n report_internal_error(err, self.path, 0, self.manager.errors,\n self.options, self.manager.stdout, self.manager.stderr)\n self.manager.errors.set_import_context(save_import_context)\n # TODO: Move this away once we've removed the old semantic analyzer?\n if check_blockers:\n self.check_blockers()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.load_fine_grained_deps_State._Methods_for_processing_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.load_fine_grained_deps_State._Methods_for_processing_", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1953, "end_line": 1981, "span_ids": ["State.load_tree", "State.load_fine_grained_deps", "State.fix_cross_refs"], "tokens": 295}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class State:\n\n def load_fine_grained_deps(self) -> Dict[str, Set[str]]:\n return self.manager.load_fine_grained_deps(self.id)\n\n def load_tree(self, temporary: bool = False) -> None:\n assert self.meta is not None, \"Internal error: this method must be called only\" \\\n \" for cached modules\"\n t0 = time.time()\n raw = self.manager.metastore.read(self.meta.data_json)\n t1 = time.time()\n data = json.loads(raw)\n t2 = time.time()\n # TODO: Assert data file wasn't changed.\n self.tree = MypyFile.deserialize(data)\n t3 = time.time()\n self.manager.add_stats(data_read_time=t1 - t0,\n data_json_load_time=t2 - t1,\n deserialize_time=t3 - t2)\n if not temporary:\n self.manager.modules[self.id] = self.tree\n self.manager.add_stats(fresh_trees=1)\n\n def fix_cross_refs(self) -> None:\n assert self.tree is not None, \"Internal error: method must be called on parsed file only\"\n # We need to set allow_missing when doing a fine grained cache\n # load because we need to gracefully handle missing modules.\n fixup_module(self.tree, self.manager.modules,\n self.options.use_fine_grained_cache)\n\n # Methods for processing modules from source code.", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.parse_inline_configuration_State.semantic_analysis_pass1.if_options_allow_redefini.self_tree_accept_Variable": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.parse_inline_configuration_State.semantic_analysis_pass1.if_options_allow_redefini.self_tree_accept_Variable", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2041, "end_line": 2072, "span_ids": ["State.parse_inline_configuration", "State.semantic_analysis_pass1"], "tokens": 315}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class State:\n\n def parse_inline_configuration(self, source: str) -> None:\n \"\"\"Check for inline mypy: options directive and parse them.\"\"\"\n flags = get_mypy_comments(source)\n if flags:\n changes, config_errors = parse_mypy_comments(flags, self.options)\n self.options = self.options.apply_changes(changes)\n self.manager.errors.set_file(self.xpath, self.id)\n for lineno, error in config_errors:\n self.manager.errors.report(lineno, 0, error)\n\n def semantic_analysis_pass1(self) -> None:\n \"\"\"Perform pass 1 of semantic analysis, which happens immediately after parsing.\n\n This pass can't assume that any other modules have been processed yet.\n \"\"\"\n options = self.options\n assert self.tree is not None\n # Do the first pass of semantic analysis: analyze the reachability\n # of blocks and import statements. We must do this before\n # processing imports, since this may mark some import statements as\n # unreachable.\n #\n # TODO: This should not be considered as a semantic analysis\n # pass -- it's an independent pass.\n analyzer = SemanticAnalyzerPreAnalysis()\n with self.wrap_context():\n analyzer.visit_file(self.tree, self.xpath, self.id, options)\n # TODO: Do this while contructing the AST?\n self.tree.names = SymbolTable()\n if options.allow_redefinition:\n # Perform renaming across the AST to allow variable redefinitions\n self.tree.accept(VariableRenameVisitor())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.add_dependency_State.suppress_dependency.if_dep_not_in_self_suppre.self_suppressed_set_add_d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.add_dependency_State.suppress_dependency.if_dep_not_in_self_suppre.self_suppressed_set_add_d", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2074, "end_line": 2088, "span_ids": ["State.suppress_dependency", "State.add_dependency"], "tokens": 121}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class State:\n\n def add_dependency(self, dep: str) -> None:\n if dep not in self.dependencies_set:\n self.dependencies.append(dep)\n self.dependencies_set.add(dep)\n if dep in self.suppressed_set:\n self.suppressed.remove(dep)\n self.suppressed_set.remove(dep)\n\n def suppress_dependency(self, dep: str) -> None:\n if dep in self.dependencies_set:\n self.dependencies.remove(dep)\n self.dependencies_set.remove(dep)\n if dep not in self.suppressed_set:\n self.suppressed.append(dep)\n self.suppressed_set.add(dep)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.compute_dependencies_State.compute_dependencies._Can_fail_due_to_bogus_r": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.compute_dependencies_State.compute_dependencies._Can_fail_due_to_bogus_r", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2090, "end_line": 2125, "span_ids": ["State.compute_dependencies"], "tokens": 329}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class State:\n\n def compute_dependencies(self) -> None:\n \"\"\"Compute a module's dependencies after parsing it.\n\n This is used when we parse a file that we didn't have\n up-to-date cache information for. When we have an up-to-date\n cache, we just use the cached info.\n \"\"\"\n manager = self.manager\n assert self.tree is not None\n\n # Compute (direct) dependencies.\n # Add all direct imports (this is why we needed the first pass).\n # Also keep track of each dependency's source line.\n # Missing dependencies will be moved from dependencies to\n # suppressed when they fail to be loaded in load_graph.\n\n self.dependencies = []\n self.dependencies_set = set()\n self.suppressed = []\n self.suppressed_set = set()\n self.priorities = {} # id -> priority\n self.dep_line_map = {} # id -> line\n dep_entries = (manager.all_imported_modules_in_file(self.tree) +\n self.manager.plugin.get_additional_deps(self.tree))\n for pri, id, line in dep_entries:\n self.priorities[id] = min(pri, self.priorities.get(id, PRI_ALL))\n if id == self.id:\n continue\n self.add_dependency(id)\n if id not in self.dep_line_map:\n self.dep_line_map[id] = line\n # Every module implicitly depends on builtins.\n if self.id != 'builtins':\n self.add_dependency('builtins')\n\n self.check_blockers() # Can fail due to bogus relative imports", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.type_check_first_pass_State.type_check_second_pass.with_self_wrap_context_.return.self_type_checker_check": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.type_check_first_pass_State.type_check_second_pass.with_self_wrap_context_.return.self_type_checker_check", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2127, "end_line": 2148, "span_ids": ["State.type_check_second_pass", "State.type_map", "State.type_check_first_pass", "State.type_checker"], "tokens": 179}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class State:\n\n def type_check_first_pass(self) -> None:\n if self.options.semantic_analysis_only:\n return\n with self.wrap_context():\n self.type_checker().check_first_pass()\n\n def type_checker(self) -> TypeChecker:\n if not self._type_checker:\n assert self.tree is not None, \"Internal error: must be called on parsed file only\"\n manager = self.manager\n self._type_checker = TypeChecker(manager.errors, manager.modules, self.options,\n self.tree, self.xpath, manager.plugin)\n return self._type_checker\n\n def type_map(self) -> Dict[Expression, Type]:\n return self.type_checker().type_map\n\n def type_check_second_pass(self) -> bool:\n if self.options.semantic_analysis_only:\n return False\n with self.wrap_context():\n return self.type_checker().check_second_pass()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.finish_passes_State.finish_passes.with_self_wrap_context_.if_not_manager_options_fi.free_tree_self_tree_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.finish_passes_State.finish_passes.with_self_wrap_context_.if_not_manager_options_fi.free_tree_self_tree_", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2150, "end_line": 2176, "span_ids": ["State.finish_passes"], "tokens": 246}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class State:\n\n def finish_passes(self) -> None:\n assert self.tree is not None, \"Internal error: method must be called on parsed file only\"\n manager = self.manager\n if self.options.semantic_analysis_only:\n return\n with self.wrap_context():\n # Some tests (and tools) want to look at the set of all types.\n options = manager.options\n if options.export_types:\n manager.all_types.update(self.type_map())\n\n # We should always patch indirect dependencies, even in full (non-incremental) builds,\n # because the cache still may be written, and it must be correct.\n self._patch_indirect_dependencies(self.type_checker().module_refs, self.type_map())\n\n if self.options.dump_inference_stats:\n dump_type_stats(self.tree,\n self.xpath,\n modules=self.manager.modules,\n inferred=True,\n typemap=self.type_map())\n manager.report_file(self.tree, self.type_map(), self.options)\n\n self.update_fine_grained_deps(self.manager.fg_deps)\n self.free_state()\n if not manager.options.fine_grained_incremental and not manager.options.preserve_asts:\n free_tree(self.tree)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.free_state_State._patch_indirect_dependencies.for_dep_in_sorted_extra_.if_dep_not_in_self_suppre.elif_dep_not_in_self_supp.self_suppress_dependency_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.free_state_State._patch_indirect_dependencies.for_dep_in_sorted_extra_.if_dep_not_in_self_suppre.elif_dep_not_in_self_supp.self_suppress_dependency_", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2178, "end_line": 2200, "span_ids": ["State._patch_indirect_dependencies", "State.free_state"], "tokens": 190}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class State:\n\n def free_state(self) -> None:\n if self._type_checker:\n self._type_checker.reset()\n self._type_checker = None\n\n def _patch_indirect_dependencies(self,\n module_refs: Set[str],\n type_map: Dict[Expression, Type]) -> None:\n types = set(type_map.values())\n assert None not in types\n valid = self.valid_references()\n\n encountered = self.manager.indirection_detector.find_modules(types) | module_refs\n extra = encountered - valid\n\n for dep in sorted(extra):\n if dep not in self.manager.modules:\n continue\n if dep not in self.suppressed_set and dep not in self.manager.missing_modules:\n self.add_dependency(dep)\n self.priorities[dep] = PRI_INDIRECT\n elif dep not in self.suppressed_set and dep in self.manager.missing_modules:\n self.suppress_dependency(dep)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.compute_fine_grained_deps_State.compute_fine_grained_deps.return.get_dependencies_target_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.compute_fine_grained_deps_State.compute_fine_grained_deps.return.get_dependencies_target_s", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2235, "end_line": 2250, "span_ids": ["State.compute_fine_grained_deps"], "tokens": 197}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class State:\n\n def compute_fine_grained_deps(self) -> Dict[str, Set[str]]:\n assert self.tree is not None\n if self.id in ('builtins', 'typing', 'types', 'sys', '_typeshed'):\n # We don't track changes to core parts of typeshed -- the\n # assumption is that they are only changed as part of mypy\n # updates, which will invalidate everything anyway. These\n # will always be processed in the initial non-fine-grained\n # build. Other modules may be brought in as a result of an\n # fine-grained increment, and we may need these\n # dependencies then to handle cyclic imports.\n return {}\n from mypy.server.deps import get_dependencies # Lazy import to speed up startup\n return get_dependencies(target=self.tree,\n type_map=self.type_map(),\n python_version=self.options.python_version,\n options=self.manager.options)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.update_fine_grained_deps_State.valid_references.return.valid_refs": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.update_fine_grained_deps_State.valid_references.return.valid_refs", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2217, "end_line": 2232, "span_ids": ["State.update_fine_grained_deps", "State.valid_references"], "tokens": 156}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class State:\n\n def update_fine_grained_deps(self, deps: Dict[str, Set[str]]) -> None:\n options = self.manager.options\n if options.cache_fine_grained or options.fine_grained_incremental:\n from mypy.server.deps import merge_dependencies # Lazy import to speed up startup\n merge_dependencies(self.compute_fine_grained_deps(), deps)\n TypeState.update_protocol_deps(deps)\n\n def valid_references(self) -> Set[str]:\n assert self.ancestors is not None\n valid_refs = set(self.dependencies + self.suppressed + self.ancestors)\n valid_refs.add(self.id)\n\n if \"os\" in valid_refs:\n valid_refs.add(\"os.path\")\n\n return valid_refs", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.write_cache_State.write_cache.if_new_interface_hash_.else_.self.interface_hash.new_interface_hash": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.write_cache_State.write_cache.if_new_interface_hash_.else_.self.interface_hash.new_interface_hash", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2234, "end_line": 2262, "span_ids": ["State.write_cache"], "tokens": 301}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class State:\n\n def write_cache(self) -> None:\n assert self.tree is not None, \"Internal error: method must be called on parsed file only\"\n # We don't support writing cache files in fine-grained incremental mode.\n if (not self.path\n or self.options.cache_dir == os.devnull\n or self.options.fine_grained_incremental):\n return\n is_errors = self.transitive_error\n if is_errors:\n delete_cache(self.id, self.path, self.manager)\n self.meta = None\n self.mark_interface_stale(on_errors=True)\n return\n dep_prios = self.dependency_priorities()\n dep_lines = self.dependency_lines()\n assert self.source_hash is not None\n assert len(set(self.dependencies)) == len(self.dependencies), (\n \"Duplicates in dependencies list for {} ({})\".format(self.id, self.dependencies))\n new_interface_hash, self.meta = write_cache(\n self.id, self.path, self.tree,\n list(self.dependencies), list(self.suppressed),\n dep_prios, dep_lines, self.interface_hash, self.source_hash, self.ignore_all,\n self.manager)\n if new_interface_hash == self.interface_hash:\n self.manager.log(\"Cached module {} has same interface\".format(self.id))\n else:\n self.manager.log(\"Cached module {} has changed interface\".format(self.id))\n self.mark_interface_stale()\n self.interface_hash = new_interface_hash", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.verify_dependencies_State.verify_dependencies.for_dep_in_all_deps_.try_.except_ModuleNotFound_C.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.verify_dependencies_State.verify_dependencies.for_dep_in_all_deps_.try_.except_ModuleNotFound_C.pass", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2264, "end_line": 2301, "span_ids": ["State.verify_dependencies"], "tokens": 352}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class State:\n\n def verify_dependencies(self, suppressed_only: bool = False) -> None:\n \"\"\"Report errors for import targets in modules that don't exist.\n\n If suppressed_only is set, only check suppressed dependencies.\n \"\"\"\n manager = self.manager\n assert self.ancestors is not None\n if suppressed_only:\n all_deps = self.suppressed\n else:\n # Strip out indirect dependencies. See comment in build.load_graph().\n dependencies = [dep for dep in self.dependencies\n if self.priorities.get(dep) != PRI_INDIRECT]\n all_deps = dependencies + self.suppressed + self.ancestors\n for dep in all_deps:\n if dep in manager.modules:\n continue\n options = manager.options.clone_for_module(dep)\n if options.ignore_missing_imports:\n continue\n line = self.dep_line_map.get(dep, 1)\n try:\n if dep in self.ancestors:\n state, ancestor = None, self # type: (Optional[State], Optional[State])\n else:\n state, ancestor = self, None\n # Called just for its side effects of producing diagnostics.\n find_module_and_diagnose(\n manager, dep, options,\n caller_state=state, caller_line=line,\n ancestor_for=ancestor)\n except (ModuleNotFound, CompileError):\n # Swallow up any ModuleNotFounds or CompilerErrors while generating\n # a diagnostic. CompileErrors may get generated in\n # fine-grained mode when an __init__.py is deleted, if a module\n # that was in that package has targets reprocessed before\n # it is renamed.\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.dependency_priorities_State.generate_unused_ignore_notes.if_self_options_warn_unus.self_manager_errors_gener": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.dependency_priorities_State.generate_unused_ignore_notes.if_self_options_warn_unus.self_manager_errors_gener", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2303, "end_line": 2316, "span_ids": ["State.dependency_priorities", "State.generate_unused_ignore_notes", "State.dependency_lines"], "tokens": 165}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class State:\n\n def dependency_priorities(self) -> List[int]:\n return [self.priorities.get(dep, PRI_HIGH) for dep in self.dependencies + self.suppressed]\n\n def dependency_lines(self) -> List[int]:\n return [self.dep_line_map.get(dep, 1) for dep in self.dependencies + self.suppressed]\n\n def generate_unused_ignore_notes(self) -> None:\n if self.options.warn_unused_ignores:\n # If this file was initially loaded from the cache, it may have suppressed\n # dependencies due to imports with ignores on them. We need to generate\n # those errors to avoid spuriously flagging them as unused ignores.\n if self.meta:\n self.verify_dependencies(suppressed_only=True)\n self.manager.errors.generate_unused_ignore_errors(self.xpath)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py__Module_import_and_diagn_find_module_and_diagnose.result.find_module_with_reason_f": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py__Module_import_and_diagn_find_module_and_diagnose.result.find_module_with_reason_f", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2319, "end_line": 2361, "span_ids": ["State.generate_unused_ignore_notes", "find_module_and_diagnose"], "tokens": 452}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Module import and diagnostic glue\n\n\ndef find_module_and_diagnose(manager: BuildManager,\n id: str,\n options: Options,\n caller_state: 'Optional[State]' = None,\n caller_line: int = 0,\n ancestor_for: 'Optional[State]' = None,\n root_source: bool = False,\n skip_diagnose: bool = False) -> Tuple[str, str]:\n \"\"\"Find a module by name, respecting follow_imports and producing diagnostics.\n\n If the module is not found, then the ModuleNotFound exception is raised.\n\n Args:\n id: module to find\n options: the options for the module being loaded\n caller_state: the state of the importing module, if applicable\n caller_line: the line number of the import\n ancestor_for: the child module this is an ancestor of, if applicable\n root_source: whether this source was specified on the command line\n skip_diagnose: skip any error diagnosis and reporting (but ModuleNotFound is\n still raised if the module is missing)\n\n The specified value of follow_imports for a module can be overridden\n if the module is specified on the command line or if it is a stub,\n so we compute and return the \"effective\" follow_imports of the module.\n\n Returns a tuple containing (file path, target's effective follow_imports setting)\n \"\"\"\n file_id = id\n if id == 'builtins' and options.python_version[0] == 2:\n # The __builtin__ module is called internally by mypy\n # 'builtins' in Python 2 mode (similar to Python 3),\n # but the stub file is __builtin__.pyi. The reason is\n # that a lot of code hard-codes 'builtins.x' and it's\n # easier to work it around like this. It also means\n # that the implementation can mostly ignore the\n # difference and just assume 'builtins' everywhere,\n # which simplifies code.\n file_id = '__builtin__'\n result = find_module_with_reason(file_id, manager)\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_find_module_and_diagnose.if_isinstance_result_str_find_module_and_diagnose.if_isinstance_result_str.else_.if_caller_state_.else_.raise_ModuleNotFound": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_find_module_and_diagnose.if_isinstance_result_str_find_module_and_diagnose.if_isinstance_result_str.else_.if_caller_state_.else_.raise_ModuleNotFound", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2397, "end_line": 2466, "span_ids": ["find_module_and_diagnose"], "tokens": 825}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def find_module_and_diagnose(manager: BuildManager,\n id: str,\n options: Options,\n caller_state: 'Optional[State]' = None,\n caller_line: int = 0,\n ancestor_for: 'Optional[State]' = None,\n root_source: bool = False,\n skip_diagnose: bool = False) -> Tuple[str, str]:\n # ... other code\n if isinstance(result, str):\n # For non-stubs, look at options.follow_imports:\n # - normal (default) -> fully analyze\n # - silent -> analyze but silence errors\n # - skip -> don't analyze, make the type Any\n follow_imports = options.follow_imports\n if (root_source # Honor top-level modules\n or (not result.endswith('.py') # Stubs are always normal\n and not options.follow_imports_for_stubs) # except when they aren't\n or id in mypy.semanal_main.core_modules): # core is always normal\n follow_imports = 'normal'\n if skip_diagnose:\n pass\n elif follow_imports == 'silent':\n # Still import it, but silence non-blocker errors.\n manager.log(\"Silencing %s (%s)\" % (result, id))\n elif follow_imports == 'skip' or follow_imports == 'error':\n # In 'error' mode, produce special error messages.\n if id not in manager.missing_modules:\n manager.log(\"Skipping %s (%s)\" % (result, id))\n if follow_imports == 'error':\n if ancestor_for:\n skipping_ancestor(manager, id, result, ancestor_for)\n else:\n skipping_module(manager, caller_line, caller_state,\n id, result)\n raise ModuleNotFound\n if not manager.options.no_silence_site_packages:\n for dir in manager.search_paths.package_path + manager.search_paths.typeshed_path:\n if is_sub_path(result, dir):\n # Silence errors in site-package dirs and typeshed\n follow_imports = 'silent'\n if (id in CORE_BUILTIN_MODULES\n and not is_typeshed_file(result)\n and not is_stub_package_file(result)\n and not options.use_builtins_fixtures\n and not options.custom_typeshed_dir):\n raise CompileError([\n 'mypy: \"%s\" shadows library module \"%s\"' % (os.path.relpath(result), id),\n 'note: A user-defined top-level module with name \"%s\" is not supported' % id\n ])\n return (result, follow_imports)\n else:\n # Could not find a module. Typically the reason is a\n # misspelled module name, missing stub, module not in\n # search path or the module has not been installed.\n\n ignore_missing_imports = options.ignore_missing_imports\n top_level = file_id.partition('.')[0]\n # Don't honor a global (not per-module) ignore_missing_imports\n # setting for modules that used to have bundled stubs, as\n # otherwise updating mypy can silently result in new false\n # negatives.\n global_ignore_missing_imports = manager.options.ignore_missing_imports\n if top_level in legacy_bundled_packages and global_ignore_missing_imports:\n ignore_missing_imports = False\n\n if skip_diagnose:\n raise ModuleNotFound\n if caller_state:\n if not (ignore_missing_imports or in_partial_package(id, manager)):\n module_not_found(manager, caller_line, caller_state, id, result)\n raise ModuleNotFound\n elif root_source:\n # If we can't find a root source it's always fatal.\n # TODO: This might hide non-fatal errors from\n # root sources processed earlier.\n raise CompileError([\"mypy: can't find module '%s'\" % id])\n else:\n raise ModuleNotFound", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_exist_added_packages_exist_added_packages.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_exist_added_packages_exist_added_packages.return.False", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2422, "end_line": 2443, "span_ids": ["exist_added_packages"], "tokens": 209}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def exist_added_packages(suppressed: List[str],\n manager: BuildManager, options: Options) -> bool:\n \"\"\"Find if there are any newly added packages that were previously suppressed.\n\n Exclude everything not in build for follow-imports=skip.\n \"\"\"\n for dep in suppressed:\n if dep in manager.source_set.source_modules:\n # We don't need to add any special logic for this. If a module\n # is added to build, importers will be invalidated by normal mechanism.\n continue\n path = find_module_simple(dep, manager)\n if not path:\n continue\n if (options.follow_imports == 'skip' and\n (not path.endswith('.pyi') or options.follow_imports_for_stubs)):\n continue\n if '__init__.py' in path:\n # It is better to have a bit lenient test, this will only slightly reduce\n # performance, while having a too strict test may affect correctness.\n return True\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_find_module_simple_find_module_with_reason.return.x": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_find_module_simple_find_module_with_reason.return.x", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2446, "end_line": 2459, "span_ids": ["find_module_with_reason", "find_module_simple"], "tokens": 144}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def find_module_simple(id: str, manager: BuildManager) -> Optional[str]:\n \"\"\"Find a filesystem path for module `id` or `None` if not found.\"\"\"\n x = find_module_with_reason(id, manager)\n if isinstance(x, ModuleNotFoundReason):\n return None\n return x\n\n\ndef find_module_with_reason(id: str, manager: BuildManager) -> ModuleSearchResult:\n \"\"\"Find a filesystem path for module `id` or the reason it can't be found.\"\"\"\n t0 = time.time()\n x = manager.find_module_cache.find_module(id)\n manager.add_stats(find_module_time=time.time() - t0, find_module_calls=1)\n return x", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_in_partial_package_in_partial_package.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_in_partial_package_in_partial_package.return.False", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2462, "end_line": 2488, "span_ids": ["in_partial_package"], "tokens": 228}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def in_partial_package(id: str, manager: BuildManager) -> bool:\n \"\"\"Check if a missing module can potentially be a part of a package.\n\n This checks if there is any existing parent __init__.pyi stub that\n defines a module-level __getattr__ (a.k.a. partial stub package).\n \"\"\"\n while '.' in id:\n parent, _ = id.rsplit('.', 1)\n if parent in manager.modules:\n parent_mod = manager.modules[parent] # type: Optional[MypyFile]\n else:\n # Parent is not in build, try quickly if we can find it.\n try:\n parent_st = State(id=parent, path=None, source=None, manager=manager,\n temporary=True)\n except (ModuleNotFound, CompileError):\n parent_mod = None\n else:\n parent_mod = parent_st.tree\n if parent_mod is not None:\n if parent_mod.is_partial_stub_package:\n return True\n else:\n # Bail out soon, complete subpackage found\n return False\n id = parent\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_module_not_found_module_not_found.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_module_not_found_module_not_found.None_2", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2538, "end_line": 2559, "span_ids": ["module_not_found"], "tokens": 267}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def module_not_found(manager: BuildManager, line: int, caller_state: State,\n target: str, reason: ModuleNotFoundReason) -> None:\n errors = manager.errors\n save_import_context = errors.import_context()\n errors.set_import_context(caller_state.import_context)\n errors.set_file(caller_state.xpath, caller_state.id)\n if target == 'builtins':\n errors.report(line, 0, \"Cannot find 'builtins' module. Typeshed appears broken!\",\n blocker=True)\n errors.raise_error()\n else:\n msg, notes = reason.error_message_templates()\n pyver = '%d.%d' % manager.options.python_version\n errors.report(line, 0, msg.format(module=target, pyver=pyver), code=codes.IMPORT)\n top_level = target.partition('.')[0]\n for note in notes:\n if '{stub_dist}' in note:\n note = note.format(stub_dist=legacy_bundled_packages[top_level])\n errors.report(line, 0, note, severity='note', only_once=True, code=codes.IMPORT)\n if reason is ModuleNotFoundReason.STUBS_NOT_INSTALLED:\n manager.missing_stub_packages.add(legacy_bundled_packages[top_level])\n errors.set_import_context(save_import_context)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_skipping_module_skipping_module.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_skipping_module_skipping_module.None_4", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2513, "end_line": 2526, "span_ids": ["skipping_module"], "tokens": 168}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def skipping_module(manager: BuildManager, line: int, caller_state: Optional[State],\n id: str, path: str) -> None:\n \"\"\"Produce an error for an import ignored due to --follow_imports=error\"\"\"\n assert caller_state, (id, path)\n save_import_context = manager.errors.import_context()\n manager.errors.set_import_context(caller_state.import_context)\n manager.errors.set_file(caller_state.xpath, caller_state.id)\n manager.errors.report(line, 0,\n \"Import of '%s' ignored\" % (id,),\n severity='error')\n manager.errors.report(line, 0,\n \"(Using --follow-imports=error, module not passed on command line)\",\n severity='note', only_once=True)\n manager.errors.set_import_context(save_import_context)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_skipping_ancestor_skipping_ancestor.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_skipping_ancestor_skipping_ancestor.None_3", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2529, "end_line": 2541, "span_ids": ["skipping_ancestor"], "tokens": 189}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def skipping_ancestor(manager: BuildManager, id: str, path: str, ancestor_for: 'State') -> None:\n \"\"\"Produce an error for an ancestor ignored due to --follow_imports=error\"\"\"\n # TODO: Read the path (the __init__.py file) and return\n # immediately if it's empty or only contains comments.\n # But beware, some package may be the ancestor of many modules,\n # so we'd need to cache the decision.\n manager.errors.set_import_context([])\n manager.errors.set_file(ancestor_for.xpath, ancestor_for.id)\n manager.errors.report(-1, -1, \"Ancestor package '%s' ignored\" % (id,),\n severity='error', only_once=True)\n manager.errors.report(-1, -1,\n \"(Using --follow-imports=error, submodule passed on command line)\",\n severity='note', only_once=True)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_log_configuration_log_configuration.for_path_type_paths_in_m.for_pth_in_paths_.manager_trace_s_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_log_configuration_log_configuration.for_path_type_paths_in_m.for_pth_in_paths_.manager_trace_s_", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2593, "end_line": 2622, "span_ids": ["log_configuration"], "tokens": 254}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def log_configuration(manager: BuildManager, sources: List[BuildSource]) -> None:\n \"\"\"Output useful configuration information to LOG and TRACE\"\"\"\n\n manager.log()\n configuration_vars = [\n (\"Mypy Version\", __version__),\n (\"Config File\", (manager.options.config_file or \"Default\")),\n (\"Configured Executable\", manager.options.python_executable or \"None\"),\n (\"Current Executable\", sys.executable),\n (\"Cache Dir\", manager.options.cache_dir),\n (\"Compiled\", str(not __file__.endswith(\".py\"))),\n (\"Exclude\", manager.options.exclude),\n ]\n\n for conf_name, conf_value in configuration_vars:\n manager.log(\"{:24}{}\".format(conf_name + \":\", conf_value))\n\n for source in sources:\n manager.log(\"{:24}{}\".format(\"Found source:\", source))\n\n # Complete list of searched paths can get very long, put them under TRACE\n for path_type, paths in manager.search_paths._asdict().items():\n if not paths:\n manager.trace(\"No %s\" % path_type)\n continue\n\n manager.trace(\"%s:\" % path_type)\n\n for pth in paths:\n manager.trace(\" %s\" % pth)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py__The_driver_dispatch._graph_we_ll_handle_it": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py__The_driver_dispatch._graph_we_ll_handle_it", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2575, "end_line": 2636, "span_ids": ["dispatch", "log_configuration"], "tokens": 668}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# The driver\n\n\ndef dispatch(sources: List[BuildSource],\n manager: BuildManager,\n stdout: TextIO,\n ) -> Graph:\n log_configuration(manager, sources)\n\n t0 = time.time()\n graph = load_graph(sources, manager)\n\n # This is a kind of unfortunate hack to work around some of fine-grained's\n # fragility: if we have loaded less than 50% of the specified files from\n # cache in fine-grained cache mode, load the graph again honestly.\n # In this case, we just turn the cache off entirely, so we don't need\n # to worry about some files being loaded and some from cache and so\n # that fine-grained mode never *writes* to the cache.\n if manager.use_fine_grained_cache() and len(graph) < 0.50 * len(sources):\n manager.log(\"Redoing load_graph without cache because too much was missing\")\n manager.cache_enabled = False\n graph = load_graph(sources, manager)\n\n t1 = time.time()\n manager.add_stats(graph_size=len(graph),\n stubs_found=sum(g.path is not None and g.path.endswith('.pyi')\n for g in graph.values()),\n graph_load_time=(t1 - t0),\n fm_cache_size=len(manager.find_module_cache.results),\n )\n if not graph:\n print(\"Nothing to do?!\", file=stdout)\n return graph\n manager.log(\"Loaded graph with %d nodes (%.3f sec)\" % (len(graph), t1 - t0))\n if manager.options.dump_graph:\n dump_graph(graph, stdout)\n return graph\n\n # Fine grained dependencies that didn't have an associated module in the build\n # are serialized separately, so we read them after we load the graph.\n # We need to read them both for running in daemon mode and if we are generating\n # a fine-grained cache (so that we can properly update them incrementally).\n # The `read_deps_cache` will also validate\n # the deps cache against the loaded individual cache files.\n if manager.options.cache_fine_grained or manager.use_fine_grained_cache():\n t2 = time.time()\n fg_deps_meta = read_deps_cache(manager, graph)\n manager.add_stats(load_fg_deps_time=time.time() - t2)\n if fg_deps_meta is not None:\n manager.fg_deps_meta = fg_deps_meta\n elif manager.stats.get('fresh_metas', 0) > 0:\n # Clear the stats so we don't infinite loop because of positive fresh_metas\n manager.stats.clear()\n # There were some cache files read, but no fine-grained dependencies loaded.\n manager.log(\"Error reading fine-grained dependencies cache -- aborting cache load\")\n manager.cache_enabled = False\n manager.log(\"Falling back to full run -- reloading graph...\")\n return dispatch(sources, manager, stdout)\n\n # If we are loading a fine-grained incremental mode cache, we\n # don't want to do a real incremental reprocess of the\n # graph---we'll handle it all later.\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_dispatch.if_not_manager_use_fine_g_dispatch.return.graph": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_dispatch.if_not_manager_use_fine_g_dispatch.return.graph", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2649, "end_line": 2669, "span_ids": ["dispatch"], "tokens": 255}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def dispatch(sources: List[BuildSource],\n manager: BuildManager,\n stdout: TextIO,\n ) -> Graph:\n # ... other code\n if not manager.use_fine_grained_cache():\n process_graph(graph, manager)\n # Update plugins snapshot.\n write_plugins_snapshot(manager)\n manager.old_plugins_snapshot = manager.plugins_snapshot\n if manager.options.cache_fine_grained or manager.options.fine_grained_incremental:\n # If we are running a daemon or are going to write cache for further fine grained use,\n # then we need to collect fine grained protocol dependencies.\n # Since these are a global property of the program, they are calculated after we\n # processed the whole graph.\n TypeState.add_all_protocol_deps(manager.fg_deps)\n if not manager.options.fine_grained_incremental:\n rdeps = generate_deps_for_cache(manager, graph)\n write_deps_cache(rdeps, manager, graph)\n\n if manager.options.dump_deps:\n # This speeds up startup a little when not using the daemon mode.\n from mypy.server.deps import dump_all_dependencies\n dump_all_dependencies(manager.modules, manager.all_types,\n manager.options.python_version, manager.options)\n return graph", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_NodeInfo_NodeInfo.dumps.return._s_s_s_n_s_n": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_NodeInfo_NodeInfo.dumps.return._s_s_s_n_s_n", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2672, "end_line": 2688, "span_ids": ["NodeInfo.dumps", "NodeInfo.__init__", "NodeInfo"], "tokens": 184}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class NodeInfo:\n \"\"\"Some info about a node in the graph of SCCs.\"\"\"\n\n def __init__(self, index: int, scc: List[str]) -> None:\n self.node_id = \"n%d\" % index\n self.scc = scc\n self.sizes = {} # type: Dict[str, int] # mod -> size in bytes\n self.deps = {} # type: Dict[str, int] # node_id -> pri\n\n def dumps(self) -> str:\n \"\"\"Convert to JSON string.\"\"\"\n total_size = sum(self.sizes.values())\n return \"[%s, %s, %s,\\n %s,\\n %s]\" % (json.dumps(self.node_id),\n json.dumps(total_size),\n json.dumps(self.scc),\n json.dumps(self.sizes),\n json.dumps(self.deps))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_dump_graph_dump_graph.print_n_join_n": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_dump_graph_dump_graph.print_n_join_n", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2691, "end_line": 2726, "span_ids": ["dump_graph"], "tokens": 325}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def dump_graph(graph: Graph, stdout: Optional[TextIO] = None) -> None:\n \"\"\"Dump the graph as a JSON string to stdout.\n\n This copies some of the work by process_graph()\n (sorted_components() and order_ascc()).\n \"\"\"\n stdout = stdout or sys.stdout\n nodes = []\n sccs = sorted_components(graph)\n for i, ascc in enumerate(sccs):\n scc = order_ascc(graph, ascc)\n node = NodeInfo(i, scc)\n nodes.append(node)\n inv_nodes = {} # module -> node_id\n for node in nodes:\n for mod in node.scc:\n inv_nodes[mod] = node.node_id\n for node in nodes:\n for mod in node.scc:\n state = graph[mod]\n size = 0\n if state.path:\n try:\n size = os.path.getsize(state.path)\n except os.error:\n pass\n node.sizes[mod] = size\n for dep in state.dependencies:\n if dep in state.priorities:\n pri = state.priorities[dep]\n if dep in inv_nodes:\n dep_id = inv_nodes[dep]\n if (dep_id != node.node_id and\n (dep_id not in node.deps or pri < node.deps[dep_id])):\n node.deps[dep_id] = pri\n print(\"[\" + \",\\n \".join(node.dumps() for node in nodes) + \"\\n]\", file=stdout)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_load_graph_load_graph._More_nodes_might_get_ad": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_load_graph_load_graph._More_nodes_might_get_ad", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2767, "end_line": 2821, "span_ids": ["load_graph"], "tokens": 516}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def load_graph(sources: List[BuildSource], manager: BuildManager,\n old_graph: Optional[Graph] = None,\n new_modules: Optional[List[State]] = None) -> Graph:\n \"\"\"Given some source files, load the full dependency graph.\n\n If an old_graph is passed in, it is used as the starting point and\n modified during graph loading.\n\n If a new_modules is passed in, any modules that are loaded are\n added to the list. This is an argument and not a return value\n so that the caller can access it even if load_graph fails.\n\n As this may need to parse files, this can raise CompileError in case\n there are syntax errors.\n \"\"\"\n\n graph = old_graph if old_graph is not None else {} # type: Graph\n\n # The deque is used to implement breadth-first traversal.\n # TODO: Consider whether to go depth-first instead. This may\n # affect the order in which we process files within import cycles.\n new = new_modules if new_modules is not None else []\n entry_points = set() # type: Set[str]\n # Seed the graph with the initial root sources.\n for bs in sources:\n try:\n st = State(id=bs.module, path=bs.path, source=bs.text, manager=manager,\n root_source=True)\n except ModuleNotFound:\n continue\n if st.id in graph:\n manager.errors.set_file(st.xpath, st.id)\n manager.errors.report(\n -1, -1,\n \"Duplicate module named '%s' (also at '%s')\" % (st.id, graph[st.id].xpath),\n blocker=True,\n )\n manager.errors.report(\n -1, -1,\n \"Are you missing an __init__.py? Alternatively, consider using --exclude to \"\n \"avoid checking one of them.\",\n severity='note'\n )\n\n manager.errors.raise_error()\n graph[st.id] = st\n new.append(st)\n entry_points.add(bs.module)\n\n # Note: Running this each time could be slow in the daemon. If it's a problem, we\n # can do more work to maintain this incrementally.\n seen_files = {st.abspath: st for st in graph.values() if st.path}\n\n # Collect dependencies. We go breadth-first.\n # More nodes might get added to new as we go, but that's fine.\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_load_graph.for_st_in_new__load_graph.return.graph": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_load_graph.for_st_in_new__load_graph.return.graph", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2785, "end_line": 2848, "span_ids": ["load_graph"], "tokens": 717}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def load_graph(sources: List[BuildSource], manager: BuildManager,\n old_graph: Optional[Graph] = None,\n new_modules: Optional[List[State]] = None) -> Graph:\n # ... other code\n for st in new:\n assert st.ancestors is not None\n # Strip out indirect dependencies. These will be dealt with\n # when they show up as direct dependencies, and there's a\n # scenario where they hurt:\n # - Suppose A imports B and B imports C.\n # - Suppose on the next round:\n # - C is deleted;\n # - B is updated to remove the dependency on C;\n # - A is unchanged.\n # - In this case A's cached *direct* dependencies are still valid\n # (since direct dependencies reflect the imports found in the source)\n # but A's cached *indirect* dependency on C is wrong.\n dependencies = [dep for dep in st.dependencies if st.priorities.get(dep) != PRI_INDIRECT]\n if not manager.use_fine_grained_cache():\n # TODO: Ideally we could skip here modules that appeared in st.suppressed\n # because they are not in build with `follow-imports=skip`.\n # This way we could avoid overhead of cloning options in `State.__init__()`\n # below to get the option value. This is quite minor performance loss however.\n added = [dep for dep in st.suppressed if find_module_simple(dep, manager)]\n else:\n # During initial loading we don't care about newly added modules,\n # they will be taken care of during fine grained update. See also\n # comment about this in `State.__init__()`.\n added = []\n for dep in st.ancestors + dependencies + st.suppressed:\n ignored = dep in st.suppressed_set and dep not in entry_points\n if ignored and dep not in added:\n manager.missing_modules.add(dep)\n elif dep not in graph:\n try:\n if dep in st.ancestors:\n # TODO: Why not 'if dep not in st.dependencies' ?\n # Ancestors don't have import context.\n newst = State(id=dep, path=None, source=None, manager=manager,\n ancestor_for=st)\n else:\n newst = State(id=dep, path=None, source=None, manager=manager,\n caller_state=st, caller_line=st.dep_line_map.get(dep, 1))\n except ModuleNotFound:\n if dep in st.dependencies_set:\n st.suppress_dependency(dep)\n else:\n if newst.path:\n newst_path = os.path.abspath(newst.path)\n\n if newst_path in seen_files:\n manager.errors.report(\n -1, 0,\n \"Source file found twice under different module names: \"\n \"'{}' and '{}'\".format(seen_files[newst_path].id, newst.id),\n blocker=True)\n manager.errors.raise_error()\n\n seen_files[newst_path] = newst\n\n assert newst.id not in graph, newst.id\n graph[newst.id] = newst\n new.append(newst)\n if dep in graph and dep in st.suppressed_set:\n # Previously suppressed file is now visible\n st.add_dependency(dep)\n manager.plugin.set_modules(manager.modules)\n return graph", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_process_graph_process_graph.for_ascc_in_sccs_.None_6.else_.process_stale_scc_graph_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_process_graph_process_graph.for_ascc_in_sccs_.None_6.else_.process_stale_scc_graph_", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2851, "end_line": 2975, "span_ids": ["process_graph"], "tokens": 1444}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def process_graph(graph: Graph, manager: BuildManager) -> None:\n \"\"\"Process everything in dependency order.\"\"\"\n sccs = sorted_components(graph)\n manager.log(\"Found %d SCCs; largest has %d nodes\" %\n (len(sccs), max(len(scc) for scc in sccs)))\n\n fresh_scc_queue = [] # type: List[List[str]]\n\n # We're processing SCCs from leaves (those without further\n # dependencies) to roots (those from which everything else can be\n # reached).\n for ascc in sccs:\n # Order the SCC's nodes using a heuristic.\n # Note that ascc is a set, and scc is a list.\n scc = order_ascc(graph, ascc)\n # If builtins is in the list, move it last. (This is a bit of\n # a hack, but it's necessary because the builtins module is\n # part of a small cycle involving at least {builtins, abc,\n # typing}. Of these, builtins must be processed last or else\n # some builtin objects will be incompletely processed.)\n if 'builtins' in ascc:\n scc.remove('builtins')\n scc.append('builtins')\n if manager.options.verbosity >= 2:\n for id in scc:\n manager.trace(\"Priorities for %s:\" % id,\n \" \".join(\"%s:%d\" % (x, graph[id].priorities[x])\n for x in graph[id].dependencies\n if x in ascc and x in graph[id].priorities))\n # Because the SCCs are presented in topological sort order, we\n # don't need to look at dependencies recursively for staleness\n # -- the immediate dependencies are sufficient.\n stale_scc = {id for id in scc if not graph[id].is_fresh()}\n fresh = not stale_scc\n deps = set()\n for id in scc:\n deps.update(graph[id].dependencies)\n deps -= ascc\n stale_deps = {id for id in deps if id in graph and not graph[id].is_interface_fresh()}\n fresh = fresh and not stale_deps\n undeps = set()\n if fresh:\n # Check if any dependencies that were suppressed according\n # to the cache have been added back in this run.\n # NOTE: Newly suppressed dependencies are handled by is_fresh().\n for id in scc:\n undeps.update(graph[id].suppressed)\n undeps &= graph.keys()\n if undeps:\n fresh = False\n if fresh:\n # All cache files are fresh. Check that no dependency's\n # cache file is newer than any scc node's cache file.\n oldest_in_scc = min(graph[id].xmeta.data_mtime for id in scc)\n viable = {id for id in stale_deps if graph[id].meta is not None}\n newest_in_deps = 0 if not viable else max(graph[dep].xmeta.data_mtime\n for dep in viable)\n if manager.options.verbosity >= 3: # Dump all mtimes for extreme debugging.\n all_ids = sorted(ascc | viable, key=lambda id: graph[id].xmeta.data_mtime)\n for id in all_ids:\n if id in scc:\n if graph[id].xmeta.data_mtime < newest_in_deps:\n key = \"*id:\"\n else:\n key = \"id:\"\n else:\n if graph[id].xmeta.data_mtime > oldest_in_scc:\n key = \"+dep:\"\n else:\n key = \"dep:\"\n manager.trace(\" %5s %.0f %s\" % (key, graph[id].xmeta.data_mtime, id))\n # If equal, give the benefit of the doubt, due to 1-sec time granularity\n # (on some platforms).\n if oldest_in_scc < newest_in_deps:\n fresh = False\n fresh_msg = \"out of date by %.0f seconds\" % (newest_in_deps - oldest_in_scc)\n else:\n fresh_msg = \"fresh\"\n elif undeps:\n fresh_msg = \"stale due to changed suppression (%s)\" % \" \".join(sorted(undeps))\n elif stale_scc:\n fresh_msg = \"inherently stale\"\n if stale_scc != ascc:\n fresh_msg += \" (%s)\" % \" \".join(sorted(stale_scc))\n if stale_deps:\n fresh_msg += \" with stale deps (%s)\" % \" \".join(sorted(stale_deps))\n else:\n fresh_msg = \"stale due to deps (%s)\" % \" \".join(sorted(stale_deps))\n\n # Initialize transitive_error for all SCC members from union\n # of transitive_error of dependencies.\n if any(graph[dep].transitive_error for dep in deps if dep in graph):\n for id in scc:\n graph[id].transitive_error = True\n\n scc_str = \" \".join(scc)\n if fresh:\n manager.trace(\"Queuing %s SCC (%s)\" % (fresh_msg, scc_str))\n fresh_scc_queue.append(scc)\n else:\n if len(fresh_scc_queue) > 0:\n manager.log(\"Processing {} queued fresh SCCs\".format(len(fresh_scc_queue)))\n # Defer processing fresh SCCs until we actually run into a stale SCC\n # and need the earlier modules to be loaded.\n #\n # Note that `process_graph` may end with us not having processed every\n # single fresh SCC. This is intentional -- we don't need those modules\n # loaded if there are no more stale SCCs to be rechecked.\n #\n # Also note we shouldn't have to worry about transitive_error here,\n # since modules with transitive errors aren't written to the cache,\n # and if any dependencies were changed, this SCC would be stale.\n # (Also, in quick_and_dirty mode we don't care about transitive errors.)\n #\n # TODO: see if it's possible to determine if we need to process only a\n # _subset_ of the past SCCs instead of having to process them all.\n for prev_scc in fresh_scc_queue:\n process_fresh_modules(graph, prev_scc, manager)\n fresh_scc_queue = []\n size = len(scc)\n if size == 1:\n manager.log(\"Processing SCC singleton (%s) as %s\" % (scc_str, fresh_msg))\n else:\n manager.log(\"Processing SCC of size %d (%s) as %s\" % (size, scc_str, fresh_msg))\n process_stale_scc(graph, scc, manager)\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_process_graph.sccs_left_process_graph.if_sccs_left_.else_.manager_log_No_fresh_SCC": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_process_graph.sccs_left_process_graph.if_sccs_left_.else_.manager_log_No_fresh_SCC", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2977, "end_line": 2985, "span_ids": ["process_graph"], "tokens": 135}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def process_graph(graph: Graph, manager: BuildManager) -> None:\n # ... other code\n\n sccs_left = len(fresh_scc_queue)\n nodes_left = sum(len(scc) for scc in fresh_scc_queue)\n manager.add_stats(sccs_left=sccs_left, nodes_left=nodes_left)\n if sccs_left:\n manager.log(\"{} fresh SCCs ({} nodes) left in queue (and will remain unprocessed)\"\n .format(sccs_left, nodes_left))\n manager.trace(str(fresh_scc_queue))\n else:\n manager.log(\"No fresh SCCs left in queue\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_order_ascc_order_ascc.return._s_for_ss_in_sccs_for_s_i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_order_ascc_order_ascc.return._s_for_ss_in_sccs_for_s_i", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2988, "end_line": 3032, "span_ids": ["order_ascc"], "tokens": 511}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def order_ascc(graph: Graph, ascc: AbstractSet[str], pri_max: int = PRI_ALL) -> List[str]:\n \"\"\"Come up with the ideal processing order within an SCC.\n\n Using the priorities assigned by all_imported_modules_in_file(),\n try to reduce the cycle to a DAG, by omitting arcs representing\n dependencies of lower priority.\n\n In the simplest case, if we have A <--> B where A has a top-level\n \"import B\" (medium priority) but B only has the reverse \"import A\"\n inside a function (low priority), we turn the cycle into a DAG by\n dropping the B --> A arc, which leaves only A --> B.\n\n If all arcs have the same priority, we fall back to sorting by\n reverse global order (the order in which modules were first\n encountered).\n\n The algorithm is recursive, as follows: when as arcs of different\n priorities are present, drop all arcs of the lowest priority,\n identify SCCs in the resulting graph, and apply the algorithm to\n each SCC thus found. The recursion is bounded because at each\n recursion the spread in priorities is (at least) one less.\n\n In practice there are only a few priority levels (less than a\n dozen) and in the worst case we just carry out the same algorithm\n for finding SCCs N times. Thus the complexity is no worse than\n the complexity of the original SCC-finding algorithm -- see\n strongly_connected_components() below for a reference.\n \"\"\"\n if len(ascc) == 1:\n return [s for s in ascc]\n pri_spread = set()\n for id in ascc:\n state = graph[id]\n for dep in state.dependencies:\n if dep in ascc:\n pri = state.priorities.get(dep, PRI_HIGH)\n if pri < pri_max:\n pri_spread.add(pri)\n if len(pri_spread) == 1:\n # Filtered dependencies are uniform -- order by global order.\n return sorted(ascc, key=lambda id: -graph[id].order)\n pri_max = max(pri_spread)\n sccs = sorted_components(graph, ascc, pri_max)\n # The recursion is bounded by the len(pri_spread) check above.\n return [s for ss in sccs for s in order_ascc(graph, ss, pri_max)]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_process_fresh_modules_process_fresh_modules.manager_add_stats_process": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_process_fresh_modules_process_fresh_modules.manager_add_stats_process", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3035, "end_line": 3048, "span_ids": ["process_fresh_modules"], "tokens": 137}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def process_fresh_modules(graph: Graph, modules: List[str], manager: BuildManager) -> None:\n \"\"\"Process the modules in one group of modules from their cached data.\n\n This can be used to process an SCC of modules\n This involves loading the tree from JSON and then doing various cleanups.\n \"\"\"\n t0 = time.time()\n for id in modules:\n graph[id].load_tree()\n t1 = time.time()\n for id in modules:\n graph[id].fix_cross_refs()\n t2 = time.time()\n manager.add_stats(process_fresh_time=t2 - t0, load_tree_time=t1 - t0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_process_stale_scc_process_stale_scc.None_6.graph_id_mark_as_recheck": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_process_stale_scc_process_stale_scc.None_6.graph_id_mark_as_recheck", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3051, "end_line": 3093, "span_ids": ["process_stale_scc"], "tokens": 402}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def process_stale_scc(graph: Graph, scc: List[str], manager: BuildManager) -> None:\n \"\"\"Process the modules in one SCC from source code.\n\n Exception: If quick_and_dirty is set, use the cache for fresh modules.\n \"\"\"\n stale = scc\n for id in stale:\n # We may already have parsed the module, or not.\n # If the former, parse_file() is a no-op.\n graph[id].parse_file()\n if 'typing' in scc:\n # For historical reasons we need to manually add typing aliases\n # for built-in generic collections, see docstring of\n # SemanticAnalyzerPass2.add_builtin_aliases for details.\n typing_mod = graph['typing'].tree\n assert typing_mod, \"The typing module was not parsed\"\n mypy.semanal_main.semantic_analysis_for_scc(graph, scc, manager.errors)\n\n # Track what modules aren't yet done so we can finish them as soon\n # as possible, saving memory.\n unfinished_modules = set(stale)\n for id in stale:\n graph[id].type_check_first_pass()\n if not graph[id].type_checker().deferred_nodes:\n unfinished_modules.discard(id)\n graph[id].finish_passes()\n\n while unfinished_modules:\n for id in stale:\n if id not in unfinished_modules:\n continue\n if not graph[id].type_check_second_pass():\n unfinished_modules.discard(id)\n graph[id].finish_passes()\n for id in stale:\n graph[id].generate_unused_ignore_notes()\n if any(manager.errors.is_errors_for_file(graph[id].xpath) for id in stale):\n for id in stale:\n graph[id].transitive_error = True\n for id in stale:\n manager.flush_errors(manager.errors.file_messages(graph[id].xpath), False)\n graph[id].write_cache()\n graph[id].mark_as_rechecked()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_sorted_components_sorted_components.return.res": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_sorted_components_sorted_components.return.res", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3096, "end_line": 3132, "span_ids": ["sorted_components"], "tokens": 446}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def sorted_components(graph: Graph,\n vertices: Optional[AbstractSet[str]] = None,\n pri_max: int = PRI_ALL) -> List[AbstractSet[str]]:\n \"\"\"Return the graph's SCCs, topologically sorted by dependencies.\n\n The sort order is from leaves (nodes without dependencies) to\n roots (nodes on which no other nodes depend).\n\n This works for a subset of the full dependency graph too;\n dependencies that aren't present in graph.keys() are ignored.\n \"\"\"\n # Compute SCCs.\n if vertices is None:\n vertices = set(graph)\n edges = {id: deps_filtered(graph, vertices, id, pri_max) for id in vertices}\n sccs = list(strongly_connected_components(vertices, edges))\n # Topsort.\n sccsmap = {id: frozenset(scc) for scc in sccs for id in scc}\n data = {} # type: Dict[AbstractSet[str], Set[AbstractSet[str]]]\n for scc in sccs:\n deps = set() # type: Set[AbstractSet[str]]\n for id in scc:\n deps.update(sccsmap[x] for x in deps_filtered(graph, vertices, id, pri_max))\n data[frozenset(scc)] = deps\n res = []\n for ready in topsort(data):\n # Sort the sets in ready by reversed smallest State.order. Examples:\n #\n # - If ready is [{x}, {y}], x.order == 1, y.order == 2, we get\n # [{y}, {x}].\n #\n # - If ready is [{a, b}, {c, d}], a.order == 1, b.order == 3,\n # c.order == 2, d.order == 4, the sort keys become [1, 2]\n # and the result is [{c, d}, {a, b}].\n res.extend(sorted(ready,\n key=lambda scc: -min(graph[id].order for id in scc)))\n return res", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_deps_filtered_strongly_connected_components._type_List_int_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_deps_filtered_strongly_connected_components._type_List_int_", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3135, "end_line": 3164, "span_ids": ["deps_filtered", "strongly_connected_components"], "tokens": 265}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def deps_filtered(graph: Graph, vertices: AbstractSet[str], id: str, pri_max: int) -> List[str]:\n \"\"\"Filter dependencies for id with pri < pri_max.\"\"\"\n if id not in vertices:\n return []\n state = graph[id]\n return [dep\n for dep in state.dependencies\n if dep in vertices and state.priorities.get(dep, PRI_HIGH) < pri_max]\n\n\ndef strongly_connected_components(vertices: AbstractSet[str],\n edges: Dict[str, List[str]]) -> Iterator[Set[str]]:\n \"\"\"Compute Strongly Connected Components of a directed graph.\n\n Args:\n vertices: the labels for the vertices\n edges: for each vertex, gives the target vertices of its outgoing edges\n\n Returns:\n An iterator yielding strongly connected components, each\n represented as a set of vertices. Each input vertex will occur\n exactly once; vertices not part of a SCC are returned as\n singleton sets.\n\n From http://code.activestate.com/recipes/578507/.\n \"\"\"\n identified = set() # type: Set[str]\n stack = [] # type: List[str]\n index = {} # type: Dict[str, int]\n boundaries = [] # type: List[int]\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_strongly_connected_components.dfs_strongly_connected_components.for_v_in_vertices_.if_v_not_in_index_.yield_from_dfs_v_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_strongly_connected_components.dfs_strongly_connected_components.for_v_in_vertices_.if_v_not_in_index_.yield_from_dfs_v_", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3166, "end_line": 3187, "span_ids": ["strongly_connected_components"], "tokens": 165}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def strongly_connected_components(vertices: AbstractSet[str],\n edges: Dict[str, List[str]]) -> Iterator[Set[str]]:\n # ... other code\n\n def dfs(v: str) -> Iterator[Set[str]]:\n index[v] = len(stack)\n stack.append(v)\n boundaries.append(index[v])\n\n for w in edges[v]:\n if w not in index:\n yield from dfs(w)\n elif w not in identified:\n while index[w] < boundaries[-1]:\n boundaries.pop()\n\n if boundaries[-1] == index[v]:\n boundaries.pop()\n scc = set(stack[index[v]:])\n del stack[index[v]:]\n identified.update(scc)\n yield scc\n\n for v in vertices:\n if v not in index:\n yield from dfs(v)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker_TypeChecker._type_Plugin": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker_TypeChecker._type_Plugin", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 145, "end_line": 207, "span_ids": ["TypeChecker"], "tokens": 626}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n \"\"\"Mypy type checker.\n\n Type check mypy source files that have been semantically analyzed.\n\n You must create a separate instance for each source file.\n \"\"\"\n\n # Are we type checking a stub?\n is_stub = False\n # Error message reporter\n errors = None # type: Errors\n # Utility for generating messages\n msg = None # type: MessageBuilder\n # Types of type checked nodes\n type_map = None # type: Dict[Expression, Type]\n\n # Helper for managing conditional types\n binder = None # type: ConditionalTypeBinder\n # Helper for type checking expressions\n expr_checker = None # type: mypy.checkexpr.ExpressionChecker\n\n tscope = None # type: Scope\n scope = None # type: CheckerScope\n # Stack of function return types\n return_types = None # type: List[Type]\n # Flags; true for dynamically typed functions\n dynamic_funcs = None # type: List[bool]\n # Stack of collections of variables with partial types\n partial_types = None # type: List[PartialTypeScope]\n # Vars for which partial type errors are already reported\n # (to avoid logically duplicate errors with different error context).\n partial_reported = None # type: Set[Var]\n globals = None # type: SymbolTable\n modules = None # type: Dict[str, MypyFile]\n # Nodes that couldn't be checked because some types weren't available. We'll run\n # another pass and try these again.\n deferred_nodes = None # type: List[DeferredNode]\n # Type checking pass number (0 = first pass)\n pass_num = 0\n # Last pass number to take\n last_pass = DEFAULT_LAST_PASS\n # Have we deferred the current function? If yes, don't infer additional\n # types during this pass within the function.\n current_node_deferred = False\n # Is this file a typeshed stub?\n is_typeshed_stub = False\n # Should strict Optional-related errors be suppressed in this file?\n suppress_none_errors = False # TODO: Get it from options instead\n options = None # type: Options\n # Used for collecting inferred attribute types so that they can be checked\n # for consistency.\n inferred_attribute_types = None # type: Optional[Dict[Var, Type]]\n # Don't infer partial None types if we are processing assignment from Union\n no_partial_types = False # type: bool\n\n # The set of all dependencies (suppressed or not) that this module accesses, either\n # directly or indirectly.\n module_refs = None # type: Set[str]\n\n # Plugin that provides special type checking rules for specific library\n # functions such as open(), etc.\n plugin = None # type: Plugin", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.__init___TypeChecker.type_context.return.self_expr_checker_type_co": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.__init___TypeChecker.type_context.return.self_expr_checker_type_co", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 209, "end_line": 257, "span_ids": ["TypeChecker.__init__", "TypeChecker.type_context"], "tokens": 483}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def __init__(self, errors: Errors, modules: Dict[str, MypyFile], options: Options,\n tree: MypyFile, path: str, plugin: Plugin) -> None:\n \"\"\"Construct a type checker.\n\n Use errors to report type check errors.\n \"\"\"\n self.errors = errors\n self.modules = modules\n self.options = options\n self.tree = tree\n self.path = path\n self.msg = MessageBuilder(errors, modules)\n self.plugin = plugin\n self.expr_checker = mypy.checkexpr.ExpressionChecker(self, self.msg, self.plugin)\n self.tscope = Scope()\n self.scope = CheckerScope(tree)\n self.binder = ConditionalTypeBinder()\n self.globals = tree.names\n self.return_types = []\n self.dynamic_funcs = []\n self.partial_types = []\n self.partial_reported = set()\n self.deferred_nodes = []\n self.type_map = {}\n self.module_refs = set()\n self.pass_num = 0\n self.current_node_deferred = False\n self.is_stub = tree.is_stub\n self.is_typeshed_stub = is_typeshed_file(path)\n self.inferred_attribute_types = None\n if options.strict_optional_whitelist is None:\n self.suppress_none_errors = not options.show_none_errors\n else:\n self.suppress_none_errors = not any(fnmatch.fnmatch(path, pattern)\n for pattern\n in options.strict_optional_whitelist)\n # If True, process function definitions. If False, don't. This is used\n # for processing module top levels in fine-grained incremental mode.\n self.recurse_into_functions = True\n # This internal flag is used to track whether we a currently type-checking\n # a final declaration (assignment), so that some errors should be suppressed.\n # Should not be set manually, use get_final_context/enter_final_context instead.\n # NOTE: we use the context manager to avoid \"threading\" an additional `is_final_def`\n # argument through various `checker` and `checkmember` functions.\n self._is_final_def = False\n\n @property\n def type_context(self) -> List[Optional[Type]]:\n return self.expr_checker.type_context", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.reset_TypeChecker.reset.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.reset_TypeChecker.reset.None_4", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 259, "end_line": 275, "span_ids": ["TypeChecker.reset"], "tokens": 144}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def reset(self) -> None:\n \"\"\"Cleanup stale state that might be left over from a typechecking run.\n\n This allows us to reuse TypeChecker objects in fine-grained\n incremental mode.\n \"\"\"\n # TODO: verify this is still actually worth it over creating new checkers\n self.partial_reported.clear()\n self.module_refs.clear()\n self.binder = ConditionalTypeBinder()\n self.type_map.clear()\n\n assert self.inferred_attribute_types is None\n assert self.partial_types == []\n assert self.deferred_nodes == []\n assert len(self.scope.stack) == 1\n assert self.partial_types == []", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_first_pass_TypeChecker.check_first_pass.with_state_strict_optiona.self_tscope_leave_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_first_pass_TypeChecker.check_first_pass.with_state_strict_optiona.self_tscope_leave_", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 277, "end_line": 312, "span_ids": ["TypeChecker.check_first_pass"], "tokens": 352}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def check_first_pass(self) -> None:\n \"\"\"Type check the entire file, but defer functions with unresolved references.\n\n Unresolved references are forward references to variables\n whose types haven't been inferred yet. They may occur later\n in the same file or in a different file that's being processed\n later (usually due to an import cycle).\n\n Deferred functions will be processed by check_second_pass().\n \"\"\"\n self.recurse_into_functions = True\n with state.strict_optional_set(self.options.strict_optional):\n self.errors.set_file(self.path, self.tree.fullname, scope=self.tscope)\n self.tscope.enter_file(self.tree.fullname)\n with self.enter_partial_types():\n with self.binder.top_frame_context():\n for d in self.tree.defs:\n self.accept(d)\n\n assert not self.current_node_deferred\n\n all_ = self.globals.get('__all__')\n if all_ is not None and all_.type is not None:\n all_node = all_.node\n assert all_node is not None\n seq_str = self.named_generic_type('typing.Sequence',\n [self.named_type('builtins.str')])\n if self.options.python_version[0] < 3:\n seq_str = self.named_generic_type('typing.Sequence',\n [self.named_type('builtins.unicode')])\n if not is_subtype(all_.type, seq_str):\n str_seq_s, all_s = format_type_distinctly(seq_str, all_.type)\n self.fail(message_registry.ALL_MUST_BE_SEQ_STR.format(str_seq_s, all_s),\n all_node)\n\n self.tscope.leave()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_second_pass_TypeChecker.check_second_pass.with_state_strict_optiona.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_second_pass_TypeChecker.check_second_pass.with_state_strict_optiona.return.True", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 314, "end_line": 346, "span_ids": ["TypeChecker.check_second_pass"], "tokens": 319}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def check_second_pass(self,\n todo: Optional[Sequence[Union[DeferredNode,\n FineGrainedDeferredNode]]] = None\n ) -> bool:\n \"\"\"Run second or following pass of type checking.\n\n This goes through deferred nodes, returning True if there were any.\n \"\"\"\n self.recurse_into_functions = True\n with state.strict_optional_set(self.options.strict_optional):\n if not todo and not self.deferred_nodes:\n return False\n self.errors.set_file(self.path, self.tree.fullname, scope=self.tscope)\n self.tscope.enter_file(self.tree.fullname)\n self.pass_num += 1\n if not todo:\n todo = self.deferred_nodes\n else:\n assert not self.deferred_nodes\n self.deferred_nodes = []\n done = set() # type: Set[Union[DeferredNodeType, FineGrainedDeferredNodeType]]\n for node, active_typeinfo in todo:\n if node in done:\n continue\n # This is useful for debugging:\n # print(\"XXX in pass %d, class %s, function %s\" %\n # (self.pass_num, type_name, node.fullname or node.name))\n done.add(node)\n with self.tscope.class_scope(active_typeinfo) if active_typeinfo else nothing():\n with self.scope.push_class(active_typeinfo) if active_typeinfo else nothing():\n self.check_partial(node)\n self.tscope.leave()\n return True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_partial_TypeChecker.check_top_level._TODO_Handle___all__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_partial_TypeChecker.check_top_level._TODO_Handle___all__", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 348, "end_line": 367, "span_ids": ["TypeChecker.check_partial", "TypeChecker.check_top_level"], "tokens": 174}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def check_partial(self, node: Union[DeferredNodeType, FineGrainedDeferredNodeType]) -> None:\n if isinstance(node, MypyFile):\n self.check_top_level(node)\n else:\n self.recurse_into_functions = True\n if isinstance(node, LambdaExpr):\n self.expr_checker.accept(node)\n else:\n self.accept(node)\n\n def check_top_level(self, node: MypyFile) -> None:\n \"\"\"Check only the top-level of a module, skipping function definitions.\"\"\"\n self.recurse_into_functions = False\n with self.enter_partial_types():\n with self.binder.top_frame_context():\n for d in node.defs:\n d.accept(self)\n\n assert not self.current_node_deferred\n # TODO: Handle __all__", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.defer_node_TypeChecker.defer_node.self_deferred_nodes_appen": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.defer_node_TypeChecker.defer_node.self_deferred_nodes_appen", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 369, "end_line": 380, "span_ids": ["TypeChecker.defer_node"], "tokens": 148}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def defer_node(self, node: DeferredNodeType, enclosing_class: Optional[TypeInfo]) -> None:\n \"\"\"Defer a node for processing during next type-checking pass.\n\n Args:\n node: function/method being deferred\n enclosing_class: for methods, the class where the method is defined\n NOTE: this can't handle nested functions/methods.\n \"\"\"\n # We don't freeze the entire scope since only top-level functions and methods\n # can be deferred. Only module/class level scope information is needed.\n # Module-level scope information is preserved in the TypeChecker instance.\n self.deferred_nodes.append(DeferredNode(node, enclosing_class))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.handle_cannot_determine_type_TypeChecker.handle_cannot_determine_type.if_self_pass_num_self_l.else_.self_msg_cannot_determine": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.handle_cannot_determine_type_TypeChecker.handle_cannot_determine_type.if_self_pass_num_self_l.else_.self_msg_cannot_determine", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 382, "end_line": 396, "span_ids": ["TypeChecker.handle_cannot_determine_type"], "tokens": 200}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def handle_cannot_determine_type(self, name: str, context: Context) -> None:\n node = self.scope.top_non_lambda_function()\n if self.pass_num < self.last_pass and isinstance(node, FuncDef):\n # Don't report an error yet. Just defer. Note that we don't defer\n # lambdas because they are coupled to the surrounding function\n # through the binder and the inferred type of the lambda, so it\n # would get messy.\n enclosing_class = self.scope.enclosing_class()\n self.defer_node(node, enclosing_class)\n # Set a marker so that we won't infer additional types in this\n # function. Any inferred types could be bogus, because there's at\n # least one type that we don't know.\n self.current_node_deferred = True\n else:\n self.msg.cannot_determine_type(name, context)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.accept_TypeChecker.visit_overloaded_func_def.with_self_tscope_function.self__visit_overloaded_fu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.accept_TypeChecker.visit_overloaded_func_def.with_self_tscope_function.self__visit_overloaded_fu", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 398, "end_line": 434, "span_ids": ["TypeChecker.accept", "TypeChecker.visit_overloaded_func_def", "TypeChecker.accept_loop"], "tokens": 316}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def accept(self, stmt: Statement) -> None:\n \"\"\"Type check a node in the given type context.\"\"\"\n try:\n stmt.accept(self)\n except Exception as err:\n report_internal_error(err, self.errors.file, stmt.line, self.errors, self.options)\n\n def accept_loop(self, body: Statement, else_body: Optional[Statement] = None, *,\n exit_condition: Optional[Expression] = None) -> None:\n \"\"\"Repeatedly type check a loop body until the frame doesn't change.\n If exit_condition is set, assume it must be False on exit from the loop.\n\n Then check the else_body.\n \"\"\"\n # The outer frame accumulates the results of all iterations\n with self.binder.frame_context(can_skip=False):\n while True:\n with self.binder.frame_context(can_skip=True,\n break_frame=2, continue_frame=1):\n self.accept(body)\n if not self.binder.last_pop_changed:\n break\n if exit_condition:\n _, else_map = self.find_isinstance_check(exit_condition)\n self.push_type_map(else_map)\n if else_body:\n self.accept(else_body)\n\n #\n # Definitions\n #\n\n def visit_overloaded_func_def(self, defn: OverloadedFuncDef) -> None:\n if not self.recurse_into_functions:\n return\n with self.tscope.function_scope(defn):\n self._visit_overloaded_func_def(defn)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker._visit_overloaded_func_def_TypeChecker._visit_overloaded_func_def.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker._visit_overloaded_func_def_TypeChecker._visit_overloaded_func_def.return.None", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 436, "end_line": 462, "span_ids": ["TypeChecker._visit_overloaded_func_def"], "tokens": 268}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def _visit_overloaded_func_def(self, defn: OverloadedFuncDef) -> None:\n num_abstract = 0\n if not defn.items:\n # In this case we have already complained about none of these being\n # valid overloads.\n return None\n if len(defn.items) == 1:\n self.fail(message_registry.MULTIPLE_OVERLOADS_REQUIRED, defn)\n\n if defn.is_property:\n # HACK: Infer the type of the property.\n self.visit_decorator(cast(Decorator, defn.items[0]))\n for fdef in defn.items:\n assert isinstance(fdef, Decorator)\n self.check_func_item(fdef.func, name=fdef.func.name)\n if fdef.func.is_abstract:\n num_abstract += 1\n if num_abstract not in (0, len(defn.items)):\n self.fail(message_registry.INCONSISTENT_ABSTRACT_OVERLOAD, defn)\n if defn.impl:\n defn.impl.accept(self)\n if defn.info:\n self.check_method_override(defn)\n self.check_inplace_operator_method(defn)\n if not defn.is_property:\n self.check_overlapping_overloads(defn)\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_overlapping_overloads_TypeChecker.check_overlapping_overloads.is_descriptor_get.defn_info_and_defn_name_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_overlapping_overloads_TypeChecker.check_overlapping_overloads.is_descriptor_get.defn_info_and_defn_name_", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 464, "end_line": 485, "span_ids": ["TypeChecker.check_overlapping_overloads"], "tokens": 251}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def check_overlapping_overloads(self, defn: OverloadedFuncDef) -> None:\n # At this point we should have set the impl already, and all remaining\n # items are decorators\n\n # Compute some info about the implementation (if it exists) for use below\n impl_type = None # type: Optional[CallableType]\n if defn.impl:\n if isinstance(defn.impl, FuncDef):\n inner_type = defn.impl.type # type: Optional[Type]\n elif isinstance(defn.impl, Decorator):\n inner_type = defn.impl.var.type\n else:\n assert False, \"Impl isn't the right type\"\n\n # This can happen if we've got an overload with a different\n # decorator or if the implementation is untyped -- we gave up on the types.\n inner_type = get_proper_type(inner_type)\n if inner_type is not None and not isinstance(inner_type, AnyType):\n assert isinstance(inner_type, CallableType)\n impl_type = inner_type\n\n is_descriptor_get = defn.info and defn.name == \"__get__\"\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_overlapping_overloads.for_i_item_in_enumerate__TypeChecker.check_overlapping_overloads.for_i_item_in_enumerate_.if_impl_type_is_not_None_.if_not_is_subtype_no_prom.self_msg_overloaded_signa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_overlapping_overloads.for_i_item_in_enumerate__TypeChecker.check_overlapping_overloads.for_i_item_in_enumerate_.if_impl_type_is_not_None_.if_not_is_subtype_no_prom.self_msg_overloaded_signa", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 486, "end_line": 556, "span_ids": ["TypeChecker.check_overlapping_overloads"], "tokens": 757}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def check_overlapping_overloads(self, defn: OverloadedFuncDef) -> None:\n # ... other code\n for i, item in enumerate(defn.items):\n # TODO overloads involving decorators\n assert isinstance(item, Decorator)\n sig1 = self.function_type(item.func)\n assert isinstance(sig1, CallableType)\n\n for j, item2 in enumerate(defn.items[i + 1:]):\n assert isinstance(item2, Decorator)\n sig2 = self.function_type(item2.func)\n assert isinstance(sig2, CallableType)\n\n if not are_argument_counts_overlapping(sig1, sig2):\n continue\n\n if overload_can_never_match(sig1, sig2):\n self.msg.overloaded_signature_will_never_match(\n i + 1, i + j + 2, item2.func)\n elif not is_descriptor_get:\n # Note: we force mypy to check overload signatures in strict-optional mode\n # so we don't incorrectly report errors when a user tries typing an overload\n # that happens to have a 'if the argument is None' fallback.\n #\n # For example, the following is fine in strict-optional mode but would throw\n # the unsafe overlap error when strict-optional is disabled:\n #\n # @overload\n # def foo(x: None) -> int: ...\n # @overload\n # def foo(x: str) -> str: ...\n #\n # See Python 2's map function for a concrete example of this kind of overload.\n with state.strict_optional_set(True):\n if is_unsafe_overlapping_overload_signatures(sig1, sig2):\n self.msg.overloaded_signatures_overlap(\n i + 1, i + j + 2, item.func)\n\n if impl_type is not None:\n assert defn.impl is not None\n\n # We perform a unification step that's very similar to what\n # 'is_callable_compatible' would have done if we had set\n # 'unify_generics' to True -- the only difference is that\n # we check and see if the impl_type's return value is a\n # *supertype* of the overload alternative, not a *subtype*.\n #\n # This is to match the direction the implementation's return\n # needs to be compatible in.\n if impl_type.variables:\n impl = unify_generic_callable(impl_type, sig1,\n ignore_return=False,\n return_constraint_direction=SUPERTYPE_OF)\n if impl is None:\n self.msg.overloaded_signatures_typevar_specific(i + 1, defn.impl)\n continue\n else:\n impl = impl_type\n\n # Prevent extra noise from inconsistent use of @classmethod by copying\n # the first arg from the method being checked against.\n if sig1.arg_types and defn.info:\n impl = impl.copy_modified(arg_types=[sig1.arg_types[0]] + impl.arg_types[1:])\n\n # Is the overload alternative's arguments subtypes of the implementation's?\n if not is_callable_compatible(impl, sig1,\n is_compat=is_subtype_no_promote,\n ignore_return=True):\n self.msg.overloaded_signatures_arg_specific(i + 1, defn.impl)\n\n # Is the overload alternative's return type a subtype of the implementation's?\n if not is_subtype_no_promote(sig1.ret_type, impl.ret_type):\n self.msg.overloaded_signatures_ret_specific(i + 1, defn.impl)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker._Here_s_the_scoop_about__TypeChecker._get_generator_return_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker._Here_s_the_scoop_about__TypeChecker._get_generator_return_", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 558, "end_line": 599, "span_ids": ["TypeChecker.check_overlapping_overloads"], "tokens": 575}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n # Here's the scoop about generators and coroutines.\n #\n # There are two kinds of generators: classic generators (functions\n # with `yield` or `yield from` in the body) and coroutines\n # (functions declared with `async def`). The latter are specified\n # in PEP 492 and only available in Python >= 3.5.\n #\n # Classic generators can be parameterized with three types:\n # - ty is the Yield type (the type of y in `yield y`)\n # - tc is the type reCeived by yield (the type of c in `c = yield`).\n # - tr is the Return type (the type of r in `return r`)\n #\n # A classic generator must define a return type that's either\n # `Generator[ty, tc, tr]`, Iterator[ty], or Iterable[ty] (or\n # object or Any). If tc/tr are not given, both are None.\n #\n # A coroutine must define a return type corresponding to tr; the\n # other two are unconstrained. The \"external\" return type (seen\n # by the caller) is Awaitable[tr].\n #\n # In addition, there's the synthetic type AwaitableGenerator: it\n # inherits from both Awaitable and Generator and can be used both\n # in `yield from` and in `await`. This type is set automatically\n # for functions decorated with `@types.coroutine` or\n # `@asyncio.coroutine`. Its single parameter corresponds to tr.\n #\n # PEP 525 adds a new type, the asynchronous generator, which was\n # first released in Python 3.6. Async generators are `async def`\n # functions that can also `yield` values. They can be parameterized\n # with two types, ty and tc, because they cannot return a value.\n #\n # There are several useful methods, each taking a type t and a\n # flag c indicating whether it's for a generator or coroutine:\n #\n # - is_generator_return_type(t, c) returns whether t is a Generator,\n # Iterator, Iterable (if not c), or Awaitable (if c), or\n # AwaitableGenerator (regardless of c).\n # - is_async_generator_return_type(t) returns whether t is an\n # AsyncGenerator.\n # - get_generator_yield_type(t, c) returns ty.\n # - get_generator_receive_type(t, c) returns tc.\n # - get_generator_return_type(t, c) returns tr.", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.is_generator_return_type_TypeChecker.is_generator_return_type.return.isinstance_typ_Instance_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.is_generator_return_type_TypeChecker.is_generator_return_type.return.isinstance_typ_Instance_", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 601, "end_line": 618, "span_ids": ["TypeChecker.is_generator_return_type"], "tokens": 220}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def is_generator_return_type(self, typ: Type, is_coroutine: bool) -> bool:\n \"\"\"Is `typ` a valid type for a generator/coroutine?\n\n True if `typ` is a *supertype* of Generator or Awaitable.\n Also true it it's *exactly* AwaitableGenerator (modulo type parameters).\n \"\"\"\n typ = get_proper_type(typ)\n if is_coroutine:\n # This means we're in Python 3.5 or later.\n at = self.named_generic_type('typing.Awaitable', [AnyType(TypeOfAny.special_form)])\n if is_subtype(at, typ):\n return True\n else:\n any_type = AnyType(TypeOfAny.special_form)\n gt = self.named_generic_type('typing.Generator', [any_type, any_type, any_type])\n if is_subtype(gt, typ):\n return True\n return isinstance(typ, Instance) and typ.type.fullname == 'typing.AwaitableGenerator'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.is_async_generator_return_type_TypeChecker.is_async_generator_return_type.return.is_subtype_agt_typ_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.is_async_generator_return_type_TypeChecker.is_async_generator_return_type.return.is_subtype_agt_typ_", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 620, "end_line": 631, "span_ids": ["TypeChecker.is_async_generator_return_type"], "tokens": 128}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def is_async_generator_return_type(self, typ: Type) -> bool:\n \"\"\"Is `typ` a valid type for an async generator?\n\n True if `typ` is a supertype of AsyncGenerator.\n \"\"\"\n try:\n any_type = AnyType(TypeOfAny.special_form)\n agt = self.named_generic_type('typing.AsyncGenerator', [any_type, any_type])\n except KeyError:\n # we're running on a version of typing that doesn't have AsyncGenerator yet\n return False\n return is_subtype(agt, typ)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.get_generator_yield_type_TypeChecker.get_generator_yield_type.if_isinstance_return_type.else_.return.AnyType_TypeOfAny_special": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.get_generator_yield_type_TypeChecker.get_generator_yield_type.if_isinstance_return_type.else_.return.AnyType_TypeOfAny_special", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 633, "end_line": 660, "span_ids": ["TypeChecker.get_generator_yield_type"], "tokens": 368}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def get_generator_yield_type(self, return_type: Type, is_coroutine: bool) -> Type:\n \"\"\"Given the declared return type of a generator (t), return the type it yields (ty).\"\"\"\n return_type = get_proper_type(return_type)\n\n if isinstance(return_type, AnyType):\n return AnyType(TypeOfAny.from_another_any, source_any=return_type)\n elif (not self.is_generator_return_type(return_type, is_coroutine)\n and not self.is_async_generator_return_type(return_type)):\n # If the function doesn't have a proper Generator (or\n # Awaitable) return type, anything is permissible.\n return AnyType(TypeOfAny.from_error)\n elif not isinstance(return_type, Instance):\n # Same as above, but written as a separate branch so the typechecker can understand.\n return AnyType(TypeOfAny.from_error)\n elif return_type.type.fullname == 'typing.Awaitable':\n # Awaitable: ty is Any.\n return AnyType(TypeOfAny.special_form)\n elif return_type.args:\n # AwaitableGenerator, Generator, AsyncGenerator, Iterator, or Iterable; ty is args[0].\n ret_type = return_type.args[0]\n # TODO not best fix, better have dedicated yield token\n return ret_type\n else:\n # If the function's declared supertype of Generator has no type\n # parameters (i.e. is `object`), then the yielded values can't\n # be accessed so any type is acceptable. IOW, ty is Any.\n # (However, see https://github.com/python/mypy/issues/1933)\n return AnyType(TypeOfAny.special_form)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.get_generator_receive_type_TypeChecker.get_generator_receive_type.if_isinstance_return_type.else_.return.NoneType_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.get_generator_receive_type_TypeChecker.get_generator_receive_type.if_isinstance_return_type.else_.return.NoneType_", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 662, "end_line": 688, "span_ids": ["TypeChecker.get_generator_receive_type"], "tokens": 356}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def get_generator_receive_type(self, return_type: Type, is_coroutine: bool) -> Type:\n \"\"\"Given a declared generator return type (t), return the type its yield receives (tc).\"\"\"\n return_type = get_proper_type(return_type)\n\n if isinstance(return_type, AnyType):\n return AnyType(TypeOfAny.from_another_any, source_any=return_type)\n elif (not self.is_generator_return_type(return_type, is_coroutine)\n and not self.is_async_generator_return_type(return_type)):\n # If the function doesn't have a proper Generator (or\n # Awaitable) return type, anything is permissible.\n return AnyType(TypeOfAny.from_error)\n elif not isinstance(return_type, Instance):\n # Same as above, but written as a separate branch so the typechecker can understand.\n return AnyType(TypeOfAny.from_error)\n elif return_type.type.fullname == 'typing.Awaitable':\n # Awaitable, AwaitableGenerator: tc is Any.\n return AnyType(TypeOfAny.special_form)\n elif (return_type.type.fullname in ('typing.Generator', 'typing.AwaitableGenerator')\n and len(return_type.args) >= 3):\n # Generator: tc is args[1].\n return return_type.args[1]\n elif return_type.type.fullname == 'typing.AsyncGenerator' and len(return_type.args) >= 2:\n return return_type.args[1]\n else:\n # `return_type` is a supertype of Generator, so callers won't be able to send it\n # values. IOW, tc is None.\n return NoneType()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.get_coroutine_return_type_TypeChecker.visit_func_def.with_self_tscope_function.self__visit_func_def_defn": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.get_coroutine_return_type_TypeChecker.visit_func_def.with_self_tscope_function.self__visit_func_def_defn", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 690, "end_line": 726, "span_ids": ["TypeChecker.get_coroutine_return_type", "TypeChecker.get_generator_return_type", "TypeChecker.visit_func_def"], "tokens": 454}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def get_coroutine_return_type(self, return_type: Type) -> Type:\n return_type = get_proper_type(return_type)\n if isinstance(return_type, AnyType):\n return AnyType(TypeOfAny.from_another_any, source_any=return_type)\n assert isinstance(return_type, Instance), \"Should only be called on coroutine functions.\"\n # Note: return type is the 3rd type parameter of Coroutine.\n return return_type.args[2]\n\n def get_generator_return_type(self, return_type: Type, is_coroutine: bool) -> Type:\n \"\"\"Given the declared return type of a generator (t), return the type it returns (tr).\"\"\"\n return_type = get_proper_type(return_type)\n\n if isinstance(return_type, AnyType):\n return AnyType(TypeOfAny.from_another_any, source_any=return_type)\n elif not self.is_generator_return_type(return_type, is_coroutine):\n # If the function doesn't have a proper Generator (or\n # Awaitable) return type, anything is permissible.\n return AnyType(TypeOfAny.from_error)\n elif not isinstance(return_type, Instance):\n # Same as above, but written as a separate branch so the typechecker can understand.\n return AnyType(TypeOfAny.from_error)\n elif return_type.type.fullname == 'typing.Awaitable' and len(return_type.args) == 1:\n # Awaitable: tr is args[0].\n return return_type.args[0]\n elif (return_type.type.fullname in ('typing.Generator', 'typing.AwaitableGenerator')\n and len(return_type.args) >= 3):\n # AwaitableGenerator, Generator: tr is args[2].\n return return_type.args[2]\n else:\n # Supertype of Generator (Iterator, Iterable, object): tr is any.\n return AnyType(TypeOfAny.special_form)\n\n def visit_func_def(self, defn: FuncDef) -> None:\n if not self.recurse_into_functions:\n return\n with self.tscope.function_scope(defn):\n self._visit_func_def(defn)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker._visit_func_def_TypeChecker._visit_func_def.if_defn_original_def_.if_isinstance_defn_origin.else_.if_isinstance_orig_type_.else_.self_check_subtype_new_ty": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker._visit_func_def_TypeChecker._visit_func_def.if_defn_original_def_.if_isinstance_defn_origin.else_.if_isinstance_orig_type_.else_.self_check_subtype_new_ty", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 728, "end_line": 775, "span_ids": ["TypeChecker._visit_func_def"], "tokens": 480}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def _visit_func_def(self, defn: FuncDef) -> None:\n \"\"\"Type check a function definition.\"\"\"\n self.check_func_item(defn, name=defn.name)\n if defn.info:\n if not defn.is_dynamic() and not defn.is_overload and not defn.is_decorated:\n # If the definition is the implementation for an\n # overload, the legality of the override has already\n # been typechecked, and decorated methods will be\n # checked when the decorator is.\n self.check_method_override(defn)\n self.check_inplace_operator_method(defn)\n if defn.original_def:\n # Override previous definition.\n new_type = self.function_type(defn)\n if isinstance(defn.original_def, FuncDef):\n # Function definition overrides function definition.\n if not is_same_type(new_type, self.function_type(defn.original_def)):\n self.msg.incompatible_conditional_function_def(defn)\n else:\n # Function definition overrides a variable initialized via assignment or a\n # decorated function.\n orig_type = defn.original_def.type\n if orig_type is None:\n # XXX This can be None, as happens in\n # test_testcheck_TypeCheckSuite.testRedefinedFunctionInTryWithElse\n self.msg.note(\"Internal mypy error checking function redefinition\", defn)\n return\n if isinstance(orig_type, PartialType):\n if orig_type.type is None:\n # Ah this is a partial type. Give it the type of the function.\n orig_def = defn.original_def\n if isinstance(orig_def, Decorator):\n var = orig_def.var\n else:\n var = orig_def\n partial_types = self.find_partial_types(var)\n if partial_types is not None:\n var.type = new_type\n del partial_types[var]\n else:\n # Trying to redefine something like partial empty list as function.\n self.fail(message_registry.INCOMPATIBLE_REDEFINITION, defn)\n else:\n # TODO: Update conditional type binder.\n self.check_subtype(new_type, orig_type, defn,\n message_registry.INCOMPATIBLE_REDEFINITION,\n 'redefinition with type',\n 'original type')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_func_item_TypeChecker.check_func_def": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_func_item_TypeChecker.check_func_def", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 777, "end_line": 1002, "span_ids": ["TypeChecker.check_func_def", "TypeChecker.enter_attribute_inference_context", "TypeChecker.check_func_item"], "tokens": 283}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def check_func_item(self, defn: FuncItem,\n type_override: Optional[CallableType] = None,\n name: Optional[str] = None) -> None:\n \"\"\"Type check a function.\n\n If type_override is provided, use it as the function type.\n \"\"\"\n self.dynamic_funcs.append(defn.is_dynamic() and not type_override)\n\n with self.enter_partial_types(is_function=True):\n typ = self.function_type(defn)\n if type_override:\n typ = type_override.copy_modified(line=typ.line, column=typ.column)\n if isinstance(typ, CallableType):\n with self.enter_attribute_inference_context():\n self.check_func_def(defn, typ, name)\n else:\n raise RuntimeError('Not supported')\n\n self.dynamic_funcs.pop()\n self.current_node_deferred = False\n\n if name == '__exit__':\n self.check__exit__return_type(defn)\n\n @contextmanager\n def enter_attribute_inference_context(self) -> Iterator[None]:\n old_types = self.inferred_attribute_types\n self.inferred_attribute_types = {}\n yield None\n self.inferred_attribute_types = old_types\n\n def check_func_def(self, defn: FuncItem, typ: CallableType, name: Optional[str]) -> None:\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_func_def._Type_check_a_function__TypeChecker.check_func_def.for_item_typ_in_expanded._Type_check_body_in_a_ne": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_func_def._Type_check_a_function__TypeChecker.check_func_def.for_item_typ_in_expanded._Type_check_body_in_a_ne", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 810, "end_line": 964, "span_ids": ["TypeChecker.check_func_def"], "tokens": 1652}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def check_func_def(self, defn: FuncItem, typ: CallableType, name: Optional[str]) -> None:\n \"\"\"Type check a function definition.\"\"\"\n # Expand type variables with value restrictions to ordinary types.\n expanded = self.expand_typevars(defn, typ)\n for item, typ in expanded:\n old_binder = self.binder\n self.binder = ConditionalTypeBinder()\n with self.binder.top_frame_context():\n defn.expanded.append(item)\n\n # We may be checking a function definition or an anonymous\n # function. In the first case, set up another reference with the\n # precise type.\n if isinstance(item, FuncDef):\n fdef = item\n # Check if __init__ has an invalid, non-None return type.\n if (fdef.info and fdef.name in ('__init__', '__init_subclass__') and\n not isinstance(get_proper_type(typ.ret_type), NoneType) and\n not self.dynamic_funcs[-1]):\n self.fail(message_registry.MUST_HAVE_NONE_RETURN_TYPE.format(fdef.name),\n item)\n\n # Check validity of __new__ signature\n if fdef.info and fdef.name == '__new__':\n self.check___new___signature(fdef, typ)\n\n self.check_for_missing_annotations(fdef)\n if self.options.disallow_any_unimported:\n if fdef.type and isinstance(fdef.type, CallableType):\n ret_type = fdef.type.ret_type\n if has_any_from_unimported_type(ret_type):\n self.msg.unimported_type_becomes_any(\"Return type\", ret_type, fdef)\n for idx, arg_type in enumerate(fdef.type.arg_types):\n if has_any_from_unimported_type(arg_type):\n prefix = \"Argument {} to \\\"{}\\\"\".format(idx + 1, fdef.name)\n self.msg.unimported_type_becomes_any(prefix, arg_type, fdef)\n check_for_explicit_any(fdef.type, self.options, self.is_typeshed_stub,\n self.msg, context=fdef)\n\n if name: # Special method names\n if defn.info and self.is_reverse_op_method(name):\n self.check_reverse_op_method(item, typ, name, defn)\n elif name in ('__getattr__', '__getattribute__'):\n self.check_getattr_method(typ, defn, name)\n elif name == '__setattr__':\n self.check_setattr_method(typ, defn)\n\n # Refuse contravariant return type variable\n if isinstance(typ.ret_type, TypeVarType):\n if typ.ret_type.variance == CONTRAVARIANT:\n self.fail(message_registry.RETURN_TYPE_CANNOT_BE_CONTRAVARIANT,\n typ.ret_type)\n\n # Check that Generator functions have the appropriate return type.\n if defn.is_generator:\n if defn.is_async_generator:\n if not self.is_async_generator_return_type(typ.ret_type):\n self.fail(message_registry.INVALID_RETURN_TYPE_FOR_ASYNC_GENERATOR,\n typ)\n else:\n if not self.is_generator_return_type(typ.ret_type, defn.is_coroutine):\n self.fail(message_registry.INVALID_RETURN_TYPE_FOR_GENERATOR, typ)\n\n # Python 2 generators aren't allowed to return values.\n orig_ret_type = get_proper_type(typ.ret_type)\n if (self.options.python_version[0] == 2 and\n isinstance(orig_ret_type, Instance) and\n orig_ret_type.type.fullname == 'typing.Generator'):\n if not isinstance(get_proper_type(orig_ret_type.args[2]),\n (NoneType, AnyType)):\n self.fail(message_registry.INVALID_GENERATOR_RETURN_ITEM_TYPE, typ)\n\n # Fix the type if decorated with `@types.coroutine` or `@asyncio.coroutine`.\n if defn.is_awaitable_coroutine:\n # Update the return type to AwaitableGenerator.\n # (This doesn't exist in typing.py, only in typing.pyi.)\n t = typ.ret_type\n c = defn.is_coroutine\n ty = self.get_generator_yield_type(t, c)\n tc = self.get_generator_receive_type(t, c)\n if c:\n tr = self.get_coroutine_return_type(t)\n else:\n tr = self.get_generator_return_type(t, c)\n ret_type = self.named_generic_type('typing.AwaitableGenerator',\n [ty, tc, tr, t])\n typ = typ.copy_modified(ret_type=ret_type)\n defn.type = typ\n\n # Push return type.\n self.return_types.append(typ.ret_type)\n\n # Store argument types.\n for i in range(len(typ.arg_types)):\n arg_type = typ.arg_types[i]\n with self.scope.push_function(defn):\n # We temporary push the definition to get the self type as\n # visible from *inside* of this function/method.\n ref_type = self.scope.active_self_type() # type: Optional[Type]\n if (isinstance(defn, FuncDef) and ref_type is not None and i == 0\n and not defn.is_static\n and typ.arg_kinds[0] not in [nodes.ARG_STAR, nodes.ARG_STAR2]):\n isclass = defn.is_class or defn.name in ('__new__', '__init_subclass__')\n if isclass:\n ref_type = mypy.types.TypeType.make_normalized(ref_type)\n erased = get_proper_type(erase_to_bound(arg_type))\n if not is_subtype_ignoring_tvars(ref_type, erased):\n note = None\n if (isinstance(erased, Instance) and erased.type.is_protocol or\n isinstance(erased, TypeType) and\n isinstance(erased.item, Instance) and\n erased.item.type.is_protocol):\n # We allow the explicit self-type to be not a supertype of\n # the current class if it is a protocol. For such cases\n # the consistency check will be performed at call sites.\n msg = None\n elif typ.arg_names[i] in {'self', 'cls'}:\n if (self.options.python_version[0] < 3\n and is_same_type(erased, arg_type) and not isclass):\n msg = message_registry.INVALID_SELF_TYPE_OR_EXTRA_ARG\n note = '(Hint: typically annotations omit the type for self)'\n else:\n msg = message_registry.ERASED_SELF_TYPE_NOT_SUPERTYPE.format(\n erased, ref_type)\n else:\n msg = message_registry.MISSING_OR_INVALID_SELF_TYPE\n if msg:\n self.fail(msg, defn)\n if note:\n self.note(note, defn)\n elif isinstance(arg_type, TypeVarType):\n # Refuse covariant parameter type variables\n # TODO: check recursively for inner type variables\n if (\n arg_type.variance == COVARIANT and\n defn.name not in ('__init__', '__new__')\n ):\n ctx = arg_type # type: Context\n if ctx.line < 0:\n ctx = typ\n self.fail(message_registry.FUNCTION_PARAMETER_CANNOT_BE_COVARIANT, ctx)\n if typ.arg_kinds[i] == nodes.ARG_STAR:\n # builtins.tuple[T] is typing.Tuple[T, ...]\n arg_type = self.named_generic_type('builtins.tuple',\n [arg_type])\n elif typ.arg_kinds[i] == nodes.ARG_STAR2:\n arg_type = self.named_generic_type('builtins.dict',\n [self.str_type(),\n arg_type])\n item.arguments[i].variable.type = arg_type\n\n # Type check initialization expressions.\n body_is_trivial = self.is_trivial_body(defn.body)\n self.check_default_args(item, body_is_trivial)\n\n # Type check body in a new scope.\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_func_def.for_item_typ_in_expanded.None_1_TypeChecker.check_func_def.for_item_typ_in_expanded.self.binder_2.old_binder": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_func_def.for_item_typ_in_expanded.None_1_TypeChecker.check_func_def.for_item_typ_in_expanded.self.binder_2.old_binder", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 965, "end_line": 1002, "span_ids": ["TypeChecker.check_func_def"], "tokens": 424}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def check_func_def(self, defn: FuncItem, typ: CallableType, name: Optional[str]) -> None:\n for item, typ in expanded:\n # ... other code\n with self.binder.top_frame_context():\n with self.scope.push_function(defn):\n # We suppress reachability warnings when we use TypeVars with value\n # restrictions: we only want to report a warning if a certain statement is\n # marked as being suppressed in *all* of the expansions, but we currently\n # have no good way of doing this.\n #\n # TODO: Find a way of working around this limitation\n if len(expanded) >= 2:\n self.binder.suppress_unreachable_warnings()\n self.accept(item.body)\n unreachable = self.binder.is_unreachable()\n\n if (self.options.warn_no_return and not unreachable):\n if (defn.is_generator or\n is_named_instance(self.return_types[-1], 'typing.AwaitableGenerator')):\n return_type = self.get_generator_return_type(self.return_types[-1],\n defn.is_coroutine)\n elif defn.is_coroutine:\n return_type = self.get_coroutine_return_type(self.return_types[-1])\n else:\n return_type = self.return_types[-1]\n\n return_type = get_proper_type(return_type)\n if not isinstance(return_type, (NoneType, AnyType)) and not body_is_trivial:\n # Control flow fell off the end of a function that was\n # declared to return a non-None type and is not\n # entirely pass/Ellipsis/raise NotImplementedError.\n if isinstance(return_type, UninhabitedType):\n # This is a NoReturn function\n self.msg.fail(message_registry.INVALID_IMPLICIT_RETURN, defn)\n else:\n self.msg.fail(message_registry.MISSING_RETURN_STATEMENT, defn,\n code=codes.RETURN)\n\n self.return_types.pop()\n\n self.binder = old_binder", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_default_args_TypeChecker.is_reverse_op_method.if_self_options_python_ve.else_.return.method_name_in_nodes_reve": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_default_args_TypeChecker.is_reverse_op_method.if_self_options_python_ve.else_.return.method_name_in_nodes_reve", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1004, "end_line": 1035, "span_ids": ["TypeChecker.check_default_args", "TypeChecker.is_forward_op_method", "TypeChecker.is_reverse_op_method"], "tokens": 277}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def check_default_args(self, item: FuncItem, body_is_trivial: bool) -> None:\n for arg in item.arguments:\n if arg.initializer is None:\n continue\n if body_is_trivial and isinstance(arg.initializer, EllipsisExpr):\n continue\n name = arg.variable.name\n msg = 'Incompatible default for '\n if name.startswith('__tuple_arg_'):\n msg += \"tuple argument {}\".format(name[12:])\n else:\n msg += 'argument \"{}\"'.format(name)\n self.check_simple_assignment(\n arg.variable.type,\n arg.initializer,\n context=arg.initializer,\n msg=msg,\n lvalue_name='argument',\n rvalue_name='default',\n code=codes.ASSIGNMENT)\n\n def is_forward_op_method(self, method_name: str) -> bool:\n if self.options.python_version[0] == 2 and method_name == '__div__':\n return True\n else:\n return method_name in nodes.reverse_op_methods\n\n def is_reverse_op_method(self, method_name: str) -> bool:\n if self.options.python_version[0] == 2 and method_name == '__rdiv__':\n return True\n else:\n return method_name in nodes.reverse_op_method_set", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_for_missing_annotations_TypeChecker.check_for_missing_annotations.if_show_untyped_and_self.if_fdef_type_is_None_and_.elif_isinstance_fdef_type.if_any_is_unannotated_any.self_fail_message_registr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_for_missing_annotations_TypeChecker.check_for_missing_annotations.if_show_untyped_and_self.if_fdef_type_is_None_and_.elif_isinstance_fdef_type.if_any_is_unannotated_any.self_fail_message_registr", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1037, "end_line": 1078, "span_ids": ["TypeChecker.check_for_missing_annotations"], "tokens": 564}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def check_for_missing_annotations(self, fdef: FuncItem) -> None:\n # Check for functions with unspecified/not fully specified types.\n def is_unannotated_any(t: Type) -> bool:\n if not isinstance(t, ProperType):\n return False\n return isinstance(t, AnyType) and t.type_of_any == TypeOfAny.unannotated\n\n has_explicit_annotation = (isinstance(fdef.type, CallableType)\n and any(not is_unannotated_any(t)\n for t in fdef.type.arg_types + [fdef.type.ret_type]))\n\n show_untyped = not self.is_typeshed_stub or self.options.warn_incomplete_stub\n check_incomplete_defs = self.options.disallow_incomplete_defs and has_explicit_annotation\n if show_untyped and (self.options.disallow_untyped_defs or check_incomplete_defs):\n if fdef.type is None and self.options.disallow_untyped_defs:\n if (not fdef.arguments or (len(fdef.arguments) == 1 and\n (fdef.arg_names[0] == 'self' or fdef.arg_names[0] == 'cls'))):\n self.fail(message_registry.RETURN_TYPE_EXPECTED, fdef,\n code=codes.NO_UNTYPED_DEF)\n if not has_return_statement(fdef) and not fdef.is_generator:\n self.note('Use \"-> None\" if function does not return a value', fdef,\n code=codes.NO_UNTYPED_DEF)\n else:\n self.fail(message_registry.FUNCTION_TYPE_EXPECTED, fdef,\n code=codes.NO_UNTYPED_DEF)\n elif isinstance(fdef.type, CallableType):\n ret_type = get_proper_type(fdef.type.ret_type)\n if is_unannotated_any(ret_type):\n self.fail(message_registry.RETURN_TYPE_EXPECTED, fdef,\n code=codes.NO_UNTYPED_DEF)\n elif fdef.is_generator:\n if is_unannotated_any(self.get_generator_return_type(ret_type,\n fdef.is_coroutine)):\n self.fail(message_registry.RETURN_TYPE_EXPECTED, fdef,\n code=codes.NO_UNTYPED_DEF)\n elif fdef.is_coroutine and isinstance(ret_type, Instance):\n if is_unannotated_any(self.get_coroutine_return_type(ret_type)):\n self.fail(message_registry.RETURN_TYPE_EXPECTED, fdef,\n code=codes.NO_UNTYPED_DEF)\n if any(is_unannotated_any(t) for t in fdef.type.arg_types):\n self.fail(message_registry.ARGUMENT_TYPE_EXPECTED, fdef,\n code=codes.NO_UNTYPED_DEF)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check___new___signature_TypeChecker.check___new___signature.if_not_isinstance_get_pro.else_.self_check_subtype_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check___new___signature_TypeChecker.check___new___signature.if_not_isinstance_get_pro.else_.self_check_subtype_", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1080, "end_line": 1100, "span_ids": ["TypeChecker.check___new___signature"], "tokens": 194}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def check___new___signature(self, fdef: FuncDef, typ: CallableType) -> None:\n self_type = fill_typevars_with_any(fdef.info)\n bound_type = bind_self(typ, self_type, is_classmethod=True)\n # Check that __new__ (after binding cls) returns an instance\n # type (or any).\n if not isinstance(get_proper_type(bound_type.ret_type),\n (AnyType, Instance, TupleType)):\n self.fail(\n message_registry.NON_INSTANCE_NEW_TYPE.format(\n format_type(bound_type.ret_type)),\n fdef)\n else:\n # And that it returns a subtype of the class\n self.check_subtype(\n bound_type.ret_type,\n self_type,\n fdef,\n message_registry.INVALID_NEW_TYPE,\n 'returns',\n 'but must return a subtype of'\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.is_trivial_body_TypeChecker.is_trivial_body.return._isinstance_stmt_PassStm": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.is_trivial_body_TypeChecker.is_trivial_body.return._isinstance_stmt_PassStm", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1102, "end_line": 1145, "span_ids": ["TypeChecker.is_trivial_body"], "tokens": 394}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def is_trivial_body(self, block: Block) -> bool:\n \"\"\"Returns 'true' if the given body is \"trivial\" -- if it contains just a \"pass\",\n \"...\" (ellipsis), or \"raise NotImplementedError()\". A trivial body may also\n start with a statement containing just a string (e.g. a docstring).\n\n Note: functions that raise other kinds of exceptions do not count as\n \"trivial\". We use this function to help us determine when it's ok to\n relax certain checks on body, but functions that raise arbitrary exceptions\n are more likely to do non-trivial work. For example:\n\n def halt(self, reason: str = ...) -> NoReturn:\n raise MyCustomError(\"Fatal error: \" + reason, self.line, self.context)\n\n A function that raises just NotImplementedError is much less likely to be\n this complex.\n \"\"\"\n body = block.body\n\n # Skip a docstring\n if (body and isinstance(body[0], ExpressionStmt) and\n isinstance(body[0].expr, (StrExpr, UnicodeExpr))):\n body = block.body[1:]\n\n if len(body) == 0:\n # There's only a docstring (or no body at all).\n return True\n elif len(body) > 1:\n return False\n\n stmt = body[0]\n\n if isinstance(stmt, RaiseStmt):\n expr = stmt.expr\n if expr is None:\n return False\n if isinstance(expr, CallExpr):\n expr = expr.callee\n\n return (isinstance(expr, NameExpr)\n and expr.fullname == 'builtins.NotImplementedError')\n\n return (isinstance(stmt, PassStmt) or\n (isinstance(stmt, ExpressionStmt) and\n isinstance(stmt.expr, EllipsisExpr)))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_reverse_op_method_TypeChecker.check_reverse_op_method.self_check_overlapping_op": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_reverse_op_method_TypeChecker.check_reverse_op_method.self_check_overlapping_op", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1147, "end_line": 1213, "span_ids": ["TypeChecker.check_reverse_op_method"], "tokens": 669}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def check_reverse_op_method(self, defn: FuncItem,\n reverse_type: CallableType, reverse_name: str,\n context: Context) -> None:\n \"\"\"Check a reverse operator method such as __radd__.\"\"\"\n # Decides whether it's worth calling check_overlapping_op_methods().\n\n # This used to check for some very obscure scenario. It now\n # just decides whether it's worth calling\n # check_overlapping_op_methods().\n\n assert defn.info\n\n # First check for a valid signature\n method_type = CallableType([AnyType(TypeOfAny.special_form),\n AnyType(TypeOfAny.special_form)],\n [nodes.ARG_POS, nodes.ARG_POS],\n [None, None],\n AnyType(TypeOfAny.special_form),\n self.named_type('builtins.function'))\n if not is_subtype(reverse_type, method_type):\n self.msg.invalid_signature(reverse_type, context)\n return\n\n if reverse_name in ('__eq__', '__ne__'):\n # These are defined for all objects => can't cause trouble.\n return\n\n # With 'Any' or 'object' return type we are happy, since any possible\n # return value is valid.\n ret_type = get_proper_type(reverse_type.ret_type)\n if isinstance(ret_type, AnyType):\n return\n if isinstance(ret_type, Instance):\n if ret_type.type.fullname == 'builtins.object':\n return\n if reverse_type.arg_kinds[0] == ARG_STAR:\n reverse_type = reverse_type.copy_modified(arg_types=[reverse_type.arg_types[0]] * 2,\n arg_kinds=[ARG_POS] * 2,\n arg_names=[reverse_type.arg_names[0], \"_\"])\n assert len(reverse_type.arg_types) >= 2\n\n if self.options.python_version[0] == 2 and reverse_name == '__rdiv__':\n forward_name = '__div__'\n else:\n forward_name = nodes.normal_from_reverse_op[reverse_name]\n forward_inst = get_proper_type(reverse_type.arg_types[1])\n if isinstance(forward_inst, TypeVarType):\n forward_inst = get_proper_type(forward_inst.upper_bound)\n elif isinstance(forward_inst, TupleType):\n forward_inst = tuple_fallback(forward_inst)\n elif isinstance(forward_inst, (FunctionLike, TypedDictType, LiteralType)):\n forward_inst = forward_inst.fallback\n if isinstance(forward_inst, TypeType):\n item = forward_inst.item\n if isinstance(item, Instance):\n opt_meta = item.type.metaclass_type\n if opt_meta is not None:\n forward_inst = opt_meta\n if not (isinstance(forward_inst, (Instance, UnionType))\n and forward_inst.has_readable_member(forward_name)):\n return\n forward_base = reverse_type.arg_types[1]\n forward_type = self.expr_checker.analyze_external_member_access(forward_name, forward_base,\n context=defn)\n self.check_overlapping_op_methods(reverse_type, reverse_name, defn.info,\n forward_type, forward_name, forward_base,\n context=defn)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_overlapping_op_methods_TypeChecker.check_overlapping_op_methods.for_forward_item_in_union.if_isinstance_forward_ite.elif_not_isinstance_forwa.self_msg_forward_operator": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_overlapping_op_methods_TypeChecker.check_overlapping_op_methods.for_forward_item_in_union.if_isinstance_forward_ite.elif_not_isinstance_forwa.self_msg_forward_operator", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1215, "end_line": 1275, "span_ids": ["TypeChecker.check_overlapping_op_methods"], "tokens": 652}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def check_overlapping_op_methods(self,\n reverse_type: CallableType,\n reverse_name: str,\n reverse_class: TypeInfo,\n forward_type: Type,\n forward_name: str,\n forward_base: Type,\n context: Context) -> None:\n \"\"\"Check for overlapping method and reverse method signatures.\n\n This function assumes that:\n\n - The reverse method has valid argument count and kinds.\n - If the reverse operator method accepts some argument of type\n X, the forward operator method also belong to class X.\n\n For example, if we have the reverse operator `A.__radd__(B)`, then the\n corresponding forward operator must have the type `B.__add__(...)`.\n \"\"\"\n\n # Note: Suppose we have two operator methods \"A.__rOP__(B) -> R1\" and\n # \"B.__OP__(C) -> R2\". We check if these two methods are unsafely overlapping\n # by using the following algorithm:\n #\n # 1. Rewrite \"B.__OP__(C) -> R1\" to \"temp1(B, C) -> R1\"\n #\n # 2. Rewrite \"A.__rOP__(B) -> R2\" to \"temp2(B, A) -> R2\"\n #\n # 3. Treat temp1 and temp2 as if they were both variants in the same\n # overloaded function. (This mirrors how the Python runtime calls\n # operator methods: we first try __OP__, then __rOP__.)\n #\n # If the first signature is unsafely overlapping with the second,\n # report an error.\n #\n # 4. However, if temp1 shadows temp2 (e.g. the __rOP__ method can never\n # be called), do NOT report an error.\n #\n # This behavior deviates from how we handle overloads -- many of the\n # modules in typeshed seem to define __OP__ methods that shadow the\n # corresponding __rOP__ method.\n #\n # Note: we do not attempt to handle unsafe overlaps related to multiple\n # inheritance. (This is consistent with how we handle overloads: we also\n # do not try checking unsafe overlaps due to multiple inheritance there.)\n\n for forward_item in union_items(forward_type):\n if isinstance(forward_item, CallableType):\n if self.is_unsafe_overlapping_op(forward_item, forward_base, reverse_type):\n self.msg.operator_method_signatures_overlap(\n reverse_class, reverse_name,\n forward_base, forward_name, context)\n elif isinstance(forward_item, Overloaded):\n for item in forward_item.items():\n if self.is_unsafe_overlapping_op(item, forward_base, reverse_type):\n self.msg.operator_method_signatures_overlap(\n reverse_class, reverse_name,\n forward_base, forward_name,\n context)\n elif not isinstance(forward_item, AnyType):\n self.msg.forward_operator_not_callable(forward_name, context)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.is_unsafe_overlapping_op_TypeChecker.is_unsafe_overlapping_op.return.is_unsafe_overlapping_ove": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.is_unsafe_overlapping_op_TypeChecker.is_unsafe_overlapping_op.return.is_unsafe_overlapping_ove", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1277, "end_line": 1322, "span_ids": ["TypeChecker.is_unsafe_overlapping_op"], "tokens": 443}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def is_unsafe_overlapping_op(self,\n forward_item: CallableType,\n forward_base: Type,\n reverse_type: CallableType) -> bool:\n # TODO: check argument kinds?\n if len(forward_item.arg_types) < 1:\n # Not a valid operator method -- can't succeed anyway.\n return False\n\n # Erase the type if necessary to make sure we don't have a single\n # TypeVar in forward_tweaked. (Having a function signature containing\n # just a single TypeVar can lead to unpredictable behavior.)\n forward_base_erased = forward_base\n if isinstance(forward_base, TypeVarType):\n forward_base_erased = erase_to_bound(forward_base)\n\n # Construct normalized function signatures corresponding to the\n # operator methods. The first argument is the left operand and the\n # second operand is the right argument -- we switch the order of\n # the arguments of the reverse method.\n\n forward_tweaked = forward_item.copy_modified(\n arg_types=[forward_base_erased, forward_item.arg_types[0]],\n arg_kinds=[nodes.ARG_POS] * 2,\n arg_names=[None] * 2,\n )\n reverse_tweaked = reverse_type.copy_modified(\n arg_types=[reverse_type.arg_types[1], reverse_type.arg_types[0]],\n arg_kinds=[nodes.ARG_POS] * 2,\n arg_names=[None] * 2,\n )\n\n reverse_base_erased = reverse_type.arg_types[0]\n if isinstance(reverse_base_erased, TypeVarType):\n reverse_base_erased = erase_to_bound(reverse_base_erased)\n\n if is_same_type(reverse_base_erased, forward_base_erased):\n return False\n elif is_subtype(reverse_base_erased, forward_base_erased):\n first = reverse_tweaked\n second = forward_tweaked\n else:\n first = forward_tweaked\n second = reverse_tweaked\n\n return is_unsafe_overlapping_overload_signatures(first, second)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_inplace_operator_method_TypeChecker.check_inplace_operator_method.if_cls_has_readable_membe.if_fail_.self_msg_signatures_incom": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_inplace_operator_method_TypeChecker.check_inplace_operator_method.if_cls_has_readable_membe.if_fail_.self_msg_signatures_incom", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1324, "end_line": 1347, "span_ids": ["TypeChecker.check_inplace_operator_method"], "tokens": 214}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def check_inplace_operator_method(self, defn: FuncBase) -> None:\n \"\"\"Check an inplace operator method such as __iadd__.\n\n They cannot arbitrarily overlap with __add__.\n \"\"\"\n method = defn.name\n if method not in nodes.inplace_operator_methods:\n return\n typ = bind_self(self.function_type(defn))\n cls = defn.info\n other_method = '__' + method[3:]\n if cls.has_readable_member(other_method):\n instance = fill_typevars(cls)\n typ2 = get_proper_type(self.expr_checker.analyze_external_member_access(\n other_method, instance, defn))\n fail = False\n if isinstance(typ2, FunctionLike):\n if not is_more_general_arg_prefix(typ, typ2):\n fail = True\n else:\n # TODO overloads\n fail = True\n if fail:\n self.msg.signatures_incompatible(method, other_method, defn)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_getattr_method_TypeChecker.check_getattr_method.if_not_is_subtype_typ_me.self_msg_invalid_signatur": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_getattr_method_TypeChecker.check_getattr_method.if_not_is_subtype_typ_me.self_msg_invalid_signatur", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1349, "end_line": 1373, "span_ids": ["TypeChecker.check_getattr_method"], "tokens": 278}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def check_getattr_method(self, typ: Type, context: Context, name: str) -> None:\n if len(self.scope.stack) == 1:\n # module scope\n if name == '__getattribute__':\n self.msg.fail(message_registry.MODULE_LEVEL_GETATTRIBUTE, context)\n return\n # __getattr__ is fine at the module level as of Python 3.7 (PEP 562). We could\n # show an error for Python < 3.7, but that would be annoying in code that supports\n # both 3.7 and older versions.\n method_type = CallableType([self.named_type('builtins.str')],\n [nodes.ARG_POS],\n [None],\n AnyType(TypeOfAny.special_form),\n self.named_type('builtins.function'))\n elif self.scope.active_class():\n method_type = CallableType([AnyType(TypeOfAny.special_form),\n self.named_type('builtins.str')],\n [nodes.ARG_POS, nodes.ARG_POS],\n [None, None],\n AnyType(TypeOfAny.special_form),\n self.named_type('builtins.function'))\n else:\n return\n if not is_subtype(typ, method_type):\n self.msg.invalid_signature_for_special_method(typ, context, name)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_setattr_method_TypeChecker.check_setattr_method.if_not_is_subtype_typ_me.self_msg_invalid_signatur": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_setattr_method_TypeChecker.check_setattr_method.if_not_is_subtype_typ_me.self_msg_invalid_signatur", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1375, "end_line": 1386, "span_ids": ["TypeChecker.check_setattr_method"], "tokens": 139}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def check_setattr_method(self, typ: Type, context: Context) -> None:\n if not self.scope.active_class():\n return\n method_type = CallableType([AnyType(TypeOfAny.special_form),\n self.named_type('builtins.str'),\n AnyType(TypeOfAny.special_form)],\n [nodes.ARG_POS, nodes.ARG_POS, nodes.ARG_POS],\n [None, None, None],\n NoneType(),\n self.named_type('builtins.function'))\n if not is_subtype(typ, method_type):\n self.msg.invalid_signature_for_special_method(typ, context, '__setattr__')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.expand_typevars_TypeChecker.expand_typevars.if_subst_and_not_self_opt.else_.return._defn_typ_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.expand_typevars_TypeChecker.expand_typevars.if_subst_and_not_self_opt.else_.return._defn_typ_", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1388, "end_line": 1411, "span_ids": ["TypeChecker.expand_typevars"], "tokens": 284}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def expand_typevars(self, defn: FuncItem,\n typ: CallableType) -> List[Tuple[FuncItem, CallableType]]:\n # TODO use generator\n subst = [] # type: List[List[Tuple[TypeVarId, Type]]]\n tvars = list(typ.variables) or []\n if defn.info:\n # Class type variables\n tvars += defn.info.defn.type_vars or []\n # TODO(shantanu): audit for paramspec\n for tvar in tvars:\n if isinstance(tvar, TypeVarDef) and tvar.values:\n subst.append([(tvar.id, value) for value in tvar.values])\n # Make a copy of the function to check for each combination of\n # value restricted type variables. (Except when running mypyc,\n # where we need one canonical version of the function.)\n if subst and not self.options.mypyc:\n result = [] # type: List[Tuple[FuncItem, CallableType]]\n for substitutions in itertools.product(*subst):\n mapping = dict(substitutions)\n expanded = cast(CallableType, expand_type(typ, mapping))\n result.append((expand_func(defn, mapping), expanded))\n return result\n else:\n return [(defn, typ)]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_method_override_TypeChecker.check_method_override.for_base_in_defn_info_mro.if_self_check_method_or_a.return": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_method_override_TypeChecker.check_method_override.for_base_in_defn_info_mro.if_self_check_method_or_a.return", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1413, "end_line": 1422, "span_ids": ["TypeChecker.check_method_override"], "tokens": 122}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def check_method_override(self, defn: Union[FuncDef, OverloadedFuncDef, Decorator]) -> None:\n \"\"\"Check if function definition is compatible with base classes.\n\n This may defer the method if a signature is not available in at least one base class.\n \"\"\"\n # Check against definitions in base classes.\n for base in defn.info.mro[1:]:\n if self.check_method_or_accessor_override_for_base(defn, base):\n # Node was deferred, we will have another attempt later.\n return", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_method_or_accessor_override_for_base_TypeChecker.check_method_or_accessor_override_for_base.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_method_or_accessor_override_for_base_TypeChecker.check_method_or_accessor_override_for_base.return.False", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1424, "end_line": 1459, "span_ids": ["TypeChecker.check_method_or_accessor_override_for_base"], "tokens": 373}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def check_method_or_accessor_override_for_base(self, defn: Union[FuncDef,\n OverloadedFuncDef,\n Decorator],\n base: TypeInfo) -> bool:\n \"\"\"Check if method definition is compatible with a base class.\n\n Return True if the node was deferred because one of the corresponding\n superclass nodes is not ready.\n \"\"\"\n if base:\n name = defn.name\n base_attr = base.names.get(name)\n if base_attr:\n # First, check if we override a final (always an error, even with Any types).\n if is_final_node(base_attr.node):\n self.msg.cant_override_final(name, base.name, defn)\n # Second, final can't override anything writeable independently of types.\n if defn.is_final:\n self.check_if_final_var_override_writable(name, base_attr.node, defn)\n\n # Check the type of override.\n if name not in ('__init__', '__new__', '__init_subclass__'):\n # Check method override\n # (__init__, __new__, __init_subclass__ are special).\n if self.check_method_override_for_base_with_name(defn, name, base):\n return True\n if name in nodes.inplace_operator_methods:\n # Figure out the name of the corresponding operator method.\n method = '__' + name[3:]\n # An inplace operator method such as __iadd__ might not be\n # always introduced safely if a base class defined __add__.\n # TODO can't come up with an example where this is\n # necessary; now it's \"just in case\"\n return self.check_method_override_for_base_with_name(defn, method,\n base)\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_method_override_for_base_with_name_TypeChecker.check_method_override_for_base_with_name.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_method_override_for_base_with_name_TypeChecker.check_method_override_for_base_with_name.return.False", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1461, "end_line": 1545, "span_ids": ["TypeChecker.check_method_override_for_base_with_name"], "tokens": 811}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def check_method_override_for_base_with_name(\n self, defn: Union[FuncDef, OverloadedFuncDef, Decorator],\n name: str, base: TypeInfo) -> bool:\n \"\"\"Check if overriding an attribute `name` of `base` with `defn` is valid.\n\n Return True if the supertype node was not analysed yet, and `defn` was deferred.\n \"\"\"\n base_attr = base.names.get(name)\n if base_attr:\n # The name of the method is defined in the base class.\n\n # Point errors at the 'def' line (important for backward compatibility\n # of type ignores).\n if not isinstance(defn, Decorator):\n context = defn\n else:\n context = defn.func\n\n # Construct the type of the overriding method.\n if isinstance(defn, (FuncDef, OverloadedFuncDef)):\n typ = self.function_type(defn) # type: Type\n override_class_or_static = defn.is_class or defn.is_static\n override_class = defn.is_class\n else:\n assert defn.var.is_ready\n assert defn.var.type is not None\n typ = defn.var.type\n override_class_or_static = defn.func.is_class or defn.func.is_static\n override_class = defn.func.is_class\n typ = get_proper_type(typ)\n if isinstance(typ, FunctionLike) and not is_static(context):\n typ = bind_self(typ, self.scope.active_self_type(),\n is_classmethod=override_class)\n # Map the overridden method type to subtype context so that\n # it can be checked for compatibility.\n original_type = get_proper_type(base_attr.type)\n original_node = base_attr.node\n if original_type is None:\n if self.pass_num < self.last_pass:\n # If there are passes left, defer this node until next pass,\n # otherwise try reconstructing the method type from available information.\n self.defer_node(defn, defn.info)\n return True\n elif isinstance(original_node, (FuncDef, OverloadedFuncDef)):\n original_type = self.function_type(original_node)\n elif isinstance(original_node, Decorator):\n original_type = self.function_type(original_node.func)\n else:\n assert False, str(base_attr.node)\n if isinstance(original_node, (FuncDef, OverloadedFuncDef)):\n original_class_or_static = original_node.is_class or original_node.is_static\n elif isinstance(original_node, Decorator):\n fdef = original_node.func\n original_class_or_static = fdef.is_class or fdef.is_static\n else:\n original_class_or_static = False # a variable can't be class or static\n if isinstance(original_type, AnyType) or isinstance(typ, AnyType):\n pass\n elif isinstance(original_type, FunctionLike) and isinstance(typ, FunctionLike):\n original = self.bind_and_map_method(base_attr, original_type,\n defn.info, base)\n # Check that the types are compatible.\n # TODO overloaded signatures\n self.check_override(typ,\n original,\n defn.name,\n name,\n base.name,\n original_class_or_static,\n override_class_or_static,\n context)\n elif is_equivalent(original_type, typ):\n # Assume invariance for a non-callable attribute here. Note\n # that this doesn't affect read-only properties which can have\n # covariant overrides.\n #\n pass\n elif (base_attr.node and not self.is_writable_attribute(base_attr.node)\n and is_subtype(typ, original_type)):\n # If the attribute is read-only, allow covariance\n pass\n else:\n self.msg.signature_incompatible_with_supertype(\n defn.name, name, base.name, context)\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.bind_and_map_method_TypeChecker.bind_and_map_method.return.cast_FunctionLike_map_ty": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.bind_and_map_method_TypeChecker.bind_and_map_method.return.cast_FunctionLike_map_ty", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1547, "end_line": 1566, "span_ids": ["TypeChecker.bind_and_map_method"], "tokens": 212}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def bind_and_map_method(self, sym: SymbolTableNode, typ: FunctionLike,\n sub_info: TypeInfo, super_info: TypeInfo) -> FunctionLike:\n \"\"\"Bind self-type and map type variables for a method.\n\n Arguments:\n sym: a symbol that points to method definition\n typ: method type on the definition\n sub_info: class where the method is used\n super_info: class where the method was defined\n \"\"\"\n if (isinstance(sym.node, (FuncDef, OverloadedFuncDef, Decorator))\n and not is_static(sym.node)):\n if isinstance(sym.node, Decorator):\n is_class_method = sym.node.func.is_class\n else:\n is_class_method = sym.node.is_class\n bound = bind_self(typ, self.scope.active_self_type(), is_class_method)\n else:\n bound = typ\n return cast(FunctionLike, map_type_from_supertype(bound, sub_info, super_info))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.get_op_other_domain_TypeChecker.get_op_other_domain.if_isinstance_tp_Callabl.else_.assert_False_Need_to_ch": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.get_op_other_domain_TypeChecker.get_op_other_domain.if_isinstance_tp_Callabl.else_.assert_False_Need_to_ch", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1568, "end_line": 1580, "span_ids": ["TypeChecker.get_op_other_domain"], "tokens": 141}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def get_op_other_domain(self, tp: FunctionLike) -> Optional[Type]:\n if isinstance(tp, CallableType):\n if tp.arg_kinds and tp.arg_kinds[0] == ARG_POS:\n return tp.arg_types[0]\n return None\n elif isinstance(tp, Overloaded):\n raw_items = [self.get_op_other_domain(it) for it in tp.items()]\n items = [it for it in raw_items if it]\n if items:\n return make_simplified_union(items)\n return None\n else:\n assert False, \"Need to check all FunctionLike subtypes here\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_override_TypeChecker.check_override.if_is_private_name_.fail.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_override_TypeChecker.check_override.if_is_private_name_.fail.False", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1582, "end_line": 1618, "span_ids": ["TypeChecker.check_override"], "tokens": 371}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def check_override(self, override: FunctionLike, original: FunctionLike,\n name: str, name_in_super: str, supertype: str,\n original_class_or_static: bool,\n override_class_or_static: bool,\n node: Context) -> None:\n \"\"\"Check a method override with given signatures.\n\n Arguments:\n override: The signature of the overriding method.\n original: The signature of the original supertype method.\n name: The name of the subtype. This and the next argument are\n only used for generating error messages.\n supertype: The name of the supertype.\n \"\"\"\n # Use boolean variable to clarify code.\n fail = False\n op_method_wider_note = False\n if not is_subtype(override, original, ignore_pos_arg_names=True):\n fail = True\n elif isinstance(override, Overloaded) and self.is_forward_op_method(name):\n # Operator method overrides cannot extend the domain, as\n # this could be unsafe with reverse operator methods.\n original_domain = self.get_op_other_domain(original)\n override_domain = self.get_op_other_domain(override)\n if (original_domain and override_domain and\n not is_subtype(override_domain, original_domain)):\n fail = True\n op_method_wider_note = True\n if isinstance(original, FunctionLike) and isinstance(override, FunctionLike):\n if original_class_or_static and not override_class_or_static:\n fail = True\n elif isinstance(original, CallableType) and isinstance(override, CallableType):\n if original.type_guard is not None and override.type_guard is None:\n fail = True\n\n if is_private(name):\n fail = False\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_override.if_fail__TypeChecker.check_override.if_fail_.if_op_method_wider_note_.self_note_Overloaded_ope": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_override.if_fail__TypeChecker.check_override.if_fail_.if_op_method_wider_note_.self_note_Overloaded_ope", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1617, "end_line": 1687, "span_ids": ["TypeChecker.check_override"], "tokens": 704}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def check_override(self, override: FunctionLike, original: FunctionLike,\n name: str, name_in_super: str, supertype: str,\n original_class_or_static: bool,\n override_class_or_static: bool,\n node: Context) -> None:\n # ... other code\n\n if fail:\n emitted_msg = False\n if (isinstance(override, CallableType) and\n isinstance(original, CallableType) and\n len(override.arg_types) == len(original.arg_types) and\n override.min_args == original.min_args):\n # Give more detailed messages for the common case of both\n # signatures having the same number of arguments and no\n # overloads.\n\n # override might have its own generic function type\n # variables. If an argument or return type of override\n # does not have the correct subtyping relationship\n # with the original type even after these variables\n # are erased, then it is definitely an incompatibility.\n\n override_ids = override.type_var_ids()\n type_name = None\n if isinstance(override.definition, FuncDef):\n type_name = override.definition.info.name\n\n def erase_override(t: Type) -> Type:\n return erase_typevars(t, ids_to_erase=override_ids)\n\n for i in range(len(override.arg_types)):\n if not is_subtype(original.arg_types[i],\n erase_override(override.arg_types[i])):\n arg_type_in_super = original.arg_types[i]\n self.msg.argument_incompatible_with_supertype(\n i + 1,\n name,\n type_name,\n name_in_super,\n arg_type_in_super,\n supertype,\n node\n )\n emitted_msg = True\n\n if not is_subtype(erase_override(override.ret_type),\n original.ret_type):\n self.msg.return_type_incompatible_with_supertype(\n name, name_in_super, supertype, original.ret_type, override.ret_type, node)\n emitted_msg = True\n elif isinstance(override, Overloaded) and isinstance(original, Overloaded):\n # Give a more detailed message in the case where the user is trying to\n # override an overload, and the subclass's overload is plausible, except\n # that the order of the variants are wrong.\n #\n # For example, if the parent defines the overload f(int) -> int and f(str) -> str\n # (in that order), and if the child swaps the two and does f(str) -> str and\n # f(int) -> int\n order = []\n for child_variant in override.items():\n for i, parent_variant in enumerate(original.items()):\n if is_subtype(child_variant, parent_variant):\n order.append(i)\n break\n\n if len(order) == len(original.items()) and order != sorted(order):\n self.msg.overload_signature_incompatible_with_supertype(\n name, name_in_super, supertype, override, node)\n emitted_msg = True\n\n if not emitted_msg:\n # Fall back to generic incompatibility message.\n self.msg.signature_incompatible_with_supertype(\n name, name_in_super, supertype, node)\n if op_method_wider_note:\n self.note(\"Overloaded operator methods can't have wider argument types\"\n \" in overrides\", node, code=codes.OVERRIDE)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check__exit__return_type_TypeChecker.check__exit__return_type.if_all_isinstance_ret_exp.self_msg_incorrect__exit_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check__exit__return_type_TypeChecker.check__exit__return_type.if_all_isinstance_ret_exp.self_msg_incorrect__exit_", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1689, "end_line": 1710, "span_ids": ["TypeChecker.check__exit__return_type"], "tokens": 200}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def check__exit__return_type(self, defn: FuncItem) -> None:\n \"\"\"Generate error if the return type of __exit__ is problematic.\n\n If __exit__ always returns False but the return type is declared\n as bool, mypy thinks that a with statement may \"swallow\"\n exceptions even though this is not the case, resulting in\n invalid reachability inference.\n \"\"\"\n if not defn.type or not isinstance(defn.type, CallableType):\n return\n\n ret_type = get_proper_type(defn.type.ret_type)\n if not has_bool_item(ret_type):\n return\n\n returns = all_return_statements(defn)\n if not returns:\n return\n\n if all(isinstance(ret.expr, NameExpr) and ret.expr.fullname == 'builtins.False'\n for ret in returns):\n self.msg.incorrect__exit__return(defn)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.visit_class_def_TypeChecker.visit_class_def.if_typ_is_protocol_and_ty.self_check_protocol_varia": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.visit_class_def_TypeChecker.visit_class_def.if_typ_is_protocol_and_ty.self_check_protocol_varia", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1712, "end_line": 1755, "span_ids": ["TypeChecker.visit_class_def"], "tokens": 491}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def visit_class_def(self, defn: ClassDef) -> None:\n \"\"\"Type check a class definition.\"\"\"\n typ = defn.info\n for base in typ.mro[1:]:\n if base.is_final:\n self.fail(message_registry.CANNOT_INHERIT_FROM_FINAL.format(base.name), defn)\n with self.tscope.class_scope(defn.info), self.enter_partial_types(is_class=True):\n old_binder = self.binder\n self.binder = ConditionalTypeBinder()\n with self.binder.top_frame_context():\n with self.scope.push_class(defn.info):\n self.accept(defn.defs)\n self.binder = old_binder\n if not (defn.info.typeddict_type or defn.info.tuple_type or defn.info.is_enum):\n # If it is not a normal class (not a special form) check class keywords.\n self.check_init_subclass(defn)\n if not defn.has_incompatible_baseclass:\n # Otherwise we've already found errors; more errors are not useful\n self.check_multiple_inheritance(typ)\n\n if defn.decorators:\n sig = type_object_type(defn.info, self.named_type) # type: Type\n # Decorators are applied in reverse order.\n for decorator in reversed(defn.decorators):\n if (isinstance(decorator, CallExpr)\n and isinstance(decorator.analyzed, PromoteExpr)):\n # _promote is a special type checking related construct.\n continue\n\n dec = self.expr_checker.accept(decorator)\n temp = self.temp_node(sig, context=decorator)\n fullname = None\n if isinstance(decorator, RefExpr):\n fullname = decorator.fullname\n\n # TODO: Figure out how to have clearer error messages.\n # (e.g. \"class decorator must be a function that accepts a type.\"\n sig, _ = self.expr_checker.check_call(dec, [temp],\n [nodes.ARG_POS], defn,\n callable_name=fullname)\n # TODO: Apply the sig to the actual TypeInfo so we can handle decorators\n # that completely swap out the type. (e.g. Callable[[Type[A]], Type[B]])\n if typ.is_protocol and typ.defn.type_vars:\n self.check_protocol_variance(defn)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_init_subclass_TypeChecker.check_init_subclass.for_base_in_defn_info_mro.break": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_init_subclass_TypeChecker.check_init_subclass.for_base_in_defn_info_mro.break", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1757, "end_line": 1803, "span_ids": ["TypeChecker.check_init_subclass"], "tokens": 504}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def check_init_subclass(self, defn: ClassDef) -> None:\n \"\"\"Check that keywords in a class definition are valid arguments for __init_subclass__().\n\n In this example:\n 1 class Base:\n 2 def __init_subclass__(cls, thing: int):\n 3 pass\n 4 class Child(Base, thing=5):\n 5 def __init_subclass__(cls):\n 6 pass\n 7 Child()\n\n Base.__init_subclass__(thing=5) is called at line 4. This is what we simulate here.\n Child.__init_subclass__ is never called.\n \"\"\"\n if (defn.info.metaclass_type and\n defn.info.metaclass_type.type.fullname not in ('builtins.type', 'abc.ABCMeta')):\n # We can't safely check situations when both __init_subclass__ and a custom\n # metaclass are present.\n return\n # At runtime, only Base.__init_subclass__ will be called, so\n # we skip the current class itself.\n for base in defn.info.mro[1:]:\n if '__init_subclass__' not in base.names:\n continue\n name_expr = NameExpr(defn.name)\n name_expr.node = base\n callee = MemberExpr(name_expr, '__init_subclass__')\n args = list(defn.keywords.values())\n arg_names = list(defn.keywords.keys()) # type: List[Optional[str]]\n # 'metaclass' keyword is consumed by the rest of the type machinery,\n # and is never passed to __init_subclass__ implementations\n if 'metaclass' in arg_names:\n idx = arg_names.index('metaclass')\n arg_names.pop(idx)\n args.pop(idx)\n arg_kinds = [ARG_NAMED] * len(args)\n call_expr = CallExpr(callee, args, arg_kinds, arg_names)\n call_expr.line = defn.line\n call_expr.column = defn.column\n call_expr.end_line = defn.end_line\n self.expr_checker.accept(call_expr,\n allow_none_return=True,\n always_allow_any=True)\n # We are only interested in the first Base having __init_subclass__,\n # all other bases have already been checked.\n break", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_protocol_variance_TypeChecker.check_protocol_variance.for_i_tvar_in_enumerate_.if_expected_tvar_varia.self_msg_bad_proto_varian": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_protocol_variance_TypeChecker.check_protocol_variance.for_i_tvar_in_enumerate_.if_expected_tvar_varia.self_msg_bad_proto_varian", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1805, "end_line": 1830, "span_ids": ["TypeChecker.check_protocol_variance"], "tokens": 319}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def check_protocol_variance(self, defn: ClassDef) -> None:\n \"\"\"Check that protocol definition is compatible with declared\n variances of type variables.\n\n Note that we also prohibit declaring protocol classes as invariant\n if they are actually covariant/contravariant, since this may break\n transitivity of subtyping, see PEP 544.\n \"\"\"\n info = defn.info\n object_type = Instance(info.mro[-1], [])\n tvars = info.defn.type_vars\n for i, tvar in enumerate(tvars):\n up_args = [object_type if i == j else AnyType(TypeOfAny.special_form)\n for j, _ in enumerate(tvars)] # type: List[Type]\n down_args = [UninhabitedType() if i == j else AnyType(TypeOfAny.special_form)\n for j, _ in enumerate(tvars)] # type: List[Type]\n up, down = Instance(info, up_args), Instance(info, down_args)\n # TODO: add advanced variance checks for recursive protocols\n if is_subtype(down, up, ignore_declared_variance=True):\n expected = COVARIANT\n elif is_subtype(up, down, ignore_declared_variance=True):\n expected = CONTRAVARIANT\n else:\n expected = INVARIANT\n if expected != tvar.variance:\n self.msg.bad_proto_variance(tvar.variance, tvar.name, expected, defn)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_multiple_inheritance_TypeChecker.check_multiple_inheritance.for_i_base_in_enumerate_.for_name_in_non_overridde.for_base2_in_mro_i_1_.if_name_in_base2_names_an.self_check_compatibility_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_multiple_inheritance_TypeChecker.check_multiple_inheritance.for_i_base_in_enumerate_.for_name_in_non_overridde.for_base2_in_mro_i_1_.if_name_in_base2_names_an.self_check_compatibility_", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1832, "end_line": 1851, "span_ids": ["TypeChecker.check_multiple_inheritance"], "tokens": 225}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def check_multiple_inheritance(self, typ: TypeInfo) -> None:\n \"\"\"Check for multiple inheritance related errors.\"\"\"\n if len(typ.bases) <= 1:\n # No multiple inheritance.\n return\n # Verify that inherited attributes are compatible.\n mro = typ.mro[1:]\n for i, base in enumerate(mro):\n # Attributes defined in both the type and base are skipped.\n # Normal checks for attribute compatibility should catch any problems elsewhere.\n non_overridden_attrs = base.names.keys() - typ.names.keys()\n for name in non_overridden_attrs:\n if is_private(name):\n continue\n for base2 in mro[i + 1:]:\n # We only need to check compatibility of attributes from classes not\n # in a subclass relationship. For subclasses, normal (single inheritance)\n # checks suffice (these are implemented elsewhere).\n if name in base2.names and base2 not in base.mro:\n self.check_compatibility(name, base, base2, typ)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.determine_type_of_class_member_TypeChecker.determine_type_of_class_member.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.determine_type_of_class_member_TypeChecker.determine_type_of_class_member.return.None", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1853, "end_line": 1865, "span_ids": ["TypeChecker.determine_type_of_class_member"], "tokens": 140}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def determine_type_of_class_member(self, sym: SymbolTableNode) -> Optional[Type]:\n if sym.type is not None:\n return sym.type\n if isinstance(sym.node, FuncBase):\n return self.function_type(sym.node)\n if isinstance(sym.node, TypeInfo):\n # nested class\n return type_object_type(sym.node, self.named_type)\n if isinstance(sym.node, TypeVarExpr):\n # Use of TypeVars is rejected in an expression/runtime context, so\n # we don't need to check supertype compatibility for them.\n return AnyType(TypeOfAny.special_form)\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_compatibility_TypeChecker.check_compatibility.if_not_ok_.self_msg_base_class_defin": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_compatibility_TypeChecker.check_compatibility.if_not_ok_.self_msg_base_class_defin", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1867, "end_line": 1932, "span_ids": ["TypeChecker.check_compatibility"], "tokens": 741}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def check_compatibility(self, name: str, base1: TypeInfo,\n base2: TypeInfo, ctx: TypeInfo) -> None:\n \"\"\"Check if attribute name in base1 is compatible with base2 in multiple inheritance.\n\n Assume base1 comes before base2 in the MRO, and that base1 and base2 don't have\n a direct subclass relationship (i.e., the compatibility requirement only derives from\n multiple inheritance).\n\n This check verifies that a definition taken from base1 (and mapped to the current\n class ctx), is type compatible with the definition taken from base2 (also mapped), so\n that unsafe subclassing like this can be detected:\n class A(Generic[T]):\n def foo(self, x: T) -> None: ...\n\n class B:\n def foo(self, x: str) -> None: ...\n\n class C(B, A[int]): ... # this is unsafe because...\n\n x: A[int] = C()\n x.foo # ...runtime type is (str) -> None, while static type is (int) -> None\n \"\"\"\n if name in ('__init__', '__new__', '__init_subclass__'):\n # __init__ and friends can be incompatible -- it's a special case.\n return\n first = base1.names[name]\n second = base2.names[name]\n first_type = get_proper_type(self.determine_type_of_class_member(first))\n second_type = get_proper_type(self.determine_type_of_class_member(second))\n\n if (isinstance(first_type, FunctionLike) and\n isinstance(second_type, FunctionLike)):\n if first_type.is_type_obj() and second_type.is_type_obj():\n # For class objects only check the subtype relationship of the classes,\n # since we allow incompatible overrides of '__init__'/'__new__'\n ok = is_subtype(left=fill_typevars_with_any(first_type.type_object()),\n right=fill_typevars_with_any(second_type.type_object()))\n else:\n # First bind/map method types when necessary.\n first_sig = self.bind_and_map_method(first, first_type, ctx, base1)\n second_sig = self.bind_and_map_method(second, second_type, ctx, base2)\n ok = is_subtype(first_sig, second_sig, ignore_pos_arg_names=True)\n elif first_type and second_type:\n ok = is_equivalent(first_type, second_type)\n if not ok:\n second_node = base2[name].node\n if isinstance(second_node, Decorator) and second_node.func.is_property:\n ok = is_subtype(first_type, cast(CallableType, second_type).ret_type)\n else:\n if first_type is None:\n self.msg.cannot_determine_type_in_base(name, base1.name, ctx)\n if second_type is None:\n self.msg.cannot_determine_type_in_base(name, base2.name, ctx)\n ok = True\n # Final attributes can never be overridden, but can override\n # non-final read-only attributes.\n if is_final_node(second.node):\n self.msg.cant_override_final(name, base2.name, ctx)\n if is_final_node(first.node):\n self.check_if_final_var_override_writable(name, second.node, ctx)\n # __slots__ is special and the type can vary across class hierarchy.\n if name == '__slots__':\n ok = True\n if not ok:\n self.msg.base_class_definitions_incompatible(name, base1, base2,\n ctx)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.visit_import_from_TypeChecker.check_import.for_assign_in_node_assign.self_check_simple_assignm": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.visit_import_from_TypeChecker.check_import.for_assign_in_node_assign.self_check_simple_assignm", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1934, "end_line": 1954, "span_ids": ["TypeChecker.visit_import", "TypeChecker.visit_import_from", "TypeChecker.visit_import_all", "TypeChecker.check_import"], "tokens": 209}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def visit_import_from(self, node: ImportFrom) -> None:\n self.check_import(node)\n\n def visit_import_all(self, node: ImportAll) -> None:\n self.check_import(node)\n\n def visit_import(self, s: Import) -> None:\n pass\n\n def check_import(self, node: ImportBase) -> None:\n for assign in node.assignments:\n lvalue = assign.lvalues[0]\n lvalue_type, _, __ = self.check_lvalue(lvalue)\n if lvalue_type is None:\n # TODO: This is broken.\n lvalue_type = AnyType(TypeOfAny.special_form)\n message = '{} \"{}\"'.format(message_registry.INCOMPATIBLE_IMPORT_OF,\n cast(NameExpr, assign.rvalue).name)\n self.check_simple_assignment(lvalue_type, assign.rvalue, node,\n msg=message, lvalue_name='local name',\n rvalue_name='imported name')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.None_92_TypeChecker.should_report_unreachable_issues.return._self_options_warn_unreac": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.None_92_TypeChecker.should_report_unreachable_issues.return._self_options_warn_unreac", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1956, "end_line": 1976, "span_ids": ["TypeChecker.check_import", "TypeChecker.should_report_unreachable_issues", "TypeChecker.visit_block"], "tokens": 180}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n #\n # Statements\n #\n\n def visit_block(self, b: Block) -> None:\n if b.is_unreachable:\n # This block was marked as being unreachable during semantic analysis.\n # It turns out any blocks marked in this way are *intentionally* marked\n # as unreachable -- so we don't display an error.\n self.binder.unreachable()\n return\n for s in b.body:\n if self.binder.is_unreachable():\n if self.should_report_unreachable_issues() and not self.is_raising_or_empty(s):\n self.msg.unreachable_statement(s)\n break\n self.accept(s)\n\n def should_report_unreachable_issues(self) -> bool:\n return (self.options.warn_unreachable\n and not self.binder.is_unreachable_warning_suppressed())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.is_raising_or_empty_TypeChecker.is_raising_or_empty.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.is_raising_or_empty_TypeChecker.is_raising_or_empty.return.False", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1978, "end_line": 2002, "span_ids": ["TypeChecker.is_raising_or_empty"], "tokens": 245}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def is_raising_or_empty(self, s: Statement) -> bool:\n \"\"\"Returns 'true' if the given statement either throws an error of some kind\n or is a no-op.\n\n We use this function mostly while handling the '--warn-unreachable' flag. When\n that flag is present, we normally report an error on any unreachable statement.\n But if that statement is just something like a 'pass' or a just-in-case 'assert False',\n reporting an error would be annoying.\n \"\"\"\n if isinstance(s, AssertStmt) and is_false_literal(s.expr):\n return True\n elif isinstance(s, (RaiseStmt, PassStmt)):\n return True\n elif isinstance(s, ExpressionStmt):\n if isinstance(s.expr, EllipsisExpr):\n return True\n elif isinstance(s.expr, CallExpr):\n self.expr_checker.msg.disable_errors()\n typ = get_proper_type(self.expr_checker.accept(\n s.expr, allow_none_return=True, always_allow_any=True))\n self.expr_checker.msg.enable_errors()\n\n if isinstance(typ, UninhabitedType):\n return True\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.visit_assignment_stmt_TypeChecker.visit_assignment_stmt.if_s_is_final_def_and_s_.self_fail_message_registr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.visit_assignment_stmt_TypeChecker.visit_assignment_stmt.if_s_is_final_def_and_s_.self_fail_message_registr", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2004, "end_line": 2042, "span_ids": ["TypeChecker.visit_assignment_stmt"], "tokens": 444}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def visit_assignment_stmt(self, s: AssignmentStmt) -> None:\n \"\"\"Type check an assignment statement.\n\n Handle all kinds of assignment statements (simple, indexed, multiple).\n \"\"\"\n with self.enter_final_context(s.is_final_def):\n self.check_assignment(s.lvalues[-1], s.rvalue, s.type is None, s.new_syntax)\n\n if s.is_alias_def:\n # We do this mostly for compatibility with old semantic analyzer.\n # TODO: should we get rid of this?\n self.store_type(s.lvalues[-1], self.expr_checker.accept(s.rvalue))\n\n if (s.type is not None and\n self.options.disallow_any_unimported and\n has_any_from_unimported_type(s.type)):\n if isinstance(s.lvalues[-1], TupleExpr):\n # This is a multiple assignment. Instead of figuring out which type is problematic,\n # give a generic error message.\n self.msg.unimported_type_becomes_any(\"A type on this line\",\n AnyType(TypeOfAny.special_form), s)\n else:\n self.msg.unimported_type_becomes_any(\"Type of variable\", s.type, s)\n check_for_explicit_any(s.type, self.options, self.is_typeshed_stub, self.msg, context=s)\n\n if len(s.lvalues) > 1:\n # Chained assignment (e.g. x = y = ...).\n # Make sure that rvalue type will not be reinferred.\n if s.rvalue not in self.type_map:\n self.expr_checker.accept(s.rvalue)\n rvalue = self.temp_node(self.type_map[s.rvalue], s)\n for lv in s.lvalues[:-1]:\n with self.enter_final_context(s.is_final_def):\n self.check_assignment(lv, rvalue, s.type is None)\n\n self.check_final(s)\n if (s.is_final_def and s.type and not has_no_typevars(s.type)\n and self.scope.active_class() is not None):\n self.fail(message_registry.DEPENDENT_FINAL_IN_CLASS_BODY, s)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_assignment_TypeChecker.check_assignment.if_isinstance_lvalue_Tup.else_.if_inferred_.self_infer_variable_type_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_assignment_TypeChecker.check_assignment.if_isinstance_lvalue_Tup.else_.if_inferred_.self_infer_variable_type_", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2044, "end_line": 2149, "span_ids": ["TypeChecker.check_assignment"], "tokens": 1202}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def check_assignment(self, lvalue: Lvalue, rvalue: Expression, infer_lvalue_type: bool = True,\n new_syntax: bool = False) -> None:\n \"\"\"Type check a single assignment: lvalue = rvalue.\"\"\"\n if isinstance(lvalue, TupleExpr) or isinstance(lvalue, ListExpr):\n self.check_assignment_to_multiple_lvalues(lvalue.items, rvalue, rvalue,\n infer_lvalue_type)\n else:\n self.try_infer_partial_generic_type_from_assignment(lvalue, rvalue, '=')\n lvalue_type, index_lvalue, inferred = self.check_lvalue(lvalue)\n # If we're assigning to __getattr__ or similar methods, check that the signature is\n # valid.\n if isinstance(lvalue, NameExpr) and lvalue.node:\n name = lvalue.node.name\n if name in ('__setattr__', '__getattribute__', '__getattr__'):\n # If an explicit type is given, use that.\n if lvalue_type:\n signature = lvalue_type\n else:\n signature = self.expr_checker.accept(rvalue)\n if signature:\n if name == '__setattr__':\n self.check_setattr_method(signature, lvalue)\n else:\n self.check_getattr_method(signature, lvalue, name)\n\n # Defer PartialType's super type checking.\n if (isinstance(lvalue, RefExpr) and\n not (isinstance(lvalue_type, PartialType) and lvalue_type.type is None)):\n if self.check_compatibility_all_supers(lvalue, lvalue_type, rvalue):\n # We hit an error on this line; don't check for any others\n return\n\n if lvalue_type:\n if isinstance(lvalue_type, PartialType) and lvalue_type.type is None:\n # Try to infer a proper type for a variable with a partial None type.\n rvalue_type = self.expr_checker.accept(rvalue)\n if isinstance(get_proper_type(rvalue_type), NoneType):\n # This doesn't actually provide any additional information -- multiple\n # None initializers preserve the partial None type.\n return\n\n if is_valid_inferred_type(rvalue_type):\n var = lvalue_type.var\n partial_types = self.find_partial_types(var)\n if partial_types is not None:\n if not self.current_node_deferred:\n # Partial type can't be final, so strip any literal values.\n rvalue_type = remove_instance_last_known_values(rvalue_type)\n inferred_type = make_simplified_union(\n [rvalue_type, NoneType()])\n self.set_inferred_type(var, lvalue, inferred_type)\n else:\n var.type = None\n del partial_types[var]\n lvalue_type = var.type\n else:\n # Try to infer a partial type. No need to check the return value, as\n # an error will be reported elsewhere.\n self.infer_partial_type(lvalue_type.var, lvalue, rvalue_type)\n # Handle None PartialType's super type checking here, after it's resolved.\n if (isinstance(lvalue, RefExpr) and\n self.check_compatibility_all_supers(lvalue, lvalue_type, rvalue)):\n # We hit an error on this line; don't check for any others\n return\n elif (is_literal_none(rvalue) and\n isinstance(lvalue, NameExpr) and\n isinstance(lvalue.node, Var) and\n lvalue.node.is_initialized_in_class and\n not new_syntax):\n # Allow None's to be assigned to class variables with non-Optional types.\n rvalue_type = lvalue_type\n elif (isinstance(lvalue, MemberExpr) and\n lvalue.kind is None): # Ignore member access to modules\n instance_type = self.expr_checker.accept(lvalue.expr)\n rvalue_type, lvalue_type, infer_lvalue_type = self.check_member_assignment(\n instance_type, lvalue_type, rvalue, context=rvalue)\n else:\n rvalue_type = self.check_simple_assignment(lvalue_type, rvalue, context=rvalue,\n code=codes.ASSIGNMENT)\n\n # Special case: only non-abstract non-protocol classes can be assigned to\n # variables with explicit type Type[A], where A is protocol or abstract.\n rvalue_type = get_proper_type(rvalue_type)\n lvalue_type = get_proper_type(lvalue_type)\n if (isinstance(rvalue_type, CallableType) and rvalue_type.is_type_obj() and\n (rvalue_type.type_object().is_abstract or\n rvalue_type.type_object().is_protocol) and\n isinstance(lvalue_type, TypeType) and\n isinstance(lvalue_type.item, Instance) and\n (lvalue_type.item.type.is_abstract or\n lvalue_type.item.type.is_protocol)):\n self.msg.concrete_only_assign(lvalue_type, rvalue)\n return\n if rvalue_type and infer_lvalue_type and not isinstance(lvalue_type, PartialType):\n # Don't use type binder for definitions of special forms, like named tuples.\n if not (isinstance(lvalue, NameExpr) and lvalue.is_special_form):\n self.binder.assign_type(lvalue, rvalue_type, lvalue_type, False)\n\n elif index_lvalue:\n self.check_indexed_assignment(index_lvalue, rvalue, lvalue)\n\n if inferred:\n rvalue_type = self.expr_checker.accept(rvalue)\n if not inferred.is_final:\n rvalue_type = remove_instance_last_known_values(rvalue_type)\n self.infer_variable_type(inferred, lvalue, rvalue_type, rvalue)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker._type_operator_tuples_TypeChecker.try_infer_partial_generic_type_from_assignment.if_var_is_not_None_.if_isinstance_rvalue_type.elif_isinstance_rvalue_ty.del_partial_types_var_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker._type_operator_tuples_TypeChecker.try_infer_partial_generic_type_from_assignment.if_var_is_not_None_.if_isinstance_rvalue_type.elif_isinstance_rvalue_ty.del_partial_types_var_", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2151, "end_line": 2200, "span_ids": ["TypeChecker.check_assignment", "TypeChecker.try_infer_partial_generic_type_from_assignment", "TypeChecker:53"], "tokens": 441}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n # (type, operator) tuples for augmented assignments supported with partial types\n partial_type_augmented_ops = {\n ('builtins.list', '+'),\n ('builtins.set', '|'),\n } # type: Final\n\n def try_infer_partial_generic_type_from_assignment(self,\n lvalue: Lvalue,\n rvalue: Expression,\n op: str) -> None:\n \"\"\"Try to infer a precise type for partial generic type from assignment.\n\n 'op' is '=' for normal assignment and a binary operator ('+', ...) for\n augmented assignment.\n\n Example where this happens:\n\n x = []\n if foo():\n x = [1] # Infer List[int] as type of 'x'\n \"\"\"\n var = None\n if (isinstance(lvalue, NameExpr)\n and isinstance(lvalue.node, Var)\n and isinstance(lvalue.node.type, PartialType)):\n var = lvalue.node\n elif isinstance(lvalue, MemberExpr):\n var = self.expr_checker.get_partial_self_var(lvalue)\n if var is not None:\n typ = var.type\n assert isinstance(typ, PartialType)\n if typ.type is None:\n return\n # Return if this is an unsupported augmented assignment.\n if op != '=' and (typ.type.fullname, op) not in self.partial_type_augmented_ops:\n return\n # TODO: some logic here duplicates the None partial type counterpart\n # inlined in check_assignment(), see # 8043.\n partial_types = self.find_partial_types(var)\n if partial_types is None:\n return\n rvalue_type = self.expr_checker.accept(rvalue)\n rvalue_type = get_proper_type(rvalue_type)\n if isinstance(rvalue_type, Instance):\n if rvalue_type.type == typ.type and is_valid_inferred_type(rvalue_type):\n var.type = rvalue_type\n del partial_types[var]\n elif isinstance(rvalue_type, AnyType):\n var.type = fill_typevars_with_any(typ.type)\n del partial_types[var]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_compatibility_all_supers_TypeChecker.check_compatibility_all_supers.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_compatibility_all_supers_TypeChecker.check_compatibility_all_supers.return.False", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2202, "end_line": 2258, "span_ids": ["TypeChecker.check_compatibility_all_supers"], "tokens": 502}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def check_compatibility_all_supers(self, lvalue: RefExpr, lvalue_type: Optional[Type],\n rvalue: Expression) -> bool:\n lvalue_node = lvalue.node\n # Check if we are a class variable with at least one base class\n if (isinstance(lvalue_node, Var) and\n lvalue.kind in (MDEF, None) and # None for Vars defined via self\n len(lvalue_node.info.bases) > 0):\n\n for base in lvalue_node.info.mro[1:]:\n tnode = base.names.get(lvalue_node.name)\n if tnode is not None:\n if not self.check_compatibility_classvar_super(lvalue_node,\n base,\n tnode.node):\n # Show only one error per variable\n break\n\n if not self.check_compatibility_final_super(lvalue_node,\n base,\n tnode.node):\n # Show only one error per variable\n break\n\n direct_bases = lvalue_node.info.direct_base_classes()\n last_immediate_base = direct_bases[-1] if direct_bases else None\n\n for base in lvalue_node.info.mro[1:]:\n # Only check __slots__ against the 'object'\n # If a base class defines a Tuple of 3 elements, a child of\n # this class should not be allowed to define it as a Tuple of\n # anything other than 3 elements. The exception to this rule\n # is __slots__, where it is allowed for any child class to\n # redefine it.\n if lvalue_node.name == \"__slots__\" and base.fullname != \"builtins.object\":\n continue\n\n if is_private(lvalue_node.name):\n continue\n\n base_type, base_node = self.lvalue_type_from_base(lvalue_node, base)\n\n if base_type:\n assert base_node is not None\n if not self.check_compatibility_super(lvalue,\n lvalue_type,\n rvalue,\n base,\n base_type,\n base_node):\n # Only show one error per variable; even if other\n # base classes are also incompatible\n return True\n if base is last_immediate_base:\n # At this point, the attribute was found to be compatible with all\n # immediate parents.\n break\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_compatibility_super_TypeChecker.check_compatibility_super.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_compatibility_super_TypeChecker.check_compatibility_super.return.True", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2260, "end_line": 2315, "span_ids": ["TypeChecker.check_compatibility_super"], "tokens": 554}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def check_compatibility_super(self, lvalue: RefExpr, lvalue_type: Optional[Type],\n rvalue: Expression, base: TypeInfo, base_type: Type,\n base_node: Node) -> bool:\n lvalue_node = lvalue.node\n assert isinstance(lvalue_node, Var)\n\n # Do not check whether the rvalue is compatible if the\n # lvalue had a type defined; this is handled by other\n # parts, and all we have to worry about in that case is\n # that lvalue is compatible with the base class.\n compare_node = None\n if lvalue_type:\n compare_type = lvalue_type\n compare_node = lvalue.node\n else:\n compare_type = self.expr_checker.accept(rvalue, base_type)\n if isinstance(rvalue, NameExpr):\n compare_node = rvalue.node\n if isinstance(compare_node, Decorator):\n compare_node = compare_node.func\n\n base_type = get_proper_type(base_type)\n compare_type = get_proper_type(compare_type)\n if compare_type:\n if (isinstance(base_type, CallableType) and\n isinstance(compare_type, CallableType)):\n base_static = is_node_static(base_node)\n compare_static = is_node_static(compare_node)\n\n # In case compare_static is unknown, also check\n # if 'definition' is set. The most common case for\n # this is with TempNode(), where we lose all\n # information about the real rvalue node (but only get\n # the rvalue type)\n if compare_static is None and compare_type.definition:\n compare_static = is_node_static(compare_type.definition)\n\n # Compare against False, as is_node_static can return None\n if base_static is False and compare_static is False:\n # Class-level function objects and classmethods become bound\n # methods: the former to the instance, the latter to the\n # class\n base_type = bind_self(base_type, self.scope.active_self_type())\n compare_type = bind_self(compare_type, self.scope.active_self_type())\n\n # If we are a static method, ensure to also tell the\n # lvalue it now contains a static method\n if base_static and compare_static:\n lvalue_node.is_staticmethod = True\n\n return self.check_subtype(compare_type, base_type, rvalue,\n message_registry.INCOMPATIBLE_TYPES_IN_ASSIGNMENT,\n 'expression has type',\n 'base class \"%s\" defined the type as' % base.name,\n code=codes.ASSIGNMENT)\n return True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.lvalue_type_from_base_TypeChecker.lvalue_type_from_base.return.None_None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.lvalue_type_from_base_TypeChecker.lvalue_type_from_base.return.None_None", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2317, "end_line": 2356, "span_ids": ["TypeChecker.lvalue_type_from_base"], "tokens": 369}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def lvalue_type_from_base(self, expr_node: Var,\n base: TypeInfo) -> Tuple[Optional[Type], Optional[Node]]:\n \"\"\"For a NameExpr that is part of a class, walk all base classes and try\n to find the first class that defines a Type for the same name.\"\"\"\n expr_name = expr_node.name\n base_var = base.names.get(expr_name)\n\n if base_var:\n base_node = base_var.node\n base_type = base_var.type\n if isinstance(base_node, Decorator):\n base_node = base_node.func\n base_type = base_node.type\n\n if base_type:\n if not has_no_typevars(base_type):\n self_type = self.scope.active_self_type()\n assert self_type is not None, \"Internal error: base lookup outside class\"\n if isinstance(self_type, TupleType):\n instance = tuple_fallback(self_type)\n else:\n instance = self_type\n itype = map_instance_to_supertype(instance, base)\n base_type = expand_type_by_instance(base_type, itype)\n\n base_type = get_proper_type(base_type)\n if isinstance(base_type, CallableType) and isinstance(base_node, FuncDef):\n # If we are a property, return the Type of the return\n # value, not the Callable\n if base_node.is_property:\n base_type = get_proper_type(base_type.ret_type)\n if isinstance(base_type, FunctionLike) and isinstance(base_node,\n OverloadedFuncDef):\n # Same for properties with setter\n if base_node.is_property:\n base_type = base_type.items()[0].ret_type\n\n return base_type, base_node\n\n return None, None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_compatibility_classvar_super_TypeChecker.check_compatibility_classvar_super.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_compatibility_classvar_super_TypeChecker.check_compatibility_classvar_super.return.True", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2358, "end_line": 2368, "span_ids": ["TypeChecker.check_compatibility_classvar_super"], "tokens": 125}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def check_compatibility_classvar_super(self, node: Var,\n base: TypeInfo, base_node: Optional[Node]) -> bool:\n if not isinstance(base_node, Var):\n return True\n if node.is_classvar and not base_node.is_classvar:\n self.fail(message_registry.CANNOT_OVERRIDE_INSTANCE_VAR.format(base.name), node)\n return False\n elif not node.is_classvar and base_node.is_classvar:\n self.fail(message_registry.CANNOT_OVERRIDE_CLASS_VAR.format(base.name), node)\n return False\n return True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_compatibility_final_super_TypeChecker.check_compatibility_final_super.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_compatibility_final_super_TypeChecker.check_compatibility_final_super.return.True", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2370, "end_line": 2392, "span_ids": ["TypeChecker.check_compatibility_final_super"], "tokens": 268}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def check_compatibility_final_super(self, node: Var,\n base: TypeInfo, base_node: Optional[Node]) -> bool:\n \"\"\"Check if an assignment overrides a final attribute in a base class.\n\n This only checks situations where either a node in base class is not a variable\n but a final method, or where override is explicitly declared as final.\n In these cases we give a more detailed error message. In addition, we check that\n a final variable doesn't override writeable attribute, which is not safe.\n\n Other situations are checked in `check_final()`.\n \"\"\"\n if not isinstance(base_node, (Var, FuncBase, Decorator)):\n return True\n if base_node.is_final and (node.is_final or not isinstance(base_node, Var)):\n # Give this error only for explicit override attempt with `Final`, or\n # if we are overriding a final method with variable.\n # Other override attempts will be flagged as assignment to constant\n # in `check_final()`.\n self.msg.cant_override_final(node.name, base.name, node)\n return False\n if node.is_final:\n self.check_if_final_var_override_writable(node.name, base_node, node)\n return True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_if_final_var_override_writable_TypeChecker.enter_final_context.try_.finally_.self._is_final_def.old_ctx": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_if_final_var_override_writable_TypeChecker.enter_final_context.try_.finally_.self._is_final_def.old_ctx", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2394, "end_line": 2428, "span_ids": ["TypeChecker.check_if_final_var_override_writable", "TypeChecker.get_final_context", "TypeChecker.enter_final_context"], "tokens": 254}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def check_if_final_var_override_writable(self,\n name: str,\n base_node:\n Optional[Node],\n ctx: Context) -> None:\n \"\"\"Check that a final variable doesn't override writeable attribute.\n\n This is done to prevent situations like this:\n class C:\n attr = 1\n class D(C):\n attr: Final = 2\n\n x: C = D()\n x.attr = 3 # Oops!\n \"\"\"\n writable = True\n if base_node:\n writable = self.is_writable_attribute(base_node)\n if writable:\n self.msg.final_cant_override_writable(name, ctx)\n\n def get_final_context(self) -> bool:\n \"\"\"Check whether we a currently checking a final declaration.\"\"\"\n return self._is_final_def\n\n @contextmanager\n def enter_final_context(self, is_final_def: bool) -> Iterator[None]:\n \"\"\"Store whether the current checked assignment is a final declaration.\"\"\"\n old_ctx = self._is_final_def\n self._is_final_def = is_final_def\n try:\n yield\n finally:\n self._is_final_def = old_ctx", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_final_TypeChecker.check_final.for_lv_in_lvs_.if_isinstance_lv_RefExpr.if_lv_node_is_final_and_n.self_msg_cant_assign_to_f": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_final_TypeChecker.check_final.for_lv_in_lvs_.if_isinstance_lv_RefExpr.if_lv_node_is_final_and_n.self_msg_cant_assign_to_f", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2430, "end_line": 2474, "span_ids": ["TypeChecker.check_final"], "tokens": 499}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def check_final(self,\n s: Union[AssignmentStmt, OperatorAssignmentStmt, AssignmentExpr]) -> None:\n \"\"\"Check if this assignment does not assign to a final attribute.\n\n This function performs the check only for name assignments at module\n and class scope. The assignments to `obj.attr` and `Cls.attr` are checked\n in checkmember.py.\n \"\"\"\n if isinstance(s, AssignmentStmt):\n lvs = self.flatten_lvalues(s.lvalues)\n elif isinstance(s, AssignmentExpr):\n lvs = [s.target]\n else:\n lvs = [s.lvalue]\n is_final_decl = s.is_final_def if isinstance(s, AssignmentStmt) else False\n if is_final_decl and self.scope.active_class():\n lv = lvs[0]\n assert isinstance(lv, RefExpr)\n assert isinstance(lv.node, Var)\n if (lv.node.final_unset_in_class and not lv.node.final_set_in_init and\n not self.is_stub and # It is OK to skip initializer in stub files.\n # Avoid extra error messages, if there is no type in Final[...],\n # then we already reported the error about missing r.h.s.\n isinstance(s, AssignmentStmt) and s.type is not None):\n self.msg.final_without_value(s)\n for lv in lvs:\n if isinstance(lv, RefExpr) and isinstance(lv.node, Var):\n name = lv.node.name\n cls = self.scope.active_class()\n if cls is not None:\n # Theses additional checks exist to give more error messages\n # even if the final attribute was overridden with a new symbol\n # (which is itself an error)...\n for base in cls.mro[1:]:\n sym = base.names.get(name)\n # We only give this error if base node is variable,\n # overriding final method will be caught in\n # `check_compatibility_final_super()`.\n if sym and isinstance(sym.node, Var):\n if sym.node.is_final and not is_final_decl:\n self.msg.cant_assign_to_final(name, sym.node.info is None, s)\n # ...but only once\n break\n if lv.node.is_final and not is_final_decl:\n self.msg.cant_assign_to_final(name, lv.node.info is None, s)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_assignment_to_multiple_lvalues_TypeChecker.check_assignment_to_multiple_lvalues.if_isinstance_rvalue_Tup.else_.self_check_multi_assignme": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_assignment_to_multiple_lvalues_TypeChecker.check_assignment_to_multiple_lvalues.if_isinstance_rvalue_Tup.else_.self_check_multi_assignme", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2476, "end_line": 2548, "span_ids": ["TypeChecker.check_assignment_to_multiple_lvalues"], "tokens": 828}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def check_assignment_to_multiple_lvalues(self, lvalues: List[Lvalue], rvalue: Expression,\n context: Context,\n infer_lvalue_type: bool = True) -> None:\n if isinstance(rvalue, TupleExpr) or isinstance(rvalue, ListExpr):\n # Recursively go into Tuple or List expression rhs instead of\n # using the type of rhs, because this allowed more fine grained\n # control in cases like: a, b = [int, str] where rhs would get\n # type List[object]\n rvalues = [] # type: List[Expression]\n iterable_type = None # type: Optional[Type]\n last_idx = None # type: Optional[int]\n for idx_rval, rval in enumerate(rvalue.items):\n if isinstance(rval, StarExpr):\n typs = get_proper_type(self.expr_checker.visit_star_expr(rval).type)\n if isinstance(typs, TupleType):\n rvalues.extend([TempNode(typ) for typ in typs.items])\n elif self.type_is_iterable(typs) and isinstance(typs, Instance):\n if (iterable_type is not None\n and iterable_type != self.iterable_item_type(typs)):\n self.fail(\"Contiguous iterable with same type expected\", context)\n else:\n if last_idx is None or last_idx + 1 == idx_rval:\n rvalues.append(rval)\n last_idx = idx_rval\n iterable_type = self.iterable_item_type(typs)\n else:\n self.fail(\"Contiguous iterable with same type expected\", context)\n else:\n self.fail(\"Invalid type '{}' for *expr (iterable expected)\".format(typs),\n context)\n else:\n rvalues.append(rval)\n iterable_start = None # type: Optional[int]\n iterable_end = None # type: Optional[int]\n for i, rval in enumerate(rvalues):\n if isinstance(rval, StarExpr):\n typs = get_proper_type(self.expr_checker.visit_star_expr(rval).type)\n if self.type_is_iterable(typs) and isinstance(typs, Instance):\n if iterable_start is None:\n iterable_start = i\n iterable_end = i\n if (iterable_start is not None\n and iterable_end is not None\n and iterable_type is not None):\n iterable_num = iterable_end - iterable_start + 1\n rvalue_needed = len(lvalues) - (len(rvalues) - iterable_num)\n if rvalue_needed > 0:\n rvalues = rvalues[0: iterable_start] + [TempNode(iterable_type)\n for i in range(rvalue_needed)] + rvalues[iterable_end + 1:]\n\n if self.check_rvalue_count_in_assignment(lvalues, len(rvalues), context):\n star_index = next((i for i, lv in enumerate(lvalues) if\n isinstance(lv, StarExpr)), len(lvalues))\n\n left_lvs = lvalues[:star_index]\n star_lv = cast(StarExpr,\n lvalues[star_index]) if star_index != len(lvalues) else None\n right_lvs = lvalues[star_index + 1:]\n\n left_rvs, star_rvs, right_rvs = self.split_around_star(\n rvalues, star_index, len(lvalues))\n\n lr_pairs = list(zip(left_lvs, left_rvs))\n if star_lv:\n rv_list = ListExpr(star_rvs)\n rv_list.set_line(rvalue.get_line())\n lr_pairs.append((star_lv.expr, rv_list))\n lr_pairs.extend(zip(right_lvs, right_rvs))\n\n for lv, rv in lr_pairs:\n self.check_assignment(lv, rv, infer_lvalue_type)\n else:\n self.check_multi_assignment(lvalues, rvalue, context, infer_lvalue_type)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_rvalue_count_in_assignment_TypeChecker.check_rvalue_count_in_assignment.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_rvalue_count_in_assignment_TypeChecker.check_rvalue_count_in_assignment.return.True", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2550, "end_line": 2561, "span_ids": ["TypeChecker.check_rvalue_count_in_assignment"], "tokens": 139}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def check_rvalue_count_in_assignment(self, lvalues: List[Lvalue], rvalue_count: int,\n context: Context) -> bool:\n if any(isinstance(lvalue, StarExpr) for lvalue in lvalues):\n if len(lvalues) - 1 > rvalue_count:\n self.msg.wrong_number_values_to_unpack(rvalue_count,\n len(lvalues) - 1, context)\n return False\n elif rvalue_count != len(lvalues):\n self.msg.wrong_number_values_to_unpack(rvalue_count,\n len(lvalues), context)\n return False\n return True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_multi_assignment_TypeChecker.check_multi_assignment.None_1.else_.self_check_multi_assignme": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_multi_assignment_TypeChecker.check_multi_assignment.None_1.else_.self_check_multi_assignme", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2563, "end_line": 2598, "span_ids": ["TypeChecker.check_multi_assignment"], "tokens": 397}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def check_multi_assignment(self, lvalues: List[Lvalue],\n rvalue: Expression,\n context: Context,\n infer_lvalue_type: bool = True,\n rv_type: Optional[Type] = None,\n undefined_rvalue: bool = False) -> None:\n \"\"\"Check the assignment of one rvalue to a number of lvalues.\"\"\"\n\n # Infer the type of an ordinary rvalue expression.\n # TODO: maybe elsewhere; redundant.\n rvalue_type = get_proper_type(rv_type or self.expr_checker.accept(rvalue))\n\n if isinstance(rvalue_type, UnionType):\n # If this is an Optional type in non-strict Optional code, unwrap it.\n relevant_items = rvalue_type.relevant_items()\n if len(relevant_items) == 1:\n rvalue_type = get_proper_type(relevant_items[0])\n\n if isinstance(rvalue_type, AnyType):\n for lv in lvalues:\n if isinstance(lv, StarExpr):\n lv = lv.expr\n temp_node = self.temp_node(AnyType(TypeOfAny.from_another_any,\n source_any=rvalue_type), context)\n self.check_assignment(lv, temp_node, infer_lvalue_type)\n elif isinstance(rvalue_type, TupleType):\n self.check_multi_assignment_from_tuple(lvalues, rvalue, rvalue_type,\n context, undefined_rvalue, infer_lvalue_type)\n elif isinstance(rvalue_type, UnionType):\n self.check_multi_assignment_from_union(lvalues, rvalue, rvalue_type, context,\n infer_lvalue_type)\n elif isinstance(rvalue_type, Instance) and rvalue_type.type.fullname == 'builtins.str':\n self.msg.unpacking_strings_disallowed(context)\n else:\n self.check_multi_assignment_from_iterable(lvalues, rvalue_type,\n context, infer_lvalue_type)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_multi_assignment_from_union_TypeChecker.check_multi_assignment_from_union.self.no_partial_types_3.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_multi_assignment_from_union_TypeChecker.check_multi_assignment_from_union.self.no_partial_types_3.False", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2600, "end_line": 2654, "span_ids": ["TypeChecker.check_multi_assignment_from_union"], "tokens": 611}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def check_multi_assignment_from_union(self, lvalues: List[Expression], rvalue: Expression,\n rvalue_type: UnionType, context: Context,\n infer_lvalue_type: bool) -> None:\n \"\"\"Check assignment to multiple lvalue targets when rvalue type is a Union[...].\n For example:\n\n t: Union[Tuple[int, int], Tuple[str, str]]\n x, y = t\n reveal_type(x) # Union[int, str]\n\n The idea in this case is to process the assignment for every item of the union.\n Important note: the types are collected in two places, 'union_types' contains\n inferred types for first assignments, 'assignments' contains the narrowed types\n for binder.\n \"\"\"\n self.no_partial_types = True\n transposed = tuple([] for _ in\n self.flatten_lvalues(lvalues)) # type: Tuple[List[Type], ...]\n # Notify binder that we want to defer bindings and instead collect types.\n with self.binder.accumulate_type_assignments() as assignments:\n for item in rvalue_type.items:\n # Type check the assignment separately for each union item and collect\n # the inferred lvalue types for each union item.\n self.check_multi_assignment(lvalues, rvalue, context,\n infer_lvalue_type=infer_lvalue_type,\n rv_type=item, undefined_rvalue=True)\n for t, lv in zip(transposed, self.flatten_lvalues(lvalues)):\n t.append(self.type_map.pop(lv, AnyType(TypeOfAny.special_form)))\n union_types = tuple(make_simplified_union(col) for col in transposed)\n for expr, items in assignments.items():\n # Bind a union of types collected in 'assignments' to every expression.\n if isinstance(expr, StarExpr):\n expr = expr.expr\n\n # TODO: See todo in binder.py, ConditionalTypeBinder.assign_type\n # It's unclear why the 'declared_type' param is sometimes 'None'\n clean_items = [] # type: List[Tuple[Type, Type]]\n for type, declared_type in items:\n assert declared_type is not None\n clean_items.append((type, declared_type))\n\n # TODO: fix signature of zip() in typeshed.\n types, declared_types = cast(Any, zip)(*clean_items)\n self.binder.assign_type(expr,\n make_simplified_union(list(types)),\n make_simplified_union(list(declared_types)),\n False)\n for union, lv in zip(union_types, self.flatten_lvalues(lvalues)):\n # Properly store the inferred types.\n _1, _2, inferred = self.check_lvalue(lv)\n if inferred:\n self.set_inferred_type(inferred, lv, union)\n else:\n self.store_type(lv, union)\n self.no_partial_types = False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.flatten_lvalues_TypeChecker.check_multi_assignment_from_tuple.if_self_check_rvalue_coun.for_lv_rv_type_in_zip_ri.self_check_assignment_lv_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.flatten_lvalues_TypeChecker.check_multi_assignment_from_tuple.if_self_check_rvalue_coun.for_lv_rv_type_in_zip_ri.self_check_assignment_lv_", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2656, "end_line": 2712, "span_ids": ["TypeChecker.flatten_lvalues", "TypeChecker.check_multi_assignment_from_tuple"], "tokens": 678}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def flatten_lvalues(self, lvalues: List[Expression]) -> List[Expression]:\n res = [] # type: List[Expression]\n for lv in lvalues:\n if isinstance(lv, (TupleExpr, ListExpr)):\n res.extend(self.flatten_lvalues(lv.items))\n if isinstance(lv, StarExpr):\n # Unwrap StarExpr, since it is unwrapped by other helpers.\n lv = lv.expr\n res.append(lv)\n return res\n\n def check_multi_assignment_from_tuple(self, lvalues: List[Lvalue], rvalue: Expression,\n rvalue_type: TupleType, context: Context,\n undefined_rvalue: bool,\n infer_lvalue_type: bool = True) -> None:\n if self.check_rvalue_count_in_assignment(lvalues, len(rvalue_type.items), context):\n star_index = next((i for i, lv in enumerate(lvalues)\n if isinstance(lv, StarExpr)), len(lvalues))\n\n left_lvs = lvalues[:star_index]\n star_lv = cast(StarExpr, lvalues[star_index]) if star_index != len(lvalues) else None\n right_lvs = lvalues[star_index + 1:]\n\n if not undefined_rvalue:\n # Infer rvalue again, now in the correct type context.\n lvalue_type = self.lvalue_type_for_inference(lvalues, rvalue_type)\n reinferred_rvalue_type = get_proper_type(self.expr_checker.accept(rvalue,\n lvalue_type))\n\n if isinstance(reinferred_rvalue_type, UnionType):\n # If this is an Optional type in non-strict Optional code, unwrap it.\n relevant_items = reinferred_rvalue_type.relevant_items()\n if len(relevant_items) == 1:\n reinferred_rvalue_type = get_proper_type(relevant_items[0])\n if isinstance(reinferred_rvalue_type, UnionType):\n self.check_multi_assignment_from_union(lvalues, rvalue,\n reinferred_rvalue_type, context,\n infer_lvalue_type)\n return\n if isinstance(reinferred_rvalue_type, AnyType) and self.current_node_deferred:\n # Doing more inference in deferred nodes can be hard, so give up for now.\n return\n assert isinstance(reinferred_rvalue_type, TupleType)\n rvalue_type = reinferred_rvalue_type\n\n left_rv_types, star_rv_types, right_rv_types = self.split_around_star(\n rvalue_type.items, star_index, len(lvalues))\n\n for lv, rv_type in zip(left_lvs, left_rv_types):\n self.check_assignment(lv, self.temp_node(rv_type, context), infer_lvalue_type)\n if star_lv:\n list_expr = ListExpr([self.temp_node(rv_type, context)\n for rv_type in star_rv_types])\n list_expr.set_line(context.get_line())\n self.check_assignment(star_lv.expr, list_expr, infer_lvalue_type)\n for lv, rv_type in zip(right_lvs, right_rv_types):\n self.check_assignment(lv, self.temp_node(rv_type, context), infer_lvalue_type)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.lvalue_type_for_inference_TypeChecker.lvalue_type_for_inference._type_List_Type_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.lvalue_type_for_inference_TypeChecker.lvalue_type_for_inference._type_List_Type_", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2714, "end_line": 2723, "span_ids": ["TypeChecker.lvalue_type_for_inference"], "tokens": 172}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def lvalue_type_for_inference(self, lvalues: List[Lvalue], rvalue_type: TupleType) -> Type:\n star_index = next((i for i, lv in enumerate(lvalues)\n if isinstance(lv, StarExpr)), len(lvalues))\n left_lvs = lvalues[:star_index]\n star_lv = cast(StarExpr, lvalues[star_index]) if star_index != len(lvalues) else None\n right_lvs = lvalues[star_index + 1:]\n left_rv_types, star_rv_types, right_rv_types = self.split_around_star(\n rvalue_type.items, star_index, len(lvalues))\n\n type_parameters = [] # type: List[Type]\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.lvalue_type_for_inference.append_types_for_inference_TypeChecker.lvalue_type_for_inference.append_types_for_inference.for_lv_rv_type_in_zip_lv.if_sub_lvalue_type_and_no.else_index_lvalue.type_parameters_append_rv": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.lvalue_type_for_inference.append_types_for_inference_TypeChecker.lvalue_type_for_inference.append_types_for_inference.for_lv_rv_type_in_zip_lv.if_sub_lvalue_type_and_no.else_index_lvalue.type_parameters_append_rv", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2725, "end_line": 2733, "span_ids": ["TypeChecker.lvalue_type_for_inference"], "tokens": 174}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def lvalue_type_for_inference(self, lvalues: List[Lvalue], rvalue_type: TupleType) -> Type:\n # ... other code\n\n def append_types_for_inference(lvs: List[Expression], rv_types: List[Type]) -> None:\n for lv, rv_type in zip(lvs, rv_types):\n sub_lvalue_type, index_expr, inferred = self.check_lvalue(lv)\n if sub_lvalue_type and not isinstance(sub_lvalue_type, PartialType):\n type_parameters.append(sub_lvalue_type)\n else: # index lvalue\n # TODO Figure out more precise type context, probably\n # based on the type signature of the _set method.\n type_parameters.append(rv_type)\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.lvalue_type_for_inference.append_types_for_inferenc_TypeChecker.lvalue_type_for_inference.return.TupleType_type_parameters": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.lvalue_type_for_inference.append_types_for_inferenc_TypeChecker.lvalue_type_for_inference.return.TupleType_type_parameters", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2735, "end_line": 2748, "span_ids": ["TypeChecker.lvalue_type_for_inference"], "tokens": 196}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def lvalue_type_for_inference(self, lvalues: List[Lvalue], rvalue_type: TupleType) -> Type:\n # ... other code\n\n append_types_for_inference(left_lvs, left_rv_types)\n\n if star_lv:\n sub_lvalue_type, index_expr, inferred = self.check_lvalue(star_lv.expr)\n if sub_lvalue_type and not isinstance(sub_lvalue_type, PartialType):\n type_parameters.extend([sub_lvalue_type] * len(star_rv_types))\n else: # index lvalue\n # TODO Figure out more precise type context, probably\n # based on the type signature of the _set method.\n type_parameters.extend(star_rv_types)\n\n append_types_for_inference(right_lvs, right_rv_types)\n\n return TupleType(type_parameters, self.named_type('builtins.tuple'))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.split_around_star_TypeChecker.split_around_star.return.left_star_right": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.split_around_star_TypeChecker.split_around_star.return.left_star_right", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2750, "end_line": 2763, "span_ids": ["TypeChecker.split_around_star"], "tokens": 211}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def split_around_star(self, items: List[T], star_index: int,\n length: int) -> Tuple[List[T], List[T], List[T]]:\n \"\"\"Splits a list of items in three to match another list of length 'length'\n that contains a starred expression at 'star_index' in the following way:\n\n star_index = 2, length = 5 (i.e., [a,b,*,c,d]), items = [1,2,3,4,5,6,7]\n returns in: ([1,2], [3,4,5], [6,7])\n \"\"\"\n nr_right_of_star = length - star_index - 1\n right_index = -nr_right_of_star if nr_right_of_star != 0 else len(items)\n left = items[:star_index]\n star = items[star_index:right_index]\n right = items[right_index:]\n return left, star, right", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.type_is_iterable_TypeChecker.check_multi_assignment_from_iterable.if_self_type_is_iterable_.else_.self_msg_type_not_iterabl": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.type_is_iterable_TypeChecker.check_multi_assignment_from_iterable.if_self_type_is_iterable_.else_.self_msg_type_not_iterabl", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2765, "end_line": 2787, "span_ids": ["TypeChecker.check_multi_assignment_from_iterable", "TypeChecker.type_is_iterable"], "tokens": 264}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def type_is_iterable(self, type: Type) -> bool:\n type = get_proper_type(type)\n if isinstance(type, CallableType) and type.is_type_obj():\n type = type.fallback\n return is_subtype(type, self.named_generic_type('typing.Iterable',\n [AnyType(TypeOfAny.special_form)]))\n\n def check_multi_assignment_from_iterable(self, lvalues: List[Lvalue], rvalue_type: Type,\n context: Context,\n infer_lvalue_type: bool = True) -> None:\n rvalue_type = get_proper_type(rvalue_type)\n if self.type_is_iterable(rvalue_type) and isinstance(rvalue_type, Instance):\n item_type = self.iterable_item_type(rvalue_type)\n for lv in lvalues:\n if isinstance(lv, StarExpr):\n items_type = self.named_generic_type('builtins.list', [item_type])\n self.check_assignment(lv.expr, self.temp_node(items_type, context),\n infer_lvalue_type)\n else:\n self.check_assignment(lv, self.temp_node(item_type, context),\n infer_lvalue_type)\n else:\n self.msg.type_not_iterable(rvalue_type, context)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_lvalue_TypeChecker.check_lvalue.return.lvalue_type_index_lvalue": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_lvalue_TypeChecker.check_lvalue.return.lvalue_type_index_lvalue", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2789, "end_line": 2825, "span_ids": ["TypeChecker.check_lvalue"], "tokens": 385}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def check_lvalue(self, lvalue: Lvalue) -> Tuple[Optional[Type],\n Optional[IndexExpr],\n Optional[Var]]:\n lvalue_type = None\n index_lvalue = None\n inferred = None\n\n if self.is_definition(lvalue):\n if isinstance(lvalue, NameExpr):\n inferred = cast(Var, lvalue.node)\n assert isinstance(inferred, Var)\n else:\n assert isinstance(lvalue, MemberExpr)\n self.expr_checker.accept(lvalue.expr)\n inferred = lvalue.def_var\n elif isinstance(lvalue, IndexExpr):\n index_lvalue = lvalue\n elif isinstance(lvalue, MemberExpr):\n lvalue_type = self.expr_checker.analyze_ordinary_member_access(lvalue,\n True)\n self.store_type(lvalue, lvalue_type)\n elif isinstance(lvalue, NameExpr):\n lvalue_type = self.expr_checker.analyze_ref_expr(lvalue, lvalue=True)\n self.store_type(lvalue, lvalue_type)\n elif isinstance(lvalue, TupleExpr) or isinstance(lvalue, ListExpr):\n types = [self.check_lvalue(sub_expr)[0] or\n # This type will be used as a context for further inference of rvalue,\n # we put Uninhabited if there is no information available from lvalue.\n UninhabitedType() for sub_expr in lvalue.items]\n lvalue_type = TupleType(types, self.named_type('builtins.tuple'))\n elif isinstance(lvalue, StarExpr):\n typ, _, _ = self.check_lvalue(lvalue.expr)\n lvalue_type = StarType(typ) if typ else None\n else:\n lvalue_type = self.expr_checker.accept(lvalue)\n\n return lvalue_type, index_lvalue, inferred", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.is_definition_TypeChecker.is_definition.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.is_definition_TypeChecker.is_definition.return.False", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2827, "end_line": 2841, "span_ids": ["TypeChecker.is_definition"], "tokens": 160}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def is_definition(self, s: Lvalue) -> bool:\n if isinstance(s, NameExpr):\n if s.is_inferred_def:\n return True\n # If the node type is not defined, this must the first assignment\n # that we process => this is a definition, even though the semantic\n # analyzer did not recognize this as such. This can arise in code\n # that uses isinstance checks, if type checking of the primary\n # definition is skipped due to an always False type check.\n node = s.node\n if isinstance(node, Var):\n return node.type is None\n elif isinstance(s, MemberExpr):\n return s.is_inferred_def\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.infer_variable_type_TypeChecker.infer_variable_type.if_isinstance_init_type_.else_.self_set_inferred_type_na": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.infer_variable_type_TypeChecker.infer_variable_type.if_isinstance_init_type_.else_.self_set_inferred_type_na", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2843, "end_line": 2869, "span_ids": ["TypeChecker.infer_variable_type"], "tokens": 370}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def infer_variable_type(self, name: Var, lvalue: Lvalue,\n init_type: Type, context: Context) -> None:\n \"\"\"Infer the type of initialized variables from initializer type.\"\"\"\n init_type = get_proper_type(init_type)\n if isinstance(init_type, DeletedType):\n self.msg.deleted_as_rvalue(init_type, context)\n elif not is_valid_inferred_type(init_type) and not self.no_partial_types:\n # We cannot use the type of the initialization expression for full type\n # inference (it's not specific enough), but we might be able to give\n # partial type which will be made more specific later. A partial type\n # gets generated in assignment like 'x = []' where item type is not known.\n if not self.infer_partial_type(name, lvalue, init_type):\n self.msg.need_annotation_for_var(name, context, self.options.python_version)\n self.set_inference_error_fallback_type(name, lvalue, init_type)\n elif (isinstance(lvalue, MemberExpr) and self.inferred_attribute_types is not None\n and lvalue.def_var and lvalue.def_var in self.inferred_attribute_types\n and not is_same_type(self.inferred_attribute_types[lvalue.def_var], init_type)):\n # Multiple, inconsistent types inferred for an attribute.\n self.msg.need_annotation_for_var(name, context, self.options.python_version)\n name.type = AnyType(TypeOfAny.from_error)\n else:\n # Infer type of the target.\n\n # Make the type more general (strip away function names etc.).\n init_type = strip_type(init_type)\n\n self.set_inferred_type(name, lvalue, init_type)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.infer_partial_type_TypeChecker.infer_partial_type.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.infer_partial_type_TypeChecker.infer_partial_type.return.True", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2871, "end_line": 2902, "span_ids": ["TypeChecker.infer_partial_type"], "tokens": 339}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def infer_partial_type(self, name: Var, lvalue: Lvalue, init_type: Type) -> bool:\n init_type = get_proper_type(init_type)\n if isinstance(init_type, NoneType):\n partial_type = PartialType(None, name)\n elif isinstance(init_type, Instance):\n fullname = init_type.type.fullname\n is_ref = isinstance(lvalue, RefExpr)\n if (is_ref and\n (fullname == 'builtins.list' or\n fullname == 'builtins.set' or\n fullname == 'builtins.dict' or\n fullname == 'collections.OrderedDict') and\n all(isinstance(t, (NoneType, UninhabitedType))\n for t in get_proper_types(init_type.args))):\n partial_type = PartialType(init_type.type, name)\n elif is_ref and fullname == 'collections.defaultdict':\n arg0 = get_proper_type(init_type.args[0])\n arg1 = get_proper_type(init_type.args[1])\n if (isinstance(arg0, (NoneType, UninhabitedType)) and\n self.is_valid_defaultdict_partial_value_type(arg1)):\n arg1 = erase_type(arg1)\n assert isinstance(arg1, Instance)\n partial_type = PartialType(init_type.type, name, arg1)\n else:\n return False\n else:\n return False\n else:\n return False\n self.set_inferred_type(name, lvalue, partial_type)\n self.partial_types[-1].map[name] = lvalue\n return True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.is_valid_defaultdict_partial_value_type_TypeChecker.is_valid_defaultdict_partial_value_type.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.is_valid_defaultdict_partial_value_type_TypeChecker.is_valid_defaultdict_partial_value_type.return.False", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2904, "end_line": 2926, "span_ids": ["TypeChecker.is_valid_defaultdict_partial_value_type"], "tokens": 234}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def is_valid_defaultdict_partial_value_type(self, t: ProperType) -> bool:\n \"\"\"Check if t can be used as the basis for a partial defaultddict value type.\n\n Examples:\n\n * t is 'int' --> True\n * t is 'list[]' --> True\n * t is 'dict[...]' --> False (only generic types with a single type\n argument supported)\n \"\"\"\n if not isinstance(t, Instance):\n return False\n if len(t.args) == 0:\n return True\n if len(t.args) == 1:\n arg = get_proper_type(t.args[0])\n # TODO: This is too permissive -- we only allow TypeVarType since\n # they leak in cases like defaultdict(list) due to a bug.\n # This can result in incorrect types being inferred, but only\n # in rare cases.\n if isinstance(arg, (TypeVarType, UninhabitedType, NoneType)):\n return True\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.set_inferred_type_TypeChecker.set_inferred_type.if_var_and_not_self_curre.self_store_type_lvalue_t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.set_inferred_type_TypeChecker.set_inferred_type.if_var_and_not_self_curre.self_store_type_lvalue_t", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2928, "end_line": 2941, "span_ids": ["TypeChecker.set_inferred_type"], "tokens": 170}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def set_inferred_type(self, var: Var, lvalue: Lvalue, type: Type) -> None:\n \"\"\"Store inferred variable type.\n\n Store the type to both the variable node and the expression node that\n refers to the variable (lvalue). If var is None, do nothing.\n \"\"\"\n if var and not self.current_node_deferred:\n var.type = type\n var.is_inferred = True\n if isinstance(lvalue, MemberExpr) and self.inferred_attribute_types is not None:\n # Store inferred attribute type so that we can check consistency afterwards.\n if lvalue.def_var is not None:\n self.inferred_attribute_types[lvalue.def_var] = type\n self.store_type(lvalue, type)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.set_inference_error_fallback_type_TypeChecker.inference_error_fallback_type.return.erase_typevars_fallback_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.set_inference_error_fallback_type_TypeChecker.inference_error_fallback_type.return.erase_typevars_fallback_", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2943, "end_line": 2961, "span_ids": ["TypeChecker.inference_error_fallback_type", "TypeChecker.set_inference_error_fallback_type"], "tokens": 221}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def set_inference_error_fallback_type(self, var: Var, lvalue: Lvalue, type: Type) -> None:\n \"\"\"Store best known type for variable if type inference failed.\n\n If a program ignores error on type inference error, the variable should get some\n inferred type so that if can used later on in the program. Example:\n\n x = [] # type: ignore\n x.append(1) # Should be ok!\n\n We implement this here by giving x a valid type (replacing inferred with Any).\n \"\"\"\n fallback = self.inference_error_fallback_type(type)\n self.set_inferred_type(var, lvalue, fallback)\n\n def inference_error_fallback_type(self, type: Type) -> Type:\n fallback = type.accept(SetNothingToAny())\n # Type variables may leak from inference, see https://github.com/python/mypy/issues/5738,\n # we therefore need to erase them.\n return erase_typevars(fallback)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_simple_assignment_TypeChecker.check_simple_assignment.if_self_is_stub_and_isins.else_.return.rvalue_type": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_simple_assignment_TypeChecker.check_simple_assignment.if_self_is_stub_and_isins.else_.return.rvalue_type", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2963, "end_line": 2986, "span_ids": ["TypeChecker.check_simple_assignment"], "tokens": 296}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def check_simple_assignment(self, lvalue_type: Optional[Type], rvalue: Expression,\n context: Context,\n msg: str = message_registry.INCOMPATIBLE_TYPES_IN_ASSIGNMENT,\n lvalue_name: str = 'variable',\n rvalue_name: str = 'expression', *,\n code: Optional[ErrorCode] = None) -> Type:\n if self.is_stub and isinstance(rvalue, EllipsisExpr):\n # '...' is always a valid initializer in a stub.\n return AnyType(TypeOfAny.special_form)\n else:\n lvalue_type = get_proper_type(lvalue_type)\n always_allow_any = lvalue_type is not None and not isinstance(lvalue_type, AnyType)\n rvalue_type = self.expr_checker.accept(rvalue, lvalue_type,\n always_allow_any=always_allow_any)\n rvalue_type = get_proper_type(rvalue_type)\n if isinstance(rvalue_type, DeletedType):\n self.msg.deleted_as_rvalue(rvalue_type, context)\n if isinstance(lvalue_type, DeletedType):\n self.msg.deleted_as_lvalue(lvalue_type, context)\n elif lvalue_type:\n self.check_subtype(rvalue_type, lvalue_type, context, msg,\n '{} has type'.format(rvalue_name),\n '{} has type'.format(lvalue_name), code=code)\n return rvalue_type", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_indexed_assignment_TypeChecker.check_indexed_assignment.self_expr_checker_check_m": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_indexed_assignment_TypeChecker.check_indexed_assignment.self_expr_checker_check_m", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3085, "end_line": 3115, "span_ids": ["TypeChecker.check_indexed_assignment"], "tokens": 362}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def check_indexed_assignment(self, lvalue: IndexExpr,\n rvalue: Expression, context: Context) -> None:\n \"\"\"Type check indexed assignment base[index] = rvalue.\n\n The lvalue argument is the base[index] expression.\n \"\"\"\n self.try_infer_partial_type_from_indexed_assignment(lvalue, rvalue)\n basetype = get_proper_type(self.expr_checker.accept(lvalue.base))\n if (isinstance(basetype, TypedDictType) or (isinstance(basetype, TypeVarType)\n and isinstance(get_proper_type(basetype.upper_bound), TypedDictType))):\n if isinstance(basetype, TypedDictType):\n typed_dict_type = basetype\n else:\n upper_bound_type = get_proper_type(basetype.upper_bound)\n assert isinstance(upper_bound_type, TypedDictType)\n typed_dict_type = upper_bound_type\n item_type = self.expr_checker.visit_typeddict_index_expr(typed_dict_type, lvalue.index)\n method_type = CallableType(\n arg_types=[self.named_type('builtins.str'), item_type],\n arg_kinds=[ARG_POS, ARG_POS],\n arg_names=[None, None],\n ret_type=NoneType(),\n fallback=self.named_type('builtins.function')\n ) # type: Type\n else:\n method_type = self.expr_checker.analyze_external_member_access(\n '__setitem__', basetype, context)\n lvalue.method_type = method_type\n self.expr_checker.check_method_call(\n '__setitem__', basetype, method_type, [lvalue.index, rvalue],\n [nodes.ARG_POS, nodes.ARG_POS], context)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.try_infer_partial_type_from_indexed_assignment_TypeChecker.visit_return_stmt.self_binder_unreachable_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.try_infer_partial_type_from_indexed_assignment_TypeChecker.visit_return_stmt.self_binder_unreachable_", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3117, "end_line": 3156, "span_ids": ["TypeChecker.visit_expression_stmt", "TypeChecker.visit_return_stmt", "TypeChecker.try_infer_partial_type_from_indexed_assignment"], "tokens": 409}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def try_infer_partial_type_from_indexed_assignment(\n self, lvalue: IndexExpr, rvalue: Expression) -> None:\n # TODO: Should we share some of this with try_infer_partial_type?\n var = None\n if isinstance(lvalue.base, RefExpr) and isinstance(lvalue.base.node, Var):\n var = lvalue.base.node\n elif isinstance(lvalue.base, MemberExpr):\n var = self.expr_checker.get_partial_self_var(lvalue.base)\n if isinstance(var, Var):\n if isinstance(var.type, PartialType):\n type_type = var.type.type\n if type_type is None:\n return # The partial type is None.\n partial_types = self.find_partial_types(var)\n if partial_types is None:\n return\n typename = type_type.fullname\n if (typename == 'builtins.dict'\n or typename == 'collections.OrderedDict'\n or typename == 'collections.defaultdict'):\n # TODO: Don't infer things twice.\n key_type = self.expr_checker.accept(lvalue.index)\n value_type = self.expr_checker.accept(rvalue)\n if (is_valid_inferred_type(key_type) and\n is_valid_inferred_type(value_type) and\n not self.current_node_deferred and\n not (typename == 'collections.defaultdict' and\n var.type.value_type is not None and\n not is_equivalent(value_type, var.type.value_type))):\n var.type = self.named_generic_type(typename,\n [key_type, value_type])\n del partial_types[var]\n\n def visit_expression_stmt(self, s: ExpressionStmt) -> None:\n self.expr_checker.accept(s.expr, allow_none_return=True, always_allow_any=True)\n\n def visit_return_stmt(self, s: ReturnStmt) -> None:\n \"\"\"Type check a return statement.\"\"\"\n self.check_return_stmt(s)\n self.binder.unreachable()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_return_stmt_TypeChecker.check_return_stmt.if_defn_is_not_None_.if_s_expr_.else_.if_self_in_checked_functi.self_fail_message_registr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_return_stmt_TypeChecker.check_return_stmt.if_defn_is_not_None_.if_s_expr_.else_.if_self_in_checked_functi.self_fail_message_registr", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3158, "end_line": 3237, "span_ids": ["TypeChecker.check_return_stmt"], "tokens": 741}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def check_return_stmt(self, s: ReturnStmt) -> None:\n defn = self.scope.top_function()\n if defn is not None:\n if defn.is_generator:\n return_type = self.get_generator_return_type(self.return_types[-1],\n defn.is_coroutine)\n elif defn.is_coroutine:\n return_type = self.get_coroutine_return_type(self.return_types[-1])\n else:\n return_type = self.return_types[-1]\n return_type = get_proper_type(return_type)\n\n if isinstance(return_type, UninhabitedType):\n self.fail(message_registry.NO_RETURN_EXPECTED, s)\n return\n\n if s.expr:\n is_lambda = isinstance(self.scope.top_function(), LambdaExpr)\n declared_none_return = isinstance(return_type, NoneType)\n declared_any_return = isinstance(return_type, AnyType)\n\n # This controls whether or not we allow a function call that\n # returns None as the expression of this return statement.\n # E.g. `return f()` for some `f` that returns None. We allow\n # this only if we're in a lambda or in a function that returns\n # `None` or `Any`.\n allow_none_func_call = is_lambda or declared_none_return or declared_any_return\n\n # Return with a value.\n typ = get_proper_type(self.expr_checker.accept(\n s.expr, return_type, allow_none_return=allow_none_func_call))\n\n if defn.is_async_generator:\n self.fail(message_registry.RETURN_IN_ASYNC_GENERATOR, s)\n return\n # Returning a value of type Any is always fine.\n if isinstance(typ, AnyType):\n # (Unless you asked to be warned in that case, and the\n # function is not declared to return Any)\n if (self.options.warn_return_any\n and not self.current_node_deferred\n and not is_proper_subtype(AnyType(TypeOfAny.special_form), return_type)\n and not (defn.name in BINARY_MAGIC_METHODS and\n is_literal_not_implemented(s.expr))\n and not (isinstance(return_type, Instance) and\n return_type.type.fullname == 'builtins.object')):\n self.msg.incorrectly_returning_any(return_type, s)\n return\n\n # Disallow return expressions in functions declared to return\n # None, subject to two exceptions below.\n if declared_none_return:\n # Lambdas are allowed to have None returns.\n # Functions returning a value of type None are allowed to have a None return.\n if is_lambda or isinstance(typ, NoneType):\n return\n self.fail(message_registry.NO_RETURN_VALUE_EXPECTED, s,\n code=codes.RETURN_VALUE)\n else:\n self.check_subtype(\n subtype_label='got',\n subtype=typ,\n supertype_label='expected',\n supertype=return_type,\n context=s.expr,\n outer_context=s,\n msg=message_registry.INCOMPATIBLE_RETURN_VALUE_TYPE,\n code=codes.RETURN_VALUE)\n else:\n # Empty returns are valid in Generators with Any typed returns, but not in\n # coroutines.\n if (defn.is_generator and not defn.is_coroutine and\n isinstance(return_type, AnyType)):\n return\n\n if isinstance(return_type, (NoneType, AnyType)):\n return\n\n if self.in_checked_function():\n self.fail(message_registry.RETURN_VALUE_EXPECTED, s, code=codes.RETURN_VALUE)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.visit_if_stmt_TypeChecker.visit_while_stmt.self_accept_loop_if_stmt_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.visit_if_stmt_TypeChecker.visit_while_stmt.self_accept_loop_if_stmt_", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3239, "end_line": 3269, "span_ids": ["TypeChecker.visit_if_stmt", "TypeChecker.visit_while_stmt"], "tokens": 305}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def visit_if_stmt(self, s: IfStmt) -> None:\n \"\"\"Type check an if statement.\"\"\"\n # This frame records the knowledge from previous if/elif clauses not being taken.\n # Fall-through to the original frame is handled explicitly in each block.\n with self.binder.frame_context(can_skip=False, fall_through=0):\n for e, b in zip(s.expr, s.body):\n t = get_proper_type(self.expr_checker.accept(e))\n\n if isinstance(t, DeletedType):\n self.msg.deleted_as_rvalue(t, s)\n\n if_map, else_map = self.find_isinstance_check(e)\n\n # XXX Issue a warning if condition is always False?\n with self.binder.frame_context(can_skip=True, fall_through=2):\n self.push_type_map(if_map)\n self.accept(b)\n\n # XXX Issue a warning if condition is always True?\n self.push_type_map(else_map)\n\n with self.binder.frame_context(can_skip=False, fall_through=2):\n if s.else_body:\n self.accept(s.else_body)\n\n def visit_while_stmt(self, s: WhileStmt) -> None:\n \"\"\"Type check a while statement.\"\"\"\n if_stmt = IfStmt([s.expr], [s.body], None)\n if_stmt.set_line(s.get_line(), s.get_column())\n self.accept_loop(if_stmt, s.else_body,\n exit_condition=s.expr)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.visit_operator_assignment_stmt_TypeChecker.visit_operator_assignment_stmt.self_check_final_s_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.visit_operator_assignment_stmt_TypeChecker.visit_operator_assignment_stmt.self_check_final_s_", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3271, "end_line": 3294, "span_ids": ["TypeChecker.visit_operator_assignment_stmt"], "tokens": 301}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def visit_operator_assignment_stmt(self,\n s: OperatorAssignmentStmt) -> None:\n \"\"\"Type check an operator assignment statement, e.g. x += 1.\"\"\"\n self.try_infer_partial_generic_type_from_assignment(s.lvalue, s.rvalue, s.op)\n if isinstance(s.lvalue, MemberExpr):\n # Special case, some additional errors may be given for\n # assignments to read-only or final attributes.\n lvalue_type = self.expr_checker.visit_member_expr(s.lvalue, True)\n else:\n lvalue_type = self.expr_checker.accept(s.lvalue)\n inplace, method = infer_operator_assignment_method(lvalue_type, s.op)\n if inplace:\n # There is __ifoo__, treat as x = x.__ifoo__(y)\n rvalue_type, method_type = self.expr_checker.check_op(\n method, lvalue_type, s.rvalue, s)\n if not is_subtype(rvalue_type, lvalue_type):\n self.msg.incompatible_operator_assignment(s.op, s)\n else:\n # There is no __ifoo__, treat as x = x y\n expr = OpExpr(s.op, s.lvalue, s.rvalue)\n expr.set_line(s)\n self.check_assignment(lvalue=s.lvalue, rvalue=expr,\n infer_lvalue_type=True, new_syntax=False)\n self.check_final(s)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.visit_assert_stmt_TypeChecker.visit_raise_stmt.self_binder_unreachable_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.visit_assert_stmt_TypeChecker.visit_raise_stmt.self_binder_unreachable_", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3296, "end_line": 3314, "span_ids": ["TypeChecker.visit_assert_stmt", "TypeChecker.visit_raise_stmt"], "tokens": 197}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def visit_assert_stmt(self, s: AssertStmt) -> None:\n self.expr_checker.accept(s.expr)\n\n if isinstance(s.expr, TupleExpr) and len(s.expr.items) > 0:\n self.fail(message_registry.MALFORMED_ASSERT, s)\n\n # If this is asserting some isinstance check, bind that type in the following code\n true_map, else_map = self.find_isinstance_check(s.expr)\n if s.msg is not None:\n self.expr_checker.analyze_cond_branch(else_map, s.msg, None)\n self.push_type_map(true_map)\n\n def visit_raise_stmt(self, s: RaiseStmt) -> None:\n \"\"\"Type check a raise statement.\"\"\"\n if s.expr:\n self.type_check_raise(s.expr, s)\n if s.from_expr:\n self.type_check_raise(s.from_expr, s, True)\n self.binder.unreachable()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.type_check_raise_TypeChecker.type_check_raise.self_check_subtype_typ_e": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.type_check_raise_TypeChecker.type_check_raise.self_check_subtype_typ_e", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3316, "end_line": 3334, "span_ids": ["TypeChecker.type_check_raise"], "tokens": 250}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def type_check_raise(self, e: Expression, s: RaiseStmt,\n optional: bool = False) -> None:\n typ = get_proper_type(self.expr_checker.accept(e))\n if isinstance(typ, DeletedType):\n self.msg.deleted_as_rvalue(typ, e)\n return\n exc_type = self.named_type('builtins.BaseException')\n expected_type = UnionType([exc_type, TypeType(exc_type)])\n if optional:\n expected_type.items.append(NoneType())\n if self.options.python_version[0] == 2:\n # allow `raise type, value, traceback`\n # https://docs.python.org/2/reference/simple_stmts.html#the-raise-statement\n # TODO: Also check tuple item types.\n any_type = AnyType(TypeOfAny.implementation_artifact)\n tuple_type = self.named_type('builtins.tuple')\n expected_type.items.append(TupleType([any_type, any_type], tuple_type))\n expected_type.items.append(TupleType([any_type, any_type, any_type], tuple_type))\n self.check_subtype(typ, expected_type, s, message_registry.INVALID_EXCEPTION)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.visit_try_stmt_TypeChecker.visit_try_stmt.if_s_finally_body_.if_not_self_binder_is_unr.self_accept_s_finally_bod": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.visit_try_stmt_TypeChecker.visit_try_stmt.if_s_finally_body_.if_not_self_binder_is_unr.self_accept_s_finally_bod", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3336, "end_line": 3367, "span_ids": ["TypeChecker.visit_try_stmt"], "tokens": 413}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def visit_try_stmt(self, s: TryStmt) -> None:\n \"\"\"Type check a try statement.\"\"\"\n # Our enclosing frame will get the result if the try/except falls through.\n # This one gets all possible states after the try block exited abnormally\n # (by exception, return, break, etc.)\n with self.binder.frame_context(can_skip=False, fall_through=0):\n # Not only might the body of the try statement exit\n # abnormally, but so might an exception handler or else\n # clause. The finally clause runs in *all* cases, so we\n # need an outer try frame to catch all intermediate states\n # in case an exception is raised during an except or else\n # clause. As an optimization, only create the outer try\n # frame when there actually is a finally clause.\n self.visit_try_without_finally(s, try_frame=bool(s.finally_body))\n if s.finally_body:\n # First we check finally_body is type safe on all abnormal exit paths\n self.accept(s.finally_body)\n\n if s.finally_body:\n # Then we try again for the more restricted set of options\n # that can fall through. (Why do we need to check the\n # finally clause twice? Depending on whether the finally\n # clause was reached by the try clause falling off the end\n # or exiting abnormally, after completing the finally clause\n # either flow will continue to after the entire try statement\n # or the exception/return/etc. will be processed and control\n # flow will escape. We need to check that the finally clause\n # type checks in both contexts, but only the resulting types\n # from the latter context affect the type state in the code\n # that follows the try statement.)\n if not self.binder.is_unreachable():\n self.accept(s.finally_body)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.visit_try_without_finally_TypeChecker.visit_try_without_finally.with_self_binder_frame_co.if_s_else_body_.self_accept_s_else_body_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.visit_try_without_finally_TypeChecker.visit_try_without_finally.with_self_binder_frame_co.if_s_else_body_.self_accept_s_else_body_", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3369, "end_line": 3422, "span_ids": ["TypeChecker.visit_try_without_finally"], "tokens": 594}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def visit_try_without_finally(self, s: TryStmt, try_frame: bool) -> None:\n \"\"\"Type check a try statement, ignoring the finally block.\n\n On entry, the top frame should receive all flow that exits the\n try block abnormally (i.e., such that the else block does not\n execute), and its parent should receive all flow that exits\n the try block normally.\n \"\"\"\n # This frame will run the else block if the try fell through.\n # In that case, control flow continues to the parent of what\n # was the top frame on entry.\n with self.binder.frame_context(can_skip=False, fall_through=2, try_frame=try_frame):\n # This frame receives exit via exception, and runs exception handlers\n with self.binder.frame_context(can_skip=False, fall_through=2):\n # Finally, the body of the try statement\n with self.binder.frame_context(can_skip=False, fall_through=2, try_frame=True):\n self.accept(s.body)\n for i in range(len(s.handlers)):\n with self.binder.frame_context(can_skip=True, fall_through=4):\n typ = s.types[i]\n if typ:\n t = self.check_except_handler_test(typ)\n var = s.vars[i]\n if var:\n # To support local variables, we make this a definition line,\n # causing assignment to set the variable's type.\n var.is_inferred_def = True\n # We also temporarily set current_node_deferred to False to\n # make sure the inference happens.\n # TODO: Use a better solution, e.g. a\n # separate Var for each except block.\n am_deferring = self.current_node_deferred\n self.current_node_deferred = False\n self.check_assignment(var, self.temp_node(t, var))\n self.current_node_deferred = am_deferring\n self.accept(s.handlers[i])\n var = s.vars[i]\n if var:\n # Exception variables are deleted in python 3 but not python 2.\n # But, since it's bad form in python 2 and the type checking\n # wouldn't work very well, we delete it anyway.\n\n # Unfortunately, this doesn't let us detect usage before the\n # try/except block.\n if self.options.python_version[0] >= 3:\n source = var.name\n else:\n source = ('(exception variable \"{}\", which we do not '\n 'accept outside except: blocks even in '\n 'python 2)'.format(var.name))\n cast(Var, var.node).type = DeletedType(source=source)\n self.binder.cleanse(var)\n if s.else_body:\n self.accept(s.else_body)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_except_handler_test_TypeChecker.check_except_handler_test.return.make_simplified_union_all": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_except_handler_test_TypeChecker.check_except_handler_test.return.make_simplified_union_all", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3424, "end_line": 3454, "span_ids": ["TypeChecker.check_except_handler_test"], "tokens": 254}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def check_except_handler_test(self, n: Expression) -> Type:\n \"\"\"Type check an exception handler test clause.\"\"\"\n typ = self.expr_checker.accept(n)\n\n all_types = [] # type: List[Type]\n test_types = self.get_types_from_except_handler(typ, n)\n\n for ttype in get_proper_types(test_types):\n if isinstance(ttype, AnyType):\n all_types.append(ttype)\n continue\n\n if isinstance(ttype, FunctionLike):\n item = ttype.items()[0]\n if not item.is_type_obj():\n self.fail(message_registry.INVALID_EXCEPTION_TYPE, n)\n return AnyType(TypeOfAny.from_error)\n exc_type = item.ret_type\n elif isinstance(ttype, TypeType):\n exc_type = ttype.item\n else:\n self.fail(message_registry.INVALID_EXCEPTION_TYPE, n)\n return AnyType(TypeOfAny.from_error)\n\n if not is_subtype(exc_type, self.named_type('builtins.BaseException')):\n self.fail(message_registry.INVALID_EXCEPTION_TYPE, n)\n return AnyType(TypeOfAny.from_error)\n\n all_types.append(exc_type)\n\n return make_simplified_union(all_types)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.get_types_from_except_handler_TypeChecker.get_types_from_except_handler.if_isinstance_typ_TupleT.else_.return._typ_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.get_types_from_except_handler_TypeChecker.get_types_from_except_handler.if_isinstance_typ_TupleT.else_.return._typ_", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3456, "end_line": 3471, "span_ids": ["TypeChecker.get_types_from_except_handler"], "tokens": 151}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def get_types_from_except_handler(self, typ: Type, n: Expression) -> List[Type]:\n \"\"\"Helper for check_except_handler_test to retrieve handler types.\"\"\"\n typ = get_proper_type(typ)\n if isinstance(typ, TupleType):\n return typ.items\n elif isinstance(typ, UnionType):\n return [\n union_typ\n for item in typ.relevant_items()\n for union_typ in self.get_types_from_except_handler(item, n)\n ]\n elif isinstance(typ, Instance) and is_named_instance(typ, 'builtins.tuple'):\n # variadic tuple\n return [typ.args[0]]\n else:\n return [typ]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.visit_for_stmt_TypeChecker.visit_for_stmt.self_accept_loop_s_body_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.visit_for_stmt_TypeChecker.visit_for_stmt.self_accept_loop_s_body_", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3473, "end_line": 3482, "span_ids": ["TypeChecker.visit_for_stmt"], "tokens": 131}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def visit_for_stmt(self, s: ForStmt) -> None:\n \"\"\"Type check a for statement.\"\"\"\n if s.is_async:\n iterator_type, item_type = self.analyze_async_iterable_item_type(s.expr)\n else:\n iterator_type, item_type = self.analyze_iterable_item_type(s.expr)\n s.inferred_item_type = item_type\n s.inferred_iterator_type = iterator_type\n self.analyze_index_variables(s.index, item_type, s.index_type is None, s)\n self.accept_loop(s.body, s.else_body)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.analyze_async_iterable_item_type_TypeChecker.analyze_async_iterable_item_type.return.iterator_item_type": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.analyze_async_iterable_item_type_TypeChecker.analyze_async_iterable_item_type.return.iterator_item_type", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3484, "end_line": 3492, "span_ids": ["TypeChecker.analyze_async_iterable_item_type"], "tokens": 143}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def analyze_async_iterable_item_type(self, expr: Expression) -> Tuple[Type, Type]:\n \"\"\"Analyse async iterable expression and return iterator and iterator item types.\"\"\"\n echk = self.expr_checker\n iterable = echk.accept(expr)\n iterator = echk.check_method_call_by_name('__aiter__', iterable, [], [], expr)[0]\n awaitable = echk.check_method_call_by_name('__anext__', iterator, [], [], expr)[0]\n item_type = echk.check_awaitable_expr(awaitable, expr,\n message_registry.INCOMPATIBLE_TYPES_IN_ASYNC_FOR)\n return iterator, item_type", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.analyze_iterable_item_type_TypeChecker.analyze_iterable_item_type.if_isinstance_iterable_T.else_.return.iterator_echk_check_meth": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.analyze_iterable_item_type_TypeChecker.analyze_iterable_item_type.if_isinstance_iterable_T.else_.return.iterator_echk_check_meth", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3494, "end_line": 3511, "span_ids": ["TypeChecker.analyze_iterable_item_type"], "tokens": 197}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def analyze_iterable_item_type(self, expr: Expression) -> Tuple[Type, Type]:\n \"\"\"Analyse iterable expression and return iterator and iterator item types.\"\"\"\n echk = self.expr_checker\n iterable = get_proper_type(echk.accept(expr))\n iterator = echk.check_method_call_by_name('__iter__', iterable, [], [], expr)[0]\n\n if isinstance(iterable, TupleType):\n joined = UninhabitedType() # type: Type\n for item in iterable.items:\n joined = join_types(joined, item)\n return iterator, joined\n else:\n # Non-tuple iterable.\n if self.options.python_version[0] >= 3:\n nextmethod = '__next__'\n else:\n nextmethod = 'next'\n return iterator, echk.check_method_call_by_name(nextmethod, iterator, [], [], expr)[0]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.analyze_container_item_type_TypeChecker.analyze_container_item_type.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.analyze_container_item_type_TypeChecker.analyze_container_item_type.return.None", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3513, "end_line": 3533, "span_ids": ["TypeChecker.analyze_container_item_type"], "tokens": 208}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def analyze_container_item_type(self, typ: Type) -> Optional[Type]:\n \"\"\"Check if a type is a nominal container of a union of such.\n\n Return the corresponding container item type.\n \"\"\"\n typ = get_proper_type(typ)\n if isinstance(typ, UnionType):\n types = [] # type: List[Type]\n for item in typ.items:\n c_type = self.analyze_container_item_type(item)\n if c_type:\n types.append(c_type)\n return UnionType.make_union(types)\n if isinstance(typ, Instance) and typ.type.has_base('typing.Container'):\n supertype = self.named_type('typing.Container').type\n super_instance = map_instance_to_supertype(typ, supertype)\n assert len(super_instance.args) == 1\n return super_instance.args[0]\n if isinstance(typ, TupleType):\n return self.analyze_container_item_type(tuple_fallback(typ))\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.analyze_index_variables_TypeChecker.visit_del_stmt.if_isinstance_s_expr_Ind.else_.for_elt_in_flatten_s_expr.if_isinstance_elt_NameEx.self_binder_assign_type_e": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.analyze_index_variables_TypeChecker.visit_del_stmt.if_isinstance_s_expr_Ind.else_.for_elt_in_flatten_s_expr.if_isinstance_elt_NameEx.self_binder_assign_type_e", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3535, "end_line": 3555, "span_ids": ["TypeChecker.visit_del_stmt", "TypeChecker.analyze_index_variables"], "tokens": 231}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def analyze_index_variables(self, index: Expression, item_type: Type,\n infer_lvalue_type: bool, context: Context) -> None:\n \"\"\"Type check or infer for loop or list comprehension index vars.\"\"\"\n self.check_assignment(index, self.temp_node(item_type, context), infer_lvalue_type)\n\n def visit_del_stmt(self, s: DelStmt) -> None:\n if isinstance(s.expr, IndexExpr):\n e = s.expr\n m = MemberExpr(e.base, '__delitem__')\n m.line = s.line\n m.column = s.column\n c = CallExpr(m, [e.index], [nodes.ARG_POS], [None])\n c.line = s.line\n c.column = s.column\n self.expr_checker.accept(c, allow_none_return=True)\n else:\n s.expr.accept(self.expr_checker)\n for elt in flatten(s.expr):\n if isinstance(elt, NameExpr):\n self.binder.assign_type(elt, DeletedType(source=elt.name),\n get_declaration(elt), False)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.visit_decorator_TypeChecker.visit_decorator.if_e_func_info_and_e_func.if_e_type_and_not_isinsta.self_fail_message_registr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.visit_decorator_TypeChecker.visit_decorator.if_e_func_info_and_e_func.if_e_type_and_not_isinsta.self_fail_message_registr", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3557, "end_line": 3596, "span_ids": ["TypeChecker.visit_decorator"], "tokens": 396}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def visit_decorator(self, e: Decorator) -> None:\n for d in e.decorators:\n if isinstance(d, RefExpr):\n if d.fullname == 'typing.no_type_check':\n e.var.type = AnyType(TypeOfAny.special_form)\n e.var.is_ready = True\n return\n\n if self.recurse_into_functions:\n with self.tscope.function_scope(e.func):\n self.check_func_item(e.func, name=e.func.name)\n\n # Process decorators from the inside out to determine decorated signature, which\n # may be different from the declared signature.\n sig = self.function_type(e.func) # type: Type\n for d in reversed(e.decorators):\n if refers_to_fullname(d, 'typing.overload'):\n self.fail(message_registry.MULTIPLE_OVERLOADS_REQUIRED, e)\n continue\n dec = self.expr_checker.accept(d)\n temp = self.temp_node(sig, context=e)\n fullname = None\n if isinstance(d, RefExpr):\n fullname = d.fullname\n self.check_for_untyped_decorator(e.func, dec, d)\n sig, t2 = self.expr_checker.check_call(dec, [temp],\n [nodes.ARG_POS], e,\n callable_name=fullname)\n self.check_untyped_after_decorator(sig, e.func)\n sig = set_callable_name(sig, e.func)\n e.var.type = sig\n e.var.is_ready = True\n if e.func.is_property:\n self.check_incompatible_property_override(e)\n if e.func.info and not e.func.is_dynamic():\n self.check_method_override(e)\n\n if e.func.info and e.func.name in ('__init__', '__new__'):\n if e.type and not isinstance(get_proper_type(e.type), (FunctionLike, AnyType)):\n self.fail(message_registry.BAD_CONSTRUCTOR_TYPE, e)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_for_untyped_decorator_TypeChecker.check_incompatible_property_override.if_not_e_var_is_settable_.for_base_in_e_func_info_m.if_isinstance_base_attr_.self_fail_message_registr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_for_untyped_decorator_TypeChecker.check_incompatible_property_override.if_not_e_var_is_settable_.for_base_in_e_func_info_m.if_isinstance_base_attr_.self_fail_message_registr", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3598, "end_line": 3618, "span_ids": ["TypeChecker.check_incompatible_property_override", "TypeChecker.check_for_untyped_decorator"], "tokens": 215}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def check_for_untyped_decorator(self,\n func: FuncDef,\n dec_type: Type,\n dec_expr: Expression) -> None:\n if (self.options.disallow_untyped_decorators and\n is_typed_callable(func.type) and\n is_untyped_decorator(dec_type)):\n self.msg.typed_function_untyped_decorator(func.name, dec_expr)\n\n def check_incompatible_property_override(self, e: Decorator) -> None:\n if not e.var.is_settable_property and e.func.info:\n name = e.func.name\n for base in e.func.info.mro[1:]:\n base_attr = base.names.get(name)\n if not base_attr:\n continue\n if (isinstance(base_attr.node, OverloadedFuncDef) and\n base_attr.node.is_property and\n cast(Decorator,\n base_attr.node.items[0]).var.is_settable_property):\n self.fail(message_registry.READ_ONLY_PROPERTY_OVERRIDES_READ_WRITE, e)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.visit_with_stmt_TypeChecker.visit_with_stmt.if_exceptions_maybe_suppr.else_.self_accept_s_body_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.visit_with_stmt_TypeChecker.visit_with_stmt.if_exceptions_maybe_suppr.else_.self_accept_s_body_", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3620, "end_line": 3654, "span_ids": ["TypeChecker.visit_with_stmt"], "tokens": 402}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def visit_with_stmt(self, s: WithStmt) -> None:\n exceptions_maybe_suppressed = False\n for expr, target in zip(s.expr, s.target):\n if s.is_async:\n exit_ret_type = self.check_async_with_item(expr, target, s.unanalyzed_type is None)\n else:\n exit_ret_type = self.check_with_item(expr, target, s.unanalyzed_type is None)\n\n # Based on the return type, determine if this context manager 'swallows'\n # exceptions or not. We determine this using a heuristic based on the\n # return type of the __exit__ method -- see the discussion in\n # https://github.com/python/mypy/issues/7214 and the section about context managers\n # in https://github.com/python/typeshed/blob/master/CONTRIBUTING.md#conventions\n # for more details.\n\n exit_ret_type = get_proper_type(exit_ret_type)\n if is_literal_type(exit_ret_type, \"builtins.bool\", False):\n continue\n\n if (is_literal_type(exit_ret_type, \"builtins.bool\", True)\n or (isinstance(exit_ret_type, Instance)\n and exit_ret_type.type.fullname == 'builtins.bool'\n and state.strict_optional)):\n # Note: if strict-optional is disabled, this bool instance\n # could actually be an Optional[bool].\n exceptions_maybe_suppressed = True\n\n if exceptions_maybe_suppressed:\n # Treat this 'with' block in the same way we'd treat a 'try: BODY; except: pass'\n # block. This means control flow can continue after the 'with' even if the 'with'\n # block immediately returns.\n with self.binder.frame_context(can_skip=True, try_frame=True):\n self.accept(s.body)\n else:\n self.accept(s.body)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_untyped_after_decorator_TypeChecker.check_async_with_item.return.echk_check_awaitable_expr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_untyped_after_decorator_TypeChecker.check_async_with_item.return.echk_check_awaitable_expr", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3656, "end_line": 3676, "span_ids": ["TypeChecker.check_untyped_after_decorator", "TypeChecker.check_async_with_item"], "tokens": 276}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def check_untyped_after_decorator(self, typ: Type, func: FuncDef) -> None:\n if not self.options.disallow_any_decorated or self.is_stub:\n return\n\n if mypy.checkexpr.has_any_type(typ):\n self.msg.untyped_decorated_function(typ, func)\n\n def check_async_with_item(self, expr: Expression, target: Optional[Expression],\n infer_lvalue_type: bool) -> Type:\n echk = self.expr_checker\n ctx = echk.accept(expr)\n obj = echk.check_method_call_by_name('__aenter__', ctx, [], [], expr)[0]\n obj = echk.check_awaitable_expr(\n obj, expr, message_registry.INCOMPATIBLE_TYPES_IN_ASYNC_WITH_AENTER)\n if target:\n self.check_assignment(target, self.temp_node(obj, expr), infer_lvalue_type)\n arg = self.temp_node(AnyType(TypeOfAny.special_form), expr)\n res, _ = echk.check_method_call_by_name(\n '__aexit__', ctx, [arg] * 3, [nodes.ARG_POS] * 3, expr)\n return echk.check_awaitable_expr(\n res, expr, message_registry.INCOMPATIBLE_TYPES_IN_ASYNC_WITH_AEXIT)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_with_item_TypeChecker.check_with_item.return.res": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_with_item_TypeChecker.check_with_item.return.res", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3678, "end_line": 3688, "span_ids": ["TypeChecker.check_with_item"], "tokens": 157}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def check_with_item(self, expr: Expression, target: Optional[Expression],\n infer_lvalue_type: bool) -> Type:\n echk = self.expr_checker\n ctx = echk.accept(expr)\n obj = echk.check_method_call_by_name('__enter__', ctx, [], [], expr)[0]\n if target:\n self.check_assignment(target, self.temp_node(obj, expr), infer_lvalue_type)\n arg = self.temp_node(AnyType(TypeOfAny.special_form), expr)\n res, _ = echk.check_method_call_by_name(\n '__exit__', ctx, [arg] * 3, [nodes.ARG_POS] * 3, expr)\n return res", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.visit_print_stmt_TypeChecker.visit_continue_stmt.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.visit_print_stmt_TypeChecker.visit_continue_stmt.return.None", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3690, "end_line": 3704, "span_ids": ["TypeChecker.visit_print_stmt", "TypeChecker.visit_continue_stmt", "TypeChecker.visit_break_stmt"], "tokens": 148}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def visit_print_stmt(self, s: PrintStmt) -> None:\n for arg in s.args:\n self.expr_checker.accept(arg)\n if s.target:\n target_type = get_proper_type(self.expr_checker.accept(s.target))\n if not isinstance(target_type, NoneType):\n # TODO: Also verify the type of 'write'.\n self.expr_checker.analyze_external_member_access('write', target_type, s.target)\n\n def visit_break_stmt(self, s: BreakStmt) -> None:\n self.binder.handle_break()\n\n def visit_continue_stmt(self, s: ContinueStmt) -> None:\n self.binder.handle_continue()\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.make_fake_typeinfo_TypeChecker.make_fake_typeinfo.return.cdef_info": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.make_fake_typeinfo_TypeChecker.make_fake_typeinfo.return.cdef_info", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3706, "end_line": 3725, "span_ids": ["TypeChecker.make_fake_typeinfo"], "tokens": 218}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def make_fake_typeinfo(self,\n curr_module_fullname: str,\n class_gen_name: str,\n class_short_name: str,\n bases: List[Instance],\n ) -> Tuple[ClassDef, TypeInfo]:\n # Build the fake ClassDef and TypeInfo together.\n # The ClassDef is full of lies and doesn't actually contain a body.\n # Use format_bare to generate a nice name for error messages.\n # We skip fully filling out a handful of TypeInfo fields because they\n # should be irrelevant for a generated type like this:\n # is_protocol, protocol_members, is_abstract\n cdef = ClassDef(class_short_name, Block([]))\n cdef.fullname = curr_module_fullname + '.' + class_gen_name\n info = TypeInfo(SymbolTable(), cdef, curr_module_fullname)\n cdef.info = info\n info.bases = bases\n calculate_mro(info)\n info.calculate_metaclass_type()\n return cdef, info", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.intersect_instances_TypeChecker.intersect_instances.return.Instance_info_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.intersect_instances_TypeChecker.intersect_instances.return.Instance_info_", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3727, "end_line": 3800, "span_ids": ["TypeChecker.intersect_instances"], "tokens": 633}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def intersect_instances(self,\n instances: Sequence[Instance],\n ctx: Context,\n ) -> Optional[Instance]:\n \"\"\"Try creating an ad-hoc intersection of the given instances.\n\n Note that this function does *not* try and create a full-fledged\n intersection type. Instead, it returns an instance of a new ad-hoc\n subclass of the given instances.\n\n This is mainly useful when you need a way of representing some\n theoretical subclass of the instances the user may be trying to use\n the generated intersection can serve as a placeholder.\n\n This function will create a fresh subclass every time you call it,\n even if you pass in the exact same arguments. So this means calling\n `self.intersect_intersection([inst_1, inst_2], ctx)` twice will result\n in instances of two distinct subclasses of inst_1 and inst_2.\n\n This is by design: we want each ad-hoc intersection to be unique since\n they're supposed represent some other unknown subclass.\n\n Returns None if creating the subclass is impossible (e.g. due to\n MRO errors or incompatible signatures). If we do successfully create\n a subclass, its TypeInfo will automatically be added to the global scope.\n \"\"\"\n curr_module = self.scope.stack[0]\n assert isinstance(curr_module, MypyFile)\n\n base_classes = []\n for inst in instances:\n expanded = [inst]\n if inst.type.is_intersection:\n expanded = inst.type.bases\n\n for expanded_inst in expanded:\n base_classes.append(expanded_inst)\n\n # We use the pretty_names_list for error messages but can't\n # use it for the real name that goes into the symbol table\n # because it can have dots in it.\n pretty_names_list = pretty_seq(format_type_distinctly(*base_classes, bare=True), \"and\")\n names_list = pretty_seq([x.type.name for x in base_classes], \"and\")\n short_name = ''.format(names_list)\n full_name = gen_unique_name(short_name, curr_module.names)\n\n old_msg = self.msg\n new_msg = self.msg.clean_copy()\n self.msg = new_msg\n try:\n cdef, info = self.make_fake_typeinfo(\n curr_module.fullname,\n full_name,\n short_name,\n base_classes,\n )\n self.check_multiple_inheritance(info)\n info.is_intersection = True\n except MroError:\n if self.should_report_unreachable_issues():\n old_msg.impossible_intersection(\n pretty_names_list, \"inconsistent method resolution order\", ctx)\n return None\n finally:\n self.msg = old_msg\n\n if new_msg.is_errors():\n if self.should_report_unreachable_issues():\n self.msg.impossible_intersection(\n pretty_names_list, \"incompatible method signatures\", ctx)\n return None\n\n curr_module.names[full_name] = SymbolTableNode(GDEF, info)\n return Instance(info, [])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.intersect_instance_callable_TypeChecker.intersect_instance_callable.return.Instance_info_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.intersect_instance_callable_TypeChecker.intersect_instance_callable.return.Instance_info_", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3802, "end_line": 3828, "span_ids": ["TypeChecker.intersect_instance_callable"], "tokens": 306}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def intersect_instance_callable(self, typ: Instance, callable_type: CallableType) -> Instance:\n \"\"\"Creates a fake type that represents the intersection of an Instance and a CallableType.\n\n It operates by creating a bare-minimum dummy TypeInfo that\n subclasses type and adds a __call__ method matching callable_type.\n \"\"\"\n\n # In order for this to work in incremental mode, the type we generate needs to\n # have a valid fullname and a corresponding entry in a symbol table. We generate\n # a unique name inside the symbol table of the current module.\n cur_module = cast(MypyFile, self.scope.stack[0])\n gen_name = gen_unique_name(\"\".format(typ.type.name),\n cur_module.names)\n\n # Synthesize a fake TypeInfo\n short_name = format_type_bare(typ)\n cdef, info = self.make_fake_typeinfo(cur_module.fullname, gen_name, short_name, [typ])\n\n # Build up a fake FuncDef so we can populate the symbol table.\n func_def = FuncDef('__call__', [], Block([]), callable_type)\n func_def._fullname = cdef.fullname + '.__call__'\n func_def.info = info\n info.names['__call__'] = SymbolTableNode(MDEF, func_def)\n\n cur_module.names[gen_name] = SymbolTableNode(GDEF, info)\n\n return Instance(info, [])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.make_fake_callable_TypeChecker.make_fake_callable.return.self_intersect_instance_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.make_fake_callable_TypeChecker.make_fake_callable.return.self_intersect_instance_c", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3830, "end_line": 3842, "span_ids": ["TypeChecker.make_fake_callable"], "tokens": 133}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def make_fake_callable(self, typ: Instance) -> Instance:\n \"\"\"Produce a new type that makes type Callable with a generic callable type.\"\"\"\n\n fallback = self.named_type('builtins.function')\n callable_type = CallableType([AnyType(TypeOfAny.explicit),\n AnyType(TypeOfAny.explicit)],\n [nodes.ARG_STAR, nodes.ARG_STAR2],\n [None, None],\n ret_type=AnyType(TypeOfAny.explicit),\n fallback=fallback,\n is_ellipsis_args=True)\n\n return self.intersect_instance_callable(typ, callable_type)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.partition_by_callable_TypeChecker.partition_by_callable.if_unsound_partition_.else_.return._typ_typ_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.partition_by_callable_TypeChecker.partition_by_callable.if_unsound_partition_.else_.return._typ_typ_", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3844, "end_line": 3924, "span_ids": ["TypeChecker.partition_by_callable"], "tokens": 718}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def partition_by_callable(self, typ: Type,\n unsound_partition: bool) -> Tuple[List[Type], List[Type]]:\n \"\"\"Partitions a type into callable subtypes and uncallable subtypes.\n\n Thus, given:\n `callables, uncallables = partition_by_callable(type)`\n\n If we assert `callable(type)` then `type` has type Union[*callables], and\n If we assert `not callable(type)` then `type` has type Union[*uncallables]\n\n If unsound_partition is set, assume that anything that is not\n clearly callable is in fact not callable. Otherwise we generate a\n new subtype that *is* callable.\n\n Guaranteed to not return [], [].\n \"\"\"\n typ = get_proper_type(typ)\n\n if isinstance(typ, FunctionLike) or isinstance(typ, TypeType):\n return [typ], []\n\n if isinstance(typ, AnyType):\n return [typ], [typ]\n\n if isinstance(typ, NoneType):\n return [], [typ]\n\n if isinstance(typ, UnionType):\n callables = []\n uncallables = []\n for subtype in typ.items:\n # Use unsound_partition when handling unions in order to\n # allow the expected type discrimination.\n subcallables, subuncallables = self.partition_by_callable(subtype,\n unsound_partition=True)\n callables.extend(subcallables)\n uncallables.extend(subuncallables)\n return callables, uncallables\n\n if isinstance(typ, TypeVarType):\n # We could do better probably?\n # Refine the the type variable's bound as our type in the case that\n # callable() is true. This unfortunately loses the information that\n # the type is a type variable in that branch.\n # This matches what is done for isinstance, but it may be possible to\n # do better.\n # If it is possible for the false branch to execute, return the original\n # type to avoid losing type information.\n callables, uncallables = self.partition_by_callable(erase_to_union_or_bound(typ),\n unsound_partition)\n uncallables = [typ] if len(uncallables) else []\n return callables, uncallables\n\n # A TupleType is callable if its fallback is, but needs special handling\n # when we dummy up a new type.\n ityp = typ\n if isinstance(typ, TupleType):\n ityp = tuple_fallback(typ)\n\n if isinstance(ityp, Instance):\n method = ityp.type.get_method('__call__')\n if method and method.type:\n callables, uncallables = self.partition_by_callable(method.type,\n unsound_partition=False)\n if len(callables) and not len(uncallables):\n # Only consider the type callable if its __call__ method is\n # definitely callable.\n return [typ], []\n\n if not unsound_partition:\n fake = self.make_fake_callable(ityp)\n if isinstance(typ, TupleType):\n fake.type.tuple_type = TupleType(typ.items, fake)\n return [fake.type.tuple_type], [typ]\n return [fake], [typ]\n\n if unsound_partition:\n return [], [typ]\n else:\n # We don't know how properly make the type callable.\n return [typ], [typ]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.conditional_callable_type_map_TypeChecker.conditional_callable_type_map.return.None_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.conditional_callable_type_map_TypeChecker.conditional_callable_type_map.return.None_", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3926, "end_line": 3954, "span_ids": ["TypeChecker.conditional_callable_type_map"], "tokens": 249}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def conditional_callable_type_map(self, expr: Expression,\n current_type: Optional[Type],\n ) -> Tuple[TypeMap, TypeMap]:\n \"\"\"Takes in an expression and the current type of the expression.\n\n Returns a 2-tuple: The first element is a map from the expression to\n the restricted type if it were callable. The second element is a\n map from the expression to the type it would hold if it weren't\n callable.\n \"\"\"\n if not current_type:\n return {}, {}\n\n if isinstance(get_proper_type(current_type), AnyType):\n return {}, {}\n\n callables, uncallables = self.partition_by_callable(current_type,\n unsound_partition=False)\n\n if len(callables) and len(uncallables):\n callable_map = {expr: UnionType.make_union(callables)} if len(callables) else None\n uncallable_map = {\n expr: UnionType.make_union(uncallables)} if len(uncallables) else None\n return callable_map, uncallable_map\n\n elif len(callables):\n return {}, None\n\n return None, {}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.find_isinstance_check_TypeChecker.find_isinstance_check.return.new_if_map_new_else_map": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.find_isinstance_check_TypeChecker.find_isinstance_check.return.new_if_map_new_else_map", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3957, "end_line": 3974, "span_ids": ["TypeChecker.find_isinstance_check"], "tokens": 204}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def find_isinstance_check(self, node: Expression\n ) -> Tuple[TypeMap, TypeMap]:\n \"\"\"Find any isinstance checks (within a chain of ands). Includes\n implicit and explicit checks for None and calls to callable.\n Also includes TypeGuard functions.\n\n Return value is a map of variables to their types if the condition\n is true and a map of variables to their types if the condition is false.\n\n If either of the values in the tuple is None, then that particular\n branch can never occur.\n\n Guaranteed to not return None, None. (But may return {}, {})\n \"\"\"\n if_map, else_map = self.find_isinstance_check_helper(node)\n new_if_map = self.propagate_up_typemap_info(self.type_map, if_map)\n new_else_map = self.propagate_up_typemap_info(self.type_map, else_map)\n return new_if_map, new_else_map", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.find_isinstance_check_helper.if_is_true_literal_node_.elif_isinstance_node_Com_TypeChecker.find_isinstance_check_helper.if_is_true_literal_node_.elif_isinstance_node_Ref.return.if_map_else_map": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.find_isinstance_check_helper.if_is_true_literal_node_.elif_isinstance_node_Com_TypeChecker.find_isinstance_check_helper.if_is_true_literal_node_.elif_isinstance_node_Ref.return.if_map_else_map", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4093, "end_line": 4252, "span_ids": ["TypeChecker.find_isinstance_check_helper"], "tokens": 1632}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def find_isinstance_check_helper(self, node: Expression) -> Tuple[TypeMap, TypeMap]:\n if is_true_literal(node):\n # ... other code\n elif isinstance(node, ComparisonExpr):\n # Step 1: Obtain the types of each operand and whether or not we can\n # narrow their types. (For example, we shouldn't try narrowing the\n # types of literal string or enum expressions).\n\n operands = [collapse_walrus(x) for x in node.operands]\n operand_types = []\n narrowable_operand_index_to_hash = {}\n for i, expr in enumerate(operands):\n if expr not in type_map:\n return {}, {}\n expr_type = type_map[expr]\n operand_types.append(expr_type)\n\n if (literal(expr) == LITERAL_TYPE\n and not is_literal_none(expr)\n and not is_literal_enum(type_map, expr)):\n h = literal_hash(expr)\n if h is not None:\n narrowable_operand_index_to_hash[i] = h\n\n # Step 2: Group operands chained by either the 'is' or '==' operands\n # together. For all other operands, we keep them in groups of size 2.\n # So the expression:\n #\n # x0 == x1 == x2 < x3 < x4 is x5 is x6 is not x7 is not x8\n #\n # ...is converted into the simplified operator list:\n #\n # [(\"==\", [0, 1, 2]), (\"<\", [2, 3]), (\"<\", [3, 4]),\n # (\"is\", [4, 5, 6]), (\"is not\", [6, 7]), (\"is not\", [7, 8])]\n #\n # We group identity/equality expressions so we can propagate information\n # we discover about one operand across the entire chain. We don't bother\n # handling 'is not' and '!=' chains in a special way: those are very rare\n # in practice.\n\n simplified_operator_list = group_comparison_operands(\n node.pairwise(),\n narrowable_operand_index_to_hash,\n {'==', 'is'},\n )\n\n # Step 3: Analyze each group and infer more precise type maps for each\n # assignable operand, if possible. We combine these type maps together\n # in the final step.\n\n partial_type_maps = []\n for operator, expr_indices in simplified_operator_list:\n if operator in {'is', 'is not', '==', '!='}:\n # is_valid_target:\n # Controls which types we're allowed to narrow exprs to. Note that\n # we cannot use 'is_literal_type_like' in both cases since doing\n # 'x = 10000 + 1; x is 10001' is not always True in all Python\n # implementations.\n #\n # coerce_only_in_literal_context:\n # If true, coerce types into literal types only if one or more of\n # the provided exprs contains an explicit Literal type. This could\n # technically be set to any arbitrary value, but it seems being liberal\n # with narrowing when using 'is' and conservative when using '==' seems\n # to break the least amount of real-world code.\n #\n # should_narrow_by_identity:\n # Set to 'false' only if the user defines custom __eq__ or __ne__ methods\n # that could cause identity-based narrowing to produce invalid results.\n if operator in {'is', 'is not'}:\n is_valid_target = is_singleton_type # type: Callable[[Type], bool]\n coerce_only_in_literal_context = False\n should_narrow_by_identity = True\n else:\n def is_exactly_literal_type(t: Type) -> bool:\n return isinstance(get_proper_type(t), LiteralType)\n\n def has_no_custom_eq_checks(t: Type) -> bool:\n return (not custom_special_method(t, '__eq__', check_all=False)\n and not custom_special_method(t, '__ne__', check_all=False))\n\n is_valid_target = is_exactly_literal_type\n coerce_only_in_literal_context = True\n\n expr_types = [operand_types[i] for i in expr_indices]\n should_narrow_by_identity = all(map(has_no_custom_eq_checks, expr_types))\n\n if_map = {} # type: TypeMap\n else_map = {} # type: TypeMap\n if should_narrow_by_identity:\n if_map, else_map = self.refine_identity_comparison_expression(\n operands,\n operand_types,\n expr_indices,\n narrowable_operand_index_to_hash.keys(),\n is_valid_target,\n coerce_only_in_literal_context,\n )\n\n # Strictly speaking, we should also skip this check if the objects in the expr\n # chain have custom __eq__ or __ne__ methods. But we (maybe optimistically)\n # assume nobody would actually create a custom objects that considers itself\n # equal to None.\n if if_map == {} and else_map == {}:\n if_map, else_map = self.refine_away_none_in_comparison(\n operands,\n operand_types,\n expr_indices,\n narrowable_operand_index_to_hash.keys(),\n )\n\n # If we haven't been able to narrow types yet, we might be dealing with a\n # explicit type(x) == some_type check\n if if_map == {} and else_map == {}:\n if_map, else_map = self.find_type_equals_check(node, expr_indices)\n elif operator in {'in', 'not in'}:\n assert len(expr_indices) == 2\n left_index, right_index = expr_indices\n if left_index not in narrowable_operand_index_to_hash:\n continue\n\n item_type = operand_types[left_index]\n collection_type = operand_types[right_index]\n\n # We only try and narrow away 'None' for now\n if not is_optional(item_type):\n continue\n\n collection_item_type = get_proper_type(builtin_item_type(collection_type))\n if collection_item_type is None or is_optional(collection_item_type):\n continue\n if (isinstance(collection_item_type, Instance)\n and collection_item_type.type.fullname == 'builtins.object'):\n continue\n if is_overlapping_erased_types(item_type, collection_item_type):\n if_map, else_map = {operands[left_index]: remove_optional(item_type)}, {}\n else:\n continue\n else:\n if_map = {}\n else_map = {}\n\n if operator in {'is not', '!=', 'not in'}:\n if_map, else_map = else_map, if_map\n\n partial_type_maps.append((if_map, else_map))\n\n return reduce_conditional_maps(partial_type_maps)\n elif isinstance(node, AssignmentExpr):\n return self.find_isinstance_check_helper(node.target)\n elif isinstance(node, RefExpr):\n # Restrict the type of the variable to True-ish/False-ish in the if and else branches\n # respectively\n vartype = type_map[node]\n if_type = true_only(vartype) # type: Type\n else_type = false_only(vartype) # type: Type\n ref = node # type: Expression\n if_map = ({ref: if_type} if not isinstance(get_proper_type(if_type), UninhabitedType)\n else None)\n else_map = ({ref: else_type} if not isinstance(get_proper_type(else_type),\n UninhabitedType)\n else None)\n return if_map, else_map\n # ... other code\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.find_isinstance_check_helper.if_is_true_literal_node_.elif_isinstance_node_OpE_TypeChecker.find_isinstance_check_helper.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.find_isinstance_check_helper.if_is_true_literal_node_.elif_isinstance_node_OpE_TypeChecker.find_isinstance_check_helper.return._", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4159, "end_line": 4180, "span_ids": ["TypeChecker.find_isinstance_check_helper"], "tokens": 328}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def find_isinstance_check_helper(self, node: Expression) -> Tuple[TypeMap, TypeMap]:\n if is_true_literal(node):\n # ... other code\n elif isinstance(node, OpExpr) and node.op == 'and':\n left_if_vars, left_else_vars = self.find_isinstance_check_helper(node.left)\n right_if_vars, right_else_vars = self.find_isinstance_check_helper(node.right)\n\n # (e1 and e2) is true if both e1 and e2 are true,\n # and false if at least one of e1 and e2 is false.\n return (and_conditional_maps(left_if_vars, right_if_vars),\n or_conditional_maps(left_else_vars, right_else_vars))\n elif isinstance(node, OpExpr) and node.op == 'or':\n left_if_vars, left_else_vars = self.find_isinstance_check_helper(node.left)\n right_if_vars, right_else_vars = self.find_isinstance_check_helper(node.right)\n\n # (e1 or e2) is true if at least one of e1 or e2 is true,\n # and false if both e1 and e2 are false.\n return (or_conditional_maps(left_if_vars, right_if_vars),\n and_conditional_maps(left_else_vars, right_else_vars))\n elif isinstance(node, UnaryExpr) and node.op == 'not':\n left, right = self.find_isinstance_check_helper(node.expr)\n return right, left\n\n # Not a supported isinstance check\n return {}, {}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.propagate_up_typemap_info_TypeChecker.propagate_up_typemap_info.return.output_map": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.propagate_up_typemap_info_TypeChecker.propagate_up_typemap_info.return.output_map", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4182, "end_line": 4225, "span_ids": ["TypeChecker.propagate_up_typemap_info"], "tokens": 531}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def propagate_up_typemap_info(self,\n existing_types: Mapping[Expression, Type],\n new_types: TypeMap) -> TypeMap:\n \"\"\"Attempts refining parent expressions of any MemberExpr or IndexExprs in new_types.\n\n Specifically, this function accepts two mappings of expression to original types:\n the original mapping (existing_types), and a new mapping (new_types) intended to\n update the original.\n\n This function iterates through new_types and attempts to use the information to try\n refining any parent types that happen to be unions.\n\n For example, suppose there are two types \"A = Tuple[int, int]\" and \"B = Tuple[str, str]\".\n Next, suppose that 'new_types' specifies the expression 'foo[0]' has a refined type\n of 'int' and that 'foo' was previously deduced to be of type Union[A, B].\n\n Then, this function will observe that since A[0] is an int and B[0] is not, the type of\n 'foo' can be further refined from Union[A, B] into just B.\n\n We perform this kind of \"parent narrowing\" for member lookup expressions and indexing\n expressions into tuples, namedtuples, and typeddicts. We repeat this narrowing\n recursively if the parent is also a \"lookup expression\". So for example, if we have\n the expression \"foo['bar'].baz[0]\", we'd potentially end up refining types for the\n expressions \"foo\", \"foo['bar']\", and \"foo['bar'].baz\".\n\n We return the newly refined map. This map is guaranteed to be a superset of 'new_types'.\n \"\"\"\n if new_types is None:\n return None\n output_map = {}\n for expr, expr_type in new_types.items():\n # The original inferred type should always be present in the output map, of course\n output_map[expr] = expr_type\n\n # Next, try using this information to refine the parent types, if applicable.\n new_mapping = self.refine_parent_types(existing_types, expr, expr_type)\n for parent_expr, proposed_parent_type in new_mapping.items():\n # We don't try inferring anything if we've already inferred something for\n # the parent expression.\n # TODO: Consider picking the narrower type instead of always discarding this?\n if parent_expr in new_types:\n continue\n output_map[parent_expr] = proposed_parent_type\n return output_map", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.refine_parent_types_TypeChecker.refine_parent_types._parent_lookup_chain_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.refine_parent_types_TypeChecker.refine_parent_types._parent_lookup_chain_", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4227, "end_line": 4243, "span_ids": ["TypeChecker.refine_parent_types"], "tokens": 209}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def refine_parent_types(self,\n existing_types: Mapping[Expression, Type],\n expr: Expression,\n expr_type: Type) -> Mapping[Expression, Type]:\n \"\"\"Checks if the given expr is a 'lookup operation' into a union and iteratively refines\n the parent types based on the 'expr_type'.\n\n For example, if 'expr' is an expression like 'a.b.c.d', we'll potentially return refined\n types for expressions 'a', 'a.b', and 'a.b.c'.\n\n For more details about what a 'lookup operation' is and how we use the expr_type to refine\n the parent types of lookup_expr, see the docstring in 'propagate_up_typemap_info'.\n \"\"\"\n output = {} # type: Dict[Expression, Type]\n\n # Note: parent_expr and parent_type are progressively refined as we crawl up the\n # parent lookup chain.\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.refine_parent_types.while_True__TypeChecker.refine_parent_types.return.output": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.refine_parent_types.while_True__TypeChecker.refine_parent_types.return.output", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4244, "end_line": 4348, "span_ids": ["TypeChecker.refine_parent_types"], "tokens": 912}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def refine_parent_types(self,\n existing_types: Mapping[Expression, Type],\n expr: Expression,\n expr_type: Type) -> Mapping[Expression, Type]:\n # ... other code\n while True:\n # First, check if this expression is one that's attempting to\n # \"lookup\" some key in the parent type. If so, save the parent type\n # and create function that will try replaying the same lookup\n # operation against arbitrary types.\n if isinstance(expr, MemberExpr):\n parent_expr = expr.expr\n parent_type = existing_types.get(parent_expr)\n member_name = expr.name\n\n def replay_lookup(new_parent_type: ProperType) -> Optional[Type]:\n msg_copy = self.msg.clean_copy()\n msg_copy.disable_count = 0\n member_type = analyze_member_access(\n name=member_name,\n typ=new_parent_type,\n context=parent_expr,\n is_lvalue=False,\n is_super=False,\n is_operator=False,\n msg=msg_copy,\n original_type=new_parent_type,\n chk=self,\n in_literal_context=False,\n )\n if msg_copy.is_errors():\n return None\n else:\n return member_type\n elif isinstance(expr, IndexExpr):\n parent_expr = expr.base\n parent_type = existing_types.get(parent_expr)\n\n index_type = existing_types.get(expr.index)\n if index_type is None:\n return output\n\n str_literals = try_getting_str_literals_from_type(index_type)\n if str_literals is not None:\n # Refactoring these two indexing replay functions is surprisingly\n # tricky -- see https://github.com/python/mypy/pull/7917, which\n # was blocked by https://github.com/mypyc/mypyc/issues/586\n def replay_lookup(new_parent_type: ProperType) -> Optional[Type]:\n if not isinstance(new_parent_type, TypedDictType):\n return None\n try:\n assert str_literals is not None\n member_types = [new_parent_type.items[key] for key in str_literals]\n except KeyError:\n return None\n return make_simplified_union(member_types)\n else:\n int_literals = try_getting_int_literals_from_type(index_type)\n if int_literals is not None:\n def replay_lookup(new_parent_type: ProperType) -> Optional[Type]:\n if not isinstance(new_parent_type, TupleType):\n return None\n try:\n assert int_literals is not None\n member_types = [new_parent_type.items[key] for key in int_literals]\n except IndexError:\n return None\n return make_simplified_union(member_types)\n else:\n return output\n else:\n return output\n\n # If we somehow didn't previously derive the parent type, abort completely\n # with what we have so far: something went wrong at an earlier stage.\n if parent_type is None:\n return output\n\n # We currently only try refining the parent type if it's a Union.\n # If not, there's no point in trying to refine any further parents\n # since we have no further information we can use to refine the lookup\n # chain, so we end early as an optimization.\n parent_type = get_proper_type(parent_type)\n if not isinstance(parent_type, UnionType):\n return output\n\n # Take each element in the parent union and replay the original lookup procedure\n # to figure out which parents are compatible.\n new_parent_types = []\n for item in parent_type.items:\n item = get_proper_type(item)\n member_type = replay_lookup(item)\n if member_type is None:\n # We were unable to obtain the member type. So, we give up on refining this\n # parent type entirely and abort.\n return output\n\n if is_overlapping_types(member_type, expr_type):\n new_parent_types.append(item)\n\n # If none of the parent types overlap (if we derived an empty union), something\n # went wrong. We should never hit this case, but deriving the uninhabited type or\n # reporting an error both seem unhelpful. So we abort.\n if not new_parent_types:\n return output\n\n expr = parent_expr\n expr_type = output[parent_expr] = make_simplified_union(new_parent_types)\n\n return output", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.refine_identity_comparison_expression_TypeChecker.refine_identity_comparison_expression.None_21": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.refine_identity_comparison_expression_TypeChecker.refine_identity_comparison_expression.None_21", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4350, "end_line": 4430, "span_ids": ["TypeChecker.refine_identity_comparison_expression"], "tokens": 790}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def refine_identity_comparison_expression(self,\n operands: List[Expression],\n operand_types: List[Type],\n chain_indices: List[int],\n narrowable_operand_indices: AbstractSet[int],\n is_valid_target: Callable[[ProperType], bool],\n coerce_only_in_literal_context: bool,\n ) -> Tuple[TypeMap, TypeMap]:\n \"\"\"Produce conditional type maps refining expressions by an identity/equality comparison.\n\n The 'operands' and 'operand_types' lists should be the full list of operands used\n in the overall comparison expression. The 'chain_indices' list is the list of indices\n actually used within this identity comparison chain.\n\n So if we have the expression:\n\n a <= b is c is d <= e\n\n ...then 'operands' and 'operand_types' would be lists of length 5 and 'chain_indices'\n would be the list [1, 2, 3].\n\n The 'narrowable_operand_indices' parameter is the set of all indices we are allowed\n to refine the types of: that is, all operands that will potentially be a part of\n the output TypeMaps.\n\n Although this function could theoretically try setting the types of the operands\n in the chains to the meet, doing that causes too many issues in real-world code.\n Instead, we use 'is_valid_target' to identify which of the given chain types\n we could plausibly use as the refined type for the expressions in the chain.\n\n Similarly, 'coerce_only_in_literal_context' controls whether we should try coercing\n expressions in the chain to a Literal type. Performing this coercion is sometimes\n too aggressive of a narrowing, depending on context.\n \"\"\"\n should_coerce = True\n if coerce_only_in_literal_context:\n should_coerce = any(is_literal_type_like(operand_types[i]) for i in chain_indices)\n\n target = None # type: Optional[Type]\n possible_target_indices = []\n for i in chain_indices:\n expr_type = operand_types[i]\n if should_coerce:\n expr_type = coerce_to_literal(expr_type)\n if not is_valid_target(get_proper_type(expr_type)):\n continue\n if target and not is_same_type(target, expr_type):\n # We have multiple disjoint target types. So the 'if' branch\n # must be unreachable.\n return None, {}\n target = expr_type\n possible_target_indices.append(i)\n\n # There's nothing we can currently infer if none of the operands are valid targets,\n # so we end early and infer nothing.\n if target is None:\n return {}, {}\n\n # If possible, use an unassignable expression as the target.\n # We skip refining the type of the target below, so ideally we'd\n # want to pick an expression we were going to skip anyways.\n singleton_index = -1\n for i in possible_target_indices:\n if i not in narrowable_operand_indices:\n singleton_index = i\n\n # But if none of the possible singletons are unassignable ones, we give up\n # and arbitrarily pick the last item, mostly because other parts of the\n # type narrowing logic bias towards picking the rightmost item and it'd be\n # nice to stay consistent.\n #\n # That said, it shouldn't matter which index we pick. For example, suppose we\n # have this if statement, where 'x' and 'y' both have singleton types:\n #\n # if x is y:\n # reveal_type(x)\n # reveal_type(y)\n # else:\n # reveal_type(x)\n # reveal_type(y)\n #\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.refine_identity_comparison_expression._At_this_point_x_and__TypeChecker.refine_identity_comparison_expression.return.reduce_conditional_maps_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.refine_identity_comparison_expression._At_this_point_x_and__TypeChecker.refine_identity_comparison_expression.return.reduce_conditional_maps_p", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4431, "end_line": 4475, "span_ids": ["TypeChecker.refine_identity_comparison_expression"], "tokens": 562}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def refine_identity_comparison_expression(self,\n operands: List[Expression],\n operand_types: List[Type],\n chain_indices: List[int],\n narrowable_operand_indices: AbstractSet[int],\n is_valid_target: Callable[[ProperType], bool],\n coerce_only_in_literal_context: bool,\n ) -> Tuple[TypeMap, TypeMap]:\n # At this point, 'x' and 'y' *must* have the same singleton type: we would have\n # ended early in the first for-loop in this function if they weren't.\n #\n # So, we should always get the same result in the 'if' case no matter which\n # index we pick. And while we do end up getting different results in the 'else'\n # case depending on the index (e.g. if we pick 'y', then its type stays the same\n # while 'x' is narrowed to ''), this distinction is also moot: mypy\n # currently will just mark the whole branch as unreachable if either operand is\n # narrowed to .\n if singleton_index == -1:\n singleton_index = possible_target_indices[-1]\n\n enum_name = None\n target = get_proper_type(target)\n if isinstance(target, LiteralType) and target.is_enum_literal():\n enum_name = target.fallback.type.fullname\n\n target_type = [TypeRange(target, is_upper_bound=False)]\n\n partial_type_maps = []\n for i in chain_indices:\n # If we try refining a type against itself, conditional_type_map\n # will end up assuming that the 'else' branch is unreachable. This is\n # typically not what we want: generally the user will intend for the\n # target type to be some fixed 'sentinel' value and will want to refine\n # the other exprs against this one instead.\n if i == singleton_index:\n continue\n\n # Naturally, we can't refine operands which are not permitted to be refined.\n if i not in narrowable_operand_indices:\n continue\n\n expr = operands[i]\n expr_type = coerce_to_literal(operand_types[i])\n\n if enum_name is not None:\n expr_type = try_expanding_enum_to_union(expr_type, enum_name)\n\n # We intentionally use 'conditional_type_map' directly here instead of\n # 'self.conditional_type_map_with_intersection': we only compute ad-hoc\n # intersections when working with pure instances.\n partial_type_maps.append(conditional_type_map(expr, expr_type, target_type))\n\n return reduce_conditional_maps(partial_type_maps)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.refine_away_none_in_comparison_TypeChecker.None_99": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.refine_away_none_in_comparison_TypeChecker.None_99", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4477, "end_line": 4510, "span_ids": ["TypeChecker.refine_away_none_in_comparison"], "tokens": 267}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def refine_away_none_in_comparison(self,\n operands: List[Expression],\n operand_types: List[Type],\n chain_indices: List[int],\n narrowable_operand_indices: AbstractSet[int],\n ) -> Tuple[TypeMap, TypeMap]:\n \"\"\"Produces conditional type maps refining away None in an identity/equality chain.\n\n For more details about what the different arguments mean, see the\n docstring of 'refine_identity_comparison_expression' up above.\n \"\"\"\n non_optional_types = []\n for i in chain_indices:\n typ = operand_types[i]\n if not is_optional(typ):\n non_optional_types.append(typ)\n\n # Make sure we have a mixture of optional and non-optional types.\n if len(non_optional_types) == 0 or len(non_optional_types) == len(chain_indices):\n return {}, {}\n\n if_map = {}\n for i in narrowable_operand_indices:\n expr_type = operand_types[i]\n if not is_optional(expr_type):\n continue\n if any(is_overlapping_erased_types(expr_type, t) for t in non_optional_types):\n if_map[operands[i]] = remove_optional(expr_type)\n\n return if_map, {}\n\n #\n # Helpers\n #", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_subtype_TypeChecker.check_subtype.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_subtype_TypeChecker.check_subtype.return.False", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4512, "end_line": 4565, "span_ids": ["TypeChecker.check_subtype"], "tokens": 616}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def check_subtype(self,\n subtype: Type,\n supertype: Type,\n context: Context,\n msg: str = message_registry.INCOMPATIBLE_TYPES,\n subtype_label: Optional[str] = None,\n supertype_label: Optional[str] = None,\n *,\n code: Optional[ErrorCode] = None,\n outer_context: Optional[Context] = None) -> bool:\n \"\"\"Generate an error if the subtype is not compatible with supertype.\"\"\"\n if is_subtype(subtype, supertype):\n return True\n\n subtype = get_proper_type(subtype)\n supertype = get_proper_type(supertype)\n if self.msg.try_report_long_tuple_assignment_error(subtype, supertype, context, msg,\n subtype_label, supertype_label, code=code):\n return False\n if self.should_suppress_optional_error([subtype]):\n return False\n extra_info = [] # type: List[str]\n note_msg = ''\n notes = [] # type: List[str]\n if subtype_label is not None or supertype_label is not None:\n subtype_str, supertype_str = format_type_distinctly(subtype, supertype)\n if subtype_label is not None:\n extra_info.append(subtype_label + ' ' + subtype_str)\n if supertype_label is not None:\n extra_info.append(supertype_label + ' ' + supertype_str)\n note_msg = make_inferred_type_note(outer_context or context, subtype,\n supertype, supertype_str)\n if isinstance(subtype, Instance) and isinstance(supertype, Instance):\n notes = append_invariance_notes([], subtype, supertype)\n if extra_info:\n msg += ' (' + ', '.join(extra_info) + ')'\n self.fail(msg, context, code=code)\n for note in notes:\n self.msg.note(note, context, code=code)\n if note_msg:\n self.note(note_msg, context, code=code)\n if (isinstance(supertype, Instance) and supertype.type.is_protocol and\n isinstance(subtype, (Instance, TupleType, TypedDictType))):\n self.msg.report_protocol_problems(subtype, supertype, context, code=code)\n if isinstance(supertype, CallableType) and isinstance(subtype, Instance):\n call = find_member('__call__', subtype, subtype, is_operator=True)\n if call:\n self.msg.note_call(subtype, call, context, code=code)\n if isinstance(subtype, (CallableType, Overloaded)) and isinstance(supertype, Instance):\n if supertype.type.is_protocol and supertype.type.protocol_members == ['__call__']:\n call = find_member('__call__', supertype, subtype, is_operator=True)\n assert call is not None\n self.msg.note_call(supertype, call, context, code=code)\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.contains_none_TypeChecker.should_suppress_optional_error.return.self_suppress_none_errors": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.contains_none_TypeChecker.should_suppress_optional_error.return.self_suppress_none_errors", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4567, "end_line": 4578, "span_ids": ["TypeChecker.should_suppress_optional_error", "TypeChecker.contains_none"], "tokens": 163}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def contains_none(self, t: Type) -> bool:\n t = get_proper_type(t)\n return (\n isinstance(t, NoneType) or\n (isinstance(t, UnionType) and any(self.contains_none(ut) for ut in t.items)) or\n (isinstance(t, TupleType) and any(self.contains_none(tt) for tt in t.items)) or\n (isinstance(t, Instance) and bool(t.args)\n and any(self.contains_none(it) for it in t.args))\n )\n\n def should_suppress_optional_error(self, related_types: List[Type]) -> bool:\n return self.suppress_none_errors and any(self.contains_none(t) for t in related_types)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.named_type_TypeChecker.named_type.return.Instance_node_any_type_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.named_type_TypeChecker.named_type.return.Instance_node_any_type_", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4580, "end_line": 4593, "span_ids": ["TypeChecker.named_type"], "tokens": 155}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def named_type(self, name: str) -> Instance:\n \"\"\"Return an instance type with given name and implicit Any type args.\n\n For example, named_type('builtins.object') produces the 'object' type.\n \"\"\"\n # Assume that the name refers to a type.\n sym = self.lookup_qualified(name)\n node = sym.node\n if isinstance(node, TypeAlias):\n assert isinstance(node.target, Instance) # type: ignore\n node = node.target.type\n assert isinstance(node, TypeInfo)\n any_type = AnyType(TypeOfAny.from_omitted_generics)\n return Instance(node, [any_type] * len(node.defn.type_vars))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.named_generic_type_TypeChecker.named_generic_type.return.Instance_info_args_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.named_generic_type_TypeChecker.named_generic_type.return.Instance_info_args_", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4595, "end_line": 4604, "span_ids": ["TypeChecker.named_generic_type"], "tokens": 119}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def named_generic_type(self, name: str, args: List[Type]) -> Instance:\n \"\"\"Return an instance with the given name and type arguments.\n\n Assume that the number of arguments is correct. Assume that\n the name refers to a compatible generic type.\n \"\"\"\n info = self.lookup_typeinfo(name)\n args = [remove_instance_last_known_values(arg) for arg in args]\n # TODO: assert len(args) == len(info.defn.type_vars)\n return Instance(info, args)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.lookup_typeinfo_TypeChecker.lookup.if_name_in_self_globals_.else_.raise_KeyError_Failed_lo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.lookup_typeinfo_TypeChecker.lookup.if_name_in_self_globals_.else_.raise_KeyError_Failed_lo", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4606, "end_line": 4649, "span_ids": ["TypeChecker.str_type", "TypeChecker.lookup_typeinfo", "TypeChecker.type_type", "TypeChecker.store_type", "TypeChecker.lookup", "TypeChecker.in_checked_function"], "tokens": 349}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def lookup_typeinfo(self, fullname: str) -> TypeInfo:\n # Assume that the name refers to a class.\n sym = self.lookup_qualified(fullname)\n node = sym.node\n assert isinstance(node, TypeInfo)\n return node\n\n def type_type(self) -> Instance:\n \"\"\"Return instance type 'type'.\"\"\"\n return self.named_type('builtins.type')\n\n def str_type(self) -> Instance:\n \"\"\"Return instance type 'str'.\"\"\"\n return self.named_type('builtins.str')\n\n def store_type(self, node: Expression, typ: Type) -> None:\n \"\"\"Store the type of a node in the type map.\"\"\"\n self.type_map[node] = typ\n\n def in_checked_function(self) -> bool:\n \"\"\"Should we type-check the current function?\n\n - Yes if --check-untyped-defs is set.\n - Yes outside functions.\n - Yes in annotated functions.\n - No otherwise.\n \"\"\"\n return (self.options.check_untyped_defs\n or not self.dynamic_funcs\n or not self.dynamic_funcs[-1])\n\n def lookup(self, name: str, kind: int) -> SymbolTableNode:\n \"\"\"Look up a definition from the symbol table with the given name.\n TODO remove kind argument\n \"\"\"\n if name in self.globals:\n return self.globals[name]\n else:\n b = self.globals.get('__builtins__', None)\n if b:\n table = cast(MypyFile, b.node).names\n if name in table:\n return table[name]\n raise KeyError('Failed lookup: {}'.format(name))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.lookup_qualified_TypeChecker.lookup_qualified.if_not_in_name_.else_.if_last_in_n_names_.else_.raise_KeyError_msg_format": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.lookup_qualified_TypeChecker.lookup_qualified.if_not_in_name_.else_.if_last_in_n_names_.else_.raise_KeyError_msg_format", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4651, "end_line": 4676, "span_ids": ["TypeChecker.lookup_qualified"], "tokens": 287}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def lookup_qualified(self, name: str) -> SymbolTableNode:\n if '.' not in name:\n return self.lookup(name, GDEF) # FIX kind\n else:\n parts = name.split('.')\n n = self.modules[parts[0]]\n for i in range(1, len(parts) - 1):\n sym = n.names.get(parts[i])\n assert sym is not None, \"Internal error: attempted lookup of unknown name\"\n n = cast(MypyFile, sym.node)\n last = parts[-1]\n if last in n.names:\n return n.names[last]\n elif len(parts) == 2 and parts[0] == 'builtins':\n fullname = 'builtins.' + last\n if fullname in SUGGESTED_TEST_FIXTURES:\n suggestion = \", e.g. add '[builtins fixtures/{}]' to your test\".format(\n SUGGESTED_TEST_FIXTURES[fullname])\n else:\n suggestion = ''\n raise KeyError(\"Could not find builtin symbol '{}' (If you are running a \"\n \"test case, use a fixture that \"\n \"defines this symbol{})\".format(last, suggestion))\n else:\n msg = \"Failed qualified lookup: '{}' (fullname = '{}').\"\n raise KeyError(msg.format(last, name))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.enter_partial_types_TypeChecker.enter_partial_types.if_not_self_current_node_.for_var_context_in_parti.if_allow_none.else_.if_var_type_.var.type.self_fixup_partial_type_v": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.enter_partial_types_TypeChecker.enter_partial_types.if_not_self_current_node_.for_var_context_in_parti.if_allow_none.else_.if_var_type_.var.type.self_fixup_partial_type_v", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4678, "end_line": 4728, "span_ids": ["TypeChecker.enter_partial_types"], "tokens": 578}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n @contextmanager\n def enter_partial_types(self, *, is_function: bool = False,\n is_class: bool = False) -> Iterator[None]:\n \"\"\"Enter a new scope for collecting partial types.\n\n Also report errors for (some) variables which still have partial\n types, i.e. we couldn't infer a complete type.\n \"\"\"\n is_local = (self.partial_types and self.partial_types[-1].is_local) or is_function\n self.partial_types.append(PartialTypeScope({}, is_function, is_local))\n yield\n\n # Don't complain about not being able to infer partials if it is\n # at the toplevel (with allow_untyped_globals) or if it is in an\n # untyped function being checked with check_untyped_defs.\n permissive = (self.options.allow_untyped_globals and not is_local) or (\n self.options.check_untyped_defs\n and self.dynamic_funcs\n and self.dynamic_funcs[-1]\n )\n\n partial_types, _, _ = self.partial_types.pop()\n if not self.current_node_deferred:\n for var, context in partial_types.items():\n # If we require local partial types, there are a few exceptions where\n # we fall back to inferring just \"None\" as the type from a None initializer:\n #\n # 1. If all happens within a single function this is acceptable, since only\n # the topmost function is a separate target in fine-grained incremental mode.\n # We primarily want to avoid \"splitting\" partial types across targets.\n #\n # 2. A None initializer in the class body if the attribute is defined in a base\n # class is fine, since the attribute is already defined and it's currently okay\n # to vary the type of an attribute covariantly. The None type will still be\n # checked for compatibility with base classes elsewhere. Without this exception\n # mypy could require an annotation for an attribute that already has been\n # declared in a base class, which would be bad.\n allow_none = (not self.options.local_partial_types\n or is_function\n or (is_class and self.is_defined_in_base_class(var)))\n if (allow_none\n and isinstance(var.type, PartialType)\n and var.type.type is None\n and not permissive):\n var.type = NoneType()\n else:\n if var not in self.partial_reported and not permissive:\n self.msg.need_annotation_for_var(var, context, self.options.python_version)\n self.partial_reported.add(var)\n if var.type:\n var.type = self.fixup_partial_type(var.type)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.handle_partial_var_type_TypeChecker.handle_partial_var_type.if_typ_type_is_None_and_i.else_.return.self_fixup_partial_type_t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.handle_partial_var_type_TypeChecker.handle_partial_var_type.if_typ_type_is_None_and_i.else_.return.self_fixup_partial_type_t", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4730, "end_line": 4754, "span_ids": ["TypeChecker.handle_partial_var_type"], "tokens": 259}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def handle_partial_var_type(\n self, typ: PartialType, is_lvalue: bool, node: Var, context: Context) -> Type:\n \"\"\"Handle a reference to a partial type through a var.\n\n (Used by checkexpr and checkmember.)\n \"\"\"\n in_scope, is_local, partial_types = self.find_partial_types_in_all_scopes(node)\n if typ.type is None and in_scope:\n # 'None' partial type. It has a well-defined type. In an lvalue context\n # we want to preserve the knowledge of it being a partial type.\n if not is_lvalue:\n return NoneType()\n else:\n return typ\n else:\n if partial_types is not None and not self.current_node_deferred:\n if in_scope:\n context = partial_types[node]\n if is_local or not self.options.allow_untyped_globals:\n self.msg.need_annotation_for_var(node, context,\n self.options.python_version)\n else:\n # Defer the node -- we might get a better type in the outer scope\n self.handle_cannot_determine_type(node.name, context)\n return self.fixup_partial_type(typ)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.fixup_partial_type_TypeChecker.fixup_partial_type.if_typ_type_is_None_.else_.return.Instance_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.fixup_partial_type_TypeChecker.fixup_partial_type.if_typ_type_is_None_.else_.return.Instance_", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4756, "end_line": 4769, "span_ids": ["TypeChecker.fixup_partial_type"], "tokens": 141}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def fixup_partial_type(self, typ: Type) -> Type:\n \"\"\"Convert a partial type that we couldn't resolve into something concrete.\n\n This means, for None we make it Optional[Any], and for anything else we\n fill in all of the type arguments with Any.\n \"\"\"\n if not isinstance(typ, PartialType):\n return typ\n if typ.type is None:\n return UnionType.make_union([AnyType(TypeOfAny.unannotated), NoneType()])\n else:\n return Instance(\n typ.type,\n [AnyType(TypeOfAny.unannotated)] * len(typ.type.type_vars))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.is_defined_in_base_class_TypeChecker.find_partial_types.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.is_defined_in_base_class_TypeChecker.find_partial_types.return.None", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4771, "end_line": 4790, "span_ids": ["TypeChecker.find_partial_types", "TypeChecker.is_defined_in_base_class"], "tokens": 178}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def is_defined_in_base_class(self, var: Var) -> bool:\n if var.info:\n for base in var.info.mro[1:]:\n if base.get(var.name) is not None:\n return True\n if var.info.fallback_to_any:\n return True\n return False\n\n def find_partial_types(self, var: Var) -> Optional[Dict[Var, Context]]:\n \"\"\"Look for an active partial type scope containing variable.\n\n A scope is active if assignments in the current context can refine a partial\n type originally defined in the scope. This is affected by the local_partial_types\n configuration option.\n \"\"\"\n in_scope, _, partial_types = self.find_partial_types_in_all_scopes(var)\n if in_scope:\n return partial_types\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.find_partial_types_in_all_scopes_TypeChecker.find_partial_types_in_all_scopes.return.False_False_None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.find_partial_types_in_all_scopes_TypeChecker.find_partial_types_in_all_scopes.return.False_False_None", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4792, "end_line": 4813, "span_ids": ["TypeChecker.find_partial_types_in_all_scopes"], "tokens": 256}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def find_partial_types_in_all_scopes(\n self, var: Var) -> Tuple[bool, bool, Optional[Dict[Var, Context]]]:\n \"\"\"Look for partial type scope containing variable.\n\n Return tuple (is the scope active, is the scope a local scope, scope).\n \"\"\"\n for scope in reversed(self.partial_types):\n if var in scope.map:\n # All scopes within the outermost function are active. Scopes out of\n # the outermost function are inactive to allow local reasoning (important\n # for fine-grained incremental mode).\n disallow_other_scopes = self.options.local_partial_types\n\n if isinstance(var.type, PartialType) and var.type.type is not None and var.info:\n # This is an ugly hack to make partial generic self attributes behave\n # as if --local-partial-types is always on (because it used to be like this).\n disallow_other_scopes = True\n\n scope_active = (not disallow_other_scopes\n or scope.is_local == self.partial_types[-1].is_local)\n return scope_active, scope.is_local, scope.map\n return False, False, None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.temp_node_TypeChecker.note.self_msg_note_msg_contex": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.temp_node_TypeChecker.note.self_msg_note_msg_contex", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4815, "end_line": 4830, "span_ids": ["TypeChecker.note", "TypeChecker.fail", "TypeChecker.temp_node"], "tokens": 164}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def temp_node(self, t: Type, context: Optional[Context] = None) -> TempNode:\n \"\"\"Create a temporary node with the given, fixed type.\"\"\"\n return TempNode(t, context=context)\n\n def fail(self, msg: str, context: Context, *, code: Optional[ErrorCode] = None) -> None:\n \"\"\"Produce an error message.\"\"\"\n self.msg.fail(msg, context, code=code)\n\n def note(self,\n msg: str,\n context: Context,\n offset: int = 0,\n *,\n code: Optional[ErrorCode] = None) -> None:\n \"\"\"Produce a note.\"\"\"\n self.msg.note(msg, context, offset=offset, code=code)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.iterable_item_type_TypeChecker.push_type_map.if_type_map_is_None_.else_.for_expr_type_in_type_ma.self_binder_put_expr_typ": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.iterable_item_type_TypeChecker.push_type_map.if_type_map_is_None_.else_.for_expr_type_in_type_ma.self_binder_put_expr_typ", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4832, "end_line": 4859, "span_ids": ["TypeChecker.push_type_map", "TypeChecker.iterable_item_type", "TypeChecker.function_type"], "tokens": 281}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def iterable_item_type(self, instance: Instance) -> Type:\n iterable = map_instance_to_supertype(\n instance,\n self.lookup_typeinfo('typing.Iterable'))\n item_type = iterable.args[0]\n if not isinstance(get_proper_type(item_type), AnyType):\n # This relies on 'map_instance_to_supertype' returning 'Iterable[Any]'\n # in case there is no explicit base class.\n return item_type\n # Try also structural typing.\n iter_type = get_proper_type(find_member('__iter__', instance, instance, is_operator=True))\n if iter_type and isinstance(iter_type, CallableType):\n ret_type = get_proper_type(iter_type.ret_type)\n if isinstance(ret_type, Instance):\n iterator = map_instance_to_supertype(ret_type,\n self.lookup_typeinfo('typing.Iterator'))\n item_type = iterator.args[0]\n return item_type\n\n def function_type(self, func: FuncBase) -> FunctionLike:\n return function_type(func, self.named_type('builtins.function'))\n\n def push_type_map(self, type_map: 'TypeMap') -> None:\n if type_map is None:\n self.binder.unreachable()\n else:\n for expr, type in type_map.items():\n self.binder.put(expr, type)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.infer_issubclass_maps_TypeChecker.infer_issubclass_maps.return.yes_map_no_map": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.infer_issubclass_maps_TypeChecker.infer_issubclass_maps.return.yes_map_no_map", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4861, "end_line": 4892, "span_ids": ["TypeChecker.infer_issubclass_maps"], "tokens": 360}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def infer_issubclass_maps(self, node: CallExpr,\n expr: Expression,\n type_map: Dict[Expression, Type]\n ) -> Tuple[TypeMap, TypeMap]:\n \"\"\"Infer type restrictions for an expression in issubclass call.\"\"\"\n vartype = type_map[expr]\n type = get_isinstance_type(node.args[1], type_map)\n if isinstance(vartype, TypeVarType):\n vartype = vartype.upper_bound\n vartype = get_proper_type(vartype)\n if isinstance(vartype, UnionType):\n union_list = []\n for t in get_proper_types(vartype.items):\n if isinstance(t, TypeType):\n union_list.append(t.item)\n else:\n # This is an error that should be reported earlier\n # if we reach here, we refuse to do any type inference.\n return {}, {}\n vartype = UnionType(union_list)\n elif isinstance(vartype, TypeType):\n vartype = vartype.item\n elif (isinstance(vartype, Instance) and\n vartype.type.fullname == 'builtins.type'):\n vartype = self.named_type('builtins.object')\n else:\n # Any other object whose type we don't know precisely\n # for example, Any or a custom metaclass.\n return {}, {} # unknown type\n yes_map, no_map = self.conditional_type_map_with_intersection(expr, vartype, type)\n yes_map, no_map = map(convert_to_typetype, (yes_map, no_map))\n return yes_map, no_map", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.conditional_type_map_with_intersection_TypeChecker.is_writable_attribute.if_isinstance_node_Var_.else_.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.conditional_type_map_with_intersection_TypeChecker.is_writable_attribute.if_isinstance_node_Var_.else_.return.False", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4894, "end_line": 4947, "span_ids": ["TypeChecker.is_writable_attribute", "TypeChecker.conditional_type_map_with_intersection"], "tokens": 504}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def conditional_type_map_with_intersection(self,\n expr: Expression,\n expr_type: Type,\n type_ranges: Optional[List[TypeRange]],\n ) -> Tuple[TypeMap, TypeMap]:\n # For some reason, doing \"yes_map, no_map = conditional_type_maps(...)\"\n # doesn't work: mypyc will decide that 'yes_map' is of type None if we try.\n initial_maps = conditional_type_map(expr, expr_type, type_ranges)\n yes_map = initial_maps[0] # type: TypeMap\n no_map = initial_maps[1] # type: TypeMap\n\n if yes_map is not None or type_ranges is None:\n return yes_map, no_map\n\n # If conditions_type_map was unable to successfully narrow the expr_type\n # using the type_ranges and concluded if-branch is unreachable, we try\n # computing it again using a different algorithm that tries to generate\n # an ad-hoc intersection between the expr_type and the type_ranges.\n expr_type = get_proper_type(expr_type)\n if isinstance(expr_type, UnionType):\n possible_expr_types = get_proper_types(expr_type.relevant_items())\n else:\n possible_expr_types = [expr_type]\n\n possible_target_types = []\n for tr in type_ranges:\n item = get_proper_type(tr.item)\n if not isinstance(item, Instance) or tr.is_upper_bound:\n return yes_map, no_map\n possible_target_types.append(item)\n\n out = []\n for v in possible_expr_types:\n if not isinstance(v, Instance):\n return yes_map, no_map\n for t in possible_target_types:\n intersection = self.intersect_instances([v, t], expr)\n if intersection is None:\n continue\n out.append(intersection)\n if len(out) == 0:\n return None, {}\n new_yes_type = make_simplified_union(out)\n return {expr: new_yes_type}, {}\n\n def is_writable_attribute(self, node: Node) -> bool:\n \"\"\"Check if an attribute is writable\"\"\"\n if isinstance(node, Var):\n return True\n elif isinstance(node, OverloadedFuncDef) and node.is_property:\n first_item = cast(Decorator, node.items[0])\n return first_item.var.is_settable_property\n else:\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_conditional_type_map_conditional_type_map.if_proposed_type_ranges_.else_.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_conditional_type_map_conditional_type_map.if_proposed_type_ranges_.else_.return._", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4950, "end_line": 4989, "span_ids": ["conditional_type_map"], "tokens": 435}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def conditional_type_map(expr: Expression,\n current_type: Optional[Type],\n proposed_type_ranges: Optional[List[TypeRange]],\n ) -> Tuple[TypeMap, TypeMap]:\n \"\"\"Takes in an expression, the current type of the expression, and a\n proposed type of that expression.\n\n Returns a 2-tuple: The first element is a map from the expression to\n the proposed type, if the expression can be the proposed type. The\n second element is a map from the expression to the type it would hold\n if it was not the proposed type, if any. None means bot, {} means top\"\"\"\n if proposed_type_ranges:\n proposed_items = [type_range.item for type_range in proposed_type_ranges]\n proposed_type = make_simplified_union(proposed_items)\n if current_type:\n if isinstance(proposed_type, AnyType):\n # We don't really know much about the proposed type, so we shouldn't\n # attempt to narrow anything. Instead, we broaden the expr to Any to\n # avoid false positives\n return {expr: proposed_type}, {}\n elif (not any(type_range.is_upper_bound for type_range in proposed_type_ranges)\n and is_proper_subtype(current_type, proposed_type)):\n # Expression is always of one of the types in proposed_type_ranges\n return {}, None\n elif not is_overlapping_types(current_type, proposed_type,\n prohibit_none_typevar_overlap=True):\n # Expression is never of any type in proposed_type_ranges\n return None, {}\n else:\n # we can only restrict when the type is precise, not bounded\n proposed_precise_type = UnionType([type_range.item\n for type_range in proposed_type_ranges\n if not type_range.is_upper_bound])\n remaining_type = restrict_subtype_away(current_type, proposed_precise_type)\n return {expr: proposed_type}, {expr: remaining_type}\n else:\n return {expr: proposed_type}, {}\n else:\n # An isinstance check, but we don't understand the type\n return {}, {}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_gen_unique_name_is_false_literal.return._refers_to_fullname_n_b": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_gen_unique_name_is_false_literal.return._refers_to_fullname_n_b", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4992, "end_line": 5011, "span_ids": ["is_false_literal", "gen_unique_name", "is_true_literal"], "tokens": 187}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def gen_unique_name(base: str, table: SymbolTable) -> str:\n \"\"\"Generate a name that does not appear in table by appending numbers to base.\"\"\"\n if base not in table:\n return base\n i = 1\n while base + str(i) in table:\n i += 1\n return base + str(i)\n\n\ndef is_true_literal(n: Expression) -> bool:\n \"\"\"Returns true if this expression is the 'True' literal/keyword.\"\"\"\n return (refers_to_fullname(n, 'builtins.True')\n or isinstance(n, IntExpr) and n.value == 1)\n\n\ndef is_false_literal(n: Expression) -> bool:\n \"\"\"Returns true if this expression is the 'False' literal/keyword.\"\"\"\n return (refers_to_fullname(n, 'builtins.False')\n or isinstance(n, IntExpr) and n.value == 0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_is_literal_enum_is_literal_not_implemented.return.isinstance_n_NameExpr_a": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_is_literal_enum_is_literal_not_implemented.return.isinstance_n_NameExpr_a", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 5014, "end_line": 5056, "span_ids": ["is_literal_enum", "is_literal_none", "is_literal_not_implemented"], "tokens": 391}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_literal_enum(type_map: Mapping[Expression, Type], n: Expression) -> bool:\n \"\"\"Returns true if this expression (with the given type context) is an Enum literal.\n\n For example, if we had an enum:\n\n class Foo(Enum):\n A = 1\n B = 2\n\n ...and if the expression 'Foo' referred to that enum within the current type context,\n then the expression 'Foo.A' would be a a literal enum. However, if we did 'a = Foo.A',\n then the variable 'a' would *not* be a literal enum.\n\n We occasionally special-case expressions like 'Foo.A' and treat them as a single primitive\n unit for the same reasons we sometimes treat 'True', 'False', or 'None' as a single\n primitive unit.\n \"\"\"\n if not isinstance(n, MemberExpr) or not isinstance(n.expr, NameExpr):\n return False\n\n parent_type = type_map.get(n.expr)\n member_type = type_map.get(n)\n if member_type is None or parent_type is None:\n return False\n\n parent_type = get_proper_type(parent_type)\n member_type = get_proper_type(coerce_to_literal(member_type))\n if not isinstance(parent_type, FunctionLike) or not isinstance(member_type, LiteralType):\n return False\n\n if not parent_type.is_type_obj():\n return False\n\n return member_type.is_enum_literal() and member_type.fallback.type == parent_type.type_object()\n\n\ndef is_literal_none(n: Expression) -> bool:\n \"\"\"Returns true if this expression is the 'None' literal/keyword.\"\"\"\n return isinstance(n, NameExpr) and n.fullname == 'builtins.None'\n\n\ndef is_literal_not_implemented(n: Expression) -> bool:\n return isinstance(n, NameExpr) and n.fullname == 'builtins.NotImplemented'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_builtin_item_type_builtin_item_type.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_builtin_item_type_builtin_item_type.return.None", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 5059, "end_line": 5095, "span_ids": ["builtin_item_type"], "tokens": 380}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def builtin_item_type(tp: Type) -> Optional[Type]:\n \"\"\"Get the item type of a builtin container.\n\n If 'tp' is not one of the built containers (these includes NamedTuple and TypedDict)\n or if the container is not parameterized (like List or List[Any])\n return None. This function is used to narrow optional types in situations like this:\n\n x: Optional[int]\n if x in (1, 2, 3):\n x + 42 # OK\n\n Note: this is only OK for built-in containers, where we know the behavior\n of __contains__.\n \"\"\"\n tp = get_proper_type(tp)\n\n if isinstance(tp, Instance):\n if tp.type.fullname in [\n 'builtins.list', 'builtins.tuple', 'builtins.dict',\n 'builtins.set', 'builtins.frozenset',\n ]:\n if not tp.args:\n # TODO: fix tuple in lib-stub/builtins.pyi (it should be generic).\n return None\n if not isinstance(get_proper_type(tp.args[0]), AnyType):\n return tp.args[0]\n elif isinstance(tp, TupleType) and all(not isinstance(it, AnyType)\n for it in get_proper_types(tp.items)):\n return make_simplified_union(tp.items) # this type is not externally visible\n elif isinstance(tp, TypedDictType):\n # TypedDict always has non-optional string keys. Find the key type from the Mapping\n # base class.\n for base in tp.fallback.type.mro:\n if base.fullname == 'typing.Mapping':\n return map_instance_to_supertype(tp.fallback, base).args[0]\n assert False, 'No Mapping base class found for TypedDict fallback'\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_and_conditional_maps_and_conditional_maps.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_and_conditional_maps_and_conditional_maps.return.result", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 5098, "end_line": 5117, "span_ids": ["and_conditional_maps"], "tokens": 223}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def and_conditional_maps(m1: TypeMap, m2: TypeMap) -> TypeMap:\n \"\"\"Calculate what information we can learn from the truth of (e1 and e2)\n in terms of the information that we can learn from the truth of e1 and\n the truth of e2.\n \"\"\"\n\n if m1 is None or m2 is None:\n # One of the conditions can never be true.\n return None\n # Both conditions can be true; combine the information. Anything\n # we learn from either conditions's truth is valid. If the same\n # expression's type is refined by both conditions, we somewhat\n # arbitrarily give precedence to m2. (In the future, we could use\n # an intersection type.)\n result = m2.copy()\n m2_keys = set(literal_hash(n2) for n2 in m2)\n for n1 in m1:\n if literal_hash(n1) not in m2_keys:\n result[n1] = m1[n1]\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_or_conditional_maps_or_conditional_maps.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_or_conditional_maps_or_conditional_maps.return.result", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 5120, "end_line": 5139, "span_ids": ["or_conditional_maps"], "tokens": 204}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def or_conditional_maps(m1: TypeMap, m2: TypeMap) -> TypeMap:\n \"\"\"Calculate what information we can learn from the truth of (e1 or e2)\n in terms of the information that we can learn from the truth of e1 and\n the truth of e2.\n \"\"\"\n\n if m1 is None:\n return m2\n if m2 is None:\n return m1\n # Both conditions can be true. Combine information about\n # expressions whose type is refined by both conditions. (We do not\n # learn anything about expressions whose type is refined by only\n # one condition.)\n result = {} # type: Dict[Expression, Type]\n for n1 in m1:\n for n2 in m2:\n if literal_hash(n1) == literal_hash(n2):\n result[n1] = make_simplified_union([m1[n1], m2[n2]])\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_reduce_conditional_maps_reduce_conditional_maps.if_len_type_maps_0_.else_.return.final_if_map_final_else_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_reduce_conditional_maps_reduce_conditional_maps.if_len_type_maps_0_.else_.return.final_if_map_final_else_", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 5142, "end_line": 5177, "span_ids": ["reduce_conditional_maps"], "tokens": 387}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def reduce_conditional_maps(type_maps: List[Tuple[TypeMap, TypeMap]],\n ) -> Tuple[TypeMap, TypeMap]:\n \"\"\"Reduces a list containing pairs of if/else TypeMaps into a single pair.\n\n We \"and\" together all of the if TypeMaps and \"or\" together the else TypeMaps. So\n for example, if we had the input:\n\n [\n ({x: TypeIfX, shared: TypeIfShared1}, {x: TypeElseX, shared: TypeElseShared1}),\n ({y: TypeIfY, shared: TypeIfShared2}, {y: TypeElseY, shared: TypeElseShared2}),\n ]\n\n ...we'd return the output:\n\n (\n {x: TypeIfX, y: TypeIfY, shared: PseudoIntersection[TypeIfShared1, TypeIfShared2]},\n {shared: Union[TypeElseShared1, TypeElseShared2]},\n )\n\n ...where \"PseudoIntersection[X, Y] == Y\" because mypy actually doesn't understand intersections\n yet, so we settle for just arbitrarily picking the right expr's type.\n\n We only retain the shared expression in the 'else' case because we don't actually know\n whether x was refined or y was refined -- only just that one of the two was refined.\n \"\"\"\n if len(type_maps) == 0:\n return {}, {}\n elif len(type_maps) == 1:\n return type_maps[0]\n else:\n final_if_map, final_else_map = type_maps[0]\n for if_map, else_map in type_maps[1:]:\n final_if_map = and_conditional_maps(final_if_map, if_map)\n final_else_map = or_conditional_maps(final_else_map, else_map)\n\n return final_if_map, final_else_map", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_convert_to_typetype_convert_to_typetype.return.converted_type_map": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_convert_to_typetype_convert_to_typetype.return.converted_type_map", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 5180, "end_line": 5193, "span_ids": ["convert_to_typetype"], "tokens": 140}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def convert_to_typetype(type_map: TypeMap) -> TypeMap:\n converted_type_map = {} # type: Dict[Expression, Type]\n if type_map is None:\n return None\n for expr, typ in type_map.items():\n t = typ\n if isinstance(t, TypeVarType):\n t = t.upper_bound\n # TODO: should we only allow unions of instances as per PEP 484?\n if not isinstance(get_proper_type(t), (UnionType, Instance)):\n # unknown type; error was likely reported earlier\n return {}\n converted_type_map[expr] = TypeType.make_normalized(typ)\n return converted_type_map", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_flatten_flatten_types.if_isinstance_t_TupleTyp.else_.return._t_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_flatten_flatten_types.if_isinstance_t_TupleTyp.else_.return._t_", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 5196, "end_line": 5212, "span_ids": ["flatten_types", "flatten"], "tokens": 147}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def flatten(t: Expression) -> List[Expression]:\n \"\"\"Flatten a nested sequence of tuples/lists into one list of nodes.\"\"\"\n if isinstance(t, TupleExpr) or isinstance(t, ListExpr):\n return [b for a in t.items for b in flatten(a)]\n elif isinstance(t, StarExpr):\n return flatten(t.expr)\n else:\n return [t]\n\n\ndef flatten_types(t: Type) -> List[Type]:\n \"\"\"Flatten a nested sequence of tuples into one list of nodes.\"\"\"\n t = get_proper_type(t)\n if isinstance(t, TupleType):\n return [b for a in t.items for b in flatten_types(a)]\n else:\n return [t]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_get_isinstance_type_get_isinstance_type.return.types": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_get_isinstance_type_get_isinstance_type.return.types", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 5215, "end_line": 5241, "span_ids": ["get_isinstance_type"], "tokens": 345}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_isinstance_type(expr: Expression,\n type_map: Dict[Expression, Type]) -> Optional[List[TypeRange]]:\n all_types = get_proper_types(flatten_types(type_map[expr]))\n types = [] # type: List[TypeRange]\n for typ in all_types:\n if isinstance(typ, FunctionLike) and typ.is_type_obj():\n # Type variables may be present -- erase them, which is the best\n # we can do (outside disallowing them here).\n erased_type = erase_typevars(typ.items()[0].ret_type)\n types.append(TypeRange(erased_type, is_upper_bound=False))\n elif isinstance(typ, TypeType):\n # Type[A] means \"any type that is a subtype of A\" rather than \"precisely type A\"\n # we indicate this by setting is_upper_bound flag\n types.append(TypeRange(typ.item, is_upper_bound=True))\n elif isinstance(typ, Instance) and typ.type.fullname == 'builtins.type':\n object_type = Instance(typ.type.mro[-1], [])\n types.append(TypeRange(object_type, is_upper_bound=True))\n elif isinstance(typ, AnyType):\n types.append(TypeRange(typ, is_upper_bound=False))\n else: # we didn't see an actual type, but rather a variable whose value is unknown to us\n return None\n if not types:\n # this can happen if someone has empty tuple as 2nd argument to isinstance\n # strictly speaking, we should return UninhabitedType but for simplicity we will simply\n # refuse to do any type inference for now\n return None\n return types", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_expand_func_are_argument_counts_overlapping.return.min_args_max_args": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_expand_func_are_argument_counts_overlapping.return.min_args_max_args", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 5244, "end_line": 5265, "span_ids": ["expand_func", "are_argument_counts_overlapping", "TypeTransformVisitor", "TypeTransformVisitor.type", "TypeTransformVisitor.__init__"], "tokens": 189}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def expand_func(defn: FuncItem, map: Dict[TypeVarId, Type]) -> FuncItem:\n visitor = TypeTransformVisitor(map)\n ret = defn.accept(visitor)\n assert isinstance(ret, FuncItem)\n return ret\n\n\nclass TypeTransformVisitor(TransformVisitor):\n def __init__(self, map: Dict[TypeVarId, Type]) -> None:\n super().__init__()\n self.map = map\n\n def type(self, type: Type) -> Type:\n return expand_type(type, self.map)\n\n\ndef are_argument_counts_overlapping(t: CallableType, s: CallableType) -> bool:\n \"\"\"Can a single call match both t and s, based just on positional argument counts?\n \"\"\"\n min_args = max(t.min_args, s.min_args)\n max_args = min(t.max_possible_positional_args(), s.max_possible_positional_args())\n return min_args <= max_args", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_is_unsafe_overlapping_overload_signatures_is_unsafe_overlapping_overload_signatures.return._is_callable_compatible_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_is_unsafe_overlapping_overload_signatures_is_unsafe_overlapping_overload_signatures.return._is_callable_compatible_s", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 5268, "end_line": 5311, "span_ids": ["is_unsafe_overlapping_overload_signatures"], "tokens": 465}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_unsafe_overlapping_overload_signatures(signature: CallableType,\n other: CallableType) -> bool:\n \"\"\"Check if two overloaded signatures are unsafely overlapping or partially overlapping.\n\n We consider two functions 's' and 't' to be unsafely overlapping if both\n of the following are true:\n\n 1. s's parameters are all more precise or partially overlapping with t's\n 2. s's return type is NOT a subtype of t's.\n\n Assumes that 'signature' appears earlier in the list of overload\n alternatives then 'other' and that their argument counts are overlapping.\n \"\"\"\n # Try detaching callables from the containing class so that all TypeVars\n # are treated as being free.\n #\n # This lets us identify cases where the two signatures use completely\n # incompatible types -- e.g. see the testOverloadingInferUnionReturnWithMixedTypevars\n # test case.\n signature = detach_callable(signature)\n other = detach_callable(other)\n\n # Note: We repeat this check twice in both directions due to a slight\n # asymmetry in 'is_callable_compatible'. When checking for partial overlaps,\n # we attempt to unify 'signature' and 'other' both against each other.\n #\n # If 'signature' cannot be unified with 'other', we end early. However,\n # if 'other' cannot be modified with 'signature', the function continues\n # using the older version of 'other'.\n #\n # This discrepancy is unfortunately difficult to get rid of, so we repeat the\n # checks twice in both directions for now.\n return (is_callable_compatible(signature, other,\n is_compat=is_overlapping_types_no_promote,\n is_compat_return=lambda l, r: not is_subtype_no_promote(l, r),\n ignore_return=False,\n check_args_covariantly=True,\n allow_partial_overlap=True) or\n is_callable_compatible(other, signature,\n is_compat=is_overlapping_types_no_promote,\n is_compat_return=lambda l, r: not is_subtype_no_promote(r, l),\n ignore_return=False,\n check_args_covariantly=False,\n allow_partial_overlap=True))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_detach_callable_detach_callable.return.out": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_detach_callable_detach_callable.return.out", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 5314, "end_line": 5358, "span_ids": ["detach_callable"], "tokens": 383}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def detach_callable(typ: CallableType) -> CallableType:\n \"\"\"Ensures that the callable's type variables are 'detached' and independent of the context.\n\n A callable normally keeps track of the type variables it uses within its 'variables' field.\n However, if the callable is from a method and that method is using a class type variable,\n the callable will not keep track of that type variable since it belongs to the class.\n\n This function will traverse the callable and find all used type vars and add them to the\n variables field if it isn't already present.\n\n The caller can then unify on all type variables whether or not the callable is originally\n from a class or not.\"\"\"\n type_list = typ.arg_types + [typ.ret_type]\n\n appear_map = {} # type: Dict[str, List[int]]\n for i, inner_type in enumerate(type_list):\n typevars_available = get_type_vars(inner_type)\n for var in typevars_available:\n if var.fullname not in appear_map:\n appear_map[var.fullname] = []\n appear_map[var.fullname].append(i)\n\n used_type_var_names = set()\n for var_name, appearances in appear_map.items():\n used_type_var_names.add(var_name)\n\n all_type_vars = get_type_vars(typ)\n new_variables = []\n for var in set(all_type_vars):\n if var.fullname not in used_type_var_names:\n continue\n new_variables.append(TypeVarDef(\n name=var.name,\n fullname=var.fullname,\n id=var.id,\n values=var.values,\n upper_bound=var.upper_bound,\n variance=var.variance,\n ))\n out = typ.copy_modified(\n variables=new_variables,\n arg_types=type_list[:-1],\n ret_type=type_list[-1],\n )\n return out", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_overload_can_never_match_overload_can_never_match.return.is_callable_compatible_ex": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_overload_can_never_match_overload_can_never_match.return.is_callable_compatible_ex", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 5361, "end_line": 5382, "span_ids": ["overload_can_never_match"], "tokens": 245}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def overload_can_never_match(signature: CallableType, other: CallableType) -> bool:\n \"\"\"Check if the 'other' method can never be matched due to 'signature'.\n\n This can happen if signature's parameters are all strictly broader then\n other's parameters.\n\n Assumes that both signatures have overlapping argument counts.\n \"\"\"\n # The extra erasure is needed to prevent spurious errors\n # in situations where an `Any` overload is used as a fallback\n # for an overload with type variables. The spurious error appears\n # because the type variables turn into `Any` during unification in\n # the below subtype check and (surprisingly?) `is_proper_subtype(Any, Any)`\n # returns `True`.\n # TODO: find a cleaner solution instead of this ad-hoc erasure.\n exp_signature = expand_type(signature, {tvar.id: erase_def_to_union_or_bound(tvar)\n for tvar in signature.variables})\n assert isinstance(exp_signature, ProperType)\n assert isinstance(exp_signature, CallableType)\n return is_callable_compatible(exp_signature, other,\n is_compat=is_more_precise,\n ignore_return=True)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_is_more_general_arg_prefix_is_more_general_arg_prefix.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_is_more_general_arg_prefix_is_more_general_arg_prefix.return.False", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 5385, "end_line": 5399, "span_ids": ["is_more_general_arg_prefix"], "tokens": 155}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_more_general_arg_prefix(t: FunctionLike, s: FunctionLike) -> bool:\n \"\"\"Does t have wider arguments than s?\"\"\"\n # TODO should an overload with additional items be allowed to be more\n # general than one with fewer items (or just one item)?\n if isinstance(t, CallableType):\n if isinstance(s, CallableType):\n return is_callable_compatible(t, s,\n is_compat=is_proper_subtype,\n ignore_return=True)\n elif isinstance(t, FunctionLike):\n if isinstance(s, FunctionLike):\n if len(t.items()) == len(s.items()):\n return all(is_same_arg_prefix(items, itemt)\n for items, itemt in zip(t.items(), s.items()))\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_is_same_arg_prefix_infer_operator_assignment_method.return.False_method": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_is_same_arg_prefix_infer_operator_assignment_method.return.False_method", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 5402, "end_line": 5423, "span_ids": ["infer_operator_assignment_method", "is_same_arg_prefix"], "tokens": 204}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_same_arg_prefix(t: CallableType, s: CallableType) -> bool:\n return is_callable_compatible(t, s,\n is_compat=is_same_type,\n ignore_return=True,\n check_args_covariantly=True,\n ignore_pos_arg_names=True)\n\n\ndef infer_operator_assignment_method(typ: Type, operator: str) -> Tuple[bool, str]:\n \"\"\"Determine if operator assignment on given value type is in-place, and the method name.\n\n For example, if operator is '+', return (True, '__iadd__') or (False, '__add__')\n depending on which method is supported by the type.\n \"\"\"\n typ = get_proper_type(typ)\n method = nodes.op_methods[operator]\n if isinstance(typ, Instance):\n if operator in nodes.ops_with_inplace_method:\n inplace_method = '__i' + method[2:]\n if typ.type.has_readable_member(inplace_method):\n return True, inplace_method\n return False, method", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_is_valid_inferred_type_is_valid_inferred_type.return.not_typ_accept_NothingSee": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_is_valid_inferred_type_is_valid_inferred_type.return.not_typ_accept_NothingSee", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 5426, "end_line": 5441, "span_ids": ["is_valid_inferred_type"], "tokens": 185}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_valid_inferred_type(typ: Type) -> bool:\n \"\"\"Is an inferred type valid?\n\n Examples of invalid types include the None type or List[].\n\n When not doing strict Optional checking, all types containing None are\n invalid. When doing strict Optional checking, only None and types that are\n incompletely defined (i.e. contain UninhabitedType) are invalid.\n \"\"\"\n if isinstance(get_proper_type(typ), (NoneType, UninhabitedType)):\n # With strict Optional checking, we *may* eventually infer NoneType when\n # the initializer is None, but we only do that if we can't infer a\n # specific Optional type. This resolution happens in\n # leave_partial_types when we pop a partial types scope.\n return False\n return not typ.accept(NothingSeeker())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_NothingSeeker_is_node_static.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_NothingSeeker_is_node_static.return.None", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 5444, "end_line": 5477, "span_ids": ["NothingSeeker", "NothingSeeker.__init__", "SetNothingToAny.visit_type_alias_type", "SetNothingToAny", "NothingSeeker.visit_uninhabited_type", "SetNothingToAny.visit_uninhabited_type", "is_node_static"], "tokens": 255}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class NothingSeeker(TypeQuery[bool]):\n \"\"\"Find any types resulting from failed (ambiguous) type inference.\"\"\"\n\n def __init__(self) -> None:\n super().__init__(any)\n\n def visit_uninhabited_type(self, t: UninhabitedType) -> bool:\n return t.ambiguous\n\n\nclass SetNothingToAny(TypeTranslator):\n \"\"\"Replace all ambiguous types with Any (to avoid spurious extra errors).\"\"\"\n\n def visit_uninhabited_type(self, t: UninhabitedType) -> Type:\n if t.ambiguous:\n return AnyType(TypeOfAny.from_error)\n return t\n\n def visit_type_alias_type(self, t: TypeAliasType) -> Type:\n # Target of the alias cannot by an ambiguous , so we just\n # replace the arguments.\n return t.copy_modified(args=[a.accept(self) for a in t.args])\n\n\ndef is_node_static(node: Optional[Node]) -> Optional[bool]:\n \"\"\"Find out if a node describes a static function method.\"\"\"\n\n if isinstance(node, FuncDef):\n return node.is_static\n\n if isinstance(node, Var):\n return node.is_staticmethod\n\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_CheckerScope_TValue.TypeVar_TValue_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_CheckerScope_TValue.TypeVar_TValue_", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 5480, "end_line": 5547, "span_ids": ["nothing", "CheckerScope", "CheckerScope.push_function", "CheckerScope.active_self_type", "CheckerScope.push_class", "CheckerScope.__init__", "CheckerScope.top_non_lambda_function", "CheckerScope.top_function", "CheckerScope.enclosing_class", "CheckerScope.active_class", "impl:19"], "tokens": 474}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CheckerScope:\n # We keep two stacks combined, to maintain the relative order\n stack = None # type: List[Union[TypeInfo, FuncItem, MypyFile]]\n\n def __init__(self, module: MypyFile) -> None:\n self.stack = [module]\n\n def top_function(self) -> Optional[FuncItem]:\n for e in reversed(self.stack):\n if isinstance(e, FuncItem):\n return e\n return None\n\n def top_non_lambda_function(self) -> Optional[FuncItem]:\n for e in reversed(self.stack):\n if isinstance(e, FuncItem) and not isinstance(e, LambdaExpr):\n return e\n return None\n\n def active_class(self) -> Optional[TypeInfo]:\n if isinstance(self.stack[-1], TypeInfo):\n return self.stack[-1]\n return None\n\n def enclosing_class(self) -> Optional[TypeInfo]:\n \"\"\"Is there a class *directly* enclosing this function?\"\"\"\n top = self.top_function()\n assert top, \"This method must be called from inside a function\"\n index = self.stack.index(top)\n assert index, \"CheckerScope stack must always start with a module\"\n enclosing = self.stack[index - 1]\n if isinstance(enclosing, TypeInfo):\n return enclosing\n return None\n\n def active_self_type(self) -> Optional[Union[Instance, TupleType]]:\n \"\"\"An instance or tuple type representing the current class.\n\n This returns None unless we are in class body or in a method.\n In particular, inside a function nested in method this returns None.\n \"\"\"\n info = self.active_class()\n if not info and self.top_function():\n info = self.enclosing_class()\n if info:\n return fill_typevars(info)\n return None\n\n @contextmanager\n def push_function(self, item: FuncItem) -> Iterator[None]:\n self.stack.append(item)\n yield\n self.stack.pop()\n\n @contextmanager\n def push_class(self, info: TypeInfo) -> Iterator[None]:\n self.stack.append(info)\n yield\n self.stack.pop()\n\n\n@contextmanager\ndef nothing() -> Iterator[None]:\n yield\n\n\nTKey = TypeVar('TKey')\nTValue = TypeVar('TValue')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_DisjointDict_DisjointDict.__init__._type_Dict_int_Set_TVa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_DisjointDict_DisjointDict.__init__._type_Dict_int_Set_TVa", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 5550, "end_line": 5586, "span_ids": ["DisjointDict.__init__", "DisjointDict"], "tokens": 554}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DisjointDict(Generic[TKey, TValue]):\n \"\"\"An variation of the union-find algorithm/data structure where instead of keeping\n track of just disjoint sets, we keep track of disjoint dicts -- keep track of multiple\n Set[Key] -> Set[Value] mappings, where each mapping's keys are guaranteed to be disjoint.\n\n This data structure is currently used exclusively by 'group_comparison_operands' below\n to merge chains of '==' and 'is' comparisons when two or more chains use the same expression\n in best-case O(n), where n is the number of operands.\n\n Specifically, the `add_mapping()` function and `items()` functions will take on average\n O(k + v) and O(n) respectively, where k and v are the number of keys and values we're adding\n for a given chain. Note that k <= n and v <= n.\n\n We hit these average/best-case scenarios for most user code: e.g. when the user has just\n a single chain like 'a == b == c == d == ...' or multiple disjoint chains like\n 'a==b < c==d < e==f < ...'. (Note that a naive iterative merging would be O(n^2) for\n the latter case).\n\n In comparison, this data structure will make 'group_comparison_operands' have a worst-case\n runtime of O(n*log(n)): 'add_mapping()' and 'items()' are worst-case O(k*log(n) + v) and\n O(k*log(n)) respectively. This happens only in the rare case where the user keeps repeatedly\n making disjoint mappings before merging them in a way that persistently dodges the path\n compression optimization in '_lookup_root_id', which would end up constructing a single\n tree of height log_2(n). This makes root lookups no longer amoritized constant time when we\n finally call 'items()'.\n \"\"\"\n def __init__(self) -> None:\n # Each key maps to a unique ID\n self._key_to_id = {} # type: Dict[TKey, int]\n\n # Each id points to the parent id, forming a forest of upwards-pointing trees. If the\n # current id already is the root, it points to itself. We gradually flatten these trees\n # as we perform root lookups: eventually all nodes point directly to its root.\n self._id_to_parent_id = {} # type: Dict[int, int]\n\n # Each root id in turn maps to the set of values.\n self._root_id_to_values = {} # type: Dict[int, Set[TValue]]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_DisjointDict.add_mapping_DisjointDict.add_mapping.for_subtree_root_in_subtr.root_values_update_self__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_DisjointDict.add_mapping_DisjointDict.add_mapping.for_subtree_root_in_subtr.root_values_update_self__", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 5588, "end_line": 5606, "span_ids": ["DisjointDict.add_mapping"], "tokens": 220}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DisjointDict(Generic[TKey, TValue]):\n\n def add_mapping(self, keys: Set[TKey], values: Set[TValue]) -> None:\n \"\"\"Adds a 'Set[TKey] -> Set[TValue]' mapping. If there already exists a mapping\n containing one or more of the given keys, we merge the input mapping with the old one.\n\n Note that the given set of keys must be non-empty -- otherwise, nothing happens.\n \"\"\"\n if len(keys) == 0:\n return\n\n subtree_roots = [self._lookup_or_make_root_id(key) for key in keys]\n new_root = subtree_roots[0]\n\n root_values = self._root_id_to_values[new_root]\n root_values.update(values)\n for subtree_root in subtree_roots[1:]:\n if subtree_root == new_root or subtree_root not in self._root_id_to_values:\n continue\n self._id_to_parent_id[subtree_root] = new_root\n root_values.update(self._root_id_to_values.pop(subtree_root))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_DisjointDict.items_DisjointDict.items.return.output": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_DisjointDict.items_DisjointDict.items.return.output", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 5608, "end_line": 5621, "span_ids": ["DisjointDict.items"], "tokens": 149}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DisjointDict(Generic[TKey, TValue]):\n\n def items(self) -> List[Tuple[Set[TKey], Set[TValue]]]:\n \"\"\"Returns all disjoint mappings in key-value pairs.\"\"\"\n root_id_to_keys = {} # type: Dict[int, Set[TKey]]\n for key in self._key_to_id:\n root_id = self._lookup_root_id(key)\n if root_id not in root_id_to_keys:\n root_id_to_keys[root_id] = set()\n root_id_to_keys[root_id].add(key)\n\n output = []\n for root_id, keys in root_id_to_keys.items():\n output.append((keys, self._root_id_to_values[root_id]))\n\n return output", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_DisjointDict._lookup_or_make_root_id_DisjointDict._lookup_root_id.return.i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_DisjointDict._lookup_or_make_root_id_DisjointDict._lookup_root_id.return.i", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 5623, "end_line": 5641, "span_ids": ["DisjointDict._lookup_or_make_root_id", "DisjointDict._lookup_root_id"], "tokens": 215}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DisjointDict(Generic[TKey, TValue]):\n\n def _lookup_or_make_root_id(self, key: TKey) -> int:\n if key in self._key_to_id:\n return self._lookup_root_id(key)\n else:\n new_id = len(self._key_to_id)\n self._key_to_id[key] = new_id\n self._id_to_parent_id[new_id] = new_id\n self._root_id_to_values[new_id] = set()\n return new_id\n\n def _lookup_root_id(self, key: TKey) -> int:\n i = self._key_to_id[key]\n while i != self._id_to_parent_id[i]:\n # Optimization: make keys directly point to their grandparents to speed up\n # future traversals. This prevents degenerate trees of height n from forming.\n new_parent = self._id_to_parent_id[self._id_to_parent_id[i]]\n self._id_to_parent_id[i] = new_parent\n i = new_parent\n return i", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_group_comparison_operands_group_comparison_operands._type_Set_Key_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_group_comparison_operands_group_comparison_operands._type_Set_Key_", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 5644, "end_line": 5698, "span_ids": ["group_comparison_operands"], "tokens": 681}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def group_comparison_operands(pairwise_comparisons: Iterable[Tuple[str, Expression, Expression]],\n operand_to_literal_hash: Mapping[int, Key],\n operators_to_group: Set[str],\n ) -> List[Tuple[str, List[int]]]:\n \"\"\"Group a series of comparison operands together chained by any operand\n in the 'operators_to_group' set. All other pairwise operands are kept in\n groups of size 2.\n\n For example, suppose we have the input comparison expression:\n\n x0 == x1 == x2 < x3 < x4 is x5 is x6 is not x7 is not x8\n\n If we get these expressions in a pairwise way (e.g. by calling ComparisionExpr's\n 'pairwise()' method), we get the following as input:\n\n [('==', x0, x1), ('==', x1, x2), ('<', x2, x3), ('<', x3, x4),\n ('is', x4, x5), ('is', x5, x6), ('is not', x6, x7), ('is not', x7, x8)]\n\n If `operators_to_group` is the set {'==', 'is'}, this function will produce\n the following \"simplified operator list\":\n\n [(\"==\", [0, 1, 2]), (\"<\", [2, 3]), (\"<\", [3, 4]),\n (\"is\", [4, 5, 6]), (\"is not\", [6, 7]), (\"is not\", [7, 8])]\n\n Note that (a) we yield *indices* to the operands rather then the operand\n expressions themselves and that (b) operands used in a consecutive chain\n of '==' or 'is' are grouped together.\n\n If two of these chains happen to contain operands with the same underlying\n literal hash (e.g. are assignable and correspond to the same expression),\n we combine those chains together. For example, if we had:\n\n same == x < y == same\n\n ...and if 'operand_to_literal_hash' contained the same values for the indices\n 0 and 3, we'd produce the following output:\n\n [(\"==\", [0, 1, 2, 3]), (\"<\", [1, 2])]\n\n But if the 'operand_to_literal_hash' did *not* contain an entry, we'd instead\n default to returning:\n\n [(\"==\", [0, 1]), (\"<\", [1, 2]), (\"==\", [2, 3])]\n\n This function is currently only used to assist with type-narrowing refinements\n and is extracted out to a helper function so we can unit test it.\n \"\"\"\n groups = {\n op: DisjointDict() for op in operators_to_group\n } # type: Dict[str, DisjointDict[Key, int]]\n\n simplified_operator_list = [] # type: List[Tuple[str, List[int]]]\n last_operator = None # type: Optional[str]\n current_indices = set() # type: Set[int]\n current_hashes = set() # type: Set[Key]\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_group_comparison_operands.for_i_operator_left_ex_group_comparison_operands.return.simplified_operator_list": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_group_comparison_operands.for_i_operator_left_ex_group_comparison_operands.return.simplified_operator_list", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 5699, "end_line": 5742, "span_ids": ["group_comparison_operands"], "tokens": 470}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def group_comparison_operands(pairwise_comparisons: Iterable[Tuple[str, Expression, Expression]],\n operand_to_literal_hash: Mapping[int, Key],\n operators_to_group: Set[str],\n ) -> List[Tuple[str, List[int]]]:\n # ... other code\n for i, (operator, left_expr, right_expr) in enumerate(pairwise_comparisons):\n if last_operator is None:\n last_operator = operator\n\n if current_indices and (operator != last_operator or operator not in operators_to_group):\n # If some of the operands in the chain are assignable, defer adding it: we might\n # end up needing to merge it with other chains that appear later.\n if len(current_hashes) == 0:\n simplified_operator_list.append((last_operator, sorted(current_indices)))\n else:\n groups[last_operator].add_mapping(current_hashes, current_indices)\n last_operator = operator\n current_indices = set()\n current_hashes = set()\n\n # Note: 'i' corresponds to the left operand index, so 'i + 1' is the\n # right operand.\n current_indices.add(i)\n current_indices.add(i + 1)\n\n # We only ever want to combine operands/combine chains for these operators\n if operator in operators_to_group:\n left_hash = operand_to_literal_hash.get(i)\n if left_hash is not None:\n current_hashes.add(left_hash)\n right_hash = operand_to_literal_hash.get(i + 1)\n if right_hash is not None:\n current_hashes.add(right_hash)\n\n if last_operator is not None:\n if len(current_hashes) == 0:\n simplified_operator_list.append((last_operator, sorted(current_indices)))\n else:\n groups[last_operator].add_mapping(current_hashes, current_indices)\n\n # Now that we know which chains happen to contain the same underlying expressions\n # and can be merged together, add in this info back to the output.\n for operator, disjoint_dict in groups.items():\n for keys, indices in disjoint_dict.items():\n simplified_operator_list.append((operator, sorted(indices)))\n\n # For stability, reorder list by the first operand index to appear\n simplified_operator_list.sort(key=lambda item: item[1][0])\n return simplified_operator_list", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_is_typed_callable_is_untyped_decorator.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_is_typed_callable_is_untyped_decorator.return.True", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 5745, "end_line": 5770, "span_ids": ["is_untyped_decorator", "is_typed_callable"], "tokens": 222}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_typed_callable(c: Optional[Type]) -> bool:\n c = get_proper_type(c)\n if not c or not isinstance(c, CallableType):\n return False\n return not all(isinstance(t, AnyType) and t.type_of_any == TypeOfAny.unannotated\n for t in get_proper_types(c.arg_types + [c.ret_type]))\n\n\ndef is_untyped_decorator(typ: Optional[Type]) -> bool:\n typ = get_proper_type(typ)\n if not typ:\n return True\n elif isinstance(typ, CallableType):\n return not is_typed_callable(typ)\n elif isinstance(typ, Instance):\n method = typ.type.get_method('__call__')\n if method:\n if isinstance(method.type, Overloaded):\n return any(is_untyped_decorator(item) for item in method.type.items())\n else:\n return not is_typed_callable(method.type)\n else:\n return False\n elif isinstance(typ, Overloaded):\n return any(is_untyped_decorator(item) for item in typ.items())\n return True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_is_static_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_is_static_", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 5773, "end_line": 5813, "span_ids": ["is_private", "is_static", "has_bool_item", "is_subtype_no_promote", "is_overlapping_types_no_promote", "collapse_walrus"], "tokens": 327}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_static(func: Union[FuncBase, Decorator]) -> bool:\n if isinstance(func, Decorator):\n return is_static(func.func)\n elif isinstance(func, FuncBase):\n return func.is_static\n assert False, \"Unexpected func type: {}\".format(type(func))\n\n\ndef is_subtype_no_promote(left: Type, right: Type) -> bool:\n return is_subtype(left, right, ignore_promotions=True)\n\n\ndef is_overlapping_types_no_promote(left: Type, right: Type) -> bool:\n return is_overlapping_types(left, right, ignore_promotions=True)\n\n\ndef is_private(node_name: str) -> bool:\n \"\"\"Check if node is private to class definition.\"\"\"\n return node_name.startswith('__') and not node_name.endswith('__')\n\n\ndef has_bool_item(typ: ProperType) -> bool:\n \"\"\"Return True if type is 'bool' or a union with a 'bool' item.\"\"\"\n if is_named_instance(typ, 'builtins.bool'):\n return True\n if isinstance(typ, UnionType):\n return any(is_named_instance(item, 'builtins.bool')\n for item in typ.items)\n return False\n\n\ndef collapse_walrus(e: Expression) -> Expression:\n \"\"\"If an expression is an AssignmentExpr, pull out the assignment target.\n\n We don't make any attempt to pull out all the targets in code like `x := (y := z)`.\n We could support narrowing those if that sort of code turns out to be common.\n \"\"\"\n if isinstance(e, AssignmentExpr):\n return e.target\n return e", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py__Expression_type_checke_from_mypy_plugin_import_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py__Expression_type_checke_from_mypy_plugin_import_", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 63, "span_ids": ["imports:15", "docstring"], "tokens": 748}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Expression type checker. This file is conceptually part of TypeChecker.\"\"\"\n\nfrom mypy.ordered_dict import OrderedDict\nfrom contextlib import contextmanager\nimport itertools\nfrom typing import (\n Any, cast, Dict, Set, List, Tuple, Callable, Union, Optional, Sequence, Iterator\n)\nfrom typing_extensions import ClassVar, Final, overload\n\nfrom mypy.errors import report_internal_error\nfrom mypy.typeanal import (\n has_any_from_unimported_type, check_for_explicit_any, set_any_tvars, expand_type_alias,\n make_optional_type,\n)\nfrom mypy.types import (\n Type, AnyType, CallableType, Overloaded, NoneType, TypeGuardType, TypeVarDef,\n TupleType, TypedDictType, Instance, TypeVarType, ErasedType, UnionType,\n PartialType, DeletedType, UninhabitedType, TypeType, TypeOfAny, LiteralType, LiteralValue,\n is_named_instance, FunctionLike,\n StarType, is_optional, remove_optional, is_generic_instance, get_proper_type, ProperType,\n get_proper_types, flatten_nested_unions\n)\nfrom mypy.nodes import (\n NameExpr, RefExpr, Var, FuncDef, OverloadedFuncDef, TypeInfo, CallExpr,\n MemberExpr, IntExpr, StrExpr, BytesExpr, UnicodeExpr, FloatExpr,\n OpExpr, UnaryExpr, IndexExpr, CastExpr, RevealExpr, TypeApplication, ListExpr,\n TupleExpr, DictExpr, LambdaExpr, SuperExpr, SliceExpr, Context, Expression,\n ListComprehension, GeneratorExpr, SetExpr, MypyFile, Decorator,\n ConditionalExpr, ComparisonExpr, TempNode, SetComprehension, AssignmentExpr,\n DictionaryComprehension, ComplexExpr, EllipsisExpr, StarExpr, AwaitExpr, YieldExpr,\n YieldFromExpr, TypedDictExpr, PromoteExpr, NewTypeExpr, NamedTupleExpr, TypeVarExpr,\n TypeAliasExpr, BackquoteExpr, EnumCallExpr, TypeAlias, SymbolNode, PlaceholderNode,\n ParamSpecExpr,\n ARG_POS, ARG_OPT, ARG_NAMED, ARG_STAR, ARG_STAR2, LITERAL_TYPE, REVEAL_TYPE,\n)\nfrom mypy.literals import literal\nfrom mypy import nodes\nimport mypy.checker\nfrom mypy import types\nfrom mypy.sametypes import is_same_type\nfrom mypy.erasetype import replace_meta_vars, erase_type, remove_instance_last_known_values\nfrom mypy.maptype import map_instance_to_supertype\nfrom mypy.messages import MessageBuilder\nfrom mypy import message_registry\nfrom mypy.infer import infer_type_arguments, infer_function_type_arguments\nfrom mypy import join\nfrom mypy.meet import narrow_declared_type, is_overlapping_types\nfrom mypy.subtypes import is_subtype, is_proper_subtype, is_equivalent, non_method_protocol_members\nfrom mypy import applytype\nfrom mypy import erasetype\nfrom mypy.checkmember import analyze_member_access, type_object_type\nfrom mypy.argmap import ArgTypeExpander, map_actuals_to_formals, map_formals_to_actuals\nfrom mypy.checkstrformat import StringFormatterChecker\nfrom mypy.expandtype import expand_type, expand_type_by_instance, freshen_function_type_vars\nfrom mypy.util import split_module_names\nfrom mypy.typevars import fill_typevars\nfrom mypy.visitor import ExpressionVisitor\nfrom mypy.plugin import (\n Plugin,\n MethodContext, MethodSigContext,\n FunctionContext, FunctionSigContext,\n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_from_mypy_typeops_import__TooManyUnions._Indicates_that_we_need": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_from_mypy_typeops_import__TooManyUnions._Indicates_that_we_need", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 64, "end_line": 102, "span_ids": ["TooManyUnions", "imports:15"], "tokens": 316}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from mypy.typeops import (\n tuple_fallback, make_simplified_union, true_only, false_only, erase_to_union_or_bound,\n function_type, callable_type, try_getting_str_literals, custom_special_method,\n is_literal_type_like,\n)\nimport mypy.errorcodes as codes\n\n# Type of callback user for checking individual function arguments. See\n# check_args() below for details.\nArgChecker = Callable[[Type,\n Type,\n int,\n Type,\n int,\n int,\n CallableType,\n Optional[Type],\n Context,\n Context,\n MessageBuilder],\n None]\n\n# Maximum nesting level for math union in overloads, setting this to large values\n# may cause performance issues. The reason is that although union math algorithm we use\n# nicely captures most corner cases, its worst case complexity is exponential,\n# see https://github.com/python/mypy/pull/5255#discussion_r196896335 for discussion.\nMAX_UNIONS = 5 # type: Final\n\n\n# Types considered safe for comparisons with --strict-equality due to known behaviour of __eq__.\n# NOTE: All these types are subtypes of AbstractSet.\nOVERLAPPING_TYPES_WHITELIST = ['builtins.set', 'builtins.frozenset',\n 'typing.KeysView', 'typing.ItemsView'] # type: Final\n\n\nclass TooManyUnions(Exception):\n \"\"\"Indicates that we need to stop splitting unions in an attempt\n to match an overload in order to save performance.\n \"\"\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_extract_refexpr_names_Finished._Raised_if_we_can_termi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_extract_refexpr_names_Finished._Raised_if_we_can_termi", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 104, "end_line": 137, "span_ids": ["Finished", "extract_refexpr_names"], "tokens": 320}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def extract_refexpr_names(expr: RefExpr) -> Set[str]:\n \"\"\"Recursively extracts all module references from a reference expression.\n\n Note that currently, the only two subclasses of RefExpr are NameExpr and\n MemberExpr.\"\"\"\n output = set() # type: Set[str]\n while isinstance(expr.node, MypyFile) or expr.fullname is not None:\n if isinstance(expr.node, MypyFile) and expr.fullname is not None:\n # If it's None, something's wrong (perhaps due to an\n # import cycle or a suppressed error). For now we just\n # skip it.\n output.add(expr.fullname)\n\n if isinstance(expr, NameExpr):\n is_suppressed_import = isinstance(expr.node, Var) and expr.node.is_suppressed_import\n if isinstance(expr.node, TypeInfo):\n # Reference to a class or a nested class\n output.update(split_module_names(expr.node.module_name))\n elif expr.fullname is not None and '.' in expr.fullname and not is_suppressed_import:\n # Everything else (that is not a silenced import within a class)\n output.add(expr.fullname.rsplit('.', 1)[0])\n break\n elif isinstance(expr, MemberExpr):\n if isinstance(expr.expr, RefExpr):\n expr = expr.expr\n else:\n break\n else:\n raise AssertionError(\"Unknown RefExpr subclass: {}\".format(type(expr)))\n return output\n\n\nclass Finished(Exception):\n \"\"\"Raised if we can terminate overload argument check early (no match).\"\"\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker_ExpressionChecker.visit_name_expr.return.self_narrow_type_from_bin": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker_ExpressionChecker.visit_name_expr.return.self_narrow_type_from_bin", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 140, "end_line": 180, "span_ids": ["ExpressionChecker.visit_name_expr", "ExpressionChecker", "ExpressionChecker.__init__"], "tokens": 355}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n \"\"\"Expression type checker.\n\n This class works closely together with checker.TypeChecker.\n \"\"\"\n\n # Some services are provided by a TypeChecker instance.\n chk = None # type: mypy.checker.TypeChecker\n # This is shared with TypeChecker, but stored also here for convenience.\n msg = None # type: MessageBuilder\n # Type context for type inference\n type_context = None # type: List[Optional[Type]]\n\n strfrm_checker = None # type: StringFormatterChecker\n plugin = None # type: Plugin\n\n def __init__(self,\n chk: 'mypy.checker.TypeChecker',\n msg: MessageBuilder,\n plugin: Plugin) -> None:\n \"\"\"Construct an expression type checker.\"\"\"\n self.chk = chk\n self.msg = msg\n self.plugin = plugin\n self.type_context = [None]\n\n # Temporary overrides for expression types. This is currently\n # used by the union math in overloads.\n # TODO: refactor this to use a pattern similar to one in\n # multiassign_from_union, or maybe even combine the two?\n self.type_overrides = {} # type: Dict[Expression, Type]\n self.strfrm_checker = StringFormatterChecker(self, self.chk, self.msg)\n\n def visit_name_expr(self, e: NameExpr) -> Type:\n \"\"\"Type check a name expression.\n\n It can be of any kind: local, member or global.\n \"\"\"\n self.chk.module_refs.update(extract_refexpr_names(e))\n result = self.analyze_ref_expr(e)\n return self.narrow_type_from_binder(e, result)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.analyze_ref_expr_ExpressionChecker.analyze_ref_expr.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.analyze_ref_expr_ExpressionChecker.analyze_ref_expr.return.result", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 182, "end_line": 244, "span_ids": ["ExpressionChecker.analyze_ref_expr"], "tokens": 665}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def analyze_ref_expr(self, e: RefExpr, lvalue: bool = False) -> Type:\n result = None # type: Optional[Type]\n node = e.node\n\n if isinstance(e, NameExpr) and e.is_special_form:\n # A special form definition, nothing to check here.\n return AnyType(TypeOfAny.special_form)\n\n if isinstance(node, Var):\n # Variable reference.\n result = self.analyze_var_ref(node, e)\n if isinstance(result, PartialType):\n result = self.chk.handle_partial_var_type(result, lvalue, node, e)\n elif isinstance(node, FuncDef):\n # Reference to a global function.\n result = function_type(node, self.named_type('builtins.function'))\n elif isinstance(node, OverloadedFuncDef) and node.type is not None:\n # node.type is None when there are multiple definitions of a function\n # and it's decorated by something that is not typing.overload\n # TODO: use a dummy Overloaded instead of AnyType in this case\n # like we do in mypy.types.function_type()?\n result = node.type\n elif isinstance(node, TypeInfo):\n # Reference to a type object.\n result = type_object_type(node, self.named_type)\n if (isinstance(result, CallableType) and\n isinstance(result.ret_type, Instance)): # type: ignore\n # We need to set correct line and column\n # TODO: always do this in type_object_type by passing the original context\n result.ret_type.line = e.line\n result.ret_type.column = e.column\n if isinstance(get_proper_type(self.type_context[-1]), TypeType):\n # This is the type in a Type[] expression, so substitute type\n # variables with Any.\n result = erasetype.erase_typevars(result)\n elif isinstance(node, MypyFile):\n # Reference to a module object.\n try:\n result = self.named_type('types.ModuleType')\n except KeyError:\n # In test cases might 'types' may not be available.\n # Fall back to a dummy 'object' type instead to\n # avoid a crash.\n result = self.named_type('builtins.object')\n elif isinstance(node, Decorator):\n result = self.analyze_var_ref(node.var, e)\n elif isinstance(node, TypeAlias):\n # Something that refers to a type alias appears in runtime context.\n # Note that we suppress bogus errors for alias redefinitions,\n # they are already reported in semanal.py.\n result = self.alias_type_in_runtime_context(node, node.no_args, e,\n alias_definition=e.is_alias_rvalue\n or lvalue)\n elif isinstance(node, (TypeVarExpr, ParamSpecExpr)):\n result = self.object_type()\n else:\n if isinstance(node, PlaceholderNode):\n assert False, 'PlaceholderNode %r leaked to checker' % node.fullname\n # Unknown reference; use any type implicitly to avoid\n # generating extra type errors.\n result = AnyType(TypeOfAny.from_error)\n assert result is not None\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.analyze_var_ref_ExpressionChecker.analyze_var_ref.if_var_type_.else_.return.AnyType_TypeOfAny_special": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.analyze_var_ref_ExpressionChecker.analyze_var_ref.if_var_type_.else_.return.AnyType_TypeOfAny_special", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 246, "end_line": 259, "span_ids": ["ExpressionChecker.analyze_var_ref"], "tokens": 160}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def analyze_var_ref(self, var: Var, context: Context) -> Type:\n if var.type:\n var_type = get_proper_type(var.type)\n if isinstance(var_type, Instance):\n if self.is_literal_context() and var_type.last_known_value is not None:\n return var_type.last_known_value\n if var.name in {'True', 'False'}:\n return self.infer_literal_expr_type(var.name == 'True', 'builtins.bool')\n return var.type\n else:\n if not var.is_ready and self.chk.in_checked_function():\n self.chk.handle_cannot_determine_type(var.name, context)\n # Implicit 'Any' type.\n return AnyType(TypeOfAny.special_form)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_call_expr_ExpressionChecker.visit_call_expr.return.self_visit_call_expr_inne": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_call_expr_ExpressionChecker.visit_call_expr.return.self_visit_call_expr_inne", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 261, "end_line": 270, "span_ids": ["ExpressionChecker.visit_call_expr"], "tokens": 149}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def visit_call_expr(self, e: CallExpr, allow_none_return: bool = False) -> Type:\n \"\"\"Type check a call expression.\"\"\"\n if e.analyzed:\n if isinstance(e.analyzed, NamedTupleExpr) and not e.analyzed.is_typed:\n # Type check the arguments, but ignore the results. This relies\n # on the typeshed stubs to type check the arguments.\n self.visit_call_expr_inner(e)\n # It's really a special form that only looks like a call.\n return self.accept(e.analyzed, self.type_context[-1])\n return self.visit_call_expr_inner(e, allow_none_return=allow_none_return)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_call_expr_inner_ExpressionChecker.visit_call_expr_inner.fullname.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_call_expr_inner_ExpressionChecker.visit_call_expr_inner.fullname.None", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 272, "end_line": 333, "span_ids": ["ExpressionChecker.visit_call_expr_inner"], "tokens": 750}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def visit_call_expr_inner(self, e: CallExpr, allow_none_return: bool = False) -> Type:\n if isinstance(e.callee, RefExpr) and isinstance(e.callee.node, TypeInfo) and \\\n e.callee.node.typeddict_type is not None:\n # Use named fallback for better error messages.\n typeddict_type = e.callee.node.typeddict_type.copy_modified(\n fallback=Instance(e.callee.node, []))\n return self.check_typeddict_call(typeddict_type, e.arg_kinds, e.arg_names, e.args, e)\n if (isinstance(e.callee, NameExpr) and e.callee.name in ('isinstance', 'issubclass')\n and len(e.args) == 2):\n for typ in mypy.checker.flatten(e.args[1]):\n node = None\n if isinstance(typ, NameExpr):\n try:\n node = self.chk.lookup_qualified(typ.name)\n except KeyError:\n # Undefined names should already be reported in semantic analysis.\n pass\n if is_expr_literal_type(typ):\n self.msg.cannot_use_function_with_type(e.callee.name, \"Literal\", e)\n continue\n if (node and isinstance(node.node, TypeAlias)\n and isinstance(get_proper_type(node.node.target), AnyType)):\n self.msg.cannot_use_function_with_type(e.callee.name, \"Any\", e)\n continue\n if ((isinstance(typ, IndexExpr)\n and isinstance(typ.analyzed, (TypeApplication, TypeAliasExpr)))\n or (isinstance(typ, NameExpr) and node and\n isinstance(node.node, TypeAlias) and not node.node.no_args)):\n self.msg.type_arguments_not_allowed(e)\n if isinstance(typ, RefExpr) and isinstance(typ.node, TypeInfo):\n if typ.node.typeddict_type:\n self.msg.cannot_use_function_with_type(e.callee.name, \"TypedDict\", e)\n elif typ.node.is_newtype:\n self.msg.cannot_use_function_with_type(e.callee.name, \"NewType\", e)\n self.try_infer_partial_type(e)\n type_context = None\n if isinstance(e.callee, LambdaExpr):\n formal_to_actual = map_actuals_to_formals(\n e.arg_kinds, e.arg_names,\n e.callee.arg_kinds, e.callee.arg_names,\n lambda i: self.accept(e.args[i]))\n\n arg_types = [join.join_type_list([self.accept(e.args[j]) for j in formal_to_actual[i]])\n for i in range(len(e.callee.arg_kinds))]\n type_context = CallableType(arg_types, e.callee.arg_kinds, e.callee.arg_names,\n ret_type=self.object_type(),\n fallback=self.named_type('builtins.function'))\n callee_type = get_proper_type(self.accept(e.callee, type_context, always_allow_any=True))\n if (isinstance(e.callee, RefExpr)\n and isinstance(callee_type, CallableType)\n and callee_type.type_guard is not None):\n # Cache it for find_isinstance_check()\n e.callee.type_guard = callee_type.type_guard\n if (self.chk.options.disallow_untyped_calls and\n self.chk.in_checked_function() and\n isinstance(callee_type, CallableType)\n and callee_type.implicit):\n self.msg.untyped_function_call(callee_type, e)\n # Figure out the full name of the callee for plugin lookup.\n object_type = None\n member = None\n fullname = None\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_str_format_call_ExpressionChecker.check_str_format_call.if_format_value_is_not_No.self_strfrm_checker_check": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_str_format_call_ExpressionChecker.check_str_format_call.if_format_value_is_not_No.self_strfrm_checker_check", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 368, "end_line": 379, "span_ids": ["ExpressionChecker.check_str_format_call"], "tokens": 156}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def check_str_format_call(self, e: CallExpr) -> None:\n \"\"\"More precise type checking for str.format() calls on literals.\"\"\"\n assert isinstance(e.callee, MemberExpr)\n format_value = None\n if isinstance(e.callee.expr, (StrExpr, UnicodeExpr)):\n format_value = e.callee.expr.value\n elif e.callee.expr in self.chk.type_map:\n base_typ = try_getting_literal(self.chk.type_map[e.callee.expr])\n if isinstance(base_typ, LiteralType) and isinstance(base_typ.value, str):\n format_value = base_typ.value\n if format_value is not None:\n self.strfrm_checker.check_str_format_call(e, format_value)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.method_fullname_ExpressionChecker.method_fullname.if_type_name_is_not_None_.else_.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.method_fullname_ExpressionChecker.method_fullname.if_type_name_is_not_None_.else_.return.None", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 381, "end_line": 407, "span_ids": ["ExpressionChecker.method_fullname"], "tokens": 297}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def method_fullname(self, object_type: Type, method_name: str) -> Optional[str]:\n \"\"\"Convert a method name to a fully qualified name, based on the type of the object that\n it is invoked on. Return `None` if the name of `object_type` cannot be determined.\n \"\"\"\n object_type = get_proper_type(object_type)\n\n if isinstance(object_type, CallableType) and object_type.is_type_obj():\n # For class method calls, object_type is a callable representing the class object.\n # We \"unwrap\" it to a regular type, as the class/instance method difference doesn't\n # affect the fully qualified name.\n object_type = get_proper_type(object_type.ret_type)\n elif isinstance(object_type, TypeType):\n object_type = object_type.item\n\n type_name = None\n if isinstance(object_type, Instance):\n type_name = object_type.type.fullname\n elif isinstance(object_type, (TypedDictType, LiteralType)):\n info = object_type.fallback.type.get_containing_type_info(method_name)\n type_name = info.fullname if info is not None else None\n elif isinstance(object_type, TupleType):\n type_name = tuple_fallback(object_type).type.fullname\n\n if type_name is not None:\n return '{}.{}'.format(type_name, method_name)\n else:\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.always_returns_none_ExpressionChecker.always_returns_none.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.always_returns_none_ExpressionChecker.always_returns_none.return.False", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 409, "end_line": 429, "span_ids": ["ExpressionChecker.always_returns_none"], "tokens": 193}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def always_returns_none(self, node: Expression) -> bool:\n \"\"\"Check if `node` refers to something explicitly annotated as only returning None.\"\"\"\n if isinstance(node, RefExpr):\n if self.defn_returns_none(node.node):\n return True\n if isinstance(node, MemberExpr) and node.node is None: # instance or class attribute\n typ = get_proper_type(self.chk.type_map.get(node.expr))\n if isinstance(typ, Instance):\n info = typ.type\n elif isinstance(typ, CallableType) and typ.is_type_obj():\n ret_type = get_proper_type(typ.ret_type)\n if isinstance(ret_type, Instance):\n info = ret_type.type\n else:\n return False\n else:\n return False\n sym = info.get(node.name)\n if sym and self.defn_returns_none(sym.node):\n return True\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.defn_returns_none_ExpressionChecker.defn_returns_none.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.defn_returns_none_ExpressionChecker.defn_returns_none.return.False", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 431, "end_line": 447, "span_ids": ["ExpressionChecker.defn_returns_none"], "tokens": 199}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def defn_returns_none(self, defn: Optional[SymbolNode]) -> bool:\n \"\"\"Check if `defn` can _only_ return None.\"\"\"\n if isinstance(defn, FuncDef):\n return (isinstance(defn.type, CallableType) and\n isinstance(get_proper_type(defn.type.ret_type), NoneType))\n if isinstance(defn, OverloadedFuncDef):\n return all(self.defn_returns_none(item) for item in defn.items)\n if isinstance(defn, Var):\n typ = get_proper_type(defn.type)\n if (not defn.is_inferred and isinstance(typ, CallableType) and\n isinstance(get_proper_type(typ.ret_type), NoneType)):\n return True\n if isinstance(typ, Instance):\n sym = typ.type.get('__call__')\n if sym and self.defn_returns_none(sym.node):\n return True\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_runtime_protocol_test_ExpressionChecker.check_protocol_issubclass.for_expr_in_mypy_checker_.if_isinstance_tp_Callab.if_attr_members_.self_chk_msg_report_non_m": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_runtime_protocol_test_ExpressionChecker.check_protocol_issubclass.for_expr_in_mypy_checker_.if_isinstance_tp_Callab.if_attr_members_.self_chk_msg_report_non_m", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 449, "end_line": 465, "span_ids": ["ExpressionChecker.check_runtime_protocol_test", "ExpressionChecker.check_protocol_issubclass"], "tokens": 210}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def check_runtime_protocol_test(self, e: CallExpr) -> None:\n for expr in mypy.checker.flatten(e.args[1]):\n tp = get_proper_type(self.chk.type_map[expr])\n if (isinstance(tp, CallableType) and tp.is_type_obj() and\n tp.type_object().is_protocol and\n not tp.type_object().runtime_protocol):\n self.chk.fail(message_registry.RUNTIME_PROTOCOL_EXPECTED, e)\n\n def check_protocol_issubclass(self, e: CallExpr) -> None:\n for expr in mypy.checker.flatten(e.args[1]):\n tp = get_proper_type(self.chk.type_map[expr])\n if (isinstance(tp, CallableType) and tp.is_type_obj() and\n tp.type_object().is_protocol):\n attr_members = non_method_protocol_members(tp.type_object())\n if attr_members:\n self.chk.msg.report_non_method_protocol(tp.type_object(),\n attr_members, e)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_typeddict_call_ExpressionChecker.check_typeddict_call.return.AnyType_TypeOfAny_from_er": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_typeddict_call_ExpressionChecker.check_typeddict_call.return.AnyType_TypeOfAny_from_er", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 467, "end_line": 495, "span_ids": ["ExpressionChecker.check_typeddict_call"], "tokens": 333}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def check_typeddict_call(self, callee: TypedDictType,\n arg_kinds: List[int],\n arg_names: Sequence[Optional[str]],\n args: List[Expression],\n context: Context) -> Type:\n if len(args) >= 1 and all([ak == ARG_NAMED for ak in arg_kinds]):\n # ex: Point(x=42, y=1337)\n assert all(arg_name is not None for arg_name in arg_names)\n item_names = cast(List[str], arg_names)\n item_args = args\n return self.check_typeddict_call_with_kwargs(\n callee, OrderedDict(zip(item_names, item_args)), context)\n\n if len(args) == 1 and arg_kinds[0] == ARG_POS:\n unique_arg = args[0]\n if isinstance(unique_arg, DictExpr):\n # ex: Point({'x': 42, 'y': 1337})\n return self.check_typeddict_call_with_dict(callee, unique_arg, context)\n if isinstance(unique_arg, CallExpr) and isinstance(unique_arg.analyzed, DictExpr):\n # ex: Point(dict(x=42, y=1337))\n return self.check_typeddict_call_with_dict(callee, unique_arg.analyzed, context)\n\n if len(args) == 0:\n # ex: EmptyDict()\n return self.check_typeddict_call_with_kwargs(\n callee, OrderedDict(), context)\n\n self.chk.fail(message_registry.INVALID_TYPEDDICT_ARGS, context)\n return AnyType(TypeOfAny.from_error)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.validate_typeddict_kwargs_ExpressionChecker.validate_typeddict_kwargs.return.OrderedDict_zip_item_name": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.validate_typeddict_kwargs_ExpressionChecker.validate_typeddict_kwargs.return.OrderedDict_zip_item_name", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 497, "end_line": 516, "span_ids": ["ExpressionChecker.validate_typeddict_kwargs"], "tokens": 194}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def validate_typeddict_kwargs(\n self, kwargs: DictExpr) -> 'Optional[OrderedDict[str, Expression]]':\n item_args = [item[1] for item in kwargs.items]\n\n item_names = [] # List[str]\n for item_name_expr, item_arg in kwargs.items:\n literal_value = None\n if item_name_expr:\n key_type = self.accept(item_name_expr)\n values = try_getting_str_literals(item_name_expr, key_type)\n if values and len(values) == 1:\n literal_value = values[0]\n if literal_value is None:\n key_context = item_name_expr or item_arg\n self.chk.fail(message_registry.TYPEDDICT_KEY_MUST_BE_STRING_LITERAL,\n key_context)\n return None\n else:\n item_names.append(literal_value)\n return OrderedDict(zip(item_names, item_args))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.match_typeddict_call_with_dict_ExpressionChecker.check_typeddict_call_with_dict.if_validated_kwargs_is_no.else_.return.AnyType_TypeOfAny_from_er": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.match_typeddict_call_with_dict_ExpressionChecker.check_typeddict_call_with_dict.if_validated_kwargs_is_no.else_.return.AnyType_TypeOfAny_from_er", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 518, "end_line": 538, "span_ids": ["ExpressionChecker.match_typeddict_call_with_dict", "ExpressionChecker.check_typeddict_call_with_dict"], "tokens": 180}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def match_typeddict_call_with_dict(self, callee: TypedDictType,\n kwargs: DictExpr,\n context: Context) -> bool:\n validated_kwargs = self.validate_typeddict_kwargs(kwargs=kwargs)\n if validated_kwargs is not None:\n return (callee.required_keys <= set(validated_kwargs.keys())\n <= set(callee.items.keys()))\n else:\n return False\n\n def check_typeddict_call_with_dict(self, callee: TypedDictType,\n kwargs: DictExpr,\n context: Context) -> Type:\n validated_kwargs = self.validate_typeddict_kwargs(kwargs=kwargs)\n if validated_kwargs is not None:\n return self.check_typeddict_call_with_kwargs(\n callee,\n kwargs=validated_kwargs,\n context=context)\n else:\n return AnyType(TypeOfAny.from_error)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_typeddict_call_with_kwargs_ExpressionChecker.check_typeddict_call_with_kwargs.return.callee": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_typeddict_call_with_kwargs_ExpressionChecker.check_typeddict_call_with_kwargs.return.callee", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 540, "end_line": 564, "span_ids": ["ExpressionChecker.check_typeddict_call_with_kwargs"], "tokens": 238}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def check_typeddict_call_with_kwargs(self, callee: TypedDictType,\n kwargs: 'OrderedDict[str, Expression]',\n context: Context) -> Type:\n if not (callee.required_keys <= set(kwargs.keys()) <= set(callee.items.keys())):\n expected_keys = [key for key in callee.items.keys()\n if key in callee.required_keys or key in kwargs.keys()]\n actual_keys = kwargs.keys()\n self.msg.unexpected_typeddict_keys(\n callee,\n expected_keys=expected_keys,\n actual_keys=list(actual_keys),\n context=context)\n return AnyType(TypeOfAny.from_error)\n\n for (item_name, item_expected_type) in callee.items.items():\n if item_name in kwargs:\n item_value = kwargs[item_name]\n self.chk.check_simple_assignment(\n lvalue_type=item_expected_type, rvalue=item_value, context=item_value,\n msg=message_registry.INCOMPATIBLE_TYPES,\n lvalue_name='TypedDict item \"{}\"'.format(item_name),\n rvalue_name='expression',\n code=codes.TYPEDDICT_ITEM)\n\n return callee", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.get_partial_self_var_ExpressionChecker.get_partial_self_var.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.get_partial_self_var_ExpressionChecker.get_partial_self_var.return.None", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 566, "end_line": 583, "span_ids": ["ExpressionChecker.get_partial_self_var"], "tokens": 179}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def get_partial_self_var(self, expr: MemberExpr) -> Optional[Var]:\n \"\"\"Get variable node for a partial self attribute.\n\n If the expression is not a self attribute, or attribute is not variable,\n or variable is not partial, return None.\n \"\"\"\n if not (isinstance(expr.expr, NameExpr) and\n isinstance(expr.expr.node, Var) and expr.expr.node.is_self):\n # Not a self.attr expression.\n return None\n info = self.chk.scope.enclosing_class()\n if not info or expr.name not in info.names:\n # Don't mess with partial types in superclasses.\n return None\n sym = info.names[expr.name]\n if isinstance(sym.node, Var) and isinstance(sym.node.type, PartialType):\n return sym.node\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker._Types_and_methods_that__ExpressionChecker.None_11": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker._Types_and_methods_that__ExpressionChecker.None_11", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 585, "end_line": 593, "span_ids": ["ExpressionChecker:13", "ExpressionChecker.get_partial_self_var"], "tokens": 147}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n # Types and methods that can be used to infer partial types.\n item_args = {'builtins.list': ['append'],\n 'builtins.set': ['add', 'discard'],\n } # type: ClassVar[Dict[str, List[str]]]\n container_args = {'builtins.list': {'extend': ['builtins.list']},\n 'builtins.dict': {'update': ['builtins.dict']},\n 'collections.OrderedDict': {'update': ['builtins.dict']},\n 'builtins.set': {'update': ['builtins.set', 'builtins.list']},\n } # type: ClassVar[Dict[str, Dict[str, List[str]]]]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.try_infer_partial_type_ExpressionChecker.get_partial_var.return.var_partial_types": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.try_infer_partial_type_ExpressionChecker.get_partial_var.return.var_partial_types", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 595, "end_line": 644, "span_ids": ["ExpressionChecker.try_infer_partial_type", "ExpressionChecker.get_partial_var"], "tokens": 485}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def try_infer_partial_type(self, e: CallExpr) -> None:\n \"\"\"Try to make partial type precise from a call.\"\"\"\n if not isinstance(e.callee, MemberExpr):\n return\n callee = e.callee\n if isinstance(callee.expr, RefExpr):\n # Call a method with a RefExpr callee, such as 'x.method(...)'.\n ret = self.get_partial_var(callee.expr)\n if ret is None:\n return\n var, partial_types = ret\n typ = self.try_infer_partial_value_type_from_call(e, callee.name, var)\n if typ is not None:\n var.type = typ\n del partial_types[var]\n elif isinstance(callee.expr, IndexExpr) and isinstance(callee.expr.base, RefExpr):\n # Call 'x[y].method(...)'; may infer type of 'x' if it's a partial defaultdict.\n if callee.expr.analyzed is not None:\n return # A special form\n base = callee.expr.base\n index = callee.expr.index\n ret = self.get_partial_var(base)\n if ret is None:\n return\n var, partial_types = ret\n partial_type = get_partial_instance_type(var.type)\n if partial_type is None or partial_type.value_type is None:\n return\n value_type = self.try_infer_partial_value_type_from_call(e, callee.name, var)\n if value_type is not None:\n # Infer key type.\n key_type = self.accept(index)\n if mypy.checker.is_valid_inferred_type(key_type):\n # Store inferred partial type.\n assert partial_type.type is not None\n typename = partial_type.type.fullname\n var.type = self.chk.named_generic_type(typename,\n [key_type, value_type])\n del partial_types[var]\n\n def get_partial_var(self, ref: RefExpr) -> Optional[Tuple[Var, Dict[Var, Context]]]:\n var = ref.node\n if var is None and isinstance(ref, MemberExpr):\n var = self.get_partial_self_var(ref)\n if not isinstance(var, Var):\n return None\n partial_types = self.chk.find_partial_types(var)\n if partial_types is None:\n return None\n return var, partial_types", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.try_infer_partial_value_type_from_call_ExpressionChecker.try_infer_partial_value_type_from_call.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.try_infer_partial_value_type_from_call_ExpressionChecker.try_infer_partial_value_type_from_call.return.None", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 646, "end_line": 683, "span_ids": ["ExpressionChecker.try_infer_partial_value_type_from_call"], "tokens": 378}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def try_infer_partial_value_type_from_call(\n self,\n e: CallExpr,\n methodname: str,\n var: Var) -> Optional[Instance]:\n \"\"\"Try to make partial type precise from a call such as 'x.append(y)'.\"\"\"\n if self.chk.current_node_deferred:\n return None\n partial_type = get_partial_instance_type(var.type)\n if partial_type is None:\n return None\n if partial_type.value_type:\n typename = partial_type.value_type.type.fullname\n else:\n assert partial_type.type is not None\n typename = partial_type.type.fullname\n # Sometimes we can infer a full type for a partial List, Dict or Set type.\n # TODO: Don't infer argument expression twice.\n if (typename in self.item_args and methodname in self.item_args[typename]\n and e.arg_kinds == [ARG_POS]):\n item_type = self.accept(e.args[0])\n if mypy.checker.is_valid_inferred_type(item_type):\n return self.chk.named_generic_type(typename, [item_type])\n elif (typename in self.container_args\n and methodname in self.container_args[typename]\n and e.arg_kinds == [ARG_POS]):\n arg_type = get_proper_type(self.accept(e.args[0]))\n if isinstance(arg_type, Instance):\n arg_typename = arg_type.type.fullname\n if arg_typename in self.container_args[typename][methodname]:\n if all(mypy.checker.is_valid_inferred_type(item_type)\n for item_type in arg_type.args):\n return self.chk.named_generic_type(typename,\n list(arg_type.args))\n elif isinstance(arg_type, AnyType):\n return self.chk.named_type(typename)\n\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.apply_function_plugin_ExpressionChecker.apply_function_plugin.if_object_type_is_None_.else_.return.method_callback_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.apply_function_plugin_ExpressionChecker.apply_function_plugin.if_object_type_is_None_.else_.return.method_callback_", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 685, "end_line": 735, "span_ids": ["ExpressionChecker.apply_function_plugin"], "tokens": 534}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def apply_function_plugin(self,\n callee: CallableType,\n arg_kinds: List[int],\n arg_types: List[Type],\n arg_names: Optional[Sequence[Optional[str]]],\n formal_to_actual: List[List[int]],\n args: List[Expression],\n fullname: str,\n object_type: Optional[Type],\n context: Context) -> Type:\n \"\"\"Use special case logic to infer the return type of a specific named function/method.\n\n Caller must ensure that a plugin hook exists. There are two different cases:\n\n - If object_type is None, the caller must ensure that a function hook exists\n for fullname.\n - If object_type is not None, the caller must ensure that a method hook exists\n for fullname.\n\n Return the inferred return type.\n \"\"\"\n num_formals = len(callee.arg_types)\n formal_arg_types = [[] for _ in range(num_formals)] # type: List[List[Type]]\n formal_arg_exprs = [[] for _ in range(num_formals)] # type: List[List[Expression]]\n formal_arg_names = [[] for _ in range(num_formals)] # type: List[List[Optional[str]]]\n formal_arg_kinds = [[] for _ in range(num_formals)] # type: List[List[int]]\n for formal, actuals in enumerate(formal_to_actual):\n for actual in actuals:\n formal_arg_types[formal].append(arg_types[actual])\n formal_arg_exprs[formal].append(args[actual])\n if arg_names:\n formal_arg_names[formal].append(arg_names[actual])\n formal_arg_kinds[formal].append(arg_kinds[actual])\n\n if object_type is None:\n # Apply function plugin\n callback = self.plugin.get_function_hook(fullname)\n assert callback is not None # Assume that caller ensures this\n return callback(\n FunctionContext(formal_arg_types, formal_arg_kinds,\n callee.arg_names, formal_arg_names,\n callee.ret_type, formal_arg_exprs, context, self.chk))\n else:\n # Apply method plugin\n method_callback = self.plugin.get_method_hook(fullname)\n assert method_callback is not None # Assume that caller ensures this\n object_type = get_proper_type(object_type)\n return method_callback(\n MethodContext(object_type, formal_arg_types, formal_arg_kinds,\n callee.arg_names, formal_arg_names,\n callee.ret_type, formal_arg_exprs, context, self.chk))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.apply_signature_hook_ExpressionChecker.apply_signature_hook.if_isinstance_callee_Cal.else_.return.Overloaded_items_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.apply_signature_hook_ExpressionChecker.apply_signature_hook.if_isinstance_callee_Cal.else_.return.Overloaded_items_", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 737, "end_line": 765, "span_ids": ["ExpressionChecker.apply_signature_hook"], "tokens": 284}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def apply_signature_hook(\n self, callee: FunctionLike, args: List[Expression],\n arg_kinds: List[int],\n arg_names: Optional[Sequence[Optional[str]]],\n hook: Callable[\n [List[List[Expression]], CallableType],\n CallableType,\n ]) -> FunctionLike:\n \"\"\"Helper to apply a signature hook for either a function or method\"\"\"\n if isinstance(callee, CallableType):\n num_formals = len(callee.arg_kinds)\n formal_to_actual = map_actuals_to_formals(\n arg_kinds, arg_names,\n callee.arg_kinds, callee.arg_names,\n lambda i: self.accept(args[i]))\n formal_arg_exprs = [[] for _ in range(num_formals)] # type: List[List[Expression]]\n for formal, actuals in enumerate(formal_to_actual):\n for actual in actuals:\n formal_arg_exprs[formal].append(args[actual])\n return hook(formal_arg_exprs, callee)\n else:\n assert isinstance(callee, Overloaded)\n items = []\n for item in callee.items():\n adjusted = self.apply_signature_hook(\n item, args, arg_kinds, arg_names, hook)\n assert isinstance(adjusted, CallableType)\n items.append(adjusted)\n return Overloaded(items)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.apply_function_signature_hook_ExpressionChecker.apply_function_signature_hook.return.self_apply_signature_hook": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.apply_function_signature_hook_ExpressionChecker.apply_function_signature_hook.return.self_apply_signature_hook", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 767, "end_line": 776, "span_ids": ["ExpressionChecker.apply_function_signature_hook"], "tokens": 129}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def apply_function_signature_hook(\n self, callee: FunctionLike, args: List[Expression],\n arg_kinds: List[int], context: Context,\n arg_names: Optional[Sequence[Optional[str]]],\n signature_hook: Callable[[FunctionSigContext], CallableType]) -> FunctionLike:\n \"\"\"Apply a plugin hook that may infer a more precise signature for a function.\"\"\"\n return self.apply_signature_hook(\n callee, args, arg_kinds, arg_names,\n (lambda args, sig:\n signature_hook(FunctionSigContext(args, sig, context, self.chk))))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.apply_method_signature_hook_ExpressionChecker.apply_method_signature_hook.return.self_apply_signature_hook": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.apply_method_signature_hook_ExpressionChecker.apply_method_signature_hook.return.self_apply_signature_hook", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 778, "end_line": 788, "span_ids": ["ExpressionChecker.apply_method_signature_hook"], "tokens": 150}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def apply_method_signature_hook(\n self, callee: FunctionLike, args: List[Expression],\n arg_kinds: List[int], context: Context,\n arg_names: Optional[Sequence[Optional[str]]], object_type: Type,\n signature_hook: Callable[[MethodSigContext], CallableType]) -> FunctionLike:\n \"\"\"Apply a plugin hook that may infer a more precise signature for a method.\"\"\"\n pobject_type = get_proper_type(object_type)\n return self.apply_signature_hook(\n callee, args, arg_kinds, arg_names,\n (lambda args, sig:\n signature_hook(MethodSigContext(pobject_type, args, sig, context, self.chk))))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.transform_callee_type_ExpressionChecker.transform_callee_type.return.callee": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.transform_callee_type_ExpressionChecker.transform_callee_type.return.callee", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 790, "end_line": 822, "span_ids": ["ExpressionChecker.transform_callee_type"], "tokens": 375}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def transform_callee_type(\n self, callable_name: Optional[str], callee: Type, args: List[Expression],\n arg_kinds: List[int], context: Context,\n arg_names: Optional[Sequence[Optional[str]]] = None,\n object_type: Optional[Type] = None) -> Type:\n \"\"\"Attempt to determine a more accurate signature for a method call.\n\n This is done by looking up and applying a method signature hook (if one exists for the\n given method name).\n\n If no matching method signature hook is found, callee is returned unmodified. The same\n happens if the arguments refer to a non-method callable (this is allowed so that the code\n calling transform_callee_type needs to perform fewer boilerplate checks).\n\n Note: this method is *not* called automatically as part of check_call, because in some\n cases check_call is called multiple times while checking a single call (for example when\n dealing with overloads). Instead, this method needs to be called explicitly\n (if appropriate) before the signature is passed to check_call.\n \"\"\"\n callee = get_proper_type(callee)\n if callable_name is not None and isinstance(callee, FunctionLike):\n if object_type is not None:\n method_sig_hook = self.plugin.get_method_signature_hook(callable_name)\n if method_sig_hook:\n return self.apply_method_signature_hook(\n callee, args, arg_kinds, context, arg_names, object_type, method_sig_hook)\n else:\n function_sig_hook = self.plugin.get_function_signature_hook(callable_name)\n if function_sig_hook:\n return self.apply_function_signature_hook(\n callee, args, arg_kinds, context, arg_names, function_sig_hook)\n\n return callee", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_call_expr_with_callee_type_ExpressionChecker.check_call_expr_with_callee_type.return.self_check_call_callee_ty": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_call_expr_with_callee_type_ExpressionChecker.check_call_expr_with_callee_type.return.self_check_call_callee_ty", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 824, "end_line": 855, "span_ids": ["ExpressionChecker.check_call_expr_with_callee_type"], "tokens": 381}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def check_call_expr_with_callee_type(self,\n callee_type: Type,\n e: CallExpr,\n callable_name: Optional[str],\n object_type: Optional[Type],\n member: Optional[str] = None) -> Type:\n \"\"\"Type check call expression.\n\n The callee_type should be used as the type of callee expression. In particular,\n in case of a union type this can be a particular item of the union, so that we can\n apply plugin hooks to each item.\n\n The 'member', 'callable_name' and 'object_type' are only used to call plugin hooks.\n If 'callable_name' is None but 'member' is not None (member call), try constructing\n 'callable_name' using 'object_type' (the base type on which the method is called),\n for example 'typing.Mapping.get'.\n \"\"\"\n if callable_name is None and member is not None:\n assert object_type is not None\n callable_name = self.method_fullname(object_type, member)\n object_type = get_proper_type(object_type)\n if callable_name:\n # Try to refine the call signature using plugin hooks before checking the call.\n callee_type = self.transform_callee_type(\n callable_name, callee_type, e.args, e.arg_kinds, e, e.arg_names, object_type)\n # Unions are special-cased to allow plugins to act on each item in the union.\n elif member is not None and isinstance(object_type, UnionType):\n return self.check_union_call_expr(e, object_type, member)\n return self.check_call(callee_type, e.args, e.arg_kinds, e,\n e.arg_names, callable_node=e.callee,\n callable_name=callable_name,\n object_type=object_type)[0]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_union_call_expr_ExpressionChecker.check_union_call_expr.return.make_simplified_union_res": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_union_call_expr_ExpressionChecker.check_union_call_expr.return.make_simplified_union_res", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 857, "end_line": 875, "span_ids": ["ExpressionChecker.check_union_call_expr"], "tokens": 235}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def check_union_call_expr(self, e: CallExpr, object_type: UnionType, member: str) -> Type:\n \"\"\"\"Type check calling a member expression where the base type is a union.\"\"\"\n res = [] # type: List[Type]\n for typ in object_type.relevant_items():\n # Member access errors are already reported when visiting the member expression.\n self.msg.disable_errors()\n item = analyze_member_access(member, typ, e, False, False, False,\n self.msg, original_type=object_type, chk=self.chk,\n in_literal_context=self.is_literal_context(),\n self_type=typ)\n self.msg.enable_errors()\n narrowed = self.narrow_type_from_binder(e.callee, item, skip_non_overlapping=True)\n if narrowed is None:\n continue\n callable_name = self.method_fullname(typ, member)\n item_object_type = typ if callable_name else None\n res.append(self.check_call_expr_with_callee_type(narrowed, e, callable_name,\n item_object_type))\n return make_simplified_union(res)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_call_ExpressionChecker.check_call.callee.get_proper_type_callee_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_call_ExpressionChecker.check_call.callee.get_proper_type_callee_", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 877, "end_line": 908, "span_ids": ["ExpressionChecker.check_call"], "tokens": 305}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def check_call(self,\n callee: Type,\n args: List[Expression],\n arg_kinds: List[int],\n context: Context,\n arg_names: Optional[Sequence[Optional[str]]] = None,\n callable_node: Optional[Expression] = None,\n arg_messages: Optional[MessageBuilder] = None,\n callable_name: Optional[str] = None,\n object_type: Optional[Type] = None) -> Tuple[Type, Type]:\n \"\"\"Type check a call.\n\n Also infer type arguments if the callee is a generic function.\n\n Return (result type, inferred callee type).\n\n Arguments:\n callee: type of the called value\n args: actual argument expressions\n arg_kinds: contains nodes.ARG_* constant for each argument in args\n describing whether the argument is positional, *arg, etc.\n arg_names: names of arguments (optional)\n callable_node: associate the inferred callable type to this node,\n if specified\n arg_messages: TODO\n callable_name: Fully-qualified name of the function/method to call,\n or None if unavailable (examples: 'builtins.open', 'typing.Mapping.get')\n object_type: If callable_name refers to a method, the type of the object\n on which the method is being called\n \"\"\"\n arg_messages = arg_messages or self.msg\n callee = get_proper_type(callee)\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_call.if_isinstance_callee_Cal_ExpressionChecker.check_call.if_isinstance_callee_Cal.else_.return.self_msg_not_callable_cal": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_call.if_isinstance_callee_Cal_ExpressionChecker.check_call.if_isinstance_callee_Cal.else_.return.self_msg_not_callable_cal", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 910, "end_line": 949, "span_ids": ["ExpressionChecker.check_call"], "tokens": 600}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def check_call(self,\n callee: Type,\n args: List[Expression],\n arg_kinds: List[int],\n context: Context,\n arg_names: Optional[Sequence[Optional[str]]] = None,\n callable_node: Optional[Expression] = None,\n arg_messages: Optional[MessageBuilder] = None,\n callable_name: Optional[str] = None,\n object_type: Optional[Type] = None) -> Tuple[Type, Type]:\n # ... other code\n\n if isinstance(callee, CallableType):\n return self.check_callable_call(callee, args, arg_kinds, context, arg_names,\n callable_node, arg_messages, callable_name,\n object_type)\n elif isinstance(callee, Overloaded):\n return self.check_overload_call(callee, args, arg_kinds, arg_names, callable_name,\n object_type, context, arg_messages)\n elif isinstance(callee, AnyType) or not self.chk.in_checked_function():\n return self.check_any_type_call(args, callee)\n elif isinstance(callee, UnionType):\n return self.check_union_call(callee, args, arg_kinds, arg_names, context, arg_messages)\n elif isinstance(callee, Instance):\n call_function = analyze_member_access('__call__', callee, context, is_lvalue=False,\n is_super=False, is_operator=True, msg=self.msg,\n original_type=callee, chk=self.chk,\n in_literal_context=self.is_literal_context())\n callable_name = callee.type.fullname + \".__call__\"\n # Apply method signature hook, if one exists\n call_function = self.transform_callee_type(\n callable_name, call_function, args, arg_kinds, context, arg_names, callee)\n result = self.check_call(call_function, args, arg_kinds, context, arg_names,\n callable_node, arg_messages, callable_name, callee)\n if callable_node:\n # check_call() stored \"call_function\" as the type, which is incorrect.\n # Override the type.\n self.chk.store_type(callable_node, callee)\n return result\n elif isinstance(callee, TypeVarType):\n return self.check_call(callee.upper_bound, args, arg_kinds, context, arg_names,\n callable_node, arg_messages)\n elif isinstance(callee, TypeType):\n item = self.analyze_type_type_callee(callee.item, context)\n return self.check_call(item, args, arg_kinds, context, arg_names,\n callable_node, arg_messages)\n elif isinstance(callee, TupleType):\n return self.check_call(tuple_fallback(callee), args, arg_kinds, context,\n arg_names, callable_node, arg_messages, callable_name,\n object_type)\n else:\n return self.msg.not_callable(callee, context), AnyType(TypeOfAny.from_error)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_callable_call_ExpressionChecker.check_callable_call.return.callee_ret_type_callee": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_callable_call_ExpressionChecker.check_callable_call.return.callee_ret_type_callee", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 957, "end_line": 1033, "span_ids": ["ExpressionChecker.check_callable_call"], "tokens": 729}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def check_callable_call(self,\n callee: CallableType,\n args: List[Expression],\n arg_kinds: List[int],\n context: Context,\n arg_names: Optional[Sequence[Optional[str]]],\n callable_node: Optional[Expression],\n arg_messages: MessageBuilder,\n callable_name: Optional[str],\n object_type: Optional[Type]) -> Tuple[Type, Type]:\n \"\"\"Type check a call that targets a callable value.\n\n See the docstring of check_call for more information.\n \"\"\"\n if callable_name is None and callee.name:\n callable_name = callee.name\n ret_type = get_proper_type(callee.ret_type)\n if callee.is_type_obj() and isinstance(ret_type, Instance):\n callable_name = ret_type.type.fullname\n if (isinstance(callable_node, RefExpr)\n and callable_node.fullname in ('enum.Enum', 'enum.IntEnum',\n 'enum.Flag', 'enum.IntFlag')):\n # An Enum() call that failed SemanticAnalyzerPass2.check_enum_call().\n return callee.ret_type, callee\n\n if (callee.is_type_obj() and callee.type_object().is_abstract\n # Exception for Type[...]\n and not callee.from_type_type\n and not callee.type_object().fallback_to_any):\n type = callee.type_object()\n self.msg.cannot_instantiate_abstract_class(\n callee.type_object().name, type.abstract_attributes,\n context)\n elif (callee.is_type_obj() and callee.type_object().is_protocol\n # Exception for Type[...]\n and not callee.from_type_type):\n self.chk.fail(message_registry.CANNOT_INSTANTIATE_PROTOCOL\n .format(callee.type_object().name), context)\n\n formal_to_actual = map_actuals_to_formals(\n arg_kinds, arg_names,\n callee.arg_kinds, callee.arg_names,\n lambda i: self.accept(args[i]))\n\n if callee.is_generic():\n callee = freshen_function_type_vars(callee)\n callee = self.infer_function_type_arguments_using_context(\n callee, context)\n callee = self.infer_function_type_arguments(\n callee, args, arg_kinds, formal_to_actual, context)\n\n arg_types = self.infer_arg_types_in_context(\n callee, args, arg_kinds, formal_to_actual)\n\n self.check_argument_count(callee, arg_types, arg_kinds,\n arg_names, formal_to_actual, context, self.msg)\n\n self.check_argument_types(arg_types, arg_kinds, args, callee, formal_to_actual, context,\n messages=arg_messages, object_type=object_type)\n\n if (callee.is_type_obj() and (len(arg_types) == 1)\n and is_equivalent(callee.ret_type, self.named_type('builtins.type'))):\n callee = callee.copy_modified(ret_type=TypeType.make_normalized(arg_types[0]))\n\n if callable_node:\n # Store the inferred callable type.\n self.chk.store_type(callable_node, callee)\n\n if (callable_name\n and ((object_type is None and self.plugin.get_function_hook(callable_name))\n or (object_type is not None\n and self.plugin.get_method_hook(callable_name)))):\n new_ret_type = self.apply_function_plugin(\n callee, arg_kinds, arg_types, arg_names, formal_to_actual, args,\n callable_name, object_type, context)\n callee = callee.copy_modified(ret_type=new_ret_type)\n return callee.ret_type, callee", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.analyze_type_type_callee_ExpressionChecker.analyze_type_type_callee.return.AnyType_TypeOfAny_from_er": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.analyze_type_type_callee_ExpressionChecker.analyze_type_type_callee.return.AnyType_TypeOfAny_from_er", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1029, "end_line": 1068, "span_ids": ["ExpressionChecker.analyze_type_type_callee"], "tokens": 450}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def analyze_type_type_callee(self, item: ProperType, context: Context) -> Type:\n \"\"\"Analyze the callee X in X(...) where X is Type[item].\n\n Return a Y that we can pass to check_call(Y, ...).\n \"\"\"\n if isinstance(item, AnyType):\n return AnyType(TypeOfAny.from_another_any, source_any=item)\n if isinstance(item, Instance):\n res = type_object_type(item.type, self.named_type)\n if isinstance(res, CallableType):\n res = res.copy_modified(from_type_type=True)\n expanded = get_proper_type(expand_type_by_instance(res, item))\n if isinstance(expanded, CallableType):\n # Callee of the form Type[...] should never be generic, only\n # proper class objects can be.\n expanded = expanded.copy_modified(variables=[])\n return expanded\n if isinstance(item, UnionType):\n return UnionType([self.analyze_type_type_callee(get_proper_type(tp), context)\n for tp in item.relevant_items()], item.line)\n if isinstance(item, TypeVarType):\n # Pretend we're calling the typevar's upper bound,\n # i.e. its constructor (a poor approximation for reality,\n # but better than AnyType...), but replace the return type\n # with typevar.\n callee = self.analyze_type_type_callee(get_proper_type(item.upper_bound), context)\n callee = get_proper_type(callee)\n if isinstance(callee, CallableType):\n callee = callee.copy_modified(ret_type=item)\n elif isinstance(callee, Overloaded):\n callee = Overloaded([c.copy_modified(ret_type=item)\n for c in callee.items()])\n return callee\n # We support Type of namedtuples but not of tuples in general\n if (isinstance(item, TupleType)\n and tuple_fallback(item).type.fullname != 'builtins.tuple'):\n return self.analyze_type_type_callee(tuple_fallback(item), context)\n\n self.msg.unsupported_type_type(item, context)\n return AnyType(TypeOfAny.from_error)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.infer_arg_types_in_empty_context_ExpressionChecker.infer_arg_types_in_context.return.cast_List_Type_res_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.infer_arg_types_in_empty_context_ExpressionChecker.infer_arg_types_in_context.return.cast_List_Type_res_", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1070, "end_line": 1108, "span_ids": ["ExpressionChecker.infer_arg_types_in_context", "ExpressionChecker.infer_arg_types_in_empty_context"], "tokens": 352}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def infer_arg_types_in_empty_context(self, args: List[Expression]) -> List[Type]:\n \"\"\"Infer argument expression types in an empty context.\n\n In short, we basically recurse on each argument without considering\n in what context the argument was called.\n \"\"\"\n res = [] # type: List[Type]\n\n for arg in args:\n arg_type = self.accept(arg)\n if has_erased_component(arg_type):\n res.append(NoneType())\n else:\n res.append(arg_type)\n return res\n\n def infer_arg_types_in_context(\n self, callee: CallableType, args: List[Expression], arg_kinds: List[int],\n formal_to_actual: List[List[int]]) -> List[Type]:\n \"\"\"Infer argument expression types using a callable type as context.\n\n For example, if callee argument 2 has type List[int], infer the\n argument expression with List[int] type context.\n\n Returns the inferred types of *actual arguments*.\n \"\"\"\n res = [None] * len(args) # type: List[Optional[Type]]\n\n for i, actuals in enumerate(formal_to_actual):\n for ai in actuals:\n if arg_kinds[ai] not in (nodes.ARG_STAR, nodes.ARG_STAR2):\n res[ai] = self.accept(args[ai], callee.arg_types[i])\n\n # Fill in the rest of the argument types.\n for i, t in enumerate(res):\n if not t:\n res[i] = self.accept(args[i])\n assert all(tp is not None for tp in res)\n return cast(List[Type], res)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.infer_function_type_arguments_using_context_ExpressionChecker.infer_function_type_arguments_using_context.args.infer_type_arguments_call": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.infer_function_type_arguments_using_context_ExpressionChecker.infer_function_type_arguments_using_context.args.infer_type_arguments_call", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1110, "end_line": 1171, "span_ids": ["ExpressionChecker.infer_function_type_arguments_using_context"], "tokens": 788}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def infer_function_type_arguments_using_context(\n self, callable: CallableType, error_context: Context) -> CallableType:\n \"\"\"Unify callable return type to type context to infer type vars.\n\n For example, if the return type is set[t] where 't' is a type variable\n of callable, and if the context is set[int], return callable modified\n by substituting 't' with 'int'.\n \"\"\"\n ctx = self.type_context[-1]\n if not ctx:\n return callable\n # The return type may have references to type metavariables that\n # we are inferring right now. We must consider them as indeterminate\n # and they are not potential results; thus we replace them with the\n # special ErasedType type. On the other hand, class type variables are\n # valid results.\n erased_ctx = replace_meta_vars(ctx, ErasedType())\n ret_type = callable.ret_type\n if is_optional(ret_type) and is_optional(ctx):\n # If both the context and the return type are optional, unwrap the optional,\n # since in 99% cases this is what a user expects. In other words, we replace\n # Optional[T] <: Optional[int]\n # with\n # T <: int\n # while the former would infer T <: Optional[int].\n ret_type = remove_optional(ret_type)\n erased_ctx = remove_optional(erased_ctx)\n #\n # TODO: Instead of this hack and the one below, we need to use outer and\n # inner contexts at the same time. This is however not easy because of two\n # reasons:\n # * We need to support constraints like [1 <: 2, 2 <: X], i.e. with variables\n # on both sides. (This is not too hard.)\n # * We need to update all the inference \"infrastructure\", so that all\n # variables in an expression are inferred at the same time.\n # (And this is hard, also we need to be careful with lambdas that require\n # two passes.)\n if isinstance(ret_type, TypeVarType):\n # Another special case: the return type is a type variable. If it's unrestricted,\n # we could infer a too general type for the type variable if we use context,\n # and this could result in confusing and spurious type errors elsewhere.\n #\n # So we give up and just use function arguments for type inference, with just two\n # exceptions:\n #\n # 1. If the context is a generic instance type, actually use it as context, as\n # this *seems* to usually be the reasonable thing to do.\n #\n # See also github issues #462 and #360.\n #\n # 2. If the context is some literal type, we want to \"propagate\" that information\n # down so that we infer a more precise type for literal expressions. For example,\n # the expression `3` normally has an inferred type of `builtins.int`: but if it's\n # in a literal context like below, we want it to infer `Literal[3]` instead.\n #\n # def expects_literal(x: Literal[3]) -> None: pass\n # def identity(x: T) -> T: return x\n #\n # expects_literal(identity(3)) # Should type-check\n if not is_generic_instance(ctx) and not is_literal_type_like(ctx):\n return callable.copy_modified()\n args = infer_type_arguments(callable.type_var_ids(), ret_type, erased_ctx)\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.infer_function_type_arguments_using_context._Only_substitute_non_Uni_ExpressionChecker.infer_function_type_arguments_using_context.return.self_apply_generic_argume": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.infer_function_type_arguments_using_context._Only_substitute_non_Uni_ExpressionChecker.infer_function_type_arguments_using_context.return.self_apply_generic_argume", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1172, "end_line": 1182, "span_ids": ["ExpressionChecker.infer_function_type_arguments_using_context"], "tokens": 155}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def infer_function_type_arguments_using_context(\n self, callable: CallableType, error_context: Context) -> CallableType:\n # Only substitute non-Uninhabited and non-erased types.\n new_args = [] # type: List[Optional[Type]]\n for arg in args:\n if has_uninhabited_component(arg) or has_erased_component(arg):\n new_args.append(None)\n else:\n new_args.append(arg)\n # Don't show errors after we have only used the outer context for inference.\n # We will use argument context to infer more variables.\n return self.apply_generic_arguments(callable, new_args, error_context,\n skip_unsatisfied=True)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.infer_function_type_arguments_ExpressionChecker.infer_function_type_arguments.return.self_apply_inferred_argum": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.infer_function_type_arguments_ExpressionChecker.infer_function_type_arguments.return.self_apply_inferred_argum", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1184, "end_line": 1247, "span_ids": ["ExpressionChecker.infer_function_type_arguments"], "tokens": 647}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def infer_function_type_arguments(self, callee_type: CallableType,\n args: List[Expression],\n arg_kinds: List[int],\n formal_to_actual: List[List[int]],\n context: Context) -> CallableType:\n \"\"\"Infer the type arguments for a generic callee type.\n\n Infer based on the types of arguments.\n\n Return a derived callable type that has the arguments applied.\n \"\"\"\n if self.chk.in_checked_function():\n # Disable type errors during type inference. There may be errors\n # due to partial available context information at this time, but\n # these errors can be safely ignored as the arguments will be\n # inferred again later.\n self.msg.disable_errors()\n\n arg_types = self.infer_arg_types_in_context(\n callee_type, args, arg_kinds, formal_to_actual)\n\n self.msg.enable_errors()\n\n arg_pass_nums = self.get_arg_infer_passes(\n callee_type.arg_types, formal_to_actual, len(args))\n\n pass1_args = [] # type: List[Optional[Type]]\n for i, arg in enumerate(arg_types):\n if arg_pass_nums[i] > 1:\n pass1_args.append(None)\n else:\n pass1_args.append(arg)\n\n inferred_args = infer_function_type_arguments(\n callee_type, pass1_args, arg_kinds, formal_to_actual,\n strict=self.chk.in_checked_function())\n\n if 2 in arg_pass_nums:\n # Second pass of type inference.\n (callee_type,\n inferred_args) = self.infer_function_type_arguments_pass2(\n callee_type, args, arg_kinds, formal_to_actual,\n inferred_args, context)\n\n if callee_type.special_sig == 'dict' and len(inferred_args) == 2 and (\n ARG_NAMED in arg_kinds or ARG_STAR2 in arg_kinds):\n # HACK: Infer str key type for dict(...) with keyword args. The type system\n # can't represent this so we special case it, as this is a pretty common\n # thing. This doesn't quite work with all possible subclasses of dict\n # if they shuffle type variables around, as we assume that there is a 1-1\n # correspondence with dict type variables. This is a marginal issue and\n # a little tricky to fix so it's left unfixed for now.\n first_arg = get_proper_type(inferred_args[0])\n if isinstance(first_arg, (NoneType, UninhabitedType)):\n inferred_args[0] = self.named_type('builtins.str')\n elif not first_arg or not is_subtype(self.named_type('builtins.str'), first_arg):\n self.msg.fail(message_registry.KEYWORD_ARGUMENT_REQUIRES_STR_KEY_TYPE,\n context)\n else:\n # In dynamically typed functions use implicit 'Any' types for\n # type variables.\n inferred_args = [AnyType(TypeOfAny.unannotated)] * len(callee_type.variables)\n return self.apply_inferred_arguments(callee_type, inferred_args,\n context)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.infer_function_type_arguments_pass2_ExpressionChecker.infer_function_type_arguments_pass2.return.callee_type_inferred_arg": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.infer_function_type_arguments_pass2_ExpressionChecker.infer_function_type_arguments_pass2.return.callee_type_inferred_arg", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1249, "end_line": 1282, "span_ids": ["ExpressionChecker.infer_function_type_arguments_pass2"], "tokens": 376}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def infer_function_type_arguments_pass2(\n self, callee_type: CallableType,\n args: List[Expression],\n arg_kinds: List[int],\n formal_to_actual: List[List[int]],\n old_inferred_args: Sequence[Optional[Type]],\n context: Context) -> Tuple[CallableType, List[Optional[Type]]]:\n \"\"\"Perform second pass of generic function type argument inference.\n\n The second pass is needed for arguments with types such as Callable[[T], S],\n where both T and S are type variables, when the actual argument is a\n lambda with inferred types. The idea is to infer the type variable T\n in the first pass (based on the types of other arguments). This lets\n us infer the argument and return type of the lambda expression and\n thus also the type variable S in this second pass.\n\n Return (the callee with type vars applied, inferred actual arg types).\n \"\"\"\n # None or erased types in inferred types mean that there was not enough\n # information to infer the argument. Replace them with None values so\n # that they are not applied yet below.\n inferred_args = list(old_inferred_args)\n for i, arg in enumerate(get_proper_types(inferred_args)):\n if isinstance(arg, (NoneType, UninhabitedType)) or has_erased_component(arg):\n inferred_args[i] = None\n callee_type = self.apply_generic_arguments(callee_type, inferred_args, context)\n\n arg_types = self.infer_arg_types_in_context(\n callee_type, args, arg_kinds, formal_to_actual)\n\n inferred_args = infer_function_type_arguments(\n callee_type, arg_types, arg_kinds, formal_to_actual)\n\n return callee_type, inferred_args", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.get_arg_infer_passes_ExpressionChecker.get_arg_infer_passes.return.res": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.get_arg_infer_passes_ExpressionChecker.get_arg_infer_passes.return.res", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1284, "end_line": 1300, "span_ids": ["ExpressionChecker.get_arg_infer_passes"], "tokens": 158}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def get_arg_infer_passes(self, arg_types: List[Type],\n formal_to_actual: List[List[int]],\n num_actuals: int) -> List[int]:\n \"\"\"Return pass numbers for args for two-pass argument type inference.\n\n For each actual, the pass number is either 1 (first pass) or 2 (second\n pass).\n\n Two-pass argument type inference primarily lets us infer types of\n lambdas more effectively.\n \"\"\"\n res = [1] * num_actuals\n for i, arg in enumerate(arg_types):\n if arg.accept(ArgInferSecondPassQuery()):\n for j in formal_to_actual[i]:\n res[j] = 2\n return res", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.apply_inferred_arguments_ExpressionChecker.apply_inferred_arguments.return.self_apply_generic_argume": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.apply_inferred_arguments_ExpressionChecker.apply_inferred_arguments.return.self_apply_generic_argume", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1302, "end_line": 1321, "span_ids": ["ExpressionChecker.apply_inferred_arguments"], "tokens": 241}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def apply_inferred_arguments(self, callee_type: CallableType,\n inferred_args: Sequence[Optional[Type]],\n context: Context) -> CallableType:\n \"\"\"Apply inferred values of type arguments to a generic function.\n\n Inferred_args contains the values of function type arguments.\n \"\"\"\n # Report error if some of the variables could not be solved. In that\n # case assume that all variables have type Any to avoid extra\n # bogus error messages.\n for i, inferred_type in enumerate(inferred_args):\n if not inferred_type or has_erased_component(inferred_type):\n # Could not infer a non-trivial type for a type variable.\n self.msg.could_not_infer_type_arguments(\n callee_type, i + 1, context)\n inferred_args = [AnyType(TypeOfAny.from_error)] * len(inferred_args)\n # Apply the inferred types to the function type. In this case the\n # return type must be CallableType, since we give the right number of type\n # arguments.\n return self.apply_generic_arguments(callee_type, inferred_args, context)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_argument_count_ExpressionChecker.check_argument_count.return.ok": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_argument_count_ExpressionChecker.check_argument_count.return.ok", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1323, "end_line": 1384, "span_ids": ["ExpressionChecker.check_argument_count"], "tokens": 649}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def check_argument_count(self,\n callee: CallableType,\n actual_types: List[Type],\n actual_kinds: List[int],\n actual_names: Optional[Sequence[Optional[str]]],\n formal_to_actual: List[List[int]],\n context: Optional[Context],\n messages: Optional[MessageBuilder]) -> bool:\n \"\"\"Check that there is a value for all required arguments to a function.\n\n Also check that there are no duplicate values for arguments. Report found errors\n using 'messages' if it's not None. If 'messages' is given, 'context' must also be given.\n\n Return False if there were any errors. Otherwise return True\n \"\"\"\n if messages:\n assert context, \"Internal error: messages given without context\"\n elif context is None:\n # Avoid \"is None\" checks\n context = TempNode(AnyType(TypeOfAny.special_form))\n\n # TODO(jukka): We could return as soon as we find an error if messages is None.\n\n # Collect list of all actual arguments matched to formal arguments.\n all_actuals = [] # type: List[int]\n for actuals in formal_to_actual:\n all_actuals.extend(actuals)\n\n ok, is_unexpected_arg_error = self.check_for_extra_actual_arguments(\n callee, actual_types, actual_kinds, actual_names, all_actuals, context, messages)\n\n # Check for too many or few values for formals.\n for i, kind in enumerate(callee.arg_kinds):\n if kind == nodes.ARG_POS and (not formal_to_actual[i] and\n not is_unexpected_arg_error):\n # No actual for a mandatory positional formal.\n if messages:\n messages.too_few_arguments(callee, context, actual_names)\n ok = False\n elif kind == nodes.ARG_NAMED and (not formal_to_actual[i] and\n not is_unexpected_arg_error):\n # No actual for a mandatory named formal\n if messages:\n argname = callee.arg_names[i] or \"?\"\n messages.missing_named_argument(callee, context, argname)\n ok = False\n elif kind in [nodes.ARG_POS, nodes.ARG_OPT,\n nodes.ARG_NAMED, nodes.ARG_NAMED_OPT] and is_duplicate_mapping(\n formal_to_actual[i], actual_types, actual_kinds):\n if (self.chk.in_checked_function() or\n isinstance(get_proper_type(actual_types[formal_to_actual[i][0]]),\n TupleType)):\n if messages:\n messages.duplicate_argument_value(callee, i, context)\n ok = False\n elif (kind in (nodes.ARG_NAMED, nodes.ARG_NAMED_OPT) and formal_to_actual[i] and\n actual_kinds[formal_to_actual[i][0]] not in [nodes.ARG_NAMED, nodes.ARG_STAR2]):\n # Positional argument when expecting a keyword argument.\n if messages:\n messages.too_many_positional_arguments(callee, context)\n ok = False\n return ok", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_for_extra_actual_arguments_ExpressionChecker.check_for_extra_actual_arguments.return.ok_is_unexpected_arg_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_for_extra_actual_arguments_ExpressionChecker.check_for_extra_actual_arguments.return.ok_is_unexpected_arg_err", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1386, "end_line": 1440, "span_ids": ["ExpressionChecker.check_for_extra_actual_arguments"], "tokens": 525}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def check_for_extra_actual_arguments(self,\n callee: CallableType,\n actual_types: List[Type],\n actual_kinds: List[int],\n actual_names: Optional[Sequence[Optional[str]]],\n all_actuals: List[int],\n context: Context,\n messages: Optional[MessageBuilder]) -> Tuple[bool, bool]:\n \"\"\"Check for extra actual arguments.\n\n Return tuple (was everything ok,\n was there an extra keyword argument error [used to avoid duplicate errors]).\n \"\"\"\n\n is_unexpected_arg_error = False # Keep track of errors to avoid duplicate errors\n ok = True # False if we've found any error\n\n for i, kind in enumerate(actual_kinds):\n if i not in all_actuals and (\n kind != nodes.ARG_STAR or\n # We accept the other iterables than tuple (including Any)\n # as star arguments because they could be empty, resulting no arguments.\n is_non_empty_tuple(actual_types[i])):\n # Extra actual: not matched by a formal argument.\n ok = False\n if kind != nodes.ARG_NAMED:\n if messages:\n messages.too_many_arguments(callee, context)\n else:\n if messages:\n assert actual_names, \"Internal error: named kinds without names given\"\n act_name = actual_names[i]\n assert act_name is not None\n act_type = actual_types[i]\n messages.unexpected_keyword_argument(callee, act_name, act_type, context)\n is_unexpected_arg_error = True\n elif ((kind == nodes.ARG_STAR and nodes.ARG_STAR not in callee.arg_kinds)\n or kind == nodes.ARG_STAR2):\n actual_type = get_proper_type(actual_types[i])\n if isinstance(actual_type, (TupleType, TypedDictType)):\n if all_actuals.count(i) < len(actual_type.items):\n # Too many tuple/dict items as some did not match.\n if messages:\n if (kind != nodes.ARG_STAR2\n or not isinstance(actual_type, TypedDictType)):\n messages.too_many_arguments(callee, context)\n else:\n messages.too_many_arguments_from_typed_dict(callee, actual_type,\n context)\n is_unexpected_arg_error = True\n ok = False\n # *args/**kwargs can be applied even if the function takes a fixed\n # number of positional arguments. This may succeed at runtime.\n\n return ok, is_unexpected_arg_error", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_argument_types_ExpressionChecker.check_argument_types.for_i_actuals_in_enumera.for_actual_in_actuals_.check_arg_expanded_actual": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_argument_types_ExpressionChecker.check_argument_types.for_i_actuals_in_enumera.for_actual_in_actuals_.check_arg_expanded_actual", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1448, "end_line": 1487, "span_ids": ["ExpressionChecker.check_argument_types"], "tokens": 401}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def check_argument_types(self,\n arg_types: List[Type],\n arg_kinds: List[int],\n args: List[Expression],\n callee: CallableType,\n formal_to_actual: List[List[int]],\n context: Context,\n messages: Optional[MessageBuilder] = None,\n check_arg: Optional[ArgChecker] = None,\n object_type: Optional[Type] = None) -> None:\n \"\"\"Check argument types against a callable type.\n\n Report errors if the argument types are not compatible.\n\n The check_call docstring describes some of the arguments.\n \"\"\"\n messages = messages or self.msg\n check_arg = check_arg or self.check_arg\n # Keep track of consumed tuple *arg items.\n mapper = ArgTypeExpander()\n for i, actuals in enumerate(formal_to_actual):\n for actual in actuals:\n actual_type = arg_types[actual]\n if actual_type is None:\n continue # Some kind of error was already reported.\n actual_kind = arg_kinds[actual]\n # Check that a *arg is valid as varargs.\n if (actual_kind == nodes.ARG_STAR and\n not self.is_valid_var_arg(actual_type)):\n messages.invalid_var_arg(actual_type, context)\n if (actual_kind == nodes.ARG_STAR2 and\n not self.is_valid_keyword_var_arg(actual_type)):\n is_mapping = is_subtype(actual_type, self.chk.named_type('typing.Mapping'))\n messages.invalid_keyword_var_arg(actual_type, is_mapping, context)\n expanded_actual = mapper.expand_actual_type(\n actual_type, actual_kind,\n callee.arg_names[i], callee.arg_kinds[i])\n check_arg(expanded_actual, actual_type, arg_kinds[actual],\n callee.arg_types[i],\n actual + 1, i + 1, callee, object_type, args[actual], context, messages)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_arg_ExpressionChecker.check_arg.if_isinstance_caller_type.elif_not_is_subtype_calle.messages_incompatible_arg": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_arg_ExpressionChecker.check_arg.if_isinstance_caller_type.elif_not_is_subtype_calle.messages_incompatible_arg", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1489, "end_line": 1527, "span_ids": ["ExpressionChecker.check_arg"], "tokens": 366}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def check_arg(self,\n caller_type: Type,\n original_caller_type: Type,\n caller_kind: int,\n callee_type: Type,\n n: int,\n m: int,\n callee: CallableType,\n object_type: Optional[Type],\n context: Context,\n outer_context: Context,\n messages: MessageBuilder) -> None:\n \"\"\"Check the type of a single argument in a call.\"\"\"\n caller_type = get_proper_type(caller_type)\n original_caller_type = get_proper_type(original_caller_type)\n callee_type = get_proper_type(callee_type)\n\n if isinstance(caller_type, DeletedType):\n messages.deleted_as_rvalue(caller_type, context)\n # Only non-abstract non-protocol class can be given where Type[...] is expected...\n elif (isinstance(caller_type, CallableType) and isinstance(callee_type, TypeType) and\n caller_type.is_type_obj() and\n (caller_type.type_object().is_abstract or caller_type.type_object().is_protocol) and\n isinstance(callee_type.item, Instance) and\n (callee_type.item.type.is_abstract or callee_type.item.type.is_protocol)):\n self.msg.concrete_only_call(callee_type, context)\n elif not is_subtype(caller_type, callee_type):\n if self.chk.should_suppress_optional_error([caller_type, callee_type]):\n return\n code = messages.incompatible_argument(n,\n m,\n callee,\n original_caller_type,\n caller_kind,\n object_type=object_type,\n context=context,\n outer_context=outer_context)\n messages.incompatible_argument_note(original_caller_type, callee_type, context,\n code=code)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_overload_call_ExpressionChecker.check_overload_call.None_18": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_overload_call_ExpressionChecker.check_overload_call.None_18", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1518, "end_line": 1588, "span_ids": ["ExpressionChecker.check_overload_call"], "tokens": 806}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def check_overload_call(self,\n callee: Overloaded,\n args: List[Expression],\n arg_kinds: List[int],\n arg_names: Optional[Sequence[Optional[str]]],\n callable_name: Optional[str],\n object_type: Optional[Type],\n context: Context,\n arg_messages: MessageBuilder) -> Tuple[Type, Type]:\n \"\"\"Checks a call to an overloaded function.\"\"\"\n arg_types = self.infer_arg_types_in_empty_context(args)\n # Step 1: Filter call targets to remove ones where the argument counts don't match\n plausible_targets = self.plausible_overload_call_targets(arg_types, arg_kinds,\n arg_names, callee)\n\n # Step 2: If the arguments contain a union, we try performing union math first,\n # instead of picking the first matching overload.\n # This is because picking the first overload often ends up being too greedy:\n # for example, when we have a fallback alternative that accepts an unrestricted\n # typevar. See https://github.com/python/mypy/issues/4063 for related discussion.\n erased_targets = None # type: Optional[List[CallableType]]\n unioned_result = None # type: Optional[Tuple[Type, Type]]\n union_interrupted = False # did we try all union combinations?\n if any(self.real_union(arg) for arg in arg_types):\n unioned_errors = arg_messages.clean_copy()\n try:\n unioned_return = self.union_overload_result(plausible_targets, args,\n arg_types, arg_kinds, arg_names,\n callable_name, object_type,\n context,\n arg_messages=unioned_errors)\n except TooManyUnions:\n union_interrupted = True\n else:\n # Record if we succeeded. Next we need to see if maybe normal procedure\n # gives a narrower type.\n if unioned_return:\n # TODO: fix signature of zip() in typeshed.\n returns, inferred_types = cast(Any, zip)(*unioned_return)\n # Note that we use `combine_function_signatures` instead of just returning\n # a union of inferred callables because for example a call\n # Union[int -> int, str -> str](Union[int, str]) is invalid and\n # we don't want to introduce internal inconsistencies.\n unioned_result = (make_simplified_union(list(returns),\n context.line,\n context.column),\n self.combine_function_signatures(inferred_types))\n\n # Step 3: We try checking each branch one-by-one.\n inferred_result = self.infer_overload_return_type(plausible_targets, args, arg_types,\n arg_kinds, arg_names, callable_name,\n object_type, context, arg_messages)\n # If any of checks succeed, stop early.\n if inferred_result is not None and unioned_result is not None:\n # Both unioned and direct checks succeeded, choose the more precise type.\n if (is_subtype(inferred_result[0], unioned_result[0]) and\n not isinstance(get_proper_type(inferred_result[0]), AnyType)):\n return inferred_result\n return unioned_result\n elif unioned_result is not None:\n return unioned_result\n elif inferred_result is not None:\n return inferred_result\n\n # Step 4: Failure. At this point, we know there is no match. We fall back to trying\n # to find a somewhat plausible overload target using the erased types\n # so we can produce a nice error message.\n #\n # For example, suppose the user passes a value of type 'List[str]' into an\n # overload with signatures f(x: int) -> int and f(x: List[int]) -> List[int].\n #\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_overload_call._Neither_alterna_ExpressionChecker.check_overload_call.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_overload_call._Neither_alterna_ExpressionChecker.check_overload_call.return.result", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1589, "end_line": 1623, "span_ids": ["ExpressionChecker.check_overload_call"], "tokens": 446}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def check_overload_call(self,\n callee: Overloaded,\n args: List[Expression],\n arg_kinds: List[int],\n arg_names: Optional[Sequence[Optional[str]]],\n callable_name: Optional[str],\n object_type: Optional[Type],\n context: Context,\n arg_messages: MessageBuilder) -> Tuple[Type, Type]:\n # Neither alternative matches, but we can guess the user probably wants the\n # second one.\n erased_targets = self.overload_erased_call_targets(plausible_targets, arg_types,\n arg_kinds, arg_names, args, context)\n\n # Step 5: We try and infer a second-best alternative if possible. If not, fall back\n # to using 'Any'.\n if len(erased_targets) > 0:\n # Pick the first plausible erased target as the fallback\n # TODO: Adjust the error message here to make it clear there was no match.\n # In order to do this, we need to find a clean way of associating\n # a note with whatever error message 'self.check_call' will generate.\n # In particular, the note's line and column numbers need to be the same\n # as the error's.\n target = erased_targets[0] # type: Type\n else:\n # There was no plausible match: give up\n target = AnyType(TypeOfAny.from_error)\n\n if not self.chk.should_suppress_optional_error(arg_types):\n if not is_operator_method(callable_name):\n code = None\n else:\n code = codes.OPERATOR\n arg_messages.no_variant_matches_arguments(\n plausible_targets, callee, arg_types, context, code=code)\n\n result = self.check_call(target, args, arg_kinds, context, arg_names,\n arg_messages=arg_messages,\n callable_name=callable_name,\n object_type=object_type)\n if union_interrupted:\n self.chk.fail(\"Not all union combinations were tried\"\n \" because there are too many unions\", context)\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.plausible_overload_call_targets_ExpressionChecker.plausible_overload_call_targets.return.star_matches_matches": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.plausible_overload_call_targets_ExpressionChecker.plausible_overload_call_targets.return.star_matches_matches", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1625, "end_line": 1671, "span_ids": ["ExpressionChecker.plausible_overload_call_targets"], "tokens": 447}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def plausible_overload_call_targets(self,\n arg_types: List[Type],\n arg_kinds: List[int],\n arg_names: Optional[Sequence[Optional[str]]],\n overload: Overloaded) -> List[CallableType]:\n \"\"\"Returns all overload call targets that having matching argument counts.\n\n If the given args contains a star-arg (*arg or **kwarg argument), this method\n will ensure all star-arg overloads appear at the start of the list, instead\n of their usual location.\n\n The only exception is if the starred argument is something like a Tuple or a\n NamedTuple, which has a definitive \"shape\". If so, we don't move the corresponding\n alternative to the front since we can infer a more precise match using the original\n order.\"\"\"\n\n def has_shape(typ: Type) -> bool:\n typ = get_proper_type(typ)\n return (isinstance(typ, TupleType) or isinstance(typ, TypedDictType)\n or (isinstance(typ, Instance) and typ.type.is_named_tuple))\n\n matches = [] # type: List[CallableType]\n star_matches = [] # type: List[CallableType]\n\n args_have_var_arg = False\n args_have_kw_arg = False\n for kind, typ in zip(arg_kinds, arg_types):\n if kind == ARG_STAR and not has_shape(typ):\n args_have_var_arg = True\n if kind == ARG_STAR2 and not has_shape(typ):\n args_have_kw_arg = True\n\n for typ in overload.items():\n formal_to_actual = map_actuals_to_formals(arg_kinds, arg_names,\n typ.arg_kinds, typ.arg_names,\n lambda i: arg_types[i])\n\n if self.check_argument_count(typ, arg_types, arg_kinds, arg_names,\n formal_to_actual, None, None):\n if args_have_var_arg and typ.is_var_arg:\n star_matches.append(typ)\n elif args_have_kw_arg and typ.is_kw_arg:\n star_matches.append(typ)\n else:\n matches.append(typ)\n\n return star_matches + matches", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.infer_overload_return_type_ExpressionChecker.infer_overload_return_type.if_len_matches_0_.else_.return.return_types_0_inferred": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.infer_overload_return_type_ExpressionChecker.infer_overload_return_type.if_len_matches_0_.else_.return.return_types_0_inferred", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1673, "end_line": 1754, "span_ids": ["ExpressionChecker.infer_overload_return_type"], "tokens": 741}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def infer_overload_return_type(self,\n plausible_targets: List[CallableType],\n args: List[Expression],\n arg_types: List[Type],\n arg_kinds: List[int],\n arg_names: Optional[Sequence[Optional[str]]],\n callable_name: Optional[str],\n object_type: Optional[Type],\n context: Context,\n arg_messages: Optional[MessageBuilder] = None,\n ) -> Optional[Tuple[Type, Type]]:\n \"\"\"Attempts to find the first matching callable from the given list.\n\n If a match is found, returns a tuple containing the result type and the inferred\n callee type. (This tuple is meant to be eventually returned by check_call.)\n If multiple targets match due to ambiguous Any parameters, returns (AnyType, AnyType).\n If no targets match, returns None.\n\n Assumes all of the given targets have argument counts compatible with the caller.\n \"\"\"\n\n arg_messages = self.msg if arg_messages is None else arg_messages\n matches = [] # type: List[CallableType]\n return_types = [] # type: List[Type]\n inferred_types = [] # type: List[Type]\n args_contain_any = any(map(has_any_type, arg_types))\n\n for typ in plausible_targets:\n overload_messages = self.msg.clean_copy()\n prev_messages = self.msg\n assert self.msg is self.chk.msg\n self.msg = overload_messages\n self.chk.msg = overload_messages\n try:\n # Passing `overload_messages` as the `arg_messages` parameter doesn't\n # seem to reliably catch all possible errors.\n # TODO: Figure out why\n ret_type, infer_type = self.check_call(\n callee=typ,\n args=args,\n arg_kinds=arg_kinds,\n arg_names=arg_names,\n context=context,\n arg_messages=overload_messages,\n callable_name=callable_name,\n object_type=object_type)\n finally:\n self.chk.msg = prev_messages\n self.msg = prev_messages\n\n is_match = not overload_messages.is_errors()\n if is_match:\n # Return early if possible; otherwise record info so we can\n # check for ambiguity due to 'Any' below.\n if not args_contain_any:\n return ret_type, infer_type\n matches.append(typ)\n return_types.append(ret_type)\n inferred_types.append(infer_type)\n\n if len(matches) == 0:\n # No match was found\n return None\n elif any_causes_overload_ambiguity(matches, return_types, arg_types, arg_kinds, arg_names):\n # An argument of type or containing the type 'Any' caused ambiguity.\n # We try returning a precise type if we can. If not, we give up and just return 'Any'.\n if all_same_types(return_types):\n return return_types[0], inferred_types[0]\n elif all_same_types([erase_type(typ) for typ in return_types]):\n return erase_type(return_types[0]), erase_type(inferred_types[0])\n else:\n return self.check_call(callee=AnyType(TypeOfAny.special_form),\n args=args,\n arg_kinds=arg_kinds,\n arg_names=arg_names,\n context=context,\n arg_messages=arg_messages,\n callable_name=callable_name,\n object_type=object_type)\n else:\n # Success! No ambiguity; return the first match.\n return return_types[0], inferred_types[0]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.overload_erased_call_targets_ExpressionChecker.overload_erased_call_targets.return.matches": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.overload_erased_call_targets_ExpressionChecker.overload_erased_call_targets.return.matches", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1756, "end_line": 1772, "span_ids": ["ExpressionChecker.overload_erased_call_targets"], "tokens": 159}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def overload_erased_call_targets(self,\n plausible_targets: List[CallableType],\n arg_types: List[Type],\n arg_kinds: List[int],\n arg_names: Optional[Sequence[Optional[str]]],\n args: List[Expression],\n context: Context) -> List[CallableType]:\n \"\"\"Returns a list of all targets that match the caller after erasing types.\n\n Assumes all of the given targets have argument counts compatible with the caller.\n \"\"\"\n matches = [] # type: List[CallableType]\n for typ in plausible_targets:\n if self.erased_signature_similarity(arg_types, arg_kinds, arg_names, args, typ,\n context):\n matches.append(typ)\n return matches", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.union_overload_result_ExpressionChecker.union_overload_result.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.union_overload_result_ExpressionChecker.union_overload_result.return.result", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1774, "end_line": 1849, "span_ids": ["ExpressionChecker.union_overload_result"], "tokens": 728}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def union_overload_result(self,\n plausible_targets: List[CallableType],\n args: List[Expression],\n arg_types: List[Type],\n arg_kinds: List[int],\n arg_names: Optional[Sequence[Optional[str]]],\n callable_name: Optional[str],\n object_type: Optional[Type],\n context: Context,\n arg_messages: Optional[MessageBuilder] = None,\n level: int = 0\n ) -> Optional[List[Tuple[Type, Type]]]:\n \"\"\"Accepts a list of overload signatures and attempts to match calls by destructuring\n the first union.\n\n Return a list of (, ) if call succeeds for every\n item of the desctructured union. Returns None if there is no match.\n \"\"\"\n # Step 1: If we are already too deep, then stop immediately. Otherwise mypy might\n # hang for long time because of a weird overload call. The caller will get\n # the exception and generate an appropriate note message, if needed.\n if level >= MAX_UNIONS:\n raise TooManyUnions\n\n # Step 2: Find position of the first union in arguments. Return the normal inferred\n # type if no more unions left.\n for idx, typ in enumerate(arg_types):\n if self.real_union(typ):\n break\n else:\n # No unions in args, just fall back to normal inference\n with self.type_overrides_set(args, arg_types):\n res = self.infer_overload_return_type(plausible_targets, args, arg_types,\n arg_kinds, arg_names, callable_name,\n object_type, context, arg_messages)\n if res is not None:\n return [res]\n return None\n\n # Step 3: Try a direct match before splitting to avoid unnecessary union splits\n # and save performance.\n with self.type_overrides_set(args, arg_types):\n direct = self.infer_overload_return_type(plausible_targets, args, arg_types,\n arg_kinds, arg_names, callable_name,\n object_type, context, arg_messages)\n if direct is not None and not isinstance(get_proper_type(direct[0]),\n (UnionType, AnyType)):\n # We only return non-unions soon, to avoid greedy match.\n return [direct]\n\n # Step 4: Split the first remaining union type in arguments into items and\n # try to match each item individually (recursive).\n first_union = get_proper_type(arg_types[idx])\n assert isinstance(first_union, UnionType)\n res_items = []\n for item in first_union.relevant_items():\n new_arg_types = arg_types.copy()\n new_arg_types[idx] = item\n sub_result = self.union_overload_result(plausible_targets, args, new_arg_types,\n arg_kinds, arg_names, callable_name,\n object_type, context, arg_messages,\n level + 1)\n if sub_result is not None:\n res_items.extend(sub_result)\n else:\n # Some item doesn't match, return soon.\n return None\n\n # Step 5: If splitting succeeded, then filter out duplicate items before returning.\n seen = set() # type: Set[Tuple[Type, Type]]\n result = []\n for pair in res_items:\n if pair not in seen:\n seen.add(pair)\n result.append(pair)\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.real_union_ExpressionChecker.type_overrides_set.try_.finally_.for_expr_in_exprs_.del_self_type_overrides_e": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.real_union_ExpressionChecker.type_overrides_set.try_.finally_.for_expr_in_exprs_.del_self_type_overrides_e", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1851, "end_line": 1866, "span_ids": ["ExpressionChecker.real_union", "ExpressionChecker.type_overrides_set"], "tokens": 153}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def real_union(self, typ: Type) -> bool:\n typ = get_proper_type(typ)\n return isinstance(typ, UnionType) and len(typ.relevant_items()) > 1\n\n @contextmanager\n def type_overrides_set(self, exprs: Sequence[Expression],\n overrides: Sequence[Type]) -> Iterator[None]:\n \"\"\"Set _temporary_ type overrides for given expressions.\"\"\"\n assert len(exprs) == len(overrides)\n for expr, typ in zip(exprs, overrides):\n self.type_overrides[expr] = typ\n try:\n yield\n finally:\n for expr in exprs:\n del self.type_overrides[expr]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.combine_function_signatures_ExpressionChecker.combine_function_signatures.return.callables_0_copy_modifie": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.combine_function_signatures_ExpressionChecker.combine_function_signatures.return.callables_0_copy_modifie", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1868, "end_line": 1947, "span_ids": ["ExpressionChecker.combine_function_signatures"], "tokens": 775}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def combine_function_signatures(self, types: Sequence[Type]) -> Union[AnyType, CallableType]:\n \"\"\"Accepts a list of function signatures and attempts to combine them together into a\n new CallableType consisting of the union of all of the given arguments and return types.\n\n If there is at least one non-callable type, return Any (this can happen if there is\n an ambiguity because of Any in arguments).\n \"\"\"\n assert types, \"Trying to merge no callables\"\n types = get_proper_types(types)\n if not all(isinstance(c, CallableType) for c in types):\n return AnyType(TypeOfAny.special_form)\n callables = cast(Sequence[CallableType], types)\n if len(callables) == 1:\n return callables[0]\n\n # Note: we are assuming here that if a user uses some TypeVar 'T' in\n # two different functions, they meant for that TypeVar to mean the\n # same thing.\n #\n # This function will make sure that all instances of that TypeVar 'T'\n # refer to the same underlying TypeVarType and TypeVarDef objects to\n # simplify the union-ing logic below.\n #\n # (If the user did *not* mean for 'T' to be consistently bound to the\n # same type in their overloads, well, their code is probably too\n # confusing and ought to be re-written anyways.)\n callables, variables = merge_typevars_in_callables_by_name(callables)\n\n new_args = [[] for _ in range(len(callables[0].arg_types))] # type: List[List[Type]]\n new_kinds = list(callables[0].arg_kinds)\n new_returns = [] # type: List[Type]\n\n too_complex = False\n for target in callables:\n # We fall back to Callable[..., Union[]] if the functions do not have\n # the exact same signature. The only exception is if one arg is optional and\n # the other is positional: in that case, we continue unioning (and expect a\n # positional arg).\n # TODO: Enhance the merging logic to handle a wider variety of signatures.\n if len(new_kinds) != len(target.arg_kinds):\n too_complex = True\n break\n for i, (new_kind, target_kind) in enumerate(zip(new_kinds, target.arg_kinds)):\n if new_kind == target_kind:\n continue\n elif new_kind in (ARG_POS, ARG_OPT) and target_kind in (ARG_POS, ARG_OPT):\n new_kinds[i] = ARG_POS\n else:\n too_complex = True\n break\n\n if too_complex:\n break # outer loop\n\n for i, arg in enumerate(target.arg_types):\n new_args[i].append(arg)\n new_returns.append(target.ret_type)\n\n union_return = make_simplified_union(new_returns)\n if too_complex:\n any = AnyType(TypeOfAny.special_form)\n return callables[0].copy_modified(\n arg_types=[any, any],\n arg_kinds=[ARG_STAR, ARG_STAR2],\n arg_names=[None, None],\n ret_type=union_return,\n variables=variables,\n implicit=True)\n\n final_args = []\n for args_list in new_args:\n new_type = make_simplified_union(args_list)\n final_args.append(new_type)\n\n return callables[0].copy_modified(\n arg_types=final_args,\n arg_kinds=new_kinds,\n ret_type=union_return,\n variables=variables,\n implicit=True)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.erased_signature_similarity_ExpressionChecker.erased_signature_similarity.try_.except_Finished_.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.erased_signature_similarity_ExpressionChecker.erased_signature_similarity.try_.except_Finished_.return.False", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1960, "end_line": 2001, "span_ids": ["ExpressionChecker.erased_signature_similarity"], "tokens": 324}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def erased_signature_similarity(self,\n arg_types: List[Type],\n arg_kinds: List[int],\n arg_names: Optional[Sequence[Optional[str]]],\n args: List[Expression],\n callee: CallableType,\n context: Context) -> bool:\n \"\"\"Determine whether arguments could match the signature at runtime, after\n erasing types.\"\"\"\n formal_to_actual = map_actuals_to_formals(arg_kinds,\n arg_names,\n callee.arg_kinds,\n callee.arg_names,\n lambda i: arg_types[i])\n\n if not self.check_argument_count(callee, arg_types, arg_kinds, arg_names,\n formal_to_actual, None, None):\n # Too few or many arguments -> no match.\n return False\n\n def check_arg(caller_type: Type,\n original_ccaller_type: Type,\n caller_kind: int,\n callee_type: Type,\n n: int,\n m: int,\n callee: CallableType,\n object_type: Optional[Type],\n context: Context,\n outer_context: Context,\n messages: MessageBuilder) -> None:\n if not arg_approximate_similarity(caller_type, callee_type):\n # No match -- exit early since none of the remaining work can change\n # the result.\n raise Finished\n\n try:\n self.check_argument_types(arg_types, arg_kinds, args, callee,\n formal_to_actual, context=context, check_arg=check_arg)\n return True\n except Finished:\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.apply_generic_arguments_ExpressionChecker.check_any_type_call.if_isinstance_callee_Any.else_.return.AnyType_TypeOfAny_special": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.apply_generic_arguments_ExpressionChecker.check_any_type_call.if_isinstance_callee_Any.else_.return.AnyType_TypeOfAny_special", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1991, "end_line": 2005, "span_ids": ["ExpressionChecker.check_any_type_call", "ExpressionChecker.apply_generic_arguments"], "tokens": 204}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def apply_generic_arguments(self, callable: CallableType, types: Sequence[Optional[Type]],\n context: Context, skip_unsatisfied: bool = False) -> CallableType:\n \"\"\"Simple wrapper around mypy.applytype.apply_generic_arguments.\"\"\"\n return applytype.apply_generic_arguments(callable, types,\n self.msg.incompatible_typevar_value, context,\n skip_unsatisfied=skip_unsatisfied)\n\n def check_any_type_call(self, args: List[Expression], callee: Type) -> Tuple[Type, Type]:\n self.infer_arg_types_in_empty_context(args)\n callee = get_proper_type(callee)\n if isinstance(callee, AnyType):\n return (AnyType(TypeOfAny.from_another_any, source_any=callee),\n AnyType(TypeOfAny.from_another_any, source_any=callee))\n else:\n return AnyType(TypeOfAny.special_form), AnyType(TypeOfAny.special_form)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_union_call_ExpressionChecker.visit_member_expr.return.self_narrow_type_from_bin": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_union_call_ExpressionChecker.visit_member_expr.return.self_narrow_type_from_bin", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2007, "end_line": 2026, "span_ids": ["ExpressionChecker.check_union_call", "ExpressionChecker.visit_member_expr"], "tokens": 222}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def check_union_call(self,\n callee: UnionType,\n args: List[Expression],\n arg_kinds: List[int],\n arg_names: Optional[Sequence[Optional[str]]],\n context: Context,\n arg_messages: MessageBuilder) -> Tuple[Type, Type]:\n self.msg.disable_type_names += 1\n results = [self.check_call(subtype, args, arg_kinds, context, arg_names,\n arg_messages=arg_messages)\n for subtype in callee.relevant_items()]\n self.msg.disable_type_names -= 1\n return (make_simplified_union([res[0] for res in results]),\n callee)\n\n def visit_member_expr(self, e: MemberExpr, is_lvalue: bool = False) -> Type:\n \"\"\"Visit member expression (of form e.id).\"\"\"\n self.chk.module_refs.update(extract_refexpr_names(e))\n result = self.analyze_ordinary_member_access(e, is_lvalue)\n return self.narrow_type_from_binder(e, result)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.analyze_ordinary_member_access_ExpressionChecker.analyze_ordinary_member_access.if_e_kind_is_not_None_.else_.return.member_type": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.analyze_ordinary_member_access_ExpressionChecker.analyze_ordinary_member_access.if_e_kind_is_not_None_.else_.return.member_type", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2028, "end_line": 2049, "span_ids": ["ExpressionChecker.analyze_ordinary_member_access"], "tokens": 196}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def analyze_ordinary_member_access(self, e: MemberExpr,\n is_lvalue: bool) -> Type:\n \"\"\"Analyse member expression or member lvalue.\"\"\"\n if e.kind is not None:\n # This is a reference to a module attribute.\n return self.analyze_ref_expr(e)\n else:\n # This is a reference to a non-module attribute.\n original_type = self.accept(e.expr)\n base = e.expr\n module_symbol_table = None\n\n if isinstance(base, RefExpr) and isinstance(base.node, MypyFile):\n module_symbol_table = base.node.names\n\n member_type = analyze_member_access(\n e.name, original_type, e, is_lvalue, False, False,\n self.msg, original_type=original_type, chk=self.chk,\n in_literal_context=self.is_literal_context(),\n module_symbol_table=module_symbol_table)\n\n return member_type", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.analyze_external_member_access_ExpressionChecker.is_literal_context.return.is_literal_type_like_self": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.analyze_external_member_access_ExpressionChecker.is_literal_context.return.is_literal_type_like_self", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2051, "end_line": 2062, "span_ids": ["ExpressionChecker.is_literal_context", "ExpressionChecker.analyze_external_member_access"], "tokens": 138}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def analyze_external_member_access(self, member: str, base_type: Type,\n context: Context) -> Type:\n \"\"\"Analyse member access that is external, i.e. it cannot\n refer to private definitions. Return the result type.\n \"\"\"\n # TODO remove; no private definitions in mypy\n return analyze_member_access(member, base_type, context, False, False, False,\n self.msg, original_type=base_type, chk=self.chk,\n in_literal_context=self.is_literal_context())\n\n def is_literal_context(self) -> bool:\n return is_literal_type_like(self.type_context[-1])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.infer_literal_expr_type_ExpressionChecker.infer_literal_expr_type.if_self_is_literal_contex.else_.return.typ_copy_modified_last_kn": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.infer_literal_expr_type_ExpressionChecker.infer_literal_expr_type.if_self_is_literal_contex.else_.return.typ_copy_modified_last_kn", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2064, "end_line": 2090, "span_ids": ["ExpressionChecker.infer_literal_expr_type"], "tokens": 307}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def infer_literal_expr_type(self, value: LiteralValue, fallback_name: str) -> Type:\n \"\"\"Analyzes the given literal expression and determines if we should be\n inferring an Instance type, a Literal[...] type, or an Instance that\n remembers the original literal. We...\n\n 1. ...Infer a normal Instance in most circumstances.\n\n 2. ...Infer a Literal[...] if we're in a literal context. For example, if we\n were analyzing the \"3\" in \"foo(3)\" where \"foo\" has a signature of\n \"def foo(Literal[3]) -> None\", we'd want to infer that the \"3\" has a\n type of Literal[3] instead of Instance.\n\n 3. ...Infer an Instance that remembers the original Literal if we're declaring\n a Final variable with an inferred type -- for example, \"bar\" in \"bar: Final = 3\"\n would be assigned an Instance that remembers it originated from a '3'. See\n the comments in Instance's constructor for more details.\n \"\"\"\n typ = self.named_type(fallback_name)\n if self.is_literal_context():\n return LiteralType(value=value, fallback=typ)\n else:\n return typ.copy_modified(last_known_value=LiteralType(\n value=value,\n fallback=typ,\n line=typ.line,\n column=typ.column,\n ))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.concat_tuples_ExpressionChecker.visit_complex_expr.return.self_named_type_builtins": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.concat_tuples_ExpressionChecker.visit_complex_expr.return.self_named_type_builtins", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2092, "end_line": 2119, "span_ids": ["ExpressionChecker.concat_tuples", "ExpressionChecker.visit_unicode_expr", "ExpressionChecker.visit_complex_expr", "ExpressionChecker.visit_float_expr", "ExpressionChecker.visit_str_expr", "ExpressionChecker.visit_int_expr", "ExpressionChecker.visit_bytes_expr"], "tokens": 305}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def concat_tuples(self, left: TupleType, right: TupleType) -> TupleType:\n \"\"\"Concatenate two fixed length tuples.\"\"\"\n return TupleType(items=left.items + right.items,\n fallback=self.named_type('builtins.tuple'))\n\n def visit_int_expr(self, e: IntExpr) -> Type:\n \"\"\"Type check an integer literal (trivial).\"\"\"\n return self.infer_literal_expr_type(e.value, 'builtins.int')\n\n def visit_str_expr(self, e: StrExpr) -> Type:\n \"\"\"Type check a string literal (trivial).\"\"\"\n return self.infer_literal_expr_type(e.value, 'builtins.str')\n\n def visit_bytes_expr(self, e: BytesExpr) -> Type:\n \"\"\"Type check a bytes literal (trivial).\"\"\"\n return self.infer_literal_expr_type(e.value, 'builtins.bytes')\n\n def visit_unicode_expr(self, e: UnicodeExpr) -> Type:\n \"\"\"Type check a unicode literal (trivial).\"\"\"\n return self.infer_literal_expr_type(e.value, 'builtins.unicode')\n\n def visit_float_expr(self, e: FloatExpr) -> Type:\n \"\"\"Type check a float literal (trivial).\"\"\"\n return self.named_type('builtins.float')\n\n def visit_complex_expr(self, e: ComplexExpr) -> Type:\n \"\"\"Type check a complex literal.\"\"\"\n return self.named_type('builtins.complex')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_ellipsis_ExpressionChecker.visit_ellipsis.if_self_chk_options_pytho.else_.return.self_named_type_builtins": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_ellipsis_ExpressionChecker.visit_ellipsis.if_self_chk_options_pytho.else_.return.self_named_type_builtins", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2121, "end_line": 2131, "span_ids": ["ExpressionChecker.visit_ellipsis"], "tokens": 153}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def visit_ellipsis(self, e: EllipsisExpr) -> Type:\n \"\"\"Type check '...'.\"\"\"\n if self.chk.options.python_version[0] >= 3:\n return self.named_type('builtins.ellipsis')\n else:\n # '...' is not valid in normal Python 2 code, but it can\n # be used in stubs. The parser makes sure that we only\n # get this far if we are in a stub, and we can safely\n # return 'object' as ellipsis is special cased elsewhere.\n # The builtins.ellipsis type does not exist in Python 2.\n return self.named_type('builtins.object')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_op_expr_ExpressionChecker.visit_op_expr.if_e_op_in_nodes_op_metho.else_.raise_RuntimeError_Unkno": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_op_expr_ExpressionChecker.visit_op_expr.if_e_op_in_nodes_op_metho.else_.raise_RuntimeError_Unkno", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2133, "end_line": 2169, "span_ids": ["ExpressionChecker.visit_op_expr"], "tokens": 436}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def visit_op_expr(self, e: OpExpr) -> Type:\n \"\"\"Type check a binary operator expression.\"\"\"\n if e.op == 'and' or e.op == 'or':\n return self.check_boolean_op(e, e)\n if e.op == '*' and isinstance(e.left, ListExpr):\n # Expressions of form [...] * e get special type inference.\n return self.check_list_multiply(e)\n if e.op == '%':\n pyversion = self.chk.options.python_version\n if pyversion[0] == 3:\n if isinstance(e.left, BytesExpr) and pyversion[1] >= 5:\n return self.strfrm_checker.check_str_interpolation(e.left, e.right)\n if isinstance(e.left, StrExpr):\n return self.strfrm_checker.check_str_interpolation(e.left, e.right)\n elif pyversion[0] <= 2:\n if isinstance(e.left, (StrExpr, BytesExpr, UnicodeExpr)):\n return self.strfrm_checker.check_str_interpolation(e.left, e.right)\n left_type = self.accept(e.left)\n\n proper_left_type = get_proper_type(left_type)\n if isinstance(proper_left_type, TupleType) and e.op == '+':\n left_add_method = proper_left_type.partial_fallback.type.get('__add__')\n if left_add_method and left_add_method.fullname == 'builtins.tuple.__add__':\n proper_right_type = get_proper_type(self.accept(e.right))\n if isinstance(proper_right_type, TupleType):\n right_radd_method = proper_right_type.partial_fallback.type.get('__radd__')\n if right_radd_method is None:\n return self.concat_tuples(proper_left_type, proper_right_type)\n\n if e.op in nodes.op_methods:\n method = self.get_operator_method(e.op)\n result, method_type = self.check_op(method, left_type, e.right, e,\n allow_reverse=True)\n e.method_type = method_type\n return result\n else:\n raise RuntimeError('Unknown operator {}'.format(e.op))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_comparison_expr_ExpressionChecker.visit_comparison_expr.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_comparison_expr_ExpressionChecker.visit_comparison_expr.return.result", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2171, "end_line": 2270, "span_ids": ["ExpressionChecker.visit_comparison_expr"], "tokens": 1059}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def visit_comparison_expr(self, e: ComparisonExpr) -> Type:\n \"\"\"Type check a comparison expression.\n\n Comparison expressions are type checked consecutive-pair-wise\n That is, 'a < b > c == d' is check as 'a < b and b > c and c == d'\n \"\"\"\n result = None # type: Optional[Type]\n sub_result = None # type: Optional[Type]\n\n # Check each consecutive operand pair and their operator\n for left, right, operator in zip(e.operands, e.operands[1:], e.operators):\n left_type = self.accept(left)\n\n method_type = None # type: Optional[mypy.types.Type]\n\n if operator == 'in' or operator == 'not in':\n # If the right operand has partial type, look it up without triggering\n # a \"Need type annotation ...\" message, as it would be noise.\n right_type = self.find_partial_type_ref_fast_path(right)\n if right_type is None:\n right_type = self.accept(right) # Validate the right operand\n\n # Keep track of whether we get type check errors (these won't be reported, they\n # are just to verify whether something is valid typing wise).\n local_errors = self.msg.copy()\n local_errors.disable_count = 0\n _, method_type = self.check_method_call_by_name(\n '__contains__', right_type, [left], [ARG_POS], e, local_errors)\n sub_result = self.bool_type()\n # Container item type for strict type overlap checks. Note: we need to only\n # check for nominal type, because a usual \"Unsupported operands for in\"\n # will be reported for types incompatible with __contains__().\n # See testCustomContainsCheckStrictEquality for an example.\n cont_type = self.chk.analyze_container_item_type(right_type)\n if isinstance(right_type, PartialType):\n # We don't really know if this is an error or not, so just shut up.\n pass\n elif (local_errors.is_errors() and\n # is_valid_var_arg is True for any Iterable\n self.is_valid_var_arg(right_type)):\n _, itertype = self.chk.analyze_iterable_item_type(right)\n method_type = CallableType(\n [left_type],\n [nodes.ARG_POS],\n [None],\n self.bool_type(),\n self.named_type('builtins.function'))\n if not is_subtype(left_type, itertype):\n self.msg.unsupported_operand_types('in', left_type, right_type, e)\n # Only show dangerous overlap if there are no other errors.\n elif (not local_errors.is_errors() and cont_type and\n self.dangerous_comparison(left_type, cont_type,\n original_container=right_type)):\n self.msg.dangerous_comparison(left_type, cont_type, 'container', e)\n else:\n self.msg.add_errors(local_errors)\n elif operator in nodes.op_methods:\n method = self.get_operator_method(operator)\n err_count = self.msg.errors.total_errors()\n sub_result, method_type = self.check_op(method, left_type, right, e,\n allow_reverse=True)\n # Only show dangerous overlap if there are no other errors. See\n # testCustomEqCheckStrictEquality for an example.\n if self.msg.errors.total_errors() == err_count and operator in ('==', '!='):\n right_type = self.accept(right)\n # We suppress the error if there is a custom __eq__() method on either\n # side. User defined (or even standard library) classes can define this\n # to return True for comparisons between non-overlapping types.\n if (not custom_special_method(left_type, '__eq__') and\n not custom_special_method(right_type, '__eq__')):\n # Also flag non-overlapping literals in situations like:\n # x: Literal['a', 'b']\n # if x == 'c':\n # ...\n left_type = try_getting_literal(left_type)\n right_type = try_getting_literal(right_type)\n if self.dangerous_comparison(left_type, right_type):\n self.msg.dangerous_comparison(left_type, right_type, 'equality', e)\n\n elif operator == 'is' or operator == 'is not':\n right_type = self.accept(right) # validate the right operand\n sub_result = self.bool_type()\n left_type = try_getting_literal(left_type)\n right_type = try_getting_literal(right_type)\n if self.dangerous_comparison(left_type, right_type):\n self.msg.dangerous_comparison(left_type, right_type, 'identity', e)\n method_type = None\n else:\n raise RuntimeError('Unknown comparison operator {}'.format(operator))\n\n e.method_types.append(method_type)\n\n # Determine type of boolean-and of result and sub_result\n if result is None:\n result = sub_result\n else:\n result = join.join_types(result, sub_result)\n\n assert result is not None\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.find_partial_type_ref_fast_path_ExpressionChecker.find_partial_type_ref_fast_path.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.find_partial_type_ref_fast_path_ExpressionChecker.find_partial_type_ref_fast_path.return.None", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2272, "end_line": 2286, "span_ids": ["ExpressionChecker.find_partial_type_ref_fast_path"], "tokens": 138}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def find_partial_type_ref_fast_path(self, expr: Expression) -> Optional[Type]:\n \"\"\"If expression has a partial generic type, return it without additional checks.\n\n In particular, this does not generate an error about a missing annotation.\n\n Otherwise, return None.\n \"\"\"\n if not isinstance(expr, RefExpr):\n return None\n if isinstance(expr.node, Var):\n result = self.analyze_var_ref(expr.node, expr)\n if isinstance(result, PartialType) and result.type is not None:\n self.chk.store_type(expr, self.chk.fixup_partial_type(result))\n return result\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.dangerous_comparison_ExpressionChecker.dangerous_comparison.return.not_is_overlapping_types_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.dangerous_comparison_ExpressionChecker.dangerous_comparison.return.not_is_overlapping_types_", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2288, "end_line": 2348, "span_ids": ["ExpressionChecker.dangerous_comparison"], "tokens": 715}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def dangerous_comparison(self, left: Type, right: Type,\n original_container: Optional[Type] = None) -> bool:\n \"\"\"Check for dangerous non-overlapping comparisons like 42 == 'no'.\n\n The original_container is the original container type for 'in' checks\n (and None for equality checks).\n\n Rules:\n * X and None are overlapping even in strict-optional mode. This is to allow\n 'assert x is not None' for x defined as 'x = None # type: str' in class body\n (otherwise mypy itself would have couple dozen errors because of this).\n * Optional[X] and Optional[Y] are non-overlapping if X and Y are\n non-overlapping, although technically None is overlap, it is most\n likely an error.\n * Any overlaps with everything, i.e. always safe.\n * Special case: b'abc' in b'cde' is safe.\n \"\"\"\n if not self.chk.options.strict_equality:\n return False\n\n left, right = get_proper_types((left, right))\n\n if self.chk.binder.is_unreachable_warning_suppressed():\n # We are inside a function that contains type variables with value restrictions in\n # its signature. In this case we just suppress all strict-equality checks to avoid\n # false positives for code like:\n #\n # T = TypeVar('T', str, int)\n # def f(x: T) -> T:\n # if x == 0:\n # ...\n # return x\n #\n # TODO: find a way of disabling the check only for types resulted from the expansion.\n return False\n if isinstance(left, NoneType) or isinstance(right, NoneType):\n return False\n if isinstance(left, UnionType) and isinstance(right, UnionType):\n left = remove_optional(left)\n right = remove_optional(right)\n left, right = get_proper_types((left, right))\n py2 = self.chk.options.python_version < (3, 0)\n if (original_container and has_bytes_component(original_container, py2) and\n has_bytes_component(left, py2)):\n # We need to special case bytes and bytearray, because 97 in b'abc', b'a' in b'abc',\n # b'a' in bytearray(b'abc') etc. all return True (and we want to show the error only\n # if the check can _never_ be True).\n return False\n if isinstance(left, Instance) and isinstance(right, Instance):\n # Special case some builtin implementations of AbstractSet.\n if (left.type.fullname in OVERLAPPING_TYPES_WHITELIST and\n right.type.fullname in OVERLAPPING_TYPES_WHITELIST):\n abstract_set = self.chk.lookup_typeinfo('typing.AbstractSet')\n left = map_instance_to_supertype(left, abstract_set)\n right = map_instance_to_supertype(right, abstract_set)\n return not is_overlapping_types(left.args[0], right.args[0])\n if isinstance(left, LiteralType) and isinstance(right, LiteralType):\n if isinstance(left.value, bool) and isinstance(right.value, bool):\n # Comparing different booleans is not dangerous.\n return False\n return not is_overlapping_types(left, right, ignore_promotions=False)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.get_operator_method_ExpressionChecker.check_method_call_by_name.return.self_check_method_call_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.get_operator_method_ExpressionChecker.check_method_call_by_name.return.self_check_method_call_", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2350, "end_line": 2385, "span_ids": ["ExpressionChecker.get_operator_method", "ExpressionChecker.check_method_call_by_name"], "tokens": 343}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def get_operator_method(self, op: str) -> str:\n if op == '/' and self.chk.options.python_version[0] == 2:\n # TODO also check for \"from __future__ import division\"\n return '__div__'\n else:\n return nodes.op_methods[op]\n\n def check_method_call_by_name(self,\n method: str,\n base_type: Type,\n args: List[Expression],\n arg_kinds: List[int],\n context: Context,\n local_errors: Optional[MessageBuilder] = None,\n original_type: Optional[Type] = None\n ) -> Tuple[Type, Type]:\n \"\"\"Type check a call to a named method on an object.\n\n Return tuple (result type, inferred method type). The 'original_type'\n is used for error messages.\n \"\"\"\n local_errors = local_errors or self.msg\n original_type = original_type or base_type\n # Unions are special-cased to allow plugins to act on each element of the union.\n base_type = get_proper_type(base_type)\n if isinstance(base_type, UnionType):\n return self.check_union_method_call_by_name(method, base_type,\n args, arg_kinds,\n context, local_errors, original_type)\n\n method_type = analyze_member_access(method, base_type, context, False, False, True,\n local_errors, original_type=original_type,\n chk=self.chk,\n in_literal_context=self.is_literal_context())\n return self.check_method_call(\n method, base_type, method_type, args, arg_kinds, context, local_errors)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_union_method_call_by_name_ExpressionChecker.check_union_method_call_by_name.return.make_simplified_union_res": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_union_method_call_by_name_ExpressionChecker.check_union_method_call_by_name.return.make_simplified_union_res", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2387, "end_line": 2414, "span_ids": ["ExpressionChecker.check_union_method_call_by_name"], "tokens": 272}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def check_union_method_call_by_name(self,\n method: str,\n base_type: UnionType,\n args: List[Expression],\n arg_kinds: List[int],\n context: Context,\n local_errors: MessageBuilder,\n original_type: Optional[Type] = None\n ) -> Tuple[Type, Type]:\n \"\"\"Type check a call to a named method on an object with union type.\n\n This essentially checks the call using check_method_call_by_name() for each\n union item and unions the result. We do this to allow plugins to act on\n individual union items.\n \"\"\"\n res = [] # type: List[Type]\n meth_res = [] # type: List[Type]\n for typ in base_type.relevant_items():\n # Format error messages consistently with\n # mypy.checkmember.analyze_union_member_access().\n local_errors.disable_type_names += 1\n item, meth_item = self.check_method_call_by_name(method, typ, args, arg_kinds,\n context, local_errors,\n original_type)\n local_errors.disable_type_names -= 1\n res.append(item)\n meth_res.append(meth_item)\n return make_simplified_union(res), make_simplified_union(meth_res)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_method_call_ExpressionChecker.check_method_call.return.self_check_call_method_ty": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_method_call_ExpressionChecker.check_method_call.return.self_check_call_method_ty", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2428, "end_line": 2449, "span_ids": ["ExpressionChecker.check_method_call"], "tokens": 217}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def check_method_call(self,\n method_name: str,\n base_type: Type,\n method_type: Type,\n args: List[Expression],\n arg_kinds: List[int],\n context: Context,\n local_errors: Optional[MessageBuilder] = None) -> Tuple[Type, Type]:\n \"\"\"Type check a call to a method with the given name and type on an object.\n\n Return tuple (result type, inferred method type).\n \"\"\"\n callable_name = self.method_fullname(base_type, method_name)\n object_type = base_type if callable_name is not None else None\n\n # Try to refine the method signature using plugin hooks before checking the call.\n method_type = self.transform_callee_type(\n callable_name, method_type, args, arg_kinds, context, object_type=object_type)\n\n return self.check_call(method_type, args, arg_kinds,\n context, arg_messages=local_errors,\n callable_name=callable_name, object_type=base_type)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_op_reversible_ExpressionChecker.check_op_reversible.lookup_operator.if_local_errors_is_errors.else_.return.member": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_op_reversible_ExpressionChecker.check_op_reversible.lookup_operator.if_local_errors_is_errors.else_.return.member", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2439, "end_line": 2481, "span_ids": ["ExpressionChecker.check_op_reversible"], "tokens": 300}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def check_op_reversible(self,\n op_name: str,\n left_type: Type,\n left_expr: Expression,\n right_type: Type,\n right_expr: Expression,\n context: Context,\n msg: MessageBuilder) -> Tuple[Type, Type]:\n def make_local_errors() -> MessageBuilder:\n \"\"\"Creates a new MessageBuilder object.\"\"\"\n local_errors = msg.clean_copy()\n local_errors.disable_count = 0\n return local_errors\n\n def lookup_operator(op_name: str, base_type: Type) -> Optional[Type]:\n \"\"\"Looks up the given operator and returns the corresponding type,\n if it exists.\"\"\"\n\n # This check is an important performance optimization,\n # even though it is mostly a subset of\n # analyze_member_access.\n # TODO: Find a way to remove this call without performance implications.\n if not self.has_member(base_type, op_name):\n return None\n\n local_errors = make_local_errors()\n\n member = analyze_member_access(\n name=op_name,\n typ=base_type,\n is_lvalue=False,\n is_super=False,\n is_operator=True,\n original_type=base_type,\n context=context,\n msg=local_errors,\n chk=self.chk,\n in_literal_context=self.is_literal_context()\n )\n if local_errors.is_errors():\n return None\n else:\n return member\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_op_reversible.lookup_definer_ExpressionChecker.check_op_reversible.lookup_definer.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_op_reversible.lookup_definer_ExpressionChecker.check_op_reversible.lookup_definer.return.None", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2483, "end_line": 2497, "span_ids": ["ExpressionChecker.check_op_reversible"], "tokens": 221}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def check_op_reversible(self,\n op_name: str,\n left_type: Type,\n left_expr: Expression,\n right_type: Type,\n right_expr: Expression,\n context: Context,\n msg: MessageBuilder) -> Tuple[Type, Type]:\n # ... other code\n\n def lookup_definer(typ: Instance, attr_name: str) -> Optional[str]:\n \"\"\"Returns the name of the class that contains the actual definition of attr_name.\n\n So if class A defines foo and class B subclasses A, running\n 'get_class_defined_in(B, \"foo\")` would return the full name of A.\n\n However, if B were to override and redefine foo, that method call would\n return the full name of B instead.\n\n If the attr name is not present in the given class or its MRO, returns None.\n \"\"\"\n for cls in typ.type.mro:\n if cls.names.get(attr_name):\n return cls.fullname\n return None\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_op_reversible.left_type_ExpressionChecker.check_op_reversible.is_python_2.self_chk_options_python_v": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_op_reversible.left_type_ExpressionChecker.check_op_reversible.is_python_2.self_chk_options_python_v", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2499, "end_line": 2567, "span_ids": ["ExpressionChecker.check_op_reversible"], "tokens": 771}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def check_op_reversible(self,\n op_name: str,\n left_type: Type,\n left_expr: Expression,\n right_type: Type,\n right_expr: Expression,\n context: Context,\n msg: MessageBuilder) -> Tuple[Type, Type]:\n # ... other code\n\n left_type = get_proper_type(left_type)\n right_type = get_proper_type(right_type)\n\n # If either the LHS or the RHS are Any, we can't really concluding anything\n # about the operation since the Any type may or may not define an\n # __op__ or __rop__ method. So, we punt and return Any instead.\n\n if isinstance(left_type, AnyType):\n any_type = AnyType(TypeOfAny.from_another_any, source_any=left_type)\n return any_type, any_type\n if isinstance(right_type, AnyType):\n any_type = AnyType(TypeOfAny.from_another_any, source_any=right_type)\n return any_type, any_type\n\n # STEP 1:\n # We start by getting the __op__ and __rop__ methods, if they exist.\n\n rev_op_name = self.get_reverse_op_method(op_name)\n\n left_op = lookup_operator(op_name, left_type)\n right_op = lookup_operator(rev_op_name, right_type)\n\n # STEP 2a:\n # We figure out in which order Python will call the operator methods. As it\n # turns out, it's not as simple as just trying to call __op__ first and\n # __rop__ second.\n #\n # We store the determined order inside the 'variants_raw' variable,\n # which records tuples containing the method, base type, and the argument.\n\n bias_right = is_proper_subtype(right_type, left_type)\n if op_name in nodes.op_methods_that_shortcut and is_same_type(left_type, right_type):\n # When we do \"A() + A()\", for example, Python will only call the __add__ method,\n # never the __radd__ method.\n #\n # This is the case even if the __add__ method is completely missing and the __radd__\n # method is defined.\n\n variants_raw = [\n (left_op, left_type, right_expr)\n ]\n elif (is_subtype(right_type, left_type)\n and isinstance(left_type, Instance)\n and isinstance(right_type, Instance)\n and lookup_definer(left_type, op_name) != lookup_definer(right_type, rev_op_name)):\n # When we do \"A() + B()\" where B is a subclass of B, we'll actually try calling\n # B's __radd__ method first, but ONLY if B explicitly defines or overrides the\n # __radd__ method.\n #\n # This mechanism lets subclasses \"refine\" the expected outcome of the operation, even\n # if they're located on the RHS.\n\n variants_raw = [\n (right_op, right_type, left_expr),\n (left_op, left_type, right_expr),\n ]\n else:\n # In all other cases, we do the usual thing and call __add__ first and\n # __radd__ second when doing \"A() + B()\".\n\n variants_raw = [\n (left_op, left_type, right_expr),\n (right_op, right_type, left_expr),\n ]\n\n # STEP 2b:\n # When running Python 2, we might also try calling the __cmp__ method.\n\n is_python_2 = self.chk.options.python_version[0] == 2\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_op_reversible.if_is_python_2_and_op_nam_ExpressionChecker.check_op_reversible.if_len_results_1_.else_.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_op_reversible.if_is_python_2_and_op_nam_ExpressionChecker.check_op_reversible.if_len_results_1_.else_.return.result", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2568, "end_line": 2641, "span_ids": ["ExpressionChecker.check_op_reversible"], "tokens": 735}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def check_op_reversible(self,\n op_name: str,\n left_type: Type,\n left_expr: Expression,\n right_type: Type,\n right_expr: Expression,\n context: Context,\n msg: MessageBuilder) -> Tuple[Type, Type]:\n # ... other code\n if is_python_2 and op_name in nodes.ops_falling_back_to_cmp:\n cmp_method = nodes.comparison_fallback_method\n left_cmp_op = lookup_operator(cmp_method, left_type)\n right_cmp_op = lookup_operator(cmp_method, right_type)\n\n if bias_right:\n variants_raw.append((right_cmp_op, right_type, left_expr))\n variants_raw.append((left_cmp_op, left_type, right_expr))\n else:\n variants_raw.append((left_cmp_op, left_type, right_expr))\n variants_raw.append((right_cmp_op, right_type, left_expr))\n\n # STEP 3:\n # We now filter out all non-existent operators. The 'variants' list contains\n # all operator methods that are actually present, in the order that Python\n # attempts to invoke them.\n\n variants = [(op, obj, arg) for (op, obj, arg) in variants_raw if op is not None]\n\n # STEP 4:\n # We now try invoking each one. If an operation succeeds, end early and return\n # the corresponding result. Otherwise, return the result and errors associated\n # with the first entry.\n\n errors = []\n results = []\n for method, obj, arg in variants:\n local_errors = make_local_errors()\n result = self.check_method_call(\n op_name, obj, method, [arg], [ARG_POS], context, local_errors)\n if local_errors.is_errors():\n errors.append(local_errors)\n results.append(result)\n else:\n return result\n\n # We finish invoking above operators and no early return happens. Therefore,\n # we check if either the LHS or the RHS is Instance and fallbacks to Any,\n # if so, we also return Any\n if ((isinstance(left_type, Instance) and left_type.type.fallback_to_any) or\n (isinstance(right_type, Instance) and right_type.type.fallback_to_any)):\n any_type = AnyType(TypeOfAny.special_form)\n return any_type, any_type\n\n # STEP 4b:\n # Sometimes, the variants list is empty. In that case, we fall-back to attempting to\n # call the __op__ method (even though it's missing).\n\n if not variants:\n local_errors = make_local_errors()\n result = self.check_method_call_by_name(\n op_name, left_type, [right_expr], [ARG_POS], context, local_errors)\n\n if local_errors.is_errors():\n errors.append(local_errors)\n results.append(result)\n else:\n # In theory, we should never enter this case, but it seems\n # we sometimes do, when dealing with Type[...]? E.g. see\n # check-classes.testTypeTypeComparisonWorks.\n #\n # This is probably related to the TODO in lookup_operator(...)\n # up above.\n #\n # TODO: Remove this extra case\n return result\n\n msg.add_errors(errors[0])\n if len(results) == 1:\n return results[0]\n else:\n error_any = AnyType(TypeOfAny.from_error)\n result = error_any, error_any\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_op_ExpressionChecker.check_op.if_allow_reverse_.else_.return.self_check_method_call_by": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_op_ExpressionChecker.check_op.if_allow_reverse_.else_.return.self_check_method_call_by", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2643, "end_line": 2747, "span_ids": ["ExpressionChecker.check_op"], "tokens": 951}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def check_op(self, method: str, base_type: Type,\n arg: Expression, context: Context,\n allow_reverse: bool = False) -> Tuple[Type, Type]:\n \"\"\"Type check a binary operation which maps to a method call.\n\n Return tuple (result type, inferred operator method type).\n \"\"\"\n\n if allow_reverse:\n left_variants = [base_type]\n base_type = get_proper_type(base_type)\n if isinstance(base_type, UnionType):\n left_variants = [item for item in\n flatten_nested_unions(base_type.relevant_items(),\n handle_type_alias_type=True)]\n right_type = self.accept(arg)\n\n # Step 1: We first try leaving the right arguments alone and destructure\n # just the left ones. (Mypy can sometimes perform some more precise inference\n # if we leave the right operands a union -- see testOperatorWithEmptyListAndSum.)\n msg = self.msg.clean_copy()\n msg.disable_count = 0\n all_results = []\n all_inferred = []\n\n for left_possible_type in left_variants:\n result, inferred = self.check_op_reversible(\n op_name=method,\n left_type=left_possible_type,\n left_expr=TempNode(left_possible_type, context=context),\n right_type=right_type,\n right_expr=arg,\n context=context,\n msg=msg)\n all_results.append(result)\n all_inferred.append(inferred)\n\n if not msg.is_errors():\n results_final = make_simplified_union(all_results)\n inferred_final = make_simplified_union(all_inferred)\n return results_final, inferred_final\n\n # Step 2: If that fails, we try again but also destructure the right argument.\n # This is also necessary to make certain edge cases work -- see\n # testOperatorDoubleUnionInterwovenUnionAdd, for example.\n\n # Note: We want to pass in the original 'arg' for 'left_expr' and 'right_expr'\n # whenever possible so that plugins and similar things can introspect on the original\n # node if possible.\n #\n # We don't do the same for the base expression because it could lead to weird\n # type inference errors -- e.g. see 'testOperatorDoubleUnionSum'.\n # TODO: Can we use `type_overrides_set()` here?\n right_variants = [(right_type, arg)]\n right_type = get_proper_type(right_type)\n if isinstance(right_type, UnionType):\n right_variants = [(item, TempNode(item, context=context))\n for item in flatten_nested_unions(right_type.relevant_items(),\n handle_type_alias_type=True)]\n msg = self.msg.clean_copy()\n msg.disable_count = 0\n all_results = []\n all_inferred = []\n\n for left_possible_type in left_variants:\n for right_possible_type, right_expr in right_variants:\n result, inferred = self.check_op_reversible(\n op_name=method,\n left_type=left_possible_type,\n left_expr=TempNode(left_possible_type, context=context),\n right_type=right_possible_type,\n right_expr=right_expr,\n context=context,\n msg=msg)\n all_results.append(result)\n all_inferred.append(inferred)\n\n if msg.is_errors():\n self.msg.add_errors(msg)\n # Point any notes to the same location as an existing message.\n recent_context = msg.most_recent_context()\n if len(left_variants) >= 2 and len(right_variants) >= 2:\n self.msg.warn_both_operands_are_from_unions(recent_context)\n elif len(left_variants) >= 2:\n self.msg.warn_operand_was_from_union(\n \"Left\", base_type, context=recent_context)\n elif len(right_variants) >= 2:\n self.msg.warn_operand_was_from_union(\n \"Right\", right_type, context=recent_context)\n\n # See the comment in 'check_overload_call' for more details on why\n # we call 'combine_function_signature' instead of just unioning the inferred\n # callable types.\n results_final = make_simplified_union(all_results)\n inferred_final = self.combine_function_signatures(all_inferred)\n return results_final, inferred_final\n else:\n return self.check_method_call_by_name(\n method=method,\n base_type=base_type,\n args=[arg],\n arg_kinds=[ARG_POS],\n context=context,\n local_errors=self.msg,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.get_reverse_op_method_ExpressionChecker.check_boolean_op.if_isinstance_restricted_.else_.return.make_simplified_union_re": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.get_reverse_op_method_ExpressionChecker.check_boolean_op.if_isinstance_restricted_.else_.return.make_simplified_union_re", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2749, "end_line": 2830, "span_ids": ["ExpressionChecker.get_reverse_op_method", "ExpressionChecker.check_boolean_op"], "tokens": 772}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def get_reverse_op_method(self, method: str) -> str:\n if method == '__div__' and self.chk.options.python_version[0] == 2:\n return '__rdiv__'\n else:\n return nodes.reverse_op_methods[method]\n\n def check_boolean_op(self, e: OpExpr, context: Context) -> Type:\n \"\"\"Type check a boolean operation ('and' or 'or').\"\"\"\n\n # A boolean operation can evaluate to either of the operands.\n\n # We use the current type context to guide the type inference of of\n # the left operand. We also use the left operand type to guide the type\n # inference of the right operand so that expressions such as\n # '[1] or []' are inferred correctly.\n ctx = self.type_context[-1]\n left_type = self.accept(e.left, ctx)\n\n assert e.op in ('and', 'or') # Checked by visit_op_expr\n\n if e.op == 'and':\n right_map, left_map = self.chk.find_isinstance_check(e.left)\n restricted_left_type = false_only(left_type)\n result_is_left = not left_type.can_be_true\n elif e.op == 'or':\n left_map, right_map = self.chk.find_isinstance_check(e.left)\n restricted_left_type = true_only(left_type)\n result_is_left = not left_type.can_be_false\n\n # If left_map is None then we know mypy considers the left expression\n # to be redundant.\n #\n # Note that we perform these checks *before* we take into account\n # the analysis from the semanal phase below. We assume that nodes\n # marked as unreachable during semantic analysis were done so intentionally.\n # So, we shouldn't report an error.\n if codes.REDUNDANT_EXPR in self.chk.options.enabled_error_codes:\n if left_map is None:\n self.msg.redundant_left_operand(e.op, e.left)\n\n # If right_map is None then we know mypy considers the right branch\n # to be unreachable and therefore any errors found in the right branch\n # should be suppressed.\n #\n # Note that we perform these checks *before* we take into account\n # the analysis from the semanal phase below. We assume that nodes\n # marked as unreachable during semantic analysis were done so intentionally.\n # So, we shouldn't report an error.\n if self.chk.should_report_unreachable_issues():\n if right_map is None:\n self.msg.unreachable_right_operand(e.op, e.right)\n\n if e.right_unreachable:\n right_map = None\n elif e.right_always:\n left_map = None\n\n if right_map is None:\n self.msg.disable_errors()\n try:\n right_type = self.analyze_cond_branch(right_map, e.right, left_type)\n finally:\n if right_map is None:\n self.msg.enable_errors()\n\n if right_map is None:\n # The boolean expression is statically known to be the left value\n assert left_map is not None # find_isinstance_check guarantees this\n return left_type\n if left_map is None:\n # The boolean expression is statically known to be the right value\n assert right_map is not None # find_isinstance_check guarantees this\n return right_type\n\n if isinstance(restricted_left_type, UninhabitedType):\n # The left operand can never be the result\n return right_type\n elif result_is_left:\n # The left operand is always the result\n return left_type\n else:\n return make_simplified_union([restricted_left_type, right_type])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_list_multiply_ExpressionChecker.check_list_multiply.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_list_multiply_ExpressionChecker.check_list_multiply.return.result", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2832, "end_line": 2846, "span_ids": ["ExpressionChecker.check_list_multiply"], "tokens": 167}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def check_list_multiply(self, e: OpExpr) -> Type:\n \"\"\"Type check an expression of form '[...] * e'.\n\n Type inference is special-cased for this common construct.\n \"\"\"\n right_type = self.accept(e.right)\n if is_subtype(right_type, self.named_type('builtins.int')):\n # Special case: [...] * . Use the type context of the\n # OpExpr, since the multiplication does not affect the type.\n left_type = self.accept(e.left, type_context=self.type_context[-1])\n else:\n left_type = self.accept(e.left)\n result, method_type = self.check_op('__mul__', left_type, e.right, e)\n e.method_type = method_type\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_assignment_expr_ExpressionChecker.visit_index_expr_helper.return.self_visit_index_with_typ": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_assignment_expr_ExpressionChecker.visit_index_expr_helper.return.self_visit_index_with_typ", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2848, "end_line": 2885, "span_ids": ["ExpressionChecker.visit_index_expr", "ExpressionChecker.visit_unary_expr", "ExpressionChecker.visit_assignment_expr", "ExpressionChecker.visit_index_expr_helper"], "tokens": 349}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def visit_assignment_expr(self, e: AssignmentExpr) -> Type:\n value = self.accept(e.value)\n self.chk.check_assignment(e.target, e.value)\n self.chk.check_final(e)\n self.chk.store_type(e.target, value)\n self.find_partial_type_ref_fast_path(e.target)\n return value\n\n def visit_unary_expr(self, e: UnaryExpr) -> Type:\n \"\"\"Type check an unary operation ('not', '-', '+' or '~').\"\"\"\n operand_type = self.accept(e.expr)\n op = e.op\n if op == 'not':\n result = self.bool_type() # type: Type\n else:\n method = nodes.unary_op_methods[op]\n result, method_type = self.check_method_call_by_name(method, operand_type, [], [], e)\n e.method_type = method_type\n return result\n\n def visit_index_expr(self, e: IndexExpr) -> Type:\n \"\"\"Type check an index expression (base[index]).\n\n It may also represent type application.\n \"\"\"\n result = self.visit_index_expr_helper(e)\n result = get_proper_type(self.narrow_type_from_binder(e, result))\n if (self.is_literal_context() and isinstance(result, Instance)\n and result.last_known_value is not None):\n result = result.last_known_value\n return result\n\n def visit_index_expr_helper(self, e: IndexExpr) -> Type:\n if e.analyzed:\n # It's actually a type application.\n return self.accept(e.analyzed)\n left_type = self.accept(e.base)\n return self.visit_index_with_type(left_type, e)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_index_with_type_ExpressionChecker.visit_index_with_type.if_isinstance_left_type_.else_.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_index_with_type_ExpressionChecker.visit_index_with_type.if_isinstance_left_type_.else_.return.result", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2899, "end_line": 2948, "span_ids": ["ExpressionChecker.visit_index_with_type"], "tokens": 486}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def visit_index_with_type(self, left_type: Type, e: IndexExpr,\n original_type: Optional[ProperType] = None) -> Type:\n \"\"\"Analyze type of an index expression for a given type of base expression.\n\n The 'original_type' is used for error messages (currently used for union types).\n \"\"\"\n index = e.index\n left_type = get_proper_type(left_type)\n\n # Visit the index, just to make sure we have a type for it available\n self.accept(index)\n\n if isinstance(left_type, UnionType):\n original_type = original_type or left_type\n # Don't combine literal types, since we may need them for type narrowing.\n return make_simplified_union([self.visit_index_with_type(typ, e,\n original_type)\n for typ in left_type.relevant_items()],\n contract_literals=False)\n elif isinstance(left_type, TupleType) and self.chk.in_checked_function():\n # Special case for tuples. They return a more specific type when\n # indexed by an integer literal.\n if isinstance(index, SliceExpr):\n return self.visit_tuple_slice_helper(left_type, index)\n\n ns = self.try_getting_int_literals(index)\n if ns is not None:\n out = []\n for n in ns:\n if n < 0:\n n += len(left_type.items)\n if 0 <= n < len(left_type.items):\n out.append(left_type.items[n])\n else:\n self.chk.fail(message_registry.TUPLE_INDEX_OUT_OF_RANGE, e)\n return AnyType(TypeOfAny.from_error)\n return make_simplified_union(out)\n else:\n return self.nonliteral_tuple_index_helper(left_type, index)\n elif isinstance(left_type, TypedDictType):\n return self.visit_typeddict_index_expr(left_type, e.index)\n elif (isinstance(left_type, CallableType)\n and left_type.is_type_obj() and left_type.type_object().is_enum):\n return self.visit_enum_index_expr(left_type.type_object(), e.index, e)\n else:\n result, method_type = self.check_method_call_by_name(\n '__getitem__', left_type, [e.index], [ARG_POS], e,\n original_type=original_type)\n e.method_type = method_type\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_tuple_slice_helper_ExpressionChecker.visit_tuple_slice_helper.return.make_simplified_union_ite": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_tuple_slice_helper_ExpressionChecker.visit_tuple_slice_helper.return.make_simplified_union_ite", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2935, "end_line": 2961, "span_ids": ["ExpressionChecker.visit_tuple_slice_helper"], "tokens": 263}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def visit_tuple_slice_helper(self, left_type: TupleType, slic: SliceExpr) -> Type:\n begin = [None] # type: Sequence[Optional[int]]\n end = [None] # type: Sequence[Optional[int]]\n stride = [None] # type: Sequence[Optional[int]]\n\n if slic.begin_index:\n begin_raw = self.try_getting_int_literals(slic.begin_index)\n if begin_raw is None:\n return self.nonliteral_tuple_index_helper(left_type, slic)\n begin = begin_raw\n\n if slic.end_index:\n end_raw = self.try_getting_int_literals(slic.end_index)\n if end_raw is None:\n return self.nonliteral_tuple_index_helper(left_type, slic)\n end = end_raw\n\n if slic.stride:\n stride_raw = self.try_getting_int_literals(slic.stride)\n if stride_raw is None:\n return self.nonliteral_tuple_index_helper(left_type, slic)\n stride = stride_raw\n\n items = [] # type: List[Type]\n for b, e, s in itertools.product(begin, end, stride):\n items.append(left_type.slice(b, e, s))\n return make_simplified_union(items)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.try_getting_int_literals_ExpressionChecker.try_getting_int_literals.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.try_getting_int_literals_ExpressionChecker.try_getting_int_literals.return.None", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2963, "end_line": 2995, "span_ids": ["ExpressionChecker.try_getting_int_literals"], "tokens": 311}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def try_getting_int_literals(self, index: Expression) -> Optional[List[int]]:\n \"\"\"If the given expression or type corresponds to an int literal\n or a union of int literals, returns a list of the underlying ints.\n Otherwise, returns None.\n\n Specifically, this function is guaranteed to return a list with\n one or more ints if one one the following is true:\n\n 1. 'expr' is a IntExpr or a UnaryExpr backed by an IntExpr\n 2. 'typ' is a LiteralType containing an int\n 3. 'typ' is a UnionType containing only LiteralType of ints\n \"\"\"\n if isinstance(index, IntExpr):\n return [index.value]\n elif isinstance(index, UnaryExpr):\n if index.op == '-':\n operand = index.expr\n if isinstance(operand, IntExpr):\n return [-1 * operand.value]\n typ = get_proper_type(self.accept(index))\n if isinstance(typ, Instance) and typ.last_known_value is not None:\n typ = typ.last_known_value\n if isinstance(typ, LiteralType) and isinstance(typ.value, int):\n return [typ.value]\n if isinstance(typ, UnionType):\n out = []\n for item in get_proper_types(typ.items):\n if isinstance(item, LiteralType) and isinstance(item.value, int):\n out.append(item.value)\n else:\n return None\n return out\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.nonliteral_tuple_index_helper_ExpressionChecker.nonliteral_tuple_index_helper.if_not_self_chk_check_sub.else_.if_isinstance_index_Slic.else_.return.union": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.nonliteral_tuple_index_helper_ExpressionChecker.nonliteral_tuple_index_helper.if_not_self_chk_check_sub.else_.if_isinstance_index_Slic.else_.return.union", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2997, "end_line": 3010, "span_ids": ["ExpressionChecker.nonliteral_tuple_index_helper"], "tokens": 152}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def nonliteral_tuple_index_helper(self, left_type: TupleType, index: Expression) -> Type:\n index_type = self.accept(index)\n expected_type = UnionType.make_union([self.named_type('builtins.int'),\n self.named_type('builtins.slice')])\n if not self.chk.check_subtype(index_type, expected_type, index,\n message_registry.INVALID_TUPLE_INDEX_TYPE,\n 'actual type', 'expected type'):\n return AnyType(TypeOfAny.from_error)\n else:\n union = make_simplified_union(left_type.items)\n if isinstance(index, SliceExpr):\n return self.chk.named_generic_type('builtins.tuple', [union])\n else:\n return union", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_typeddict_index_expr_ExpressionChecker.visit_typeddict_index_expr.return.make_simplified_union_val": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_typeddict_index_expr_ExpressionChecker.visit_typeddict_index_expr.return.make_simplified_union_val", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3012, "end_line": 3043, "span_ids": ["ExpressionChecker.visit_typeddict_index_expr"], "tokens": 296}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def visit_typeddict_index_expr(self, td_type: TypedDictType, index: Expression) -> Type:\n if isinstance(index, (StrExpr, UnicodeExpr)):\n key_names = [index.value]\n else:\n typ = get_proper_type(self.accept(index))\n if isinstance(typ, UnionType):\n key_types = list(typ.items) # type: List[Type]\n else:\n key_types = [typ]\n\n key_names = []\n for key_type in get_proper_types(key_types):\n if isinstance(key_type, Instance) and key_type.last_known_value is not None:\n key_type = key_type.last_known_value\n\n if (isinstance(key_type, LiteralType)\n and isinstance(key_type.value, str)\n and key_type.fallback.type.fullname != 'builtins.bytes'):\n key_names.append(key_type.value)\n else:\n self.msg.typeddict_key_must_be_string_literal(td_type, index)\n return AnyType(TypeOfAny.from_error)\n\n value_types = []\n for key_name in key_names:\n value_type = td_type.items.get(key_name)\n if value_type is None:\n self.msg.typeddict_key_not_found(td_type, key_name, index)\n return AnyType(TypeOfAny.from_error)\n else:\n value_types.append(value_type)\n return make_simplified_union(value_types)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_enum_index_expr_ExpressionChecker.visit_enum_index_expr.return.Instance_enum_type_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_enum_index_expr_ExpressionChecker.visit_enum_index_expr.return.Instance_enum_type_", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3045, "end_line": 3053, "span_ids": ["ExpressionChecker.visit_enum_index_expr"], "tokens": 123}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def visit_enum_index_expr(self, enum_type: TypeInfo, index: Expression,\n context: Context) -> Type:\n string_type = self.named_type('builtins.str') # type: Type\n if self.chk.options.python_version[0] < 3:\n string_type = UnionType.make_union([string_type,\n self.named_type('builtins.unicode')])\n self.chk.check_subtype(self.accept(index), string_type, context,\n \"Enum index should be a string\", \"actual index type\")\n return Instance(enum_type, [])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_cast_expr_ExpressionChecker.visit_cast_expr.return.target_type": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_cast_expr_ExpressionChecker.visit_cast_expr.return.target_type", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3055, "end_line": 3068, "span_ids": ["ExpressionChecker.visit_cast_expr"], "tokens": 199}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def visit_cast_expr(self, expr: CastExpr) -> Type:\n \"\"\"Type check a cast expression.\"\"\"\n source_type = self.accept(expr.expr, type_context=AnyType(TypeOfAny.special_form),\n allow_none_return=True, always_allow_any=True)\n target_type = expr.type\n options = self.chk.options\n if (options.warn_redundant_casts and not isinstance(get_proper_type(target_type), AnyType)\n and is_same_type(source_type, target_type)):\n self.msg.redundant_cast(target_type, expr)\n if options.disallow_any_unimported and has_any_from_unimported_type(target_type):\n self.msg.unimported_type_becomes_any(\"Target type of cast\", target_type, expr)\n check_for_explicit_any(target_type, self.chk.options, self.chk.is_typeshed_stub, self.msg,\n context=expr)\n return target_type", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_reveal_expr_ExpressionChecker.visit_reveal_expr.if_expr_kind_REVEAL_TY.else_.return.NoneType_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_reveal_expr_ExpressionChecker.visit_reveal_expr.if_expr_kind_REVEAL_TY.else_.return.NoneType_", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3070, "end_line": 3093, "span_ids": ["ExpressionChecker.visit_reveal_expr"], "tokens": 247}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def visit_reveal_expr(self, expr: RevealExpr) -> Type:\n \"\"\"Type check a reveal_type expression.\"\"\"\n if expr.kind == REVEAL_TYPE:\n assert expr.expr is not None\n revealed_type = self.accept(expr.expr, type_context=self.type_context[-1],\n allow_none_return=True)\n if not self.chk.current_node_deferred:\n self.msg.reveal_type(revealed_type, expr.expr)\n if not self.chk.in_checked_function():\n self.msg.note(\"'reveal_type' always outputs 'Any' in unchecked functions\",\n expr.expr)\n return revealed_type\n else:\n # REVEAL_LOCALS\n if not self.chk.current_node_deferred:\n # the RevealExpr contains a local_nodes attribute,\n # calculated at semantic analysis time. Use it to pull out the\n # corresponding subset of variables in self.chk.type_map\n names_to_types = {\n var_node.name: var_node.type for var_node in expr.local_nodes\n } if expr.local_nodes is not None else {}\n\n self.msg.reveal_locals(names_to_types, expr)\n return NoneType()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_type_application_ExpressionChecker.visit_type_application.return.AnyType_TypeOfAny_special": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_type_application_ExpressionChecker.visit_type_application.return.AnyType_TypeOfAny_special", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3095, "end_line": 3125, "span_ids": ["ExpressionChecker.visit_type_application"], "tokens": 389}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def visit_type_application(self, tapp: TypeApplication) -> Type:\n \"\"\"Type check a type application (expr[type, ...]).\n\n There are two different options here, depending on whether expr refers\n to a type alias or directly to a generic class. In the first case we need\n to use a dedicated function typeanal.expand_type_aliases. This\n is due to the fact that currently type aliases machinery uses\n unbound type variables, while normal generics use bound ones;\n see TypeAlias docstring for more details.\n \"\"\"\n if isinstance(tapp.expr, RefExpr) and isinstance(tapp.expr.node, TypeAlias):\n # Subscription of a (generic) alias in runtime context, expand the alias.\n item = expand_type_alias(tapp.expr.node, tapp.types, self.chk.fail,\n tapp.expr.node.no_args, tapp)\n item = get_proper_type(item)\n if isinstance(item, Instance):\n tp = type_object_type(item.type, self.named_type)\n return self.apply_type_arguments_to_callable(tp, item.args, tapp)\n else:\n self.chk.fail(message_registry.ONLY_CLASS_APPLICATION, tapp)\n return AnyType(TypeOfAny.from_error)\n # Type application of a normal generic class in runtime context.\n # This is typically used as `x = G[int]()`.\n tp = get_proper_type(self.accept(tapp.expr))\n if isinstance(tp, (CallableType, Overloaded)):\n if not tp.is_type_obj():\n self.chk.fail(message_registry.ONLY_CLASS_APPLICATION, tapp)\n return self.apply_type_arguments_to_callable(tp, tapp.types, tapp)\n if isinstance(tp, AnyType):\n return AnyType(TypeOfAny.from_another_any, source_any=tp)\n return AnyType(TypeOfAny.special_form)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_type_alias_expr_ExpressionChecker.visit_type_alias_expr.return.self_alias_type_in_runtim": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_type_alias_expr_ExpressionChecker.visit_type_alias_expr.return.self_alias_type_in_runtim", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3127, "end_line": 3140, "span_ids": ["ExpressionChecker.visit_type_alias_expr"], "tokens": 132}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def visit_type_alias_expr(self, alias: TypeAliasExpr) -> Type:\n \"\"\"Right hand side of a type alias definition.\n\n It has the same type as if the alias itself was used in a runtime context.\n For example, here:\n\n A = reveal_type(List[T])\n reveal_type(A)\n\n both `reveal_type` instances will reveal the same type `def (...) -> builtins.list[Any]`.\n Note that type variables are implicitly substituted with `Any`.\n \"\"\"\n return self.alias_type_in_runtime_context(alias.node, alias.no_args,\n alias, alias_definition=True)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.alias_type_in_runtime_context_ExpressionChecker.alias_type_in_runtime_context.if_isinstance_item_Insta.else_.return.self_named_type_builtins": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.alias_type_in_runtime_context_ExpressionChecker.alias_type_in_runtime_context.if_isinstance_item_Insta.else_.return.self_named_type_builtins", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3142, "end_line": 3184, "span_ids": ["ExpressionChecker.alias_type_in_runtime_context"], "tokens": 467}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def alias_type_in_runtime_context(self, alias: TypeAlias,\n no_args: bool, ctx: Context,\n *,\n alias_definition: bool = False) -> Type:\n \"\"\"Get type of a type alias (could be generic) in a runtime expression.\n\n Note that this function can be called only if the alias appears _not_\n as a target of type application, which is treated separately in the\n visit_type_application method. Some examples where this method is called are\n casts and instantiation:\n\n class LongName(Generic[T]): ...\n A = LongName[int]\n\n x = A()\n y = cast(A, ...)\n \"\"\"\n if isinstance(alias.target, Instance) and alias.target.invalid: # type: ignore\n # An invalid alias, error already has been reported\n return AnyType(TypeOfAny.from_error)\n # If this is a generic alias, we set all variables to `Any`.\n # For example:\n # A = List[Tuple[T, T]]\n # x = A() <- same as List[Tuple[Any, Any]], see PEP 484.\n item = get_proper_type(set_any_tvars(alias, ctx.line, ctx.column))\n if isinstance(item, Instance):\n # Normally we get a callable type (or overloaded) with .is_type_obj() true\n # representing the class's constructor\n tp = type_object_type(item.type, self.named_type)\n if no_args:\n return tp\n return self.apply_type_arguments_to_callable(tp, item.args, ctx)\n elif (isinstance(item, TupleType) and\n # Tuple[str, int]() fails at runtime, only named tuples and subclasses work.\n tuple_fallback(item).type.fullname != 'builtins.tuple'):\n return type_object_type(tuple_fallback(item).type, self.named_type)\n elif isinstance(item, AnyType):\n return AnyType(TypeOfAny.from_another_any, source_any=item)\n else:\n if alias_definition:\n return AnyType(TypeOfAny.special_form)\n # This type is invalid in most runtime contexts, give it an 'object' type.\n return self.named_type('builtins.object')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.apply_type_arguments_to_callable_ExpressionChecker.apply_type_arguments_to_callable.return.AnyType_TypeOfAny_special": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.apply_type_arguments_to_callable_ExpressionChecker.apply_type_arguments_to_callable.return.AnyType_TypeOfAny_special", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3186, "end_line": 3212, "span_ids": ["ExpressionChecker.apply_type_arguments_to_callable"], "tokens": 267}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def apply_type_arguments_to_callable(\n self, tp: Type, args: Sequence[Type], ctx: Context\n ) -> Type:\n \"\"\"Apply type arguments to a generic callable type coming from a type object.\n\n This will first perform type arguments count checks, report the\n error as needed, and return the correct kind of Any. As a special\n case this returns Any for non-callable types, because if type object type\n is not callable, then an error should be already reported.\n \"\"\"\n tp = get_proper_type(tp)\n\n if isinstance(tp, CallableType):\n if len(tp.variables) != len(args):\n self.msg.incompatible_type_application(len(tp.variables),\n len(args), ctx)\n return AnyType(TypeOfAny.from_error)\n return self.apply_generic_arguments(tp, args, ctx)\n if isinstance(tp, Overloaded):\n for it in tp.items():\n if len(it.variables) != len(args):\n self.msg.incompatible_type_application(len(it.variables),\n len(args), ctx)\n return AnyType(TypeOfAny.from_error)\n return Overloaded([self.apply_generic_arguments(it, args, ctx)\n for it in tp.items()])\n return AnyType(TypeOfAny.special_form)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_list_expr_ExpressionChecker.fast_container_type.return.self_chk_named_generic_ty": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_list_expr_ExpressionChecker.fast_container_type.return.self_chk_named_generic_ty", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3214, "end_line": 3248, "span_ids": ["ExpressionChecker.visit_set_expr", "ExpressionChecker.visit_list_expr", "ExpressionChecker.fast_container_type"], "tokens": 295}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def visit_list_expr(self, e: ListExpr) -> Type:\n \"\"\"Type check a list expression [...].\"\"\"\n return self.check_lst_expr(e.items, 'builtins.list', '', e)\n\n def visit_set_expr(self, e: SetExpr) -> Type:\n return self.check_lst_expr(e.items, 'builtins.set', '', e)\n\n def fast_container_type(\n self, items: List[Expression], container_fullname: str\n ) -> Optional[Type]:\n \"\"\"\n Fast path to determine the type of a list or set literal,\n based on the list of entries. This mostly impacts large\n module-level constant definitions.\n\n Limitations:\n - no active type context\n - no star expressions\n - the joined type of all entries must be an Instance type\n \"\"\"\n ctx = self.type_context[-1]\n if ctx:\n return None\n values = [] # type: List[Type]\n for item in items:\n if isinstance(item, StarExpr):\n # fallback to slow path\n return None\n values.append(self.accept(item))\n vt = join.join_type_list(values)\n if not isinstance(vt, Instance):\n return None\n # TODO: update tests instead?\n vt.erased = True\n return self.chk.named_generic_type(container_fullname, [vt])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_lst_expr_ExpressionChecker.check_lst_expr.return.remove_instance_last_know": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_lst_expr_ExpressionChecker.check_lst_expr.return.remove_instance_last_know", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3250, "end_line": 3277, "span_ids": ["ExpressionChecker.check_lst_expr"], "tokens": 270}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def check_lst_expr(self, items: List[Expression], fullname: str,\n tag: str, context: Context) -> Type:\n # fast path\n t = self.fast_container_type(items, fullname)\n if t:\n return t\n\n # Translate into type checking a generic function call.\n # Used for list and set expressions, as well as for tuples\n # containing star expressions that don't refer to a\n # Tuple. (Note: \"lst\" stands for list-set-tuple. :-)\n tvdef = TypeVarDef('T', 'T', -1, [], self.object_type())\n tv = TypeVarType(tvdef)\n constructor = CallableType(\n [tv],\n [nodes.ARG_STAR],\n [None],\n self.chk.named_generic_type(fullname, [tv]),\n self.named_type('builtins.function'),\n name=tag,\n variables=[tvdef])\n out = self.check_call(constructor,\n [(i.expr if isinstance(i, StarExpr) else i)\n for i in items],\n [(nodes.ARG_STAR if isinstance(i, StarExpr) else nodes.ARG_POS)\n for i in items],\n context)[0]\n return remove_instance_last_known_values(out)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_tuple_expr_ExpressionChecker.visit_tuple_expr.return.TupleType_items_self_chk": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_tuple_expr_ExpressionChecker.visit_tuple_expr.return.TupleType_items_self_chk", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3279, "end_line": 3336, "span_ids": ["ExpressionChecker.visit_tuple_expr"], "tokens": 654}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def visit_tuple_expr(self, e: TupleExpr) -> Type:\n \"\"\"Type check a tuple expression.\"\"\"\n # Try to determine type context for type inference.\n type_context = get_proper_type(self.type_context[-1])\n type_context_items = None\n if isinstance(type_context, UnionType):\n tuples_in_context = [t for t in get_proper_types(type_context.items)\n if (isinstance(t, TupleType) and len(t.items) == len(e.items)) or\n is_named_instance(t, 'builtins.tuple')]\n if len(tuples_in_context) == 1:\n type_context = tuples_in_context[0]\n else:\n # There are either no relevant tuples in the Union, or there is\n # more than one. Either way, we can't decide on a context.\n pass\n\n if isinstance(type_context, TupleType):\n type_context_items = type_context.items\n elif type_context and is_named_instance(type_context, 'builtins.tuple'):\n assert isinstance(type_context, Instance)\n if type_context.args:\n type_context_items = [type_context.args[0]] * len(e.items)\n # NOTE: it's possible for the context to have a different\n # number of items than e. In that case we use those context\n # items that match a position in e, and we'll worry about type\n # mismatches later.\n\n # Infer item types. Give up if there's a star expression\n # that's not a Tuple.\n items = [] # type: List[Type]\n j = 0 # Index into type_context_items; irrelevant if type_context_items is none\n for i in range(len(e.items)):\n item = e.items[i]\n if isinstance(item, StarExpr):\n # Special handling for star expressions.\n # TODO: If there's a context, and item.expr is a\n # TupleExpr, flatten it, so we can benefit from the\n # context? Counterargument: Why would anyone write\n # (1, *(2, 3)) instead of (1, 2, 3) except in a test?\n tt = self.accept(item.expr)\n tt = get_proper_type(tt)\n if isinstance(tt, TupleType):\n items.extend(tt.items)\n j += len(tt.items)\n else:\n # A star expression that's not a Tuple.\n # Treat the whole thing as a variable-length tuple.\n return self.check_lst_expr(e.items, 'builtins.tuple', '', e)\n else:\n if not type_context_items or j >= len(type_context_items):\n tt = self.accept(item)\n else:\n tt = self.accept(item, type_context_items[j])\n j += 1\n items.append(tt)\n # This is a partial fallback item type. A precise type will be calculated on demand.\n fallback_item = AnyType(TypeOfAny.special_form)\n return TupleType(items, self.chk.named_generic_type('builtins.tuple', [fallback_item]))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.fast_dict_type_ExpressionChecker.fast_dict_type.return.self_chk_named_generic_ty": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.fast_dict_type_ExpressionChecker.fast_dict_type.return.self_chk_named_generic_ty", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3338, "end_line": 3378, "span_ids": ["ExpressionChecker.fast_dict_type"], "tokens": 359}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def fast_dict_type(self, e: DictExpr) -> Optional[Type]:\n \"\"\"\n Fast path to determine the type of a dict literal,\n based on the list of entries. This mostly impacts large\n module-level constant definitions.\n\n Limitations:\n - no active type context\n - only supported star expressions are other dict instances\n - the joined types of all keys and values must be Instance types\n \"\"\"\n ctx = self.type_context[-1]\n if ctx:\n return None\n keys = [] # type: List[Type]\n values = [] # type: List[Type]\n stargs = None # type: Optional[Tuple[Type, Type]]\n for key, value in e.items:\n if key is None:\n st = get_proper_type(self.accept(value))\n if (\n isinstance(st, Instance)\n and st.type.fullname == 'builtins.dict'\n and len(st.args) == 2\n ):\n stargs = (st.args[0], st.args[1])\n else:\n return None\n else:\n keys.append(self.accept(key))\n values.append(self.accept(value))\n kt = join.join_type_list(keys)\n vt = join.join_type_list(values)\n if not (isinstance(kt, Instance) and isinstance(vt, Instance)):\n return None\n if stargs and (stargs[0] != kt or stargs[1] != vt):\n return None\n # TODO: update tests instead?\n kt.erased = True\n vt.erased = True\n return self.chk.named_generic_type('builtins.dict', [kt, vt])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_dict_expr_ExpressionChecker.visit_dict_expr.return.rv": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_dict_expr_ExpressionChecker.visit_dict_expr.return.rv", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3380, "end_line": 3458, "span_ids": ["ExpressionChecker.visit_dict_expr"], "tokens": 772}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def visit_dict_expr(self, e: DictExpr) -> Type:\n \"\"\"Type check a dict expression.\n\n Translate it into a call to dict(), with provisions for **expr.\n \"\"\"\n # if the dict literal doesn't match TypedDict, check_typeddict_call_with_dict reports\n # an error, but returns the TypedDict type that matches the literal it found\n # that would cause a second error when that TypedDict type is returned upstream\n # to avoid the second error, we always return TypedDict type that was requested\n typeddict_context = self.find_typeddict_context(self.type_context[-1], e)\n if typeddict_context:\n self.check_typeddict_call_with_dict(\n callee=typeddict_context,\n kwargs=e,\n context=e\n )\n return typeddict_context.copy_modified()\n\n # fast path attempt\n dt = self.fast_dict_type(e)\n if dt:\n return dt\n\n # Collect function arguments, watching out for **expr.\n args = [] # type: List[Expression] # Regular \"key: value\"\n stargs = [] # type: List[Expression] # For \"**expr\"\n for key, value in e.items:\n if key is None:\n stargs.append(value)\n else:\n tup = TupleExpr([key, value])\n if key.line >= 0:\n tup.line = key.line\n tup.column = key.column\n else:\n tup.line = value.line\n tup.column = value.column\n args.append(tup)\n # Define type variables (used in constructors below).\n ktdef = TypeVarDef('KT', 'KT', -1, [], self.object_type())\n vtdef = TypeVarDef('VT', 'VT', -2, [], self.object_type())\n kt = TypeVarType(ktdef)\n vt = TypeVarType(vtdef)\n rv = None\n # Call dict(*args), unless it's empty and stargs is not.\n if args or not stargs:\n # The callable type represents a function like this:\n #\n # def (*v: Tuple[kt, vt]) -> Dict[kt, vt]: ...\n constructor = CallableType(\n [TupleType([kt, vt], self.named_type('builtins.tuple'))],\n [nodes.ARG_STAR],\n [None],\n self.chk.named_generic_type('builtins.dict', [kt, vt]),\n self.named_type('builtins.function'),\n name='',\n variables=[ktdef, vtdef])\n rv = self.check_call(constructor, args, [nodes.ARG_POS] * len(args), e)[0]\n else:\n # dict(...) will be called below.\n pass\n # Call rv.update(arg) for each arg in **stargs,\n # except if rv isn't set yet, then set rv = dict(arg).\n if stargs:\n for arg in stargs:\n if rv is None:\n constructor = CallableType(\n [self.chk.named_generic_type('typing.Mapping', [kt, vt])],\n [nodes.ARG_POS],\n [None],\n self.chk.named_generic_type('builtins.dict', [kt, vt]),\n self.named_type('builtins.function'),\n name='',\n variables=[ktdef, vtdef])\n rv = self.check_call(constructor, [arg], [nodes.ARG_POS], arg)[0]\n else:\n self.check_method_call_by_name('update', rv, [arg], [nodes.ARG_POS], arg)\n assert rv is not None\n return rv", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.find_typeddict_context_ExpressionChecker.find_typeddict_context.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.find_typeddict_context_ExpressionChecker.find_typeddict_context.return.None", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3460, "end_line": 3480, "span_ids": ["ExpressionChecker.find_typeddict_context"], "tokens": 209}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def find_typeddict_context(self, context: Optional[Type],\n dict_expr: DictExpr) -> Optional[TypedDictType]:\n context = get_proper_type(context)\n if isinstance(context, TypedDictType):\n return context\n elif isinstance(context, UnionType):\n items = []\n for item in context.items:\n item_context = self.find_typeddict_context(item, dict_expr)\n if (item_context is not None\n and self.match_typeddict_call_with_dict(\n item_context, dict_expr, dict_expr)):\n items.append(item_context)\n if len(items) == 1:\n # Only one union item is valid TypedDict for the given dict_expr, so use the\n # context as it's unambiguous.\n return items[0]\n if len(items) > 1:\n self.msg.typeddict_context_ambiguous(items, dict_expr)\n # No TypedDict type in context.\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_lambda_expr_ExpressionChecker.visit_lambda_expr.if_not_inferred_type_.else_.return.replace_callable_return_t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_lambda_expr_ExpressionChecker.visit_lambda_expr.if_not_inferred_type_.else_.return.replace_callable_return_t", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3482, "end_line": 3509, "span_ids": ["ExpressionChecker.visit_lambda_expr"], "tokens": 319}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def visit_lambda_expr(self, e: LambdaExpr) -> Type:\n \"\"\"Type check lambda expression.\"\"\"\n self.chk.check_default_args(e, body_is_trivial=False)\n inferred_type, type_override = self.infer_lambda_type_using_context(e)\n if not inferred_type:\n self.chk.return_types.append(AnyType(TypeOfAny.special_form))\n # Type check everything in the body except for the final return\n # statement (it can contain tuple unpacking before return).\n with self.chk.scope.push_function(e):\n for stmt in e.body.body[:-1]:\n stmt.accept(self.chk)\n # Only type check the return expression, not the return statement.\n # This is important as otherwise the following statements would be\n # considered unreachable. There's no useful type context.\n ret_type = self.accept(e.expr(), allow_none_return=True)\n fallback = self.named_type('builtins.function')\n self.chk.return_types.pop()\n return callable_type(e, fallback, ret_type)\n else:\n # Type context available.\n self.chk.return_types.append(inferred_type.ret_type)\n self.chk.check_func_item(e, type_override=type_override)\n if e.expr() not in self.chk.type_map:\n # TODO: return expression must be accepted before exiting function scope.\n self.accept(e.expr(), allow_none_return=True)\n ret_type = self.chk.type_map[e.expr()]\n self.chk.return_types.pop()\n return replace_callable_return_type(inferred_type, ret_type)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.infer_lambda_type_using_context_ExpressionChecker.infer_lambda_type_using_context.return.callable_ctx_callable_ct": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.infer_lambda_type_using_context_ExpressionChecker.infer_lambda_type_using_context.return.callable_ctx_callable_ct", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3511, "end_line": 3557, "span_ids": ["ExpressionChecker.infer_lambda_type_using_context"], "tokens": 448}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def infer_lambda_type_using_context(self, e: LambdaExpr) -> Tuple[Optional[CallableType],\n Optional[CallableType]]:\n \"\"\"Try to infer lambda expression type using context.\n\n Return None if could not infer type.\n The second item in the return type is the type_override parameter for check_func_item.\n \"\"\"\n # TODO also accept 'Any' context\n ctx = get_proper_type(self.type_context[-1])\n\n if isinstance(ctx, UnionType):\n callables = [t for t in get_proper_types(ctx.relevant_items())\n if isinstance(t, CallableType)]\n if len(callables) == 1:\n ctx = callables[0]\n\n if not ctx or not isinstance(ctx, CallableType):\n return None, None\n\n # The context may have function type variables in it. We replace them\n # since these are the type variables we are ultimately trying to infer;\n # they must be considered as indeterminate. We use ErasedType since it\n # does not affect type inference results (it is for purposes like this\n # only).\n callable_ctx = get_proper_type(replace_meta_vars(ctx, ErasedType()))\n assert isinstance(callable_ctx, CallableType)\n\n arg_kinds = [arg.kind for arg in e.arguments]\n\n if callable_ctx.is_ellipsis_args:\n # Fill in Any arguments to match the arguments of the lambda.\n callable_ctx = callable_ctx.copy_modified(\n is_ellipsis_args=False,\n arg_types=[AnyType(TypeOfAny.special_form)] * len(arg_kinds),\n arg_kinds=arg_kinds,\n arg_names=[None] * len(arg_kinds)\n )\n\n if ARG_STAR in arg_kinds or ARG_STAR2 in arg_kinds:\n # TODO treat this case appropriately\n return callable_ctx, None\n if callable_ctx.arg_kinds != arg_kinds:\n # Incompatible context; cannot use it to infer types.\n self.chk.fail(message_registry.CANNOT_INFER_LAMBDA_TYPE, e)\n return None, None\n\n return callable_ctx, callable_ctx", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_super_expr_ExpressionChecker.visit_super_expr.assert_False_unreachabl": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_super_expr_ExpressionChecker.visit_super_expr.assert_False_unreachabl", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3559, "end_line": 3615, "span_ids": ["ExpressionChecker.visit_super_expr"], "tokens": 471}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def visit_super_expr(self, e: SuperExpr) -> Type:\n \"\"\"Type check a super expression (non-lvalue).\"\"\"\n\n # We have an expression like super(T, var).member\n\n # First compute the types of T and var\n types = self._super_arg_types(e)\n if isinstance(types, tuple):\n type_type, instance_type = types\n else:\n return types\n\n # Now get the MRO\n type_info = type_info_from_type(type_type)\n if type_info is None:\n self.chk.fail(message_registry.UNSUPPORTED_ARG_1_FOR_SUPER, e)\n return AnyType(TypeOfAny.from_error)\n\n instance_info = type_info_from_type(instance_type)\n if instance_info is None:\n self.chk.fail(message_registry.UNSUPPORTED_ARG_2_FOR_SUPER, e)\n return AnyType(TypeOfAny.from_error)\n\n mro = instance_info.mro\n\n # The base is the first MRO entry *after* type_info that has a member\n # with the right name\n try:\n index = mro.index(type_info)\n except ValueError:\n self.chk.fail(message_registry.SUPER_ARG_2_NOT_INSTANCE_OF_ARG_1, e)\n return AnyType(TypeOfAny.from_error)\n\n if len(mro) == index + 1:\n self.chk.fail(message_registry.TARGET_CLASS_HAS_NO_BASE_CLASS, e)\n return AnyType(TypeOfAny.from_error)\n\n for base in mro[index+1:]:\n if e.name in base.names or base == mro[-1]:\n if e.info and e.info.fallback_to_any and base == mro[-1]:\n # There's an undefined base class, and we're at the end of the\n # chain. That's not an error.\n return AnyType(TypeOfAny.special_form)\n\n return analyze_member_access(name=e.name,\n typ=instance_type,\n is_lvalue=False,\n is_super=True,\n is_operator=False,\n original_type=instance_type,\n override_info=base,\n context=e,\n msg=self.msg,\n chk=self.chk,\n in_literal_context=self.is_literal_context())\n\n assert False, 'unreachable'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker._super_arg_types_ExpressionChecker._super_arg_types.instance_type.get_proper_type_instance_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker._super_arg_types_ExpressionChecker._super_arg_types.instance_type.get_proper_type_instance_", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3617, "end_line": 3685, "span_ids": ["ExpressionChecker._super_arg_types"], "tokens": 762}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def _super_arg_types(self, e: SuperExpr) -> Union[Type, Tuple[Type, Type]]:\n \"\"\"\n Computes the types of the type and instance expressions in super(T, instance), or the\n implicit ones for zero-argument super() expressions. Returns a single type for the whole\n super expression when possible (for errors, anys), otherwise the pair of computed types.\n \"\"\"\n\n if not self.chk.in_checked_function():\n return AnyType(TypeOfAny.unannotated)\n elif len(e.call.args) == 0:\n if self.chk.options.python_version[0] == 2:\n self.chk.fail(message_registry.TOO_FEW_ARGS_FOR_SUPER, e, code=codes.CALL_ARG)\n return AnyType(TypeOfAny.from_error)\n elif not e.info:\n # This has already been reported by the semantic analyzer.\n return AnyType(TypeOfAny.from_error)\n elif self.chk.scope.active_class():\n self.chk.fail(message_registry.SUPER_OUTSIDE_OF_METHOD_NOT_SUPPORTED, e)\n return AnyType(TypeOfAny.from_error)\n\n # Zero-argument super() is like super(, )\n current_type = fill_typevars(e.info)\n type_type = TypeType(current_type) # type: ProperType\n\n # Use the type of the self argument, in case it was annotated\n method = self.chk.scope.top_function()\n assert method is not None\n if method.arguments:\n instance_type = method.arguments[0].variable.type or current_type # type: Type\n else:\n self.chk.fail(message_registry.SUPER_ENCLOSING_POSITIONAL_ARGS_REQUIRED, e)\n return AnyType(TypeOfAny.from_error)\n elif ARG_STAR in e.call.arg_kinds:\n self.chk.fail(message_registry.SUPER_VARARGS_NOT_SUPPORTED, e)\n return AnyType(TypeOfAny.from_error)\n elif set(e.call.arg_kinds) != {ARG_POS}:\n self.chk.fail(message_registry.SUPER_POSITIONAL_ARGS_REQUIRED, e)\n return AnyType(TypeOfAny.from_error)\n elif len(e.call.args) == 1:\n self.chk.fail(message_registry.SUPER_WITH_SINGLE_ARG_NOT_SUPPORTED, e)\n return AnyType(TypeOfAny.from_error)\n elif len(e.call.args) == 2:\n type_type = get_proper_type(self.accept(e.call.args[0]))\n instance_type = self.accept(e.call.args[1])\n else:\n self.chk.fail(message_registry.TOO_MANY_ARGS_FOR_SUPER, e)\n return AnyType(TypeOfAny.from_error)\n\n # Imprecisely assume that the type is the current class\n if isinstance(type_type, AnyType):\n if e.info:\n type_type = TypeType(fill_typevars(e.info))\n else:\n return AnyType(TypeOfAny.from_another_any, source_any=type_type)\n elif isinstance(type_type, TypeType):\n type_item = type_type.item\n if isinstance(type_item, AnyType):\n if e.info:\n type_type = TypeType(fill_typevars(e.info))\n else:\n return AnyType(TypeOfAny.from_another_any, source_any=type_item)\n\n if (not isinstance(type_type, TypeType)\n and not (isinstance(type_type, FunctionLike) and type_type.is_type_obj())):\n self.msg.first_argument_for_super_must_be_type(type_type, e)\n return AnyType(TypeOfAny.from_error)\n\n # Imprecisely assume that the instance is of the current class\n instance_type = get_proper_type(instance_type)\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker._super_arg_types.if_isinstance_instance_ty_ExpressionChecker._super_arg_types.return.type_type_instance_type": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker._super_arg_types.if_isinstance_instance_ty_ExpressionChecker._super_arg_types.return.type_type_instance_type", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3686, "end_line": 3699, "span_ids": ["ExpressionChecker._super_arg_types"], "tokens": 155}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def _super_arg_types(self, e: SuperExpr) -> Union[Type, Tuple[Type, Type]]:\n # ... other code\n if isinstance(instance_type, AnyType):\n if e.info:\n instance_type = fill_typevars(e.info)\n else:\n return AnyType(TypeOfAny.from_another_any, source_any=instance_type)\n elif isinstance(instance_type, TypeType):\n instance_item = instance_type.item\n if isinstance(instance_item, AnyType):\n if e.info:\n instance_type = TypeType(fill_typevars(e.info))\n else:\n return AnyType(TypeOfAny.from_another_any, source_any=instance_item)\n\n return type_type, instance_type", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_slice_expr_ExpressionChecker.visit_set_comprehension.return.self_check_generator_or_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_slice_expr_ExpressionChecker.visit_set_comprehension.return.self_check_generator_or_c", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3701, "end_line": 3716, "span_ids": ["ExpressionChecker.visit_set_comprehension", "ExpressionChecker.visit_slice_expr", "ExpressionChecker.visit_list_comprehension"], "tokens": 183}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def visit_slice_expr(self, e: SliceExpr) -> Type:\n expected = make_optional_type(self.named_type('builtins.int'))\n for index in [e.begin_index, e.end_index, e.stride]:\n if index:\n t = self.accept(index)\n self.chk.check_subtype(t, expected,\n index, message_registry.INVALID_SLICE_INDEX)\n return self.named_type('builtins.slice')\n\n def visit_list_comprehension(self, e: ListComprehension) -> Type:\n return self.check_generator_or_comprehension(\n e.generator, 'builtins.list', '')\n\n def visit_set_comprehension(self, e: SetComprehension) -> Type:\n return self.check_generator_or_comprehension(\n e.generator, 'builtins.set', '')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_generator_expr_ExpressionChecker.visit_generator_expr.return.self_check_generator_or_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_generator_expr_ExpressionChecker.visit_generator_expr.return.self_check_generator_or_c", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3718, "end_line": 3730, "span_ids": ["ExpressionChecker.visit_generator_expr"], "tokens": 146}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def visit_generator_expr(self, e: GeneratorExpr) -> Type:\n # If any of the comprehensions use async for, the expression will return an async generator\n # object\n if any(e.is_async):\n typ = 'typing.AsyncGenerator'\n # received type is always None in async generator expressions\n additional_args = [NoneType()] # type: List[Type]\n else:\n typ = 'typing.Generator'\n # received type and returned type are None\n additional_args = [NoneType(), NoneType()]\n return self.check_generator_or_comprehension(e, typ, '',\n additional_args=additional_args)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_generator_or_comprehension_ExpressionChecker.check_generator_or_comprehension.with_self_chk_binder_fram.return.self_check_call_construct": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_generator_or_comprehension_ExpressionChecker.check_generator_or_comprehension.with_self_chk_binder_fram.return.self_check_call_construct", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3732, "end_line": 3754, "span_ids": ["ExpressionChecker.check_generator_or_comprehension"], "tokens": 238}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def check_generator_or_comprehension(self, gen: GeneratorExpr,\n type_name: str,\n id_for_messages: str,\n additional_args: Optional[List[Type]] = None) -> Type:\n \"\"\"Type check a generator expression or a list comprehension.\"\"\"\n additional_args = additional_args or []\n with self.chk.binder.frame_context(can_skip=True, fall_through=0):\n self.check_for_comp(gen)\n\n # Infer the type of the list comprehension by using a synthetic generic\n # callable type.\n tvdef = TypeVarDef('T', 'T', -1, [], self.object_type())\n tv_list = [TypeVarType(tvdef)] # type: List[Type]\n constructor = CallableType(\n tv_list,\n [nodes.ARG_POS],\n [None],\n self.chk.named_generic_type(type_name, tv_list + additional_args),\n self.chk.named_type('builtins.function'),\n name=id_for_messages,\n variables=[tvdef])\n return self.check_call(constructor,\n [gen.left_expr], [nodes.ARG_POS], gen)[0]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_dictionary_comprehension_ExpressionChecker.visit_dictionary_comprehension.with_self_chk_binder_fram.return.self_check_call_construct": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_dictionary_comprehension_ExpressionChecker.visit_dictionary_comprehension.with_self_chk_binder_fram.return.self_check_call_construct", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3756, "end_line": 3776, "span_ids": ["ExpressionChecker.visit_dictionary_comprehension"], "tokens": 246}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def visit_dictionary_comprehension(self, e: DictionaryComprehension) -> Type:\n \"\"\"Type check a dictionary comprehension.\"\"\"\n with self.chk.binder.frame_context(can_skip=True, fall_through=0):\n self.check_for_comp(e)\n\n # Infer the type of the list comprehension by using a synthetic generic\n # callable type.\n ktdef = TypeVarDef('KT', 'KT', -1, [], self.object_type())\n vtdef = TypeVarDef('VT', 'VT', -2, [], self.object_type())\n kt = TypeVarType(ktdef)\n vt = TypeVarType(vtdef)\n constructor = CallableType(\n [kt, vt],\n [nodes.ARG_POS, nodes.ARG_POS],\n [None, None],\n self.chk.named_generic_type('builtins.dict', [kt, vt]),\n self.chk.named_type('builtins.function'),\n name='',\n variables=[ktdef, vtdef])\n return self.check_call(constructor,\n [e.key, e.value], [nodes.ARG_POS, nodes.ARG_POS], e)[0]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_for_comp_ExpressionChecker.check_for_comp.for_index_sequence_cond.for_condition_in_conditio.if_codes_REDUNDANT_EXPR_i.if_true_map_is_None_.elif_false_map_is_None_.self_msg_redundant_condit": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_for_comp_ExpressionChecker.check_for_comp.for_index_sequence_cond.for_condition_in_conditio.if_codes_REDUNDANT_EXPR_i.if_true_map_is_None_.elif_false_map_is_None_.self_msg_redundant_condit", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3784, "end_line": 3810, "span_ids": ["ExpressionChecker.check_for_comp"], "tokens": 278}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def check_for_comp(self, e: Union[GeneratorExpr, DictionaryComprehension]) -> None:\n \"\"\"Check the for_comp part of comprehensions. That is the part from 'for':\n ... for x in y if z\n\n Note: This adds the type information derived from the condlists to the current binder.\n \"\"\"\n for index, sequence, conditions, is_async in zip(e.indices, e.sequences,\n e.condlists, e.is_async):\n if is_async:\n _, sequence_type = self.chk.analyze_async_iterable_item_type(sequence)\n else:\n _, sequence_type = self.chk.analyze_iterable_item_type(sequence)\n self.chk.analyze_index_variables(index, sequence_type, True, e)\n for condition in conditions:\n self.accept(condition)\n\n # values are only part of the comprehension when all conditions are true\n true_map, false_map = self.chk.find_isinstance_check(condition)\n\n if true_map:\n self.chk.push_type_map(true_map)\n\n if codes.REDUNDANT_EXPR in self.chk.options.enabled_error_codes:\n if true_map is None:\n self.msg.redundant_condition_in_comprehension(False, condition)\n elif false_map is None:\n self.msg.redundant_condition_in_comprehension(True, condition)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_conditional_expr_ExpressionChecker.visit_conditional_expr.return.res": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_conditional_expr_ExpressionChecker.visit_conditional_expr.return.res", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3807, "end_line": 3854, "span_ids": ["ExpressionChecker.visit_conditional_expr"], "tokens": 523}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def visit_conditional_expr(self, e: ConditionalExpr, allow_none_return: bool = False) -> Type:\n self.accept(e.cond)\n ctx = self.type_context[-1]\n\n # Gain type information from isinstance if it is there\n # but only for the current expression\n if_map, else_map = self.chk.find_isinstance_check(e.cond)\n if codes.REDUNDANT_EXPR in self.chk.options.enabled_error_codes:\n if if_map is None:\n self.msg.redundant_condition_in_if(False, e.cond)\n elif else_map is None:\n self.msg.redundant_condition_in_if(True, e.cond)\n\n if_type = self.analyze_cond_branch(if_map, e.if_expr, context=ctx,\n allow_none_return=allow_none_return)\n\n # Analyze the right branch using full type context and store the type\n full_context_else_type = self.analyze_cond_branch(else_map, e.else_expr, context=ctx,\n allow_none_return=allow_none_return)\n if not mypy.checker.is_valid_inferred_type(if_type):\n # Analyze the right branch disregarding the left branch.\n else_type = full_context_else_type\n\n # If it would make a difference, re-analyze the left\n # branch using the right branch's type as context.\n if ctx is None or not is_equivalent(else_type, ctx):\n # TODO: If it's possible that the previous analysis of\n # the left branch produced errors that are avoided\n # using this context, suppress those errors.\n if_type = self.analyze_cond_branch(if_map, e.if_expr, context=else_type,\n allow_none_return=allow_none_return)\n\n else:\n # Analyze the right branch in the context of the left\n # branch's type.\n else_type = self.analyze_cond_branch(else_map, e.else_expr, context=if_type,\n allow_none_return=allow_none_return)\n\n # Only create a union type if the type context is a union, to be mostly\n # compatible with older mypy versions where we always did a join.\n #\n # TODO: Always create a union or at least in more cases?\n if isinstance(get_proper_type(self.type_context[-1]), UnionType):\n res = make_simplified_union([if_type, full_context_else_type])\n else:\n res = join.join_types(if_type, else_type)\n\n return res", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.analyze_cond_branch_ExpressionChecker.None_14": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.analyze_cond_branch_ExpressionChecker.None_14", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3856, "end_line": 3874, "span_ids": ["ExpressionChecker.analyze_cond_branch", "ExpressionChecker.visit_backquote_expr"], "tokens": 189}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def analyze_cond_branch(self, map: Optional[Dict[Expression, Type]],\n node: Expression, context: Optional[Type],\n allow_none_return: bool = False) -> Type:\n with self.chk.binder.frame_context(can_skip=True, fall_through=0):\n if map is None:\n # We still need to type check node, in case we want to\n # process it for isinstance checks later\n self.accept(node, type_context=context, allow_none_return=allow_none_return)\n return UninhabitedType()\n self.chk.push_type_map(map)\n return self.accept(node, type_context=context, allow_none_return=allow_none_return)\n\n def visit_backquote_expr(self, e: BackquoteExpr) -> Type:\n self.accept(e.expr)\n return self.named_type('builtins.str')\n\n #\n # Helpers\n #", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.accept_ExpressionChecker.accept.if_not_self_chk_in_checke.else_.return.typ": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.accept_ExpressionChecker.accept.if_not_self_chk_in_checke.else_.return.typ", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3877, "end_line": 3917, "span_ids": ["ExpressionChecker.accept"], "tokens": 373}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def accept(self,\n node: Expression,\n type_context: Optional[Type] = None,\n allow_none_return: bool = False,\n always_allow_any: bool = False,\n ) -> Type:\n \"\"\"Type check a node in the given type context. If allow_none_return\n is True and this expression is a call, allow it to return None. This\n applies only to this expression and not any subexpressions.\n \"\"\"\n if node in self.type_overrides:\n return self.type_overrides[node]\n self.type_context.append(type_context)\n try:\n if allow_none_return and isinstance(node, CallExpr):\n typ = self.visit_call_expr(node, allow_none_return=True)\n elif allow_none_return and isinstance(node, YieldFromExpr):\n typ = self.visit_yield_from_expr(node, allow_none_return=True)\n elif allow_none_return and isinstance(node, ConditionalExpr):\n typ = self.visit_conditional_expr(node, allow_none_return=True)\n else:\n typ = node.accept(self)\n except Exception as err:\n report_internal_error(err, self.chk.errors.file,\n node.line, self.chk.errors, self.chk.options)\n\n self.type_context.pop()\n assert typ is not None\n self.chk.store_type(node, typ)\n\n if (self.chk.options.disallow_any_expr and\n not always_allow_any and\n not self.chk.is_stub and\n self.chk.in_checked_function() and\n has_any_type(typ) and not self.chk.current_node_deferred):\n self.msg.disallowed_any_type(typ, node)\n\n if not self.chk.in_checked_function() or self.chk.current_node_deferred:\n return AnyType(TypeOfAny.unannotated)\n else:\n return typ", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.named_type_ExpressionChecker.is_valid_var_arg.return._isinstance_typ_TupleTyp": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.named_type_ExpressionChecker.is_valid_var_arg.return._isinstance_typ_TupleTyp", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3921, "end_line": 3933, "span_ids": ["ExpressionChecker.is_valid_var_arg", "ExpressionChecker.named_type"], "tokens": 142}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def named_type(self, name: str) -> Instance:\n \"\"\"Return an instance type with type given by the name and no type\n arguments. Alias for TypeChecker.named_type.\n \"\"\"\n return self.chk.named_type(name)\n\n def is_valid_var_arg(self, typ: Type) -> bool:\n \"\"\"Is a type valid as a *args argument?\"\"\"\n typ = get_proper_type(typ)\n return (isinstance(typ, TupleType) or\n is_subtype(typ, self.chk.named_generic_type('typing.Iterable',\n [AnyType(TypeOfAny.special_form)])) or\n isinstance(typ, AnyType))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.is_valid_keyword_var_arg_ExpressionChecker.is_valid_keyword_var_arg.if_self_chk_options_pytho.else_.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.is_valid_keyword_var_arg_ExpressionChecker.is_valid_keyword_var_arg.if_self_chk_options_pytho.else_.return._", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3935, "end_line": 3951, "span_ids": ["ExpressionChecker.is_valid_keyword_var_arg"], "tokens": 170}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def is_valid_keyword_var_arg(self, typ: Type) -> bool:\n \"\"\"Is a type valid as a **kwargs argument?\"\"\"\n if self.chk.options.python_version[0] >= 3:\n return is_subtype(typ, self.chk.named_generic_type(\n 'typing.Mapping', [self.named_type('builtins.str'),\n AnyType(TypeOfAny.special_form)]))\n else:\n return (\n is_subtype(typ, self.chk.named_generic_type(\n 'typing.Mapping',\n [self.named_type('builtins.str'),\n AnyType(TypeOfAny.special_form)]))\n or\n is_subtype(typ, self.chk.named_generic_type(\n 'typing.Mapping',\n [self.named_type('builtins.unicode'),\n AnyType(TypeOfAny.special_form)])))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.has_member_ExpressionChecker.has_member.if_isinstance_typ_Callab.else_.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.has_member_ExpressionChecker.has_member.if_isinstance_typ_Callab.else_.return.False", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3953, "end_line": 3990, "span_ids": ["ExpressionChecker.has_member"], "tokens": 374}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def has_member(self, typ: Type, member: str) -> bool:\n \"\"\"Does type have member with the given name?\"\"\"\n # TODO: refactor this to use checkmember.analyze_member_access, otherwise\n # these two should be carefully kept in sync.\n # This is much faster than analyze_member_access, though, and so using\n # it first as a filter is important for performance.\n typ = get_proper_type(typ)\n\n if isinstance(typ, TypeVarType):\n typ = get_proper_type(typ.upper_bound)\n if isinstance(typ, TupleType):\n typ = tuple_fallback(typ)\n if isinstance(typ, LiteralType):\n typ = typ.fallback\n if isinstance(typ, Instance):\n return typ.type.has_readable_member(member)\n if isinstance(typ, CallableType) and typ.is_type_obj():\n return typ.fallback.type.has_readable_member(member)\n elif isinstance(typ, AnyType):\n return True\n elif isinstance(typ, UnionType):\n result = all(self.has_member(x, member) for x in typ.relevant_items())\n return result\n elif isinstance(typ, TypeType):\n # Type[Union[X, ...]] is always normalized to Union[Type[X], ...],\n # so we don't need to care about unions here.\n item = typ.item\n if isinstance(item, TypeVarType):\n item = get_proper_type(item.upper_bound)\n if isinstance(item, TupleType):\n item = tuple_fallback(item)\n if isinstance(item, Instance) and item.type.metaclass_type is not None:\n return self.has_member(item.type.metaclass_type, member)\n if isinstance(item, AnyType):\n return True\n return False\n else:\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.not_ready_callback_ExpressionChecker.visit_yield_expr.return.self_chk_get_generator_re": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.not_ready_callback_ExpressionChecker.visit_yield_expr.return.self_chk_get_generator_re", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3992, "end_line": 4012, "span_ids": ["ExpressionChecker.not_ready_callback", "ExpressionChecker.visit_yield_expr"], "tokens": 239}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def not_ready_callback(self, name: str, context: Context) -> None:\n \"\"\"Called when we can't infer the type of a variable because it's not ready yet.\n\n Either defer type checking of the enclosing function to the next\n pass or report an error.\n \"\"\"\n self.chk.handle_cannot_determine_type(name, context)\n\n def visit_yield_expr(self, e: YieldExpr) -> Type:\n return_type = self.chk.return_types[-1]\n expected_item_type = self.chk.get_generator_yield_type(return_type, False)\n if e.expr is None:\n if (not isinstance(get_proper_type(expected_item_type), (NoneType, AnyType))\n and self.chk.in_checked_function()):\n self.chk.fail(message_registry.YIELD_VALUE_EXPECTED, e)\n else:\n actual_item_type = self.accept(e.expr, expected_item_type)\n self.chk.check_subtype(actual_item_type, expected_item_type, e,\n message_registry.INCOMPATIBLE_TYPES_IN_YIELD,\n 'actual type', 'expected type')\n return self.chk.get_generator_receive_type(return_type, False)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_await_expr_ExpressionChecker.visit_await_expr.return.self_check_awaitable_expr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_await_expr_ExpressionChecker.visit_await_expr.return.self_check_awaitable_expr", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4014, "end_line": 4022, "span_ids": ["ExpressionChecker.visit_await_expr"], "tokens": 130}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def visit_await_expr(self, e: AwaitExpr) -> Type:\n expected_type = self.type_context[-1]\n if expected_type is not None:\n expected_type = self.chk.named_generic_type('typing.Awaitable', [expected_type])\n actual_type = get_proper_type(self.accept(e.expr, expected_type))\n if isinstance(actual_type, AnyType):\n return AnyType(TypeOfAny.from_another_any, source_any=actual_type)\n return self.check_awaitable_expr(actual_type, e,\n message_registry.INCOMPATIBLE_TYPES_IN_AWAIT)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_awaitable_expr_ExpressionChecker.check_awaitable_expr.if_not_self_chk_check_sub.else_.return.self_chk_get_generator_re": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.check_awaitable_expr_ExpressionChecker.check_awaitable_expr.if_not_self_chk_check_sub.else_.return.self_chk_get_generator_re", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4024, "end_line": 4034, "span_ids": ["ExpressionChecker.check_awaitable_expr"], "tokens": 140}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def check_awaitable_expr(self, t: Type, ctx: Context, msg: str) -> Type:\n \"\"\"Check the argument to `await` and extract the type of value.\n\n Also used by `async for` and `async with`.\n \"\"\"\n if not self.chk.check_subtype(t, self.named_type('typing.Awaitable'), ctx,\n msg, 'actual type', 'expected type'):\n return AnyType(TypeOfAny.special_form)\n else:\n generator = self.check_method_call_by_name('__await__', t, [], [], ctx)[0]\n return self.chk.get_generator_return_type(generator, False)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_yield_from_expr_ExpressionChecker.visit_yield_from_expr.return.expr_type": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_yield_from_expr_ExpressionChecker.visit_yield_from_expr.return.expr_type", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4036, "end_line": 4096, "span_ids": ["ExpressionChecker.visit_yield_from_expr"], "tokens": 759}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def visit_yield_from_expr(self, e: YieldFromExpr, allow_none_return: bool = False) -> Type:\n # NOTE: Whether `yield from` accepts an `async def` decorated\n # with `@types.coroutine` (or `@asyncio.coroutine`) depends on\n # whether the generator containing the `yield from` is itself\n # thus decorated. But it accepts a generator regardless of\n # how it's decorated.\n return_type = self.chk.return_types[-1]\n # TODO: What should the context for the sub-expression be?\n # If the containing function has type Generator[X, Y, ...],\n # the context should be Generator[X, Y, T], where T is the\n # context of the 'yield from' itself (but it isn't known).\n subexpr_type = get_proper_type(self.accept(e.expr))\n\n # Check that the expr is an instance of Iterable and get the type of the iterator produced\n # by __iter__.\n if isinstance(subexpr_type, AnyType):\n iter_type = AnyType(TypeOfAny.from_another_any, source_any=subexpr_type) # type: Type\n elif self.chk.type_is_iterable(subexpr_type):\n if is_async_def(subexpr_type) and not has_coroutine_decorator(return_type):\n self.chk.msg.yield_from_invalid_operand_type(subexpr_type, e)\n\n any_type = AnyType(TypeOfAny.special_form)\n generic_generator_type = self.chk.named_generic_type('typing.Generator',\n [any_type, any_type, any_type])\n iter_type, _ = self.check_method_call_by_name(\n '__iter__', subexpr_type, [], [], context=generic_generator_type)\n else:\n if not (is_async_def(subexpr_type) and has_coroutine_decorator(return_type)):\n self.chk.msg.yield_from_invalid_operand_type(subexpr_type, e)\n iter_type = AnyType(TypeOfAny.from_error)\n else:\n iter_type = self.check_awaitable_expr(\n subexpr_type, e, message_registry.INCOMPATIBLE_TYPES_IN_YIELD_FROM)\n\n # Check that the iterator's item type matches the type yielded by the Generator function\n # containing this `yield from` expression.\n expected_item_type = self.chk.get_generator_yield_type(return_type, False)\n actual_item_type = self.chk.get_generator_yield_type(iter_type, False)\n\n self.chk.check_subtype(actual_item_type, expected_item_type, e,\n message_registry.INCOMPATIBLE_TYPES_IN_YIELD_FROM,\n 'actual type', 'expected type')\n\n # Determine the type of the entire yield from expression.\n iter_type = get_proper_type(iter_type)\n if (isinstance(iter_type, Instance) and\n iter_type.type.fullname == 'typing.Generator'):\n expr_type = self.chk.get_generator_return_type(iter_type, False)\n else:\n # Non-Generators don't return anything from `yield from` expressions.\n # However special-case Any (which might be produced by an error).\n actual_item_type = get_proper_type(actual_item_type)\n if isinstance(actual_item_type, AnyType):\n expr_type = AnyType(TypeOfAny.from_another_any, source_any=actual_item_type)\n else:\n # Treat `Iterator[X]` as a shorthand for `Generator[X, None, Any]`.\n expr_type = NoneType()\n\n if not allow_none_return and isinstance(get_proper_type(expr_type), NoneType):\n self.chk.msg.does_not_return_value(None, e)\n return expr_type", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_temp_node_ExpressionChecker.visit_namedtuple_expr.return.AnyType_TypeOfAny_special": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_temp_node_ExpressionChecker.visit_namedtuple_expr.return.AnyType_TypeOfAny_special", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4098, "end_line": 4118, "span_ids": ["ExpressionChecker.visit_newtype_expr", "ExpressionChecker.visit_temp_node", "ExpressionChecker.visit_paramspec_expr", "ExpressionChecker.visit_namedtuple_expr", "ExpressionChecker.visit_type_var_expr"], "tokens": 225}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def visit_temp_node(self, e: TempNode) -> Type:\n return e.type\n\n def visit_type_var_expr(self, e: TypeVarExpr) -> Type:\n return AnyType(TypeOfAny.special_form)\n\n def visit_paramspec_expr(self, e: ParamSpecExpr) -> Type:\n return AnyType(TypeOfAny.special_form)\n\n def visit_newtype_expr(self, e: NewTypeExpr) -> Type:\n return AnyType(TypeOfAny.special_form)\n\n def visit_namedtuple_expr(self, e: NamedTupleExpr) -> Type:\n tuple_type = e.info.tuple_type\n if tuple_type:\n if (self.chk.options.disallow_any_unimported and\n has_any_from_unimported_type(tuple_type)):\n self.msg.unimported_type_becomes_any(\"NamedTuple type\", tuple_type, e)\n check_for_explicit_any(tuple_type, self.chk.options, self.chk.is_typeshed_stub,\n self.msg, context=e)\n return AnyType(TypeOfAny.special_form)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_enum_call_expr_ExpressionChecker.visit_enum_call_expr.return.AnyType_TypeOfAny_special": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_enum_call_expr_ExpressionChecker.visit_enum_call_expr.return.AnyType_TypeOfAny_special", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4120, "end_line": 4133, "span_ids": ["ExpressionChecker.visit_enum_call_expr"], "tokens": 155}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def visit_enum_call_expr(self, e: EnumCallExpr) -> Type:\n for name, value in zip(e.items, e.values):\n if value is not None:\n typ = self.accept(value)\n if not isinstance(get_proper_type(typ), AnyType):\n var = e.info.names[name].node\n if isinstance(var, Var):\n # Inline TypeChecker.set_inferred_type(),\n # without the lvalue. (This doesn't really do\n # much, since the value attribute is defined\n # to have type Any in the typeshed stub.)\n var.type = typ\n var.is_inferred = True\n return AnyType(TypeOfAny.special_form)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_typeddict_expr_ExpressionChecker.narrow_type_from_binder_139._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_typeddict_expr_ExpressionChecker.narrow_type_from_binder_139._", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4135, "end_line": 4157, "span_ids": ["ExpressionChecker.bool_type", "ExpressionChecker.visit_star_expr", "ExpressionChecker.object_type", "ExpressionChecker.visit__promote_expr", "ExpressionChecker.narrow_type_from_binder_139", "ExpressionChecker.narrow_type_from_binder", "ExpressionChecker.visit_typeddict_expr"], "tokens": 205}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def visit_typeddict_expr(self, e: TypedDictExpr) -> Type:\n return AnyType(TypeOfAny.special_form)\n\n def visit__promote_expr(self, e: PromoteExpr) -> Type:\n return e.type\n\n def visit_star_expr(self, e: StarExpr) -> StarType:\n return StarType(self.accept(e.expr))\n\n def object_type(self) -> Instance:\n \"\"\"Return instance type 'object'.\"\"\"\n return self.named_type('builtins.object')\n\n def bool_type(self) -> Instance:\n \"\"\"Return instance type 'bool'.\"\"\"\n return self.named_type('builtins.bool')\n\n @overload\n def narrow_type_from_binder(self, expr: Expression, known_type: Type) -> Type: ...\n\n @overload\n def narrow_type_from_binder(self, expr: Expression, known_type: Type,\n skip_non_overlapping: bool) -> Optional[Type]: ...", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.narrow_type_from_binder_140_ExpressionChecker.narrow_type_from_binder_140.return.known_type": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.narrow_type_from_binder_140_ExpressionChecker.narrow_type_from_binder_140.return.known_type", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4162, "end_line": 4186, "span_ids": ["ExpressionChecker.narrow_type_from_binder_140"], "tokens": 304}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def narrow_type_from_binder(self, expr: Expression, known_type: Type,\n skip_non_overlapping: bool = False) -> Optional[Type]:\n \"\"\"Narrow down a known type of expression using information in conditional type binder.\n\n If 'skip_non_overlapping' is True, return None if the type and restriction are\n non-overlapping.\n \"\"\"\n if literal(expr) >= LITERAL_TYPE:\n restriction = self.chk.binder.get(expr)\n # Ignore the error about using get_proper_type().\n if isinstance(restriction, TypeGuardType): # type: ignore[misc]\n # A type guard forces the new type even if it doesn't overlap the old.\n return restriction.type_guard\n # If the current node is deferred, some variables may get Any types that they\n # otherwise wouldn't have. We don't want to narrow down these since it may\n # produce invalid inferred Optional[Any] types, at least.\n if restriction and not (isinstance(get_proper_type(known_type), AnyType)\n and self.chk.current_node_deferred):\n # Note: this call should match the one in narrow_declared_type().\n if (skip_non_overlapping and\n not is_overlapping_types(known_type, restriction,\n prohibit_none_typevar_overlap=True)):\n return None\n return narrow_declared_type(known_type, restriction)\n return known_type", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_has_any_type_has_coroutine_decorator.return.isinstance_t_Instance_a": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_has_any_type_has_coroutine_decorator.return.isinstance_t_Instance_a", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4182, "end_line": 4198, "span_ids": ["HasAnyType.__init__", "has_any_type", "HasAnyType", "has_coroutine_decorator", "HasAnyType.visit_any"], "tokens": 149}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def has_any_type(t: Type) -> bool:\n \"\"\"Whether t contains an Any type\"\"\"\n return t.accept(HasAnyType())\n\n\nclass HasAnyType(types.TypeQuery[bool]):\n def __init__(self) -> None:\n super().__init__(any)\n\n def visit_any(self, t: AnyType) -> bool:\n return t.type_of_any != TypeOfAny.special_form # special forms are not real Any types\n\n\ndef has_coroutine_decorator(t: Type) -> bool:\n \"\"\"Whether t came from a function decorated with `@coroutine`.\"\"\"\n t = get_proper_type(t)\n return isinstance(t, Instance) and t.type.fullname == 'typing.AwaitableGenerator'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_is_async_def_is_async_def.return.isinstance_t_Instance_a": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_is_async_def_is_async_def.return.isinstance_t_Instance_a", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4201, "end_line": 4220, "span_ids": ["is_async_def"], "tokens": 271}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_async_def(t: Type) -> bool:\n \"\"\"Whether t came from a function defined using `async def`.\"\"\"\n # In check_func_def(), when we see a function decorated with\n # `@typing.coroutine` or `@async.coroutine`, we change the\n # return type to typing.AwaitableGenerator[...], so that its\n # type is compatible with either Generator or Awaitable.\n # But for the check here we need to know whether the original\n # function (before decoration) was an `async def`. The\n # AwaitableGenerator type conveniently preserves the original\n # type as its 4th parameter (3rd when using 0-origin indexing\n # :-), so that we can recover that information here.\n # (We really need to see whether the original, undecorated\n # function was an `async def`, which is orthogonal to its\n # decorations.)\n t = get_proper_type(t)\n if (isinstance(t, Instance)\n and t.type.fullname == 'typing.AwaitableGenerator'\n and len(t.args) >= 4):\n t = get_proper_type(t.args[3])\n return isinstance(t, Instance) and t.type.fullname == 'typing.Coroutine'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_is_non_empty_tuple_is_duplicate_mapping.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_is_non_empty_tuple_is_duplicate_mapping.return._", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4223, "end_line": 4246, "span_ids": ["is_non_empty_tuple", "is_duplicate_mapping"], "tokens": 263}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_non_empty_tuple(t: Type) -> bool:\n t = get_proper_type(t)\n return isinstance(t, TupleType) and bool(t.items)\n\n\ndef is_duplicate_mapping(mapping: List[int],\n actual_types: List[Type],\n actual_kinds: List[int]) -> bool:\n return (\n len(mapping) > 1\n # Multiple actuals can map to the same formal if they both come from\n # varargs (*args and **kwargs); in this case at runtime it is possible\n # that here are no duplicates. We need to allow this, as the convention\n # f(..., *args, **kwargs) is common enough.\n and not (len(mapping) == 2\n and actual_kinds[mapping[0]] == nodes.ARG_STAR\n and actual_kinds[mapping[1]] == nodes.ARG_STAR2)\n # Multiple actuals can map to the same formal if there are multiple\n # **kwargs which cannot be mapped with certainty (non-TypedDict\n # **kwargs).\n and not all(actual_kinds[m] == nodes.ARG_STAR2 and\n not isinstance(get_proper_type(actual_types[m]), TypedDictType)\n for m in mapping)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_replace_callable_return_type_ArgInferSecondPassQuery.visit_callable_type.return.self_query_types_t_arg_ty": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_replace_callable_return_type_ArgInferSecondPassQuery.visit_callable_type.return.self_query_types_t_arg_ty", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4249, "end_line": 4265, "span_ids": ["replace_callable_return_type", "ArgInferSecondPassQuery.visit_callable_type", "ArgInferSecondPassQuery.__init__", "ArgInferSecondPassQuery"], "tokens": 169}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def replace_callable_return_type(c: CallableType, new_ret_type: Type) -> CallableType:\n \"\"\"Return a copy of a callable type with a different return type.\"\"\"\n return c.copy_modified(ret_type=new_ret_type)\n\n\nclass ArgInferSecondPassQuery(types.TypeQuery[bool]):\n \"\"\"Query whether an argument type should be inferred in the second pass.\n\n The result is True if the type has a type variable in a callable return\n type anywhere. For example, the result for Callable[[], T] is True if t is\n a type variable.\n \"\"\"\n def __init__(self) -> None:\n super().__init__(any)\n\n def visit_callable_type(self, t: CallableType) -> bool:\n return self.query_types(t.arg_types) or t.accept(HasTypeVarQuery())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_HasTypeVarQuery_HasUninhabitedComponentsQuery.visit_uninhabited_type.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_HasTypeVarQuery_HasUninhabitedComponentsQuery.visit_uninhabited_type.return.True", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4268, "end_line": 4300, "span_ids": ["HasTypeVarQuery.visit_type_var", "HasTypeVarQuery", "HasUninhabitedComponentsQuery.visit_uninhabited_type", "has_uninhabited_component", "HasUninhabitedComponentsQuery", "HasUninhabitedComponentsQuery.__init__", "HasTypeVarQuery.__init__", "has_erased_component", "HasErasedComponentsQuery", "HasErasedComponentsQuery.__init__", "HasErasedComponentsQuery.visit_erased_type"], "tokens": 261}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class HasTypeVarQuery(types.TypeQuery[bool]):\n \"\"\"Visitor for querying whether a type has a type variable component.\"\"\"\n def __init__(self) -> None:\n super().__init__(any)\n\n def visit_type_var(self, t: TypeVarType) -> bool:\n return True\n\n\ndef has_erased_component(t: Optional[Type]) -> bool:\n return t is not None and t.accept(HasErasedComponentsQuery())\n\n\nclass HasErasedComponentsQuery(types.TypeQuery[bool]):\n \"\"\"Visitor for querying whether a type has an erased component.\"\"\"\n def __init__(self) -> None:\n super().__init__(any)\n\n def visit_erased_type(self, t: ErasedType) -> bool:\n return True\n\n\ndef has_uninhabited_component(t: Optional[Type]) -> bool:\n return t is not None and t.accept(HasUninhabitedComponentsQuery())\n\n\nclass HasUninhabitedComponentsQuery(types.TypeQuery[bool]):\n \"\"\"Visitor for querying whether a type has an UninhabitedType component.\"\"\"\n def __init__(self) -> None:\n super().__init__(any)\n\n def visit_uninhabited_type(self, t: UninhabitedType) -> bool:\n return True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_arg_approximate_similarity_arg_approximate_similarity.return.is_subtype_erasetype_eras": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_arg_approximate_similarity_arg_approximate_similarity.return.is_subtype_erasetype_eras", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4303, "end_line": 4361, "span_ids": ["arg_approximate_similarity"], "tokens": 564}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def arg_approximate_similarity(actual: Type, formal: Type) -> bool:\n \"\"\"Return if caller argument (actual) is roughly compatible with signature arg (formal).\n\n This function is deliberately loose and will report two types are similar\n as long as their \"shapes\" are plausibly the same.\n\n This is useful when we're doing error reporting: for example, if we're trying\n to select an overload alternative and there's no exact match, we can use\n this function to help us identify which alternative the user might have\n *meant* to match.\n \"\"\"\n actual = get_proper_type(actual)\n formal = get_proper_type(formal)\n\n # Erase typevars: we'll consider them all to have the same \"shape\".\n if isinstance(actual, TypeVarType):\n actual = erase_to_union_or_bound(actual)\n if isinstance(formal, TypeVarType):\n formal = erase_to_union_or_bound(formal)\n\n # Callable or Type[...]-ish types\n def is_typetype_like(typ: ProperType) -> bool:\n return (isinstance(typ, TypeType)\n or (isinstance(typ, FunctionLike) and typ.is_type_obj())\n or (isinstance(typ, Instance) and typ.type.fullname == \"builtins.type\"))\n\n if isinstance(formal, CallableType):\n if isinstance(actual, (CallableType, Overloaded, TypeType)):\n return True\n if is_typetype_like(actual) and is_typetype_like(formal):\n return True\n\n # Unions\n if isinstance(actual, UnionType):\n return any(arg_approximate_similarity(item, formal) for item in actual.relevant_items())\n if isinstance(formal, UnionType):\n return any(arg_approximate_similarity(actual, item) for item in formal.relevant_items())\n\n # TypedDicts\n if isinstance(actual, TypedDictType):\n if isinstance(formal, TypedDictType):\n return True\n return arg_approximate_similarity(actual.fallback, formal)\n\n # Instances\n # For instances, we mostly defer to the existing is_subtype check.\n if isinstance(formal, Instance):\n if isinstance(actual, CallableType):\n actual = actual.fallback\n if isinstance(actual, Overloaded):\n actual = actual.items()[0].fallback\n if isinstance(actual, TupleType):\n actual = tuple_fallback(actual)\n if isinstance(actual, Instance) and formal.type in actual.type.mro:\n # Try performing a quick check as an optimization\n return True\n\n # Fall back to a standard subtype check for the remaining kinds of type.\n return is_subtype(erasetype.erase_type(actual), erasetype.erase_type(formal))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_any_causes_overload_ambiguity_any_causes_overload_ambiguity.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_any_causes_overload_ambiguity_any_causes_overload_ambiguity.return.False", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4364, "end_line": 4411, "span_ids": ["any_causes_overload_ambiguity"], "tokens": 446}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def any_causes_overload_ambiguity(items: List[CallableType],\n return_types: List[Type],\n arg_types: List[Type],\n arg_kinds: List[int],\n arg_names: Optional[Sequence[Optional[str]]]) -> bool:\n \"\"\"May an argument containing 'Any' cause ambiguous result type on call to overloaded function?\n\n Note that this sometimes returns True even if there is no ambiguity, since a correct\n implementation would be complex (and the call would be imprecisely typed due to Any\n types anyway).\n\n Args:\n items: Overload items matching the actual arguments\n arg_types: Actual argument types\n arg_kinds: Actual argument kinds\n arg_names: Actual argument names\n \"\"\"\n if all_same_types(return_types):\n return False\n\n actual_to_formal = [\n map_formals_to_actuals(\n arg_kinds, arg_names, item.arg_kinds, item.arg_names, lambda i: arg_types[i])\n for item in items\n ]\n\n for arg_idx, arg_type in enumerate(arg_types):\n if has_any_type(arg_type):\n matching_formals_unfiltered = [(item_idx, lookup[arg_idx])\n for item_idx, lookup in enumerate(actual_to_formal)\n if lookup[arg_idx]]\n\n matching_returns = []\n matching_formals = []\n for item_idx, formals in matching_formals_unfiltered:\n matched_callable = items[item_idx]\n matching_returns.append(matched_callable.ret_type)\n\n # Note: if an actual maps to multiple formals of differing types within\n # a single callable, then we know at least one of those formals must be\n # a different type then the formal(s) in some other callable.\n # So it's safe to just append everything to the same list.\n for formal in formals:\n matching_formals.append(matched_callable.arg_types[formal])\n if not all_same_types(matching_formals) and not all_same_types(matching_returns):\n # Any maps to multiple different types, and the return types of these items differ.\n return True\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_all_same_types_merge_typevars_in_callables_by_name.return.output_variables": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_all_same_types_merge_typevars_in_callables_by_name.return.output_variables", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4414, "end_line": 4460, "span_ids": ["all_same_types", "merge_typevars_in_callables_by_name"], "tokens": 484}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def all_same_types(types: List[Type]) -> bool:\n if len(types) == 0:\n return True\n return all(is_same_type(t, types[0]) for t in types[1:])\n\n\ndef merge_typevars_in_callables_by_name(\n callables: Sequence[CallableType]) -> Tuple[List[CallableType], List[TypeVarDef]]:\n \"\"\"Takes all the typevars present in the callables and 'combines' the ones with the same name.\n\n For example, suppose we have two callables with signatures \"f(x: T, y: S) -> T\" and\n \"f(x: List[Tuple[T, S]]) -> Tuple[T, S]\". Both callables use typevars named \"T\" and\n \"S\", but we treat them as distinct, unrelated typevars. (E.g. they could both have\n distinct ids.)\n\n If we pass in both callables into this function, it returns a a list containing two\n new callables that are identical in signature, but use the same underlying TypeVarDef\n and TypeVarType objects for T and S.\n\n This is useful if we want to take the output lists and \"merge\" them into one callable\n in some way -- for example, when unioning together overloads.\n\n Returns both the new list of callables and a list of all distinct TypeVarDef objects used.\n \"\"\"\n\n output = [] # type: List[CallableType]\n unique_typevars = {} # type: Dict[str, TypeVarType]\n variables = [] # type: List[TypeVarDef]\n\n for target in callables:\n if target.is_generic():\n target = freshen_function_type_vars(target)\n\n rename = {} # Dict[TypeVarId, TypeVar]\n for tvdef in target.variables:\n name = tvdef.fullname\n if name not in unique_typevars:\n # TODO(shantanu): fix for ParamSpecDef\n assert isinstance(tvdef, TypeVarDef)\n unique_typevars[name] = TypeVarType(tvdef)\n variables.append(tvdef)\n rename[tvdef.id] = unique_typevars[name]\n\n target = cast(CallableType, expand_type(target, rename))\n output.append(target)\n\n return output, variables", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_try_getting_literal_is_expr_literal_type.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_try_getting_literal_is_expr_literal_type.return.False", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4463, "end_line": 4481, "span_ids": ["is_expr_literal_type", "try_getting_literal"], "tokens": 176}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def try_getting_literal(typ: Type) -> ProperType:\n \"\"\"If possible, get a more precise literal type for a given type.\"\"\"\n typ = get_proper_type(typ)\n if isinstance(typ, Instance) and typ.last_known_value is not None:\n return typ.last_known_value\n return typ\n\n\ndef is_expr_literal_type(node: Expression) -> bool:\n \"\"\"Returns 'true' if the given node is a Literal\"\"\"\n valid = ('typing.Literal', 'typing_extensions.Literal')\n if isinstance(node, IndexExpr):\n base = node.base\n return isinstance(base, RefExpr) and base.fullname in valid\n if isinstance(node, NameExpr):\n underlying = node.node\n return isinstance(underlying, TypeAlias) and isinstance(get_proper_type(underlying.target),\n LiteralType)\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_has_bytes_component_has_bytes_component.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_has_bytes_component_has_bytes_component.return.False", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4484, "end_line": 4495, "span_ids": ["has_bytes_component"], "tokens": 128}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def has_bytes_component(typ: Type, py2: bool = False) -> bool:\n \"\"\"Is this one of builtin byte types, or a union that contains it?\"\"\"\n typ = get_proper_type(typ)\n if py2:\n byte_types = {'builtins.str', 'builtins.bytearray'}\n else:\n byte_types = {'builtins.bytes', 'builtins.bytearray'}\n if isinstance(typ, UnionType):\n return any(has_bytes_component(t) for t in typ.items)\n if isinstance(typ, Instance) and typ.type.fullname in byte_types:\n return True\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_type_info_from_type_type_info_from_type.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_type_info_from_type_type_info_from_type.return.None", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4498, "end_line": 4514, "span_ids": ["type_info_from_type"], "tokens": 149}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def type_info_from_type(typ: Type) -> Optional[TypeInfo]:\n \"\"\"Gets the TypeInfo for a type, indirecting through things like type variables and tuples.\"\"\"\n typ = get_proper_type(typ)\n if isinstance(typ, FunctionLike) and typ.is_type_obj():\n return typ.type_object()\n if isinstance(typ, TypeType):\n typ = typ.item\n if isinstance(typ, TypeVarType):\n typ = get_proper_type(typ.upper_bound)\n if isinstance(typ, TupleType):\n typ = tuple_fallback(typ)\n if isinstance(typ, Instance):\n return typ.type\n\n # A complicated type. Too tricky, give up.\n # TODO: Do something more clever here.\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_is_operator_method_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_is_operator_method_", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4517, "end_line": 4531, "span_ids": ["get_partial_instance_type", "is_operator_method"], "tokens": 113}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_operator_method(fullname: Optional[str]) -> bool:\n if fullname is None:\n return False\n short_name = fullname.split('.')[-1]\n return (\n short_name in nodes.op_methods.values() or\n short_name in nodes.reverse_op_methods.values() or\n short_name in nodes.unary_op_methods.values())\n\n\ndef get_partial_instance_type(t: Optional[Type]) -> Optional[PartialType]:\n if t is None or not isinstance(t, PartialType) or t.type is None:\n return None\n return t", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py__Type_checking_of_attri_from_mypy_import_state": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py__Type_checking_of_attri_from_mypy_import_state", "embedding": null, "metadata": {"file_path": "mypy/checkmember.py", "file_name": "checkmember.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 34, "span_ids": ["docstring"], "tokens": 324}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Type checking of attribute access\"\"\"\n\nfrom typing import cast, Callable, Optional, Union, Sequence\nfrom typing_extensions import TYPE_CHECKING\n\nfrom mypy.types import (\n Type, Instance, AnyType, TupleType, TypedDictType, CallableType, FunctionLike,\n TypeVarLikeDef, Overloaded, TypeVarType, UnionType, PartialType, TypeOfAny, LiteralType,\n DeletedType, NoneType, TypeType, has_type_vars, get_proper_type, ProperType\n)\nfrom mypy.nodes import (\n TypeInfo, FuncBase, Var, FuncDef, SymbolNode, SymbolTable, Context,\n MypyFile, TypeVarExpr, ARG_POS, ARG_STAR, ARG_STAR2, Decorator,\n OverloadedFuncDef, TypeAlias, TempNode, is_final_node,\n SYMBOL_FUNCBASE_TYPES,\n)\nfrom mypy.messages import MessageBuilder\nfrom mypy.maptype import map_instance_to_supertype\nfrom mypy.expandtype import expand_type_by_instance, freshen_function_type_vars\nfrom mypy.erasetype import erase_typevars\nfrom mypy.plugin import AttributeContext\nfrom mypy.typeanal import set_any_tvars\nfrom mypy import message_registry\nfrom mypy import subtypes\nfrom mypy import meet\nfrom mypy.typeops import (\n tuple_fallback, bind_self, erase_to_bound, class_callable, type_object_type_from_function,\n make_simplified_union, function_type,\n)\n\nif TYPE_CHECKING: # import for forward declaration only\n import mypy.checker\n\nfrom mypy import state", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_MemberContext_MemberContext.copy_modified.return.mx": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_MemberContext_MemberContext.copy_modified.return.mx", "embedding": null, "metadata": {"file_path": "mypy/checkmember.py", "file_name": "checkmember.py", "file_type": "text/x-python", "category": "implementation", "start_line": 37, "end_line": 78, "span_ids": ["MemberContext.__init__", "MemberContext.builtin_type", "MemberContext.not_ready_callback", "MemberContext", "MemberContext.copy_modified"], "tokens": 346}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MemberContext:\n \"\"\"Information and objects needed to type check attribute access.\n\n Look at the docstring of analyze_member_access for more information.\n \"\"\"\n\n def __init__(self,\n is_lvalue: bool,\n is_super: bool,\n is_operator: bool,\n original_type: Type,\n context: Context,\n msg: MessageBuilder,\n chk: 'mypy.checker.TypeChecker',\n self_type: Optional[Type],\n module_symbol_table: Optional[SymbolTable] = None) -> None:\n self.is_lvalue = is_lvalue\n self.is_super = is_super\n self.is_operator = is_operator\n self.original_type = original_type\n self.self_type = self_type or original_type\n self.context = context # Error context\n self.msg = msg\n self.chk = chk\n self.module_symbol_table = module_symbol_table\n\n def builtin_type(self, name: str) -> Instance:\n return self.chk.named_type(name)\n\n def not_ready_callback(self, name: str, context: Context) -> None:\n self.chk.handle_cannot_determine_type(name, context)\n\n def copy_modified(self, *, messages: Optional[MessageBuilder] = None,\n self_type: Optional[Type] = None) -> 'MemberContext':\n mx = MemberContext(self.is_lvalue, self.is_super, self.is_operator,\n self.original_type, self.context, self.msg, self.chk,\n self.self_type, self.module_symbol_table)\n if messages is not None:\n mx.msg = messages\n if self_type is not None:\n mx.self_type = self_type\n return mx", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_analyze_member_access_analyze_member_access.if_in_literal_context_an.else_.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_analyze_member_access_analyze_member_access.if_in_literal_context_an.else_.return.result", "embedding": null, "metadata": {"file_path": "mypy/checkmember.py", "file_name": "checkmember.py", "file_type": "text/x-python", "category": "implementation", "start_line": 81, "end_line": 132, "span_ids": ["analyze_member_access"], "tokens": 494}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def analyze_member_access(name: str,\n typ: Type,\n context: Context,\n is_lvalue: bool,\n is_super: bool,\n is_operator: bool,\n msg: MessageBuilder, *,\n original_type: Type,\n chk: 'mypy.checker.TypeChecker',\n override_info: Optional[TypeInfo] = None,\n in_literal_context: bool = False,\n self_type: Optional[Type] = None,\n module_symbol_table: Optional[SymbolTable] = None) -> Type:\n \"\"\"Return the type of attribute 'name' of 'typ'.\n\n The actual implementation is in '_analyze_member_access' and this docstring\n also applies to it.\n\n This is a general operation that supports various different variations:\n\n 1. lvalue or non-lvalue access (setter or getter access)\n 2. supertype access when using super() (is_super == True and\n 'override_info' should refer to the supertype)\n\n 'original_type' is the most precise inferred or declared type of the base object\n that we have available. When looking for an attribute of 'typ', we may perform\n recursive calls targeting the fallback type, and 'typ' may become some supertype\n of 'original_type'. 'original_type' is always preserved as the 'typ' type used in\n the initial, non-recursive call. The 'self_type' is a component of 'original_type'\n to which generic self should be bound (a narrower type that has a fallback to instance).\n Currently this is used only for union types.\n\n 'module_symbol_table' is passed to this function if 'typ' is actually a module\n and we want to keep track of the available attributes of the module (since they\n are not available via the type object directly)\n \"\"\"\n mx = MemberContext(is_lvalue,\n is_super,\n is_operator,\n original_type,\n context,\n msg,\n chk=chk,\n self_type=self_type,\n module_symbol_table=module_symbol_table)\n result = _analyze_member_access(name, typ, mx, override_info)\n possible_literal = get_proper_type(result)\n if (in_literal_context and isinstance(possible_literal, Instance) and\n possible_literal.last_known_value is not None):\n return possible_literal.last_known_value\n else:\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py__analyze_member_access__analyze_member_access.return.mx_msg_has_no_attr_mx_ori": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py__analyze_member_access__analyze_member_access.return.mx_msg_has_no_attr_mx_ori", "embedding": null, "metadata": {"file_path": "mypy/checkmember.py", "file_name": "checkmember.py", "file_type": "text/x-python", "category": "implementation", "start_line": 135, "end_line": 168, "span_ids": ["_analyze_member_access"], "tokens": 396}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _analyze_member_access(name: str,\n typ: Type,\n mx: MemberContext,\n override_info: Optional[TypeInfo] = None) -> Type:\n # TODO: This and following functions share some logic with subtypes.find_member;\n # consider refactoring.\n typ = get_proper_type(typ)\n if isinstance(typ, Instance):\n return analyze_instance_member_access(name, typ, mx, override_info)\n elif isinstance(typ, AnyType):\n # The base object has dynamic type.\n return AnyType(TypeOfAny.from_another_any, source_any=typ)\n elif isinstance(typ, UnionType):\n return analyze_union_member_access(name, typ, mx)\n elif isinstance(typ, FunctionLike) and typ.is_type_obj():\n return analyze_type_callable_member_access(name, typ, mx)\n elif isinstance(typ, TypeType):\n return analyze_type_type_member_access(name, typ, mx, override_info)\n elif isinstance(typ, TupleType):\n # Actually look up from the fallback instance type.\n return _analyze_member_access(name, tuple_fallback(typ), mx, override_info)\n elif isinstance(typ, (TypedDictType, LiteralType, FunctionLike)):\n # Actually look up from the fallback instance type.\n return _analyze_member_access(name, typ.fallback, mx, override_info)\n elif isinstance(typ, NoneType):\n return analyze_none_member_access(name, typ, mx)\n elif isinstance(typ, TypeVarType):\n return _analyze_member_access(name, typ.upper_bound, mx, override_info)\n elif isinstance(typ, DeletedType):\n mx.msg.deleted_as_rvalue(typ, mx.context)\n return AnyType(TypeOfAny.from_error)\n if mx.chk.should_suppress_optional_error([typ]):\n return AnyType(TypeOfAny.from_error)\n return mx.msg.has_no_attr(mx.original_type, typ, name, mx.context, mx.module_symbol_table)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py__The_several_functions_t_analyze_instance_member_access.if_method_.else_.return.analyze_member_var_access": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py__The_several_functions_t_analyze_instance_member_access.if_method_.else_.return.analyze_member_var_access", "embedding": null, "metadata": {"file_path": "mypy/checkmember.py", "file_name": "checkmember.py", "file_type": "text/x-python", "category": "implementation", "start_line": 171, "end_line": 225, "span_ids": ["analyze_instance_member_access", "_analyze_member_access"], "tokens": 509}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# The several functions that follow implement analyze_member_access for various\n# types and aren't documented individually.\n\n\ndef analyze_instance_member_access(name: str,\n typ: Instance,\n mx: MemberContext,\n override_info: Optional[TypeInfo]) -> Type:\n if name == '__init__' and not mx.is_super:\n # Accessing __init__ in statically typed code would compromise\n # type safety unless used via super().\n mx.msg.fail(message_registry.CANNOT_ACCESS_INIT, mx.context)\n return AnyType(TypeOfAny.from_error)\n\n # The base object has an instance type.\n\n info = typ.type\n if override_info:\n info = override_info\n\n if (state.find_occurrences and\n info.name == state.find_occurrences[0] and\n name == state.find_occurrences[1]):\n mx.msg.note(\"Occurrence of '{}.{}'\".format(*state.find_occurrences), mx.context)\n\n # Look up the member. First look up the method dictionary.\n method = info.get_method(name)\n if method:\n if method.is_property:\n assert isinstance(method, OverloadedFuncDef)\n first_item = cast(Decorator, method.items[0])\n return analyze_var(name, first_item.var, typ, info, mx)\n if mx.is_lvalue:\n mx.msg.cant_assign_to_method(mx.context)\n signature = function_type(method, mx.builtin_type('builtins.function'))\n signature = freshen_function_type_vars(signature)\n if name == '__new__':\n # __new__ is special and behaves like a static method -- don't strip\n # the first argument.\n pass\n else:\n if isinstance(signature, FunctionLike) and name != '__call__':\n # TODO: use proper treatment of special methods on unions instead\n # of this hack here and below (i.e. mx.self_type).\n dispatched_type = meet.meet_types(mx.original_type, typ)\n signature = check_self_arg(signature, dispatched_type, method.is_class,\n mx.context, name, mx.msg)\n signature = bind_self(signature, mx.self_type, is_classmethod=method.is_class)\n typ = map_instance_to_supertype(typ, method.info)\n member_type = expand_type_by_instance(signature, typ)\n freeze_type_vars(member_type)\n return member_type\n else:\n # Not a method.\n return analyze_member_var_access(name, typ, info, mx)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_analyze_type_callable_member_access_analyze_type_callable_member_access.if_isinstance_ret_type_I.else_.assert_False_Unexpected": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_analyze_type_callable_member_access_analyze_type_callable_member_access.if_isinstance_ret_type_I.else_.assert_False_Unexpected", "embedding": null, "metadata": {"file_path": "mypy/checkmember.py", "file_name": "checkmember.py", "file_type": "text/x-python", "category": "implementation", "start_line": 228, "end_line": 260, "span_ids": ["analyze_type_callable_member_access"], "tokens": 388}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def analyze_type_callable_member_access(name: str,\n typ: FunctionLike,\n mx: MemberContext) -> Type:\n # Class attribute.\n # TODO super?\n ret_type = typ.items()[0].ret_type\n assert isinstance(ret_type, ProperType)\n if isinstance(ret_type, TupleType):\n ret_type = tuple_fallback(ret_type)\n if isinstance(ret_type, Instance):\n if not mx.is_operator:\n # When Python sees an operator (eg `3 == 4`), it automatically translates that\n # into something like `int.__eq__(3, 4)` instead of `(3).__eq__(4)` as an\n # optimization.\n #\n # While it normally it doesn't matter which of the two versions are used, it\n # does cause inconsistencies when working with classes. For example, translating\n # `int == int` to `int.__eq__(int)` would not work since `int.__eq__` is meant to\n # compare two int _instances_. What we really want is `type(int).__eq__`, which\n # is meant to compare two types or classes.\n #\n # This check makes sure that when we encounter an operator, we skip looking up\n # the corresponding method in the current instance to avoid this edge case.\n # See https://github.com/python/mypy/pull/1787 for more info.\n # TODO: do not rely on same type variables being present in all constructor overloads.\n result = analyze_class_attribute_access(ret_type, name, mx,\n original_vars=typ.items()[0].variables)\n if result:\n return result\n # Look up from the 'type' type.\n return _analyze_member_access(name, typ.fallback, mx)\n else:\n assert False, 'Unexpected type {}'.format(repr(ret_type))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_analyze_type_type_member_access_analyze_type_type_member_access.return._analyze_member_access_na": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_analyze_type_type_member_access_analyze_type_type_member_access.return._analyze_member_access_na", "embedding": null, "metadata": {"file_path": "mypy/checkmember.py", "file_name": "checkmember.py", "file_type": "text/x-python", "category": "implementation", "start_line": 263, "end_line": 305, "span_ids": ["analyze_type_type_member_access"], "tokens": 433}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def analyze_type_type_member_access(name: str,\n typ: TypeType,\n mx: MemberContext,\n override_info: Optional[TypeInfo]) -> Type:\n # Similar to analyze_type_callable_attribute_access.\n item = None\n fallback = mx.builtin_type('builtins.type')\n ignore_messages = mx.msg.copy()\n ignore_messages.disable_errors()\n if isinstance(typ.item, Instance):\n item = typ.item\n elif isinstance(typ.item, AnyType):\n mx = mx.copy_modified(messages=ignore_messages)\n return _analyze_member_access(name, fallback, mx, override_info)\n elif isinstance(typ.item, TypeVarType):\n upper_bound = get_proper_type(typ.item.upper_bound)\n if isinstance(upper_bound, Instance):\n item = upper_bound\n elif isinstance(upper_bound, TupleType):\n item = tuple_fallback(upper_bound)\n elif isinstance(upper_bound, AnyType):\n mx = mx.copy_modified(messages=ignore_messages)\n return _analyze_member_access(name, fallback, mx, override_info)\n elif isinstance(typ.item, TupleType):\n item = tuple_fallback(typ.item)\n elif isinstance(typ.item, FunctionLike) and typ.item.is_type_obj():\n item = typ.item.fallback\n elif isinstance(typ.item, TypeType):\n # Access member on metaclass object via Type[Type[C]]\n if isinstance(typ.item.item, Instance):\n item = typ.item.item.type.metaclass_type\n if item and not mx.is_operator:\n # See comment above for why operators are skipped\n result = analyze_class_attribute_access(item, name, mx, override_info)\n if result:\n if not (isinstance(get_proper_type(result), AnyType) and item.type.fallback_to_any):\n return result\n else:\n # We don't want errors on metaclass lookup for classes with Any fallback\n mx = mx.copy_modified(messages=ignore_messages)\n if item is not None:\n fallback = item.type.metaclass_type or fallback\n return _analyze_member_access(name, fallback, mx, override_info)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_analyze_union_member_access_analyze_none_member_access.if_is_python_3_and_name_.else_.return._analyze_member_access_na": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_analyze_union_member_access_analyze_none_member_access.if_is_python_3_and_name_.else_.return._analyze_member_access_na", "embedding": null, "metadata": {"file_path": "mypy/checkmember.py", "file_name": "checkmember.py", "file_type": "text/x-python", "category": "implementation", "start_line": 308, "end_line": 332, "span_ids": ["analyze_union_member_access", "analyze_none_member_access"], "tokens": 278}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def analyze_union_member_access(name: str, typ: UnionType, mx: MemberContext) -> Type:\n mx.msg.disable_type_names += 1\n results = []\n for subtype in typ.relevant_items():\n # Self types should be bound to every individual item of a union.\n item_mx = mx.copy_modified(self_type=subtype)\n results.append(_analyze_member_access(name, subtype, item_mx))\n mx.msg.disable_type_names -= 1\n return make_simplified_union(results)\n\n\ndef analyze_none_member_access(name: str, typ: NoneType, mx: MemberContext) -> Type:\n if mx.chk.should_suppress_optional_error([typ]):\n return AnyType(TypeOfAny.from_error)\n is_python_3 = mx.chk.options.python_version[0] >= 3\n # In Python 2 \"None\" has exactly the same attributes as \"object\". Python 3 adds a single\n # extra attribute, \"__bool__\".\n if is_python_3 and name == '__bool__':\n return CallableType(arg_types=[],\n arg_kinds=[],\n arg_names=[],\n ret_type=mx.builtin_type('builtins.bool'),\n fallback=mx.builtin_type('builtins.function'))\n else:\n return _analyze_member_access(name, mx.builtin_type('builtins.object'), mx)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_analyze_member_var_access_analyze_member_var_access.if_isinstance_vv_TypeAli.v.info.info": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_analyze_member_var_access_analyze_member_var_access.if_isinstance_vv_TypeAli.v.info.info", "embedding": null, "metadata": {"file_path": "mypy/checkmember.py", "file_name": "checkmember.py", "file_type": "text/x-python", "category": "implementation", "start_line": 335, "end_line": 369, "span_ids": ["analyze_member_var_access"], "tokens": 332}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def analyze_member_var_access(name: str,\n itype: Instance,\n info: TypeInfo,\n mx: MemberContext) -> Type:\n \"\"\"Analyse attribute access that does not target a method.\n\n This is logically part of analyze_member_access and the arguments are similar.\n\n original_type is the type of E in the expression E.var\n \"\"\"\n # It was not a method. Try looking up a variable.\n v = lookup_member_var_or_accessor(info, name, mx.is_lvalue)\n\n vv = v\n if isinstance(vv, Decorator):\n # The associated Var node of a decorator contains the type.\n v = vv.var\n\n if isinstance(vv, TypeInfo):\n # If the associated variable is a TypeInfo synthesize a Var node for\n # the purposes of type checking. This enables us to type check things\n # like accessing class attributes on an inner class.\n v = Var(name, type=type_object_type(vv, mx.builtin_type))\n v.info = info\n\n if isinstance(vv, TypeAlias) and isinstance(get_proper_type(vv.target), Instance):\n # Similar to the above TypeInfo case, we allow using\n # qualified type aliases in runtime context if it refers to an\n # instance type. For example:\n # class C:\n # A = List[int]\n # x = C.A() <- this is OK\n typ = instance_alias_type(vv, mx.builtin_type)\n v = Var(name, type=typ)\n v.info = info\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_analyze_member_var_access.if_isinstance_v_Var__check_final_member.for_base_in_info_mro_.if_sym_and_is_final_node_.msg_cant_assign_to_final_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_analyze_member_var_access.if_isinstance_v_Var__check_final_member.for_base_in_info_mro_.if_sym_and_is_final_node_.msg_cant_assign_to_final_", "embedding": null, "metadata": {"file_path": "mypy/checkmember.py", "file_name": "checkmember.py", "file_type": "text/x-python", "category": "implementation", "start_line": 371, "end_line": 435, "span_ids": ["analyze_member_var_access", "check_final_member"], "tokens": 726}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def analyze_member_var_access(name: str,\n itype: Instance,\n info: TypeInfo,\n mx: MemberContext) -> Type:\n # ... other code\n\n if isinstance(v, Var):\n implicit = info[name].implicit\n\n # An assignment to final attribute is always an error,\n # independently of types.\n if mx.is_lvalue and not mx.chk.get_final_context():\n check_final_member(name, info, mx.msg, mx.context)\n\n return analyze_var(name, v, itype, info, mx, implicit=implicit)\n elif isinstance(v, FuncDef):\n assert False, \"Did not expect a function\"\n elif (not v and name not in ['__getattr__', '__setattr__', '__getattribute__'] and\n not mx.is_operator):\n if not mx.is_lvalue:\n for method_name in ('__getattribute__', '__getattr__'):\n method = info.get_method(method_name)\n # __getattribute__ is defined on builtins.object and returns Any, so without\n # the guard this search will always find object.__getattribute__ and conclude\n # that the attribute exists\n if method and method.info.fullname != 'builtins.object':\n function = function_type(method, mx.builtin_type('builtins.function'))\n bound_method = bind_self(function, mx.self_type)\n typ = map_instance_to_supertype(itype, method.info)\n getattr_type = get_proper_type(expand_type_by_instance(bound_method, typ))\n if isinstance(getattr_type, CallableType):\n result = getattr_type.ret_type\n\n # Call the attribute hook before returning.\n fullname = '{}.{}'.format(method.info.fullname, name)\n hook = mx.chk.plugin.get_attribute_hook(fullname)\n if hook:\n result = hook(AttributeContext(get_proper_type(mx.original_type),\n result, mx.context, mx.chk))\n return result\n else:\n setattr_meth = info.get_method('__setattr__')\n if setattr_meth and setattr_meth.info.fullname != 'builtins.object':\n setattr_func = function_type(setattr_meth, mx.builtin_type('builtins.function'))\n bound_type = bind_self(setattr_func, mx.self_type)\n typ = map_instance_to_supertype(itype, setattr_meth.info)\n setattr_type = get_proper_type(expand_type_by_instance(bound_type, typ))\n if isinstance(setattr_type, CallableType) and len(setattr_type.arg_types) > 0:\n return setattr_type.arg_types[-1]\n\n if itype.type.fallback_to_any:\n return AnyType(TypeOfAny.special_form)\n\n # Could not find the member.\n if mx.is_super:\n mx.msg.undefined_in_superclass(name, mx.context)\n return AnyType(TypeOfAny.from_error)\n else:\n if mx.chk and mx.chk.should_suppress_optional_error([itype]):\n return AnyType(TypeOfAny.from_error)\n return mx.msg.has_no_attr(\n mx.original_type, itype, name, mx.context, mx.module_symbol_table\n )\n\n\ndef check_final_member(name: str, info: TypeInfo, msg: MessageBuilder, ctx: Context) -> None:\n \"\"\"Give an error if the name being assigned was declared as final.\"\"\"\n for base in info.mro:\n sym = base.names.get(name)\n if sym and is_final_node(sym.node):\n msg.cant_assign_to_final(name, attr_assign=True, ctx=ctx)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_analyze_descriptor_access_analyze_descriptor_access.return.inferred_dunder_get_type_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_analyze_descriptor_access_analyze_descriptor_access.return.inferred_dunder_get_type_", "embedding": null, "metadata": {"file_path": "mypy/checkmember.py", "file_name": "checkmember.py", "file_type": "text/x-python", "category": "implementation", "start_line": 438, "end_line": 516, "span_ids": ["analyze_descriptor_access"], "tokens": 710}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def analyze_descriptor_access(instance_type: Type,\n descriptor_type: Type,\n builtin_type: Callable[[str], Instance],\n msg: MessageBuilder,\n context: Context, *,\n chk: 'mypy.checker.TypeChecker') -> Type:\n \"\"\"Type check descriptor access.\n\n Arguments:\n instance_type: The type of the instance on which the descriptor\n attribute is being accessed (the type of ``a`` in ``a.f`` when\n ``f`` is a descriptor).\n descriptor_type: The type of the descriptor attribute being accessed\n (the type of ``f`` in ``a.f`` when ``f`` is a descriptor).\n context: The node defining the context of this inference.\n Return:\n The return type of the appropriate ``__get__`` overload for the descriptor.\n \"\"\"\n instance_type = get_proper_type(instance_type)\n descriptor_type = get_proper_type(descriptor_type)\n\n if isinstance(descriptor_type, UnionType):\n # Map the access over union types\n return make_simplified_union([\n analyze_descriptor_access(instance_type, typ, builtin_type,\n msg, context, chk=chk)\n for typ in descriptor_type.items\n ])\n elif not isinstance(descriptor_type, Instance):\n return descriptor_type\n\n if not descriptor_type.type.has_readable_member('__get__'):\n return descriptor_type\n\n dunder_get = descriptor_type.type.get_method('__get__')\n\n if dunder_get is None:\n msg.fail(message_registry.DESCRIPTOR_GET_NOT_CALLABLE.format(descriptor_type), context)\n return AnyType(TypeOfAny.from_error)\n\n function = function_type(dunder_get, builtin_type('builtins.function'))\n bound_method = bind_self(function, descriptor_type)\n typ = map_instance_to_supertype(descriptor_type, dunder_get.info)\n dunder_get_type = expand_type_by_instance(bound_method, typ)\n\n if isinstance(instance_type, FunctionLike) and instance_type.is_type_obj():\n owner_type = instance_type.items()[0].ret_type\n instance_type = NoneType()\n elif isinstance(instance_type, TypeType):\n owner_type = instance_type.item\n instance_type = NoneType()\n else:\n owner_type = instance_type\n\n callable_name = chk.expr_checker.method_fullname(descriptor_type, \"__get__\")\n dunder_get_type = chk.expr_checker.transform_callee_type(\n callable_name, dunder_get_type,\n [TempNode(instance_type, context=context),\n TempNode(TypeType.make_normalized(owner_type), context=context)],\n [ARG_POS, ARG_POS], context, object_type=descriptor_type,\n )\n\n _, inferred_dunder_get_type = chk.expr_checker.check_call(\n dunder_get_type,\n [TempNode(instance_type, context=context),\n TempNode(TypeType.make_normalized(owner_type), context=context)],\n [ARG_POS, ARG_POS], context, object_type=descriptor_type,\n callable_name=callable_name)\n\n inferred_dunder_get_type = get_proper_type(inferred_dunder_get_type)\n if isinstance(inferred_dunder_get_type, AnyType):\n # check_call failed, and will have reported an error\n return inferred_dunder_get_type\n\n if not isinstance(inferred_dunder_get_type, CallableType):\n msg.fail(message_registry.DESCRIPTOR_GET_NOT_CALLABLE.format(descriptor_type), context)\n return AnyType(TypeOfAny.from_error)\n\n return inferred_dunder_get_type.ret_type", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_instance_alias_type_instance_alias_type.return.expand_type_by_instance_t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_instance_alias_type_instance_alias_type.return.expand_type_by_instance_t", "embedding": null, "metadata": {"file_path": "mypy/checkmember.py", "file_name": "checkmember.py", "file_type": "text/x-python", "category": "implementation", "start_line": 519, "end_line": 531, "span_ids": ["instance_alias_type"], "tokens": 143}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def instance_alias_type(alias: TypeAlias,\n builtin_type: Callable[[str], Instance]) -> Type:\n \"\"\"Type of a type alias node targeting an instance, when appears in runtime context.\n\n As usual, we first erase any unbound type variables to Any.\n \"\"\"\n target = get_proper_type(alias.target) # type: Type\n assert isinstance(get_proper_type(target),\n Instance), \"Must be called only with aliases to classes\"\n target = get_proper_type(set_any_tvars(alias, alias.line, alias.column))\n assert isinstance(target, Instance)\n tp = type_object_type(target.type, builtin_type)\n return expand_type_by_instance(tp, target)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_analyze_var_analyze_var.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_analyze_var_analyze_var.return.result", "embedding": null, "metadata": {"file_path": "mypy/checkmember.py", "file_name": "checkmember.py", "file_type": "text/x-python", "category": "implementation", "start_line": 534, "end_line": 607, "span_ids": ["analyze_var"], "tokens": 796}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def analyze_var(name: str,\n var: Var,\n itype: Instance,\n info: TypeInfo,\n mx: MemberContext, *,\n implicit: bool = False) -> Type:\n \"\"\"Analyze access to an attribute via a Var node.\n\n This is conceptually part of analyze_member_access and the arguments are similar.\n\n itype is the class object in which var is defined\n original_type is the type of E in the expression E.var\n if implicit is True, the original Var was created as an assignment to self\n \"\"\"\n # Found a member variable.\n itype = map_instance_to_supertype(itype, var.info)\n typ = var.type\n if typ:\n if isinstance(typ, PartialType):\n return mx.chk.handle_partial_var_type(typ, mx.is_lvalue, var, mx.context)\n if mx.is_lvalue and var.is_property and not var.is_settable_property:\n # TODO allow setting attributes in subclass (although it is probably an error)\n mx.msg.read_only_property(name, itype.type, mx.context)\n if mx.is_lvalue and var.is_classvar:\n mx.msg.cant_assign_to_classvar(name, mx.context)\n t = get_proper_type(expand_type_by_instance(typ, itype))\n result = t # type: Type\n typ = get_proper_type(typ)\n if var.is_initialized_in_class and isinstance(typ, FunctionLike) and not typ.is_type_obj():\n if mx.is_lvalue:\n if var.is_property:\n if not var.is_settable_property:\n mx.msg.read_only_property(name, itype.type, mx.context)\n else:\n mx.msg.cant_assign_to_method(mx.context)\n\n if not var.is_staticmethod:\n # Class-level function objects and classmethods become bound methods:\n # the former to the instance, the latter to the class.\n functype = typ\n # Use meet to narrow original_type to the dispatched type.\n # For example, assume\n # * A.f: Callable[[A1], None] where A1 <: A (maybe A1 == A)\n # * B.f: Callable[[B1], None] where B1 <: B (maybe B1 == B)\n # * x: Union[A1, B1]\n # In `x.f`, when checking `x` against A1 we assume x is compatible with A\n # and similarly for B1 when checking against B\n dispatched_type = meet.meet_types(mx.original_type, itype)\n signature = freshen_function_type_vars(functype)\n signature = check_self_arg(signature, dispatched_type, var.is_classmethod,\n mx.context, name, mx.msg)\n signature = bind_self(signature, mx.self_type, var.is_classmethod)\n expanded_signature = get_proper_type(expand_type_by_instance(signature, itype))\n freeze_type_vars(expanded_signature)\n if var.is_property:\n # A property cannot have an overloaded type => the cast is fine.\n assert isinstance(expanded_signature, CallableType)\n result = expanded_signature.ret_type\n else:\n result = expanded_signature\n else:\n if not var.is_ready:\n mx.not_ready_callback(var.name, mx.context)\n # Implicit 'Any' type.\n result = AnyType(TypeOfAny.special_form)\n fullname = '{}.{}'.format(var.info.fullname, name)\n hook = mx.chk.plugin.get_attribute_hook(fullname)\n if result and not mx.is_lvalue and not implicit:\n result = analyze_descriptor_access(mx.original_type, result, mx.builtin_type,\n mx.msg, mx.context, chk=mx.chk)\n if hook:\n result = hook(AttributeContext(get_proper_type(mx.original_type),\n result, mx.context, mx.chk))\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_freeze_type_vars_lookup_member_var_or_accessor.if_node_.else_.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_freeze_type_vars_lookup_member_var_or_accessor.if_node_.else_.return.None", "embedding": null, "metadata": {"file_path": "mypy/checkmember.py", "file_name": "checkmember.py", "file_type": "text/x-python", "category": "implementation", "start_line": 610, "end_line": 630, "span_ids": ["freeze_type_vars", "lookup_member_var_or_accessor"], "tokens": 157}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def freeze_type_vars(member_type: Type) -> None:\n if not isinstance(member_type, ProperType):\n return\n if isinstance(member_type, CallableType):\n for v in member_type.variables:\n v.id.meta_level = 0\n if isinstance(member_type, Overloaded):\n for it in member_type.items():\n for v in it.variables:\n v.id.meta_level = 0\n\n\ndef lookup_member_var_or_accessor(info: TypeInfo, name: str,\n is_lvalue: bool) -> Optional[SymbolNode]:\n \"\"\"Find the attribute/accessor node that refers to a member of a type.\"\"\"\n # TODO handle lvalues\n node = info.get(name)\n if node:\n return node.node\n else:\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_check_self_arg_check_self_arg.return.Overloaded_new_items_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_check_self_arg_check_self_arg.return.Overloaded_new_items_", "embedding": null, "metadata": {"file_path": "mypy/checkmember.py", "file_name": "checkmember.py", "file_type": "text/x-python", "category": "implementation", "start_line": 633, "end_line": 675, "span_ids": ["check_self_arg"], "tokens": 444}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def check_self_arg(functype: FunctionLike,\n dispatched_arg_type: Type,\n is_classmethod: bool,\n context: Context, name: str,\n msg: MessageBuilder) -> FunctionLike:\n \"\"\"Check that an instance has a valid type for a method with annotated 'self'.\n\n For example if the method is defined as:\n class A:\n def f(self: S) -> T: ...\n then for 'x.f' we check that meet(type(x), A) <: S. If the method is overloaded, we\n select only overloads items that satisfy this requirement. If there are no matching\n overloads, an error is generated.\n\n Note: dispatched_arg_type uses a meet to select a relevant item in case if the\n original type of 'x' is a union. This is done because several special methods\n treat union types in ad-hoc manner, so we can't use MemberContext.self_type yet.\n \"\"\"\n items = functype.items()\n if not items:\n return functype\n new_items = []\n if is_classmethod:\n dispatched_arg_type = TypeType.make_normalized(dispatched_arg_type)\n for item in items:\n if not item.arg_types or item.arg_kinds[0] not in (ARG_POS, ARG_STAR):\n # No positional first (self) argument (*args is okay).\n msg.no_formal_self(name, item, context)\n # This is pretty bad, so just return the original signature if\n # there is at least one such error.\n return functype\n else:\n selfarg = item.arg_types[0]\n if subtypes.is_subtype(dispatched_arg_type, erase_typevars(erase_to_bound(selfarg))):\n new_items.append(item)\n if not new_items:\n # Choose first item for the message (it may be not very helpful for overloads).\n msg.incompatible_self_argument(name, dispatched_arg_type, items[0],\n is_classmethod, context)\n return functype\n if len(new_items) == 1:\n return new_items[0]\n return Overloaded(new_items)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_analyze_class_attribute_access_analyze_class_attribute_access.t.node_type": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_analyze_class_attribute_access_analyze_class_attribute_access.t.node_type", "embedding": null, "metadata": {"file_path": "mypy/checkmember.py", "file_name": "checkmember.py", "file_type": "text/x-python", "category": "implementation", "start_line": 678, "end_line": 724, "span_ids": ["analyze_class_attribute_access"], "tokens": 427}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def analyze_class_attribute_access(itype: Instance,\n name: str,\n mx: MemberContext,\n override_info: Optional[TypeInfo] = None,\n original_vars: Optional[Sequence[TypeVarLikeDef]] = None\n ) -> Optional[Type]:\n \"\"\"Analyze access to an attribute on a class object.\n\n itype is the return type of the class object callable, original_type is the type\n of E in the expression E.var, original_vars are type variables of the class callable\n (for generic classes).\n \"\"\"\n info = itype.type\n if override_info:\n info = override_info\n\n node = info.get(name)\n if not node:\n if info.fallback_to_any:\n return AnyType(TypeOfAny.special_form)\n return None\n\n is_decorated = isinstance(node.node, Decorator)\n is_method = is_decorated or isinstance(node.node, FuncBase)\n if mx.is_lvalue:\n if is_method:\n mx.msg.cant_assign_to_method(mx.context)\n if isinstance(node.node, TypeInfo):\n mx.msg.fail(message_registry.CANNOT_ASSIGN_TO_TYPE, mx.context)\n\n # If a final attribute was declared on `self` in `__init__`, then it\n # can't be accessed on the class object.\n if node.implicit and isinstance(node.node, Var) and node.node.is_final:\n mx.msg.fail(message_registry.CANNOT_ACCESS_FINAL_INSTANCE_ATTR\n .format(node.node.name), mx.context)\n\n # An assignment to final attribute on class object is also always an error,\n # independently of types.\n if mx.is_lvalue and not mx.chk.get_final_context():\n check_final_member(name, info, mx.msg, mx.context)\n\n if info.is_enum and not (mx.is_lvalue or is_decorated or is_method):\n enum_class_attribute_type = analyze_enum_class_attribute_access(itype, name, mx)\n if enum_class_attribute_type:\n return enum_class_attribute_type\n\n t = node.type\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_analyze_class_attribute_access.if_t__analyze_class_attribute_access.None_9.return.mx_builtin_type_types_Mo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_analyze_class_attribute_access.if_t__analyze_class_attribute_access.None_9.return.mx_builtin_type_types_Mo", "embedding": null, "metadata": {"file_path": "mypy/checkmember.py", "file_name": "checkmember.py", "file_type": "text/x-python", "category": "implementation", "start_line": 725, "end_line": 796, "span_ids": ["analyze_class_attribute_access"], "tokens": 810}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def analyze_class_attribute_access(itype: Instance,\n name: str,\n mx: MemberContext,\n override_info: Optional[TypeInfo] = None,\n original_vars: Optional[Sequence[TypeVarLikeDef]] = None\n ) -> Optional[Type]:\n # ... other code\n if t:\n if isinstance(t, PartialType):\n symnode = node.node\n assert isinstance(symnode, Var)\n return mx.chk.handle_partial_var_type(t, mx.is_lvalue, symnode, mx.context)\n\n # Find the class where method/variable was defined.\n if isinstance(node.node, Decorator):\n super_info = node.node.var.info # type: Optional[TypeInfo]\n elif isinstance(node.node, (Var, SYMBOL_FUNCBASE_TYPES)):\n super_info = node.node.info\n else:\n super_info = None\n\n # Map the type to how it would look as a defining class. For example:\n # class C(Generic[T]): ...\n # class D(C[Tuple[T, S]]): ...\n # D[int, str].method()\n # Here itype is D[int, str], isuper is C[Tuple[int, str]].\n if not super_info:\n isuper = None\n else:\n isuper = map_instance_to_supertype(itype, super_info)\n\n if isinstance(node.node, Var):\n assert isuper is not None\n # Check if original variable type has type variables. For example:\n # class C(Generic[T]):\n # x: T\n # C.x # Error, ambiguous access\n # C[int].x # Also an error, since C[int] is same as C at runtime\n if isinstance(t, TypeVarType) or has_type_vars(t):\n # Exception: access on Type[...], including first argument of class methods is OK.\n if not isinstance(get_proper_type(mx.original_type), TypeType) or node.implicit:\n if node.node.is_classvar:\n message = message_registry.GENERIC_CLASS_VAR_ACCESS\n else:\n message = message_registry.GENERIC_INSTANCE_VAR_CLASS_ACCESS\n mx.msg.fail(message, mx.context)\n\n # Erase non-mapped variables, but keep mapped ones, even if there is an error.\n # In the above example this means that we infer following types:\n # C.x -> Any\n # C[int].x -> int\n t = erase_typevars(expand_type_by_instance(t, isuper))\n\n is_classmethod = ((is_decorated and cast(Decorator, node.node).func.is_class)\n or (isinstance(node.node, FuncBase) and node.node.is_class))\n t = get_proper_type(t)\n if isinstance(t, FunctionLike) and is_classmethod:\n t = check_self_arg(t, mx.self_type, False, mx.context, name, mx.msg)\n result = add_class_tvars(t, isuper, is_classmethod,\n mx.self_type, original_vars=original_vars)\n if not mx.is_lvalue:\n result = analyze_descriptor_access(mx.original_type, result, mx.builtin_type,\n mx.msg, mx.context, chk=mx.chk)\n return result\n elif isinstance(node.node, Var):\n mx.not_ready_callback(name, mx.context)\n return AnyType(TypeOfAny.special_form)\n\n if isinstance(node.node, TypeVarExpr):\n mx.msg.fail(message_registry.CANNOT_USE_TYPEVAR_AS_EXPRESSION.format(\n info.name, name), mx.context)\n return AnyType(TypeOfAny.from_error)\n\n if isinstance(node.node, TypeInfo):\n return type_object_type(node.node, mx.builtin_type)\n\n if isinstance(node.node, MypyFile):\n # Reference to a module object.\n return mx.builtin_type('types.ModuleType')\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_analyze_class_attribute_access.None_10_analyze_class_attribute_access.if_is_decorated_.else_.return.typ": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_analyze_class_attribute_access.None_10_analyze_class_attribute_access.if_is_decorated_.else_.return.typ", "embedding": null, "metadata": {"file_path": "mypy/checkmember.py", "file_name": "checkmember.py", "file_type": "text/x-python", "category": "implementation", "start_line": 798, "end_line": 817, "span_ids": ["analyze_class_attribute_access"], "tokens": 252}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def analyze_class_attribute_access(itype: Instance,\n name: str,\n mx: MemberContext,\n override_info: Optional[TypeInfo] = None,\n original_vars: Optional[Sequence[TypeVarLikeDef]] = None\n ) -> Optional[Type]:\n # ... other code\n\n if (isinstance(node.node, TypeAlias) and\n isinstance(get_proper_type(node.node.target), Instance)):\n return instance_alias_type(node.node, mx.builtin_type)\n\n if is_decorated:\n assert isinstance(node.node, Decorator)\n if node.node.type:\n return node.node.type\n else:\n mx.not_ready_callback(name, mx.context)\n return AnyType(TypeOfAny.from_error)\n else:\n assert isinstance(node.node, FuncBase)\n typ = function_type(node.node, mx.builtin_type('builtins.function'))\n # Note: if we are accessing class method on class object, the cls argument is bound.\n # Annotated and/or explicit class methods go through other code paths above, for\n # unannotated implicit class methods we do this here.\n if node.node.is_class:\n typ = bind_self(typ, is_classmethod=True)\n return typ", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_analyze_enum_class_attribute_access_analyze_enum_class_attribute_access.return.itype_copy_modified_erase": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_analyze_enum_class_attribute_access_analyze_enum_class_attribute_access.return.itype_copy_modified_erase", "embedding": null, "metadata": {"file_path": "mypy/checkmember.py", "file_name": "checkmember.py", "file_type": "text/x-python", "category": "implementation", "start_line": 820, "end_line": 839, "span_ids": ["analyze_enum_class_attribute_access"], "tokens": 261}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def analyze_enum_class_attribute_access(itype: Instance,\n name: str,\n mx: MemberContext,\n ) -> Optional[Type]:\n # Skip \"_order_\" and \"__order__\", since Enum will remove it\n if name in (\"_order_\", \"__order__\"):\n return mx.msg.has_no_attr(\n mx.original_type, itype, name, mx.context, mx.module_symbol_table\n )\n # For other names surrendered by underscores, we don't make them Enum members\n if name.startswith('__') and name.endswith(\"__\") and name.replace('_', '') != '':\n return None\n\n enum_literal = LiteralType(name, fallback=itype)\n # When we analyze enums, the corresponding Instance is always considered to be erased\n # due to how the signature of Enum.__new__ is `(cls: Type[_T], value: object) -> _T`\n # in typeshed. However, this is really more of an implementation detail of how Enums\n # are typed, and we really don't want to treat every single Enum value as if it were\n # from type variable substitution. So we reset the 'erased' field here.\n return itype.copy_modified(erased=False, last_known_value=enum_literal)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_add_class_tvars_add_class_tvars.return.t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_add_class_tvars_add_class_tvars.return.t", "embedding": null, "metadata": {"file_path": "mypy/checkmember.py", "file_name": "checkmember.py", "file_type": "text/x-python", "category": "implementation", "start_line": 842, "end_line": 897, "span_ids": ["add_class_tvars"], "tokens": 628}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_class_tvars(t: ProperType, isuper: Optional[Instance],\n is_classmethod: bool,\n original_type: Type,\n original_vars: Optional[Sequence[TypeVarLikeDef]] = None) -> Type:\n \"\"\"Instantiate type variables during analyze_class_attribute_access,\n e.g T and Q in the following:\n\n class A(Generic[T]):\n @classmethod\n def foo(cls: Type[Q]) -> Tuple[T, Q]: ...\n\n class B(A[str]): pass\n B.foo()\n\n Args:\n t: Declared type of the method (or property)\n isuper: Current instance mapped to the superclass where method was defined, this\n is usually done by map_instance_to_supertype()\n is_classmethod: True if this method is decorated with @classmethod\n original_type: The value of the type B in the expression B.foo() or the corresponding\n component in case of a union (this is used to bind the self-types)\n original_vars: Type variables of the class callable on which the method was accessed\n Returns:\n Expanded method type with added type variables (when needed).\n \"\"\"\n # TODO: verify consistency between Q and T\n\n # We add class type variables if the class method is accessed on class object\n # without applied type arguments, this matches the behavior of __init__().\n # For example (continuing the example in docstring):\n # A # The type of callable is def [T] () -> A[T], _not_ def () -> A[Any]\n # A[int] # The type of callable is def () -> A[int]\n # and\n # A.foo # The type is generic def [T] () -> Tuple[T, A[T]]\n # A[int].foo # The type is non-generic def () -> Tuple[int, A[int]]\n #\n # This behaviour is useful for defining alternative constructors for generic classes.\n # To achieve such behaviour, we add the class type variables that are still free\n # (i.e. appear in the return type of the class object on which the method was accessed).\n if isinstance(t, CallableType):\n tvars = original_vars if original_vars is not None else []\n if is_classmethod:\n t = freshen_function_type_vars(t)\n t = bind_self(t, original_type, is_classmethod=True)\n assert isuper is not None\n t = cast(CallableType, expand_type_by_instance(t, isuper))\n freeze_type_vars(t)\n return t.copy_modified(variables=list(tvars) + list(t.variables))\n elif isinstance(t, Overloaded):\n return Overloaded([cast(CallableType, add_class_tvars(item, isuper,\n is_classmethod, original_type,\n original_vars=original_vars))\n for item in t.items()])\n if isuper is not None:\n t = cast(ProperType, expand_type_by_instance(t, isuper))\n return t", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_type_object_type_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkmember.py_type_object_type_", "embedding": null, "metadata": {"file_path": "mypy/checkmember.py", "file_name": "checkmember.py", "file_type": "text/x-python", "category": "implementation", "start_line": 900, "end_line": 980, "span_ids": ["type_object_type", "is_valid_constructor"], "tokens": 781}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def type_object_type(info: TypeInfo, builtin_type: Callable[[str], Instance]) -> ProperType:\n \"\"\"Return the type of a type object.\n\n For a generic type G with type variables T and S the type is generally of form\n\n Callable[..., G[T, S]]\n\n where ... are argument types for the __init__/__new__ method (without the self\n argument). Also, the fallback type will be 'type' instead of 'function'.\n \"\"\"\n\n # We take the type from whichever of __init__ and __new__ is first\n # in the MRO, preferring __init__ if there is a tie.\n init_method = info.get('__init__')\n new_method = info.get('__new__')\n if not init_method or not is_valid_constructor(init_method.node):\n # Must be an invalid class definition.\n return AnyType(TypeOfAny.from_error)\n # There *should* always be a __new__ method except the test stubs\n # lack it, so just copy init_method in that situation\n new_method = new_method or init_method\n if not is_valid_constructor(new_method.node):\n # Must be an invalid class definition.\n return AnyType(TypeOfAny.from_error)\n\n # The two is_valid_constructor() checks ensure this.\n assert isinstance(new_method.node, (SYMBOL_FUNCBASE_TYPES, Decorator))\n assert isinstance(init_method.node, (SYMBOL_FUNCBASE_TYPES, Decorator))\n\n init_index = info.mro.index(init_method.node.info)\n new_index = info.mro.index(new_method.node.info)\n\n fallback = info.metaclass_type or builtin_type('builtins.type')\n if init_index < new_index:\n method = init_method.node # type: Union[FuncBase, Decorator]\n is_new = False\n elif init_index > new_index:\n method = new_method.node\n is_new = True\n else:\n if init_method.node.info.fullname == 'builtins.object':\n # Both are defined by object. But if we've got a bogus\n # base class, we can't know for sure, so check for that.\n if info.fallback_to_any:\n # Construct a universal callable as the prototype.\n any_type = AnyType(TypeOfAny.special_form)\n sig = CallableType(arg_types=[any_type, any_type],\n arg_kinds=[ARG_STAR, ARG_STAR2],\n arg_names=[\"_args\", \"_kwds\"],\n ret_type=any_type,\n fallback=builtin_type('builtins.function'))\n return class_callable(sig, info, fallback, None, is_new=False)\n\n # Otherwise prefer __init__ in a tie. It isn't clear that this\n # is the right thing, but __new__ caused problems with\n # typeshed (#5647).\n method = init_method.node\n is_new = False\n # Construct callable type based on signature of __init__. Adjust\n # return type and insert type arguments.\n if isinstance(method, FuncBase):\n t = function_type(method, fallback)\n else:\n assert isinstance(method.type, ProperType)\n assert isinstance(method.type, FunctionLike) # is_valid_constructor() ensures this\n t = method.type\n return type_object_type_from_function(t, info, method.info, fallback, is_new)\n\n\ndef is_valid_constructor(n: Optional[SymbolNode]) -> bool:\n \"\"\"Does this node represents a valid constructor method?\n\n This includes normal functions, overloaded functions, and decorators\n that return a callable type.\n \"\"\"\n if isinstance(n, FuncBase):\n return True\n if isinstance(n, Decorator):\n return isinstance(get_proper_type(n.type), FunctionLike)\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py___MatchMap.Dict_Tuple_int_int_Mat": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py___MatchMap.Dict_Tuple_int_int_Mat", "embedding": null, "metadata": {"file_path": "mypy/checkstrformat.py", "file_name": "checkstrformat.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 44, "span_ids": ["docstring"], "tokens": 385}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"\nFormat expression type checker.\n\nThis file is conceptually part of ExpressionChecker and TypeChecker. Main functionality\nis located in StringFormatterChecker.check_str_format_call() for '{}'.format(), and in\nStringFormatterChecker.check_str_interpolation() for printf-style % interpolation.\n\nNote that although at runtime format strings are parsed using custom parsers,\nhere we use a regexp-based approach. This way we 99% match runtime behaviour while keeping\nimplementation simple.\n\"\"\"\n\nimport re\n\nfrom typing import (\n cast, List, Tuple, Dict, Callable, Union, Optional, Pattern, Match, Set, Any\n)\nfrom typing_extensions import Final, TYPE_CHECKING\n\nfrom mypy.types import (\n Type, AnyType, TupleType, Instance, UnionType, TypeOfAny, get_proper_type, TypeVarType,\n LiteralType, get_proper_types\n)\nfrom mypy.nodes import (\n StrExpr, BytesExpr, UnicodeExpr, TupleExpr, DictExpr, Context, Expression, StarExpr, CallExpr,\n IndexExpr, MemberExpr, TempNode, ARG_POS, ARG_STAR, ARG_NAMED, ARG_STAR2,\n Node, MypyFile, ExpressionStmt, NameExpr, IntExpr\n)\nimport mypy.errorcodes as codes\n\nif TYPE_CHECKING:\n # break import cycle only needed for mypy\n import mypy.checker\n import mypy.checkexpr\nfrom mypy import message_registry\nfrom mypy.messages import MessageBuilder\nfrom mypy.maptype import map_instance_to_supertype\nfrom mypy.typeops import custom_special_method\nfrom mypy.subtypes import is_subtype\nfrom mypy.parse import parse\n\nFormatStringExpr = Union[StrExpr, BytesExpr, UnicodeExpr]\nCheckers = Tuple[Callable[[Expression], None], Callable[[Type], None]]\nMatchMap = Dict[Tuple[int, int], Match[str]]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py__span_match_compile_format_re.return.re_compile_format_re_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py__span_match_compile_format_re.return.re_compile_format_re_", "embedding": null, "metadata": {"file_path": "mypy/checkstrformat.py", "file_name": "checkstrformat.py", "file_type": "text/x-python", "category": "implementation", "start_line": 44, "end_line": 60, "span_ids": ["compile_format_re", "docstring"], "tokens": 239}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": " # span -> match\n\n\ndef compile_format_re() -> Pattern[str]:\n \"\"\"Construct regexp to match format conversion specifiers in % interpolation.\n\n See https://docs.python.org/3/library/stdtypes.html#printf-style-string-formatting\n The regexp is intentionally a bit wider to report better errors.\n \"\"\"\n key_re = r'(\\(([^()]*)\\))?' # (optional) parenthesised sequence of characters.\n flags_re = r'([#0\\-+ ]*)' # (optional) sequence of flags.\n width_re = r'(\\*|[1-9][0-9]*)?' # (optional) minimum field width (* or numbers).\n precision_re = r'(?:\\.(\\*|[0-9]+)?)?' # (optional) . followed by * of numbers.\n length_mod_re = r'[hlL]?' # (optional) length modifier (unused).\n type_re = r'(.)?' # conversion type.\n format_re = '%' + key_re + flags_re + width_re + precision_re + length_mod_re + type_re\n return re.compile(format_re)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_compile_new_format_re_compile_new_format_re.return.re_compile_field_conver": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_compile_new_format_re_compile_new_format_re.return.re_compile_field_conver", "embedding": null, "metadata": {"file_path": "mypy/checkstrformat.py", "file_name": "checkstrformat.py", "file_type": "text/x-python", "category": "implementation", "start_line": 63, "end_line": 92, "span_ids": ["compile_new_format_re"], "tokens": 414}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def compile_new_format_re(custom_spec: bool) -> Pattern[str]:\n \"\"\"Construct regexps to match format conversion specifiers in str.format() calls.\n\n See After https://docs.python.org/3/library/string.html#formatspec for\n specifications. The regexps are intentionally wider, to report better errors,\n instead of just not matching.\n \"\"\"\n\n # Field (optional) is an integer/identifier possibly followed by several .attr and [index].\n field = r'(?P(?P[^.[!:]*)([^:!]+)?)'\n\n # Conversion (optional) is ! followed by one of letters for forced repr(), str(), or ascii().\n conversion = r'(?P![^:])?'\n\n # Format specification (optional) follows its own mini-language:\n if not custom_spec:\n # Fill and align is valid for all builtin types.\n fill_align = r'(?P.?[<>=^])?'\n # Number formatting options are only valid for int, float, complex, and Decimal,\n # except if only width is given (it is valid for all types).\n # This contains sign, flags (sign, # and/or 0), width, grouping (_ or ,) and precision.\n num_spec = r'(?P[+\\- ]?#?0?)(?P\\d+)?[_,]?(?P\\.\\d+)?'\n # The last element is type.\n type = r'(?P.)?' # only some are supported, but we want to give a better error\n format_spec = r'(?P:' + fill_align + num_spec + type + r')?'\n else:\n # Custom types can define their own form_spec using __format__().\n format_spec = r'(?P:.*)?'\n\n return re.compile(field + conversion + format_spec)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_FORMAT_RE_FLOAT_TYPES._e_E_f_F_g_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_FORMAT_RE_FLOAT_TYPES._e_E_f_F_g_", "embedding": null, "metadata": {"file_path": "mypy/checkstrformat.py", "file_name": "checkstrformat.py", "file_type": "text/x-python", "category": "implementation", "start_line": 95, "end_line": 115, "span_ids": ["impl:8"], "tokens": 331}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "FORMAT_RE = compile_format_re() # type: Final\nFORMAT_RE_NEW = compile_new_format_re(False) # type: Final\nFORMAT_RE_NEW_CUSTOM = compile_new_format_re(True) # type: Final\nDUMMY_FIELD_NAME = '__dummy_name__' # type: Final\n\n# Format types supported by str.format() for builtin classes.\nSUPPORTED_TYPES_NEW = {'b', 'c', 'd', 'e', 'E', 'f', 'F',\n 'g', 'G', 'n', 'o', 's', 'x', 'X', '%'} # type: Final\n\n# Types that require either int or float.\nNUMERIC_TYPES_OLD = {'d', 'i', 'o', 'u', 'x', 'X',\n 'e', 'E', 'f', 'F', 'g', 'G'} # type: Final\nNUMERIC_TYPES_NEW = {'b', 'd', 'o', 'e', 'E', 'f', 'F',\n 'g', 'G', 'n', 'x', 'X', '%'} # type: Final\n\n# These types accept _only_ int.\nREQUIRE_INT_OLD = {'o', 'x', 'X'} # type: Final\nREQUIRE_INT_NEW = {'b', 'd', 'o', 'x', 'X'} # type: Final\n\n# These types fall back to SupportsFloat with % (other fall back to SupportsInt)\nFLOAT_TYPES = {'e', 'E', 'f', 'F', 'g', 'G'}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_None_15_ConversionSpecifier.__init__.self.field.field": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_None_15_ConversionSpecifier.__init__.self.field.field", "embedding": null, "metadata": {"file_path": "mypy/checkstrformat.py", "file_name": "checkstrformat.py", "file_type": "text/x-python", "category": "implementation", "start_line": 115, "end_line": 136, "span_ids": ["ConversionSpecifier.__init__", "ConversionSpecifier", "impl:8"], "tokens": 187}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": " # type: Final\n\n\nclass ConversionSpecifier:\n def __init__(self, key: Optional[str],\n flags: str, width: str, precision: str, type: str,\n format_spec: Optional[str] = None,\n conversion: Optional[str] = None,\n field: Optional[str] = None) -> None:\n self.key = key\n self.flags = flags\n self.width = width\n self.precision = precision\n self.type = type\n # Used only for str.format() calls (it may be custom for types with __format__()).\n self.format_spec = format_spec\n self.non_standard_format_spec = False\n # Used only for str.format() calls.\n self.conversion = conversion\n # Full formatted expression (i.e. key plus following attributes and/or indexes).\n # Used only for str.format() calls.\n self.field = field", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_ConversionSpecifier.from_match_ConversionSpecifier.has_star.return.self_width_or_self": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_ConversionSpecifier.from_match_ConversionSpecifier.has_star.return.self_width_or_self", "embedding": null, "metadata": {"file_path": "mypy/checkstrformat.py", "file_name": "checkstrformat.py", "file_type": "text/x-python", "category": "implementation", "start_line": 138, "end_line": 163, "span_ids": ["ConversionSpecifier.has_star", "ConversionSpecifier.from_match", "ConversionSpecifier.has_key"], "tokens": 256}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ConversionSpecifier:\n\n @classmethod\n def from_match(cls, match_obj: Match[str],\n non_standard_spec: bool = False) -> 'ConversionSpecifier':\n \"\"\"Construct specifier from match object resulted from parsing str.format() call.\"\"\"\n match = cast(Any, match_obj) # TODO: remove this once typeshed is fixed.\n if non_standard_spec:\n spec = cls(match.group('key'),\n flags='', width='', precision='', type='',\n format_spec=match.group('format_spec'),\n conversion=match.group('conversion'),\n field=match.group('field'))\n spec.non_standard_format_spec = True\n return spec\n # Replace unmatched optional groups with empty matches (for convenience).\n return cls(match.group('key'),\n flags=match.group('flags') or '', width=match.group('width') or '',\n precision=match.group('precision') or '', type=match.group('type') or '',\n format_spec=match.group('format_spec'),\n conversion=match.group('conversion'),\n field=match.group('field'))\n\n def has_key(self) -> bool:\n return self.key is not None\n\n def has_star(self) -> bool:\n return self.width == '*' or self.precision == '*'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker_StringFormatterChecker.__init__.self.unicode_upcast.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker_StringFormatterChecker.__init__.self.unicode_upcast.False", "embedding": null, "metadata": {"file_path": "mypy/checkstrformat.py", "file_name": "checkstrformat.py", "file_type": "text/x-python", "category": "implementation", "start_line": 166, "end_line": 189, "span_ids": ["StringFormatterChecker", "StringFormatterChecker.__init__"], "tokens": 236}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StringFormatterChecker:\n \"\"\"String interpolation/formatter type checker.\n\n This class works closely together with checker.ExpressionChecker.\n \"\"\"\n\n # Some services are provided by a TypeChecker instance.\n chk = None # type: mypy.checker.TypeChecker\n # This is shared with TypeChecker, but stored also here for convenience.\n msg = None # type: MessageBuilder\n # Some services are provided by a ExpressionChecker instance.\n exprchk = None # type: mypy.checkexpr.ExpressionChecker\n\n def __init__(self,\n exprchk: 'mypy.checkexpr.ExpressionChecker',\n chk: 'mypy.checker.TypeChecker',\n msg: MessageBuilder) -> None:\n \"\"\"Construct an expression type checker.\"\"\"\n self.chk = chk\n self.exprchk = exprchk\n self.msg = msg\n # This flag is used to track Python 2 corner case where for example\n # '%s, %d' % (u'abc', 42) returns u'abc, 42' (i.e. unicode, not a string).\n self.unicode_upcast = False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.check_str_format_call_StringFormatterChecker.check_str_format_call.self_check_specs_in_forma": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.check_str_format_call_StringFormatterChecker.check_str_format_call.self_check_specs_in_forma", "embedding": null, "metadata": {"file_path": "mypy/checkstrformat.py", "file_name": "checkstrformat.py", "file_type": "text/x-python", "category": "implementation", "start_line": 191, "end_line": 217, "span_ids": ["StringFormatterChecker.check_str_format_call"], "tokens": 270}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StringFormatterChecker:\n\n def check_str_format_call(self, call: CallExpr, format_value: str) -> None:\n \"\"\"Perform more precise checks for str.format() calls when possible.\n\n Currently the checks are performed for:\n * Actual string literals\n * Literal types with string values\n * Final names with string values\n\n The checks that we currently perform:\n * Check generic validity (e.g. unmatched { or }, and {} in invalid positions)\n * Check consistency of specifiers' auto-numbering\n * Verify that replacements can be found for all conversion specifiers,\n and all arguments were used\n * Non-standard format specs are only allowed for types with custom __format__\n * Type check replacements with accessors applied (if any).\n * Verify that specifier type is known and matches replacement type\n * Perform special checks for some specifier types:\n - 'c' requires a single character string\n - 's' must not accept bytes\n - non-empty flags are only allowed for numeric types\n \"\"\"\n conv_specs = self.parse_format_value(format_value, call)\n if conv_specs is None:\n return\n if not self.auto_generate_keys(conv_specs, call):\n return\n self.check_specs_in_format_call(call, conv_specs, format_value)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.parse_format_value_StringFormatterChecker.parse_format_value.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.parse_format_value_StringFormatterChecker.parse_format_value.return.result", "embedding": null, "metadata": {"file_path": "mypy/checkstrformat.py", "file_name": "checkstrformat.py", "file_type": "text/x-python", "category": "implementation", "start_line": 219, "end_line": 263, "span_ids": ["StringFormatterChecker.parse_format_value"], "tokens": 403}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StringFormatterChecker:\n\n def parse_format_value(self, format_value: str, ctx: Context,\n nested: bool = False) -> Optional[List[ConversionSpecifier]]:\n \"\"\"Parse format string into list of conversion specifiers.\n\n The specifiers may be nested (two levels maximum), in this case they are ordered as\n '{0:{1}}, {2:{3}{4}}'. Return None in case of an error.\n \"\"\"\n top_targets = self.find_non_escaped_targets(format_value, ctx)\n if top_targets is None:\n return None\n\n result = [] # type: List[ConversionSpecifier]\n for target in top_targets:\n match = FORMAT_RE_NEW.fullmatch(target)\n if match:\n conv_spec = ConversionSpecifier.from_match(match)\n else:\n custom_match = FORMAT_RE_NEW_CUSTOM.fullmatch(target)\n if custom_match:\n conv_spec = ConversionSpecifier.from_match(custom_match,\n non_standard_spec=True)\n else:\n self.msg.fail('Invalid conversion specifier in format string',\n ctx, code=codes.STRING_FORMATTING)\n return None\n\n if conv_spec.key and ('{' in conv_spec.key or '}' in conv_spec.key):\n self.msg.fail('Conversion value must not contain { or }',\n ctx, code=codes.STRING_FORMATTING)\n return None\n result.append(conv_spec)\n\n # Parse nested conversions that are allowed in format specifier.\n if (conv_spec.format_spec and conv_spec.non_standard_format_spec and\n ('{' in conv_spec.format_spec or '}' in conv_spec.format_spec)):\n if nested:\n self.msg.fail('Formatting nesting must be at most two levels deep',\n ctx, code=codes.STRING_FORMATTING)\n return None\n sub_conv_specs = self.parse_format_value(conv_spec.format_spec, ctx=ctx,\n nested=True)\n if sub_conv_specs is None:\n return None\n result.extend(sub_conv_specs)\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.find_non_escaped_targets_StringFormatterChecker.find_non_escaped_targets.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.find_non_escaped_targets_StringFormatterChecker.find_non_escaped_targets.return.result", "embedding": null, "metadata": {"file_path": "mypy/checkstrformat.py", "file_name": "checkstrformat.py", "file_type": "text/x-python", "category": "implementation", "start_line": 265, "end_line": 311, "span_ids": ["StringFormatterChecker.find_non_escaped_targets"], "tokens": 395}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StringFormatterChecker:\n\n def find_non_escaped_targets(self, format_value: str, ctx: Context) -> Optional[List[str]]:\n \"\"\"Return list of raw (un-parsed) format specifiers in format string.\n\n Format specifiers don't include enclosing braces. We don't use regexp for\n this because they don't work well with nested/repeated patterns\n (both greedy and non-greedy), and these are heavily used internally for\n representation of f-strings.\n\n Return None in case of an error.\n \"\"\"\n result = []\n next_spec = ''\n pos = 0\n nesting = 0\n while pos < len(format_value):\n c = format_value[pos]\n if not nesting:\n # Skip any paired '{{' and '}}', enter nesting on '{', report error on '}'.\n if c == '{':\n if pos < len(format_value) - 1 and format_value[pos + 1] == '{':\n pos += 1\n else:\n nesting = 1\n if c == '}':\n if pos < len(format_value) - 1 and format_value[pos + 1] == '}':\n pos += 1\n else:\n self.msg.fail('Invalid conversion specifier in format string:'\n ' unexpected }', ctx, code=codes.STRING_FORMATTING)\n return None\n else:\n # Adjust nesting level, then either continue adding chars or move on.\n if c == '{':\n nesting += 1\n if c == '}':\n nesting -= 1\n if nesting:\n next_spec += c\n else:\n result.append(next_spec)\n next_spec = ''\n pos += 1\n if nesting:\n self.msg.fail('Invalid conversion specifier in format string:'\n ' unmatched {', ctx, code=codes.STRING_FORMATTING)\n return None\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.check_specs_in_format_call_StringFormatterChecker.check_specs_in_format_call.for_spec_repl_in_zip_spe.for_a_type_in_actual_item.self_perform_special_form": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.check_specs_in_format_call_StringFormatterChecker.check_specs_in_format_call.for_spec_repl_in_zip_spe.for_a_type_in_actual_item.self_perform_special_form", "embedding": null, "metadata": {"file_path": "mypy/checkstrformat.py", "file_name": "checkstrformat.py", "file_type": "text/x-python", "category": "implementation", "start_line": 313, "end_line": 368, "span_ids": ["StringFormatterChecker.check_specs_in_format_call"], "tokens": 612}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StringFormatterChecker:\n\n def check_specs_in_format_call(self, call: CallExpr,\n specs: List[ConversionSpecifier], format_value: str) -> None:\n \"\"\"Perform pairwise checks for conversion specifiers vs their replacements.\n\n The core logic for format checking is implemented in this method.\n \"\"\"\n assert all(s.key for s in specs), \"Keys must be auto-generated first!\"\n replacements = self.find_replacements_in_call(call, [cast(str, s.key) for s in specs])\n assert len(replacements) == len(specs)\n for spec, repl in zip(specs, replacements):\n repl = self.apply_field_accessors(spec, repl, ctx=call)\n actual_type = repl.type if isinstance(repl, TempNode) else self.chk.type_map.get(repl)\n assert actual_type is not None\n\n # Special case custom formatting.\n if (spec.format_spec and spec.non_standard_format_spec and\n # Exclude \"dynamic\" specifiers (i.e. containing nested formatting).\n not ('{' in spec.format_spec or '}' in spec.format_spec)):\n if (not custom_special_method(actual_type, '__format__', check_all=True) or\n spec.conversion):\n # TODO: add support for some custom specs like datetime?\n self.msg.fail('Unrecognized format'\n ' specification \"{}\"'.format(spec.format_spec[1:]),\n call, code=codes.STRING_FORMATTING)\n continue\n # Adjust expected and actual types.\n if not spec.type:\n expected_type = AnyType(TypeOfAny.special_form) # type: Optional[Type]\n else:\n assert isinstance(call.callee, MemberExpr)\n if isinstance(call.callee.expr, (StrExpr, UnicodeExpr)):\n format_str = call.callee.expr\n else:\n format_str = StrExpr(format_value)\n expected_type = self.conversion_type(spec.type, call, format_str,\n format_call=True)\n if spec.conversion is not None:\n # If the explicit conversion is given, then explicit conversion is called _first_.\n if spec.conversion[1] not in 'rsa':\n self.msg.fail('Invalid conversion type \"{}\",'\n ' must be one of \"r\", \"s\" or \"a\"'.format(spec.conversion[1]),\n call, code=codes.STRING_FORMATTING)\n actual_type = self.named_type('builtins.str')\n\n # Perform the checks for given types.\n if expected_type is None:\n continue\n\n a_type = get_proper_type(actual_type)\n actual_items = (get_proper_types(a_type.items) if isinstance(a_type, UnionType)\n else [a_type])\n for a_type in actual_items:\n if custom_special_method(a_type, '__format__'):\n continue\n self.check_placeholder_type(a_type, expected_type, call)\n self.perform_special_format_checks(spec, call, repl, a_type, expected_type)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.perform_special_format_checks_StringFormatterChecker.perform_special_format_checks.if_spec_flags_.if_spec_type_and_spec_ty.self_msg_fail_Numeric_fl": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.perform_special_format_checks_StringFormatterChecker.perform_special_format_checks.if_spec_flags_.if_spec_type_and_spec_ty.self_msg_fail_Numeric_fl", "embedding": null, "metadata": {"file_path": "mypy/checkstrformat.py", "file_name": "checkstrformat.py", "file_type": "text/x-python", "category": "implementation", "start_line": 370, "end_line": 398, "span_ids": ["StringFormatterChecker.perform_special_format_checks"], "tokens": 401}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StringFormatterChecker:\n\n def perform_special_format_checks(self, spec: ConversionSpecifier, call: CallExpr,\n repl: Expression, actual_type: Type,\n expected_type: Type) -> None:\n # TODO: try refactoring to combine this logic with % formatting.\n if spec.type == 'c':\n if isinstance(repl, (StrExpr, BytesExpr)) and len(repl.value) != 1:\n self.msg.requires_int_or_char(call, format_call=True)\n c_typ = get_proper_type(self.chk.type_map[repl])\n if isinstance(c_typ, Instance) and c_typ.last_known_value:\n c_typ = c_typ.last_known_value\n if isinstance(c_typ, LiteralType) and isinstance(c_typ.value, str):\n if len(c_typ.value) != 1:\n self.msg.requires_int_or_char(call, format_call=True)\n if (not spec.type or spec.type == 's') and not spec.conversion:\n if self.chk.options.python_version >= (3, 0):\n if (has_type_component(actual_type, 'builtins.bytes') and\n not custom_special_method(actual_type, '__str__')):\n self.msg.fail(\n \"On Python 3 '{}'.format(b'abc') produces \\\"b'abc'\\\", not 'abc'; \"\n \"use '{!r}'.format(b'abc') if this is desired behavior\",\n call, code=codes.STR_BYTES_PY3)\n if spec.flags:\n numeric_types = UnionType([self.named_type('builtins.int'),\n self.named_type('builtins.float')])\n if (spec.type and spec.type not in NUMERIC_TYPES_NEW or\n not spec.type and not is_subtype(actual_type, numeric_types) and\n not custom_special_method(actual_type, '__format__')):\n self.msg.fail('Numeric flags are only allowed for numeric types', call,\n code=codes.STRING_FORMATTING)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.find_replacements_in_call_StringFormatterChecker.find_replacements_in_call.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.find_replacements_in_call_StringFormatterChecker.find_replacements_in_call.return.result", "embedding": null, "metadata": {"file_path": "mypy/checkstrformat.py", "file_name": "checkstrformat.py", "file_type": "text/x-python", "category": "implementation", "start_line": 400, "end_line": 431, "span_ids": ["StringFormatterChecker.find_replacements_in_call"], "tokens": 332}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StringFormatterChecker:\n\n def find_replacements_in_call(self, call: CallExpr,\n keys: List[str]) -> List[Expression]:\n \"\"\"Find replacement expression for every specifier in str.format() call.\n\n In case of an error use TempNode(AnyType).\n \"\"\"\n result = [] # type: List[Expression]\n used = set() # type: Set[Expression]\n for key in keys:\n if key.isdecimal():\n expr = self.get_expr_by_position(int(key), call)\n if not expr:\n self.msg.fail('Cannot find replacement for positional'\n ' format specifier {}'.format(key), call,\n code=codes.STRING_FORMATTING)\n expr = TempNode(AnyType(TypeOfAny.from_error))\n else:\n expr = self.get_expr_by_name(key, call)\n if not expr:\n self.msg.fail('Cannot find replacement for named'\n ' format specifier \"{}\"'.format(key), call,\n code=codes.STRING_FORMATTING)\n expr = TempNode(AnyType(TypeOfAny.from_error))\n result.append(expr)\n if not isinstance(expr, TempNode):\n used.add(expr)\n # Strictly speaking not using all replacements is not a type error, but most likely\n # a typo in user code, so we show an error like we do for % formatting.\n total_explicit = len([kind for kind in call.arg_kinds if kind in (ARG_POS, ARG_NAMED)])\n if len(used) < total_explicit:\n self.msg.too_many_string_formatting_arguments(call)\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.get_expr_by_position_StringFormatterChecker.get_expr_by_position.return.TempNode_map_instance_to_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.get_expr_by_position_StringFormatterChecker.get_expr_by_position.return.TempNode_map_instance_to_", "embedding": null, "metadata": {"file_path": "mypy/checkstrformat.py", "file_name": "checkstrformat.py", "file_type": "text/x-python", "category": "implementation", "start_line": 433, "end_line": 455, "span_ids": ["StringFormatterChecker.get_expr_by_position"], "tokens": 282}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StringFormatterChecker:\n\n def get_expr_by_position(self, pos: int, call: CallExpr) -> Optional[Expression]:\n \"\"\"Get positional replacement expression from '{0}, {1}'.format(x, y, ...) call.\n\n If the type is from *args, return TempNode(). Return None in case of\n an error.\n \"\"\"\n pos_args = [arg for arg, kind in zip(call.args, call.arg_kinds) if kind == ARG_POS]\n if pos < len(pos_args):\n return pos_args[pos]\n star_args = [arg for arg, kind in zip(call.args, call.arg_kinds) if kind == ARG_STAR]\n if not star_args:\n return None\n\n # Fall back to *args when present in call.\n star_arg = star_args[0]\n varargs_type = get_proper_type(self.chk.type_map[star_arg])\n if (not isinstance(varargs_type, Instance) or not\n varargs_type.type.has_base('typing.Sequence')):\n # Error should be already reported.\n return TempNode(AnyType(TypeOfAny.special_form))\n iter_info = self.chk.named_generic_type('typing.Sequence',\n [AnyType(TypeOfAny.special_form)]).type\n return TempNode(map_instance_to_supertype(varargs_type, iter_info).args[0])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.get_expr_by_name_StringFormatterChecker.get_expr_by_name.return.TempNode_map_instance_to_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.get_expr_by_name_StringFormatterChecker.get_expr_by_name.return.TempNode_map_instance_to_", "embedding": null, "metadata": {"file_path": "mypy/checkstrformat.py", "file_name": "checkstrformat.py", "file_type": "text/x-python", "category": "implementation", "start_line": 457, "end_line": 479, "span_ids": ["StringFormatterChecker.get_expr_by_name"], "tokens": 291}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StringFormatterChecker:\n\n def get_expr_by_name(self, key: str, call: CallExpr) -> Optional[Expression]:\n \"\"\"Get named replacement expression from '{name}'.format(name=...) call.\n\n If the type is from **kwargs, return TempNode(). Return None in case of\n an error.\n \"\"\"\n named_args = [arg for arg, kind, name in zip(call.args, call.arg_kinds, call.arg_names)\n if kind == ARG_NAMED and name == key]\n if named_args:\n return named_args[0]\n star_args_2 = [arg for arg, kind in zip(call.args, call.arg_kinds) if kind == ARG_STAR2]\n if not star_args_2:\n return None\n star_arg_2 = star_args_2[0]\n kwargs_type = get_proper_type(self.chk.type_map[star_arg_2])\n if (not isinstance(kwargs_type, Instance) or not\n kwargs_type.type.has_base('typing.Mapping')):\n # Error should be already reported.\n return TempNode(AnyType(TypeOfAny.special_form))\n any_type = AnyType(TypeOfAny.special_form)\n mapping_info = self.chk.named_generic_type('typing.Mapping',\n [any_type, any_type]).type\n return TempNode(map_instance_to_supertype(kwargs_type, mapping_info).args[1])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.auto_generate_keys_StringFormatterChecker.auto_generate_keys.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.auto_generate_keys_StringFormatterChecker.auto_generate_keys.return.True", "embedding": null, "metadata": {"file_path": "mypy/checkstrformat.py", "file_name": "checkstrformat.py", "file_type": "text/x-python", "category": "implementation", "start_line": 481, "end_line": 506, "span_ids": ["StringFormatterChecker.auto_generate_keys"], "tokens": 241}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StringFormatterChecker:\n\n def auto_generate_keys(self, all_specs: List[ConversionSpecifier],\n ctx: Context) -> bool:\n \"\"\"Translate '{} {name} {}' to '{0} {name} {1}'.\n\n Return True if generation was successful, otherwise report an error and return false.\n \"\"\"\n some_defined = any(s.key and s.key.isdecimal() for s in all_specs)\n all_defined = all(bool(s.key) for s in all_specs)\n if some_defined and not all_defined:\n self.msg.fail('Cannot combine automatic field numbering and'\n ' manual field specification', ctx, code=codes.STRING_FORMATTING)\n return False\n if all_defined:\n return True\n next_index = 0\n for spec in all_specs:\n if not spec.key:\n str_index = str(next_index)\n spec.key = str_index\n # Update also the full field (i.e. turn {.x} into {0.x}).\n if not spec.field:\n spec.field = str_index\n else:\n spec.field = str_index + spec.field\n next_index += 1\n return True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.apply_field_accessors_StringFormatterChecker.apply_field_accessors.return.temp_ast": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.apply_field_accessors_StringFormatterChecker.apply_field_accessors.return.temp_ast", "embedding": null, "metadata": {"file_path": "mypy/checkstrformat.py", "file_name": "checkstrformat.py", "file_type": "text/x-python", "category": "implementation", "start_line": 508, "end_line": 542, "span_ids": ["StringFormatterChecker.apply_field_accessors"], "tokens": 366}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StringFormatterChecker:\n\n def apply_field_accessors(self, spec: ConversionSpecifier, repl: Expression,\n ctx: Context) -> Expression:\n \"\"\"Transform and validate expr in '{.attr[item]}'.format(expr) into expr.attr['item'].\n\n If validation fails, return TempNode(AnyType).\n \"\"\"\n assert spec.key, \"Keys must be auto-generated first!\"\n if spec.field == spec.key:\n return repl\n assert spec.field\n\n # This is a bit of a dirty trick, but it looks like this is the simplest way.\n temp_errors = self.msg.clean_copy().errors\n dummy = DUMMY_FIELD_NAME + spec.field[len(spec.key):]\n temp_ast = parse(dummy, fnam='', module=None,\n options=self.chk.options, errors=temp_errors) # type: Node\n if temp_errors.is_errors():\n self.msg.fail('Syntax error in format specifier \"{}\"'.format(spec.field),\n ctx, code=codes.STRING_FORMATTING)\n return TempNode(AnyType(TypeOfAny.from_error))\n\n # These asserts are guaranteed by the original regexp.\n assert isinstance(temp_ast, MypyFile)\n temp_ast = temp_ast.defs[0]\n assert isinstance(temp_ast, ExpressionStmt)\n temp_ast = temp_ast.expr\n if not self.validate_and_transform_accessors(temp_ast, repl, spec, ctx=ctx):\n return TempNode(AnyType(TypeOfAny.from_error))\n\n # Check if there are any other errors (like missing members).\n # TODO: fix column to point to actual start of the format specifier _within_ string.\n temp_ast.line = ctx.line\n temp_ast.column = ctx.column\n self.exprchk.accept(temp_ast)\n return temp_ast", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.validate_and_transform_accessors_StringFormatterChecker.validate_and_transform_accessors.return.self_validate_and_transfo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.validate_and_transform_accessors_StringFormatterChecker.validate_and_transform_accessors.return.self_validate_and_transfo", "embedding": null, "metadata": {"file_path": "mypy/checkstrformat.py", "file_name": "checkstrformat.py", "file_type": "text/x-python", "category": "implementation", "start_line": 544, "end_line": 587, "span_ids": ["StringFormatterChecker.validate_and_transform_accessors"], "tokens": 437}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StringFormatterChecker:\n\n def validate_and_transform_accessors(self, temp_ast: Expression, original_repl: Expression,\n spec: ConversionSpecifier, ctx: Context) -> bool:\n \"\"\"Validate and transform (in-place) format field accessors.\n\n On error, report it and return False. The transformations include replacing the dummy\n variable with actual replacement expression and translating any name expressions in an\n index into strings, so that this will work:\n\n class User(TypedDict):\n name: str\n id: int\n u: User\n '{[id]:d} -> {[name]}'.format(u)\n \"\"\"\n if not isinstance(temp_ast, (MemberExpr, IndexExpr)):\n self.msg.fail('Only index and member expressions are allowed in'\n ' format field accessors; got \"{}\"'.format(spec.field),\n ctx, code=codes.STRING_FORMATTING)\n return False\n if isinstance(temp_ast, MemberExpr):\n node = temp_ast.expr\n else:\n node = temp_ast.base\n if not isinstance(temp_ast.index, (NameExpr, IntExpr)):\n assert spec.key, \"Call this method only after auto-generating keys!\"\n assert spec.field\n self.msg.fail('Invalid index expression in format field'\n ' accessor \"{}\"'.format(spec.field[len(spec.key):]), ctx,\n code=codes.STRING_FORMATTING)\n return False\n if isinstance(temp_ast.index, NameExpr):\n temp_ast.index = StrExpr(temp_ast.index.name)\n if isinstance(node, NameExpr) and node.name == DUMMY_FIELD_NAME:\n # Replace it with the actual replacement expression.\n assert isinstance(temp_ast, (IndexExpr, MemberExpr)) # XXX: this is redundant\n if isinstance(temp_ast, IndexExpr):\n temp_ast.base = original_repl\n else:\n temp_ast.expr = original_repl\n return True\n node.line = ctx.line\n node.column = ctx.column\n return self.validate_and_transform_accessors(node, original_repl=original_repl,\n spec=spec, ctx=ctx)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker._TODO_In_Python_3_the__StringFormatterChecker.check_str_interpolation.None_2.else_.assert_False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker._TODO_In_Python_3_the__StringFormatterChecker.check_str_interpolation.None_2.else_.assert_False", "embedding": null, "metadata": {"file_path": "mypy/checkstrformat.py", "file_name": "checkstrformat.py", "file_type": "text/x-python", "category": "implementation", "start_line": 589, "end_line": 622, "span_ids": ["StringFormatterChecker.validate_and_transform_accessors", "StringFormatterChecker.check_str_interpolation"], "tokens": 324}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StringFormatterChecker:\n\n # TODO: In Python 3, the bytes formatting has a more restricted set of options\n # compared to string formatting.\n def check_str_interpolation(self,\n expr: FormatStringExpr,\n replacements: Expression) -> Type:\n \"\"\"Check the types of the 'replacements' in a string interpolation\n expression: str % replacements.\n \"\"\"\n self.exprchk.accept(expr)\n specifiers = self.parse_conversion_specifiers(expr.value)\n has_mapping_keys = self.analyze_conversion_specifiers(specifiers, expr)\n if isinstance(expr, BytesExpr) and (3, 0) <= self.chk.options.python_version < (3, 5):\n self.msg.fail('Bytes formatting is only supported in Python 3.5 and later',\n replacements, code=codes.STRING_FORMATTING)\n return AnyType(TypeOfAny.from_error)\n\n self.unicode_upcast = False\n if has_mapping_keys is None:\n pass # Error was reported\n elif has_mapping_keys:\n self.check_mapping_str_interpolation(specifiers, replacements, expr)\n else:\n self.check_simple_str_interpolation(specifiers, replacements, expr)\n\n if isinstance(expr, BytesExpr):\n return self.named_type('builtins.bytes')\n elif isinstance(expr, UnicodeExpr):\n return self.named_type('builtins.unicode')\n elif isinstance(expr, StrExpr):\n if self.unicode_upcast:\n return self.named_type('builtins.unicode')\n return self.named_type('builtins.str')\n else:\n assert False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.parse_conversion_specifiers_StringFormatterChecker.analyze_conversion_specifiers.return.has_key": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.parse_conversion_specifiers_StringFormatterChecker.analyze_conversion_specifiers.return.has_key", "embedding": null, "metadata": {"file_path": "mypy/checkstrformat.py", "file_name": "checkstrformat.py", "file_type": "text/x-python", "category": "implementation", "start_line": 624, "end_line": 646, "span_ids": ["StringFormatterChecker.analyze_conversion_specifiers", "StringFormatterChecker.parse_conversion_specifiers"], "tokens": 231}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StringFormatterChecker:\n\n def parse_conversion_specifiers(self, format: str) -> List[ConversionSpecifier]:\n specifiers = [] # type: List[ConversionSpecifier]\n for parens_key, key, flags, width, precision, type in FORMAT_RE.findall(format):\n if parens_key == '':\n key = None\n specifiers.append(ConversionSpecifier(key, flags, width, precision, type))\n return specifiers\n\n def analyze_conversion_specifiers(self, specifiers: List[ConversionSpecifier],\n context: Context) -> Optional[bool]:\n has_star = any(specifier.has_star() for specifier in specifiers)\n has_key = any(specifier.has_key() for specifier in specifiers)\n all_have_keys = all(\n specifier.has_key() or specifier.type == '%' for specifier in specifiers\n )\n\n if has_key and has_star:\n self.msg.string_interpolation_with_star_and_key(context)\n return None\n if has_key and not all_have_keys:\n self.msg.string_interpolation_mixing_key_and_non_keys(context)\n return None\n return has_key", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.check_simple_str_interpolation_StringFormatterChecker.check_simple_str_interpolation.if_len_checkers_len_re.else_.if_len_checkers_1_.else_.for_checks_rep_type_in_z.check_type_rep_type_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.check_simple_str_interpolation_StringFormatterChecker.check_simple_str_interpolation.if_len_checkers_len_re.else_.if_len_checkers_1_.else_.for_checks_rep_type_in_z.check_type_rep_type_", "embedding": null, "metadata": {"file_path": "mypy/checkstrformat.py", "file_name": "checkstrformat.py", "file_type": "text/x-python", "category": "implementation", "start_line": 648, "end_line": 692, "span_ids": ["StringFormatterChecker.check_simple_str_interpolation"], "tokens": 457}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StringFormatterChecker:\n\n def check_simple_str_interpolation(self, specifiers: List[ConversionSpecifier],\n replacements: Expression, expr: FormatStringExpr) -> None:\n \"\"\"Check % string interpolation with positional specifiers '%s, %d' % ('yes, 42').\"\"\"\n checkers = self.build_replacement_checkers(specifiers, replacements, expr)\n if checkers is None:\n return\n\n rhs_type = get_proper_type(self.accept(replacements))\n rep_types = [] # type: List[Type]\n if isinstance(rhs_type, TupleType):\n rep_types = rhs_type.items\n elif isinstance(rhs_type, AnyType):\n return\n elif isinstance(rhs_type, Instance) and rhs_type.type.fullname == 'builtins.tuple':\n # Assume that an arbitrary-length tuple has the right number of items.\n rep_types = [rhs_type.args[0]] * len(checkers)\n elif isinstance(rhs_type, UnionType):\n for typ in rhs_type.relevant_items():\n temp_node = TempNode(typ)\n temp_node.line = replacements.line\n self.check_simple_str_interpolation(specifiers, temp_node, expr)\n return\n else:\n rep_types = [rhs_type]\n\n if len(checkers) > len(rep_types):\n self.msg.too_few_string_formatting_arguments(replacements)\n elif len(checkers) < len(rep_types):\n self.msg.too_many_string_formatting_arguments(replacements)\n else:\n if len(checkers) == 1:\n check_node, check_type = checkers[0]\n if isinstance(rhs_type, TupleType) and len(rhs_type.items) == 1:\n check_type(rhs_type.items[0])\n else:\n check_node(replacements)\n elif (isinstance(replacements, TupleExpr)\n and not any(isinstance(item, StarExpr) for item in replacements.items)):\n for checks, rep_node in zip(checkers, replacements.items):\n check_node, check_type = checks\n check_node(rep_node)\n else:\n for checks, rep_type in zip(checkers, rep_types):\n check_node, check_type = checks\n check_type(rep_type)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.check_mapping_str_interpolation_StringFormatterChecker.check_mapping_str_interpolation.if_isinstance_replacemen.else_.self_chk_check_subtype_re": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.check_mapping_str_interpolation_StringFormatterChecker.check_mapping_str_interpolation.if_isinstance_replacemen.else_.self_chk_check_subtype_re", "embedding": null, "metadata": {"file_path": "mypy/checkstrformat.py", "file_name": "checkstrformat.py", "file_type": "text/x-python", "category": "implementation", "start_line": 694, "end_line": 736, "span_ids": ["StringFormatterChecker.check_mapping_str_interpolation"], "tokens": 455}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StringFormatterChecker:\n\n def check_mapping_str_interpolation(self, specifiers: List[ConversionSpecifier],\n replacements: Expression,\n expr: FormatStringExpr) -> None:\n \"\"\"Check % string interpolation with names specifiers '%(name)s' % {'name': 'John'}.\"\"\"\n if (isinstance(replacements, DictExpr) and\n all(isinstance(k, (StrExpr, BytesExpr, UnicodeExpr))\n for k, v in replacements.items)):\n mapping = {} # type: Dict[str, Type]\n for k, v in replacements.items:\n if self.chk.options.python_version >= (3, 0) and isinstance(expr, BytesExpr):\n # Special case: for bytes formatting keys must be bytes.\n if not isinstance(k, BytesExpr):\n self.msg.fail('Dictionary keys in bytes formatting must be bytes,'\n ' not strings', expr, code=codes.STRING_FORMATTING)\n key_str = cast(FormatStringExpr, k).value\n mapping[key_str] = self.accept(v)\n\n for specifier in specifiers:\n if specifier.type == '%':\n # %% is allowed in mappings, no checking is required\n continue\n assert specifier.key is not None\n if specifier.key not in mapping:\n self.msg.key_not_in_mapping(specifier.key, replacements)\n return\n rep_type = mapping[specifier.key]\n expected_type = self.conversion_type(specifier.type, replacements, expr)\n if expected_type is None:\n return\n self.chk.check_subtype(rep_type, expected_type, replacements,\n message_registry.INCOMPATIBLE_TYPES_IN_STR_INTERPOLATION,\n 'expression has type',\n 'placeholder with key \\'%s\\' has type' % specifier.key,\n code=codes.STRING_FORMATTING)\n if specifier.type == 's':\n self.check_s_special_cases(expr, rep_type, expr)\n else:\n rep_type = self.accept(replacements)\n dict_type = self.build_dict_type(expr)\n self.chk.check_subtype(rep_type, dict_type, replacements,\n message_registry.FORMAT_REQUIRES_MAPPING,\n 'expression has type', 'expected type for mapping is',\n code=codes.STRING_FORMATTING)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.build_dict_type_StringFormatterChecker.build_dict_type.if_self_chk_options_pytho.else_.return.UnionType_make_union_str": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.build_dict_type_StringFormatterChecker.build_dict_type.if_self_chk_options_pytho.else_.return.UnionType_make_union_str", "embedding": null, "metadata": {"file_path": "mypy/checkstrformat.py", "file_name": "checkstrformat.py", "file_type": "text/x-python", "category": "implementation", "start_line": 738, "end_line": 759, "span_ids": ["StringFormatterChecker.build_dict_type"], "tokens": 252}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StringFormatterChecker:\n\n def build_dict_type(self, expr: FormatStringExpr) -> Type:\n \"\"\"Build expected mapping type for right operand in % formatting.\"\"\"\n any_type = AnyType(TypeOfAny.special_form)\n if self.chk.options.python_version >= (3, 0):\n if isinstance(expr, BytesExpr):\n bytes_type = self.chk.named_generic_type('builtins.bytes', [])\n return self.chk.named_generic_type('typing.Mapping',\n [bytes_type, any_type])\n elif isinstance(expr, StrExpr):\n str_type = self.chk.named_generic_type('builtins.str', [])\n return self.chk.named_generic_type('typing.Mapping',\n [str_type, any_type])\n else:\n assert False, \"There should not be UnicodeExpr on Python 3\"\n else:\n str_type = self.chk.named_generic_type('builtins.str', [])\n unicode_type = self.chk.named_generic_type('builtins.unicode', [])\n str_map = self.chk.named_generic_type('typing.Mapping',\n [str_type, any_type])\n unicode_map = self.chk.named_generic_type('typing.Mapping',\n [unicode_type, any_type])\n return UnionType.make_union([str_map, unicode_map])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.build_replacement_checkers_StringFormatterChecker.replacement_checkers.return.checkers": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.build_replacement_checkers_StringFormatterChecker.replacement_checkers.return.checkers", "embedding": null, "metadata": {"file_path": "mypy/checkstrformat.py", "file_name": "checkstrformat.py", "file_type": "text/x-python", "category": "implementation", "start_line": 761, "end_line": 794, "span_ids": ["StringFormatterChecker.replacement_checkers", "StringFormatterChecker.build_replacement_checkers"], "tokens": 319}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StringFormatterChecker:\n\n def build_replacement_checkers(self, specifiers: List[ConversionSpecifier],\n context: Context, expr: FormatStringExpr\n ) -> Optional[List[Checkers]]:\n checkers = [] # type: List[Checkers]\n for specifier in specifiers:\n checker = self.replacement_checkers(specifier, context, expr)\n if checker is None:\n return None\n checkers.extend(checker)\n return checkers\n\n def replacement_checkers(self, specifier: ConversionSpecifier, context: Context,\n expr: FormatStringExpr) -> Optional[List[Checkers]]:\n \"\"\"Returns a list of tuples of two functions that check whether a replacement is\n of the right type for the specifier. The first functions take a node and checks\n its type in the right type context. The second function just checks a type.\n \"\"\"\n checkers = [] # type: List[Checkers]\n\n if specifier.width == '*':\n checkers.append(self.checkers_for_star(context))\n if specifier.precision == '*':\n checkers.append(self.checkers_for_star(context))\n if specifier.type == 'c':\n c = self.checkers_for_c_type(specifier.type, context, expr)\n if c is None:\n return None\n checkers.append(c)\n elif specifier.type != '%':\n c = self.checkers_for_regular_type(specifier.type, context, expr)\n if c is None:\n return None\n checkers.append(c)\n return checkers", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.checkers_for_star_StringFormatterChecker.check_placeholder_type.self_chk_check_subtype_ty": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.checkers_for_star_StringFormatterChecker.check_placeholder_type.self_chk_check_subtype_ty", "embedding": null, "metadata": {"file_path": "mypy/checkstrformat.py", "file_name": "checkstrformat.py", "file_type": "text/x-python", "category": "implementation", "start_line": 796, "end_line": 817, "span_ids": ["StringFormatterChecker.checkers_for_star", "StringFormatterChecker.check_placeholder_type"], "tokens": 210}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StringFormatterChecker:\n\n def checkers_for_star(self, context: Context) -> Checkers:\n \"\"\"Returns a tuple of check functions that check whether, respectively,\n a node or a type is compatible with a star in a conversion specifier.\n \"\"\"\n expected = self.named_type('builtins.int')\n\n def check_type(type: Type) -> None:\n expected = self.named_type('builtins.int')\n self.chk.check_subtype(type, expected, context, '* wants int',\n code=codes.STRING_FORMATTING)\n\n def check_expr(expr: Expression) -> None:\n type = self.accept(expr, expected)\n check_type(type)\n\n return check_expr, check_type\n\n def check_placeholder_type(self, typ: Type, expected_type: Type, context: Context) -> None:\n self.chk.check_subtype(typ, expected_type, context,\n message_registry.INCOMPATIBLE_TYPES_IN_STR_INTERPOLATION,\n 'expression has type', 'placeholder has type',\n code=codes.STRING_FORMATTING)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.checkers_for_regular_type_StringFormatterChecker.checkers_for_regular_type.return.check_expr_check_type": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.checkers_for_regular_type_StringFormatterChecker.checkers_for_regular_type.return.check_expr_check_type", "embedding": null, "metadata": {"file_path": "mypy/checkstrformat.py", "file_name": "checkstrformat.py", "file_type": "text/x-python", "category": "implementation", "start_line": 819, "end_line": 839, "span_ids": ["StringFormatterChecker.checkers_for_regular_type"], "tokens": 180}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StringFormatterChecker:\n\n def checkers_for_regular_type(self, type: str,\n context: Context,\n expr: FormatStringExpr) -> Optional[Checkers]:\n \"\"\"Returns a tuple of check functions that check whether, respectively,\n a node or a type is compatible with 'type'. Return None in case of an error.\n \"\"\"\n expected_type = self.conversion_type(type, context, expr)\n if expected_type is None:\n return None\n\n def check_type(typ: Type) -> None:\n assert expected_type is not None\n self.check_placeholder_type(typ, expected_type, context)\n if type == 's':\n self.check_s_special_cases(expr, typ, context)\n\n def check_expr(expr: Expression) -> None:\n type = self.accept(expr, expected_type)\n check_type(type)\n\n return check_expr, check_type", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.check_s_special_cases_StringFormatterChecker.check_s_special_cases.if_isinstance_expr_Bytes.if_self_chk_options_pytho.if_has_type_component_typ.self_msg_fail_On_Python_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.check_s_special_cases_StringFormatterChecker.check_s_special_cases.if_isinstance_expr_Bytes.if_self_chk_options_pytho.if_has_type_component_typ.self_msg_fail_On_Python_", "embedding": null, "metadata": {"file_path": "mypy/checkstrformat.py", "file_name": "checkstrformat.py", "file_type": "text/x-python", "category": "implementation", "start_line": 841, "end_line": 859, "span_ids": ["StringFormatterChecker.check_s_special_cases"], "tokens": 267}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StringFormatterChecker:\n\n def check_s_special_cases(self, expr: FormatStringExpr, typ: Type, context: Context) -> None:\n \"\"\"Additional special cases for %s in bytes vs string context.\"\"\"\n if isinstance(expr, StrExpr):\n # Couple special cases for string formatting.\n if self.chk.options.python_version >= (3, 0):\n if has_type_component(typ, 'builtins.bytes'):\n self.msg.fail(\n \"On Python 3 '%s' % b'abc' produces \\\"b'abc'\\\", not 'abc'; \"\n \"use '%r' % b'abc' if this is desired behavior\",\n context, code=codes.STR_BYTES_PY3)\n if self.chk.options.python_version < (3, 0):\n if has_type_component(typ, 'builtins.unicode'):\n self.unicode_upcast = True\n if isinstance(expr, BytesExpr):\n # A special case for bytes formatting: b'%s' actually requires bytes on Python 3.\n if self.chk.options.python_version >= (3, 0):\n if has_type_component(typ, 'builtins.str'):\n self.msg.fail(\"On Python 3 b'%s' requires bytes, not string\", context,\n code=codes.STRING_FORMATTING)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.checkers_for_c_type_StringFormatterChecker.checkers_for_c_type.return.check_expr_check_type": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.checkers_for_c_type_StringFormatterChecker.checkers_for_c_type.return.check_expr_check_type", "embedding": null, "metadata": {"file_path": "mypy/checkstrformat.py", "file_name": "checkstrformat.py", "file_type": "text/x-python", "category": "implementation", "start_line": 861, "end_line": 882, "span_ids": ["StringFormatterChecker.checkers_for_c_type"], "tokens": 206}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StringFormatterChecker:\n\n def checkers_for_c_type(self, type: str,\n context: Context,\n expr: FormatStringExpr) -> Optional[Checkers]:\n \"\"\"Returns a tuple of check functions that check whether, respectively,\n a node or a type is compatible with 'type' that is a character type.\n \"\"\"\n expected_type = self.conversion_type(type, context, expr)\n if expected_type is None:\n return None\n\n def check_type(type: Type) -> None:\n assert expected_type is not None\n self.check_placeholder_type(type, expected_type, context)\n\n def check_expr(expr: Expression) -> None:\n \"\"\"int, or str with length 1\"\"\"\n type = self.accept(expr, expected_type)\n if isinstance(expr, (StrExpr, BytesExpr)) and len(cast(StrExpr, expr).value) != 1:\n self.msg.requires_int_or_char(context)\n check_type(type)\n\n return check_expr, check_type", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.conversion_type_StringFormatterChecker.accept.return.self_chk_expr_checker_acc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_StringFormatterChecker.conversion_type_StringFormatterChecker.accept.return.self_chk_expr_checker_acc", "embedding": null, "metadata": {"file_path": "mypy/checkstrformat.py", "file_name": "checkstrformat.py", "file_type": "text/x-python", "category": "implementation", "start_line": 884, "end_line": 947, "span_ids": ["StringFormatterChecker.accept", "StringFormatterChecker.named_type", "StringFormatterChecker.conversion_type"], "tokens": 620}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StringFormatterChecker:\n\n def conversion_type(self, p: str, context: Context, expr: FormatStringExpr,\n format_call: bool = False) -> Optional[Type]:\n \"\"\"Return the type that is accepted for a string interpolation conversion specifier type.\n\n Note that both Python's float (e.g. %f) and integer (e.g. %d)\n specifier types accept both float and integers.\n\n The 'format_call' argument indicates whether this type came from % interpolation or from\n a str.format() call, the meaning of few formatting types are different.\n \"\"\"\n NUMERIC_TYPES = NUMERIC_TYPES_NEW if format_call else NUMERIC_TYPES_OLD\n INT_TYPES = REQUIRE_INT_NEW if format_call else REQUIRE_INT_OLD\n if p == 'b' and not format_call:\n if self.chk.options.python_version < (3, 5):\n self.msg.fail(\"Format character 'b' is only supported in Python 3.5 and later\",\n context, code=codes.STRING_FORMATTING)\n return None\n if not isinstance(expr, BytesExpr):\n self.msg.fail(\"Format character 'b' is only supported on bytes patterns\", context,\n code=codes.STRING_FORMATTING)\n return None\n return self.named_type('builtins.bytes')\n elif p == 'a':\n if self.chk.options.python_version < (3, 0):\n self.msg.fail(\"Format character 'a' is only supported in Python 3\", context,\n code=codes.STRING_FORMATTING)\n return None\n # TODO: return type object?\n return AnyType(TypeOfAny.special_form)\n elif p in ['s', 'r']:\n return AnyType(TypeOfAny.special_form)\n elif p in NUMERIC_TYPES:\n if p in INT_TYPES:\n numeric_types = [self.named_type('builtins.int')]\n else:\n numeric_types = [self.named_type('builtins.int'),\n self.named_type('builtins.float')]\n if not format_call:\n if p in FLOAT_TYPES:\n numeric_types.append(self.named_type('typing.SupportsFloat'))\n else:\n numeric_types.append(self.named_type('typing.SupportsInt'))\n return UnionType.make_union(numeric_types)\n elif p in ['c']:\n return UnionType([self.named_type('builtins.int'),\n self.named_type('builtins.float'),\n self.named_type('builtins.str')])\n else:\n self.msg.unsupported_placeholder(p, context)\n return None\n\n #\n # Helpers\n #\n\n def named_type(self, name: str) -> Instance:\n \"\"\"Return an instance type with type given by the name and no type\n arguments. Alias for TypeChecker.named_type.\n \"\"\"\n return self.chk.named_type(name)\n\n def accept(self, expr: Expression, context: Optional[Type] = None) -> Type:\n \"\"\"Type check a node. Alias for TypeChecker.accept.\"\"\"\n return self.chk.expr_checker.accept(expr, context)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_has_type_component_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkstrformat.py_has_type_component_", "embedding": null, "metadata": {"file_path": "mypy/checkstrformat.py", "file_name": "checkstrformat.py", "file_type": "text/x-python", "category": "implementation", "start_line": 950, "end_line": 967, "span_ids": ["has_type_component"], "tokens": 180}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def has_type_component(typ: Type, fullname: str) -> bool:\n \"\"\"Is this a specific instance type, or a union that contains it?\n\n We use this ad-hoc function instead of a proper visitor or subtype check\n because some str vs bytes errors are strictly speaking not runtime errors,\n but rather highly counter-intuitive behavior. This is similar to what is used for\n --strict-equality.\n \"\"\"\n typ = get_proper_type(typ)\n if isinstance(typ, Instance):\n return typ.type.has_base(fullname)\n elif isinstance(typ, TypeVarType):\n return (has_type_component(typ.upper_bound, fullname) or\n any(has_type_component(v, fullname) for v in typ.values))\n elif isinstance(typ, UnionType):\n return any(has_type_component(t, fullname) for t in typ.relevant_items())\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/config_parser.py_argparse_parse_version.return.major_minor": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/config_parser.py_argparse_parse_version.return.major_minor", "embedding": null, "metadata": {"file_path": "mypy/config_parser.py", "file_name": "config_parser.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 34, "span_ids": ["imports", "parse_version"], "tokens": 288}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import argparse\nimport configparser\nimport glob as fileglob\nfrom io import StringIO\nimport os\nimport re\nimport sys\n\nfrom typing import Any, Callable, Dict, List, Mapping, Optional, Tuple, TextIO\nfrom typing_extensions import Final\n\nfrom mypy import defaults\nfrom mypy.options import Options, PER_MODULE_OPTIONS\n\n\ndef parse_version(v: str) -> Tuple[int, int]:\n m = re.match(r'\\A(\\d)\\.(\\d+)\\Z', v)\n if not m:\n raise argparse.ArgumentTypeError(\n \"Invalid python version '{}' (expected format: 'x.y')\".format(v))\n major, minor = int(m.group(1)), int(m.group(2))\n if major == 2:\n if minor != 7:\n raise argparse.ArgumentTypeError(\n \"Python 2.{} is not supported (must be 2.7)\".format(minor))\n elif major == 3:\n if minor < defaults.PYTHON3_VERSION_MIN[1]:\n raise argparse.ArgumentTypeError(\n \"Python 3.{0} is not supported (must be {1}.{2} or higher)\".format(minor,\n *defaults.PYTHON3_VERSION_MIN))\n else:\n raise argparse.ArgumentTypeError(\n \"Python major version '{}' out of range (must be 2 or 3)\".format(major))\n return major, minor", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/config_parser.py_expand_path_split_and_match_files.return.expanded_paths": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/config_parser.py_expand_path_split_and_match_files.return.expanded_paths", "embedding": null, "metadata": {"file_path": "mypy/config_parser.py", "file_name": "config_parser.py", "file_type": "text/x-python", "category": "implementation", "start_line": 37, "end_line": 63, "span_ids": ["split_and_match_files", "expand_path"], "tokens": 175}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def expand_path(path: str) -> str:\n \"\"\"Expand the user home directory and any environment variables contained within\n the provided path.\n \"\"\"\n\n return os.path.expandvars(os.path.expanduser(path))\n\n\ndef split_and_match_files(paths: str) -> List[str]:\n \"\"\"Take a string representing a list of files/directories (with support for globbing\n through the glob library).\n\n Where a path/glob matches no file, we still include the raw path in the resulting list.\n\n Returns a list of file paths\n \"\"\"\n expanded_paths = []\n\n for path in paths.split(','):\n path = expand_path(path.strip())\n globbed_files = fileglob.glob(path, recursive=True)\n if globbed_files:\n expanded_paths.extend(globbed_files)\n else:\n expanded_paths.append(path)\n\n return expanded_paths", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/config_parser.py_check_follow_imports_config_types._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/config_parser.py_check_follow_imports_config_types._", "embedding": null, "metadata": {"file_path": "mypy/config_parser.py", "file_name": "config_parser.py", "file_type": "text/x-python", "category": "implementation", "start_line": 66, "end_line": 103, "span_ids": ["check_follow_imports", "impl"], "tokens": 404}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def check_follow_imports(choice: str) -> str:\n choices = ['normal', 'silent', 'skip', 'error']\n if choice not in choices:\n raise argparse.ArgumentTypeError(\n \"invalid choice '{}' (choose from {})\".format(\n choice,\n ', '.join(\"'{}'\".format(x) for x in choices)))\n return choice\n\n\n# For most options, the type of the default value set in options.py is\n# sufficient, and we don't have to do anything here. This table\n# exists to specify types for values initialized to None or container\n# types.\nconfig_types = {\n 'python_version': parse_version,\n 'strict_optional_whitelist': lambda s: s.split(),\n 'custom_typing_module': str,\n 'custom_typeshed_dir': expand_path,\n 'mypy_path': lambda s: [expand_path(p.strip()) for p in re.split('[,:]', s)],\n 'files': split_and_match_files,\n 'quickstart_file': expand_path,\n 'junit_xml': expand_path,\n # These two are for backwards compatibility\n 'silent_imports': bool,\n 'almost_silent': bool,\n 'follow_imports': check_follow_imports,\n 'no_site_packages': bool,\n 'plugins': lambda s: [p.strip() for p in s.split(',')],\n 'always_true': lambda s: [p.strip() for p in s.split(',')],\n 'always_false': lambda s: [p.strip() for p in s.split(',')],\n 'disable_error_code': lambda s: [p.strip() for p in s.split(',')],\n 'enable_error_code': lambda s: [p.strip() for p in s.split(',')],\n 'package_root': lambda s: [p.strip() for p in s.split(',')],\n 'cache_dir': expand_path,\n 'python_executable': expand_path,\n 'strict': bool,\n}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/config_parser.py__type_Final_parse_config_file.for_name_section_in_pars.if_name_startswith_mypy_.for_glob_in_globs_split_.if_any_c_in_glob_for_c_i.else_.options_per_module_option": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/config_parser.py__type_Final_parse_config_file.for_name_section_in_pars.if_name_startswith_mypy_.for_glob_in_globs_split_.if_any_c_in_glob_for_c_i.else_.options_per_module_option", "embedding": null, "metadata": {"file_path": "mypy/config_parser.py", "file_name": "config_parser.py", "file_type": "text/x-python", "category": "implementation", "start_line": 103, "end_line": 184, "span_ids": ["parse_config_file", "impl"], "tokens": 726}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": " # type: Final\n\n\ndef parse_config_file(options: Options, set_strict_flags: Callable[[], None],\n filename: Optional[str],\n stdout: Optional[TextIO] = None,\n stderr: Optional[TextIO] = None) -> None:\n \"\"\"Parse a config file into an Options object.\n\n Errors are written to stderr but are not fatal.\n\n If filename is None, fall back to default config files.\n \"\"\"\n stdout = stdout or sys.stdout\n stderr = stderr or sys.stderr\n\n if filename is not None:\n config_files = (filename,) # type: Tuple[str, ...]\n else:\n config_files = tuple(map(os.path.expanduser, defaults.CONFIG_FILES))\n\n parser = configparser.RawConfigParser()\n\n for config_file in config_files:\n if not os.path.exists(config_file):\n continue\n try:\n parser.read(config_file)\n except configparser.Error as err:\n print(\"%s: %s\" % (config_file, err), file=stderr)\n else:\n if config_file in defaults.SHARED_CONFIG_FILES and 'mypy' not in parser:\n continue\n file_read = config_file\n options.config_file = file_read\n break\n else:\n return\n\n os.environ['MYPY_CONFIG_FILE_DIR'] = os.path.dirname(\n os.path.abspath(config_file))\n\n if 'mypy' not in parser:\n if filename or file_read not in defaults.SHARED_CONFIG_FILES:\n print(\"%s: No [mypy] section in config file\" % file_read, file=stderr)\n else:\n section = parser['mypy']\n prefix = '%s: [%s]: ' % (file_read, 'mypy')\n updates, report_dirs = parse_section(prefix, options, set_strict_flags, section, stderr)\n for k, v in updates.items():\n setattr(options, k, v)\n options.report_dirs.update(report_dirs)\n\n for name, section in parser.items():\n if name.startswith('mypy-'):\n prefix = '%s: [%s]: ' % (file_read, name)\n updates, report_dirs = parse_section(\n prefix, options, set_strict_flags, section, stderr)\n if report_dirs:\n print(\"%sPer-module sections should not specify reports (%s)\" %\n (prefix, ', '.join(s + '_report' for s in sorted(report_dirs))),\n file=stderr)\n if set(updates) - PER_MODULE_OPTIONS:\n print(\"%sPer-module sections should only specify per-module flags (%s)\" %\n (prefix, ', '.join(sorted(set(updates) - PER_MODULE_OPTIONS))),\n file=stderr)\n updates = {k: v for k, v in updates.items() if k in PER_MODULE_OPTIONS}\n globs = name[5:]\n for glob in globs.split(','):\n # For backwards compatibility, replace (back)slashes with dots.\n glob = glob.replace(os.sep, '.')\n if os.altsep:\n glob = glob.replace(os.altsep, '.')\n\n if (any(c in glob for c in '?[]!') or\n any('*' in x and x != '*' for x in glob.split('.'))):\n print(\"%sPatterns must be fully-qualified module names, optionally \"\n \"with '*' in some components (e.g spam.*.eggs.*)\"\n % prefix,\n file=stderr)\n else:\n options.per_module_options[glob] = updates", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/config_parser.py_parse_section_parse_section.return.results_report_dirs": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/config_parser.py_parse_section_parse_section.return.results_report_dirs", "embedding": null, "metadata": {"file_path": "mypy/config_parser.py", "file_name": "config_parser.py", "file_type": "text/x-python", "category": "implementation", "start_line": 187, "end_line": 281, "span_ids": ["parse_section"], "tokens": 853}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def parse_section(prefix: str, template: Options,\n set_strict_flags: Callable[[], None],\n section: Mapping[str, str],\n stderr: TextIO = sys.stderr\n ) -> Tuple[Dict[str, object], Dict[str, str]]:\n \"\"\"Parse one section of a config file.\n\n Returns a dict of option values encountered, and a dict of report directories.\n \"\"\"\n results = {} # type: Dict[str, object]\n report_dirs = {} # type: Dict[str, str]\n for key in section:\n invert = False\n options_key = key\n if key in config_types:\n ct = config_types[key]\n else:\n dv = None\n # We have to keep new_semantic_analyzer in Options\n # for plugin compatibility but it is not a valid option anymore.\n assert hasattr(template, 'new_semantic_analyzer')\n if key != 'new_semantic_analyzer':\n dv = getattr(template, key, None)\n if dv is None:\n if key.endswith('_report'):\n report_type = key[:-7].replace('_', '-')\n if report_type in defaults.REPORTER_NAMES:\n report_dirs[report_type] = section[key]\n else:\n print(\"%sUnrecognized report type: %s\" % (prefix, key),\n file=stderr)\n continue\n if key.startswith('x_'):\n pass # Don't complain about `x_blah` flags\n elif key.startswith('no_') and hasattr(template, key[3:]):\n options_key = key[3:]\n invert = True\n elif key.startswith('allow') and hasattr(template, 'dis' + key):\n options_key = 'dis' + key\n invert = True\n elif key.startswith('disallow') and hasattr(template, key[3:]):\n options_key = key[3:]\n invert = True\n elif key == 'strict':\n pass # Special handling below\n else:\n print(\"%sUnrecognized option: %s = %s\" % (prefix, key, section[key]),\n file=stderr)\n if invert:\n dv = getattr(template, options_key, None)\n else:\n continue\n ct = type(dv)\n v = None # type: Any\n try:\n if ct is bool:\n v = section.getboolean(key) # type: ignore[attr-defined] # Until better stub\n if invert:\n v = not v\n elif callable(ct):\n if invert:\n print(\"%sCan not invert non-boolean key %s\" % (prefix, options_key),\n file=stderr)\n continue\n try:\n v = ct(section.get(key))\n except argparse.ArgumentTypeError as err:\n print(\"%s%s: %s\" % (prefix, key, err), file=stderr)\n continue\n else:\n print(\"%sDon't know what type %s should have\" % (prefix, key), file=stderr)\n continue\n except ValueError as err:\n print(\"%s%s: %s\" % (prefix, key, err), file=stderr)\n continue\n if key == 'strict':\n if v:\n set_strict_flags()\n continue\n if key == 'silent_imports':\n print(\"%ssilent_imports has been replaced by \"\n \"ignore_missing_imports=True; follow_imports=skip\" % prefix, file=stderr)\n if v:\n if 'ignore_missing_imports' not in results:\n results['ignore_missing_imports'] = True\n if 'follow_imports' not in results:\n results['follow_imports'] = 'skip'\n if key == 'almost_silent':\n print(\"%salmost_silent has been replaced by \"\n \"follow_imports=error\" % prefix, file=stderr)\n if v:\n if 'follow_imports' not in results:\n results['follow_imports'] = 'error'\n results[options_key] = v\n return results, report_dirs", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/config_parser.py_split_directive_split_directive.return.parts_errors": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/config_parser.py_split_directive_split_directive.return.parts_errors", "embedding": null, "metadata": {"file_path": "mypy/config_parser.py", "file_name": "config_parser.py", "file_type": "text/x-python", "category": "implementation", "start_line": 284, "end_line": 310, "span_ids": ["split_directive"], "tokens": 190}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def split_directive(s: str) -> Tuple[List[str], List[str]]:\n \"\"\"Split s on commas, except during quoted sections.\n\n Returns the parts and a list of error messages.\"\"\"\n parts = []\n cur = [] # type: List[str]\n errors = []\n i = 0\n while i < len(s):\n if s[i] == ',':\n parts.append(''.join(cur).strip())\n cur = []\n elif s[i] == '\"':\n i += 1\n while i < len(s) and s[i] != '\"':\n cur.append(s[i])\n i += 1\n if i == len(s):\n errors.append(\"Unterminated quote in configuration comment\")\n cur.clear()\n else:\n cur.append(s[i])\n i += 1\n if cur:\n parts.append(''.join(cur).strip())\n\n return parts, errors", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/config_parser.py_mypy_comments_to_config_map_mypy_comments_to_config_map.return.options_errors": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/config_parser.py_mypy_comments_to_config_map_mypy_comments_to_config_map.return.options_errors", "embedding": null, "metadata": {"file_path": "mypy/config_parser.py", "file_name": "config_parser.py", "file_type": "text/x-python", "category": "implementation", "start_line": 313, "end_line": 333, "span_ids": ["mypy_comments_to_config_map"], "tokens": 137}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def mypy_comments_to_config_map(line: str,\n template: Options) -> Tuple[Dict[str, str], List[str]]:\n \"\"\"Rewrite the mypy comment syntax into ini file syntax.\n\n Returns\n \"\"\"\n options = {}\n entries, errors = split_directive(line)\n for entry in entries:\n if '=' not in entry:\n name = entry\n value = None\n else:\n name, value = [x.strip() for x in entry.split('=', 1)]\n\n name = name.replace('-', '_')\n if value is None:\n value = 'True'\n options[name] = value\n\n return options, errors", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/config_parser.py_parse_mypy_comments_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/config_parser.py_parse_mypy_comments_", "embedding": null, "metadata": {"file_path": "mypy/config_parser.py", "file_name": "config_parser.py", "file_type": "text/x-python", "category": "implementation", "start_line": 336, "end_line": 378, "span_ids": ["parse_mypy_comments"], "tokens": 361}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def parse_mypy_comments(\n args: List[Tuple[int, str]],\n template: Options) -> Tuple[Dict[str, object], List[Tuple[int, str]]]:\n \"\"\"Parse a collection of inline mypy: configuration comments.\n\n Returns a dictionary of options to be applied and a list of error messages\n generated.\n \"\"\"\n\n errors = [] # type: List[Tuple[int, str]]\n sections = {}\n\n for lineno, line in args:\n # In order to easily match the behavior for bools, we abuse configparser.\n # Oddly, the only way to get the SectionProxy object with the getboolean\n # method is to create a config parser.\n parser = configparser.RawConfigParser()\n options, parse_errors = mypy_comments_to_config_map(line, template)\n parser['dummy'] = options\n errors.extend((lineno, x) for x in parse_errors)\n\n stderr = StringIO()\n strict_found = False\n\n def set_strict_flags() -> None:\n nonlocal strict_found\n strict_found = True\n\n new_sections, reports = parse_section(\n '', template, set_strict_flags, parser['dummy'], stderr=stderr)\n errors.extend((lineno, x) for x in stderr.getvalue().strip().split('\\n') if x)\n if reports:\n errors.append((lineno, \"Reports not supported in inline configuration\"))\n if strict_found:\n errors.append((lineno,\n \"Setting 'strict' not supported in inline configuration: specify it in \"\n \"a configuration file instead, or set individual inline flags \"\n \"(see 'mypy -h' for the list of flags enabled in strict mode)\"))\n\n sections.update(new_sections)\n\n return sections, errors", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py__Type_inference_constra_SUPERTYPE_OF.1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py__Type_inference_constra_SUPERTYPE_OF.1", "embedding": null, "metadata": {"file_path": "mypy/constraints.py", "file_name": "constraints.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 22, "span_ids": ["docstring"], "tokens": 212}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Type inference constraints.\"\"\"\n\nfrom typing import Iterable, List, Optional, Sequence\nfrom typing_extensions import Final\n\nfrom mypy.types import (\n CallableType, Type, TypeVisitor, UnboundType, AnyType, NoneType, TypeVarType, Instance,\n TupleType, TypedDictType, UnionType, Overloaded, ErasedType, PartialType, DeletedType,\n UninhabitedType, TypeType, TypeVarId, TypeQuery, is_named_instance, TypeOfAny, LiteralType,\n ProperType, get_proper_type, TypeAliasType\n)\nfrom mypy.maptype import map_instance_to_supertype\nimport mypy.subtypes\nimport mypy.sametypes\nimport mypy.typeops\nfrom mypy.erasetype import erase_typevars\nfrom mypy.nodes import COVARIANT, CONTRAVARIANT\nfrom mypy.argmap import ArgTypeExpander\nfrom mypy.typestate import TypeState\n\nSUBTYPE_OF = 0 # type: Final\nSUPERTYPE_OF = 1", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_None_2_Constraint.__repr__.return._format_self_ty": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_None_2_Constraint.__repr__.return._format_self_ty", "embedding": null, "metadata": {"file_path": "mypy/constraints.py", "file_name": "constraints.py", "file_type": "text/x-python", "category": "implementation", "start_line": 22, "end_line": 44, "span_ids": ["Constraint.__repr__", "Constraint.__init__", "Constraint", "docstring"], "tokens": 172}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": " # type: Final\n\n\nclass Constraint:\n \"\"\"A representation of a type constraint.\n\n It can be either T <: type or T :> type (T is a type variable).\n \"\"\"\n\n type_var = None # type: TypeVarId\n op = 0 # SUBTYPE_OF or SUPERTYPE_OF\n target = None # type: Type\n\n def __init__(self, type_var: TypeVarId, op: int, target: Type) -> None:\n self.type_var = type_var\n self.op = op\n self.target = target\n\n def __repr__(self) -> str:\n op_str = '<:'\n if self.op == SUPERTYPE_OF:\n op_str = ':>'\n return '{} {} {}'.format(self.type_var, op_str, self.target)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_infer_constraints_for_callable_infer_constraints_for_callable.return.constraints": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_infer_constraints_for_callable_infer_constraints_for_callable.return.constraints", "embedding": null, "metadata": {"file_path": "mypy/constraints.py", "file_name": "constraints.py", "file_type": "text/x-python", "category": "implementation", "start_line": 47, "end_line": 68, "span_ids": ["infer_constraints_for_callable"], "tokens": 183}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def infer_constraints_for_callable(\n callee: CallableType, arg_types: Sequence[Optional[Type]], arg_kinds: List[int],\n formal_to_actual: List[List[int]]) -> List[Constraint]:\n \"\"\"Infer type variable constraints for a callable and actual arguments.\n\n Return a list of constraints.\n \"\"\"\n constraints = [] # type: List[Constraint]\n mapper = ArgTypeExpander()\n\n for i, actuals in enumerate(formal_to_actual):\n for actual in actuals:\n actual_arg_type = arg_types[actual]\n if actual_arg_type is None:\n continue\n\n actual_type = mapper.expand_actual_type(actual_arg_type, arg_kinds[actual],\n callee.arg_names[i], callee.arg_kinds[i])\n c = infer_constraints(callee.arg_types[i], actual_type, SUPERTYPE_OF)\n constraints.extend(c)\n\n return constraints", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_infer_constraints_infer_constraints.return._infer_constraints_templa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_infer_constraints_infer_constraints.return._infer_constraints_templa", "embedding": null, "metadata": {"file_path": "mypy/constraints.py", "file_name": "constraints.py", "file_type": "text/x-python", "category": "implementation", "start_line": 71, "end_line": 101, "span_ids": ["infer_constraints"], "tokens": 355}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def infer_constraints(template: Type, actual: Type,\n direction: int) -> List[Constraint]:\n \"\"\"Infer type constraints.\n\n Match a template type, which may contain type variable references,\n recursively against a type which does not contain (the same) type\n variable references. The result is a list of type constrains of\n form 'T is a supertype/subtype of x', where T is a type variable\n present in the template and x is a type without reference to type\n variables present in the template.\n\n Assume T and S are type variables. Now the following results can be\n calculated (read as '(template, actual) --> result'):\n\n (T, X) --> T :> X\n (X[T], X[Y]) --> T <: Y and T :> Y\n ((T, T), (X, Y)) --> T :> X and T :> Y\n ((T, S), (X, Y)) --> T :> X and S :> Y\n (X[T], Any) --> T <: Any and T :> Any\n\n The constraints are represented as Constraint objects.\n \"\"\"\n if any(get_proper_type(template) == get_proper_type(t) for t in TypeState._inferring):\n return []\n if isinstance(template, TypeAliasType) and template.is_recursive:\n # This case requires special care because it may cause infinite recursion.\n TypeState._inferring.append(template)\n res = _infer_constraints(template, actual, direction)\n TypeState._inferring.pop()\n return res\n return _infer_constraints(template, actual, direction)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py__infer_constraints__infer_constraints.return.template_accept_Constrain": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py__infer_constraints__infer_constraints.return.template_accept_Constrain", "embedding": null, "metadata": {"file_path": "mypy/constraints.py", "file_name": "constraints.py", "file_type": "text/x-python", "category": "implementation", "start_line": 104, "end_line": 174, "span_ids": ["_infer_constraints"], "tokens": 810}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _infer_constraints(template: Type, actual: Type,\n direction: int) -> List[Constraint]:\n\n orig_template = template\n template = get_proper_type(template)\n actual = get_proper_type(actual)\n\n # Type inference shouldn't be affected by whether union types have been simplified.\n # We however keep any ErasedType items, so that the caller will see it when using\n # checkexpr.has_erased_component().\n if isinstance(template, UnionType):\n template = mypy.typeops.make_simplified_union(template.items, keep_erased=True)\n if isinstance(actual, UnionType):\n actual = mypy.typeops.make_simplified_union(actual.items, keep_erased=True)\n\n # Ignore Any types from the type suggestion engine to avoid them\n # causing us to infer Any in situations where a better job could\n # be done otherwise. (This can produce false positives but that\n # doesn't really matter because it is all heuristic anyway.)\n if isinstance(actual, AnyType) and actual.type_of_any == TypeOfAny.suggestion_engine:\n return []\n\n # If the template is simply a type variable, emit a Constraint directly.\n # We need to handle this case before handling Unions for two reasons:\n # 1. \"T <: Union[U1, U2]\" is not equivalent to \"T <: U1 or T <: U2\",\n # because T can itself be a union (notably, Union[U1, U2] itself).\n # 2. \"T :> Union[U1, U2]\" is logically equivalent to \"T :> U1 and\n # T :> U2\", but they are not equivalent to the constraint solver,\n # which never introduces new Union types (it uses join() instead).\n if isinstance(template, TypeVarType):\n return [Constraint(template.id, direction, actual)]\n\n # Now handle the case of either template or actual being a Union.\n # For a Union to be a subtype of another type, every item of the Union\n # must be a subtype of that type, so concatenate the constraints.\n if direction == SUBTYPE_OF and isinstance(template, UnionType):\n res = []\n for t_item in template.items:\n res.extend(infer_constraints(t_item, actual, direction))\n return res\n if direction == SUPERTYPE_OF and isinstance(actual, UnionType):\n res = []\n for a_item in actual.items:\n res.extend(infer_constraints(orig_template, a_item, direction))\n return res\n\n # Now the potential subtype is known not to be a Union or a type\n # variable that we are solving for. In that case, for a Union to\n # be a supertype of the potential subtype, some item of the Union\n # must be a supertype of it.\n if direction == SUBTYPE_OF and isinstance(actual, UnionType):\n # If some of items is not a complete type, disregard that.\n items = simplify_away_incomplete_types(actual.items)\n # We infer constraints eagerly -- try to find constraints for a type\n # variable if possible. This seems to help with some real-world\n # use cases.\n return any_constraints(\n [infer_constraints_if_possible(template, a_item, direction)\n for a_item in items],\n eager=True)\n if direction == SUPERTYPE_OF and isinstance(template, UnionType):\n # When the template is a union, we are okay with leaving some\n # type variables indeterminate. This helps with some special\n # cases, though this isn't very principled.\n return any_constraints(\n [infer_constraints_if_possible(t_item, actual, direction)\n for t_item in template.items],\n eager=False)\n\n # Remaining cases are handled by ConstraintBuilderVisitor.\n return template.accept(ConstraintBuilderVisitor(actual, direction))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_infer_constraints_if_possible_infer_constraints_if_possible.return.infer_constraints_templat": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_infer_constraints_if_possible_infer_constraints_if_possible.return.infer_constraints_templat", "embedding": null, "metadata": {"file_path": "mypy/constraints.py", "file_name": "constraints.py", "file_type": "text/x-python", "category": "implementation", "start_line": 177, "end_line": 195, "span_ids": ["infer_constraints_if_possible"], "tokens": 235}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def infer_constraints_if_possible(template: Type, actual: Type,\n direction: int) -> Optional[List[Constraint]]:\n \"\"\"Like infer_constraints, but return None if the input relation is\n known to be unsatisfiable, for example if template=List[T] and actual=int.\n (In this case infer_constraints would return [], just like it would for\n an automatically satisfied relation like template=List[T] and actual=object.)\n \"\"\"\n if (direction == SUBTYPE_OF and\n not mypy.subtypes.is_subtype(erase_typevars(template), actual)):\n return None\n if (direction == SUPERTYPE_OF and\n not mypy.subtypes.is_subtype(actual, erase_typevars(template))):\n return None\n if (direction == SUPERTYPE_OF and isinstance(template, TypeVarType) and\n not mypy.subtypes.is_subtype(actual, erase_typevars(template.upper_bound))):\n # This is not caught by the above branch because of the erase_typevars() call,\n # that would return 'Any' for a type variable.\n return None\n return infer_constraints(template, actual, direction)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_any_constraints_any_constraints.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_any_constraints_any_constraints.return._", "embedding": null, "metadata": {"file_path": "mypy/constraints.py", "file_name": "constraints.py", "file_type": "text/x-python", "category": "implementation", "start_line": 198, "end_line": 222, "span_ids": ["any_constraints"], "tokens": 273}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def any_constraints(options: List[Optional[List[Constraint]]], eager: bool) -> List[Constraint]:\n \"\"\"Deduce what we can from a collection of constraint lists.\n\n It's a given that at least one of the lists must be satisfied. A\n None element in the list of options represents an unsatisfiable\n constraint and is ignored. Ignore empty constraint lists if eager\n is true -- they are always trivially satisfiable.\n \"\"\"\n if eager:\n valid_options = [option for option in options if option]\n else:\n valid_options = [option for option in options if option is not None]\n if len(valid_options) == 1:\n return valid_options[0]\n elif (len(valid_options) > 1 and\n all(is_same_constraints(valid_options[0], c)\n for c in valid_options[1:])):\n # Multiple sets of constraints that are all the same. Just pick any one of them.\n # TODO: More generally, if a given (variable, direction) pair appears in\n # every option, combine the bounds with meet/join.\n return valid_options[0]\n\n # Otherwise, there are either no valid options or multiple, inconsistent valid\n # options. Give up and deduce nothing.\n return []", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_is_same_constraints_CompleteTypeVisitor.visit_uninhabited_type.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_is_same_constraints_CompleteTypeVisitor.visit_uninhabited_type.return.False", "embedding": null, "metadata": {"file_path": "mypy/constraints.py", "file_name": "constraints.py", "file_type": "text/x-python", "category": "implementation", "start_line": 225, "end_line": 263, "span_ids": ["CompleteTypeVisitor", "is_complete_type", "CompleteTypeVisitor.__init__", "is_same_constraints", "simplify_away_incomplete_types", "CompleteTypeVisitor.visit_uninhabited_type", "is_same_constraint"], "tokens": 293}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_same_constraints(x: List[Constraint], y: List[Constraint]) -> bool:\n for c1 in x:\n if not any(is_same_constraint(c1, c2) for c2 in y):\n return False\n for c1 in y:\n if not any(is_same_constraint(c1, c2) for c2 in x):\n return False\n return True\n\n\ndef is_same_constraint(c1: Constraint, c2: Constraint) -> bool:\n return (c1.type_var == c2.type_var\n and c1.op == c2.op\n and mypy.sametypes.is_same_type(c1.target, c2.target))\n\n\ndef simplify_away_incomplete_types(types: Iterable[Type]) -> List[Type]:\n complete = [typ for typ in types if is_complete_type(typ)]\n if complete:\n return complete\n else:\n return list(types)\n\n\ndef is_complete_type(typ: Type) -> bool:\n \"\"\"Is a type complete?\n\n A complete doesn't have uninhabited type components or (when not in strict\n optional mode) None components.\n \"\"\"\n return typ.accept(CompleteTypeVisitor())\n\n\nclass CompleteTypeVisitor(TypeQuery[bool]):\n def __init__(self) -> None:\n super().__init__(all)\n\n def visit_uninhabited_type(self, t: UninhabitedType) -> bool:\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_ConstraintBuilderVisitor_ConstraintBuilderVisitor._Non_leaf_types": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_ConstraintBuilderVisitor_ConstraintBuilderVisitor._Non_leaf_types", "embedding": null, "metadata": {"file_path": "mypy/constraints.py", "file_name": "constraints.py", "file_type": "text/x-python", "category": "implementation", "start_line": 266, "end_line": 313, "span_ids": ["ConstraintBuilderVisitor.visit_type_var", "ConstraintBuilderVisitor", "ConstraintBuilderVisitor.__init__", "ConstraintBuilderVisitor.visit_erased_type", "ConstraintBuilderVisitor.visit_partial_type", "ConstraintBuilderVisitor.visit_deleted_type", "ConstraintBuilderVisitor.visit_unbound_type", "ConstraintBuilderVisitor.visit_any", "ConstraintBuilderVisitor.visit_uninhabited_type", "ConstraintBuilderVisitor.visit_literal_type", "ConstraintBuilderVisitor.visit_none_type"], "tokens": 359}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ConstraintBuilderVisitor(TypeVisitor[List[Constraint]]):\n \"\"\"Visitor class for inferring type constraints.\"\"\"\n\n # The type that is compared against a template\n # TODO: The value may be None. Is that actually correct?\n actual = None # type: ProperType\n\n def __init__(self, actual: ProperType, direction: int) -> None:\n # Direction must be SUBTYPE_OF or SUPERTYPE_OF.\n self.actual = actual\n self.direction = direction\n\n # Trivial leaf types\n\n def visit_unbound_type(self, template: UnboundType) -> List[Constraint]:\n return []\n\n def visit_any(self, template: AnyType) -> List[Constraint]:\n return []\n\n def visit_none_type(self, template: NoneType) -> List[Constraint]:\n return []\n\n def visit_uninhabited_type(self, template: UninhabitedType) -> List[Constraint]:\n return []\n\n def visit_erased_type(self, template: ErasedType) -> List[Constraint]:\n return []\n\n def visit_deleted_type(self, template: DeletedType) -> List[Constraint]:\n return []\n\n def visit_literal_type(self, template: LiteralType) -> List[Constraint]:\n return []\n\n # Errors\n\n def visit_partial_type(self, template: PartialType) -> List[Constraint]:\n # We can't do anything useful with a partial type here.\n assert False, \"Internal error\"\n\n # Non-trivial leaf type\n\n def visit_type_var(self, template: TypeVarType) -> List[Constraint]:\n assert False, (\"Unexpected TypeVarType in ConstraintBuilderVisitor\"\n \" (should have been handled in infer_constraints)\")\n\n # Non-leaf types", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_ConstraintBuilderVisitor.visit_instance_ConstraintBuilderVisitor.visit_instance.if_isinstance_actual_Lit.actual.actual_fallback": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_ConstraintBuilderVisitor.visit_instance_ConstraintBuilderVisitor.visit_instance.if_isinstance_actual_Lit.actual.actual_fallback", "embedding": null, "metadata": {"file_path": "mypy/constraints.py", "file_name": "constraints.py", "file_type": "text/x-python", "category": "implementation", "start_line": 315, "end_line": 339, "span_ids": ["ConstraintBuilderVisitor.visit_instance"], "tokens": 277}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ConstraintBuilderVisitor(TypeVisitor[List[Constraint]]):\n\n def visit_instance(self, template: Instance) -> List[Constraint]:\n original_actual = actual = self.actual\n res = [] # type: List[Constraint]\n if isinstance(actual, (CallableType, Overloaded)) and template.type.is_protocol:\n if template.type.protocol_members == ['__call__']:\n # Special case: a generic callback protocol\n if not any(mypy.sametypes.is_same_type(template, t)\n for t in template.type.inferring):\n template.type.inferring.append(template)\n call = mypy.subtypes.find_member('__call__', template, actual,\n is_operator=True)\n assert call is not None\n if mypy.subtypes.is_subtype(actual, erase_typevars(call)):\n subres = infer_constraints(call, actual, self.direction)\n res.extend(subres)\n template.type.inferring.pop()\n return res\n if isinstance(actual, CallableType) and actual.fallback is not None:\n actual = actual.fallback\n if isinstance(actual, Overloaded) and actual.fallback is not None:\n actual = actual.fallback\n if isinstance(actual, TypedDictType):\n actual = actual.as_anonymous().fallback\n if isinstance(actual, LiteralType):\n actual = actual.fallback\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_ConstraintBuilderVisitor.visit_instance.if_isinstance_actual_Ins_ConstraintBuilderVisitor.visit_instance.if_isinstance_actual_Any.return.self_infer_against_any_te": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_ConstraintBuilderVisitor.visit_instance.if_isinstance_actual_Ins_ConstraintBuilderVisitor.visit_instance.if_isinstance_actual_Any.return.self_infer_against_any_te", "embedding": null, "metadata": {"file_path": "mypy/constraints.py", "file_name": "constraints.py", "file_type": "text/x-python", "category": "implementation", "start_line": 340, "end_line": 407, "span_ids": ["ConstraintBuilderVisitor.visit_instance"], "tokens": 792}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ConstraintBuilderVisitor(TypeVisitor[List[Constraint]]):\n\n def visit_instance(self, template: Instance) -> List[Constraint]:\n # ... other code\n if isinstance(actual, Instance):\n instance = actual\n erased = erase_typevars(template)\n assert isinstance(erased, Instance) # type: ignore\n # We always try nominal inference if possible,\n # it is much faster than the structural one.\n if (self.direction == SUBTYPE_OF and\n template.type.has_base(instance.type.fullname)):\n mapped = map_instance_to_supertype(template, instance.type)\n tvars = mapped.type.defn.type_vars\n # N.B: We use zip instead of indexing because the lengths might have\n # mismatches during daemon reprocessing.\n for tvar, mapped_arg, instance_arg in zip(tvars, mapped.args, instance.args):\n # The constraints for generic type parameters depend on variance.\n # Include constraints from both directions if invariant.\n if tvar.variance != CONTRAVARIANT:\n res.extend(infer_constraints(\n mapped_arg, instance_arg, self.direction))\n if tvar.variance != COVARIANT:\n res.extend(infer_constraints(\n mapped_arg, instance_arg, neg_op(self.direction)))\n return res\n elif (self.direction == SUPERTYPE_OF and\n instance.type.has_base(template.type.fullname)):\n mapped = map_instance_to_supertype(instance, template.type)\n tvars = template.type.defn.type_vars\n # N.B: We use zip instead of indexing because the lengths might have\n # mismatches during daemon reprocessing.\n for tvar, mapped_arg, template_arg in zip(tvars, mapped.args, template.args):\n # The constraints for generic type parameters depend on variance.\n # Include constraints from both directions if invariant.\n if tvar.variance != CONTRAVARIANT:\n res.extend(infer_constraints(\n template_arg, mapped_arg, self.direction))\n if tvar.variance != COVARIANT:\n res.extend(infer_constraints(\n template_arg, mapped_arg, neg_op(self.direction)))\n return res\n if (template.type.is_protocol and self.direction == SUPERTYPE_OF and\n # We avoid infinite recursion for structural subtypes by checking\n # whether this type already appeared in the inference chain.\n # This is a conservative way break the inference cycles.\n # It never produces any \"false\" constraints but gives up soon\n # on purely structural inference cycles, see #3829.\n # Note that we use is_protocol_implementation instead of is_subtype\n # because some type may be considered a subtype of a protocol\n # due to _promote, but still not implement the protocol.\n not any(mypy.sametypes.is_same_type(template, t)\n for t in template.type.inferring) and\n mypy.subtypes.is_protocol_implementation(instance, erased)):\n template.type.inferring.append(template)\n self.infer_constraints_from_protocol_members(res, instance, template,\n original_actual, template)\n template.type.inferring.pop()\n return res\n elif (instance.type.is_protocol and self.direction == SUBTYPE_OF and\n # We avoid infinite recursion for structural subtypes also here.\n not any(mypy.sametypes.is_same_type(instance, i)\n for i in instance.type.inferring) and\n mypy.subtypes.is_protocol_implementation(erased, instance)):\n instance.type.inferring.append(instance)\n self.infer_constraints_from_protocol_members(res, instance, template,\n template, instance)\n instance.type.inferring.pop()\n return res\n if isinstance(actual, AnyType):\n # IDEA: Include both ways, i.e. add negation as well?\n return self.infer_against_any(template.args, actual)\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_ConstraintBuilderVisitor.visit_instance.if_isinstance_actual_Tu_ConstraintBuilderVisitor.visit_instance.if_isinstance_actual_Tu.else_.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_ConstraintBuilderVisitor.visit_instance.if_isinstance_actual_Tu_ConstraintBuilderVisitor.visit_instance.if_isinstance_actual_Tu.else_.return._", "embedding": null, "metadata": {"file_path": "mypy/constraints.py", "file_name": "constraints.py", "file_type": "text/x-python", "category": "implementation", "start_line": 408, "end_line": 423, "span_ids": ["ConstraintBuilderVisitor.visit_instance"], "tokens": 180}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ConstraintBuilderVisitor(TypeVisitor[List[Constraint]]):\n\n def visit_instance(self, template: Instance) -> List[Constraint]:\n # ... other code\n if (isinstance(actual, TupleType) and\n (is_named_instance(template, 'typing.Iterable') or\n is_named_instance(template, 'typing.Container') or\n is_named_instance(template, 'typing.Sequence') or\n is_named_instance(template, 'typing.Reversible'))\n and self.direction == SUPERTYPE_OF):\n for item in actual.items:\n cb = infer_constraints(template.args[0], item, SUPERTYPE_OF)\n res.extend(cb)\n return res\n elif isinstance(actual, TupleType) and self.direction == SUPERTYPE_OF:\n return infer_constraints(template,\n mypy.typeops.tuple_fallback(actual),\n self.direction)\n else:\n return []", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_ConstraintBuilderVisitor.infer_constraints_from_protocol_members_ConstraintBuilderVisitor.infer_constraints_from_protocol_members.for_member_in_protocol_ty.if_mypy_subtypes_IS_SETT.res_extend_infer_constrai": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_ConstraintBuilderVisitor.infer_constraints_from_protocol_members_ConstraintBuilderVisitor.infer_constraints_from_protocol_members.for_member_in_protocol_ty.if_mypy_subtypes_IS_SETT.res_extend_infer_constrai", "embedding": null, "metadata": {"file_path": "mypy/constraints.py", "file_name": "constraints.py", "file_type": "text/x-python", "category": "implementation", "start_line": 425, "end_line": 444, "span_ids": ["ConstraintBuilderVisitor.infer_constraints_from_protocol_members"], "tokens": 276}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ConstraintBuilderVisitor(TypeVisitor[List[Constraint]]):\n\n def infer_constraints_from_protocol_members(self, res: List[Constraint],\n instance: Instance, template: Instance,\n subtype: Type, protocol: Instance) -> None:\n \"\"\"Infer constraints for situations where either 'template' or 'instance' is a protocol.\n\n The 'protocol' is the one of two that is an instance of protocol type, 'subtype'\n is the type used to bind self during inference. Currently, we just infer constrains for\n every protocol member type (both ways for settable members).\n \"\"\"\n for member in protocol.type.protocol_members:\n inst = mypy.subtypes.find_member(member, instance, subtype)\n temp = mypy.subtypes.find_member(member, template, subtype)\n assert inst is not None and temp is not None\n # The above is safe since at this point we know that 'instance' is a subtype\n # of (erased) 'template', therefore it defines all protocol members\n res.extend(infer_constraints(temp, inst, self.direction))\n if (mypy.subtypes.IS_SETTABLE in\n mypy.subtypes.get_member_flags(member, protocol.type)):\n # Settable members are invariant, add opposite constraints\n res.extend(infer_constraints(temp, inst, neg_op(self.direction)))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_ConstraintBuilderVisitor.visit_callable_type_ConstraintBuilderVisitor.visit_callable_type.if_isinstance_self_actual.else_.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_ConstraintBuilderVisitor.visit_callable_type_ConstraintBuilderVisitor.visit_callable_type.if_isinstance_self_actual.else_.return._", "embedding": null, "metadata": {"file_path": "mypy/constraints.py", "file_name": "constraints.py", "file_type": "text/x-python", "category": "implementation", "start_line": 446, "end_line": 488, "span_ids": ["ConstraintBuilderVisitor.visit_callable_type"], "tokens": 453}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ConstraintBuilderVisitor(TypeVisitor[List[Constraint]]):\n\n def visit_callable_type(self, template: CallableType) -> List[Constraint]:\n if isinstance(self.actual, CallableType):\n cactual = self.actual\n # FIX verify argument counts\n # FIX what if one of the functions is generic\n res = [] # type: List[Constraint]\n\n # We can't infer constraints from arguments if the template is Callable[..., T] (with\n # literal '...').\n if not template.is_ellipsis_args:\n # The lengths should match, but don't crash (it will error elsewhere).\n for t, a in zip(template.arg_types, cactual.arg_types):\n # Negate direction due to function argument type contravariance.\n res.extend(infer_constraints(t, a, neg_op(self.direction)))\n template_ret_type, cactual_ret_type = template.ret_type, cactual.ret_type\n if template.type_guard is not None:\n template_ret_type = template.type_guard\n if cactual.type_guard is not None:\n cactual_ret_type = cactual.type_guard\n res.extend(infer_constraints(template_ret_type, cactual_ret_type,\n self.direction))\n return res\n elif isinstance(self.actual, AnyType):\n # FIX what if generic\n res = self.infer_against_any(template.arg_types, self.actual)\n any_type = AnyType(TypeOfAny.from_another_any, source_any=self.actual)\n res.extend(infer_constraints(template.ret_type, any_type, self.direction))\n return res\n elif isinstance(self.actual, Overloaded):\n return self.infer_against_overloaded(self.actual, template)\n elif isinstance(self.actual, TypeType):\n return infer_constraints(template.ret_type, self.actual.item, self.direction)\n elif isinstance(self.actual, Instance):\n # Instances with __call__ method defined are considered structural\n # subtypes of Callable with a compatible signature.\n call = mypy.subtypes.find_member('__call__', self.actual, self.actual,\n is_operator=True)\n if call:\n return infer_constraints(template, call, self.direction)\n else:\n return []\n else:\n return []", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_ConstraintBuilderVisitor.infer_against_overloaded_ConstraintBuilderVisitor.visit_tuple_type.if_isinstance_actual_Tup.else_.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_ConstraintBuilderVisitor.infer_against_overloaded_ConstraintBuilderVisitor.visit_tuple_type.if_isinstance_actual_Tup.else_.return._", "embedding": null, "metadata": {"file_path": "mypy/constraints.py", "file_name": "constraints.py", "file_type": "text/x-python", "category": "implementation", "start_line": 485, "end_line": 507, "span_ids": ["ConstraintBuilderVisitor.infer_against_overloaded", "ConstraintBuilderVisitor.visit_tuple_type"], "tokens": 237}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ConstraintBuilderVisitor(TypeVisitor[List[Constraint]]):\n\n def infer_against_overloaded(self, overloaded: Overloaded,\n template: CallableType) -> List[Constraint]:\n # Create constraints by matching an overloaded type against a template.\n # This is tricky to do in general. We cheat by only matching against\n # the first overload item that is callable compatible. This\n # seems to work somewhat well, but we should really use a more\n # reliable technique.\n item = find_matching_overload_item(overloaded, template)\n return infer_constraints(template, item, self.direction)\n\n def visit_tuple_type(self, template: TupleType) -> List[Constraint]:\n actual = self.actual\n if isinstance(actual, TupleType) and len(actual.items) == len(template.items):\n res = [] # type: List[Constraint]\n for i in range(len(template.items)):\n res.extend(infer_constraints(template.items[i],\n actual.items[i],\n self.direction))\n return res\n elif isinstance(actual, AnyType):\n return self.infer_against_any(template.items, actual)\n else:\n return []", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_ConstraintBuilderVisitor.visit_typeddict_type_ConstraintBuilderVisitor.visit_typeddict_type.if_isinstance_actual_Typ.else_.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_ConstraintBuilderVisitor.visit_typeddict_type_ConstraintBuilderVisitor.visit_typeddict_type.if_isinstance_actual_Typ.else_.return._", "embedding": null, "metadata": {"file_path": "mypy/constraints.py", "file_name": "constraints.py", "file_type": "text/x-python", "category": "implementation", "start_line": 509, "end_line": 523, "span_ids": ["ConstraintBuilderVisitor.visit_typeddict_type"], "tokens": 154}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ConstraintBuilderVisitor(TypeVisitor[List[Constraint]]):\n\n def visit_typeddict_type(self, template: TypedDictType) -> List[Constraint]:\n actual = self.actual\n if isinstance(actual, TypedDictType):\n res = [] # type: List[Constraint]\n # NOTE: Non-matching keys are ignored. Compatibility is checked\n # elsewhere so this shouldn't be unsafe.\n for (item_name, template_item_type, actual_item_type) in template.zip(actual):\n res.extend(infer_constraints(template_item_type,\n actual_item_type,\n self.direction))\n return res\n elif isinstance(actual, AnyType):\n return self.infer_against_any(template.items.values(), actual)\n else:\n return []", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_ConstraintBuilderVisitor.visit_union_type_ConstraintBuilderVisitor.visit_overloaded.return.res": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_ConstraintBuilderVisitor.visit_union_type_ConstraintBuilderVisitor.visit_overloaded.return.res", "embedding": null, "metadata": {"file_path": "mypy/constraints.py", "file_name": "constraints.py", "file_type": "text/x-python", "category": "implementation", "start_line": 525, "end_line": 542, "span_ids": ["ConstraintBuilderVisitor.visit_overloaded", "ConstraintBuilderVisitor.visit_type_alias_type", "ConstraintBuilderVisitor.visit_union_type", "ConstraintBuilderVisitor.infer_against_any"], "tokens": 201}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ConstraintBuilderVisitor(TypeVisitor[List[Constraint]]):\n\n def visit_union_type(self, template: UnionType) -> List[Constraint]:\n assert False, (\"Unexpected UnionType in ConstraintBuilderVisitor\"\n \" (should have been handled in infer_constraints)\")\n\n def visit_type_alias_type(self, template: TypeAliasType) -> List[Constraint]:\n assert False, \"This should be never called, got {}\".format(template)\n\n def infer_against_any(self, types: Iterable[Type], any_type: AnyType) -> List[Constraint]:\n res = [] # type: List[Constraint]\n for t in types:\n res.extend(infer_constraints(t, any_type, self.direction))\n return res\n\n def visit_overloaded(self, template: Overloaded) -> List[Constraint]:\n res = [] # type: List[Constraint]\n for t in template.items():\n res.extend(infer_constraints(t, self.actual, self.direction))\n return res", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_ConstraintBuilderVisitor.visit_type_type_neg_op.if_op_SUBTYPE_OF_.else_.raise_ValueError_Invalid": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_ConstraintBuilderVisitor.visit_type_type_neg_op.if_op_SUBTYPE_OF_.else_.raise_ValueError_Invalid", "embedding": null, "metadata": {"file_path": "mypy/constraints.py", "file_name": "constraints.py", "file_type": "text/x-python", "category": "implementation", "start_line": 544, "end_line": 566, "span_ids": ["neg_op", "ConstraintBuilderVisitor.visit_type_type"], "tokens": 199}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ConstraintBuilderVisitor(TypeVisitor[List[Constraint]]):\n\n def visit_type_type(self, template: TypeType) -> List[Constraint]:\n if isinstance(self.actual, CallableType):\n return infer_constraints(template.item, self.actual.ret_type, self.direction)\n elif isinstance(self.actual, Overloaded):\n return infer_constraints(template.item, self.actual.items()[0].ret_type,\n self.direction)\n elif isinstance(self.actual, TypeType):\n return infer_constraints(template.item, self.actual.item, self.direction)\n elif isinstance(self.actual, AnyType):\n return infer_constraints(template.item, self.actual, self.direction)\n else:\n return []\n\n\ndef neg_op(op: int) -> int:\n \"\"\"Map SubtypeOf to SupertypeOf and vice versa.\"\"\"\n\n if op == SUBTYPE_OF:\n return SUPERTYPE_OF\n elif op == SUPERTYPE_OF:\n return SUBTYPE_OF\n else:\n raise ValueError('Invalid operator {}'.format(op))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_find_matching_overload_item_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/constraints.py_find_matching_overload_item_", "embedding": null, "metadata": {"file_path": "mypy/constraints.py", "file_name": "constraints.py", "file_type": "text/x-python", "category": "implementation", "start_line": 569, "end_line": 582, "span_ids": ["find_matching_overload_item"], "tokens": 142}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def find_matching_overload_item(overloaded: Overloaded, template: CallableType) -> CallableType:\n \"\"\"Disambiguate overload item against a template.\"\"\"\n items = overloaded.items()\n for item in items:\n # Return type may be indeterminate in the template, so ignore it when performing a\n # subtype check.\n if mypy.subtypes.is_callable_compatible(item, template,\n is_compat=mypy.subtypes.is_subtype,\n ignore_return=True):\n return item\n # Fall back to the first item if we can't find a match. This is totally arbitrary --\n # maybe we should just bail out at this point.\n return items[0]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/defaults.py_os_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/defaults.py_os_", "embedding": null, "metadata": {"file_path": "mypy/defaults.py", "file_name": "defaults.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 31, "span_ids": ["imports"], "tokens": 289}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\n\nfrom typing_extensions import Final\n\nPYTHON2_VERSION = (2, 7) # type: Final\nPYTHON3_VERSION = (3, 6) # type: Final\nPYTHON3_VERSION_MIN = (3, 4) # type: Final\nCACHE_DIR = '.mypy_cache' # type: Final\nCONFIG_FILE = ['mypy.ini', '.mypy.ini'] # type: Final\nSHARED_CONFIG_FILES = ['setup.cfg', ] # type: Final\nUSER_CONFIG_FILES = ['~/.config/mypy/config', '~/.mypy.ini', ] # type: Final\nif os.environ.get('XDG_CONFIG_HOME'):\n USER_CONFIG_FILES.insert(0, os.path.join(os.environ['XDG_CONFIG_HOME'], 'mypy/config'))\n\nCONFIG_FILES = CONFIG_FILE + SHARED_CONFIG_FILES + USER_CONFIG_FILES # type: Final\n\n# This must include all reporters defined in mypy.report. This is defined here\n# to make reporter names available without importing mypy.report -- this speeds\n# up startup.\nREPORTER_NAMES = ['linecount',\n 'any-exprs',\n 'linecoverage',\n 'memory-xml',\n 'cobertura-xml',\n 'xml',\n 'xslt-html',\n 'xslt-txt',\n 'html',\n 'txt',\n 'lineprecision'] # type: Final", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/__main__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/__main__.py__", "embedding": null, "metadata": {"file_path": "mypy/dmypy/__main__.py", "file_name": "__main__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 5, "span_ids": ["imports"], "tokens": 22}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from mypy.dmypy.client import console_entry\n\nif __name__ == '__main__':\n console_entry()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py__Client_for_mypy_daemon_p_add_argument_files_m": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py__Client_for_mypy_daemon_p_add_argument_files_m", "embedding": null, "metadata": {"file_path": "mypy/dmypy/client.py", "file_name": "client.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 76, "span_ids": ["AugmentedHelpFormatter", "impl", "impl:37", "AugmentedHelpFormatter.__init__", "docstring"], "tokens": 734}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Client for mypy daemon mode.\n\nThis manages a daemon process which keeps useful state in memory\nrather than having to read it back from disk on each run.\n\"\"\"\n\nimport argparse\nimport base64\nimport json\nimport os\nimport pickle\nimport sys\nimport time\nimport traceback\n\nfrom typing import Any, Callable, Dict, Mapping, Optional, Tuple, List\n\nfrom mypy.dmypy_util import DEFAULT_STATUS_FILE, receive\nfrom mypy.ipc import IPCClient, IPCException\nfrom mypy.dmypy_os import alive, kill\nfrom mypy.util import check_python_version, get_terminal_width\n\nfrom mypy.version import __version__\n\n# Argument parser. Subparsers are tied to action functions by the\n# @action(subparse) decorator.\n\n\nclass AugmentedHelpFormatter(argparse.RawDescriptionHelpFormatter):\n def __init__(self, prog: str) -> None:\n super().__init__(prog=prog, max_help_position=30)\n\n\nparser = argparse.ArgumentParser(prog='dmypy',\n description=\"Client for mypy daemon mode\",\n fromfile_prefix_chars='@')\nparser.set_defaults(action=None)\nparser.add_argument('--status-file', default=DEFAULT_STATUS_FILE,\n help='status file to retrieve daemon details')\nparser.add_argument('-V', '--version', action='version',\n version='%(prog)s ' + __version__,\n help=\"Show program's version number and exit\")\nsubparsers = parser.add_subparsers()\n\nstart_parser = p = subparsers.add_parser('start', help=\"Start daemon\")\np.add_argument('--log-file', metavar='FILE', type=str,\n help=\"Direct daemon stdout/stderr to FILE\")\np.add_argument('--timeout', metavar='TIMEOUT', type=int,\n help=\"Server shutdown timeout (in seconds)\")\np.add_argument('flags', metavar='FLAG', nargs='*', type=str,\n help=\"Regular mypy flags (precede with --)\")\n\nrestart_parser = p = subparsers.add_parser('restart',\n help=\"Restart daemon (stop or kill followed by start)\")\np.add_argument('--log-file', metavar='FILE', type=str,\n help=\"Direct daemon stdout/stderr to FILE\")\np.add_argument('--timeout', metavar='TIMEOUT', type=int,\n help=\"Server shutdown timeout (in seconds)\")\np.add_argument('flags', metavar='FLAG', nargs='*', type=str,\n help=\"Regular mypy flags (precede with --)\")\n\nstatus_parser = p = subparsers.add_parser('status', help=\"Show daemon status\")\np.add_argument('-v', '--verbose', action='store_true', help=\"Print detailed status\")\np.add_argument('--fswatcher-dump-file', help=\"Collect information about the current file state\")\n\nstop_parser = p = subparsers.add_parser('stop', help=\"Stop daemon (asks it politely to go away)\")\n\nkill_parser = p = subparsers.add_parser('kill', help=\"Kill daemon (kills the process)\")\n\ncheck_parser = p = subparsers.add_parser('check', formatter_class=AugmentedHelpFormatter,\n help=\"Check some files (requires daemon)\")\np.add_argument('-v', '--verbose', action='store_true', help=\"Print detailed status\")\np.add_argument('-q', '--quiet', action='store_true', help=argparse.SUPPRESS) # Deprecated\np.add_argument('--junit-xml', help=\"Write junit.xml to the given file\")\np.add_argument('--perf-stats-file', help='write performance information to the given file')\np.add_argument('files', metavar='FILE', nargs='+', help=\"File (or directory) to check\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py_run_parser_del_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py_run_parser_del_p", "embedding": null, "metadata": {"file_path": "mypy/dmypy/client.py", "file_name": "client.py", "file_type": "text/x-python", "category": "implementation", "start_line": 78, "end_line": 132, "span_ids": ["impl:37", "impl:63"], "tokens": 750}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "run_parser = p = subparsers.add_parser('run', formatter_class=AugmentedHelpFormatter,\n help=\"Check some files, [re]starting daemon if necessary\")\np.add_argument('-v', '--verbose', action='store_true', help=\"Print detailed status\")\np.add_argument('--junit-xml', help=\"Write junit.xml to the given file\")\np.add_argument('--perf-stats-file', help='write performance information to the given file')\np.add_argument('--timeout', metavar='TIMEOUT', type=int,\n help=\"Server shutdown timeout (in seconds)\")\np.add_argument('--log-file', metavar='FILE', type=str,\n help=\"Direct daemon stdout/stderr to FILE\")\np.add_argument('flags', metavar='ARG', nargs='*', type=str,\n help=\"Regular mypy flags and files (precede with --)\")\n\nrecheck_parser = p = subparsers.add_parser('recheck', formatter_class=AugmentedHelpFormatter,\n help=\"Re-check the previous list of files, with optional modifications (requires daemon)\")\np.add_argument('-v', '--verbose', action='store_true', help=\"Print detailed status\")\np.add_argument('-q', '--quiet', action='store_true', help=argparse.SUPPRESS) # Deprecated\np.add_argument('--junit-xml', help=\"Write junit.xml to the given file\")\np.add_argument('--perf-stats-file', help='write performance information to the given file')\np.add_argument('--update', metavar='FILE', nargs='*',\n help=\"Files in the run to add or check again (default: all from previous run)\")\np.add_argument('--remove', metavar='FILE', nargs='*',\n help=\"Files to remove from the run\")\n\nsuggest_parser = p = subparsers.add_parser('suggest',\n help=\"Suggest a signature or show call sites for a specific function\")\np.add_argument('function', metavar='FUNCTION', type=str,\n help=\"Function specified as '[package.]module.[class.]function'\")\np.add_argument('--json', action='store_true',\n help=\"Produce json that pyannotate can use to apply a suggestion\")\np.add_argument('--no-errors', action='store_true',\n help=\"Only produce suggestions that cause no errors\")\np.add_argument('--no-any', action='store_true',\n help=\"Only produce suggestions that don't contain Any\")\np.add_argument('--flex-any', type=float,\n help=\"Allow anys in types if they go above a certain score (scores are from 0-1)\")\np.add_argument('--try-text', action='store_true',\n help=\"Try using unicode wherever str is inferred\")\np.add_argument('--callsites', action='store_true',\n help=\"Find callsites instead of suggesting a type\")\np.add_argument('--use-fixme', metavar='NAME', type=str,\n help=\"A dummy name to use instead of Any for types that can't be inferred\")\np.add_argument('--max-guesses', type=int,\n help=\"Set the maximum number of types to try for a function (default 64)\")\n\nhang_parser = p = subparsers.add_parser('hang', help=\"Hang for 100 seconds\")\n\ndaemon_parser = p = subparsers.add_parser('daemon', help=\"Run daemon in foreground\")\np.add_argument('--timeout', metavar='TIMEOUT', type=int,\n help=\"Server shutdown timeout (in seconds)\")\np.add_argument('flags', metavar='FLAG', nargs='*', type=str,\n help=\"Regular mypy flags (precede with --)\")\np.add_argument('--options-data', help=argparse.SUPPRESS)\nhelp_parser = p = subparsers.add_parser('help')\n\ndel p", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py_BadStatus_action.return.register": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py_BadStatus_action.return.register", "embedding": null, "metadata": {"file_path": "mypy/dmypy/client.py", "file_name": "client.py", "file_type": "text/x-python", "category": "implementation", "start_line": 135, "end_line": 177, "span_ids": ["BadStatus", "main", "impl:82", "fail", "action"], "tokens": 255}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BadStatus(Exception):\n \"\"\"Exception raised when there is something wrong with the status file.\n\n For example:\n - No status file found\n - Status file malformed\n - Process whose pid is in the status file does not exist\n \"\"\"\n pass\n\n\ndef main(argv: List[str]) -> None:\n \"\"\"The code is top-down.\"\"\"\n check_python_version('dmypy')\n args = parser.parse_args(argv)\n if not args.action:\n parser.print_usage()\n else:\n try:\n args.action(args)\n except BadStatus as err:\n fail(err.args[0])\n except Exception:\n # We do this explicitly to avoid exceptions percolating up\n # through mypy.api invocations\n traceback.print_exc()\n sys.exit(2)\n\n\ndef fail(msg: str) -> None:\n print(msg, file=sys.stderr)\n sys.exit(2)\n\n\nActionFunction = Callable[[argparse.Namespace], None]\n\n\ndef action(subparser: argparse.ArgumentParser) -> Callable[[ActionFunction], ActionFunction]:\n \"\"\"Decorator to tie an action function to a subparser.\"\"\"\n def register(func: ActionFunction) -> ActionFunction:\n subparser.set_defaults(action=func)\n return func\n return register", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py__Action_functions_run_i_do_start.start_server_args_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py__Action_functions_run_i_do_start.start_server_args_", "embedding": null, "metadata": {"file_path": "mypy/dmypy/client.py", "file_name": "client.py", "file_type": "text/x-python", "category": "implementation", "start_line": 180, "end_line": 201, "span_ids": ["do_start", "action"], "tokens": 144}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Action functions (run in client from command line).\n\n@action(start_parser)\ndef do_start(args: argparse.Namespace) -> None:\n \"\"\"Start daemon (it must not already be running).\n\n This is where mypy flags are set from the command line.\n\n Setting flags is a bit awkward; you have to use e.g.:\n\n dmypy start -- --strict\n\n since we don't want to duplicate mypy's huge list of flags.\n \"\"\"\n try:\n get_status(args.status_file)\n except BadStatus:\n # Bad or missing status file or dead process; good to start.\n pass\n else:\n fail(\"Daemon is still alive\")\n start_server(args)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py_do_restart_start_server.wait_for_server_args_stat": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py_do_restart_start_server.wait_for_server_args_stat", "embedding": null, "metadata": {"file_path": "mypy/dmypy/client.py", "file_name": "client.py", "file_type": "text/x-python", "category": "implementation", "start_line": 204, "end_line": 231, "span_ids": ["start_server", "restart_server", "do_restart"], "tokens": 256}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@action(restart_parser)\ndef do_restart(args: argparse.Namespace) -> None:\n \"\"\"Restart daemon (it may or may not be running; but not hanging).\n\n We first try to stop it politely if it's running. This also sets\n mypy flags from the command line (see do_start()).\n \"\"\"\n restart_server(args)\n\n\ndef restart_server(args: argparse.Namespace, allow_sources: bool = False) -> None:\n \"\"\"Restart daemon (it may or may not be running; but not hanging).\"\"\"\n try:\n do_stop(args)\n except BadStatus:\n # Bad or missing status file or dead process; good to start.\n pass\n start_server(args, allow_sources)\n\n\ndef start_server(args: argparse.Namespace, allow_sources: bool = False) -> None:\n \"\"\"Start the server from command arguments and wait for it.\"\"\"\n # Lazy import so this import doesn't slow down other commands.\n from mypy.dmypy_server import daemonize, process_start_options\n start_options = process_start_options(args.flags, allow_sources)\n if daemonize(start_options, args.status_file, timeout=args.timeout, log_file=args.log_file):\n sys.exit(2)\n wait_for_server(args.status_file)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py_wait_for_server_wait_for_server.fail_Timed_out_waiting_f": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py_wait_for_server_wait_for_server.fail_Timed_out_waiting_f", "embedding": null, "metadata": {"file_path": "mypy/dmypy/client.py", "file_name": "client.py", "file_type": "text/x-python", "category": "implementation", "start_line": 234, "end_line": 251, "span_ids": ["wait_for_server"], "tokens": 145}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def wait_for_server(status_file: str, timeout: float = 5.0) -> None:\n \"\"\"Wait until the server is up.\n\n Exit if it doesn't happen within the timeout.\n \"\"\"\n endtime = time.time() + timeout\n while time.time() < endtime:\n try:\n data = read_status(status_file)\n except BadStatus:\n # If the file isn't there yet, retry later.\n time.sleep(0.1)\n continue\n # If the file's content is bogus or the process is dead, fail.\n check_status(data)\n print(\"Daemon started\")\n return\n fail(\"Timed out waiting for daemon to start\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py_do_run_do_run.check_output_response_ar": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py_do_run_do_run.check_output_response_ar", "embedding": null, "metadata": {"file_path": "mypy/dmypy/client.py", "file_name": "client.py", "file_type": "text/x-python", "category": "implementation", "start_line": 254, "end_line": 281, "span_ids": ["do_run"], "tokens": 277}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@action(run_parser)\ndef do_run(args: argparse.Namespace) -> None:\n \"\"\"Do a check, starting (or restarting) the daemon as necessary\n\n Restarts the daemon if the running daemon reports that it is\n required (due to a configuration change, for example).\n\n Setting flags is a bit awkward; you have to use e.g.:\n\n dmypy run -- --strict a.py b.py ...\n\n since we don't want to duplicate mypy's huge list of flags.\n (The -- is only necessary if flags are specified.)\n \"\"\"\n if not is_running(args.status_file):\n # Bad or missing status file or dead process; good to start.\n start_server(args, allow_sources=True)\n t0 = time.time()\n response = request(args.status_file, 'run', version=__version__, args=args.flags)\n # If the daemon signals that a restart is necessary, do it\n if 'restart' in response:\n print('Restarting: {}'.format(response['restart']))\n restart_server(args, allow_sources=True)\n response = request(args.status_file, 'run', version=__version__, args=args.flags)\n\n t1 = time.time()\n response['roundtrip_time'] = t1 - t0\n check_output(response, args.verbose, args.junit_xml, args.perf_stats_file)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py_do_status_do_status.print_Daemon_is_up_and_r": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py_do_status_do_status.print_Daemon_is_up_and_r", "embedding": null, "metadata": {"file_path": "mypy/dmypy/client.py", "file_name": "client.py", "file_type": "text/x-python", "category": "implementation", "start_line": 284, "end_line": 303, "span_ids": ["do_status"], "tokens": 161}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@action(status_parser)\ndef do_status(args: argparse.Namespace) -> None:\n \"\"\"Print daemon status.\n\n This verifies that it is responsive to requests.\n \"\"\"\n status = read_status(args.status_file)\n if args.verbose:\n show_stats(status)\n # Both check_status() and request() may raise BadStatus,\n # which will be handled by main().\n check_status(status)\n response = request(args.status_file, 'status',\n fswatcher_dump_file=args.fswatcher_dump_file,\n timeout=5)\n if args.verbose or 'error' in response:\n show_stats(response)\n if 'error' in response:\n fail(\"Daemon is stuck; consider %s kill\" % sys.argv[0])\n print(\"Daemon is up and running\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py_do_stop_do_check.check_output_response_ar": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py_do_stop_do_check.check_output_response_ar", "embedding": null, "metadata": {"file_path": "mypy/dmypy/client.py", "file_name": "client.py", "file_type": "text/x-python", "category": "implementation", "start_line": 306, "end_line": 337, "span_ids": ["do_kill", "do_stop", "do_check"], "tokens": 250}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@action(stop_parser)\ndef do_stop(args: argparse.Namespace) -> None:\n \"\"\"Stop daemon via a 'stop' request.\"\"\"\n # May raise BadStatus, which will be handled by main().\n response = request(args.status_file, 'stop', timeout=5)\n if 'error' in response:\n show_stats(response)\n fail(\"Daemon is stuck; consider %s kill\" % sys.argv[0])\n else:\n print(\"Daemon stopped\")\n\n\n@action(kill_parser)\ndef do_kill(args: argparse.Namespace) -> None:\n \"\"\"Kill daemon process with SIGKILL.\"\"\"\n pid, _ = get_status(args.status_file)\n try:\n kill(pid)\n except OSError as err:\n fail(str(err))\n else:\n print(\"Daemon killed\")\n\n\n@action(check_parser)\ndef do_check(args: argparse.Namespace) -> None:\n \"\"\"Ask the daemon to check a list of files.\"\"\"\n t0 = time.time()\n response = request(args.status_file, 'check', files=args.files)\n t1 = time.time()\n response['roundtrip_time'] = t1 - t0\n check_output(response, args.verbose, args.junit_xml, args.perf_stats_file)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py_do_recheck_do_recheck.check_output_response_ar": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py_do_recheck_do_recheck.check_output_response_ar", "embedding": null, "metadata": {"file_path": "mypy/dmypy/client.py", "file_name": "client.py", "file_type": "text/x-python", "category": "implementation", "start_line": 340, "end_line": 362, "span_ids": ["do_recheck"], "tokens": 257}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@action(recheck_parser)\ndef do_recheck(args: argparse.Namespace) -> None:\n \"\"\"Ask the daemon to recheck the previous list of files, with optional modifications.\n\n If at least one of --remove or --update is given, the server will\n update the list of files to check accordingly and assume that any other files\n are unchanged. If none of these flags are given, the server will call stat()\n on each file last checked to determine its status.\n\n Files given in --update ought to exist. Files given in --remove need not exist;\n if they don't they will be ignored.\n The lists may be empty but oughtn't contain duplicates or overlap.\n\n NOTE: The list of files is lost when the daemon is restarted.\n \"\"\"\n t0 = time.time()\n if args.remove is not None or args.update is not None:\n response = request(args.status_file, 'recheck', remove=args.remove, update=args.update)\n else:\n response = request(args.status_file, 'recheck')\n t1 = time.time()\n response['roundtrip_time'] = t1 - t0\n check_output(response, args.verbose, args.junit_xml, args.perf_stats_file)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py_do_suggest_do_suggest.check_output_response_ve": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py_do_suggest_do_suggest.check_output_response_ve", "embedding": null, "metadata": {"file_path": "mypy/dmypy/client.py", "file_name": "client.py", "file_type": "text/x-python", "category": "implementation", "start_line": 365, "end_line": 376, "span_ids": ["do_suggest"], "tokens": 140}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@action(suggest_parser)\ndef do_suggest(args: argparse.Namespace) -> None:\n \"\"\"Ask the daemon for a suggested signature.\n\n This just prints whatever the daemon reports as output.\n For now it may be closer to a list of call sites.\n \"\"\"\n response = request(args.status_file, 'suggest', function=args.function,\n json=args.json, callsites=args.callsites, no_errors=args.no_errors,\n no_any=args.no_any, flex_any=args.flex_any, try_text=args.try_text,\n use_fixme=args.use_fixme, max_guesses=args.max_guesses)\n check_output(response, verbose=False, junit_xml=None, perf_stats_file=None)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py_check_output_check_output.if_status_code_.sys_exit_status_code_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py_check_output_check_output.if_status_code_.sys_exit_status_code_", "embedding": null, "metadata": {"file_path": "mypy/dmypy/client.py", "file_name": "client.py", "file_type": "text/x-python", "category": "implementation", "start_line": 379, "end_line": 409, "span_ids": ["check_output"], "tokens": 259}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def check_output(response: Dict[str, Any], verbose: bool,\n junit_xml: Optional[str],\n perf_stats_file: Optional[str]) -> None:\n \"\"\"Print the output from a check or recheck command.\n\n Call sys.exit() unless the status code is zero.\n \"\"\"\n if 'error' in response:\n fail(response['error'])\n try:\n out, err, status_code = response['out'], response['err'], response['status']\n except KeyError:\n fail(\"Response: %s\" % str(response))\n sys.stdout.write(out)\n sys.stdout.flush()\n sys.stderr.write(err)\n if verbose:\n show_stats(response)\n if junit_xml:\n # Lazy import so this import doesn't slow things down when not writing junit\n from mypy.util import write_junit_xml\n messages = (out + err).splitlines()\n write_junit_xml(response['roundtrip_time'], bool(err), messages, junit_xml,\n response['python_version'], response['platform'])\n if perf_stats_file:\n telemetry = response.get('stats', {})\n with open(perf_stats_file, 'w') as f:\n json.dump(telemetry, f)\n\n if status_code:\n sys.exit(status_code)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py_show_stats_do_hang.print_request_args_status": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py_show_stats_do_hang.print_request_args_status", "embedding": null, "metadata": {"file_path": "mypy/dmypy/client.py", "file_name": "client.py", "file_type": "text/x-python", "category": "implementation", "start_line": 412, "end_line": 426, "span_ids": ["show_stats", "do_hang"], "tokens": 158}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def show_stats(response: Mapping[str, object]) -> None:\n for key, value in sorted(response.items()):\n if key not in ('out', 'err'):\n print(\"%-24s: %10s\" % (key, \"%.3f\" % value if isinstance(value, float) else value))\n else:\n value = repr(value)[1:-1]\n if len(value) > 50:\n value = value[:40] + ' ...'\n print(\"%-24s: %s\" % (key, value))\n\n\n@action(hang_parser)\ndef do_hang(args: argparse.Namespace) -> None:\n \"\"\"Hang for 100 seconds, as a debug hack.\"\"\"\n print(request(args.status_file, 'hang', timeout=1))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py_do_daemon_do_help.parser_print_help_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py_do_daemon_do_help.parser_print_help_", "embedding": null, "metadata": {"file_path": "mypy/dmypy/client.py", "file_name": "client.py", "file_type": "text/x-python", "category": "implementation", "start_line": 429, "end_line": 453, "span_ids": ["do_help", "do_daemon"], "tokens": 224}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@action(daemon_parser)\ndef do_daemon(args: argparse.Namespace) -> None:\n \"\"\"Serve requests in the foreground.\"\"\"\n # Lazy import so this import doesn't slow down other commands.\n from mypy.dmypy_server import Server, process_start_options\n if args.options_data:\n from mypy.options import Options\n options_dict, timeout, log_file = pickle.loads(base64.b64decode(args.options_data))\n options_obj = Options()\n options = options_obj.apply_changes(options_dict)\n if log_file:\n sys.stdout = sys.stderr = open(log_file, 'a', buffering=1)\n fd = sys.stdout.fileno()\n os.dup2(fd, 2)\n os.dup2(fd, 1)\n else:\n options = process_start_options(args.flags, allow_sources=False)\n timeout = args.timeout\n Server(options, args.status_file, timeout=timeout).serve()\n\n\n@action(help_parser)\ndef do_help(args: argparse.Namespace) -> None:\n \"\"\"Print full help (same as dmypy --help).\"\"\"\n parser.print_help()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py__Client_side_infrastruct_request.try_.else_.return.response": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py__Client_side_infrastruct_request.try_.else_.return.response", "embedding": null, "metadata": {"file_path": "mypy/dmypy/client.py", "file_name": "client.py", "file_type": "text/x-python", "category": "implementation", "start_line": 456, "end_line": 489, "span_ids": ["request", "do_help"], "tokens": 315}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Client-side infrastructure.\n\n\ndef request(status_file: str, command: str, *, timeout: Optional[int] = None,\n **kwds: object) -> Dict[str, Any]:\n \"\"\"Send a request to the daemon.\n\n Return the JSON dict with the response.\n\n Raise BadStatus if there is something wrong with the status file\n or if the process whose pid is in the status file has died.\n\n Return {'error': } if an IPC operation or receive()\n raised OSError. This covers cases such as connection refused or\n closed prematurely as well as invalid JSON received.\n \"\"\"\n response = {} # type: Dict[str, str]\n args = dict(kwds)\n args['command'] = command\n # Tell the server whether this request was initiated from a human-facing terminal,\n # so that it can format the type checking output accordingly.\n args['is_tty'] = sys.stdout.isatty() or int(os.getenv('MYPY_FORCE_COLOR', '0')) > 0\n args['terminal_width'] = get_terminal_width()\n bdata = json.dumps(args).encode('utf8')\n _, name = get_status(status_file)\n try:\n with IPCClient(name, timeout) as client:\n client.write(bdata)\n response = receive(client)\n except (OSError, IPCException) as err:\n return {'error': str(err)}\n # TODO: Other errors, e.g. ValueError, UnicodeError\n else:\n return response", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py_get_status_check_status.return.pid_connection_name": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py_get_status_check_status.return.pid_connection_name", "embedding": null, "metadata": {"file_path": "mypy/dmypy/client.py", "file_name": "client.py", "file_type": "text/x-python", "category": "implementation", "start_line": 492, "end_line": 522, "span_ids": ["check_status", "get_status"], "tokens": 235}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_status(status_file: str) -> Tuple[int, str]:\n \"\"\"Read status file and check if the process is alive.\n\n Return (pid, connection_name) on success.\n\n Raise BadStatus if something's wrong.\n \"\"\"\n data = read_status(status_file)\n return check_status(data)\n\n\ndef check_status(data: Dict[str, Any]) -> Tuple[int, str]:\n \"\"\"Check if the process is alive.\n\n Return (pid, connection_name) on success.\n\n Raise BadStatus if something's wrong.\n \"\"\"\n if 'pid' not in data:\n raise BadStatus(\"Invalid status file (no pid field)\")\n pid = data['pid']\n if not isinstance(pid, int):\n raise BadStatus(\"pid field is not an int\")\n if not alive(pid):\n raise BadStatus(\"Daemon has died\")\n if 'connection_name' not in data:\n raise BadStatus(\"Invalid status file (no connection_name field)\")\n connection_name = data['connection_name']\n if not isinstance(connection_name, str):\n raise BadStatus(\"connection_name field is not a string\")\n return pid, connection_name", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py_read_status_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy/client.py_read_status_", "embedding": null, "metadata": {"file_path": "mypy/dmypy/client.py", "file_name": "client.py", "file_type": "text/x-python", "category": "implementation", "start_line": 525, "end_line": 555, "span_ids": ["is_running", "read_status", "console_entry"], "tokens": 193}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def read_status(status_file: str) -> Dict[str, object]:\n \"\"\"Read status file.\n\n Raise BadStatus if the status file doesn't exist or contains\n invalid JSON or the JSON is not a dict.\n \"\"\"\n if not os.path.isfile(status_file):\n raise BadStatus(\"No status file found\")\n with open(status_file) as f:\n try:\n data = json.load(f)\n except Exception as e:\n raise BadStatus(\"Malformed status file (not JSON)\") from e\n if not isinstance(data, dict):\n raise BadStatus(\"Invalid status file (not a dict)\")\n return data\n\n\ndef is_running(status_file: str) -> bool:\n \"\"\"Check if the server is running cleanly\"\"\"\n try:\n get_status(status_file)\n except BadStatus:\n return False\n return True\n\n\n# Run main().\ndef console_entry() -> None:\n main(sys.argv[1:])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_os.py_sys_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_os.py_sys_", "embedding": null, "metadata": {"file_path": "mypy/dmypy_os.py", "file_name": "dmypy_os.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 44, "span_ids": ["alive", "imports", "kill"], "tokens": 287}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import sys\n\nfrom typing import Any, Callable\n\nif sys.platform == 'win32':\n import ctypes\n from ctypes.wintypes import DWORD, HANDLE\n import subprocess\n\n PROCESS_QUERY_LIMITED_INFORMATION = ctypes.c_ulong(0x1000)\n\n kernel32 = ctypes.windll.kernel32\n OpenProcess = kernel32.OpenProcess # type: Callable[[DWORD, int, int], HANDLE]\n GetExitCodeProcess = kernel32.GetExitCodeProcess # type: Callable[[HANDLE, Any], int]\nelse:\n import os\n import signal\n\n\ndef alive(pid: int) -> bool:\n \"\"\"Is the process alive?\"\"\"\n if sys.platform == 'win32':\n # why can't anything be easy...\n status = DWORD()\n handle = OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION,\n 0,\n pid)\n GetExitCodeProcess(handle, ctypes.byref(status))\n return status.value == 259 # STILL_ACTIVE\n else:\n try:\n os.kill(pid, 0)\n except OSError:\n return False\n return True\n\n\ndef kill(pid: int) -> None:\n \"\"\"Kill the process.\"\"\"\n if sys.platform == 'win32':\n subprocess.check_output(\"taskkill /pid {pid} /f /t\".format(pid=pid))\n else:\n os.kill(pid, signal.SIGKILL)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py__Server_for_mypy_daemon__type_Final_If_True_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py__Server_for_mypy_daemon__type_Final_If_True_", "embedding": null, "metadata": {"file_path": "mypy/dmypy_server.py", "file_name": "dmypy_server.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 38, "span_ids": ["docstring"], "tokens": 278}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Server for mypy daemon mode.\n\nThis implements a daemon process which keeps useful state in memory\nto enable fine-grained incremental reprocessing of changes.\n\"\"\"\n\nimport argparse\nimport base64\nimport io\nimport json\nimport os\nimport pickle\nimport subprocess\nimport sys\nimport time\nimport traceback\nfrom contextlib import redirect_stderr, redirect_stdout\n\nfrom typing import AbstractSet, Any, Callable, Dict, List, Optional, Sequence, Tuple, Set\nfrom typing_extensions import Final\n\nimport mypy.build\nimport mypy.errors\nimport mypy.main\nfrom mypy.find_sources import create_source_list, InvalidSourceList\nfrom mypy.server.update import FineGrainedBuildManager, refresh_suppressed_submodules\nfrom mypy.dmypy_util import receive\nfrom mypy.ipc import IPCServer\nfrom mypy.fscache import FileSystemCache\nfrom mypy.fswatcher import FileSystemWatcher, FileData\nfrom mypy.modulefinder import BuildSource, compute_search_paths, FindModuleCache, SearchPaths\nfrom mypy.options import Options\nfrom mypy.suggestions import SuggestionFailure, SuggestionEngine\nfrom mypy.typestate import reset_global_state\nfrom mypy.version import __version__\nfrom mypy.util import FancyFormatter, count_stats\n\nMEM_PROFILE = False # type: Final # If True, dump memory profile after initialization", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_if_sys_platform_win32__Server_code_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_if_sys_platform_win32__Server_code_", "embedding": null, "metadata": {"file_path": "mypy/dmypy_server.py", "file_name": "dmypy_server.py", "file_type": "text/x-python", "category": "implementation", "start_line": 40, "end_line": 128, "span_ids": ["docstring:3", "docstring"], "tokens": 823}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "if sys.platform == 'win32':\n from subprocess import STARTUPINFO\n\n def daemonize(options: Options,\n status_file: str,\n timeout: Optional[int] = None,\n log_file: Optional[str] = None) -> int:\n \"\"\"Create the daemon process via \"dmypy daemon\" and pass options via command line\n\n When creating the daemon grandchild, we create it in a new console, which is\n started hidden. We cannot use DETACHED_PROCESS since it will cause console windows\n to pop up when starting. See\n https://github.com/python/cpython/pull/4150#issuecomment-340215696\n for more on why we can't have nice things.\n\n It also pickles the options to be unpickled by mypy.\n \"\"\"\n command = [sys.executable, '-m', 'mypy.dmypy', '--status-file', status_file, 'daemon']\n pickeled_options = pickle.dumps((options.snapshot(), timeout, log_file))\n command.append('--options-data=\"{}\"'.format(base64.b64encode(pickeled_options).decode()))\n info = STARTUPINFO()\n info.dwFlags = 0x1 # STARTF_USESHOWWINDOW aka use wShowWindow's value\n info.wShowWindow = 0 # SW_HIDE aka make the window invisible\n try:\n subprocess.Popen(command,\n creationflags=0x10, # CREATE_NEW_CONSOLE\n startupinfo=info)\n return 0\n except subprocess.CalledProcessError as e:\n return e.returncode\n\nelse:\n def _daemonize_cb(func: Callable[[], None], log_file: Optional[str] = None) -> int:\n \"\"\"Arrange to call func() in a grandchild of the current process.\n\n Return 0 for success, exit status for failure, negative if\n subprocess killed by signal.\n \"\"\"\n # See https://stackoverflow.com/questions/473620/how-do-you-create-a-daemon-in-python\n sys.stdout.flush()\n sys.stderr.flush()\n pid = os.fork()\n if pid:\n # Parent process: wait for child in case things go bad there.\n npid, sts = os.waitpid(pid, 0)\n sig = sts & 0xff\n if sig:\n print(\"Child killed by signal\", sig)\n return -sig\n sts = sts >> 8\n if sts:\n print(\"Child exit status\", sts)\n return sts\n # Child process: do a bunch of UNIX stuff and then fork a grandchild.\n try:\n os.setsid() # Detach controlling terminal\n os.umask(0o27)\n devnull = os.open('/dev/null', os.O_RDWR)\n os.dup2(devnull, 0)\n os.dup2(devnull, 1)\n os.dup2(devnull, 2)\n os.close(devnull)\n pid = os.fork()\n if pid:\n # Child is done, exit to parent.\n os._exit(0)\n # Grandchild: run the server.\n if log_file:\n sys.stdout = sys.stderr = open(log_file, 'a', buffering=1)\n fd = sys.stdout.fileno()\n os.dup2(fd, 2)\n os.dup2(fd, 1)\n func()\n finally:\n # Make sure we never get back into the caller.\n os._exit(1)\n\n def daemonize(options: Options,\n status_file: str,\n timeout: Optional[int] = None,\n log_file: Optional[str] = None) -> int:\n \"\"\"Run the mypy daemon in a grandchild of the current process\n\n Return 0 for success, exit status for failure, negative if\n subprocess killed by signal.\n \"\"\"\n return _daemonize_cb(Server(options, status_file, timeout).serve, log_file)\n\n# Server code.", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server_Server._response_metadata.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server_Server._response_metadata.return._", "embedding": null, "metadata": {"file_path": "mypy/dmypy_server.py", "file_name": "dmypy_server.py", "file_type": "text/x-python", "category": "implementation", "start_line": 154, "end_line": 198, "span_ids": ["Server", "Server.__init__", "Server._response_metadata"], "tokens": 384}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Server:\n\n # NOTE: the instance is constructed in the parent process but\n # serve() is called in the grandchild (by daemonize()).\n\n def __init__(self, options: Options,\n status_file: str,\n timeout: Optional[int] = None) -> None:\n \"\"\"Initialize the server with the desired mypy flags.\"\"\"\n self.options = options\n # Snapshot the options info before we muck with it, to detect changes\n self.options_snapshot = options.snapshot()\n self.timeout = timeout\n self.fine_grained_manager = None # type: Optional[FineGrainedBuildManager]\n\n if os.path.isfile(status_file):\n os.unlink(status_file)\n\n self.fscache = FileSystemCache()\n\n options.raise_exceptions = True\n options.incremental = True\n options.fine_grained_incremental = True\n options.show_traceback = True\n if options.use_fine_grained_cache:\n # Using fine_grained_cache implies generating and caring\n # about the fine grained cache\n options.cache_fine_grained = True\n else:\n options.cache_dir = os.devnull\n # Fine-grained incremental doesn't support general partial types\n # (details in https://github.com/python/mypy/issues/4492)\n options.local_partial_types = True\n self.status_file = status_file\n\n # Since the object is created in the parent process we can check\n # the output terminal options here.\n self.formatter = FancyFormatter(sys.stdout, sys.stderr, options.show_error_codes)\n\n def _response_metadata(self) -> Dict[str, str]:\n py_version = '{}_{}'.format(self.options.python_version[0], self.options.python_version[1])\n return {\n 'platform': self.options.platform,\n 'python_version': py_version,\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server.serve_Server.serve.try_.finally_.if_exc_info_0_and_exc_in.traceback_print_exception": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server.serve_Server.serve.try_.finally_.if_exc_info_0_and_exc_in.traceback_print_exception", "embedding": null, "metadata": {"file_path": "mypy/dmypy_server.py", "file_name": "dmypy_server.py", "file_type": "text/x-python", "category": "implementation", "start_line": 200, "end_line": 251, "span_ids": ["Server.serve"], "tokens": 472}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Server:\n\n # NOTE: the instance is constructed in the parent process but\n\n def serve(self) -> None:\n \"\"\"Serve requests, synchronously (no thread or fork).\"\"\"\n command = None\n try:\n server = IPCServer(CONNECTION_NAME, self.timeout)\n with open(self.status_file, 'w') as f:\n json.dump({'pid': os.getpid(), 'connection_name': server.connection_name}, f)\n f.write('\\n') # I like my JSON with a trailing newline\n while True:\n with server:\n data = receive(server)\n resp = {} # type: Dict[str, Any]\n if 'command' not in data:\n resp = {'error': \"No command found in request\"}\n else:\n command = data['command']\n if not isinstance(command, str):\n resp = {'error': \"Command is not a string\"}\n else:\n command = data.pop('command')\n try:\n resp = self.run_command(command, data)\n except Exception:\n # If we are crashing, report the crash to the client\n tb = traceback.format_exception(*sys.exc_info())\n resp = {'error': \"Daemon crashed!\\n\" + \"\".join(tb)}\n resp.update(self._response_metadata())\n server.write(json.dumps(resp).encode('utf8'))\n raise\n try:\n resp.update(self._response_metadata())\n server.write(json.dumps(resp).encode('utf8'))\n except OSError:\n pass # Maybe the client hung up\n if command == 'stop':\n reset_global_state()\n sys.exit(0)\n finally:\n # If the final command is something other than a clean\n # stop, remove the status file. (We can't just\n # simplify the logic and always remove the file, since\n # that could cause us to remove a future server's\n # status file.)\n if command != 'stop':\n os.unlink(self.status_file)\n try:\n server.cleanup() # try to remove the socket dir on Linux\n except OSError:\n pass\n exc_info = sys.exc_info()\n if exc_info[0] and exc_info[0] is not SystemExit:\n traceback.print_exception(*exc_info)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server.run_command_Server.run_command.if_method_is_None_.else_.return.method_self_data_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server.run_command_Server.run_command.if_method_is_None_.else_.return.method_self_data_", "embedding": null, "metadata": {"file_path": "mypy/dmypy_server.py", "file_name": "dmypy_server.py", "file_type": "text/x-python", "category": "implementation", "start_line": 253, "end_line": 264, "span_ids": ["Server.run_command"], "tokens": 145}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Server:\n\n # NOTE: the instance is constructed in the parent process but\n\n def run_command(self, command: str, data: Dict[str, object]) -> Dict[str, object]:\n \"\"\"Run a specific command from the registry.\"\"\"\n key = 'cmd_' + command\n method = getattr(self.__class__, key, None)\n if method is None:\n return {'error': \"Unrecognized command '%s'\" % command}\n else:\n if command not in {'check', 'recheck', 'run'}:\n # Only the above commands use some error formatting.\n del data['is_tty']\n del data['terminal_width']\n return method(self, **data)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server._Command_functions_run__Server.cmd_stop.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server._Command_functions_run__Server.cmd_stop.return._", "embedding": null, "metadata": {"file_path": "mypy/dmypy_server.py", "file_name": "dmypy_server.py", "file_type": "text/x-python", "category": "implementation", "start_line": 266, "end_line": 287, "span_ids": ["Server.cmd_status", "Server.cmd_stop", "Server.run_command"], "tokens": 235}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Server:\n\n # NOTE: the instance is constructed in the parent process but\n\n # Command functions (run in the server via RPC).\n\n def cmd_status(self, fswatcher_dump_file: Optional[str] = None) -> Dict[str, object]:\n \"\"\"Return daemon status.\"\"\"\n res = {} # type: Dict[str, object]\n res.update(get_meminfo())\n if fswatcher_dump_file:\n data = self.fswatcher.dump_file_data() if hasattr(self, 'fswatcher') else {}\n # Using .dumps and then writing was noticeably faster than using dump\n s = json.dumps(data)\n with open(fswatcher_dump_file, 'w') as f:\n f.write(s)\n return res\n\n def cmd_stop(self) -> Dict[str, object]:\n \"\"\"Stop daemon.\"\"\"\n # We need to remove the status file *before* we complete the\n # RPC. Otherwise a race condition exists where a subsequent\n # command can see a status file from a dying server and think\n # it is a live one.\n os.unlink(self.status_file)\n return {}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server.cmd_run_Server.cmd_check.return.self_check_sources_is_tt": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server.cmd_run_Server.cmd_check.return.self_check_sources_is_tt", "embedding": null, "metadata": {"file_path": "mypy/dmypy_server.py", "file_name": "dmypy_server.py", "file_type": "text/x-python", "category": "implementation", "start_line": 289, "end_line": 332, "span_ids": ["Server.cmd_run", "Server.cmd_check"], "tokens": 466}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Server:\n\n # NOTE: the instance is constructed in the parent process but\n\n def cmd_run(self, version: str, args: Sequence[str],\n is_tty: bool, terminal_width: int) -> Dict[str, object]:\n \"\"\"Check a list of files, triggering a restart if needed.\"\"\"\n try:\n # Process options can exit on improper arguments, so we need to catch that and\n # capture stderr so the client can report it\n stderr = io.StringIO()\n stdout = io.StringIO()\n with redirect_stderr(stderr):\n with redirect_stdout(stdout):\n sources, options = mypy.main.process_options(\n ['-i'] + list(args),\n require_targets=True,\n server_options=True,\n fscache=self.fscache,\n program='mypy-daemon',\n header=argparse.SUPPRESS)\n # Signal that we need to restart if the options have changed\n if self.options_snapshot != options.snapshot():\n return {'restart': 'configuration changed'}\n if __version__ != version:\n return {'restart': 'mypy version changed'}\n if self.fine_grained_manager:\n manager = self.fine_grained_manager.manager\n start_plugins_snapshot = manager.plugins_snapshot\n _, current_plugins_snapshot = mypy.build.load_plugins(\n options, manager.errors, sys.stdout, extra_plugins=()\n )\n if current_plugins_snapshot != start_plugins_snapshot:\n return {'restart': 'plugins changed'}\n except InvalidSourceList as err:\n return {'out': '', 'err': str(err), 'status': 2}\n except SystemExit as e:\n return {'out': stdout.getvalue(), 'err': stderr.getvalue(), 'status': e.code}\n return self.check(sources, is_tty, terminal_width)\n\n def cmd_check(self, files: Sequence[str],\n is_tty: bool, terminal_width: int) -> Dict[str, object]:\n \"\"\"Check a list of files.\"\"\"\n try:\n sources = create_source_list(files, self.options, self.fscache)\n except InvalidSourceList as err:\n return {'out': '', 'err': str(err), 'status': 2}\n return self.check(sources, is_tty, terminal_width)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server.cmd_recheck_Server.cmd_recheck.return.res": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server.cmd_recheck_Server.cmd_recheck.return.res", "embedding": null, "metadata": {"file_path": "mypy/dmypy_server.py", "file_name": "dmypy_server.py", "file_type": "text/x-python", "category": "implementation", "start_line": 342, "end_line": 378, "span_ids": ["Server.cmd_recheck"], "tokens": 406}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Server:\n\n # NOTE: the instance is constructed in the parent process but\n\n def cmd_recheck(self,\n is_tty: bool,\n terminal_width: int,\n remove: Optional[List[str]] = None,\n update: Optional[List[str]] = None) -> Dict[str, object]:\n \"\"\"Check the same list of files we checked most recently.\n\n If remove/update is given, they modify the previous list;\n if all are None, stat() is called for each file in the previous list.\n \"\"\"\n t0 = time.time()\n if not self.fine_grained_manager:\n return {'error': \"Command 'recheck' is only valid after a 'check' command\"}\n sources = self.previous_sources\n if remove:\n removals = set(remove)\n sources = [s for s in sources if s.path and s.path not in removals]\n if update:\n known = {s.path for s in sources if s.path}\n added = [p for p in update if p not in known]\n try:\n added_sources = create_source_list(added, self.options, self.fscache)\n except InvalidSourceList as err:\n return {'out': '', 'err': str(err), 'status': 2}\n sources = sources + added_sources # Make a copy!\n t1 = time.time()\n manager = self.fine_grained_manager.manager\n manager.log(\"fine-grained increment: cmd_recheck: {:.3f}s\".format(t1 - t0))\n if not self.following_imports():\n messages = self.fine_grained_increment(sources, remove, update)\n else:\n assert remove is None and update is None\n messages = self.fine_grained_increment_follow_imports(sources)\n res = self.increment_output(messages, sources, is_tty, terminal_width)\n self.flush_caches()\n self.update_stats(res)\n return res", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server.initialize_fine_grained_Server.initialize_fine_grained.return._out_join_s_n_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server.initialize_fine_grained_Server.initialize_fine_grained.return._out_join_s_n_", "embedding": null, "metadata": {"file_path": "mypy/dmypy_server.py", "file_name": "dmypy_server.py", "file_type": "text/x-python", "category": "implementation", "start_line": 416, "end_line": 493, "span_ids": ["Server.initialize_fine_grained"], "tokens": 731}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Server:\n\n # NOTE: the instance is constructed in the parent process but\n\n def initialize_fine_grained(self, sources: List[BuildSource],\n is_tty: bool, terminal_width: int) -> Dict[str, Any]:\n self.fswatcher = FileSystemWatcher(self.fscache)\n t0 = time.time()\n self.update_sources(sources)\n t1 = time.time()\n try:\n result = mypy.build.build(sources=sources,\n options=self.options,\n fscache=self.fscache)\n except mypy.errors.CompileError as e:\n output = ''.join(s + '\\n' for s in e.messages)\n if e.use_stdout:\n out, err = output, ''\n else:\n out, err = '', output\n return {'out': out, 'err': err, 'status': 2}\n messages = result.errors\n self.fine_grained_manager = FineGrainedBuildManager(result)\n\n if self.following_imports():\n sources = find_all_sources_in_build(self.fine_grained_manager.graph, sources)\n self.update_sources(sources)\n\n self.previous_sources = sources\n\n # If we are using the fine-grained cache, build hasn't actually done\n # the typechecking on the updated files yet.\n # Run a fine-grained update starting from the cached data\n if result.used_cache:\n t2 = time.time()\n # Pull times and hashes out of the saved_cache and stick them into\n # the fswatcher, so we pick up the changes.\n for state in self.fine_grained_manager.graph.values():\n meta = state.meta\n if meta is None: continue\n assert state.path is not None\n self.fswatcher.set_file_data(\n state.path,\n FileData(st_mtime=float(meta.mtime), st_size=meta.size, hash=meta.hash))\n\n changed, removed = self.find_changed(sources)\n changed += self.find_added_suppressed(self.fine_grained_manager.graph, set(),\n self.fine_grained_manager.manager.search_paths)\n\n # Find anything that has had its dependency list change\n for state in self.fine_grained_manager.graph.values():\n if not state.is_fresh():\n assert state.path is not None\n changed.append((state.id, state.path))\n\n t3 = time.time()\n # Run an update\n messages = self.fine_grained_manager.update(changed, removed)\n\n if self.following_imports():\n # We need to do another update to any new files found by following imports.\n messages = self.fine_grained_increment_follow_imports(sources)\n\n t4 = time.time()\n self.fine_grained_manager.manager.add_stats(\n update_sources_time=t1 - t0,\n build_time=t2 - t1,\n find_changes_time=t3 - t2,\n fg_update_time=t4 - t3,\n files_changed=len(removed) + len(changed))\n\n else:\n # Stores the initial state of sources as a side effect.\n self.fswatcher.find_changed()\n\n if MEM_PROFILE:\n from mypy.memprofile import print_memory_profile\n print_memory_profile(run_gc=False)\n\n status = 1 if messages else 0\n messages = self.pretty_messages(messages, len(sources), is_tty, terminal_width)\n return {'out': ''.join(s + '\\n' for s in messages), 'err': '', 'status': status}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server.fine_grained_increment_Server.fine_grained_increment.return.messages": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server.fine_grained_increment_Server.fine_grained_increment.return.messages", "embedding": null, "metadata": {"file_path": "mypy/dmypy_server.py", "file_name": "dmypy_server.py", "file_type": "text/x-python", "category": "implementation", "start_line": 495, "end_line": 537, "span_ids": ["Server.fine_grained_increment"], "tokens": 428}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Server:\n\n # NOTE: the instance is constructed in the parent process but\n\n def fine_grained_increment(self,\n sources: List[BuildSource],\n remove: Optional[List[str]] = None,\n update: Optional[List[str]] = None,\n ) -> List[str]:\n \"\"\"Perform a fine-grained type checking increment.\n\n If remove and update are None, determine changed paths by using\n fswatcher. Otherwise, assume that only these files have changes.\n\n Args:\n sources: sources passed on the command line\n remove: paths of files that have been removed\n update: paths of files that have been changed or created\n \"\"\"\n assert self.fine_grained_manager is not None\n manager = self.fine_grained_manager.manager\n\n t0 = time.time()\n if remove is None and update is None:\n # Use the fswatcher to determine which files were changed\n # (updated or added) or removed.\n self.update_sources(sources)\n changed, removed = self.find_changed(sources)\n else:\n # Use the remove/update lists to update fswatcher.\n # This avoids calling stat() for unchanged files.\n changed, removed = self.update_changed(sources, remove or [], update or [])\n changed += self.find_added_suppressed(self.fine_grained_manager.graph, set(),\n manager.search_paths)\n manager.search_paths = compute_search_paths(sources, manager.options, manager.data_dir)\n t1 = time.time()\n manager.log(\"fine-grained increment: find_changed: {:.3f}s\".format(t1 - t0))\n messages = self.fine_grained_manager.update(changed, removed)\n t2 = time.time()\n manager.log(\"fine-grained increment: update: {:.3f}s\".format(t2 - t1))\n manager.add_stats(\n find_changes_time=t1 - t0,\n fg_update_time=t2 - t1,\n files_changed=len(removed) + len(changed))\n\n self.previous_sources = sources\n return messages", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server.fine_grained_increment_follow_imports_Server.fine_grained_increment_follow_imports.return.messages": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server.fine_grained_increment_follow_imports_Server.fine_grained_increment_follow_imports.return.messages", "embedding": null, "metadata": {"file_path": "mypy/dmypy_server.py", "file_name": "dmypy_server.py", "file_type": "text/x-python", "category": "implementation", "start_line": 539, "end_line": 656, "span_ids": ["Server.fine_grained_increment_follow_imports"], "tokens": 937}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Server:\n\n # NOTE: the instance is constructed in the parent process but\n\n def fine_grained_increment_follow_imports(self, sources: List[BuildSource]) -> List[str]:\n \"\"\"Like fine_grained_increment, but follow imports.\"\"\"\n t0 = time.time()\n\n # TODO: Support file events\n\n assert self.fine_grained_manager is not None\n fine_grained_manager = self.fine_grained_manager\n graph = fine_grained_manager.graph\n manager = fine_grained_manager.manager\n\n orig_modules = list(graph.keys())\n\n self.update_sources(sources)\n changed_paths = self.fswatcher.find_changed()\n manager.search_paths = compute_search_paths(sources, manager.options, manager.data_dir)\n\n t1 = time.time()\n manager.log(\"fine-grained increment: find_changed: {:.3f}s\".format(t1 - t0))\n\n seen = {source.module for source in sources}\n\n # Find changed modules reachable from roots (or in roots) already in graph.\n changed, new_files = self.find_reachable_changed_modules(\n sources, graph, seen, changed_paths\n )\n sources.extend(new_files)\n\n # Process changes directly reachable from roots.\n messages = fine_grained_manager.update(changed, [])\n\n # Follow deps from changed modules (still within graph).\n worklist = changed[:]\n while worklist:\n module = worklist.pop()\n if module[0] not in graph:\n continue\n sources2 = self.direct_imports(module, graph)\n # Filter anything already seen before. This prevents\n # infinite looping if there are any self edges. (Self\n # edges are maybe a bug, but...)\n sources2 = [source for source in sources2 if source.module not in seen]\n changed, new_files = self.find_reachable_changed_modules(\n sources2, graph, seen, changed_paths\n )\n self.update_sources(new_files)\n messages = fine_grained_manager.update(changed, [])\n worklist.extend(changed)\n\n t2 = time.time()\n\n def refresh_file(module: str, path: str) -> List[str]:\n return fine_grained_manager.update([(module, path)], [])\n\n for module_id, state in list(graph.items()):\n new_messages = refresh_suppressed_submodules(\n module_id, state.path, fine_grained_manager.deps, graph, self.fscache, refresh_file\n )\n if new_messages is not None:\n messages = new_messages\n\n t3 = time.time()\n\n # There may be new files that became available, currently treated as\n # suppressed imports. Process them.\n while True:\n new_unsuppressed = self.find_added_suppressed(graph, seen, manager.search_paths)\n if not new_unsuppressed:\n break\n new_files = [BuildSource(mod[1], mod[0]) for mod in new_unsuppressed]\n sources.extend(new_files)\n self.update_sources(new_files)\n messages = fine_grained_manager.update(new_unsuppressed, [])\n\n for module_id, path in new_unsuppressed:\n new_messages = refresh_suppressed_submodules(\n module_id, path,\n fine_grained_manager.deps,\n graph,\n self.fscache,\n refresh_file\n )\n if new_messages is not None:\n messages = new_messages\n\n t4 = time.time()\n\n # Find all original modules in graph that were not reached -- they are deleted.\n to_delete = []\n for module_id in orig_modules:\n if module_id not in graph:\n continue\n if module_id not in seen:\n module_path = graph[module_id].path\n assert module_path is not None\n to_delete.append((module_id, module_path))\n if to_delete:\n messages = fine_grained_manager.update([], to_delete)\n\n fix_module_deps(graph)\n\n self.previous_sources = find_all_sources_in_build(graph)\n self.update_sources(self.previous_sources)\n\n # Store current file state as side effect\n self.fswatcher.find_changed()\n\n t5 = time.time()\n\n manager.log(\"fine-grained increment: update: {:.3f}s\".format(t5 - t1))\n manager.add_stats(\n find_changes_time=t1 - t0,\n fg_update_time=t2 - t1,\n refresh_suppressed_time=t3 - t2,\n find_added_supressed_time=t4 - t3,\n cleanup_time=t5 - t4)\n\n return messages", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server.increment_output_Server.pretty_messages.return.messages": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server.increment_output_Server.pretty_messages.return.messages", "embedding": null, "metadata": {"file_path": "mypy/dmypy_server.py", "file_name": "dmypy_server.py", "file_type": "text/x-python", "category": "implementation", "start_line": 724, "end_line": 754, "span_ids": ["Server.increment_output", "Server.pretty_messages"], "tokens": 328}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Server:\n\n # NOTE: the instance is constructed in the parent process but\n\n def increment_output(self,\n messages: List[str],\n sources: List[BuildSource],\n is_tty: bool,\n terminal_width: int) -> Dict[str, Any]:\n status = 1 if messages else 0\n messages = self.pretty_messages(messages, len(sources), is_tty, terminal_width)\n return {'out': ''.join(s + '\\n' for s in messages), 'err': '', 'status': status}\n\n def pretty_messages(self, messages: List[str], n_sources: int,\n is_tty: bool = False, terminal_width: Optional[int] = None) -> List[str]:\n use_color = self.options.color_output and is_tty\n fit_width = self.options.pretty and is_tty\n if fit_width:\n messages = self.formatter.fit_in_terminal(messages,\n fixed_terminal_width=terminal_width)\n if self.options.error_summary:\n summary = None # type: Optional[str]\n if messages:\n n_errors, n_files = count_stats(messages)\n if n_errors:\n summary = self.formatter.format_error(n_errors, n_files, n_sources,\n use_color=use_color)\n else:\n summary = self.formatter.format_success(n_sources, use_color)\n if summary:\n # Create new list to avoid appending multiple summaries on successive runs.\n messages = messages + [summary]\n if use_color:\n messages = [self.formatter.colorize(m) for m in messages]\n return messages", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server.update_sources_Server.find_changed.return.self__find_changed_source": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server.update_sources_Server.find_changed.return.self__find_changed_source", "embedding": null, "metadata": {"file_path": "mypy/dmypy_server.py", "file_name": "dmypy_server.py", "file_type": "text/x-python", "category": "implementation", "start_line": 756, "end_line": 774, "span_ids": ["Server.find_changed", "Server.update_sources", "Server.update_changed"], "tokens": 201}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Server:\n\n # NOTE: the instance is constructed in the parent process but\n\n def update_sources(self, sources: List[BuildSource]) -> None:\n paths = [source.path for source in sources if source.path is not None]\n if self.following_imports():\n # Filter out directories (used for namespace packages).\n paths = [path for path in paths if self.fscache.isfile(path)]\n self.fswatcher.add_watched_paths(paths)\n\n def update_changed(self,\n sources: List[BuildSource],\n remove: List[str],\n update: List[str],\n ) -> ChangesAndRemovals:\n\n changed_paths = self.fswatcher.update_changed(remove, update)\n return self._find_changed(sources, changed_paths)\n\n def find_changed(self, sources: List[BuildSource]) -> ChangesAndRemovals:\n changed_paths = self.fswatcher.find_changed()\n return self._find_changed(sources, changed_paths)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server._find_changed_Server._find_changed.return.changed_removed": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server._find_changed_Server._find_changed.return.changed_removed", "embedding": null, "metadata": {"file_path": "mypy/dmypy_server.py", "file_name": "dmypy_server.py", "file_type": "text/x-python", "category": "implementation", "start_line": 776, "end_line": 801, "span_ids": ["Server._find_changed"], "tokens": 261}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Server:\n\n # NOTE: the instance is constructed in the parent process but\n\n def _find_changed(self, sources: List[BuildSource],\n changed_paths: AbstractSet[str]) -> ChangesAndRemovals:\n # Find anything that has been added or modified\n changed = [(source.module, source.path)\n for source in sources\n if source.path and source.path in changed_paths]\n\n # Now find anything that has been removed from the build\n modules = {source.module for source in sources}\n omitted = [source for source in self.previous_sources if source.module not in modules]\n removed = []\n for source in omitted:\n path = source.path\n assert path\n removed.append((source.module, path))\n\n # Find anything that has had its module path change because of added or removed __init__s\n last = {s.path: s.module for s in self.previous_sources}\n for s in sources:\n assert s.path\n if s.path in last and last[s.path] != s.module:\n # Mark it as removed from its old name and changed at its new name\n removed.append((last[s.path], s.path))\n changed.append((s.module, s.path))\n\n return changed, removed", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server.cmd_suggest_MiB.2_20": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server.cmd_suggest_MiB.2_20", "embedding": null, "metadata": {"file_path": "mypy/dmypy_server.py", "file_name": "dmypy_server.py", "file_type": "text/x-python", "category": "implementation", "start_line": 836, "end_line": 871, "span_ids": ["impl:13", "Server.cmd_suggest", "Server.cmd_hang"], "tokens": 262}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Server:\n\n # NOTE: the instance is constructed in the parent process but\n\n def cmd_suggest(self,\n function: str,\n callsites: bool,\n **kwargs: Any) -> Dict[str, object]:\n \"\"\"Suggest a signature for a function.\"\"\"\n if not self.fine_grained_manager:\n return {\n 'error': \"Command 'suggest' is only valid after a 'check' command\"\n \" (that produces no parse errors)\"}\n engine = SuggestionEngine(self.fine_grained_manager, **kwargs)\n try:\n if callsites:\n out = engine.suggest_callsites(function)\n else:\n out = engine.suggest(function)\n except SuggestionFailure as err:\n return {'error': str(err)}\n else:\n if not out:\n out = \"No suggestions\\n\"\n elif not out.endswith(\"\\n\"):\n out += \"\\n\"\n return {'out': out, 'err': \"\", 'status': 0}\n finally:\n self.flush_caches()\n\n def cmd_hang(self) -> Dict[str, object]:\n \"\"\"Hang for 100 seconds, as a debug hack.\"\"\"\n time.sleep(100)\n return {}\n\n\n# Misc utilities.\n\n\nMiB = 2**20", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_None_5_get_meminfo.return.res": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_None_5_get_meminfo.return.res", "embedding": null, "metadata": {"file_path": "mypy/dmypy_server.py", "file_name": "dmypy_server.py", "file_type": "text/x-python", "category": "implementation", "start_line": 838, "end_line": 866, "span_ids": ["impl:13", "get_meminfo"], "tokens": 278}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": " # type: Final\n\n\ndef get_meminfo() -> Dict[str, Any]:\n res = {} # type: Dict[str, Any]\n try:\n import psutil # type: ignore # It's not in typeshed yet\n except ImportError:\n res['memory_psutil_missing'] = (\n 'psutil not found, run pip install mypy[dmypy] '\n 'to install the needed components for dmypy'\n )\n else:\n process = psutil.Process()\n meminfo = process.memory_info()\n res['memory_rss_mib'] = meminfo.rss / MiB\n res['memory_vms_mib'] = meminfo.vms / MiB\n if sys.platform == 'win32':\n res['memory_maxrss_mib'] = meminfo.peak_wset / MiB\n else:\n # See https://stackoverflow.com/questions/938733/total-memory-used-by-python-process\n import resource # Since it doesn't exist on Windows.\n rusage = resource.getrusage(resource.RUSAGE_SELF)\n if sys.platform == 'darwin':\n factor = 1\n else:\n factor = 1024 # Linux\n res['memory_maxrss_mib'] = rusage.ru_maxrss * factor / MiB\n return res", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_util.py__Shared_code_between_dm_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_util.py__Shared_code_between_dm_", "embedding": null, "metadata": {"file_path": "mypy/dmypy_util.py", "file_name": "dmypy_util.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 32, "span_ids": ["receive", "docstring"], "tokens": 199}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Shared code between dmypy.py and dmypy_server.py.\n\nThis should be pretty lightweight and not depend on other mypy code (other than ipc).\n\"\"\"\n\nimport json\n\nfrom typing import Any\nfrom typing_extensions import Final\n\nfrom mypy.ipc import IPCBase\n\nDEFAULT_STATUS_FILE = '.dmypy.json' # type: Final\n\n\ndef receive(connection: IPCBase) -> Any:\n \"\"\"Receive JSON data from a connection until EOF.\n\n Raise OSError if the data received is not valid JSON or if it is\n not a dict.\n \"\"\"\n bdata = connection.read()\n if not bdata:\n raise OSError(\"No data received\")\n try:\n data = json.loads(bdata.decode('utf8'))\n except Exception as e:\n raise OSError(\"Data received is not valid JSON\") from e\n if not isinstance(data, dict):\n raise OSError(\"Data received is not a dict (%s)\" % str(type(data)))\n return data", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/erasetype.py_from_typing_import_Option_from_mypy_nodes_import_AR": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/erasetype.py_from_typing_import_Option_from_mypy_nodes_import_AR", "embedding": null, "metadata": {"file_path": "mypy/erasetype.py", "file_name": "erasetype.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 9, "span_ids": ["imports"], "tokens": 113}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from typing import Optional, Container, Callable\n\nfrom mypy.types import (\n Type, TypeVisitor, UnboundType, AnyType, NoneType, TypeVarId, Instance, TypeVarType,\n CallableType, TupleType, TypedDictType, UnionType, Overloaded, ErasedType, PartialType,\n DeletedType, TypeTranslator, UninhabitedType, TypeType, TypeOfAny, LiteralType, ProperType,\n get_proper_type, TypeAliasType\n)\nfrom mypy.nodes import ARG_STAR, ARG_STAR2", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/erasetype.py_erase_type_erase_type.return.typ_accept_EraseTypeVisit": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/erasetype.py_erase_type_erase_type.return.typ_accept_EraseTypeVisit", "embedding": null, "metadata": {"file_path": "mypy/erasetype.py", "file_name": "erasetype.py", "file_type": "text/x-python", "category": "implementation", "start_line": 12, "end_line": 25, "span_ids": ["erase_type"], "tokens": 104}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def erase_type(typ: Type) -> ProperType:\n \"\"\"Erase any type variables from a type.\n\n Also replace tuple types with the corresponding concrete types.\n\n Examples:\n A -> A\n B[X] -> B[Any]\n Tuple[A, B] -> tuple\n Callable[[A1, A2, ...], R] -> Callable[..., Any]\n Type[X] -> Type[Any]\n \"\"\"\n typ = get_proper_type(typ)\n return typ.accept(EraseTypeVisitor())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/erasetype.py_EraseTypeVisitor_EraseTypeVisitor.visit_type_alias_type.raise_RuntimeError_Type_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/erasetype.py_EraseTypeVisitor_EraseTypeVisitor.visit_type_alias_type.raise_RuntimeError_Type_", "embedding": null, "metadata": {"file_path": "mypy/erasetype.py", "file_name": "erasetype.py", "file_type": "text/x-python", "category": "implementation", "start_line": 28, "end_line": 97, "span_ids": ["EraseTypeVisitor.visit_none_type", "EraseTypeVisitor.visit_literal_type", "EraseTypeVisitor.visit_type_type", "EraseTypeVisitor.visit_any", "EraseTypeVisitor.visit_unbound_type", "EraseTypeVisitor.visit_deleted_type", "EraseTypeVisitor.visit_callable_type", "EraseTypeVisitor.visit_tuple_type", "EraseTypeVisitor.visit_instance", "EraseTypeVisitor.visit_uninhabited_type", "EraseTypeVisitor.visit_type_var", "EraseTypeVisitor.visit_typeddict_type", "EraseTypeVisitor", "EraseTypeVisitor.visit_partial_type", "EraseTypeVisitor.visit_overloaded", "EraseTypeVisitor.visit_type_alias_type", "EraseTypeVisitor.visit_union_type", "EraseTypeVisitor.visit_erased_type"], "tokens": 630}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class EraseTypeVisitor(TypeVisitor[ProperType]):\n\n def visit_unbound_type(self, t: UnboundType) -> ProperType:\n # TODO: replace with an assert after UnboundType can't leak from semantic analysis.\n return AnyType(TypeOfAny.from_error)\n\n def visit_any(self, t: AnyType) -> ProperType:\n return t\n\n def visit_none_type(self, t: NoneType) -> ProperType:\n return t\n\n def visit_uninhabited_type(self, t: UninhabitedType) -> ProperType:\n return t\n\n def visit_erased_type(self, t: ErasedType) -> ProperType:\n # Should not get here.\n raise RuntimeError()\n\n def visit_partial_type(self, t: PartialType) -> ProperType:\n # Should not get here.\n raise RuntimeError()\n\n def visit_deleted_type(self, t: DeletedType) -> ProperType:\n return t\n\n def visit_instance(self, t: Instance) -> ProperType:\n return Instance(t.type, [AnyType(TypeOfAny.special_form)] * len(t.args), t.line)\n\n def visit_type_var(self, t: TypeVarType) -> ProperType:\n return AnyType(TypeOfAny.special_form)\n\n def visit_callable_type(self, t: CallableType) -> ProperType:\n # We must preserve the fallback type for overload resolution to work.\n any_type = AnyType(TypeOfAny.special_form)\n return CallableType(\n arg_types=[any_type, any_type],\n arg_kinds=[ARG_STAR, ARG_STAR2],\n arg_names=[None, None],\n ret_type=any_type,\n fallback=t.fallback,\n is_ellipsis_args=True,\n implicit=True,\n )\n\n def visit_overloaded(self, t: Overloaded) -> ProperType:\n return t.fallback.accept(self)\n\n def visit_tuple_type(self, t: TupleType) -> ProperType:\n return t.partial_fallback.accept(self)\n\n def visit_typeddict_type(self, t: TypedDictType) -> ProperType:\n return t.fallback.accept(self)\n\n def visit_literal_type(self, t: LiteralType) -> ProperType:\n # The fallback for literal types should always be either\n # something like int or str, or an enum class -- types that\n # don't contain any TypeVars. So there's no need to visit it.\n return t\n\n def visit_union_type(self, t: UnionType) -> ProperType:\n erased_items = [erase_type(item) for item in t.items]\n from mypy.typeops import make_simplified_union # asdf\n return make_simplified_union(erased_items)\n\n def visit_type_type(self, t: TypeType) -> ProperType:\n return TypeType.make_normalized(t.item.accept(self), line=t.line)\n\n def visit_type_alias_type(self, t: TypeAliasType) -> ProperType:\n raise RuntimeError(\"Type aliases should be expanded before accepting this visitor\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/erasetype.py_erase_typevars_replace_meta_vars.return.t_accept_TypeVarEraser_la": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/erasetype.py_erase_typevars_replace_meta_vars.return.t_accept_TypeVarEraser_la", "embedding": null, "metadata": {"file_path": "mypy/erasetype.py", "file_name": "erasetype.py", "file_type": "text/x-python", "category": "implementation", "start_line": 100, "end_line": 113, "span_ids": ["erase_typevars", "replace_meta_vars"], "tokens": 152}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def erase_typevars(t: Type, ids_to_erase: Optional[Container[TypeVarId]] = None) -> Type:\n \"\"\"Replace all type variables in a type with any,\n or just the ones in the provided collection.\n \"\"\"\n def erase_id(id: TypeVarId) -> bool:\n if ids_to_erase is None:\n return True\n return id in ids_to_erase\n return t.accept(TypeVarEraser(erase_id, AnyType(TypeOfAny.special_form)))\n\n\ndef replace_meta_vars(t: Type, target_type: Type) -> Type:\n \"\"\"Replace unification variables in a type with the target type.\"\"\"\n return t.accept(TypeVarEraser(lambda id: id.is_meta_var(), target_type))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/erasetype.py_TypeVarEraser_remove_instance_last_known_values.return.t_accept_LastKnownValueEr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/erasetype.py_TypeVarEraser_remove_instance_last_known_values.return.t_accept_LastKnownValueEr", "embedding": null, "metadata": {"file_path": "mypy/erasetype.py", "file_name": "erasetype.py", "file_type": "text/x-python", "category": "implementation", "start_line": 116, "end_line": 135, "span_ids": ["TypeVarEraser", "TypeVarEraser.visit_type_var", "TypeVarEraser.__init__", "remove_instance_last_known_values", "TypeVarEraser.visit_type_alias_type"], "tokens": 173}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeVarEraser(TypeTranslator):\n \"\"\"Implementation of type erasure\"\"\"\n\n def __init__(self, erase_id: Callable[[TypeVarId], bool], replacement: Type) -> None:\n self.erase_id = erase_id\n self.replacement = replacement\n\n def visit_type_var(self, t: TypeVarType) -> Type:\n if self.erase_id(t.id):\n return self.replacement\n return t\n\n def visit_type_alias_type(self, t: TypeAliasType) -> Type:\n # Type alias target can't contain bound type variables, so\n # it is safe to just erase the arguments.\n return t.copy_modified(args=[a.accept(self) for a in t.args])\n\n\ndef remove_instance_last_known_values(t: Type) -> Type:\n return t.accept(LastKnownValueEraser())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/erasetype.py_LastKnownValueEraser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/erasetype.py_LastKnownValueEraser_", "embedding": null, "metadata": {"file_path": "mypy/erasetype.py", "file_name": "erasetype.py", "file_type": "text/x-python", "category": "implementation", "start_line": 138, "end_line": 157, "span_ids": ["LastKnownValueEraser.visit_type_alias_type", "LastKnownValueEraser.visit_instance", "LastKnownValueEraser"], "tokens": 158}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LastKnownValueEraser(TypeTranslator):\n \"\"\"Removes the Literal[...] type that may be associated with any\n Instance types.\"\"\"\n\n def visit_instance(self, t: Instance) -> Type:\n if not t.last_known_value and not t.args:\n return t\n new_t = t.copy_modified(\n args=[a.accept(self) for a in t.args],\n last_known_value=None,\n )\n new_t.can_be_true = t.can_be_true\n new_t.can_be_false = t.can_be_false\n return new_t\n\n def visit_type_alias_type(self, t: TypeAliasType) -> Type:\n # Type aliases can't contain literal values, because they are\n # always constructed as explicit types.\n return t", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errorcodes.py__Classification_of_poss_None_25": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errorcodes.py__Classification_of_poss_None_25", "embedding": null, "metadata": {"file_path": "mypy/errorcodes.py", "file_name": "errorcodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 78, "span_ids": ["impl:43", "ErrorCode.__init__", "impl:5", "docstring", "ErrorCode.__str__", "ErrorCode"], "tokens": 805}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Classification of possible errors mypy can detect.\n\nThese can be used for filtering specific errors.\n\"\"\"\n\nfrom typing import Dict, List\nfrom typing_extensions import Final\n\n\n# All created error codes are implicitly stored in this list.\nall_error_codes = [] # type: List[ErrorCode]\n\nerror_codes = {} # type: Dict[str, ErrorCode]\n\n\nclass ErrorCode:\n def __init__(self, code: str,\n description: str,\n category: str,\n default_enabled: bool = True) -> None:\n self.code = code\n self.description = description\n self.category = category\n self.default_enabled = default_enabled\n error_codes[code] = self\n\n def __str__(self) -> str:\n return ''.format(self.code)\n\n\nATTR_DEFINED = ErrorCode(\n 'attr-defined', \"Check that attribute exists\", 'General') # type: Final\nNAME_DEFINED = ErrorCode(\n 'name-defined', \"Check that name is defined\", 'General') # type: Final\nCALL_ARG = ErrorCode(\n 'call-arg', \"Check number, names and kinds of arguments in calls\", 'General') # type: Final\nARG_TYPE = ErrorCode(\n 'arg-type', \"Check argument types in calls\", 'General') # type: Final\nCALL_OVERLOAD = ErrorCode(\n 'call-overload', \"Check that an overload variant matches arguments\", 'General') # type: Final\nVALID_TYPE = ErrorCode(\n 'valid-type', \"Check that type (annotation) is valid\", 'General') # type: Final\nVAR_ANNOTATED = ErrorCode(\n 'var-annotated', \"Require variable annotation if type can't be inferred\",\n 'General') # type: Final\nOVERRIDE = ErrorCode(\n 'override', \"Check that method override is compatible with base class\",\n 'General') # type: Final\nRETURN = ErrorCode(\n 'return', \"Check that function always returns a value\", 'General') # type: Final\nRETURN_VALUE = ErrorCode(\n 'return-value', \"Check that return value is compatible with signature\",\n 'General') # type: Final\nASSIGNMENT = ErrorCode(\n 'assignment', \"Check that assigned value is compatible with target\", 'General') # type: Final\nTYPE_ARG = ErrorCode(\n 'type-arg', \"Check that generic type arguments are present\", 'General') # type: Final\nTYPE_VAR = ErrorCode(\n 'type-var', \"Check that type variable values are valid\", 'General') # type: Final\nUNION_ATTR = ErrorCode(\n 'union-attr', \"Check that attribute exists in each item of a union\", 'General') # type: Final\nINDEX = ErrorCode(\n 'index', \"Check indexing operations\", 'General') # type: Final\nOPERATOR = ErrorCode(\n 'operator', \"Check that operator is valid for operands\", 'General') # type: Final\nLIST_ITEM = ErrorCode(\n 'list-item', \"Check list items in a list expression [item, ...]\", 'General') # type: Final\nDICT_ITEM = ErrorCode(\n 'dict-item',\n \"Check dict items in a dict expression {key: value, ...}\", 'General') # type: Final\nTYPEDDICT_ITEM = ErrorCode(\n 'typeddict-item', \"Check items when constructing TypedDict\", 'General') # type: Final\nHAS_TYPE = ErrorCode(\n 'has-type', \"Check that type of reference can be determined\", 'General') # type: Final\nIMPORT = ErrorCode(\n 'import', \"Require that imported module can be found or has stubs\", 'General') # type: Final\nNO_REDEF = ErrorCode(\n 'no-redef', \"Check that each name is defined once\", 'General') # type: Final", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errorcodes.py_FUNC_RETURNS_VALUE_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errorcodes.py_FUNC_RETURNS_VALUE_", "embedding": null, "metadata": {"file_path": "mypy/errorcodes.py", "file_name": "errorcodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 79, "end_line": 131, "span_ids": ["impl:75", "impl:43"], "tokens": 591}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "FUNC_RETURNS_VALUE = ErrorCode(\n 'func-returns-value', \"Check that called function returns a value in value context\",\n 'General') # type: Final\nABSTRACT = ErrorCode(\n 'abstract', \"Prevent instantiation of classes with abstract attributes\",\n 'General') # type: Final\nVALID_NEWTYPE = ErrorCode(\n 'valid-newtype', \"Check that argument 2 to NewType is valid\", 'General') # type: Final\nSTRING_FORMATTING = ErrorCode(\n 'str-format', \"Check that string formatting/interpolation is type-safe\",\n 'General') # type: Final\nSTR_BYTES_PY3 = ErrorCode(\n 'str-bytes-safe', \"Warn about dangerous coercions related to bytes and string types\",\n 'General') # type: Final\nEXIT_RETURN = ErrorCode(\n 'exit-return', \"Warn about too general return type for '__exit__'\", 'General') # type: Final\n\n# These error codes aren't enabled by default.\nNO_UNTYPED_DEF = ErrorCode(\n 'no-untyped-def', \"Check that every function has an annotation\", 'General') # type: Final\nNO_UNTYPED_CALL = ErrorCode(\n 'no-untyped-call',\n \"Disallow calling functions without type annotations from annotated functions\",\n 'General') # type: Final\nREDUNDANT_CAST = ErrorCode(\n 'redundant-cast', \"Check that cast changes type of expression\", 'General') # type: Final\nCOMPARISON_OVERLAP = ErrorCode(\n 'comparison-overlap',\n \"Check that types in comparisons and 'in' expressions overlap\", 'General') # type: Final\nNO_ANY_UNIMPORTED = ErrorCode(\n 'no-any-unimported', 'Reject \"Any\" types from unfollowed imports', 'General') # type: Final\nNO_ANY_RETURN = ErrorCode(\n 'no-any-return', 'Reject returning value with \"Any\" type if return type is not \"Any\"',\n 'General') # type: Final\nUNREACHABLE = ErrorCode(\n 'unreachable', \"Warn about unreachable statements or expressions\", 'General') # type: Final\nREDUNDANT_EXPR = ErrorCode(\n 'redundant-expr',\n \"Warn about redundant expressions\",\n 'General',\n default_enabled=False) # type: Final\nNAME_MATCH = ErrorCode(\n 'name-match', \"Check that type definition has consistent naming\", 'General') # type: Final\n\n\n# Syntax errors are often blocking.\nSYNTAX = ErrorCode(\n 'syntax', \"Report syntax errors\", 'General') # type: Final\n\n# This is a catch-all for remaining uncategorized errors.\nMISC = ErrorCode(\n 'misc', \"Miscenallenous other checks\", 'General') # type: Final", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_os.path_allowed_duplicates._overload_Got_Ex": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_os.path_allowed_duplicates._overload_Got_Ex", "embedding": null, "metadata": {"file_path": "mypy/errors.py", "file_name": "errors.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 18, "span_ids": ["imports"], "tokens": 131}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os.path\nimport sys\nimport traceback\nfrom mypy.ordered_dict import OrderedDict\nfrom collections import defaultdict\n\nfrom typing import Tuple, List, TypeVar, Set, Dict, Optional, TextIO, Callable\nfrom typing_extensions import Final\n\nfrom mypy.scope import Scope\nfrom mypy.options import Options\nfrom mypy.version import __version__ as mypy_version\nfrom mypy.errorcodes import ErrorCode\nfrom mypy import errorcodes as codes\nfrom mypy.util import DEFAULT_SOURCE_OFFSET, is_typeshed_file\n\nT = TypeVar('T')\nallowed_duplicates = ['@overload', 'Got:', 'Expected:']", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py__type_Final_ErrorTuple.Tuple_Optional_str_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py__type_Final_ErrorTuple.Tuple_Optional_str_", "embedding": null, "metadata": {"file_path": "mypy/errors.py", "file_name": "errors.py", "file_type": "text/x-python", "category": "implementation", "start_line": 18, "end_line": 106, "span_ids": ["imports", "ErrorInfo.__init__", "impl:5", "ErrorInfo"], "tokens": 645}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": " # type: Final\n\n\nclass ErrorInfo:\n \"\"\"Representation of a single error message.\"\"\"\n\n # Description of a sequence of imports that refer to the source file\n # related to this error. Each item is a (path, line number) tuple.\n import_ctx = None # type: List[Tuple[str, int]]\n\n # The path to source file that was the source of this error.\n file = ''\n\n # The fully-qualified id of the source module for this error.\n module = None # type: Optional[str]\n\n # The name of the type in which this error is located at.\n type = '' # type: Optional[str] # Unqualified, may be None\n\n # The name of the function or member in which this error is located at.\n function_or_member = '' # type: Optional[str] # Unqualified, may be None\n\n # The line number related to this error within file.\n line = 0 # -1 if unknown\n\n # The column number related to this error with file.\n column = 0 # -1 if unknown\n\n # Either 'error' or 'note'\n severity = ''\n\n # The error message.\n message = ''\n\n # The error code.\n code = None # type: Optional[ErrorCode]\n\n # If True, we should halt build after the file that generated this error.\n blocker = False\n\n # Only report this particular messages once per program.\n only_once = False\n\n # Actual origin of the error message as tuple (path, line number, end line number)\n # If end line number is unknown, use line number.\n origin = None # type: Tuple[str, int, int]\n\n # Fine-grained incremental target where this was reported\n target = None # type: Optional[str]\n\n def __init__(self,\n import_ctx: List[Tuple[str, int]],\n file: str,\n module: Optional[str],\n typ: Optional[str],\n function_or_member: Optional[str],\n line: int,\n column: int,\n severity: str,\n message: str,\n code: Optional[ErrorCode],\n blocker: bool,\n only_once: bool,\n origin: Optional[Tuple[str, int, int]] = None,\n target: Optional[str] = None) -> None:\n self.import_ctx = import_ctx\n self.file = file\n self.module = module\n self.type = typ\n self.function_or_member = function_or_member\n self.line = line\n self.column = column\n self.severity = severity\n self.message = message\n self.code = code\n self.blocker = blocker\n self.only_once = only_once\n self.origin = origin or (file, line, line)\n self.target = target\n\n\n# Type used internally to represent errors:\n# (path, line, column, severity, message, code)\nErrorTuple = Tuple[Optional[str],\n int,\n int,\n str,\n str,\n Optional[ErrorCode]]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_Errors_Errors.copy.return.new": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_Errors_Errors.copy.return.new", "embedding": null, "metadata": {"file_path": "mypy/errors.py", "file_name": "errors.py", "file_type": "text/x-python", "category": "implementation", "start_line": 109, "end_line": 210, "span_ids": ["Errors.__init__", "Errors.reset", "Errors.copy", "Errors", "Errors.initialize"], "tokens": 842}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Errors:\n \"\"\"Container for compile errors.\n\n This class generates and keeps tracks of compile errors and the\n current error context (nested imports).\n \"\"\"\n\n # Map from files to generated error messages. Is an OrderedDict so\n # that it can be used to order messages based on the order the\n # files were processed.\n error_info_map = None # type: Dict[str, List[ErrorInfo]]\n\n # Files that we have reported the errors for\n flushed_files = None # type: Set[str]\n\n # Current error context: nested import context/stack, as a list of (path, line) pairs.\n import_ctx = None # type: List[Tuple[str, int]]\n\n # Path name prefix that is removed from all paths, if set.\n ignore_prefix = None # type: Optional[str]\n\n # Path to current file.\n file = '' # type: str\n\n # Ignore some errors on these lines of each file\n # (path -> line -> error-codes)\n ignored_lines = None # type: Dict[str, Dict[int, List[str]]]\n\n # Lines on which an error was actually ignored.\n used_ignored_lines = None # type: Dict[str, Set[int]]\n\n # Files where all errors should be ignored.\n ignored_files = None # type: Set[str]\n\n # Collection of reported only_once messages.\n only_once_messages = None # type: Set[str]\n\n # Set to True to show \"In function \"foo\":\" messages.\n show_error_context = False # type: bool\n\n # Set to True to show column numbers in error messages.\n show_column_numbers = False # type: bool\n\n # Set to True to show absolute file paths in error messages.\n show_absolute_path = False # type: bool\n\n # State for keeping track of the current fine-grained incremental mode target.\n # (See mypy.server.update for more about targets.)\n # Current module id.\n target_module = None # type: Optional[str]\n scope = None # type: Optional[Scope]\n\n def __init__(self,\n show_error_context: bool = False,\n show_column_numbers: bool = False,\n show_error_codes: bool = False,\n pretty: bool = False,\n read_source: Optional[Callable[[str], Optional[List[str]]]] = None,\n show_absolute_path: bool = False,\n enabled_error_codes: Optional[Set[ErrorCode]] = None,\n disabled_error_codes: Optional[Set[ErrorCode]] = None) -> None:\n self.show_error_context = show_error_context\n self.show_column_numbers = show_column_numbers\n self.show_error_codes = show_error_codes\n self.show_absolute_path = show_absolute_path\n self.pretty = pretty\n # We use fscache to read source code when showing snippets.\n self.read_source = read_source\n self.enabled_error_codes = enabled_error_codes or set()\n self.disabled_error_codes = disabled_error_codes or set()\n self.initialize()\n\n def initialize(self) -> None:\n self.error_info_map = OrderedDict()\n self.flushed_files = set()\n self.import_ctx = []\n self.function_or_member = [None]\n self.ignored_lines = OrderedDict()\n self.used_ignored_lines = defaultdict(set)\n self.ignored_files = set()\n self.only_once_messages = set()\n self.scope = None\n self.target_module = None\n\n def reset(self) -> None:\n self.initialize()\n\n def copy(self) -> 'Errors':\n new = Errors(self.show_error_context,\n self.show_column_numbers,\n self.show_error_codes,\n self.pretty,\n self.read_source,\n self.show_absolute_path,\n self.enabled_error_codes,\n self.disabled_error_codes)\n new.file = self.file\n new.import_ctx = self.import_ctx[:]\n new.function_or_member = self.function_or_member[:]\n new.target_module = self.target_module\n new.scope = self.scope\n return new", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_Errors.total_errors_Errors.simplify_path.if_self_show_absolute_pat.else_.return.remove_path_prefix_file_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_Errors.total_errors_Errors.simplify_path.if_self_show_absolute_pat.else_.return.remove_path_prefix_file_", "embedding": null, "metadata": {"file_path": "mypy/errors.py", "file_name": "errors.py", "file_type": "text/x-python", "category": "implementation", "start_line": 212, "end_line": 228, "span_ids": ["Errors.simplify_path", "Errors.set_ignore_prefix", "Errors.total_errors"], "tokens": 148}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Errors:\n\n def total_errors(self) -> int:\n return sum(len(errs) for errs in self.error_info_map.values())\n\n def set_ignore_prefix(self, prefix: str) -> None:\n \"\"\"Set path prefix that will be removed from all paths.\"\"\"\n prefix = os.path.normpath(prefix)\n # Add separator to the end, if not given.\n if os.path.basename(prefix) != '':\n prefix += os.sep\n self.ignore_prefix = prefix\n\n def simplify_path(self, file: str) -> str:\n if self.show_absolute_path:\n return os.path.abspath(file)\n else:\n file = os.path.normpath(file)\n return remove_path_prefix(file, self.ignore_prefix)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_Errors.set_file_Errors.set_file.self.scope.scope": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_Errors.set_file_Errors.set_file.self.scope.scope", "embedding": null, "metadata": {"file_path": "mypy/errors.py", "file_name": "errors.py", "file_type": "text/x-python", "category": "implementation", "start_line": 230, "end_line": 242, "span_ids": ["Errors.set_file"], "tokens": 151}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Errors:\n\n def set_file(self, file: str,\n module: Optional[str],\n scope: Optional[Scope] = None) -> None:\n \"\"\"Set the path and module id of the current file.\"\"\"\n # The path will be simplified later, in render_messages. That way\n # * 'file' is always a key that uniquely identifies a source file\n # that mypy read (simplified paths might not be unique); and\n # * we only have to simplify in one place, while still supporting\n # reporting errors for files other than the one currently being\n # processed.\n self.file = file\n self.target_module = module\n self.scope = scope", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_Errors.set_file_ignored_lines_Errors.set_import_context.self.import_ctx.ctx_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_Errors.set_file_ignored_lines_Errors.set_import_context.self.import_ctx.ctx_", "embedding": null, "metadata": {"file_path": "mypy/errors.py", "file_name": "errors.py", "file_type": "text/x-python", "category": "implementation", "start_line": 244, "end_line": 268, "span_ids": ["Errors.import_context", "Errors.set_file_ignored_lines", "Errors.current_target", "Errors.set_import_context", "Errors.current_module"], "tokens": 203}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Errors:\n\n def set_file_ignored_lines(self, file: str,\n ignored_lines: Dict[int, List[str]],\n ignore_all: bool = False) -> None:\n self.ignored_lines[file] = ignored_lines\n if ignore_all:\n self.ignored_files.add(file)\n\n def current_target(self) -> Optional[str]:\n \"\"\"Retrieves the current target from the associated scope.\n\n If there is no associated scope, use the target module.\"\"\"\n if self.scope is not None:\n return self.scope.current_target()\n return self.target_module\n\n def current_module(self) -> Optional[str]:\n return self.target_module\n\n def import_context(self) -> List[Tuple[str, int]]:\n \"\"\"Return a copy of the import context.\"\"\"\n return self.import_ctx[:]\n\n def set_import_context(self, ctx: List[Tuple[str, int]]) -> None:\n \"\"\"Replace the entire import context with a new value.\"\"\"\n self.import_ctx = ctx[:]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_Errors.report_Errors.report.self_add_error_info_info_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_Errors.report_Errors.report.self_add_error_info_info_", "embedding": null, "metadata": {"file_path": "mypy/errors.py", "file_name": "errors.py", "file_type": "text/x-python", "category": "implementation", "start_line": 270, "end_line": 326, "span_ids": ["Errors.report"], "tokens": 442}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Errors:\n\n def report(self,\n line: int,\n column: Optional[int],\n message: str,\n code: Optional[ErrorCode] = None,\n *,\n blocker: bool = False,\n severity: str = 'error',\n file: Optional[str] = None,\n only_once: bool = False,\n origin_line: Optional[int] = None,\n offset: int = 0,\n end_line: Optional[int] = None) -> None:\n \"\"\"Report message at the given line using the current error context.\n\n Args:\n line: line number of error\n column: column number of error\n message: message to report\n code: error code (defaults to 'misc'; not shown for notes)\n blocker: if True, don't continue analysis after this error\n severity: 'error' or 'note'\n file: if non-None, override current file as context\n only_once: if True, only report this exact message once per build\n origin_line: if non-None, override current context as origin\n end_line: if non-None, override current context as end\n \"\"\"\n if self.scope:\n type = self.scope.current_type_name()\n if self.scope.ignored > 0:\n type = None # Omit type context if nested function\n function = self.scope.current_function_name()\n else:\n type = None\n function = None\n\n if column is None:\n column = -1\n if file is None:\n file = self.file\n if offset:\n message = \" \" * offset + message\n\n if origin_line is None:\n origin_line = line\n\n if end_line is None:\n end_line = origin_line\n\n code = code or (codes.MISC if not blocker else None)\n\n info = ErrorInfo(self.import_context(), file, self.current_module(), type,\n function, line, column, severity, message, code,\n blocker, only_once,\n origin=(self.file, origin_line, end_line),\n target=self.current_target())\n self.add_error_info(info)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_Errors._add_error_info_Errors.add_error_info.self__add_error_info_file": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_Errors._add_error_info_Errors.add_error_info.self__add_error_info_file", "embedding": null, "metadata": {"file_path": "mypy/errors.py", "file_name": "errors.py", "file_type": "text/x-python", "category": "implementation", "start_line": 328, "end_line": 357, "span_ids": ["Errors.add_error_info", "Errors._add_error_info"], "tokens": 332}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Errors:\n\n def _add_error_info(self, file: str, info: ErrorInfo) -> None:\n assert file not in self.flushed_files\n if file not in self.error_info_map:\n self.error_info_map[file] = []\n self.error_info_map[file].append(info)\n\n def add_error_info(self, info: ErrorInfo) -> None:\n file, line, end_line = info.origin\n if not info.blocker: # Blockers cannot be ignored\n if file in self.ignored_lines:\n # It's okay if end_line is *before* line.\n # Function definitions do this, for example, because the correct\n # error reporting line is at the *end* of the ignorable range\n # (for compatibility reasons). If so, just flip 'em!\n if end_line < line:\n line, end_line = end_line, line\n # Check each line in this context for \"type: ignore\" comments.\n # line == end_line for most nodes, so we only loop once.\n for scope_line in range(line, end_line + 1):\n if self.is_ignored_error(scope_line, info, self.ignored_lines[file]):\n # Annotation requests us to ignore all errors on this line.\n self.used_ignored_lines[file].add(scope_line)\n return\n if file in self.ignored_files:\n return\n if info.only_once:\n if info.message in self.only_once_messages:\n return\n self.only_once_messages.add(info.message)\n self._add_error_info(file, info)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_Errors.generate_unused_ignore_errors_Errors.generate_unused_ignore_errors.if_not_is_typeshed_file_f.for_line_in_set_ignored_l.self__add_error_info_file": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_Errors.generate_unused_ignore_errors_Errors.generate_unused_ignore_errors.if_not_is_typeshed_file_f.for_line_in_set_ignored_l.self__add_error_info_file", "embedding": null, "metadata": {"file_path": "mypy/errors.py", "file_name": "errors.py", "file_type": "text/x-python", "category": "implementation", "start_line": 390, "end_line": 398, "span_ids": ["Errors.generate_unused_ignore_errors"], "tokens": 132}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Errors:\n\n def generate_unused_ignore_errors(self, file: str) -> None:\n ignored_lines = self.ignored_lines[file]\n if not is_typeshed_file(file) and file not in self.ignored_files:\n for line in set(ignored_lines) - self.used_ignored_lines[file]:\n # Don't use report since add_error_info will ignore the error!\n info = ErrorInfo(self.import_context(), file, self.current_module(), None,\n None, line, -1, 'error', \"unused 'type: ignore' comment\",\n None, False, False)\n self._add_error_info(file, info)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_Errors.num_messages_Errors.raise_error.raise_CompileError_self_n": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_Errors.num_messages_Errors.raise_error.raise_CompileError_self_n", "embedding": null, "metadata": {"file_path": "mypy/errors.py", "file_name": "errors.py", "file_type": "text/x-python", "category": "implementation", "start_line": 403, "end_line": 445, "span_ids": ["Errors.is_errors", "Errors.is_errors_for_file", "Errors.most_recent_error_location", "Errors.raise_error", "Errors.num_messages", "Errors.is_blockers", "Errors.blocker_module", "Errors.is_real_errors"], "tokens": 371}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Errors:\n\n def num_messages(self) -> int:\n \"\"\"Return the number of generated messages.\"\"\"\n return sum(len(x) for x in self.error_info_map.values())\n\n def is_errors(self) -> bool:\n \"\"\"Are there any generated messages?\"\"\"\n return bool(self.error_info_map)\n\n def is_real_errors(self) -> bool:\n \"\"\"Are there any generated errors (not just notes, for example)?\"\"\"\n return any(info.severity == 'error'\n for infos in self.error_info_map.values() for info in infos)\n\n def is_blockers(self) -> bool:\n \"\"\"Are the any errors that are blockers?\"\"\"\n return any(err for errs in self.error_info_map.values() for err in errs if err.blocker)\n\n def blocker_module(self) -> Optional[str]:\n \"\"\"Return the module with a blocking error, or None if not possible.\"\"\"\n for errs in self.error_info_map.values():\n for err in errs:\n if err.blocker:\n return err.module\n return None\n\n def is_errors_for_file(self, file: str) -> bool:\n \"\"\"Are there any errors for the given file?\"\"\"\n return file in self.error_info_map\n\n def most_recent_error_location(self) -> Tuple[int, int]:\n info = self.error_info_map[self.file][-1]\n return info.line, info.column\n\n def raise_error(self, use_stdout: bool = True) -> None:\n \"\"\"Raise a CompileError with the generated messages.\n\n Render the messages suitable for displaying.\n \"\"\"\n # self.new_messages() will format all messages that haven't already\n # been returned from a file_messages() call.\n raise CompileError(self.new_messages(),\n use_stdout=use_stdout,\n module_with_blocker=self.blocker_module())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_Errors.format_messages_Errors.format_messages.return.a": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_Errors.format_messages_Errors.format_messages.return.a", "embedding": null, "metadata": {"file_path": "mypy/errors.py", "file_name": "errors.py", "file_type": "text/x-python", "category": "implementation", "start_line": 439, "end_line": 483, "span_ids": ["Errors.format_messages"], "tokens": 447}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Errors:\n\n def format_messages(self, error_info: List[ErrorInfo],\n source_lines: Optional[List[str]]) -> List[str]:\n \"\"\"Return a string list that represents the error messages.\n\n Use a form suitable for displaying to the user. If self.pretty\n is True also append a relevant trimmed source code line (only for\n severity 'error').\n \"\"\"\n a = [] # type: List[str]\n errors = self.render_messages(self.sort_messages(error_info))\n errors = self.remove_duplicates(errors)\n for file, line, column, severity, message, code in errors:\n s = ''\n if file is not None:\n if self.show_column_numbers and line >= 0 and column >= 0:\n srcloc = '{}:{}:{}'.format(file, line, 1 + column)\n elif line >= 0:\n srcloc = '{}:{}'.format(file, line)\n else:\n srcloc = file\n s = '{}: {}: {}'.format(srcloc, severity, message)\n else:\n s = message\n if self.show_error_codes and code and severity != 'note':\n # If note has an error code, it is related to a previous error. Avoid\n # displaying duplicate error codes.\n s = '{} [{}]'.format(s, code.code)\n a.append(s)\n if self.pretty:\n # Add source code fragment and a location marker.\n if severity == 'error' and source_lines and line > 0:\n source_line = source_lines[line - 1]\n source_line_expanded = source_line.expandtabs()\n if column < 0:\n # Something went wrong, take first non-empty column.\n column = len(source_line) - len(source_line.lstrip())\n\n # Shifts column after tab expansion\n column = len(source_line[:column].expandtabs())\n\n # Note, currently coloring uses the offset to detect source snippets,\n # so these offsets should not be arbitrary.\n a.append(' ' * DEFAULT_SOURCE_OFFSET + source_line_expanded)\n a.append(' ' * (DEFAULT_SOURCE_OFFSET + column) + '^')\n return a", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_Errors.file_messages_Errors.targets.return.set_info_target": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_Errors.file_messages_Errors.targets.return.set_info_target", "embedding": null, "metadata": {"file_path": "mypy/errors.py", "file_name": "errors.py", "file_type": "text/x-python", "category": "implementation", "start_line": 485, "end_line": 519, "span_ids": ["Errors.new_messages", "Errors.targets", "Errors.file_messages"], "tokens": 275}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Errors:\n\n def file_messages(self, path: str) -> List[str]:\n \"\"\"Return a string list of new error messages from a given file.\n\n Use a form suitable for displaying to the user.\n \"\"\"\n if path not in self.error_info_map:\n return []\n self.flushed_files.add(path)\n source_lines = None\n if self.pretty:\n assert self.read_source\n source_lines = self.read_source(path)\n return self.format_messages(self.error_info_map[path], source_lines)\n\n def new_messages(self) -> List[str]:\n \"\"\"Return a string list of new error messages.\n\n Use a form suitable for displaying to the user.\n Errors from different files are ordered based on the order in which\n they first generated an error.\n \"\"\"\n msgs = []\n for path in self.error_info_map.keys():\n if path not in self.flushed_files:\n msgs.extend(self.file_messages(path))\n return msgs\n\n def targets(self) -> Set[str]:\n \"\"\"Return a set of all targets that contain errors.\"\"\"\n # TODO: Make sure that either target is always defined or that not being defined\n # is okay for fine-grained incremental checking.\n return set(info.target\n for errs in self.error_info_map.values()\n for info in errs\n if info.target)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_Errors.render_messages_Errors.render_messages.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_Errors.render_messages_Errors.render_messages.return.result", "embedding": null, "metadata": {"file_path": "mypy/errors.py", "file_name": "errors.py", "file_type": "text/x-python", "category": "implementation", "start_line": 521, "end_line": 592, "span_ids": ["Errors.render_messages"], "tokens": 658}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Errors:\n\n def render_messages(self,\n errors: List[ErrorInfo]) -> List[ErrorTuple]:\n \"\"\"Translate the messages into a sequence of tuples.\n\n Each tuple is of form (path, line, col, severity, message, code).\n The rendered sequence includes information about error contexts.\n The path item may be None. If the line item is negative, the\n line number is not defined for the tuple.\n \"\"\"\n result = [] # type: List[ErrorTuple]\n prev_import_context = [] # type: List[Tuple[str, int]]\n prev_function_or_member = None # type: Optional[str]\n prev_type = None # type: Optional[str]\n\n for e in errors:\n # Report module import context, if different from previous message.\n if not self.show_error_context:\n pass\n elif e.import_ctx != prev_import_context:\n last = len(e.import_ctx) - 1\n i = last\n while i >= 0:\n path, line = e.import_ctx[i]\n fmt = '{}:{}: note: In module imported here'\n if i < last:\n fmt = '{}:{}: note: ... from here'\n if i > 0:\n fmt += ','\n else:\n fmt += ':'\n # Remove prefix to ignore from path (if present) to\n # simplify path.\n path = remove_path_prefix(path, self.ignore_prefix)\n result.append((None, -1, -1, 'note', fmt.format(path, line), None))\n i -= 1\n\n file = self.simplify_path(e.file)\n\n # Report context within a source file.\n if not self.show_error_context:\n pass\n elif (e.function_or_member != prev_function_or_member or\n e.type != prev_type):\n if e.function_or_member is None:\n if e.type is None:\n result.append((file, -1, -1, 'note', 'At top level:', None))\n else:\n result.append((file, -1, -1, 'note', 'In class \"{}\":'.format(\n e.type), None))\n else:\n if e.type is None:\n result.append((file, -1, -1, 'note',\n 'In function \"{}\":'.format(\n e.function_or_member), None))\n else:\n result.append((file, -1, -1, 'note',\n 'In member \"{}\" of class \"{}\":'.format(\n e.function_or_member, e.type), None))\n elif e.type != prev_type:\n if e.type is None:\n result.append((file, -1, -1, 'note', 'At top level:', None))\n else:\n result.append((file, -1, -1, 'note',\n 'In class \"{}\":'.format(e.type), None))\n\n result.append((file, e.line, e.column, e.severity, e.message, e.code))\n\n prev_import_context = e.import_ctx\n prev_function_or_member = e.function_or_member\n prev_type = e.type\n\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_Errors.sort_messages_Errors.sort_messages.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_Errors.sort_messages_Errors.sort_messages.return.result", "embedding": null, "metadata": {"file_path": "mypy/errors.py", "file_name": "errors.py", "file_type": "text/x-python", "category": "implementation", "start_line": 594, "end_line": 615, "span_ids": ["Errors.sort_messages"], "tokens": 213}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Errors:\n\n def sort_messages(self, errors: List[ErrorInfo]) -> List[ErrorInfo]:\n \"\"\"Sort an array of error messages locally by line number.\n\n I.e., sort a run of consecutive messages with the same\n context by line number, but otherwise retain the general\n ordering of the messages.\n \"\"\"\n result = [] # type: List[ErrorInfo]\n i = 0\n while i < len(errors):\n i0 = i\n # Find neighbouring errors with the same context and file.\n while (i + 1 < len(errors) and\n errors[i + 1].import_ctx == errors[i].import_ctx and\n errors[i + 1].file == errors[i].file):\n i += 1\n i += 1\n\n # Sort the errors specific to a file according to line number and column.\n a = sorted(errors[i0:i], key=lambda x: (x.line, x.column))\n result.extend(a)\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_Errors.remove_duplicates_Errors.remove_duplicates.return.res": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_Errors.remove_duplicates_Errors.remove_duplicates.return.res", "embedding": null, "metadata": {"file_path": "mypy/errors.py", "file_name": "errors.py", "file_type": "text/x-python", "category": "implementation", "start_line": 617, "end_line": 646, "span_ids": ["Errors.remove_duplicates"], "tokens": 298}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Errors:\n\n def remove_duplicates(self, errors: List[ErrorTuple]) -> List[ErrorTuple]:\n \"\"\"Remove duplicates from a sorted error list.\"\"\"\n res = [] # type: List[ErrorTuple]\n i = 0\n while i < len(errors):\n dup = False\n # Use slightly special formatting for member conflicts reporting.\n conflicts_notes = False\n j = i - 1\n while j >= 0 and errors[j][0] == errors[i][0]:\n if errors[j][4].strip() == 'Got:':\n conflicts_notes = True\n j -= 1\n j = i - 1\n while (j >= 0 and errors[j][0] == errors[i][0] and\n errors[j][1] == errors[i][1]):\n if (errors[j][3] == errors[i][3] and\n # Allow duplicate notes in overload conflicts reporting.\n not ((errors[i][3] == 'note' and\n errors[i][4].strip() in allowed_duplicates)\n or (errors[i][4].strip().startswith('def ') and\n conflicts_notes)) and\n errors[j][4] == errors[i][4]): # ignore column\n dup = True\n break\n j -= 1\n if not dup:\n res.append(errors[i])\n i += 1\n return res", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_CompileError_remove_path_prefix.if_prefix_is_not_None_and.else_.return.path": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_CompileError_remove_path_prefix.if_prefix_is_not_None_and.else_.return.path", "embedding": null, "metadata": {"file_path": "mypy/errors.py", "file_name": "errors.py", "file_type": "text/x-python", "category": "implementation", "start_line": 649, "end_line": 684, "span_ids": ["CompileError", "remove_path_prefix", "CompileError.__init__"], "tokens": 286}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CompileError(Exception):\n \"\"\"Exception raised when there is a compile error.\n\n It can be a parse, semantic analysis, type check or other\n compilation-related error.\n\n CompileErrors raised from an errors object carry all of the\n messages that have not been reported out by error streaming.\n This is patched up by build.build to contain either all error\n messages (if errors were streamed) or none (if they were not).\n\n \"\"\"\n\n messages = None # type: List[str]\n use_stdout = False\n # Can be set in case there was a module with a blocking error\n module_with_blocker = None # type: Optional[str]\n\n def __init__(self,\n messages: List[str],\n use_stdout: bool = False,\n module_with_blocker: Optional[str] = None) -> None:\n super().__init__('\\n'.join(messages))\n self.messages = messages\n self.use_stdout = use_stdout\n self.module_with_blocker = module_with_blocker\n\n\ndef remove_path_prefix(path: str, prefix: Optional[str]) -> str:\n \"\"\"If path starts with prefix, return copy of path with the prefix removed.\n Otherwise, return path. If path is None, return None.\n \"\"\"\n if prefix is not None and path.startswith(prefix):\n return path[len(prefix):]\n else:\n return path", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_report_internal_error_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_report_internal_error_", "embedding": null, "metadata": {"file_path": "mypy/errors.py", "file_name": "errors.py", "file_type": "text/x-python", "category": "implementation", "start_line": 690, "end_line": 763, "span_ids": ["report_internal_error"], "tokens": 607}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def report_internal_error(err: Exception,\n file: Optional[str],\n line: int,\n errors: Errors,\n options: Options,\n stdout: Optional[TextIO] = None,\n stderr: Optional[TextIO] = None,\n ) -> None:\n \"\"\"Report internal error and exit.\n\n This optionally starts pdb or shows a traceback.\n \"\"\"\n stdout = (stdout or sys.stdout)\n stderr = (stderr or sys.stderr)\n # Dump out errors so far, they often provide a clue.\n # But catch unexpected errors rendering them.\n try:\n for msg in errors.new_messages():\n print(msg)\n except Exception as e:\n print(\"Failed to dump errors:\", repr(e), file=stderr)\n\n # Compute file:line prefix for official-looking error messages.\n if file:\n if line:\n prefix = '{}:{}: '.format(file, line)\n else:\n prefix = '{}: '.format(file)\n else:\n prefix = ''\n\n # Print \"INTERNAL ERROR\" message.\n print('{}error: INTERNAL ERROR --'.format(prefix),\n 'Please try using mypy master on Github:\\n'\n 'https://mypy.readthedocs.io/en/stable/common_issues.html'\n '#using-a-development-mypy-build',\n file=stderr)\n if options.show_traceback:\n print('Please report a bug at https://github.com/python/mypy/issues',\n file=stderr)\n else:\n print('If this issue continues with mypy master, '\n 'please report a bug at https://github.com/python/mypy/issues',\n file=stderr)\n print('version: {}'.format(mypy_version),\n file=stderr)\n\n # If requested, drop into pdb. This overrides show_tb.\n if options.pdb:\n print('Dropping into pdb', file=stderr)\n import pdb\n pdb.post_mortem(sys.exc_info()[2])\n\n # If requested, print traceback, else print note explaining how to get one.\n if options.raise_exceptions:\n raise err\n if not options.show_traceback:\n if not options.pdb:\n print('{}: note: please use --show-traceback to print a traceback '\n 'when reporting a bug'.format(prefix),\n file=stderr)\n else:\n tb = traceback.extract_stack()[:-2]\n tb2 = traceback.extract_tb(sys.exc_info()[2])\n print('Traceback (most recent call last):')\n for s in traceback.format_list(tb + tb2):\n print(s.rstrip('\\n'))\n print('{}: {}'.format(type(err).__name__, err), file=stdout)\n print('{}: note: use --pdb to drop into pdb'.format(prefix), file=stderr)\n\n # Exit. The caller has nothing more to say.\n # We use exit code 2 to signal that this is no ordinary error.\n raise SystemExit(2)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/expandtype.py_from_typing_import_Dict__expand_type.return.typ_accept_ExpandTypeVisi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/expandtype.py_from_typing_import_Dict__expand_type.return.typ_accept_ExpandTypeVisi", "embedding": null, "metadata": {"file_path": "mypy/expandtype.py", "file_name": "expandtype.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 16, "span_ids": ["imports", "expand_type"], "tokens": 178}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from typing import Dict, Iterable, List, TypeVar, Mapping, cast\n\nfrom mypy.types import (\n Type, Instance, CallableType, TypeVisitor, UnboundType, AnyType,\n NoneType, TypeVarType, Overloaded, TupleType, TypedDictType, UnionType,\n ErasedType, PartialType, DeletedType, UninhabitedType, TypeType, TypeVarId,\n FunctionLike, TypeVarDef, LiteralType, get_proper_type, ProperType,\n TypeAliasType)\n\n\ndef expand_type(typ: Type, env: Mapping[TypeVarId, Type]) -> Type:\n \"\"\"Substitute any type variable references in a type given by a type\n environment.\n \"\"\"\n # TODO: use an overloaded signature? (ProperType stays proper after expansion.)\n return typ.accept(ExpandTypeVisitor(env))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/expandtype.py_expand_type_by_instance_F.TypeVar_F_bound_Functi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/expandtype.py_expand_type_by_instance_F.TypeVar_F_bound_Functi", "embedding": null, "metadata": {"file_path": "mypy/expandtype.py", "file_name": "expandtype.py", "file_type": "text/x-python", "category": "implementation", "start_line": 19, "end_line": 32, "span_ids": ["impl", "expand_type_by_instance"], "tokens": 136}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def expand_type_by_instance(typ: Type, instance: Instance) -> Type:\n \"\"\"Substitute type variables in type using values from an Instance.\n Type variables are considered to be bound by the class declaration.\"\"\"\n # TODO: use an overloaded signature? (ProperType stays proper after expansion.)\n if not instance.args:\n return typ\n else:\n variables = {} # type: Dict[TypeVarId, Type]\n for binder, arg in zip(instance.type.defn.type_vars, instance.args):\n variables[binder.id] = arg\n return expand_type(typ, variables)\n\n\nF = TypeVar('F', bound=FunctionLike)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/expandtype.py_freshen_function_type_vars_freshen_function_type_vars.if_isinstance_callee_Cal.else_.return.cast_F_fresh_overload_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/expandtype.py_freshen_function_type_vars_freshen_function_type_vars.if_isinstance_callee_Cal.else_.return.cast_F_fresh_overload_", "embedding": null, "metadata": {"file_path": "mypy/expandtype.py", "file_name": "expandtype.py", "file_type": "text/x-python", "category": "implementation", "start_line": 35, "end_line": 54, "span_ids": ["freshen_function_type_vars"], "tokens": 208}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def freshen_function_type_vars(callee: F) -> F:\n \"\"\"Substitute fresh type variables for generic function type variables.\"\"\"\n if isinstance(callee, CallableType):\n if not callee.is_generic():\n return cast(F, callee)\n tvdefs = []\n tvmap = {} # type: Dict[TypeVarId, Type]\n for v in callee.variables:\n # TODO(shantanu): fix for ParamSpecDef\n assert isinstance(v, TypeVarDef)\n tvdef = TypeVarDef.new_unification_variable(v)\n tvdefs.append(tvdef)\n tvmap[v.id] = TypeVarType(tvdef)\n fresh = cast(CallableType, expand_type(callee, tvmap)).copy_modified(variables=tvdefs)\n return cast(F, fresh)\n else:\n assert isinstance(callee, Overloaded)\n fresh_overload = Overloaded([freshen_function_type_vars(item)\n for item in callee.items()])\n return cast(F, fresh_overload)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/expandtype.py_ExpandTypeVisitor_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/expandtype.py_ExpandTypeVisitor_", "embedding": null, "metadata": {"file_path": "mypy/expandtype.py", "file_name": "expandtype.py", "file_type": "text/x-python", "category": "implementation", "start_line": 57, "end_line": 149, "span_ids": ["ExpandTypeVisitor.visit_type_alias_type", "ExpandTypeVisitor.visit_union_type", "ExpandTypeVisitor.visit_deleted_type", "ExpandTypeVisitor.__init__", "ExpandTypeVisitor.visit_instance", "ExpandTypeVisitor.visit_type_type", "ExpandTypeVisitor.visit_none_type", "ExpandTypeVisitor.visit_tuple_type", "ExpandTypeVisitor.visit_typeddict_type", "ExpandTypeVisitor.visit_literal_type", "ExpandTypeVisitor.visit_callable_type", "ExpandTypeVisitor.visit_type_var", "ExpandTypeVisitor.visit_erased_type", "ExpandTypeVisitor.expand_types", "ExpandTypeVisitor.visit_overloaded", "ExpandTypeVisitor.visit_uninhabited_type", "ExpandTypeVisitor.visit_any", "ExpandTypeVisitor", "ExpandTypeVisitor.visit_unbound_type", "ExpandTypeVisitor.visit_partial_type"], "tokens": 801}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpandTypeVisitor(TypeVisitor[Type]):\n \"\"\"Visitor that substitutes type variables with values.\"\"\"\n\n variables = None # type: Mapping[TypeVarId, Type] # TypeVar id -> TypeVar value\n\n def __init__(self, variables: Mapping[TypeVarId, Type]) -> None:\n self.variables = variables\n\n def visit_unbound_type(self, t: UnboundType) -> Type:\n return t\n\n def visit_any(self, t: AnyType) -> Type:\n return t\n\n def visit_none_type(self, t: NoneType) -> Type:\n return t\n\n def visit_uninhabited_type(self, t: UninhabitedType) -> Type:\n return t\n\n def visit_deleted_type(self, t: DeletedType) -> Type:\n return t\n\n def visit_erased_type(self, t: ErasedType) -> Type:\n # Should not get here.\n raise RuntimeError()\n\n def visit_instance(self, t: Instance) -> Type:\n args = self.expand_types(t.args)\n return Instance(t.type, args, t.line, t.column)\n\n def visit_type_var(self, t: TypeVarType) -> Type:\n repl = get_proper_type(self.variables.get(t.id, t))\n if isinstance(repl, Instance):\n inst = repl\n # Return copy of instance with type erasure flag on.\n return Instance(inst.type, inst.args, line=inst.line,\n column=inst.column, erased=True)\n else:\n return repl\n\n def visit_callable_type(self, t: CallableType) -> Type:\n return t.copy_modified(arg_types=self.expand_types(t.arg_types),\n ret_type=t.ret_type.accept(self),\n type_guard=(t.type_guard.accept(self)\n if t.type_guard is not None else None))\n\n def visit_overloaded(self, t: Overloaded) -> Type:\n items = [] # type: List[CallableType]\n for item in t.items():\n new_item = item.accept(self)\n assert isinstance(new_item, ProperType)\n assert isinstance(new_item, CallableType)\n items.append(new_item)\n return Overloaded(items)\n\n def visit_tuple_type(self, t: TupleType) -> Type:\n return t.copy_modified(items=self.expand_types(t.items))\n\n def visit_typeddict_type(self, t: TypedDictType) -> Type:\n return t.copy_modified(item_types=self.expand_types(t.items.values()))\n\n def visit_literal_type(self, t: LiteralType) -> Type:\n # TODO: Verify this implementation is correct\n return t\n\n def visit_union_type(self, t: UnionType) -> Type:\n # After substituting for type variables in t.items,\n # some of the resulting types might be subtypes of others.\n from mypy.typeops import make_simplified_union # asdf\n return make_simplified_union(self.expand_types(t.items), t.line, t.column)\n\n def visit_partial_type(self, t: PartialType) -> Type:\n return t\n\n def visit_type_type(self, t: TypeType) -> Type:\n # TODO: Verify that the new item type is valid (instance or\n # union of instances or Any). Sadly we can't report errors\n # here yet.\n item = t.item.accept(self)\n return TypeType.make_normalized(item)\n\n def visit_type_alias_type(self, t: TypeAliasType) -> Type:\n # Target of the type alias cannot contain type variables,\n # so we just expand the arguments.\n return t.copy_modified(args=self.expand_types(t.args))\n\n def expand_types(self, types: Iterable[Type]) -> List[Type]:\n a = [] # type: List[Type]\n for t in types:\n a.append(t.accept(self))\n return a", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/exprtotype.py__Translate_an_Expressio__extract_argument_name.if_isinstance_expr_NameE.else_.raise_TypeTranslationErro": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/exprtotype.py__Translate_an_Expressio__extract_argument_name.if_isinstance_expr_NameE.else_.raise_TypeTranslationErro", "embedding": null, "metadata": {"file_path": "mypy/exprtotype.py", "file_name": "exprtotype.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 29, "span_ids": ["TypeTranslationError", "_extract_argument_name", "docstring"], "tokens": 215}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Translate an Expression to a Type value.\"\"\"\n\nfrom typing import Optional\n\nfrom mypy.nodes import (\n Expression, NameExpr, MemberExpr, IndexExpr, RefExpr, TupleExpr, IntExpr, FloatExpr, UnaryExpr,\n ComplexExpr, ListExpr, StrExpr, BytesExpr, UnicodeExpr, EllipsisExpr, CallExpr,\n get_member_expr_fullname\n)\nfrom mypy.fastparse import parse_type_string\nfrom mypy.types import (\n Type, UnboundType, TypeList, EllipsisType, AnyType, CallableArgument, TypeOfAny,\n RawExpressionType, ProperType\n)\n\n\nclass TypeTranslationError(Exception):\n \"\"\"Exception raised when an expression is not valid as a type.\"\"\"\n\n\ndef _extract_argument_name(expr: Expression) -> Optional[str]:\n if isinstance(expr, NameExpr) and expr.name == 'None':\n return None\n elif isinstance(expr, StrExpr):\n return expr.value\n elif isinstance(expr, UnicodeExpr):\n return expr.value\n else:\n raise TypeTranslationError()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/exprtotype.py_expr_to_unanalyzed_type_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/exprtotype.py_expr_to_unanalyzed_type_", "embedding": null, "metadata": {"file_path": "mypy/exprtotype.py", "file_name": "exprtotype.py", "file_type": "text/x-python", "category": "implementation", "start_line": 32, "end_line": 155, "span_ids": ["expr_to_unanalyzed_type"], "tokens": 1157}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def expr_to_unanalyzed_type(expr: Expression, _parent: Optional[Expression] = None) -> ProperType:\n \"\"\"Translate an expression to the corresponding type.\n\n The result is not semantically analyzed. It can be UnboundType or TypeList.\n Raise TypeTranslationError if the expression cannot represent a type.\n \"\"\"\n # The `parent` parameter is used in recursive calls to provide context for\n # understanding whether an CallableArgument is ok.\n name = None # type: Optional[str]\n if isinstance(expr, NameExpr):\n name = expr.name\n if name == 'True':\n return RawExpressionType(True, 'builtins.bool', line=expr.line, column=expr.column)\n elif name == 'False':\n return RawExpressionType(False, 'builtins.bool', line=expr.line, column=expr.column)\n else:\n return UnboundType(name, line=expr.line, column=expr.column)\n elif isinstance(expr, MemberExpr):\n fullname = get_member_expr_fullname(expr)\n if fullname:\n return UnboundType(fullname, line=expr.line, column=expr.column)\n else:\n raise TypeTranslationError()\n elif isinstance(expr, IndexExpr):\n base = expr_to_unanalyzed_type(expr.base, expr)\n if isinstance(base, UnboundType):\n if base.args:\n raise TypeTranslationError()\n if isinstance(expr.index, TupleExpr):\n args = expr.index.items\n else:\n args = [expr.index]\n\n if isinstance(expr.base, RefExpr) and expr.base.fullname in [\n 'typing.Annotated', 'typing_extensions.Annotated'\n ]:\n # TODO: this is not the optimal solution as we are basically getting rid\n # of the Annotation definition and only returning the type information,\n # losing all the annotations.\n\n return expr_to_unanalyzed_type(args[0], expr)\n else:\n base.args = tuple(expr_to_unanalyzed_type(arg, expr) for arg in args)\n if not base.args:\n base.empty_tuple_index = True\n return base\n else:\n raise TypeTranslationError()\n elif isinstance(expr, CallExpr) and isinstance(_parent, ListExpr):\n c = expr.callee\n names = []\n # Go through the dotted member expr chain to get the full arg\n # constructor name to look up\n while True:\n if isinstance(c, NameExpr):\n names.append(c.name)\n break\n elif isinstance(c, MemberExpr):\n names.append(c.name)\n c = c.expr\n else:\n raise TypeTranslationError()\n arg_const = '.'.join(reversed(names))\n\n # Go through the constructor args to get its name and type.\n name = None\n default_type = AnyType(TypeOfAny.unannotated)\n typ = default_type # type: Type\n for i, arg in enumerate(expr.args):\n if expr.arg_names[i] is not None:\n if expr.arg_names[i] == \"name\":\n if name is not None:\n # Two names\n raise TypeTranslationError()\n name = _extract_argument_name(arg)\n continue\n elif expr.arg_names[i] == \"type\":\n if typ is not default_type:\n # Two types\n raise TypeTranslationError()\n typ = expr_to_unanalyzed_type(arg, expr)\n continue\n else:\n raise TypeTranslationError()\n elif i == 0:\n typ = expr_to_unanalyzed_type(arg, expr)\n elif i == 1:\n name = _extract_argument_name(arg)\n else:\n raise TypeTranslationError()\n return CallableArgument(typ, name, arg_const, expr.line, expr.column)\n elif isinstance(expr, ListExpr):\n return TypeList([expr_to_unanalyzed_type(t, expr) for t in expr.items],\n line=expr.line, column=expr.column)\n elif isinstance(expr, StrExpr):\n return parse_type_string(expr.value, 'builtins.str', expr.line, expr.column,\n assume_str_is_unicode=expr.from_python_3)\n elif isinstance(expr, BytesExpr):\n return parse_type_string(expr.value, 'builtins.bytes', expr.line, expr.column,\n assume_str_is_unicode=False)\n elif isinstance(expr, UnicodeExpr):\n return parse_type_string(expr.value, 'builtins.unicode', expr.line, expr.column,\n assume_str_is_unicode=True)\n elif isinstance(expr, UnaryExpr):\n typ = expr_to_unanalyzed_type(expr.expr)\n if isinstance(typ, RawExpressionType):\n if isinstance(typ.literal_value, int) and expr.op == '-':\n typ.literal_value *= -1\n return typ\n raise TypeTranslationError()\n elif isinstance(expr, IntExpr):\n return RawExpressionType(expr.value, 'builtins.int', line=expr.line, column=expr.column)\n elif isinstance(expr, FloatExpr):\n # Floats are not valid parameters for RawExpressionType , so we just\n # pass in 'None' for now. We'll report the appropriate error at a later stage.\n return RawExpressionType(None, 'builtins.float', line=expr.line, column=expr.column)\n elif isinstance(expr, ComplexExpr):\n # Same thing as above with complex numbers.\n return RawExpressionType(None, 'builtins.complex', line=expr.line, column=expr.column)\n elif isinstance(expr, EllipsisExpr):\n return EllipsisType(expr.line)\n else:\n raise TypeTranslationError()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_re_from_mypy_reachability_im": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_re_from_mypy_reachability_im", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 40, "span_ids": ["imports"], "tokens": 429}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import re\nimport sys\nimport warnings\n\nimport typing # for typing.Type, which conflicts with types.Type\nfrom typing import (\n Tuple, Union, TypeVar, Callable, Sequence, Optional, Any, Dict, cast, List, overload\n)\nfrom typing_extensions import Final, Literal, overload\n\nfrom mypy.sharedparse import (\n special_function_elide_names, argument_elide_name,\n)\nfrom mypy.nodes import (\n MypyFile, Node, ImportBase, Import, ImportAll, ImportFrom, FuncDef,\n OverloadedFuncDef, OverloadPart,\n ClassDef, Decorator, Block, Var, OperatorAssignmentStmt,\n ExpressionStmt, AssignmentStmt, ReturnStmt, RaiseStmt, AssertStmt,\n DelStmt, BreakStmt, ContinueStmt, PassStmt, GlobalDecl,\n WhileStmt, ForStmt, IfStmt, TryStmt, WithStmt,\n TupleExpr, GeneratorExpr, ListComprehension, ListExpr, ConditionalExpr,\n DictExpr, SetExpr, NameExpr, IntExpr, StrExpr, BytesExpr, UnicodeExpr,\n FloatExpr, CallExpr, SuperExpr, MemberExpr, IndexExpr, SliceExpr, OpExpr,\n UnaryExpr, LambdaExpr, ComparisonExpr, AssignmentExpr,\n StarExpr, YieldFromExpr, NonlocalDecl, DictionaryComprehension,\n SetComprehension, ComplexExpr, EllipsisExpr, YieldExpr, Argument,\n AwaitExpr, TempNode, Expression, Statement,\n ARG_POS, ARG_OPT, ARG_STAR, ARG_NAMED, ARG_NAMED_OPT, ARG_STAR2,\n check_arg_names,\n FakeInfo,\n)\nfrom mypy.types import (\n Type, CallableType, AnyType, UnboundType, TupleType, TypeList, EllipsisType, CallableArgument,\n TypeOfAny, Instance, RawExpressionType, ProperType, UnionType,\n)\nfrom mypy import defaults\nfrom mypy import message_registry, errorcodes as codes\nfrom mypy.errors import Errors\nfrom mypy.options import Options\nfrom mypy.reachability import mark_block_unreachable", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_try__TYPE_IGNORE_PATTERN.re_compile_r_s_typ": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_try__TYPE_IGNORE_PATTERN.re_compile_r_s_typ", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 42, "end_line": 132, "span_ids": ["impl:22", "imports"], "tokens": 734}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "try:\n # pull this into a final variable to make mypyc be quiet about the\n # the default argument warning\n PY_MINOR_VERSION = sys.version_info[1] # type: Final\n\n # Check if we can use the stdlib ast module instead of typed_ast.\n if sys.version_info >= (3, 8):\n import ast as ast3\n assert 'kind' in ast3.Constant._fields, \\\n \"This 3.8.0 alpha (%s) is too old; 3.8.0a3 required\" % sys.version.split()[0]\n # TODO: Num, Str, Bytes, NameConstant, Ellipsis are deprecated in 3.8.\n # TODO: Index, ExtSlice are deprecated in 3.9.\n from ast import (\n AST,\n Call,\n FunctionType,\n Name,\n Attribute,\n Ellipsis as ast3_Ellipsis,\n Starred,\n NameConstant,\n Expression as ast3_Expression,\n Str,\n Bytes,\n Index,\n Num,\n UnaryOp,\n USub,\n )\n\n def ast3_parse(source: Union[str, bytes], filename: str, mode: str,\n feature_version: int = PY_MINOR_VERSION) -> AST:\n return ast3.parse(source, filename, mode,\n type_comments=True, # This works the magic\n feature_version=feature_version)\n\n NamedExpr = ast3.NamedExpr\n Constant = ast3.Constant\n else:\n from typed_ast import ast3\n from typed_ast.ast3 import (\n AST,\n Call,\n FunctionType,\n Name,\n Attribute,\n Ellipsis as ast3_Ellipsis,\n Starred,\n NameConstant,\n Expression as ast3_Expression,\n Str,\n Bytes,\n Index,\n Num,\n UnaryOp,\n USub,\n )\n\n def ast3_parse(source: Union[str, bytes], filename: str, mode: str,\n feature_version: int = PY_MINOR_VERSION) -> AST:\n return ast3.parse(source, filename, mode, feature_version=feature_version)\n\n # These don't exist before 3.8\n NamedExpr = Any\n Constant = Any\nexcept ImportError:\n try:\n from typed_ast import ast35 # type: ignore[attr-defined] # noqa: F401\n except ImportError:\n print('The typed_ast package is not installed.\\n'\n 'You can install it with `python3 -m pip install typed-ast`.',\n file=sys.stderr)\n else:\n print('You need a more recent version of the typed_ast package.\\n'\n 'You can update to the latest version with '\n '`python3 -m pip install -U typed-ast`.',\n file=sys.stderr)\n sys.exit(1)\n\nN = TypeVar('N', bound=Node)\n\n# There is no way to create reasonable fallbacks at this stage,\n# they must be patched later.\nMISSING_FALLBACK = FakeInfo(\"fallback can't be filled out until semanal\") # type: Final\n_dummy_fallback = Instance(MISSING_FALLBACK, [], -1) # type: Final\n\nTYPE_COMMENT_SYNTAX_ERROR = 'syntax error in type comment' # type: Final\n\nINVALID_TYPE_IGNORE = 'Invalid \"type: ignore\" comment' # type: Final\n\nTYPE_IGNORE_PATTERN = re.compile(r'[^#]*#\\s*type:\\s*ignore\\s*(.*)')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_parse_parse.return.tree": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_parse_parse.return.tree", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 135, "end_line": 186, "span_ids": ["parse"], "tokens": 464}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def parse(source: Union[str, bytes],\n fnam: str,\n module: Optional[str],\n errors: Optional[Errors] = None,\n options: Optional[Options] = None) -> MypyFile:\n\n \"\"\"Parse a source file, without doing any semantic analysis.\n\n Return the parse tree. If errors is not provided, raise ParseError\n on failure. Otherwise, use the errors object to report parse errors.\n \"\"\"\n raise_on_error = False\n if errors is None:\n errors = Errors()\n raise_on_error = True\n if options is None:\n options = Options()\n errors.set_file(fnam, module)\n is_stub_file = fnam.endswith('.pyi')\n try:\n if is_stub_file:\n feature_version = defaults.PYTHON3_VERSION[1]\n else:\n assert options.python_version[0] >= 3\n feature_version = options.python_version[1]\n # Disable deprecation warnings about \\u\n with warnings.catch_warnings():\n warnings.filterwarnings(\"ignore\", category=DeprecationWarning)\n ast = ast3_parse(source, fnam, 'exec', feature_version=feature_version)\n\n tree = ASTConverter(options=options,\n is_stub=is_stub_file,\n errors=errors,\n ).visit(ast)\n tree.path = fnam\n tree.is_stub = is_stub_file\n except SyntaxError as e:\n # alias to please mypyc\n is_py38_or_earlier = sys.version_info < (3, 9)\n if is_py38_or_earlier and e.filename == \"\":\n # In Python 3.8 and earlier, syntax errors in f-strings have lineno relative to the\n # start of the f-string. This would be misleading, as mypy will report the error as the\n # lineno within the file.\n e.lineno = None\n errors.report(e.lineno if e.lineno is not None else -1, e.offset, e.msg, blocker=True,\n code=codes.SYNTAX)\n tree = MypyFile([], [], False, {})\n\n if raise_on_error and errors.is_errors():\n errors.raise_error()\n\n return tree", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_parse_type_ignore_tag_parse_type_ignore_tag.return._code_strip_for_code_in": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_parse_type_ignore_tag_parse_type_ignore_tag.return._code_strip_for_code_in", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 189, "end_line": 204, "span_ids": ["parse_type_ignore_tag"], "tokens": 161}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def parse_type_ignore_tag(tag: Optional[str]) -> Optional[List[str]]:\n \"\"\"Parse optional \"[code, ...]\" tag after \"# type: ignore\".\n\n Return:\n * [] if no tag was found (ignore all errors)\n * list of ignored error codes if a tag was found\n * None if the tag was invalid.\n \"\"\"\n if not tag or tag.strip() == '' or tag.strip().startswith('#'):\n # No tag -- ignore all errors.\n return []\n m = re.match(r'\\s*\\[([^]#]*)\\]\\s*(#.*)?$', tag)\n if m is None:\n # Invalid \"# type: ignore\" comment.\n return None\n return [code.strip() for code in m.group(1).split(',')]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_parse_type_comment_parse_type_comment.try_.else_.return.ignored_converted": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_parse_type_comment_parse_type_comment.try_.else_.return.ignored_converted", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 207, "end_line": 246, "span_ids": ["parse_type_comment"], "tokens": 344}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def parse_type_comment(type_comment: str,\n line: int,\n column: int,\n errors: Optional[Errors],\n assume_str_is_unicode: bool = True,\n ) -> Tuple[Optional[List[str]], Optional[ProperType]]:\n \"\"\"Parse type portion of a type comment (+ optional type ignore).\n\n Return (ignore info, parsed type).\n \"\"\"\n try:\n typ = ast3_parse(type_comment, '', 'eval')\n except SyntaxError:\n if errors is not None:\n stripped_type = type_comment.split(\"#\", 2)[0].strip()\n err_msg = '{} \"{}\"'.format(TYPE_COMMENT_SYNTAX_ERROR, stripped_type)\n errors.report(line, column, err_msg, blocker=True, code=codes.SYNTAX)\n return None, None\n else:\n raise\n else:\n extra_ignore = TYPE_IGNORE_PATTERN.match(type_comment)\n if extra_ignore:\n # Typeshed has a non-optional return type for group!\n tag = cast(Any, extra_ignore).group(1) # type: Optional[str]\n ignored = parse_type_ignore_tag(tag) # type: Optional[List[str]]\n if ignored is None:\n if errors is not None:\n errors.report(line, column, INVALID_TYPE_IGNORE, code=codes.SYNTAX)\n else:\n raise SyntaxError\n else:\n ignored = None\n assert isinstance(typ, ast3_Expression)\n converted = TypeConverter(errors,\n line=line,\n override_column=column,\n assume_str_is_unicode=assume_str_is_unicode,\n is_evaluated=False).visit(typ.body)\n return ignored, converted", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_parse_type_string_is_no_type_check_decorator.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_parse_type_string_is_no_type_check_decorator.return.False", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 249, "end_line": 288, "span_ids": ["parse_type_string", "is_no_type_check_decorator"], "tokens": 438}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def parse_type_string(expr_string: str, expr_fallback_name: str,\n line: int, column: int, assume_str_is_unicode: bool = True) -> ProperType:\n \"\"\"Parses a type that was originally present inside of an explicit string,\n byte string, or unicode string.\n\n For example, suppose we have the type `Foo[\"blah\"]`. We should parse the\n string expression \"blah\" using this function.\n\n If `assume_str_is_unicode` is set to true, this function will assume that\n `Foo[\"blah\"]` is equivalent to `Foo[u\"blah\"]`. Otherwise, it assumes it's\n equivalent to `Foo[b\"blah\"]`.\n\n The caller is responsible for keeping track of the context in which the\n type string was encountered (e.g. in Python 3 code, Python 2 code, Python 2\n code with unicode_literals...) and setting `assume_str_is_unicode` accordingly.\n \"\"\"\n try:\n _, node = parse_type_comment(expr_string.strip(), line=line, column=column, errors=None,\n assume_str_is_unicode=assume_str_is_unicode)\n if isinstance(node, UnboundType) and node.original_str_expr is None:\n node.original_str_expr = expr_string\n node.original_str_fallback = expr_fallback_name\n return node\n elif isinstance(node, UnionType):\n return node\n else:\n return RawExpressionType(expr_string, expr_fallback_name, line, column)\n except (SyntaxError, ValueError):\n # Note: the parser will raise a `ValueError` instead of a SyntaxError if\n # the string happens to contain things like \\x00.\n return RawExpressionType(expr_string, expr_fallback_name, line, column)\n\n\ndef is_no_type_check_decorator(expr: ast3.expr) -> bool:\n if isinstance(expr, Name):\n return expr.id == 'no_type_check'\n elif isinstance(expr, Attribute):\n if isinstance(expr.value, Name):\n return expr.value.id == 'typing' and expr.attr == 'no_type_check'\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter_ASTConverter.get_lineno.return.node_lineno": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter_ASTConverter.get_lineno.return.node_lineno", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 288, "end_line": 348, "span_ids": ["ASTConverter.get_lineno", "ASTConverter.visit", "ASTConverter.set_line", "ASTConverter.__init__", "ASTConverter", "ASTConverter.translate_opt_expr_list", "ASTConverter.translate_expr_list", "ASTConverter.note", "ASTConverter.fail"], "tokens": 579}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n def __init__(self,\n options: Options,\n is_stub: bool,\n errors: Errors) -> None:\n # 'C' for class, 'F' for function\n self.class_and_function_stack = [] # type: List[Literal['C', 'F']]\n self.imports = [] # type: List[ImportBase]\n\n self.options = options\n self.is_stub = is_stub\n self.errors = errors\n\n self.type_ignores = {} # type: Dict[int, List[str]]\n\n # Cache of visit_X methods keyed by type of visited object\n self.visitor_cache = {} # type: Dict[type, Callable[[Optional[AST]], Any]]\n\n def note(self, msg: str, line: int, column: int) -> None:\n self.errors.report(line, column, msg, severity='note', code=codes.SYNTAX)\n\n def fail(self,\n msg: str,\n line: int,\n column: int,\n blocker: bool = True) -> None:\n if blocker or not self.options.ignore_errors:\n self.errors.report(line, column, msg, blocker=blocker, code=codes.SYNTAX)\n\n def visit(self, node: Optional[AST]) -> Any:\n if node is None:\n return None\n typeobj = type(node)\n visitor = self.visitor_cache.get(typeobj)\n if visitor is None:\n method = 'visit_' + node.__class__.__name__\n visitor = getattr(self, method)\n self.visitor_cache[typeobj] = visitor\n return visitor(node)\n\n def set_line(self, node: N, n: Union[ast3.expr, ast3.stmt, ast3.ExceptHandler]) -> N:\n node.line = n.lineno\n node.column = n.col_offset\n node.end_line = getattr(n, \"end_lineno\", None) if isinstance(n, ast3.expr) else None\n return node\n\n def translate_opt_expr_list(self, l: Sequence[Optional[AST]]) -> List[Optional[Expression]]:\n res = [] # type: List[Optional[Expression]]\n for e in l:\n exp = self.visit(e)\n res.append(exp)\n return res\n\n def translate_expr_list(self, l: Sequence[AST]) -> List[Expression]:\n return cast(List[Expression], self.translate_opt_expr_list(l))\n\n def get_lineno(self, node: Union[ast3.expr, ast3.stmt]) -> int:\n if (isinstance(node, (ast3.AsyncFunctionDef, ast3.ClassDef, ast3.FunctionDef))\n and node.decorator_list):\n return node.decorator_list[0].lineno\n return node.lineno", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.translate_stmt_list_ASTConverter.translate_stmt_list.return.res": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.translate_stmt_list_ASTConverter.translate_stmt_list.return.res", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 350, "end_line": 367, "span_ids": ["ASTConverter.translate_stmt_list"], "tokens": 173}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n\n def translate_stmt_list(self,\n stmts: Sequence[ast3.stmt],\n ismodule: bool = False) -> List[Statement]:\n # A \"# type: ignore\" comment before the first statement of a module\n # ignores the whole module:\n if (ismodule and stmts and self.type_ignores\n and min(self.type_ignores) < self.get_lineno(stmts[0])):\n self.errors.used_ignored_lines[self.errors.file].add(min(self.type_ignores))\n block = Block(self.fix_function_overloads(self.translate_stmt_list(stmts)))\n mark_block_unreachable(block)\n return [block]\n\n res = [] # type: List[Statement]\n for stmt in stmts:\n node = self.visit(stmt)\n res.append(node)\n\n return res", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.translate_type_comment_ASTConverter.as_required_block.return.b": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.translate_type_comment_ASTConverter.as_required_block.return.b", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 369, "end_line": 438, "span_ids": ["ASTConverter.as_block", "ASTConverter:4", "ASTConverter.as_required_block", "ASTConverter.translate_type_comment", "ASTConverter.from_operator", "ASTConverter:2", "ASTConverter.from_comp_operator"], "tokens": 583}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n\n def translate_type_comment(self,\n n: Union[ast3.stmt, ast3.arg],\n type_comment: Optional[str]) -> Optional[ProperType]:\n if type_comment is None:\n return None\n else:\n lineno = n.lineno\n extra_ignore, typ = parse_type_comment(type_comment,\n lineno,\n n.col_offset,\n self.errors)\n if extra_ignore is not None:\n self.type_ignores[lineno] = extra_ignore\n return typ\n\n op_map = {\n ast3.Add: '+',\n ast3.Sub: '-',\n ast3.Mult: '*',\n ast3.MatMult: '@',\n ast3.Div: '/',\n ast3.Mod: '%',\n ast3.Pow: '**',\n ast3.LShift: '<<',\n ast3.RShift: '>>',\n ast3.BitOr: '|',\n ast3.BitXor: '^',\n ast3.BitAnd: '&',\n ast3.FloorDiv: '//'\n } # type: Final[Dict[typing.Type[AST], str]]\n\n def from_operator(self, op: ast3.operator) -> str:\n op_name = ASTConverter.op_map.get(type(op))\n if op_name is None:\n raise RuntimeError('Unknown operator ' + str(type(op)))\n else:\n return op_name\n\n comp_op_map = {\n ast3.Gt: '>',\n ast3.Lt: '<',\n ast3.Eq: '==',\n ast3.GtE: '>=',\n ast3.LtE: '<=',\n ast3.NotEq: '!=',\n ast3.Is: 'is',\n ast3.IsNot: 'is not',\n ast3.In: 'in',\n ast3.NotIn: 'not in'\n } # type: Final[Dict[typing.Type[AST], str]]\n\n def from_comp_operator(self, op: ast3.cmpop) -> str:\n op_name = ASTConverter.comp_op_map.get(type(op))\n if op_name is None:\n raise RuntimeError('Unknown comparison operator ' + str(type(op)))\n else:\n return op_name\n\n def as_block(self, stmts: List[ast3.stmt], lineno: int) -> Optional[Block]:\n b = None\n if stmts:\n b = Block(self.fix_function_overloads(self.translate_stmt_list(stmts)))\n b.set_line(lineno)\n return b\n\n def as_required_block(self, stmts: List[ast3.stmt], lineno: int) -> Block:\n assert stmts # must be non-empty\n b = Block(self.fix_function_overloads(self.translate_stmt_list(stmts)))\n b.set_line(lineno)\n return b", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.fix_function_overloads_ASTConverter.fix_function_overloads.return.ret": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.fix_function_overloads_ASTConverter.fix_function_overloads.return.ret", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 440, "end_line": 467, "span_ids": ["ASTConverter.fix_function_overloads"], "tokens": 251}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n\n def fix_function_overloads(self, stmts: List[Statement]) -> List[Statement]:\n ret = [] # type: List[Statement]\n current_overload = [] # type: List[OverloadPart]\n current_overload_name = None # type: Optional[str]\n for stmt in stmts:\n if (current_overload_name is not None\n and isinstance(stmt, (Decorator, FuncDef))\n and stmt.name == current_overload_name):\n current_overload.append(stmt)\n else:\n if len(current_overload) == 1:\n ret.append(current_overload[0])\n elif len(current_overload) > 1:\n ret.append(OverloadedFuncDef(current_overload))\n\n if isinstance(stmt, Decorator):\n current_overload = [stmt]\n current_overload_name = stmt.name\n else:\n current_overload = []\n current_overload_name = None\n ret.append(stmt)\n\n if len(current_overload) == 1:\n ret.append(current_overload[0])\n elif len(current_overload) > 1:\n ret.append(OverloadedFuncDef(current_overload))\n return ret", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.in_method_scope_ASTConverter.translate_module_id.return.id": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.in_method_scope_ASTConverter.translate_module_id.return.id", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 469, "end_line": 483, "span_ids": ["ASTConverter.in_method_scope", "ASTConverter.translate_module_id"], "tokens": 165}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n\n def in_method_scope(self) -> bool:\n return self.class_and_function_stack[-2:] == ['C', 'F']\n\n def translate_module_id(self, id: str) -> str:\n \"\"\"Return the actual, internal module id for a source text id.\n\n For example, translate '__builtin__' in Python 2 to 'builtins'.\n \"\"\"\n if id == self.options.custom_typing_module:\n return 'typing'\n elif id == '__builtin__' and self.options.python_version[0] == 2:\n # HACK: __builtin__ in Python 2 is aliases to builtins. However, the implementation\n # is named __builtin__.py (there is another layer of translation elsewhere).\n return 'builtins'\n return id", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.visit_Module_ASTConverter.visit_Module.return.MypyFile_body_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.visit_Module_ASTConverter.visit_Module.return.MypyFile_body_", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 485, "end_line": 498, "span_ids": ["ASTConverter.visit_Module"], "tokens": 139}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n\n def visit_Module(self, mod: ast3.Module) -> MypyFile:\n self.type_ignores = {}\n for ti in mod.type_ignores:\n parsed = parse_type_ignore_tag(ti.tag) # type: ignore[attr-defined]\n if parsed is not None:\n self.type_ignores[ti.lineno] = parsed\n else:\n self.fail(INVALID_TYPE_IGNORE, ti.lineno, -1)\n body = self.fix_function_overloads(self.translate_stmt_list(mod.body, ismodule=True))\n return MypyFile(body,\n self.imports,\n False,\n self.type_ignores,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter._stmt__ASTConverter.visit_AsyncFunctionDef.return.self_do_func_def_n_is_co": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter._stmt__ASTConverter.visit_AsyncFunctionDef.return.self_do_func_def_n_is_co", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 500, "end_line": 511, "span_ids": ["ASTConverter.visit_Module", "ASTConverter.visit_FunctionDef", "ASTConverter.visit_AsyncFunctionDef"], "tokens": 179}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n\n # --- stmt ---\n # FunctionDef(identifier name, arguments args,\n # stmt* body, expr* decorator_list, expr? returns, string? type_comment)\n # arguments = (arg* args, arg? vararg, arg* kwonlyargs, expr* kw_defaults,\n # arg? kwarg, expr* defaults)\n def visit_FunctionDef(self, n: ast3.FunctionDef) -> Union[FuncDef, Decorator]:\n return self.do_func_def(n)\n\n # AsyncFunctionDef(identifier name, arguments args,\n # stmt* body, expr* decorator_list, expr? returns, string? type_comment)\n def visit_AsyncFunctionDef(self, n: ast3.AsyncFunctionDef) -> Union[FuncDef, Decorator]:\n return self.do_func_def(n, is_coroutine=True)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.do_func_def_ASTConverter.do_func_def.func_type.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.do_func_def_ASTConverter.do_func_def.func_type.None", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 516, "end_line": 584, "span_ids": ["ASTConverter.do_func_def"], "tokens": 797}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n\n def do_func_def(self, n: Union[ast3.FunctionDef, ast3.AsyncFunctionDef],\n is_coroutine: bool = False) -> Union[FuncDef, Decorator]:\n \"\"\"Helper shared between visit_FunctionDef and visit_AsyncFunctionDef.\"\"\"\n self.class_and_function_stack.append('F')\n no_type_check = bool(n.decorator_list and\n any(is_no_type_check_decorator(d) for d in n.decorator_list))\n\n lineno = n.lineno\n args = self.transform_args(n.args, lineno, no_type_check=no_type_check)\n\n posonlyargs = [arg.arg for arg in getattr(n.args, \"posonlyargs\", [])]\n arg_kinds = [arg.kind for arg in args]\n arg_names = [arg.variable.name for arg in args] # type: List[Optional[str]]\n arg_names = [None if argument_elide_name(name) or name in posonlyargs else name\n for name in arg_names]\n if special_function_elide_names(n.name):\n arg_names = [None] * len(arg_names)\n arg_types = [] # type: List[Optional[Type]]\n if no_type_check:\n arg_types = [None] * len(args)\n return_type = None\n elif n.type_comment is not None:\n try:\n func_type_ast = ast3_parse(n.type_comment, '', 'func_type')\n assert isinstance(func_type_ast, FunctionType)\n # for ellipsis arg\n if (len(func_type_ast.argtypes) == 1 and\n isinstance(func_type_ast.argtypes[0], ast3_Ellipsis)):\n if n.returns:\n # PEP 484 disallows both type annotations and type comments\n self.fail(message_registry.DUPLICATE_TYPE_SIGNATURES, lineno, n.col_offset)\n arg_types = [a.type_annotation\n if a.type_annotation is not None\n else AnyType(TypeOfAny.unannotated)\n for a in args]\n else:\n # PEP 484 disallows both type annotations and type comments\n if n.returns or any(a.type_annotation is not None for a in args):\n self.fail(message_registry.DUPLICATE_TYPE_SIGNATURES, lineno, n.col_offset)\n translated_args = (TypeConverter(self.errors,\n line=lineno,\n override_column=n.col_offset)\n .translate_expr_list(func_type_ast.argtypes))\n arg_types = [a if a is not None else AnyType(TypeOfAny.unannotated)\n for a in translated_args]\n return_type = TypeConverter(self.errors,\n line=lineno).visit(func_type_ast.returns)\n\n # add implicit self type\n if self.in_method_scope() and len(arg_types) < len(args):\n arg_types.insert(0, AnyType(TypeOfAny.special_form))\n except SyntaxError:\n stripped_type = n.type_comment.split(\"#\", 2)[0].strip()\n err_msg = '{} \"{}\"'.format(TYPE_COMMENT_SYNTAX_ERROR, stripped_type)\n self.fail(err_msg, lineno, n.col_offset)\n if n.type_comment and n.type_comment[0] not in [\"(\", \"#\"]:\n self.note('Suggestion: wrap argument types in parentheses',\n lineno, n.col_offset)\n arg_types = [AnyType(TypeOfAny.from_error)] * len(args)\n return_type = AnyType(TypeOfAny.from_error)\n else:\n arg_types = [a.type_annotation for a in args]\n return_type = TypeConverter(self.errors, line=n.returns.lineno\n if n.returns else lineno).visit(n.returns)\n\n for arg, arg_type in zip(args, arg_types):\n self.set_type_optional(arg_type, arg.initializer)\n\n func_type = None\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.do_func_def.if_any_arg_types_or_retu_ASTConverter.do_func_def.return.retval": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.do_func_def.if_any_arg_types_or_retu_ASTConverter.do_func_def.return.retval", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 582, "end_line": 643, "span_ids": ["ASTConverter.do_func_def"], "tokens": 655}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n\n def do_func_def(self, n: Union[ast3.FunctionDef, ast3.AsyncFunctionDef],\n is_coroutine: bool = False) -> Union[FuncDef, Decorator]:\n # ... other code\n if any(arg_types) or return_type:\n if len(arg_types) != 1 and any(isinstance(t, EllipsisType)\n for t in arg_types):\n self.fail(\"Ellipses cannot accompany other argument types \"\n \"in function type signature\", lineno, n.col_offset)\n elif len(arg_types) > len(arg_kinds):\n self.fail('Type signature has too many arguments', lineno, n.col_offset,\n blocker=False)\n elif len(arg_types) < len(arg_kinds):\n self.fail('Type signature has too few arguments', lineno, n.col_offset,\n blocker=False)\n else:\n func_type = CallableType([a if a is not None else\n AnyType(TypeOfAny.unannotated) for a in arg_types],\n arg_kinds,\n arg_names,\n return_type if return_type is not None else\n AnyType(TypeOfAny.unannotated),\n _dummy_fallback)\n\n func_def = FuncDef(n.name,\n args,\n self.as_required_block(n.body, lineno),\n func_type)\n if isinstance(func_def.type, CallableType):\n # semanal.py does some in-place modifications we want to avoid\n func_def.unanalyzed_type = func_def.type.copy_modified()\n if is_coroutine:\n func_def.is_coroutine = True\n if func_type is not None:\n func_type.definition = func_def\n func_type.line = lineno\n\n if n.decorator_list:\n if sys.version_info < (3, 8):\n # Before 3.8, [typed_]ast the line number points to the first decorator.\n # In 3.8, it points to the 'def' line, where we want it.\n lineno += len(n.decorator_list)\n end_lineno = None # type: Optional[int]\n else:\n # Set end_lineno to the old pre-3.8 lineno, in order to keep\n # existing \"# type: ignore\" comments working:\n end_lineno = n.decorator_list[0].lineno + len(n.decorator_list)\n\n var = Var(func_def.name)\n var.is_ready = False\n var.set_line(lineno)\n\n func_def.is_decorated = True\n func_def.set_line(lineno, n.col_offset, end_lineno)\n func_def.body.set_line(lineno) # TODO: Why?\n\n deco = Decorator(func_def, self.translate_expr_list(n.decorator_list), var)\n first = n.decorator_list[0]\n deco.set_line(first.lineno, first.col_offset)\n retval = deco # type: Union[FuncDef, Decorator]\n else:\n # FuncDef overrides set_line -- can't use self.set_line\n func_def.set_line(lineno, n.col_offset)\n retval = func_def\n self.class_and_function_stack.pop()\n return retval", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.set_type_optional_ASTConverter.transform_args.return.new_args": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.set_type_optional_ASTConverter.transform_args.return.new_args", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 648, "end_line": 697, "span_ids": ["ASTConverter.transform_args", "ASTConverter.set_type_optional"], "tokens": 442}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n\n def set_type_optional(self, type: Optional[Type], initializer: Optional[Expression]) -> None:\n if self.options.no_implicit_optional:\n return\n # Indicate that type should be wrapped in an Optional if arg is initialized to None.\n optional = isinstance(initializer, NameExpr) and initializer.name == 'None'\n if isinstance(type, UnboundType):\n type.optional = optional\n\n def transform_args(self,\n args: ast3.arguments,\n line: int,\n no_type_check: bool = False,\n ) -> List[Argument]:\n new_args = []\n names = [] # type: List[ast3.arg]\n args_args = getattr(args, \"posonlyargs\", []) + args.args\n args_defaults = args.defaults\n num_no_defaults = len(args_args) - len(args_defaults)\n # positional arguments without defaults\n for a in args_args[:num_no_defaults]:\n new_args.append(self.make_argument(a, None, ARG_POS, no_type_check))\n names.append(a)\n\n # positional arguments with defaults\n for a, d in zip(args_args[num_no_defaults:], args_defaults):\n new_args.append(self.make_argument(a, d, ARG_OPT, no_type_check))\n names.append(a)\n\n # *arg\n if args.vararg is not None:\n new_args.append(self.make_argument(args.vararg, None, ARG_STAR, no_type_check))\n names.append(args.vararg)\n\n # keyword-only arguments with defaults\n for a, kd in zip(args.kwonlyargs, args.kw_defaults):\n new_args.append(self.make_argument(\n a,\n kd,\n ARG_NAMED if kd is None else ARG_NAMED_OPT,\n no_type_check))\n names.append(a)\n\n # **kwarg\n if args.kwarg is not None:\n new_args.append(self.make_argument(args.kwarg, None, ARG_STAR2, no_type_check))\n names.append(args.kwarg)\n\n check_arg_names([arg.variable.name for arg in new_args], names, self.fail_arg)\n\n return new_args", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.make_argument_ASTConverter._expr_decorator_list_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.make_argument_ASTConverter._expr_decorator_list_", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 696, "end_line": 719, "span_ids": ["ASTConverter.fail_arg", "ASTConverter.make_argument"], "tokens": 232}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n\n def make_argument(self, arg: ast3.arg, default: Optional[ast3.expr], kind: int,\n no_type_check: bool) -> Argument:\n if no_type_check:\n arg_type = None\n else:\n annotation = arg.annotation\n type_comment = arg.type_comment\n if annotation is not None and type_comment is not None:\n self.fail(message_registry.DUPLICATE_TYPE_SIGNATURES, arg.lineno, arg.col_offset)\n arg_type = None\n if annotation is not None:\n arg_type = TypeConverter(self.errors, line=arg.lineno).visit(annotation)\n else:\n arg_type = self.translate_type_comment(arg, type_comment)\n return Argument(Var(arg.arg), arg_type, self.visit(default), kind)\n\n def fail_arg(self, msg: str, arg: ast3.arg) -> None:\n self.fail(msg, arg.lineno, arg.col_offset)\n\n # ClassDef(identifier name,\n # expr* bases,\n # keyword* keywords,\n # stmt* body,\n # expr* decorator_list)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.visit_ClassDef_ASTConverter.visit_ClassDef.return.cdef": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.visit_ClassDef_ASTConverter.visit_ClassDef.return.cdef", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 720, "end_line": 742, "span_ids": ["ASTConverter.visit_ClassDef"], "tokens": 243}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n def visit_ClassDef(self, n: ast3.ClassDef) -> ClassDef:\n self.class_and_function_stack.append('C')\n keywords = [(kw.arg, self.visit(kw.value))\n for kw in n.keywords if kw.arg]\n\n cdef = ClassDef(n.name,\n self.as_required_block(n.body, n.lineno),\n None,\n self.translate_expr_list(n.bases),\n metaclass=dict(keywords).get('metaclass'),\n keywords=keywords)\n cdef.decorators = self.translate_expr_list(n.decorator_list)\n # Set end_lineno to the old mypy 0.700 lineno, in order to keep\n # existing \"# type: ignore\" comments working:\n if sys.version_info < (3, 8):\n cdef.line = n.lineno + len(n.decorator_list)\n cdef.end_line = n.lineno\n else:\n cdef.line = n.lineno\n cdef.end_line = n.decorator_list[0].lineno if n.decorator_list else None\n cdef.column = n.col_offset\n self.class_and_function_stack.pop()\n return cdef", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter._Return_expr_value__ASTConverter._AnnAssign_expr_target_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter._Return_expr_value__ASTConverter._AnnAssign_expr_target_", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 744, "end_line": 767, "span_ids": ["ASTConverter.visit_Assign", "ASTConverter.visit_ClassDef", "ASTConverter.visit_Return", "ASTConverter.visit_Delete"], "tokens": 246}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n\n # Return(expr? value)\n def visit_Return(self, n: ast3.Return) -> ReturnStmt:\n node = ReturnStmt(self.visit(n.value))\n return self.set_line(node, n)\n\n # Delete(expr* targets)\n def visit_Delete(self, n: ast3.Delete) -> DelStmt:\n if len(n.targets) > 1:\n tup = TupleExpr(self.translate_expr_list(n.targets))\n tup.set_line(n.lineno)\n node = DelStmt(tup)\n else:\n node = DelStmt(self.visit(n.targets[0]))\n return self.set_line(node, n)\n\n # Assign(expr* targets, expr? value, string? type_comment, expr? annotation)\n def visit_Assign(self, n: ast3.Assign) -> AssignmentStmt:\n lvalues = self.translate_expr_list(n.targets)\n rvalue = self.visit(n.value)\n typ = self.translate_type_comment(n, n.type_comment)\n s = AssignmentStmt(lvalues, rvalue, type=typ, new_syntax=False)\n return self.set_line(s, n)\n\n # AnnAssign(expr target, expr annotation, expr? value, int simple)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.visit_AnnAssign_ASTConverter.visit_AnnAssign.return.self_set_line_s_n_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.visit_AnnAssign_ASTConverter.visit_AnnAssign.return.self_set_line_s_n_", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 768, "end_line": 780, "span_ids": ["ASTConverter.visit_AnnAssign"], "tokens": 162}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n def visit_AnnAssign(self, n: ast3.AnnAssign) -> AssignmentStmt:\n line = n.lineno\n if n.value is None: # always allow 'x: int'\n rvalue = TempNode(AnyType(TypeOfAny.special_form), no_rhs=True) # type: Expression\n rvalue.line = line\n rvalue.column = n.col_offset\n else:\n rvalue = self.visit(n.value)\n typ = TypeConverter(self.errors, line=line).visit(n.annotation)\n assert typ is not None\n typ.column = n.annotation.col_offset\n s = AssignmentStmt([self.visit(n.target)], rvalue, type=typ, new_syntax=True)\n return self.set_line(s, n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter._AugAssign_expr_target__ASTConverter._Try_stmt_body_excepth": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter._AugAssign_expr_target__ASTConverter._Try_stmt_body_excepth", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 782, "end_line": 849, "span_ids": ["ASTConverter.visit_For", "ASTConverter.visit_While", "ASTConverter.visit_AnnAssign", "ASTConverter.visit_If", "ASTConverter.visit_Raise", "ASTConverter.visit_AugAssign", "ASTConverter.visit_AsyncFor", "ASTConverter.visit_AsyncWith", "ASTConverter.visit_With"], "tokens": 754}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n\n # AugAssign(expr target, operator op, expr value)\n def visit_AugAssign(self, n: ast3.AugAssign) -> OperatorAssignmentStmt:\n s = OperatorAssignmentStmt(self.from_operator(n.op),\n self.visit(n.target),\n self.visit(n.value))\n return self.set_line(s, n)\n\n # For(expr target, expr iter, stmt* body, stmt* orelse, string? type_comment)\n def visit_For(self, n: ast3.For) -> ForStmt:\n target_type = self.translate_type_comment(n, n.type_comment)\n node = ForStmt(self.visit(n.target),\n self.visit(n.iter),\n self.as_required_block(n.body, n.lineno),\n self.as_block(n.orelse, n.lineno),\n target_type)\n return self.set_line(node, n)\n\n # AsyncFor(expr target, expr iter, stmt* body, stmt* orelse, string? type_comment)\n def visit_AsyncFor(self, n: ast3.AsyncFor) -> ForStmt:\n target_type = self.translate_type_comment(n, n.type_comment)\n node = ForStmt(self.visit(n.target),\n self.visit(n.iter),\n self.as_required_block(n.body, n.lineno),\n self.as_block(n.orelse, n.lineno),\n target_type)\n node.is_async = True\n return self.set_line(node, n)\n\n # While(expr test, stmt* body, stmt* orelse)\n def visit_While(self, n: ast3.While) -> WhileStmt:\n node = WhileStmt(self.visit(n.test),\n self.as_required_block(n.body, n.lineno),\n self.as_block(n.orelse, n.lineno))\n return self.set_line(node, n)\n\n # If(expr test, stmt* body, stmt* orelse)\n def visit_If(self, n: ast3.If) -> IfStmt:\n lineno = n.lineno\n node = IfStmt([self.visit(n.test)],\n [self.as_required_block(n.body, lineno)],\n self.as_block(n.orelse, lineno))\n return self.set_line(node, n)\n\n # With(withitem* items, stmt* body, string? type_comment)\n def visit_With(self, n: ast3.With) -> WithStmt:\n target_type = self.translate_type_comment(n, n.type_comment)\n node = WithStmt([self.visit(i.context_expr) for i in n.items],\n [self.visit(i.optional_vars) for i in n.items],\n self.as_required_block(n.body, n.lineno),\n target_type)\n return self.set_line(node, n)\n\n # AsyncWith(withitem* items, stmt* body, string? type_comment)\n def visit_AsyncWith(self, n: ast3.AsyncWith) -> WithStmt:\n target_type = self.translate_type_comment(n, n.type_comment)\n s = WithStmt([self.visit(i.context_expr) for i in n.items],\n [self.visit(i.optional_vars) for i in n.items],\n self.as_required_block(n.body, n.lineno),\n target_type)\n s.is_async = True\n return self.set_line(s, n)\n\n # Raise(expr? exc, expr? cause)\n def visit_Raise(self, n: ast3.Raise) -> RaiseStmt:\n node = RaiseStmt(self.visit(n.exc), self.visit(n.cause))\n return self.set_line(node, n)\n\n # Try(stmt* body, excepthandler* handlers, stmt* orelse, stmt* finalbody)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.visit_Try_ASTConverter.visit_Try.return.self_set_line_node_n_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.visit_Try_ASTConverter.visit_Try.return.self_set_line_node_n_", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 850, "end_line": 863, "span_ids": ["ASTConverter.visit_Try"], "tokens": 147}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n def visit_Try(self, n: ast3.Try) -> TryStmt:\n vs = [\n self.set_line(NameExpr(h.name), h) if h.name is not None else None for h in n.handlers\n ]\n types = [self.visit(h.type) for h in n.handlers]\n handlers = [self.as_required_block(h.body, h.lineno) for h in n.handlers]\n\n node = TryStmt(self.as_required_block(n.body, n.lineno),\n vs,\n types,\n handlers,\n self.as_block(n.orelse, n.lineno),\n self.as_block(n.finalbody, n.lineno))\n return self.set_line(node, n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter._Assert_expr_test_expr__ASTConverter.visit_Import.return.self_set_line_i_n_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter._Assert_expr_test_expr__ASTConverter.visit_Import.return.self_set_line_i_n_", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 865, "end_line": 884, "span_ids": ["ASTConverter.visit_Try", "ASTConverter.visit_Import", "ASTConverter.visit_Assert"], "tokens": 206}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n\n # Assert(expr test, expr? msg)\n def visit_Assert(self, n: ast3.Assert) -> AssertStmt:\n node = AssertStmt(self.visit(n.test), self.visit(n.msg))\n return self.set_line(node, n)\n\n # Import(alias* names)\n def visit_Import(self, n: ast3.Import) -> Import:\n names = [] # type: List[Tuple[str, Optional[str]]]\n for alias in n.names:\n name = self.translate_module_id(alias.name)\n asname = alias.asname\n if asname is None and name != alias.name:\n # if the module name has been translated (and it's not already\n # an explicit import-as), make it an implicit import-as the\n # original name\n asname = alias.name\n names.append((name, asname))\n i = Import(names)\n self.imports.append(i)\n return self.set_line(i, n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter._ImportFrom_identifier__ASTConverter.visit_ImportFrom.return.self_set_line_i_n_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter._ImportFrom_identifier__ASTConverter.visit_ImportFrom.return.self_set_line_i_n_", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 886, "end_line": 897, "span_ids": ["ASTConverter.visit_Import", "ASTConverter.visit_ImportFrom"], "tokens": 154}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n\n # ImportFrom(identifier? module, alias* names, int? level)\n def visit_ImportFrom(self, n: ast3.ImportFrom) -> ImportBase:\n assert n.level is not None\n if len(n.names) == 1 and n.names[0].name == '*':\n mod = n.module if n.module is not None else ''\n i = ImportAll(mod, n.level) # type: ImportBase\n else:\n i = ImportFrom(self.translate_module_id(n.module) if n.module is not None else '',\n n.level,\n [(a.name, a.asname) for a in n.names])\n self.imports.append(i)\n return self.set_line(i, n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter._Global_identifier_name_ASTConverter._BoolOp_boolop_op_expr_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter._Global_identifier_name_ASTConverter._BoolOp_boolop_op_expr_", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 899, "end_line": 936, "span_ids": ["ASTConverter.visit_Break", "ASTConverter.visit_Continue", "ASTConverter.visit_Global", "ASTConverter.visit_Nonlocal", "ASTConverter.visit_ImportFrom", "ASTConverter.visit_Pass", "ASTConverter.visit_NamedExpr", "ASTConverter.visit_Expr"], "tokens": 306}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n\n # Global(identifier* names)\n def visit_Global(self, n: ast3.Global) -> GlobalDecl:\n g = GlobalDecl(n.names)\n return self.set_line(g, n)\n\n # Nonlocal(identifier* names)\n def visit_Nonlocal(self, n: ast3.Nonlocal) -> NonlocalDecl:\n d = NonlocalDecl(n.names)\n return self.set_line(d, n)\n\n # Expr(expr value)\n def visit_Expr(self, n: ast3.Expr) -> ExpressionStmt:\n value = self.visit(n.value)\n node = ExpressionStmt(value)\n return self.set_line(node, n)\n\n # Pass\n def visit_Pass(self, n: ast3.Pass) -> PassStmt:\n s = PassStmt()\n return self.set_line(s, n)\n\n # Break\n def visit_Break(self, n: ast3.Break) -> BreakStmt:\n s = BreakStmt()\n return self.set_line(s, n)\n\n # Continue\n def visit_Continue(self, n: ast3.Continue) -> ContinueStmt:\n s = ContinueStmt()\n return self.set_line(s, n)\n\n # --- expr ---\n\n def visit_NamedExpr(self, n: NamedExpr) -> AssignmentExpr:\n s = AssignmentExpr(self.visit(n.target), self.visit(n.value))\n return self.set_line(s, n)\n\n # BoolOp(boolop op, expr* values)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.visit_BoolOp_ASTConverter.visit_BoolOp.return.self_group_op_self_trans": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.visit_BoolOp_ASTConverter.visit_BoolOp.return.self_group_op_self_trans", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 937, "end_line": 949, "span_ids": ["ASTConverter.visit_BoolOp"], "tokens": 131}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n def visit_BoolOp(self, n: ast3.BoolOp) -> OpExpr:\n # mypy translates (1 and 2 and 3) as (1 and (2 and 3))\n assert len(n.values) >= 2\n op_node = n.op\n if isinstance(op_node, ast3.And):\n op = 'and'\n elif isinstance(op_node, ast3.Or):\n op = 'or'\n else:\n raise RuntimeError('unknown BoolOp ' + str(type(n)))\n\n # potentially inefficient!\n return self.group(op, self.translate_expr_list(n.values), n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.group_ASTConverter._UnaryOp_unaryop_op_exp": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.group_ASTConverter._UnaryOp_unaryop_op_exp", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 951, "end_line": 968, "span_ids": ["ASTConverter.group", "ASTConverter.visit_BinOp"], "tokens": 187}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n\n def group(self, op: str, vals: List[Expression], n: ast3.expr) -> OpExpr:\n if len(vals) == 2:\n e = OpExpr(op, vals[0], vals[1])\n else:\n e = OpExpr(op, vals[0], self.group(op, vals[1:], n))\n return self.set_line(e, n)\n\n # BinOp(expr left, operator op, expr right)\n def visit_BinOp(self, n: ast3.BinOp) -> OpExpr:\n op = self.from_operator(n.op)\n\n if op is None:\n raise RuntimeError('cannot translate BinOp ' + str(type(n.op)))\n\n e = OpExpr(op, self.visit(n.left), self.visit(n.right))\n return self.set_line(e, n)\n\n # UnaryOp(unaryop op, expr operand)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.visit_UnaryOp_ASTConverter.visit_UnaryOp.return.self_set_line_e_n_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.visit_UnaryOp_ASTConverter.visit_UnaryOp.return.self_set_line_e_n_", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 969, "end_line": 984, "span_ids": ["ASTConverter.visit_UnaryOp"], "tokens": 136}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n def visit_UnaryOp(self, n: ast3.UnaryOp) -> UnaryExpr:\n op = None\n if isinstance(n.op, ast3.Invert):\n op = '~'\n elif isinstance(n.op, ast3.Not):\n op = 'not'\n elif isinstance(n.op, ast3.UAdd):\n op = '+'\n elif isinstance(n.op, ast3.USub):\n op = '-'\n\n if op is None:\n raise RuntimeError('cannot translate UnaryOp ' + str(type(n.op)))\n\n e = UnaryExpr(op, self.visit(n.operand))\n return self.set_line(e, n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter._Lambda_arguments_args__ASTConverter._DictComp_expr_key_expr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter._Lambda_arguments_args__ASTConverter._DictComp_expr_key_expr", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 986, "end_line": 1025, "span_ids": ["ASTConverter.visit_ListComp", "ASTConverter.visit_Lambda", "ASTConverter.visit_SetComp", "ASTConverter.visit_UnaryOp", "ASTConverter.visit_IfExp", "ASTConverter.visit_Set", "ASTConverter.visit_Dict"], "tokens": 427}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n\n # Lambda(arguments args, expr body)\n def visit_Lambda(self, n: ast3.Lambda) -> LambdaExpr:\n body = ast3.Return(n.body)\n body.lineno = n.body.lineno\n body.col_offset = n.body.col_offset\n\n e = LambdaExpr(self.transform_args(n.args, n.lineno),\n self.as_required_block([body], n.lineno))\n e.set_line(n.lineno, n.col_offset) # Overrides set_line -- can't use self.set_line\n return e\n\n # IfExp(expr test, expr body, expr orelse)\n def visit_IfExp(self, n: ast3.IfExp) -> ConditionalExpr:\n e = ConditionalExpr(self.visit(n.test),\n self.visit(n.body),\n self.visit(n.orelse))\n return self.set_line(e, n)\n\n # Dict(expr* keys, expr* values)\n def visit_Dict(self, n: ast3.Dict) -> DictExpr:\n e = DictExpr(list(zip(self.translate_opt_expr_list(n.keys),\n self.translate_expr_list(n.values))))\n return self.set_line(e, n)\n\n # Set(expr* elts)\n def visit_Set(self, n: ast3.Set) -> SetExpr:\n e = SetExpr(self.translate_expr_list(n.elts))\n return self.set_line(e, n)\n\n # ListComp(expr elt, comprehension* generators)\n def visit_ListComp(self, n: ast3.ListComp) -> ListComprehension:\n e = ListComprehension(self.visit_GeneratorExp(cast(ast3.GeneratorExp, n)))\n return self.set_line(e, n)\n\n # SetComp(expr elt, comprehension* generators)\n def visit_SetComp(self, n: ast3.SetComp) -> SetComprehension:\n e = SetComprehension(self.visit_GeneratorExp(cast(ast3.GeneratorExp, n)))\n return self.set_line(e, n)\n\n # DictComp(expr key, expr value, comprehension* generators)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.visit_DictComp_ASTConverter.visit_DictComp.return.self_set_line_e_n_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.visit_DictComp_ASTConverter.visit_DictComp.return.self_set_line_e_n_", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1026, "end_line": 1037, "span_ids": ["ASTConverter.visit_DictComp"], "tokens": 137}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n def visit_DictComp(self, n: ast3.DictComp) -> DictionaryComprehension:\n targets = [self.visit(c.target) for c in n.generators]\n iters = [self.visit(c.iter) for c in n.generators]\n ifs_list = [self.translate_expr_list(c.ifs) for c in n.generators]\n is_async = [bool(c.is_async) for c in n.generators]\n e = DictionaryComprehension(self.visit(n.key),\n self.visit(n.value),\n targets,\n iters,\n ifs_list,\n is_async)\n return self.set_line(e, n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter._GeneratorExp_expr_elt__ASTConverter.visit_GeneratorExp.return.self_set_line_e_n_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter._GeneratorExp_expr_elt__ASTConverter.visit_GeneratorExp.return.self_set_line_e_n_", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1039, "end_line": 1050, "span_ids": ["ASTConverter.visit_DictComp", "ASTConverter.visit_GeneratorExp"], "tokens": 140}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n\n # GeneratorExp(expr elt, comprehension* generators)\n def visit_GeneratorExp(self, n: ast3.GeneratorExp) -> GeneratorExpr:\n targets = [self.visit(c.target) for c in n.generators]\n iters = [self.visit(c.iter) for c in n.generators]\n ifs_list = [self.translate_expr_list(c.ifs) for c in n.generators]\n is_async = [bool(c.is_async) for c in n.generators]\n e = GeneratorExpr(self.visit(n.elt),\n targets,\n iters,\n ifs_list,\n is_async)\n return self.set_line(e, n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter._Await_expr_value__ASTConverter._keyword_identifier_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter._Await_expr_value__ASTConverter._keyword_identifier_", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1052, "end_line": 1076, "span_ids": ["ASTConverter.visit_YieldFrom", "ASTConverter.visit_Yield", "ASTConverter.visit_GeneratorExp", "ASTConverter.visit_Compare", "ASTConverter.visit_Await"], "tokens": 255}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n\n # Await(expr value)\n def visit_Await(self, n: ast3.Await) -> AwaitExpr:\n v = self.visit(n.value)\n e = AwaitExpr(v)\n return self.set_line(e, n)\n\n # Yield(expr? value)\n def visit_Yield(self, n: ast3.Yield) -> YieldExpr:\n e = YieldExpr(self.visit(n.value))\n return self.set_line(e, n)\n\n # YieldFrom(expr value)\n def visit_YieldFrom(self, n: ast3.YieldFrom) -> YieldFromExpr:\n e = YieldFromExpr(self.visit(n.value))\n return self.set_line(e, n)\n\n # Compare(expr left, cmpop* ops, expr* comparators)\n def visit_Compare(self, n: ast3.Compare) -> ComparisonExpr:\n operators = [self.from_comp_operator(o) for o in n.ops]\n operands = self.translate_expr_list([n.left] + n.comparators)\n e = ComparisonExpr(operators, operands)\n return self.set_line(e, n)\n\n # Call(expr func, expr* args, keyword* keywords)\n # keyword = (identifier? arg, expr value)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.visit_Call_ASTConverter._Constant_object_value_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.visit_Call_ASTConverter._Constant_object_value_", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1077, "end_line": 1092, "span_ids": ["ASTConverter.visit_Call"], "tokens": 187}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n def visit_Call(self, n: Call) -> CallExpr:\n args = n.args\n keywords = n.keywords\n keyword_names = [k.arg for k in keywords]\n arg_types = self.translate_expr_list(\n [a.value if isinstance(a, Starred) else a for a in args] +\n [k.value for k in keywords])\n arg_kinds = ([ARG_STAR if type(a) is Starred else ARG_POS for a in args] +\n [ARG_STAR2 if arg is None else ARG_NAMED for arg in keyword_names])\n e = CallExpr(self.visit(n.func),\n arg_types,\n arg_kinds,\n cast('List[Optional[str]]', [None] * len(args)) + keyword_names)\n return self.set_line(e, n)\n\n # Constant(object value) -- a constant, in Python 3.8.", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.visit_Constant_ASTConverter.visit_Constant.return.self_set_line_e_n_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.visit_Constant_ASTConverter.visit_Constant.return.self_set_line_e_n_", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1093, "end_line": 1114, "span_ids": ["ASTConverter.visit_Constant"], "tokens": 187}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n def visit_Constant(self, n: Constant) -> Any:\n val = n.value\n e = None # type: Any\n if val is None:\n e = NameExpr('None')\n elif isinstance(val, str):\n e = StrExpr(n.s)\n elif isinstance(val, bytes):\n e = BytesExpr(bytes_to_human_readable_repr(n.s))\n elif isinstance(val, bool): # Must check before int!\n e = NameExpr(str(val))\n elif isinstance(val, int):\n e = IntExpr(val)\n elif isinstance(val, float):\n e = FloatExpr(val)\n elif isinstance(val, complex):\n e = ComplexExpr(val)\n elif val is Ellipsis:\n e = EllipsisExpr()\n else:\n raise RuntimeError('Constant not implemented for ' + str(type(val)))\n return self.set_line(e, n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter._Num_object_n_a_numb_ASTConverter.visit_Num.return.self_set_line_e_n_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter._Num_object_n_a_numb_ASTConverter.visit_Num.return.self_set_line_e_n_", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1116, "end_line": 1131, "span_ids": ["ASTConverter.visit_Num", "ASTConverter.visit_Constant"], "tokens": 188}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n\n # Num(object n) -- a number as a PyObject.\n def visit_Num(self, n: ast3.Num) -> Union[IntExpr, FloatExpr, ComplexExpr]:\n # The n field has the type complex, but complex isn't *really*\n # a parent of int and float, and this causes isinstance below\n # to think that the complex branch is always picked. Avoid\n # this by throwing away the type.\n val = n.n # type: object\n if isinstance(val, int):\n e = IntExpr(val) # type: Union[IntExpr, FloatExpr, ComplexExpr]\n elif isinstance(val, float):\n e = FloatExpr(val)\n elif isinstance(val, complex):\n e = ComplexExpr(val)\n else:\n raise RuntimeError('num not implemented for ' + str(type(val)))\n return self.set_line(e, n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter._Str_string_s__ASTConverter._JoinedStr_expr_values_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter._Str_string_s__ASTConverter._JoinedStr_expr_values_", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1133, "end_line": 1144, "span_ids": ["ASTConverter.visit_Num", "ASTConverter.visit_Str"], "tokens": 140}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n\n # Str(string s)\n def visit_Str(self, n: Str) -> Union[UnicodeExpr, StrExpr]:\n # Hack: assume all string literals in Python 2 stubs are normal\n # strs (i.e. not unicode). All stubs are parsed with the Python 3\n # parser, which causes unprefixed string literals to be interpreted\n # as unicode instead of bytes. This hack is generally okay,\n # because mypy considers str literals to be compatible with\n # unicode.\n e = StrExpr(n.s)\n return self.set_line(e, n)\n\n # JoinedStr(expr* values)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.visit_JoinedStr_ASTConverter._FormattedValue_expr_val": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.visit_JoinedStr_ASTConverter._FormattedValue_expr_val", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1145, "end_line": 1163, "span_ids": ["ASTConverter.visit_JoinedStr"], "tokens": 200}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n def visit_JoinedStr(self, n: ast3.JoinedStr) -> Expression:\n # Each of n.values is a str or FormattedValue; we just concatenate\n # them all using ''.join.\n empty_string = StrExpr('')\n empty_string.set_line(n.lineno, n.col_offset)\n strs_to_join = ListExpr(self.translate_expr_list(n.values))\n strs_to_join.set_line(empty_string)\n # Don't make unnecessary join call if there is only one str to join\n if len(strs_to_join.items) == 1:\n return self.set_line(strs_to_join.items[0], n)\n join_method = MemberExpr(empty_string, 'join')\n join_method.set_line(empty_string)\n result_expression = CallExpr(join_method,\n [strs_to_join],\n [ARG_POS],\n [None])\n return self.set_line(result_expression, n)\n\n # FormattedValue(expr value)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.visit_FormattedValue_ASTConverter.visit_FormattedValue.return.self_set_line_result_expr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.visit_FormattedValue_ASTConverter.visit_FormattedValue.return.self_set_line_result_expr", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1164, "end_line": 1181, "span_ids": ["ASTConverter.visit_FormattedValue"], "tokens": 252}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n def visit_FormattedValue(self, n: ast3.FormattedValue) -> Expression:\n # A FormattedValue is a component of a JoinedStr, or it can exist\n # on its own. We translate them to individual '{}'.format(value)\n # calls. Format specifier and conversion information is passed along\n # to allow mypyc to support f-strings with format specifiers and conversions.\n val_exp = self.visit(n.value)\n val_exp.set_line(n.lineno, n.col_offset)\n conv_str = '' if n.conversion is None or n.conversion < 0 else '!' + chr(n.conversion)\n format_string = StrExpr('{' + conv_str + ':{}}')\n format_spec_exp = self.visit(n.format_spec) if n.format_spec is not None else StrExpr('')\n format_string.set_line(n.lineno, n.col_offset)\n format_method = MemberExpr(format_string, 'format')\n format_method.set_line(format_string)\n result_expression = CallExpr(format_method,\n [val_exp, format_spec_exp],\n [ARG_POS, ARG_POS],\n [None, None])\n return self.set_line(result_expression, n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter._Bytes_bytes_s__ASTConverter._Attribute_expr_value_i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter._Bytes_bytes_s__ASTConverter._Attribute_expr_value_i", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1183, "end_line": 1198, "span_ids": ["ASTConverter.visit_FormattedValue", "ASTConverter.visit_NameConstant", "ASTConverter.visit_Bytes", "ASTConverter.visit_Ellipsis"], "tokens": 151}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n\n # Bytes(bytes s)\n def visit_Bytes(self, n: ast3.Bytes) -> Union[BytesExpr, StrExpr]:\n e = BytesExpr(bytes_to_human_readable_repr(n.s))\n return self.set_line(e, n)\n\n # NameConstant(singleton value)\n def visit_NameConstant(self, n: NameConstant) -> NameExpr:\n e = NameExpr(str(n.value))\n return self.set_line(e, n)\n\n # Ellipsis\n def visit_Ellipsis(self, n: ast3_Ellipsis) -> EllipsisExpr:\n e = EllipsisExpr()\n return self.set_line(e, n)\n\n # Attribute(expr value, identifier attr, expr_context ctx)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.visit_Attribute_ASTConverter._Subscript_expr_value_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.visit_Attribute_ASTConverter._Subscript_expr_value_s", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1199, "end_line": 1211, "span_ids": ["ASTConverter.visit_Attribute"], "tokens": 137}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n def visit_Attribute(self, n: Attribute) -> Union[MemberExpr, SuperExpr]:\n value = n.value\n member_expr = MemberExpr(self.visit(value), n.attr)\n obj = member_expr.expr\n if (isinstance(obj, CallExpr) and\n isinstance(obj.callee, NameExpr) and\n obj.callee.name == 'super'):\n e = SuperExpr(member_expr.name, obj) # type: Union[MemberExpr, SuperExpr]\n else:\n e = member_expr\n return self.set_line(e, n)\n\n # Subscript(expr value, slice slice, expr_context ctx)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.visit_Subscript_ASTConverter.visit_Subscript.return.e": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter.visit_Subscript_ASTConverter.visit_Subscript.return.e", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1212, "end_line": 1227, "span_ids": ["ASTConverter.visit_Subscript"], "tokens": 205}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n def visit_Subscript(self, n: ast3.Subscript) -> IndexExpr:\n e = IndexExpr(self.visit(n.value), self.visit(n.slice))\n self.set_line(e, n)\n # alias to please mypyc\n is_py38_or_earlier = sys.version_info < (3, 9)\n if (\n isinstance(n.slice, ast3.Slice) or\n (is_py38_or_earlier and isinstance(n.slice, ast3.ExtSlice))\n ):\n # Before Python 3.9, Slice has no line/column in the raw ast. To avoid incompatibility\n # visit_Slice doesn't set_line, even in Python 3.9 on.\n # ExtSlice also has no line/column info. In Python 3.9 on, line/column is set for\n # e.index when visiting n.slice.\n e.index.line = e.line\n e.index.column = e.column\n return e", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter._Starred_expr_value_exp_ASTConverter.visit_List.return.self_set_line_e_n_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter._Starred_expr_value_exp_ASTConverter.visit_List.return.self_set_line_e_n_", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1229, "end_line": 1247, "span_ids": ["ASTConverter.visit_Starred", "ASTConverter.visit_List", "ASTConverter.visit_Name", "ASTConverter.visit_Subscript"], "tokens": 220}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n\n # Starred(expr value, expr_context ctx)\n def visit_Starred(self, n: Starred) -> StarExpr:\n e = StarExpr(self.visit(n.value))\n return self.set_line(e, n)\n\n # Name(identifier id, expr_context ctx)\n def visit_Name(self, n: Name) -> NameExpr:\n e = NameExpr(n.id)\n return self.set_line(e, n)\n\n # List(expr* elts, expr_context ctx)\n def visit_List(self, n: ast3.List) -> Union[ListExpr, TupleExpr]:\n expr_list = [self.visit(e) for e in n.elts] # type: List[Expression]\n if isinstance(n.ctx, ast3.Store):\n # [x, y] = z and (x, y) = z means exactly the same thing\n e = TupleExpr(expr_list) # type: Union[ListExpr, TupleExpr]\n else:\n e = ListExpr(expr_list)\n return self.set_line(e, n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter._Tuple_expr_elts_expr__ASTConverter.visit_Index.return.self_visit_cast_Any_n_v": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_ASTConverter._Tuple_expr_elts_expr__ASTConverter.visit_Index.return.self_visit_cast_Any_n_v", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1249, "end_line": 1270, "span_ids": ["ASTConverter.visit_Tuple", "ASTConverter.visit_Slice", "ASTConverter.visit_List", "ASTConverter.visit_Index", "ASTConverter.visit_ExtSlice"], "tokens": 223}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n\n # Tuple(expr* elts, expr_context ctx)\n def visit_Tuple(self, n: ast3.Tuple) -> TupleExpr:\n e = TupleExpr(self.translate_expr_list(n.elts))\n return self.set_line(e, n)\n\n # --- slice ---\n\n # Slice(expr? lower, expr? upper, expr? step)\n def visit_Slice(self, n: ast3.Slice) -> SliceExpr:\n return SliceExpr(self.visit(n.lower),\n self.visit(n.upper),\n self.visit(n.step))\n\n # ExtSlice(slice* dims)\n def visit_ExtSlice(self, n: ast3.ExtSlice) -> TupleExpr:\n # cast for mypyc's benefit on Python 3.9\n return TupleExpr(self.translate_expr_list(cast(Any, n).dims))\n\n # Index(expr value)\n def visit_Index(self, n: Index) -> Node:\n # cast for mypyc's benefit on Python 3.9\n return self.visit(cast(Any, n).value)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_TypeConverter_TypeConverter.convert_column.if_self_override_column_.else_.return.self_override_column": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_TypeConverter_TypeConverter.convert_column.if_self_override_column_.else_.return.self_override_column", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1276, "end_line": 1300, "span_ids": ["TypeConverter.convert_column", "TypeConverter", "TypeConverter.__init__"], "tokens": 187}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeConverter:\n def __init__(self,\n errors: Optional[Errors],\n line: int = -1,\n override_column: int = -1,\n assume_str_is_unicode: bool = True,\n is_evaluated: bool = True,\n ) -> None:\n self.errors = errors\n self.line = line\n self.override_column = override_column\n self.node_stack = [] # type: List[AST]\n self.assume_str_is_unicode = assume_str_is_unicode\n self.is_evaluated = is_evaluated\n\n def convert_column(self, column: int) -> int:\n \"\"\"Apply column override if defined; otherwise return column.\n\n Column numbers are sometimes incorrect in the AST and the column\n override can be used to work around that.\n \"\"\"\n if self.override_column < 0:\n return column\n else:\n return self.override_column", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_TypeConverter.invalid_type_TypeConverter.invalid_type.return.RawExpressionType_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_TypeConverter.invalid_type_TypeConverter.invalid_type.return.RawExpressionType_", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1297, "end_line": 1313, "span_ids": ["TypeConverter.invalid_type"], "tokens": 163}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeConverter:\n\n def invalid_type(self, node: AST, note: Optional[str] = None) -> RawExpressionType:\n \"\"\"Constructs a type representing some expression that normally forms an invalid type.\n For example, if we see a type hint that says \"3 + 4\", we would transform that\n expression into a RawExpressionType.\n\n The semantic analysis layer will report an \"Invalid type\" error when it\n encounters this type, along with the given note if one is provided.\n\n See RawExpressionType's docstring for more details on how it's used.\n \"\"\"\n return RawExpressionType(\n None,\n 'typing.Any',\n line=self.line,\n column=getattr(node, 'col_offset', -1),\n note=note,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_TypeConverter.visit_TypeConverter.visit_raw_str.return.typ_or_AnyType_TypeOfAny_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_TypeConverter.visit_TypeConverter.visit_raw_str.return.typ_or_AnyType_TypeOfAny_", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1315, "end_line": 1362, "span_ids": ["TypeConverter.parent", "TypeConverter.visit", "TypeConverter.translate_expr_list", "TypeConverter.fail", "TypeConverter.note", "TypeConverter.visit_raw_str", "TypeConverter.visit_3", "TypeConverter.visit_4"], "tokens": 425}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeConverter:\n\n @overload\n def visit(self, node: ast3.expr) -> ProperType: ...\n\n @overload\n def visit(self, node: Optional[AST]) -> Optional[ProperType]: ...\n\n def visit(self, node: Optional[AST]) -> Optional[ProperType]:\n \"\"\"Modified visit -- keep track of the stack of nodes\"\"\"\n if node is None:\n return None\n self.node_stack.append(node)\n try:\n method = 'visit_' + node.__class__.__name__\n visitor = getattr(self, method, None)\n if visitor is not None:\n return visitor(node)\n else:\n return self.invalid_type(node)\n finally:\n self.node_stack.pop()\n\n def parent(self) -> Optional[AST]:\n \"\"\"Return the AST node above the one we are processing\"\"\"\n if len(self.node_stack) < 2:\n return None\n return self.node_stack[-2]\n\n def fail(self, msg: str, line: int, column: int) -> None:\n if self.errors:\n self.errors.report(line, column, msg, blocker=True, code=codes.SYNTAX)\n\n def note(self, msg: str, line: int, column: int) -> None:\n if self.errors:\n self.errors.report(line, column, msg, severity='note', code=codes.SYNTAX)\n\n def translate_expr_list(self, l: Sequence[ast3.expr]) -> List[Type]:\n return [self.visit(e) for e in l]\n\n def visit_raw_str(self, s: str) -> Type:\n # An escape hatch that allows the AST walker in fastparse2 to\n # directly hook into the Python 3.5 type converter in some cases\n # without needing to create an intermediary `Str` object.\n _, typ = parse_type_comment(s.strip(),\n self.line,\n -1,\n self.errors,\n self.assume_str_is_unicode)\n return typ or AnyType(TypeOfAny.from_error)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_TypeConverter.visit_Call_TypeConverter.visit_Call.return.CallableArgument_typ_nam": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_TypeConverter.visit_Call_TypeConverter.visit_Call.return.CallableArgument_typ_nam", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1364, "end_line": 1408, "span_ids": ["TypeConverter.visit_Call"], "tokens": 402}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeConverter:\n\n def visit_Call(self, e: Call) -> Type:\n # Parse the arg constructor\n f = e.func\n constructor = stringify_name(f)\n\n if not isinstance(self.parent(), ast3.List):\n note = None\n if constructor:\n note = \"Suggestion: use {0}[...] instead of {0}(...)\".format(constructor)\n return self.invalid_type(e, note=note)\n if not constructor:\n self.fail(\"Expected arg constructor name\", e.lineno, e.col_offset)\n\n name = None # type: Optional[str]\n default_type = AnyType(TypeOfAny.special_form)\n typ = default_type # type: Type\n for i, arg in enumerate(e.args):\n if i == 0:\n converted = self.visit(arg)\n assert converted is not None\n typ = converted\n elif i == 1:\n name = self._extract_argument_name(arg)\n else:\n self.fail(\"Too many arguments for argument constructor\",\n f.lineno, f.col_offset)\n for k in e.keywords:\n value = k.value\n if k.arg == \"name\":\n if name is not None:\n self.fail('\"{}\" gets multiple values for keyword argument \"name\"'.format(\n constructor), f.lineno, f.col_offset)\n name = self._extract_argument_name(value)\n elif k.arg == \"type\":\n if typ is not default_type:\n self.fail('\"{}\" gets multiple values for keyword argument \"type\"'.format(\n constructor), f.lineno, f.col_offset)\n converted = self.visit(value)\n assert converted is not None\n typ = converted\n else:\n self.fail(\n 'Unexpected argument \"{}\" for argument constructor'.format(k.arg),\n value.lineno, value.col_offset)\n return CallableArgument(typ, name, constructor, e.lineno, e.col_offset)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_TypeConverter.translate_argument_list_TypeConverter._Only_for_3_8_and_newer": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_TypeConverter.translate_argument_list_TypeConverter._Only_for_3_8_and_newer", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1415, "end_line": 1448, "span_ids": ["TypeConverter.translate_argument_list", "TypeConverter.visit_BinOp", "TypeConverter.visit_NameConstant", "TypeConverter._extract_argument_name", "TypeConverter.visit_Name"], "tokens": 322}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeConverter:\n\n def translate_argument_list(self, l: Sequence[ast3.expr]) -> TypeList:\n return TypeList([self.visit(e) for e in l], line=self.line)\n\n def _extract_argument_name(self, n: ast3.expr) -> Optional[str]:\n if isinstance(n, Str):\n return n.s.strip()\n elif isinstance(n, NameConstant) and str(n.value) == 'None':\n return None\n self.fail('Expected string literal for argument name, got {}'.format(\n type(n).__name__), self.line, 0)\n return None\n\n def visit_Name(self, n: Name) -> Type:\n return UnboundType(n.id, line=self.line, column=self.convert_column(n.col_offset))\n\n def visit_BinOp(self, n: ast3.BinOp) -> Type:\n if not isinstance(n.op, ast3.BitOr):\n return self.invalid_type(n)\n\n left = self.visit(n.left)\n right = self.visit(n.right)\n return UnionType([left, right],\n line=self.line,\n column=self.convert_column(n.col_offset),\n is_evaluated=self.is_evaluated,\n uses_pep604_syntax=True)\n\n def visit_NameConstant(self, n: NameConstant) -> Type:\n if isinstance(n.value, bool):\n return RawExpressionType(n.value, 'builtins.bool', line=self.line)\n else:\n return UnboundType(str(n.value), line=self.line, column=n.col_offset)\n\n # Only for 3.8 and newer", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_TypeConverter.visit_Constant_TypeConverter.visit_Constant.return.self_invalid_type_n_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_TypeConverter.visit_Constant_TypeConverter.visit_Constant.return.self_invalid_type_n_", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1432, "end_line": 1457, "span_ids": ["TypeConverter.visit_Constant"], "tokens": 282}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeConverter:\n def visit_Constant(self, n: Constant) -> Type:\n val = n.value\n if val is None:\n # None is a type.\n return UnboundType('None', line=self.line)\n if isinstance(val, str):\n # Parse forward reference.\n if (n.kind and 'u' in n.kind) or self.assume_str_is_unicode:\n return parse_type_string(n.s, 'builtins.unicode', self.line, n.col_offset,\n assume_str_is_unicode=self.assume_str_is_unicode)\n else:\n return parse_type_string(n.s, 'builtins.str', self.line, n.col_offset,\n assume_str_is_unicode=self.assume_str_is_unicode)\n if val is Ellipsis:\n # '...' is valid in some types.\n return EllipsisType(line=self.line)\n if isinstance(val, bool):\n # Special case for True/False.\n return RawExpressionType(val, 'builtins.bool', line=self.line)\n if isinstance(val, (int, float, complex)):\n return self.numeric_type(val, n)\n if isinstance(val, bytes):\n contents = bytes_to_human_readable_repr(val)\n return RawExpressionType(contents, 'builtins.bytes', self.line, column=n.col_offset)\n # Everything else is invalid.\n return self.invalid_type(n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_TypeConverter._UnaryOp_op_operand__TypeConverter.numeric_type.return.RawExpressionType_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_TypeConverter._UnaryOp_op_operand__TypeConverter.numeric_type.return.RawExpressionType_", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1459, "end_line": 1489, "span_ids": ["TypeConverter.numeric_type", "TypeConverter.visit_UnaryOp", "TypeConverter.visit_Constant"], "tokens": 322}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeConverter:\n\n # UnaryOp(op, operand)\n def visit_UnaryOp(self, n: UnaryOp) -> Type:\n # We support specifically Literal[-4] and nothing else.\n # For example, Literal[+4] or Literal[~6] is not supported.\n typ = self.visit(n.operand)\n if isinstance(typ, RawExpressionType) and isinstance(n.op, USub):\n if isinstance(typ.literal_value, int):\n typ.literal_value *= -1\n return typ\n return self.invalid_type(n)\n\n def numeric_type(self, value: object, n: AST) -> Type:\n # The node's field has the type complex, but complex isn't *really*\n # a parent of int and float, and this causes isinstance below\n # to think that the complex branch is always picked. Avoid\n # this by throwing away the type.\n if isinstance(value, int):\n numeric_value = value # type: Optional[int]\n type_name = 'builtins.int'\n else:\n # Other kinds of numbers (floats, complex) are not valid parameters for\n # RawExpressionType so we just pass in 'None' for now. We'll report the\n # appropriate error at a later stage.\n numeric_value = None\n type_name = 'builtins.{}'.format(type(value).__name__)\n return RawExpressionType(\n numeric_value,\n type_name,\n line=self.line,\n column=getattr(n, 'col_offset', -1),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_TypeConverter._These_next_three_method_TypeConverter.visit_Str.if_u_in_kind_or_self_as.else_.return.parse_type_string_n_s_b": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_TypeConverter._These_next_three_method_TypeConverter.visit_Str.if_u_in_kind_or_self_as.else_.return.parse_type_string_n_s_b", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1491, "end_line": 1518, "span_ids": ["TypeConverter.visit_Str", "TypeConverter.numeric_type", "TypeConverter.visit_Num"], "tokens": 357}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeConverter:\n\n # These next three methods are only used if we are on python <\n # 3.8, using typed_ast. They are defined unconditionally because\n # mypyc can't handle conditional method definitions.\n\n # Num(number n)\n def visit_Num(self, n: Num) -> Type:\n return self.numeric_type(n.n, n)\n\n # Str(string s)\n def visit_Str(self, n: Str) -> Type:\n # Note: we transform these fallback types into the correct types in\n # 'typeanal.py' -- specifically in the named_type_with_normalized_str method.\n # If we're analyzing Python 3, that function will translate 'builtins.unicode'\n # into 'builtins.str'. In contrast, if we're analyzing Python 2 code, we'll\n # translate 'builtins.bytes' in the method below into 'builtins.str'.\n\n # Do a getattr because the field doesn't exist in 3.8 (where\n # this method doesn't actually ever run.) We can't just do\n # an attribute access with a `# type: ignore` because it would be\n # unused on < 3.8.\n kind = getattr(n, 'kind') # type: str # noqa\n\n if 'u' in kind or self.assume_str_is_unicode:\n return parse_type_string(n.s, 'builtins.unicode', self.line, n.col_offset,\n assume_str_is_unicode=self.assume_str_is_unicode)\n else:\n return parse_type_string(n.s, 'builtins.str', self.line, n.col_offset,\n assume_str_is_unicode=self.assume_str_is_unicode)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_TypeConverter._Bytes_bytes_s__TypeConverter.visit_Subscript.if_isinstance_value_Unbo.else_.return.self_invalid_type_n_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_TypeConverter._Bytes_bytes_s__TypeConverter.visit_Subscript.if_isinstance_value_Unbo.else_.return.self_invalid_type_n_", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1520, "end_line": 1555, "span_ids": ["TypeConverter.visit_Str", "TypeConverter.visit_Bytes", "TypeConverter.visit_Subscript"], "tokens": 423}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeConverter:\n\n # Bytes(bytes s)\n def visit_Bytes(self, n: Bytes) -> Type:\n contents = bytes_to_human_readable_repr(n.s)\n return RawExpressionType(contents, 'builtins.bytes', self.line, column=n.col_offset)\n\n # Subscript(expr value, slice slice, expr_context ctx) # Python 3.8 and before\n # Subscript(expr value, expr slice, expr_context ctx) # Python 3.9 and later\n def visit_Subscript(self, n: ast3.Subscript) -> Type:\n if sys.version_info >= (3, 9): # Really 3.9a5 or later\n sliceval = n.slice # type: Any\n if (isinstance(sliceval, ast3.Slice) or\n (isinstance(sliceval, ast3.Tuple) and\n any(isinstance(x, ast3.Slice) for x in sliceval.elts))):\n self.fail(TYPE_COMMENT_SYNTAX_ERROR, self.line, getattr(n, 'col_offset', -1))\n return AnyType(TypeOfAny.from_error)\n else:\n # Python 3.8 or earlier use a different AST structure for subscripts\n if not isinstance(n.slice, Index):\n self.fail(TYPE_COMMENT_SYNTAX_ERROR, self.line, getattr(n, 'col_offset', -1))\n return AnyType(TypeOfAny.from_error)\n sliceval = n.slice.value\n\n empty_tuple_index = False\n if isinstance(sliceval, ast3.Tuple):\n params = self.translate_expr_list(sliceval.elts)\n if len(sliceval.elts) == 0:\n empty_tuple_index = True\n else:\n params = [self.visit(sliceval)]\n\n value = self.visit(n.value)\n if isinstance(value, UnboundType) and not value.args:\n return UnboundType(value.name, params, line=self.line, column=value.column,\n empty_tuple_index=empty_tuple_index)\n else:\n return self.invalid_type(n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_TypeConverter.visit_Tuple_TypeConverter.visit_List.return.self_translate_argument_l": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_TypeConverter.visit_Tuple_TypeConverter.visit_List.return.self_translate_argument_l", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1557, "end_line": 1577, "span_ids": ["TypeConverter.visit_Attribute", "TypeConverter.visit_Tuple", "TypeConverter.visit_Ellipsis", "TypeConverter.visit_List"], "tokens": 216}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeConverter:\n\n def visit_Tuple(self, n: ast3.Tuple) -> Type:\n return TupleType(self.translate_expr_list(n.elts), _dummy_fallback,\n implicit=True, line=self.line, column=self.convert_column(n.col_offset))\n\n # Attribute(expr value, identifier attr, expr_context ctx)\n def visit_Attribute(self, n: Attribute) -> Type:\n before_dot = self.visit(n.value)\n\n if isinstance(before_dot, UnboundType) and not before_dot.args:\n return UnboundType(\"{}.{}\".format(before_dot.name, n.attr), line=self.line)\n else:\n return self.invalid_type(n)\n\n # Ellipsis\n def visit_Ellipsis(self, n: ast3_Ellipsis) -> Type:\n return EllipsisType(line=self.line)\n\n # List(expr* elts, expr_context ctx)\n def visit_List(self, n: ast3.List) -> Type:\n assert isinstance(n.ctx, ast3.Load)\n return self.translate_argument_list(n.elts)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_stringify_name_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse.py_stringify_name_", "embedding": null, "metadata": {"file_path": "mypy/fastparse.py", "file_name": "fastparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1580, "end_line": 1602, "span_ids": ["bytes_to_human_readable_repr", "stringify_name"], "tokens": 177}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def stringify_name(n: AST) -> Optional[str]:\n if isinstance(n, Name):\n return n.id\n elif isinstance(n, Attribute):\n sv = stringify_name(n.value)\n if sv is not None:\n return \"{}.{}\".format(sv, n.attr)\n return None # Can't do it.\n\n\ndef bytes_to_human_readable_repr(b: bytes) -> str:\n \"\"\"Converts bytes into some human-readable representation. Unprintable\n bytes such as the nul byte are escaped. For example:\n\n >>> b = bytes([102, 111, 111, 10, 0])\n >>> s = bytes_to_human_readable_repr(b)\n >>> print(s)\n foo\\n\\x00\n >>> print(repr(s))\n 'foo\\\\n\\\\x00'\n \"\"\"\n return repr(b)[2:-1]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py___from_mypy_reachability_im": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py___from_mypy_reachability_im", "embedding": null, "metadata": {"file_path": "mypy/fastparse2.py", "file_name": "fastparse2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 53, "span_ids": ["imports:8", "docstring"], "tokens": 591}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"\nThis file is nearly identical to `fastparse.py`, except that it works with a Python 2\nAST instead of a Python 3 AST.\n\nPreviously, how we handled Python 2 code was by first obtaining the Python 2 AST via\ntyped_ast, converting it into a Python 3 AST by using typed_ast.conversion, then\nrunning it through mypy.fastparse.\n\nWhile this worked, it did add some overhead, especially in larger Python 2 codebases.\nThis module allows us to skip the conversion step, saving us some time.\n\nThe reason why this file is not easily merged with mypy.fastparse despite the large amount\nof redundancy is because the Python 2 AST and the Python 3 AST nodes belong to two completely\ndifferent class hierarchies, which made it difficult to write a shared visitor between the\ntwo in a typesafe way.\n\"\"\"\nimport sys\nimport warnings\n\nimport typing # for typing.Type, which conflicts with types.Type\nfrom typing import Tuple, Union, TypeVar, Callable, Sequence, Optional, Any, Dict, cast, List\nfrom typing_extensions import Final, Literal\n\nfrom mypy.sharedparse import (\n special_function_elide_names, argument_elide_name,\n)\nfrom mypy.nodes import (\n MypyFile, Node, ImportBase, Import, ImportAll, ImportFrom, FuncDef, OverloadedFuncDef,\n ClassDef, Decorator, Block, Var, OperatorAssignmentStmt,\n ExpressionStmt, AssignmentStmt, ReturnStmt, RaiseStmt, AssertStmt,\n DelStmt, BreakStmt, ContinueStmt, PassStmt, GlobalDecl,\n WhileStmt, ForStmt, IfStmt, TryStmt, WithStmt,\n TupleExpr, GeneratorExpr, ListComprehension, ListExpr, ConditionalExpr,\n DictExpr, SetExpr, NameExpr, IntExpr, StrExpr, UnicodeExpr,\n FloatExpr, CallExpr, SuperExpr, MemberExpr, IndexExpr, SliceExpr, OpExpr,\n UnaryExpr, LambdaExpr, ComparisonExpr, DictionaryComprehension,\n SetComprehension, ComplexExpr, EllipsisExpr, YieldExpr, Argument,\n Expression, Statement, BackquoteExpr, PrintStmt, ExecStmt,\n ARG_POS, ARG_OPT, ARG_STAR, ARG_NAMED, ARG_STAR2, OverloadPart, check_arg_names,\n FakeInfo,\n)\nfrom mypy.types import (\n Type, CallableType, AnyType, UnboundType, EllipsisType, TypeOfAny, Instance,\n ProperType\n)\nfrom mypy import message_registry, errorcodes as codes\nfrom mypy.errors import Errors\nfrom mypy.fastparse import (\n TypeConverter, parse_type_comment, bytes_to_human_readable_repr, parse_type_ignore_tag,\n TYPE_IGNORE_PATTERN, INVALID_TYPE_IGNORE\n)\nfrom mypy.options import Options\nfrom mypy.reachability import mark_block_unreachable", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_try__TYPE_COMMENT_AST_ERROR._invalid_type_comment_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_try__TYPE_COMMENT_AST_ERROR._invalid_type_comment_", "embedding": null, "metadata": {"file_path": "mypy/fastparse2.py", "file_name": "fastparse2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 55, "end_line": 89, "span_ids": ["imports:8"], "tokens": 337}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "try:\n from typed_ast import ast27\n from typed_ast.ast27 import (\n AST,\n Call,\n Name,\n Attribute,\n Tuple as ast27_Tuple,\n )\n # Import ast3 from fastparse, which has special case for Python 3.8\n from mypy.fastparse import ast3, ast3_parse\nexcept ImportError:\n try:\n from typed_ast import ast35 # type: ignore[attr-defined] # noqa: F401\n except ImportError:\n print('The typed_ast package is not installed.\\n'\n 'For Python 2 support, install mypy using `python3 -m pip install \"mypy[python2]\"`'\n 'Alternatively, you can install typed_ast with `python3 -m pip install typed-ast`.',\n file=sys.stderr)\n else:\n print('You need a more recent version of the typed_ast package.\\n'\n 'You can update to the latest version with '\n '`python3 -m pip install -U typed-ast`.',\n file=sys.stderr)\n sys.exit(1)\n\nN = TypeVar('N', bound=Node)\n\n# There is no way to create reasonable fallbacks at this stage,\n# they must be patched later.\nMISSING_FALLBACK = FakeInfo(\"fallback can't be filled out until semanal\") # type: Final\n_dummy_fallback = Instance(MISSING_FALLBACK, [], -1) # type: Final\n\nTYPE_COMMENT_SYNTAX_ERROR = 'syntax error in type comment' # type: Final\nTYPE_COMMENT_AST_ERROR = 'invalid type comment'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_None_7_is_no_type_check_decorator.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_None_7_is_no_type_check_decorator.return.False", "embedding": null, "metadata": {"file_path": "mypy/fastparse2.py", "file_name": "fastparse2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 88, "end_line": 138, "span_ids": ["parse", "is_no_type_check_decorator", "imports:8"], "tokens": 401}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": " # type: Final\n\n\ndef parse(source: Union[str, bytes],\n fnam: str,\n module: Optional[str],\n errors: Optional[Errors] = None,\n options: Optional[Options] = None) -> MypyFile:\n \"\"\"Parse a source file, without doing any semantic analysis.\n\n Return the parse tree. If errors is not provided, raise ParseError\n on failure. Otherwise, use the errors object to report parse errors.\n \"\"\"\n raise_on_error = False\n if errors is None:\n errors = Errors()\n raise_on_error = True\n if options is None:\n options = Options()\n errors.set_file(fnam, module)\n is_stub_file = fnam.endswith('.pyi')\n try:\n assert options.python_version[0] < 3 and not is_stub_file\n # Disable deprecation warnings about <>.\n with warnings.catch_warnings():\n warnings.filterwarnings(\"ignore\", category=DeprecationWarning)\n ast = ast27.parse(source, fnam, 'exec')\n tree = ASTConverter(options=options,\n errors=errors,\n ).visit(ast)\n assert isinstance(tree, MypyFile)\n tree.path = fnam\n tree.is_stub = is_stub_file\n except SyntaxError as e:\n errors.report(e.lineno if e.lineno is not None else -1, e.offset, e.msg, blocker=True,\n code=codes.SYNTAX)\n tree = MypyFile([], [], False, {})\n\n if raise_on_error and errors.is_errors():\n errors.raise_error()\n\n return tree\n\n\ndef is_no_type_check_decorator(expr: ast27.expr) -> bool:\n if isinstance(expr, Name):\n return expr.id == 'no_type_check'\n elif isinstance(expr, Attribute):\n if isinstance(expr.value, Name):\n return expr.value.id == 'typing' and expr.attr == 'no_type_check'\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter_ASTConverter.get_lineno.return.node_lineno": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter_ASTConverter.get_lineno.return.node_lineno", "embedding": null, "metadata": {"file_path": "mypy/fastparse2.py", "file_name": "fastparse2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 141, "end_line": 207, "span_ids": ["ASTConverter.get_lineno", "ASTConverter.visit", "ASTConverter.set_line", "ASTConverter.__init__", "ASTConverter", "ASTConverter.translate_expr_list", "ASTConverter.fail"], "tokens": 730}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n def __init__(self,\n options: Options,\n errors: Errors) -> None:\n # 'C' for class, 'F' for function\n self.class_and_function_stack = [] # type: List[Literal['C', 'F']]\n self.imports = [] # type: List[ImportBase]\n\n self.options = options\n self.errors = errors\n\n # Indicates whether this file is being parsed with unicode_literals enabled.\n # Note: typed_ast already naturally takes unicode_literals into account when\n # parsing so we don't have to worry when analyzing strings within this class.\n #\n # The only place where we use this field is when we call fastparse's TypeConverter\n # and any related methods. That class accepts a Python 3 AST instead of a Python 2\n # AST: as a result, it don't special-case the `unicode_literals` import and won't know\n # exactly whether to parse some string as bytes or unicode.\n #\n # This distinction is relevant mostly when handling Literal types -- Literal[u\"foo\"]\n # is not the same type as Literal[b\"foo\"], and Literal[\"foo\"] could mean either the\n # former or the latter based on context.\n #\n # This field is set in the 'visit_ImportFrom' method: it's ok to delay computing it\n # because any `from __future__ import blah` import must be located at the top of the\n # file, with the exception of the docstring. This means we're guaranteed to correctly\n # set this field before we encounter any type hints.\n self.unicode_literals = False\n\n # Cache of visit_X methods keyed by type of visited object\n self.visitor_cache = {} # type: Dict[type, Callable[[Optional[AST]], Any]]\n\n self.type_ignores = {} # type: Dict[int, List[str]]\n\n def fail(self, msg: str, line: int, column: int, blocker: bool = True) -> None:\n if blocker or not self.options.ignore_errors:\n self.errors.report(line, column, msg, blocker=blocker, code=codes.SYNTAX)\n\n def visit(self, node: Optional[AST]) -> Any: # same as in typed_ast stub\n if node is None:\n return None\n typeobj = type(node)\n visitor = self.visitor_cache.get(typeobj)\n if visitor is None:\n method = 'visit_' + node.__class__.__name__\n visitor = getattr(self, method)\n self.visitor_cache[typeobj] = visitor\n return visitor(node)\n\n def set_line(self, node: N, n: Union[ast27.expr, ast27.stmt, ast27.ExceptHandler]) -> N:\n node.line = n.lineno\n node.column = n.col_offset\n return node\n\n def translate_expr_list(self, l: Sequence[AST]) -> List[Expression]:\n res = [] # type: List[Expression]\n for e in l:\n exp = self.visit(e)\n assert isinstance(exp, Expression)\n res.append(exp)\n return res\n\n def get_lineno(self, node: Union[ast27.expr, ast27.stmt]) -> int:\n if isinstance(node, (ast27.ClassDef, ast27.FunctionDef)) and node.decorator_list:\n return node.decorator_list[0].lineno\n return node.lineno", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.translate_stmt_list_ASTConverter.translate_stmt_list.return.res": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.translate_stmt_list_ASTConverter.translate_stmt_list.return.res", "embedding": null, "metadata": {"file_path": "mypy/fastparse2.py", "file_name": "fastparse2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 209, "end_line": 226, "span_ids": ["ASTConverter.translate_stmt_list"], "tokens": 178}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n\n def translate_stmt_list(self,\n stmts: Sequence[ast27.stmt],\n module: bool = False) -> List[Statement]:\n # A \"# type: ignore\" comment before the first statement of a module\n # ignores the whole module:\n if (module and stmts and self.type_ignores\n and min(self.type_ignores) < self.get_lineno(stmts[0])):\n self.errors.used_ignored_lines[self.errors.file].add(min(self.type_ignores))\n block = Block(self.fix_function_overloads(self.translate_stmt_list(stmts)))\n mark_block_unreachable(block)\n return [block]\n\n res = [] # type: List[Statement]\n for stmt in stmts:\n node = self.visit(stmt)\n assert isinstance(node, Statement)\n res.append(node)\n return res", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.translate_type_comment_ASTConverter.as_required_block.return.b": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.translate_type_comment_ASTConverter.as_required_block.return.b", "embedding": null, "metadata": {"file_path": "mypy/fastparse2.py", "file_name": "fastparse2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 228, "end_line": 298, "span_ids": ["ASTConverter.as_block", "ASTConverter:4", "ASTConverter.as_required_block", "ASTConverter.translate_type_comment", "ASTConverter.from_operator", "ASTConverter:2", "ASTConverter.from_comp_operator"], "tokens": 598}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n\n def translate_type_comment(self, n: ast27.stmt,\n type_comment: Optional[str]) -> Optional[ProperType]:\n if type_comment is None:\n return None\n else:\n lineno = n.lineno\n extra_ignore, typ = parse_type_comment(type_comment,\n lineno,\n n.col_offset,\n self.errors,\n assume_str_is_unicode=self.unicode_literals)\n if extra_ignore is not None:\n self.type_ignores[lineno] = extra_ignore\n return typ\n\n op_map = {\n ast27.Add: '+',\n ast27.Sub: '-',\n ast27.Mult: '*',\n ast27.Div: '/',\n ast27.Mod: '%',\n ast27.Pow: '**',\n ast27.LShift: '<<',\n ast27.RShift: '>>',\n ast27.BitOr: '|',\n ast27.BitXor: '^',\n ast27.BitAnd: '&',\n ast27.FloorDiv: '//'\n } # type: Final[Dict[typing.Type[AST], str]]\n\n def from_operator(self, op: ast27.operator) -> str:\n op_name = ASTConverter.op_map.get(type(op))\n if op_name is None:\n raise RuntimeError('Unknown operator ' + str(type(op)))\n elif op_name == '@':\n raise RuntimeError('mypy does not support the MatMult operator')\n else:\n return op_name\n\n comp_op_map = {\n ast27.Gt: '>',\n ast27.Lt: '<',\n ast27.Eq: '==',\n ast27.GtE: '>=',\n ast27.LtE: '<=',\n ast27.NotEq: '!=',\n ast27.Is: 'is',\n ast27.IsNot: 'is not',\n ast27.In: 'in',\n ast27.NotIn: 'not in'\n } # type: Final[Dict[typing.Type[AST], str]]\n\n def from_comp_operator(self, op: ast27.cmpop) -> str:\n op_name = ASTConverter.comp_op_map.get(type(op))\n if op_name is None:\n raise RuntimeError('Unknown comparison operator ' + str(type(op)))\n else:\n return op_name\n\n def as_block(self, stmts: List[ast27.stmt], lineno: int) -> Optional[Block]:\n b = None\n if stmts:\n b = Block(self.fix_function_overloads(self.translate_stmt_list(stmts)))\n b.set_line(lineno)\n return b\n\n def as_required_block(self, stmts: List[ast27.stmt], lineno: int) -> Block:\n assert stmts # must be non-empty\n b = Block(self.fix_function_overloads(self.translate_stmt_list(stmts)))\n b.set_line(lineno)\n return b", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.fix_function_overloads_ASTConverter.fix_function_overloads.return.ret": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.fix_function_overloads_ASTConverter.fix_function_overloads.return.ret", "embedding": null, "metadata": {"file_path": "mypy/fastparse2.py", "file_name": "fastparse2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 300, "end_line": 327, "span_ids": ["ASTConverter.fix_function_overloads"], "tokens": 251}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n\n def fix_function_overloads(self, stmts: List[Statement]) -> List[Statement]:\n ret = [] # type: List[Statement]\n current_overload = [] # type: List[OverloadPart]\n current_overload_name = None # type: Optional[str]\n for stmt in stmts:\n if (current_overload_name is not None\n and isinstance(stmt, (Decorator, FuncDef))\n and stmt.name == current_overload_name):\n current_overload.append(stmt)\n else:\n if len(current_overload) == 1:\n ret.append(current_overload[0])\n elif len(current_overload) > 1:\n ret.append(OverloadedFuncDef(current_overload))\n\n if isinstance(stmt, Decorator):\n current_overload = [stmt]\n current_overload_name = stmt.name\n else:\n current_overload = []\n current_overload_name = None\n ret.append(stmt)\n\n if len(current_overload) == 1:\n ret.append(current_overload[0])\n elif len(current_overload) > 1:\n ret.append(OverloadedFuncDef(current_overload))\n return ret", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.in_method_scope_ASTConverter.translate_module_id.return.id": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.in_method_scope_ASTConverter.translate_module_id.return.id", "embedding": null, "metadata": {"file_path": "mypy/fastparse2.py", "file_name": "fastparse2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 329, "end_line": 343, "span_ids": ["ASTConverter.in_method_scope", "ASTConverter.translate_module_id"], "tokens": 152}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n\n def in_method_scope(self) -> bool:\n return self.class_and_function_stack[-2:] == ['C', 'F']\n\n def translate_module_id(self, id: str) -> str:\n \"\"\"Return the actual, internal module id for a source text id.\n\n For example, translate '__builtin__' in Python 2 to 'builtins'.\n \"\"\"\n if id == self.options.custom_typing_module:\n return 'typing'\n elif id == '__builtin__':\n # HACK: __builtin__ in Python 2 is aliases to builtins. However, the implementation\n # is named __builtin__.py (there is another layer of translation elsewhere).\n return 'builtins'\n return id", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.visit_Module_ASTConverter._arg_kwarg": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.visit_Module_ASTConverter._arg_kwarg", "embedding": null, "metadata": {"file_path": "mypy/fastparse2.py", "file_name": "fastparse2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 345, "end_line": 364, "span_ids": ["ASTConverter.visit_Module"], "tokens": 212}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n\n def visit_Module(self, mod: ast27.Module) -> MypyFile:\n self.type_ignores = {}\n for ti in mod.type_ignores:\n parsed = parse_type_ignore_tag(ti.tag) # type: ignore[attr-defined]\n if parsed is not None:\n self.type_ignores[ti.lineno] = parsed\n else:\n self.fail(INVALID_TYPE_IGNORE, ti.lineno, -1)\n body = self.fix_function_overloads(self.translate_stmt_list(mod.body, module=True))\n return MypyFile(body,\n self.imports,\n False,\n self.type_ignores,\n )\n\n # --- stmt ---\n # FunctionDef(identifier name, arguments args,\n # stmt* body, expr* decorator_list, expr? returns, string? type_comment)\n # arguments = (arg* args, arg? vararg, arg* kwonlyargs, expr* kw_defaults,\n # arg? kwarg, expr* defaults)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.visit_FunctionDef_ASTConverter.visit_FunctionDef.if_any_arg_types_or_retu.if_len_arg_types_1_an.else_.func_type.CallableType_a_if_a_is_n": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.visit_FunctionDef_ASTConverter.visit_FunctionDef.if_any_arg_types_or_retu.if_len_arg_types_1_an.else_.func_type.CallableType_a_if_a_is_n", "embedding": null, "metadata": {"file_path": "mypy/fastparse2.py", "file_name": "fastparse2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 366, "end_line": 437, "span_ids": ["ASTConverter.visit_FunctionDef"], "tokens": 816}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n def visit_FunctionDef(self, n: ast27.FunctionDef) -> Statement:\n self.class_and_function_stack.append('F')\n lineno = n.lineno\n converter = TypeConverter(self.errors, line=lineno, override_column=n.col_offset,\n assume_str_is_unicode=self.unicode_literals)\n args, decompose_stmts = self.transform_args(n.args, lineno)\n\n arg_kinds = [arg.kind for arg in args]\n arg_names = [arg.variable.name for arg in args] # type: List[Optional[str]]\n arg_names = [None if argument_elide_name(name) else name for name in arg_names]\n if special_function_elide_names(n.name):\n arg_names = [None] * len(arg_names)\n\n arg_types = [] # type: List[Optional[Type]]\n type_comment = n.type_comment\n if (n.decorator_list and any(is_no_type_check_decorator(d) for d in n.decorator_list)):\n arg_types = [None] * len(args)\n return_type = None\n elif type_comment is not None and len(type_comment) > 0:\n try:\n func_type_ast = ast3_parse(type_comment, '', 'func_type')\n assert isinstance(func_type_ast, ast3.FunctionType)\n # for ellipsis arg\n if (len(func_type_ast.argtypes) == 1 and\n isinstance(func_type_ast.argtypes[0], ast3.Ellipsis)):\n arg_types = [a.type_annotation\n if a.type_annotation is not None\n else AnyType(TypeOfAny.unannotated)\n for a in args]\n else:\n # PEP 484 disallows both type annotations and type comments\n if any(a.type_annotation is not None for a in args):\n self.fail(message_registry.DUPLICATE_TYPE_SIGNATURES, lineno, n.col_offset)\n arg_types = [a if a is not None else AnyType(TypeOfAny.unannotated) for\n a in converter.translate_expr_list(func_type_ast.argtypes)]\n return_type = converter.visit(func_type_ast.returns)\n\n # add implicit self type\n if self.in_method_scope() and len(arg_types) < len(args):\n arg_types.insert(0, AnyType(TypeOfAny.special_form))\n except SyntaxError:\n stripped_type = type_comment.split(\"#\", 2)[0].strip()\n err_msg = '{} \"{}\"'.format(TYPE_COMMENT_SYNTAX_ERROR, stripped_type)\n self.fail(err_msg, lineno, n.col_offset)\n arg_types = [AnyType(TypeOfAny.from_error)] * len(args)\n return_type = AnyType(TypeOfAny.from_error)\n else:\n arg_types = [a.type_annotation for a in args]\n return_type = converter.visit(None)\n\n for arg, arg_type in zip(args, arg_types):\n self.set_type_optional(arg_type, arg.initializer)\n\n func_type = None\n if any(arg_types) or return_type:\n if len(arg_types) != 1 and any(isinstance(t, EllipsisType)\n for t in arg_types):\n self.fail(\"Ellipses cannot accompany other argument types \"\n \"in function type signature\", lineno, n.col_offset)\n elif len(arg_types) > len(arg_kinds):\n self.fail('Type signature has too many arguments', lineno, n.col_offset,\n blocker=False)\n elif len(arg_types) < len(arg_kinds):\n self.fail('Type signature has too few arguments', lineno, n.col_offset,\n blocker=False)\n else:\n any_type = AnyType(TypeOfAny.unannotated)\n func_type = CallableType([a if a is not None else any_type for a in arg_types],\n arg_kinds,\n arg_names,\n return_type if return_type is not None else any_type,\n _dummy_fallback)\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.visit_FunctionDef.body_ASTConverter.set_type_optional.if_isinstance_type_Unbou.type.optional.optional": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.visit_FunctionDef.body_ASTConverter.set_type_optional.if_isinstance_type_Unbou.type.optional.optional", "embedding": null, "metadata": {"file_path": "mypy/fastparse2.py", "file_name": "fastparse2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 438, "end_line": 476, "span_ids": ["ASTConverter.visit_FunctionDef", "ASTConverter.set_type_optional"], "tokens": 381}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n def visit_FunctionDef(self, n: ast27.FunctionDef) -> Statement:\n # ... other code\n\n body = self.as_required_block(n.body, lineno)\n if decompose_stmts:\n body.body = decompose_stmts + body.body\n func_def = FuncDef(n.name,\n args,\n body,\n func_type)\n if isinstance(func_def.type, CallableType):\n # semanal.py does some in-place modifications we want to avoid\n func_def.unanalyzed_type = func_def.type.copy_modified()\n if func_type is not None:\n func_type.definition = func_def\n func_type.line = lineno\n\n if n.decorator_list:\n var = Var(func_def.name)\n var.is_ready = False\n var.set_line(n.decorator_list[0].lineno)\n\n func_def.is_decorated = True\n func_def.set_line(lineno + len(n.decorator_list))\n func_def.body.set_line(func_def.get_line())\n dec = Decorator(func_def, self.translate_expr_list(n.decorator_list), var)\n dec.set_line(lineno, n.col_offset)\n retval = dec # type: Statement\n else:\n # Overrides set_line -- can't use self.set_line\n func_def.set_line(lineno, n.col_offset)\n retval = func_def\n self.class_and_function_stack.pop()\n return retval\n\n def set_type_optional(self, type: Optional[Type], initializer: Optional[Expression]) -> None:\n if self.options.no_implicit_optional:\n return\n # Indicate that type should be wrapped in an Optional if arg is initialized to None.\n optional = isinstance(initializer, NameExpr) and initializer.name == 'None'\n if isinstance(type, UnboundType):\n type.optional = optional", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.transform_args_ASTConverter.transform_args.return.new_args_decompose_stmts": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.transform_args_ASTConverter.transform_args.return.new_args_decompose_stmts", "embedding": null, "metadata": {"file_path": "mypy/fastparse2.py", "file_name": "fastparse2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 478, "end_line": 525, "span_ids": ["ASTConverter.transform_args"], "tokens": 463}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n\n def transform_args(self,\n n: ast27.arguments,\n line: int,\n ) -> Tuple[List[Argument], List[Statement]]:\n type_comments = n.type_comments # type: Sequence[Optional[str]]\n converter = TypeConverter(self.errors, line=line,\n assume_str_is_unicode=self.unicode_literals)\n decompose_stmts = [] # type: List[Statement]\n\n n_args = n.args\n args = [(self.convert_arg(i, arg, line, decompose_stmts),\n self.get_type(i, type_comments, converter))\n for i, arg in enumerate(n_args)]\n defaults = self.translate_expr_list(n.defaults)\n names = [name for arg in n_args for name in self.extract_names(arg)] # type: List[str]\n\n new_args = [] # type: List[Argument]\n num_no_defaults = len(args) - len(defaults)\n # positional arguments without defaults\n for a, annotation in args[:num_no_defaults]:\n new_args.append(Argument(a, annotation, None, ARG_POS))\n\n # positional arguments with defaults\n for (a, annotation), d in zip(args[num_no_defaults:], defaults):\n new_args.append(Argument(a, annotation, d, ARG_OPT))\n\n # *arg\n if n.vararg is not None:\n new_args.append(Argument(Var(n.vararg),\n self.get_type(len(args), type_comments, converter),\n None,\n ARG_STAR))\n names.append(n.vararg)\n\n # **kwarg\n if n.kwarg is not None:\n typ = self.get_type(len(args) + (0 if n.vararg is None else 1),\n type_comments,\n converter)\n new_args.append(Argument(Var(n.kwarg), typ, None, ARG_STAR2))\n names.append(n.kwarg)\n\n # We don't have any context object to give, but we have closed around the line num\n def fail_arg(msg: str, arg: None) -> None:\n self.fail(msg, line, 0)\n check_arg_names(names, [None] * len(names), fail_arg)\n\n return new_args, decompose_stmts", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.extract_names_ASTConverter.convert_arg.return.Var_v_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.extract_names_ASTConverter.convert_arg.return.Var_v_", "embedding": null, "metadata": {"file_path": "mypy/fastparse2.py", "file_name": "fastparse2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 527, "end_line": 548, "span_ids": ["ASTConverter.extract_names", "ASTConverter.convert_arg"], "tokens": 207}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n\n def extract_names(self, arg: ast27.expr) -> List[str]:\n if isinstance(arg, Name):\n return [arg.id]\n elif isinstance(arg, ast27_Tuple):\n return [name for elt in arg.elts for name in self.extract_names(elt)]\n else:\n return []\n\n def convert_arg(self, index: int, arg: ast27.expr, line: int,\n decompose_stmts: List[Statement]) -> Var:\n if isinstance(arg, Name):\n v = arg.id\n elif isinstance(arg, ast27_Tuple):\n v = '__tuple_arg_{}'.format(index + 1)\n rvalue = NameExpr(v)\n rvalue.set_line(line)\n assignment = AssignmentStmt([self.visit(arg)], rvalue)\n assignment.set_line(line)\n decompose_stmts.append(assignment)\n else:\n raise RuntimeError(\"'{}' is not a valid argument.\".format(ast27.dump(arg)))\n return Var(v)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.get_type_ASTConverter.get_type.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.get_type_ASTConverter.get_type.return.None", "embedding": null, "metadata": {"file_path": "mypy/fastparse2.py", "file_name": "fastparse2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 550, "end_line": 567, "span_ids": ["ASTConverter.get_type"], "tokens": 154}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n\n def get_type(self,\n i: int,\n type_comments: Sequence[Optional[str]],\n converter: TypeConverter) -> Optional[Type]:\n if i < len(type_comments):\n comment = type_comments[i]\n if comment is not None:\n typ = converter.visit_raw_str(comment)\n extra_ignore = TYPE_IGNORE_PATTERN.match(comment)\n if extra_ignore:\n tag = cast(Any, extra_ignore).group(1) # type: Optional[str]\n ignored = parse_type_ignore_tag(tag)\n if ignored is None:\n self.fail(INVALID_TYPE_IGNORE, converter.line, -1)\n else:\n self.type_ignores[converter.line] = ignored\n return typ\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.stringify_name_ASTConverter.visit_ClassDef.return.cdef": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.stringify_name_ASTConverter.visit_ClassDef.return.cdef", "embedding": null, "metadata": {"file_path": "mypy/fastparse2.py", "file_name": "fastparse2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 569, "end_line": 595, "span_ids": ["ASTConverter.visit_ClassDef", "ASTConverter.stringify_name"], "tokens": 230}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n\n def stringify_name(self, n: AST) -> str:\n if isinstance(n, Name):\n return n.id\n elif isinstance(n, Attribute):\n return \"{}.{}\".format(self.stringify_name(n.value), n.attr)\n else:\n assert False, \"can't stringify \" + str(type(n))\n\n # ClassDef(identifier name,\n # expr* bases,\n # keyword* keywords,\n # stmt* body,\n # expr* decorator_list)\n def visit_ClassDef(self, n: ast27.ClassDef) -> ClassDef:\n self.class_and_function_stack.append('C')\n\n cdef = ClassDef(n.name,\n self.as_required_block(n.body, n.lineno),\n None,\n self.translate_expr_list(n.bases),\n metaclass=None)\n cdef.decorators = self.translate_expr_list(n.decorator_list)\n cdef.line = n.lineno + len(n.decorator_list)\n cdef.column = n.col_offset\n cdef.end_line = n.lineno\n self.class_and_function_stack.pop()\n return cdef", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter._Return_expr_value__ASTConverter.visit_With.return.self_set_line_stmt_n_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter._Return_expr_value__ASTConverter.visit_With.return.self_set_line_stmt_n_", "embedding": null, "metadata": {"file_path": "mypy/fastparse2.py", "file_name": "fastparse2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 597, "end_line": 658, "span_ids": ["ASTConverter.visit_For", "ASTConverter.visit_While", "ASTConverter.visit_Assign", "ASTConverter.visit_ClassDef", "ASTConverter.visit_If", "ASTConverter.visit_AugAssign", "ASTConverter.visit_Return", "ASTConverter.visit_With", "ASTConverter.visit_Delete"], "tokens": 628}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n\n # Return(expr? value)\n def visit_Return(self, n: ast27.Return) -> ReturnStmt:\n stmt = ReturnStmt(self.visit(n.value))\n return self.set_line(stmt, n)\n\n # Delete(expr* targets)\n def visit_Delete(self, n: ast27.Delete) -> DelStmt:\n if len(n.targets) > 1:\n tup = TupleExpr(self.translate_expr_list(n.targets))\n tup.set_line(n.lineno)\n stmt = DelStmt(tup)\n else:\n stmt = DelStmt(self.visit(n.targets[0]))\n return self.set_line(stmt, n)\n\n # Assign(expr* targets, expr value, string? type_comment)\n def visit_Assign(self, n: ast27.Assign) -> AssignmentStmt:\n typ = self.translate_type_comment(n, n.type_comment)\n stmt = AssignmentStmt(self.translate_expr_list(n.targets),\n self.visit(n.value),\n type=typ)\n return self.set_line(stmt, n)\n\n # AugAssign(expr target, operator op, expr value)\n def visit_AugAssign(self, n: ast27.AugAssign) -> OperatorAssignmentStmt:\n stmt = OperatorAssignmentStmt(self.from_operator(n.op),\n self.visit(n.target),\n self.visit(n.value))\n return self.set_line(stmt, n)\n\n # For(expr target, expr iter, stmt* body, stmt* orelse, string? type_comment)\n def visit_For(self, n: ast27.For) -> ForStmt:\n typ = self.translate_type_comment(n, n.type_comment)\n stmt = ForStmt(self.visit(n.target),\n self.visit(n.iter),\n self.as_required_block(n.body, n.lineno),\n self.as_block(n.orelse, n.lineno),\n typ)\n return self.set_line(stmt, n)\n\n # While(expr test, stmt* body, stmt* orelse)\n def visit_While(self, n: ast27.While) -> WhileStmt:\n stmt = WhileStmt(self.visit(n.test),\n self.as_required_block(n.body, n.lineno),\n self.as_block(n.orelse, n.lineno))\n return self.set_line(stmt, n)\n\n # If(expr test, stmt* body, stmt* orelse)\n def visit_If(self, n: ast27.If) -> IfStmt:\n stmt = IfStmt([self.visit(n.test)],\n [self.as_required_block(n.body, n.lineno)],\n self.as_block(n.orelse, n.lineno))\n return self.set_line(stmt, n)\n\n # With(withitem* items, stmt* body, string? type_comment)\n def visit_With(self, n: ast27.With) -> WithStmt:\n typ = self.translate_type_comment(n, n.type_comment)\n stmt = WithStmt([self.visit(n.context_expr)],\n [self.visit(n.optional_vars)],\n self.as_required_block(n.body, n.lineno),\n typ)\n return self.set_line(stmt, n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.visit_Raise_ASTConverter.visit_Raise.return.self_set_line_stmt_n_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.visit_Raise_ASTConverter.visit_Raise.return.self_set_line_stmt_n_", "embedding": null, "metadata": {"file_path": "mypy/fastparse2.py", "file_name": "fastparse2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 660, "end_line": 673, "span_ids": ["ASTConverter.visit_Raise"], "tokens": 121}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n\n def visit_Raise(self, n: ast27.Raise) -> RaiseStmt:\n if n.type is None:\n e = None\n else:\n if n.inst is None:\n e = self.visit(n.type)\n else:\n if n.tback is None:\n e = TupleExpr([self.visit(n.type), self.visit(n.inst)])\n else:\n e = TupleExpr([self.visit(n.type), self.visit(n.inst), self.visit(n.tback)])\n\n stmt = RaiseStmt(e, None)\n return self.set_line(stmt, n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter._TryExcept_stmt_body_e_ASTConverter.visit_TryFinally.return.self_set_line_stmt_n_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter._TryExcept_stmt_body_e_ASTConverter.visit_TryFinally.return.self_set_line_stmt_n_", "embedding": null, "metadata": {"file_path": "mypy/fastparse2.py", "file_name": "fastparse2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 675, "end_line": 685, "span_ids": ["ASTConverter.visit_TryExcept", "ASTConverter.visit_Raise", "ASTConverter.visit_TryFinally"], "tokens": 167}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n\n # TryExcept(stmt* body, excepthandler* handlers, stmt* orelse)\n def visit_TryExcept(self, n: ast27.TryExcept) -> TryStmt:\n stmt = self.try_handler(n.body, n.handlers, n.orelse, [], n.lineno)\n return self.set_line(stmt, n)\n\n def visit_TryFinally(self, n: ast27.TryFinally) -> TryStmt:\n if len(n.body) == 1 and isinstance(n.body[0], ast27.TryExcept):\n stmt = self.try_handler([n.body[0]], [], [], n.finalbody, n.lineno)\n else:\n stmt = self.try_handler(n.body, [], [], n.finalbody, n.lineno)\n return self.set_line(stmt, n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.try_handler_ASTConverter.try_handler.return.TryStmt_self_as_required_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.try_handler_ASTConverter.try_handler.return.TryStmt_self_as_required_", "embedding": null, "metadata": {"file_path": "mypy/fastparse2.py", "file_name": "fastparse2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 687, "end_line": 711, "span_ids": ["ASTConverter.try_handler"], "tokens": 231}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n\n def try_handler(self,\n body: List[ast27.stmt],\n handlers: List[ast27.ExceptHandler],\n orelse: List[ast27.stmt],\n finalbody: List[ast27.stmt],\n lineno: int) -> TryStmt:\n vs = [] # type: List[Optional[NameExpr]]\n for item in handlers:\n if item.name is None:\n vs.append(None)\n elif isinstance(item.name, Name):\n vs.append(self.set_line(NameExpr(item.name.id), item))\n else:\n self.fail(\"Sorry, `except , ` is not supported\",\n item.lineno, item.col_offset)\n vs.append(None)\n types = [self.visit(h.type) for h in handlers]\n handlers_ = [self.as_required_block(h.body, h.lineno) for h in handlers]\n\n return TryStmt(self.as_required_block(body, lineno),\n vs,\n types,\n handlers_,\n self.as_block(orelse, lineno),\n self.as_block(finalbody, lineno))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.visit_Print_ASTConverter._Import_alias_names_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.visit_Print_ASTConverter._Import_alias_names_", "embedding": null, "metadata": {"file_path": "mypy/fastparse2.py", "file_name": "fastparse2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 713, "end_line": 732, "span_ids": ["ASTConverter.visit_Repr", "ASTConverter.visit_Print", "ASTConverter.visit_Assert", "ASTConverter.visit_Exec"], "tokens": 195}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n\n def visit_Print(self, n: ast27.Print) -> PrintStmt:\n stmt = PrintStmt(self.translate_expr_list(n.values), n.nl, self.visit(n.dest))\n return self.set_line(stmt, n)\n\n def visit_Exec(self, n: ast27.Exec) -> ExecStmt:\n stmt = ExecStmt(self.visit(n.body),\n self.visit(n.globals),\n self.visit(n.locals))\n return self.set_line(stmt, n)\n\n def visit_Repr(self, n: ast27.Repr) -> BackquoteExpr:\n stmt = BackquoteExpr(self.visit(n.value))\n return self.set_line(stmt, n)\n\n # Assert(expr test, expr? msg)\n def visit_Assert(self, n: ast27.Assert) -> AssertStmt:\n stmt = AssertStmt(self.visit(n.test), self.visit(n.msg))\n return self.set_line(stmt, n)\n\n # Import(alias* names)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.visit_Import_ASTConverter._ImportFrom_identifier_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.visit_Import_ASTConverter._ImportFrom_identifier_", "embedding": null, "metadata": {"file_path": "mypy/fastparse2.py", "file_name": "fastparse2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 733, "end_line": 748, "span_ids": ["ASTConverter.visit_Import"], "tokens": 164}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n def visit_Import(self, n: ast27.Import) -> Import:\n names = [] # type: List[Tuple[str, Optional[str]]]\n for alias in n.names:\n name = self.translate_module_id(alias.name)\n asname = alias.asname\n if asname is None and name != alias.name:\n # if the module name has been translated (and it's not already\n # an explicit import-as), make it an implicit import-as the\n # original name\n asname = alias.name\n names.append((name, asname))\n i = Import(names)\n self.imports.append(i)\n return self.set_line(i, n)\n\n # ImportFrom(identifier? module, alias* names, int? level)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.visit_ImportFrom_ASTConverter.visit_ImportFrom.return.self_set_line_i_n_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.visit_ImportFrom_ASTConverter.visit_ImportFrom.return.self_set_line_i_n_", "embedding": null, "metadata": {"file_path": "mypy/fastparse2.py", "file_name": "fastparse2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 749, "end_line": 762, "span_ids": ["ASTConverter.visit_ImportFrom"], "tokens": 189}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n def visit_ImportFrom(self, n: ast27.ImportFrom) -> ImportBase:\n assert n.level is not None\n if len(n.names) == 1 and n.names[0].name == '*':\n mod = n.module if n.module is not None else ''\n i = ImportAll(mod, n.level) # type: ImportBase\n else:\n module_id = self.translate_module_id(n.module) if n.module is not None else ''\n i = ImportFrom(module_id, n.level, [(a.name, a.asname) for a in n.names])\n\n # See comments in the constructor for more information about this field.\n if module_id == '__future__' and any(a.name == 'unicode_literals' for a in n.names):\n self.unicode_literals = True\n self.imports.append(i)\n return self.set_line(i, n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter._Global_identifier_name_ASTConverter._BoolOp_boolop_op_expr_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter._Global_identifier_name_ASTConverter._BoolOp_boolop_op_expr_", "embedding": null, "metadata": {"file_path": "mypy/fastparse2.py", "file_name": "fastparse2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 764, "end_line": 792, "span_ids": ["ASTConverter.visit_Break", "ASTConverter.visit_Continue", "ASTConverter.visit_Global", "ASTConverter.visit_ImportFrom", "ASTConverter.visit_Pass", "ASTConverter.visit_Expr"], "tokens": 219}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n\n # Global(identifier* names)\n def visit_Global(self, n: ast27.Global) -> GlobalDecl:\n stmt = GlobalDecl(n.names)\n return self.set_line(stmt, n)\n\n # Expr(expr value)\n def visit_Expr(self, n: ast27.Expr) -> ExpressionStmt:\n value = self.visit(n.value)\n stmt = ExpressionStmt(value)\n return self.set_line(stmt, n)\n\n # Pass\n def visit_Pass(self, n: ast27.Pass) -> PassStmt:\n stmt = PassStmt()\n return self.set_line(stmt, n)\n\n # Break\n def visit_Break(self, n: ast27.Break) -> BreakStmt:\n stmt = BreakStmt()\n return self.set_line(stmt, n)\n\n # Continue\n def visit_Continue(self, n: ast27.Continue) -> ContinueStmt:\n stmt = ContinueStmt()\n return self.set_line(stmt, n)\n\n # --- expr ---\n\n # BoolOp(boolop op, expr* values)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.visit_BoolOp_ASTConverter.visit_BoolOp.return.self_set_line_e_n_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.visit_BoolOp_ASTConverter.visit_BoolOp.return.self_set_line_e_n_", "embedding": null, "metadata": {"file_path": "mypy/fastparse2.py", "file_name": "fastparse2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 793, "end_line": 805, "span_ids": ["ASTConverter.visit_BoolOp"], "tokens": 132}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n def visit_BoolOp(self, n: ast27.BoolOp) -> OpExpr:\n # mypy translates (1 and 2 and 3) as (1 and (2 and 3))\n assert len(n.values) >= 2\n if isinstance(n.op, ast27.And):\n op = 'and'\n elif isinstance(n.op, ast27.Or):\n op = 'or'\n else:\n raise RuntimeError('unknown BoolOp ' + str(type(n)))\n\n # potentially inefficient!\n e = self.group(self.translate_expr_list(n.values), op)\n return self.set_line(e, n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.group_ASTConverter._UnaryOp_unaryop_op_exp": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.group_ASTConverter._UnaryOp_unaryop_op_exp", "embedding": null, "metadata": {"file_path": "mypy/fastparse2.py", "file_name": "fastparse2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 807, "end_line": 823, "span_ids": ["ASTConverter.group", "ASTConverter.visit_BinOp"], "tokens": 168}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n\n def group(self, vals: List[Expression], op: str) -> OpExpr:\n if len(vals) == 2:\n return OpExpr(op, vals[0], vals[1])\n else:\n return OpExpr(op, vals[0], self.group(vals[1:], op))\n\n # BinOp(expr left, operator op, expr right)\n def visit_BinOp(self, n: ast27.BinOp) -> OpExpr:\n op = self.from_operator(n.op)\n\n if op is None:\n raise RuntimeError('cannot translate BinOp ' + str(type(n.op)))\n\n e = OpExpr(op, self.visit(n.left), self.visit(n.right))\n return self.set_line(e, n)\n\n # UnaryOp(unaryop op, expr operand)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.visit_UnaryOp_ASTConverter._Lambda_arguments_args_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.visit_UnaryOp_ASTConverter._Lambda_arguments_args_", "embedding": null, "metadata": {"file_path": "mypy/fastparse2.py", "file_name": "fastparse2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 824, "end_line": 841, "span_ids": ["ASTConverter.visit_UnaryOp"], "tokens": 145}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n def visit_UnaryOp(self, n: ast27.UnaryOp) -> UnaryExpr:\n op = None\n if isinstance(n.op, ast27.Invert):\n op = '~'\n elif isinstance(n.op, ast27.Not):\n op = 'not'\n elif isinstance(n.op, ast27.UAdd):\n op = '+'\n elif isinstance(n.op, ast27.USub):\n op = '-'\n\n if op is None:\n raise RuntimeError('cannot translate UnaryOp ' + str(type(n.op)))\n\n e = UnaryExpr(op, self.visit(n.operand))\n return self.set_line(e, n)\n\n # Lambda(arguments args, expr body)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.visit_Lambda_ASTConverter.visit_Lambda.return.e": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.visit_Lambda_ASTConverter.visit_Lambda.return.e", "embedding": null, "metadata": {"file_path": "mypy/fastparse2.py", "file_name": "fastparse2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 842, "end_line": 854, "span_ids": ["ASTConverter.visit_Lambda"], "tokens": 143}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n def visit_Lambda(self, n: ast27.Lambda) -> LambdaExpr:\n args, decompose_stmts = self.transform_args(n.args, n.lineno)\n\n n_body = ast27.Return(n.body)\n n_body.lineno = n.body.lineno\n n_body.col_offset = n.body.col_offset\n body = self.as_required_block([n_body], n.lineno)\n if decompose_stmts:\n body.body = decompose_stmts + body.body\n\n e = LambdaExpr(args, body)\n e.set_line(n.lineno, n.col_offset) # Overrides set_line -- can't use self.set_line\n return e", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter._IfExp_expr_test_expr_b_ASTConverter._DictComp_expr_key_expr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter._IfExp_expr_test_expr_b_ASTConverter._DictComp_expr_key_expr", "embedding": null, "metadata": {"file_path": "mypy/fastparse2.py", "file_name": "fastparse2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 856, "end_line": 884, "span_ids": ["ASTConverter.visit_ListComp", "ASTConverter.visit_Lambda", "ASTConverter.visit_SetComp", "ASTConverter.visit_IfExp", "ASTConverter.visit_Set", "ASTConverter.visit_Dict"], "tokens": 314}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n\n # IfExp(expr test, expr body, expr orelse)\n def visit_IfExp(self, n: ast27.IfExp) -> ConditionalExpr:\n e = ConditionalExpr(self.visit(n.test),\n self.visit(n.body),\n self.visit(n.orelse))\n return self.set_line(e, n)\n\n # Dict(expr* keys, expr* values)\n def visit_Dict(self, n: ast27.Dict) -> DictExpr:\n e = DictExpr(list(zip(self.translate_expr_list(n.keys),\n self.translate_expr_list(n.values))))\n return self.set_line(e, n)\n\n # Set(expr* elts)\n def visit_Set(self, n: ast27.Set) -> SetExpr:\n e = SetExpr(self.translate_expr_list(n.elts))\n return self.set_line(e, n)\n\n # ListComp(expr elt, comprehension* generators)\n def visit_ListComp(self, n: ast27.ListComp) -> ListComprehension:\n e = ListComprehension(self.visit_GeneratorExp(cast(ast27.GeneratorExp, n)))\n return self.set_line(e, n)\n\n # SetComp(expr elt, comprehension* generators)\n def visit_SetComp(self, n: ast27.SetComp) -> SetComprehension:\n e = SetComprehension(self.visit_GeneratorExp(cast(ast27.GeneratorExp, n)))\n return self.set_line(e, n)\n\n # DictComp(expr key, expr value, comprehension* generators)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.visit_DictComp_ASTConverter.visit_DictComp.return.self_set_line_e_n_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.visit_DictComp_ASTConverter.visit_DictComp.return.self_set_line_e_n_", "embedding": null, "metadata": {"file_path": "mypy/fastparse2.py", "file_name": "fastparse2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 885, "end_line": 895, "span_ids": ["ASTConverter.visit_DictComp"], "tokens": 126}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n def visit_DictComp(self, n: ast27.DictComp) -> DictionaryComprehension:\n targets = [self.visit(c.target) for c in n.generators]\n iters = [self.visit(c.iter) for c in n.generators]\n ifs_list = [self.translate_expr_list(c.ifs) for c in n.generators]\n e = DictionaryComprehension(self.visit(n.key),\n self.visit(n.value),\n targets,\n iters,\n ifs_list,\n [False for _ in n.generators])\n return self.set_line(e, n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter._GeneratorExp_expr_elt__ASTConverter.visit_GeneratorExp.return.self_set_line_e_n_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter._GeneratorExp_expr_elt__ASTConverter.visit_GeneratorExp.return.self_set_line_e_n_", "embedding": null, "metadata": {"file_path": "mypy/fastparse2.py", "file_name": "fastparse2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 897, "end_line": 907, "span_ids": ["ASTConverter.visit_DictComp", "ASTConverter.visit_GeneratorExp"], "tokens": 129}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n\n # GeneratorExp(expr elt, comprehension* generators)\n def visit_GeneratorExp(self, n: ast27.GeneratorExp) -> GeneratorExpr:\n targets = [self.visit(c.target) for c in n.generators]\n iters = [self.visit(c.iter) for c in n.generators]\n ifs_list = [self.translate_expr_list(c.ifs) for c in n.generators]\n e = GeneratorExpr(self.visit(n.elt),\n targets,\n iters,\n ifs_list,\n [False for _ in n.generators])\n return self.set_line(e, n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter._Yield_expr_value__ASTConverter._keyword_identifier_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter._Yield_expr_value__ASTConverter._keyword_identifier_", "embedding": null, "metadata": {"file_path": "mypy/fastparse2.py", "file_name": "fastparse2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 909, "end_line": 922, "span_ids": ["ASTConverter.visit_Yield", "ASTConverter.visit_Compare", "ASTConverter.visit_GeneratorExp"], "tokens": 159}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n\n # Yield(expr? value)\n def visit_Yield(self, n: ast27.Yield) -> YieldExpr:\n e = YieldExpr(self.visit(n.value))\n return self.set_line(e, n)\n\n # Compare(expr left, cmpop* ops, expr* comparators)\n def visit_Compare(self, n: ast27.Compare) -> ComparisonExpr:\n operators = [self.from_comp_operator(o) for o in n.ops]\n operands = self.translate_expr_list([n.left] + n.comparators)\n e = ComparisonExpr(operators, operands)\n return self.set_line(e, n)\n\n # Call(expr func, expr* args, keyword* keywords)\n # keyword = (identifier? arg, expr value)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.visit_Call_ASTConverter.visit_Call.return.self_set_line_e_n_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.visit_Call_ASTConverter.visit_Call.return.self_set_line_e_n_", "embedding": null, "metadata": {"file_path": "mypy/fastparse2.py", "file_name": "fastparse2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 923, "end_line": 952, "span_ids": ["ASTConverter.visit_Call"], "tokens": 226}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n def visit_Call(self, n: Call) -> CallExpr:\n arg_types = [] # type: List[ast27.expr]\n arg_kinds = [] # type: List[int]\n signature = [] # type: List[Optional[str]]\n\n args = n.args\n arg_types.extend(args)\n arg_kinds.extend(ARG_POS for a in args)\n signature.extend(None for a in args)\n\n if n.starargs is not None:\n arg_types.append(n.starargs)\n arg_kinds.append(ARG_STAR)\n signature.append(None)\n\n keywords = n.keywords\n arg_types.extend(k.value for k in keywords)\n arg_kinds.extend(ARG_NAMED for k in keywords)\n signature.extend(k.arg for k in keywords)\n\n if n.kwargs is not None:\n arg_types.append(n.kwargs)\n arg_kinds.append(ARG_STAR2)\n signature.append(None)\n\n e = CallExpr(self.visit(n.func),\n self.translate_expr_list(arg_types),\n arg_kinds,\n signature)\n return self.set_line(e, n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter._Num_object_n_a_numb_ASTConverter.visit_Num.return.self_set_line_expr_n_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter._Num_object_n_a_numb_ASTConverter.visit_Num.return.self_set_line_expr_n_", "embedding": null, "metadata": {"file_path": "mypy/fastparse2.py", "file_name": "fastparse2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 954, "end_line": 978, "span_ids": ["ASTConverter.visit_Call", "ASTConverter.visit_Num"], "tokens": 222}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n\n # Num(object n) -- a number as a PyObject.\n def visit_Num(self, n: ast27.Num) -> Expression:\n # The n field has the type complex, but complex isn't *really*\n # a parent of int and float, and this causes isinstance below\n # to think that the complex branch is always picked. Avoid\n # this by throwing away the type.\n value = n.n # type: object\n is_inverse = False\n if str(n.n).startswith('-'): # Hackish because of complex.\n value = -n.n\n is_inverse = True\n\n if isinstance(value, int):\n expr = IntExpr(value) # type: Expression\n elif isinstance(value, float):\n expr = FloatExpr(value)\n elif isinstance(value, complex):\n expr = ComplexExpr(value)\n else:\n raise RuntimeError('num not implemented for ' + str(type(n.n)))\n\n if is_inverse:\n expr = UnaryExpr('-', expr)\n\n return self.set_line(expr, n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter._Str_string_s__ASTConverter.visit_Str.if_isinstance_n_s_bytes_.else_.return.self_set_line_e_n_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter._Str_string_s__ASTConverter.visit_Str.if_isinstance_n_s_bytes_.else_.return.self_set_line_e_n_", "embedding": null, "metadata": {"file_path": "mypy/fastparse2.py", "file_name": "fastparse2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 980, "end_line": 996, "span_ids": ["ASTConverter.visit_Num", "ASTConverter.visit_Str"], "tokens": 209}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n\n # Str(string s)\n def visit_Str(self, n: ast27.Str) -> Expression:\n # Note: typed_ast.ast27 will handled unicode_literals for us. If\n # n.s is of type 'bytes', we know unicode_literals was not enabled;\n # otherwise we know it was.\n #\n # Note that the following code is NOT run when parsing Python 2.7 stubs:\n # we always parse stub files (no matter what version) using the Python 3\n # parser. This is also why string literals in Python 2.7 stubs are assumed\n # to be unicode.\n if isinstance(n.s, bytes):\n contents = bytes_to_human_readable_repr(n.s)\n e = StrExpr(contents, from_python_3=False) # type: Union[StrExpr, UnicodeExpr]\n return self.set_line(e, n)\n else:\n e = UnicodeExpr(n.s)\n return self.set_line(e, n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter._Ellipsis_ASTConverter.visit_Attribute.return.self_set_line_e_n_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter._Ellipsis_ASTConverter.visit_Attribute.return.self_set_line_e_n_", "embedding": null, "metadata": {"file_path": "mypy/fastparse2.py", "file_name": "fastparse2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 998, "end_line": 1016, "span_ids": ["ASTConverter.visit_Attribute", "ASTConverter.visit_Str", "ASTConverter.visit_Ellipsis"], "tokens": 207}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n\n # Ellipsis\n def visit_Ellipsis(self, n: ast27.Ellipsis) -> EllipsisExpr:\n return EllipsisExpr()\n\n # Attribute(expr value, identifier attr, expr_context ctx)\n def visit_Attribute(self, n: Attribute) -> Expression:\n # First create MemberExpr and then potentially replace with a SuperExpr\n # to improve performance when compiled. The check for \"super()\" will be\n # faster with native AST nodes. Note also that super expressions are\n # less common than normal member expressions.\n member_expr = MemberExpr(self.visit(n.value), n.attr)\n obj = member_expr.expr\n if (isinstance(obj, CallExpr) and\n isinstance(obj.callee, NameExpr) and\n obj.callee.name == 'super'):\n e = SuperExpr(member_expr.name, obj) # type: Expression\n else:\n e = member_expr\n return self.set_line(e, n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter._Subscript_expr_value_s_ASTConverter._List_expr_elts_expr_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter._Subscript_expr_value_s_ASTConverter._List_expr_elts_expr_c", "embedding": null, "metadata": {"file_path": "mypy/fastparse2.py", "file_name": "fastparse2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1018, "end_line": 1033, "span_ids": ["ASTConverter.visit_Attribute", "ASTConverter.visit_Name", "ASTConverter.visit_Subscript"], "tokens": 153}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n\n # Subscript(expr value, slice slice, expr_context ctx)\n def visit_Subscript(self, n: ast27.Subscript) -> IndexExpr:\n e = IndexExpr(self.visit(n.value), self.visit(n.slice))\n self.set_line(e, n)\n if isinstance(e.index, SliceExpr):\n # Slice has no line/column in the raw ast.\n e.index.line = e.line\n e.index.column = e.column\n return e\n\n # Name(identifier id, expr_context ctx)\n def visit_Name(self, n: Name) -> NameExpr:\n e = NameExpr(n.id)\n return self.set_line(e, n)\n\n # List(expr* elts, expr_context ctx)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.visit_List_ASTConverter.visit_List.return.self_set_line_e_n_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter.visit_List_ASTConverter.visit_List.return.self_set_line_e_n_", "embedding": null, "metadata": {"file_path": "mypy/fastparse2.py", "file_name": "fastparse2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1034, "end_line": 1041, "span_ids": ["ASTConverter.visit_List"], "tokens": 120}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n def visit_List(self, n: ast27.List) -> Union[ListExpr, TupleExpr]:\n expr_list = [self.visit(e) for e in n.elts] # type: List[Expression]\n if isinstance(n.ctx, ast27.Store):\n # [x, y] = z and (x, y) = z means exactly the same thing\n e = TupleExpr(expr_list) # type: Union[ListExpr, TupleExpr]\n else:\n e = ListExpr(expr_list)\n return self.set_line(e, n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter._Tuple_expr_elts_expr__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fastparse2.py_ASTConverter._Tuple_expr_elts_expr__", "embedding": null, "metadata": {"file_path": "mypy/fastparse2.py", "file_name": "fastparse2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1043, "end_line": 1063, "span_ids": ["ASTConverter.visit_Tuple", "ASTConverter.visit_Slice", "ASTConverter.visit_List", "ASTConverter.visit_Index", "ASTConverter.visit_ExtSlice"], "tokens": 186}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTConverter:\n\n # Tuple(expr* elts, expr_context ctx)\n def visit_Tuple(self, n: ast27_Tuple) -> TupleExpr:\n e = TupleExpr([self.visit(e) for e in n.elts])\n return self.set_line(e, n)\n\n # --- slice ---\n\n # Slice(expr? lower, expr? upper, expr? step)\n def visit_Slice(self, n: ast27.Slice) -> SliceExpr:\n return SliceExpr(self.visit(n.lower),\n self.visit(n.upper),\n self.visit(n.step))\n\n # ExtSlice(slice* dims)\n def visit_ExtSlice(self, n: ast27.ExtSlice) -> TupleExpr:\n return TupleExpr(self.translate_expr_list(n.dims))\n\n # Index(expr value)\n def visit_Index(self, n: ast27.Index) -> Expression:\n return self.visit(n.value)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/find_sources.py_SourceFinder.get_init_file_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/find_sources.py_SourceFinder.get_init_file_", "embedding": null, "metadata": {"file_path": "mypy/find_sources.py", "file_name": "find_sources.py", "file_type": "text/x-python", "category": "implementation", "start_line": 206, "end_line": 238, "span_ids": ["module_join", "SourceFinder.get_init_file", "strip_py"], "tokens": 239}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SourceFinder:\n\n def get_init_file(self, dir: str) -> Optional[str]:\n \"\"\"Check whether a directory contains a file named __init__.py[i].\n\n If so, return the file's name (with dir prefixed). If not, return None.\n\n This prefers .pyi over .py (because of the ordering of PY_EXTENSIONS).\n \"\"\"\n for ext in PY_EXTENSIONS:\n f = os.path.join(dir, '__init__' + ext)\n if self.fscache.isfile(f):\n return f\n if ext == '.py' and self.fscache.init_under_package_root(f):\n return f\n return None\n\n\ndef module_join(parent: str, child: str) -> str:\n \"\"\"Join module ids, accounting for a possibly empty parent.\"\"\"\n if parent:\n return parent + '.' + child\n return child\n\n\ndef strip_py(arg: str) -> Optional[str]:\n \"\"\"Strip a trailing .py or .pyi suffix.\n\n Return None if no such suffix is found.\n \"\"\"\n for ext in PY_EXTENSIONS:\n if arg.endswith(ext):\n return arg[:-len(ext)]\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fixup.py__Fix_up_various_things__fixup_module.node_fixer_visit_symbol_t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fixup.py__Fix_up_various_things__fixup_module.node_fixer_visit_symbol_t", "embedding": null, "metadata": {"file_path": "mypy/fixup.py", "file_name": "fixup.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 26, "span_ids": ["fixup_module", "docstring"], "tokens": 251}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Fix up various things after deserialization.\"\"\"\n\nfrom typing import Any, Dict, Optional\nfrom typing_extensions import Final\n\nfrom mypy.nodes import (\n MypyFile, SymbolNode, SymbolTable, SymbolTableNode,\n TypeInfo, FuncDef, OverloadedFuncDef, Decorator, Var,\n TypeVarExpr, ClassDef, Block, TypeAlias,\n)\nfrom mypy.types import (\n CallableType, Instance, Overloaded, TupleType, TypedDictType,\n TypeVarType, UnboundType, UnionType, TypeVisitor, LiteralType,\n TypeType, NOT_READY, TypeAliasType, AnyType, TypeOfAny, TypeVarDef\n)\nfrom mypy.visitor import NodeVisitor\nfrom mypy.lookup import lookup_fully_qualified\n\n\n# N.B: we do a allow_missing fixup when fixing up a fine-grained\n# incremental cache load (since there may be cross-refs into deleted\n# modules)\ndef fixup_module(tree: MypyFile, modules: Dict[str, MypyFile],\n allow_missing: bool) -> None:\n node_fixer = NodeFixer(modules, allow_missing)\n node_fixer.visit_symbol_table(tree.names, tree.fullname)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fixup.py__TODO_Fix_up_info_when_NodeFixer.visit_type_info.try_.finally_.self.current_info.save_info": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fixup.py__TODO_Fix_up_info_when_NodeFixer.visit_type_info.try_.finally_.self.current_info.save_info", "embedding": null, "metadata": {"file_path": "mypy/fixup.py", "file_name": "fixup.py", "file_type": "text/x-python", "category": "implementation", "start_line": 29, "end_line": 65, "span_ids": ["fixup_module", "NodeFixer.visit_type_info", "NodeFixer.__init__", "NodeFixer"], "tokens": 346}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# TODO: Fix up .info when deserializing, i.e. much earlier.\nclass NodeFixer(NodeVisitor[None]):\n current_info = None # type: Optional[TypeInfo]\n\n def __init__(self, modules: Dict[str, MypyFile], allow_missing: bool) -> None:\n self.modules = modules\n self.allow_missing = allow_missing\n self.type_fixer = TypeFixer(self.modules, allow_missing)\n\n # NOTE: This method isn't (yet) part of the NodeVisitor API.\n def visit_type_info(self, info: TypeInfo) -> None:\n save_info = self.current_info\n try:\n self.current_info = info\n if info.defn:\n info.defn.accept(self)\n if info.names:\n self.visit_symbol_table(info.names, info.fullname)\n if info.bases:\n for base in info.bases:\n base.accept(self.type_fixer)\n if info._promote:\n info._promote.accept(self.type_fixer)\n if info.tuple_type:\n info.tuple_type.accept(self.type_fixer)\n if info.typeddict_type:\n info.typeddict_type.accept(self.type_fixer)\n if info.declared_metaclass:\n info.declared_metaclass.accept(self.type_fixer)\n if info.metaclass_type:\n info.metaclass_type.accept(self.type_fixer)\n if info._mro_refs:\n info.mro = [lookup_qualified_typeinfo(self.modules, name, self.allow_missing)\n for name in info._mro_refs]\n info._mro_refs = None\n finally:\n self.current_info = save_info", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fixup.py_NodeFixer._NOTE_This_method_defi_NodeFixer.visit_symbol_table.for_key_value_in_list_sy.if_cross_ref_is_not_None_.else_.if_isinstance_value_node_.else_.assert_False_Unexpected": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fixup.py_NodeFixer._NOTE_This_method_defi_NodeFixer.visit_symbol_table.for_key_value_in_list_sy.if_cross_ref_is_not_None_.else_.if_isinstance_value_node_.else_.assert_False_Unexpected", "embedding": null, "metadata": {"file_path": "mypy/fixup.py", "file_name": "fixup.py", "file_type": "text/x-python", "category": "implementation", "start_line": 67, "end_line": 94, "span_ids": ["NodeFixer.visit_type_info", "NodeFixer.visit_symbol_table"], "tokens": 306}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class NodeFixer(NodeVisitor[None]):\n\n # NOTE: This method *definitely* isn't part of the NodeVisitor API.\n def visit_symbol_table(self, symtab: SymbolTable, table_fullname: str) -> None:\n # Copy the items because we may mutate symtab.\n for key, value in list(symtab.items()):\n cross_ref = value.cross_ref\n if cross_ref is not None: # Fix up cross-reference.\n value.cross_ref = None\n if cross_ref in self.modules:\n value.node = self.modules[cross_ref]\n else:\n stnode = lookup_qualified_stnode(self.modules, cross_ref,\n self.allow_missing)\n if stnode is not None:\n assert stnode.node is not None, (table_fullname + \".\" + key, cross_ref)\n value.node = stnode.node\n elif not self.allow_missing:\n assert False, \"Could not find cross-ref %s\" % (cross_ref,)\n else:\n # We have a missing crossref in allow missing mode, need to put something\n value.node = missing_info(self.modules)\n else:\n if isinstance(value.node, TypeInfo):\n # TypeInfo has no accept(). TODO: Add it?\n self.visit_type_info(value.node)\n elif value.node is not None:\n value.node.accept(self)\n else:\n assert False, 'Unexpected empty node %r: %s' % (key, value)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fixup.py_NodeFixer.visit_func_def_NodeFixer.visit_type_alias.a_target_accept_self_type": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fixup.py_NodeFixer.visit_func_def_NodeFixer.visit_type_alias.a_target_accept_self_type", "embedding": null, "metadata": {"file_path": "mypy/fixup.py", "file_name": "fixup.py", "file_type": "text/x-python", "category": "implementation", "start_line": 96, "end_line": 140, "span_ids": ["NodeFixer.visit_type_var_expr", "NodeFixer.visit_overloaded_func_def", "NodeFixer.visit_decorator", "NodeFixer.visit_type_alias", "NodeFixer.visit_class_def", "NodeFixer.visit_func_def", "NodeFixer.visit_var"], "tokens": 359}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class NodeFixer(NodeVisitor[None]):\n\n def visit_func_def(self, func: FuncDef) -> None:\n if self.current_info is not None:\n func.info = self.current_info\n if func.type is not None:\n func.type.accept(self.type_fixer)\n\n def visit_overloaded_func_def(self, o: OverloadedFuncDef) -> None:\n if self.current_info is not None:\n o.info = self.current_info\n if o.type:\n o.type.accept(self.type_fixer)\n for item in o.items:\n item.accept(self)\n if o.impl:\n o.impl.accept(self)\n\n def visit_decorator(self, d: Decorator) -> None:\n if self.current_info is not None:\n d.var.info = self.current_info\n if d.func:\n d.func.accept(self)\n if d.var:\n d.var.accept(self)\n for node in d.decorators:\n node.accept(self)\n\n def visit_class_def(self, c: ClassDef) -> None:\n for v in c.type_vars:\n for value in v.values:\n value.accept(self.type_fixer)\n v.upper_bound.accept(self.type_fixer)\n\n def visit_type_var_expr(self, tv: TypeVarExpr) -> None:\n for value in tv.values:\n value.accept(self.type_fixer)\n tv.upper_bound.accept(self.type_fixer)\n\n def visit_var(self, v: Var) -> None:\n if self.current_info is not None:\n v.info = self.current_info\n if v.type is not None:\n v.type.accept(self.type_fixer)\n\n def visit_type_alias(self, a: TypeAlias) -> None:\n a.target.accept(self.type_fixer)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fixup.py_TypeFixer_TypeFixer.visit_instance.if_inst_last_known_value_.inst_last_known_value_acc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fixup.py_TypeFixer_TypeFixer.visit_instance.if_inst_last_known_value_.inst_last_known_value_acc", "embedding": null, "metadata": {"file_path": "mypy/fixup.py", "file_name": "fixup.py", "file_type": "text/x-python", "category": "implementation", "start_line": 143, "end_line": 163, "span_ids": ["TypeFixer", "TypeFixer.__init__", "TypeFixer.visit_instance"], "tokens": 197}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeFixer(TypeVisitor[None]):\n def __init__(self, modules: Dict[str, MypyFile], allow_missing: bool) -> None:\n self.modules = modules\n self.allow_missing = allow_missing\n\n def visit_instance(self, inst: Instance) -> None:\n # TODO: Combine Instances that are exactly the same?\n type_ref = inst.type_ref\n if type_ref is None:\n return # We've already been here.\n inst.type_ref = None\n inst.type = lookup_qualified_typeinfo(self.modules, type_ref, self.allow_missing)\n # TODO: Is this needed or redundant?\n # Also fix up the bases, just in case.\n for base in inst.type.bases:\n if base.type is NOT_READY:\n base.accept(self)\n for a in inst.args:\n a.accept(self)\n if inst.last_known_value is not None:\n inst.last_known_value.accept(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fixup.py_TypeFixer.visit_overloaded_TypeFixer.visit_tuple_type.if_tt_partial_fallback_is.tt_partial_fallback_accep": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fixup.py_TypeFixer.visit_overloaded_TypeFixer.visit_tuple_type.if_tt_partial_fallback_is.tt_partial_fallback_accep", "embedding": null, "metadata": {"file_path": "mypy/fixup.py", "file_name": "fixup.py", "file_type": "text/x-python", "category": "implementation", "start_line": 196, "end_line": 221, "span_ids": ["TypeFixer.visit_erased_type", "TypeFixer.visit_deleted_type", "TypeFixer.visit_partial_type", "TypeFixer.visit_uninhabited_type", "TypeFixer.visit_overloaded", "TypeFixer.visit_none_type", "TypeFixer.visit_tuple_type"], "tokens": 224}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeFixer(TypeVisitor[None]):\n\n def visit_overloaded(self, t: Overloaded) -> None:\n for ct in t.items():\n ct.accept(self)\n\n def visit_erased_type(self, o: Any) -> None:\n # This type should exist only temporarily during type inference\n raise RuntimeError(\"Shouldn't get here\", o)\n\n def visit_deleted_type(self, o: Any) -> None:\n pass # Nothing to descend into.\n\n def visit_none_type(self, o: Any) -> None:\n pass # Nothing to descend into.\n\n def visit_uninhabited_type(self, o: Any) -> None:\n pass # Nothing to descend into.\n\n def visit_partial_type(self, o: Any) -> None:\n raise RuntimeError(\"Shouldn't get here\", o)\n\n def visit_tuple_type(self, tt: TupleType) -> None:\n if tt.items:\n for it in tt.items:\n it.accept(self)\n if tt.partial_fallback is not None:\n tt.partial_fallback.accept(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fixup.py_TypeFixer.visit_typeddict_type_TypeFixer.visit_typeddict_type.if_tdt_fallback_is_not_No.tdt_fallback_accept_self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fixup.py_TypeFixer.visit_typeddict_type_TypeFixer.visit_typeddict_type.if_tdt_fallback_is_not_No.tdt_fallback_accept_self_", "embedding": null, "metadata": {"file_path": "mypy/fixup.py", "file_name": "fixup.py", "file_type": "text/x-python", "category": "implementation", "start_line": 223, "end_line": 234, "span_ids": ["TypeFixer.visit_typeddict_type"], "tokens": 144}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeFixer(TypeVisitor[None]):\n\n def visit_typeddict_type(self, tdt: TypedDictType) -> None:\n if tdt.items:\n for it in tdt.items.values():\n it.accept(self)\n if tdt.fallback is not None:\n if tdt.fallback.type_ref is not None:\n if lookup_qualified(self.modules, tdt.fallback.type_ref,\n self.allow_missing) is None:\n # We reject fake TypeInfos for TypedDict fallbacks because\n # the latter are used in type checking and must be valid.\n tdt.fallback.type_ref = 'typing._TypedDict'\n tdt.fallback.accept(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fixup.py_TypeFixer.visit_literal_type_TypeFixer.visit_type_type.t_item_accept_self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fixup.py_TypeFixer.visit_literal_type_TypeFixer.visit_type_type.t_item_accept_self_", "embedding": null, "metadata": {"file_path": "mypy/fixup.py", "file_name": "fixup.py", "file_type": "text/x-python", "category": "implementation", "start_line": 236, "end_line": 259, "span_ids": ["TypeFixer.visit_union_type", "TypeFixer.visit_literal_type", "TypeFixer.visit_type_var", "TypeFixer.visit_unbound_type", "TypeFixer.visit_type_type", "TypeFixer.visit_void"], "tokens": 190}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeFixer(TypeVisitor[None]):\n\n def visit_literal_type(self, lt: LiteralType) -> None:\n lt.fallback.accept(self)\n\n def visit_type_var(self, tvt: TypeVarType) -> None:\n if tvt.values:\n for vt in tvt.values:\n vt.accept(self)\n if tvt.upper_bound is not None:\n tvt.upper_bound.accept(self)\n\n def visit_unbound_type(self, o: UnboundType) -> None:\n for a in o.args:\n a.accept(self)\n\n def visit_union_type(self, ut: UnionType) -> None:\n if ut.items:\n for it in ut.items:\n it.accept(self)\n\n def visit_void(self, o: Any) -> None:\n pass # Nothing to descend into.\n\n def visit_type_type(self, t: TypeType) -> None:\n t.item.accept(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fixup.py_lookup_qualified_typeinfo_lookup_qualified_typeinfo.if_isinstance_node_TypeI.else_.return.missing_info_modules_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fixup.py_lookup_qualified_typeinfo_lookup_qualified_typeinfo.if_isinstance_node_TypeI.else_.return.missing_info_modules_", "embedding": null, "metadata": {"file_path": "mypy/fixup.py", "file_name": "fixup.py", "file_type": "text/x-python", "category": "implementation", "start_line": 262, "end_line": 273, "span_ids": ["lookup_qualified_typeinfo"], "tokens": 121}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def lookup_qualified_typeinfo(modules: Dict[str, MypyFile], name: str,\n allow_missing: bool) -> TypeInfo:\n node = lookup_qualified(modules, name, allow_missing)\n if isinstance(node, TypeInfo):\n return node\n else:\n # Looks like a missing TypeInfo during an initial daemon load, put something there\n assert allow_missing, \"Should never get here in normal mode,\" \\\n \" got {}:{} instead of TypeInfo\".format(type(node).__name__,\n node.fullname if node\n else '')\n return missing_info(modules)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fixup.py_lookup_qualified_alias_lookup_qualified_alias.if_isinstance_node_TypeA.else_.return.missing_alias_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fixup.py_lookup_qualified_alias_lookup_qualified_alias.if_isinstance_node_TypeA.else_.return.missing_alias_", "embedding": null, "metadata": {"file_path": "mypy/fixup.py", "file_name": "fixup.py", "file_type": "text/x-python", "category": "implementation", "start_line": 276, "end_line": 287, "span_ids": ["lookup_qualified_alias"], "tokens": 122}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def lookup_qualified_alias(modules: Dict[str, MypyFile], name: str,\n allow_missing: bool) -> TypeAlias:\n node = lookup_qualified(modules, name, allow_missing)\n if isinstance(node, TypeAlias):\n return node\n else:\n # Looks like a missing TypeAlias during an initial daemon load, put something there\n assert allow_missing, \"Should never get here in normal mode,\" \\\n \" got {}:{} instead of TypeAlias\".format(type(node).__name__,\n node.fullname if node\n else '')\n return missing_alias()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fixup.py_lookup_qualified__SUGGESTION._missing_should_ha": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fixup.py_lookup_qualified__SUGGESTION._missing_should_ha", "embedding": null, "metadata": {"file_path": "mypy/fixup.py", "file_name": "fixup.py", "file_type": "text/x-python", "category": "implementation", "start_line": 290, "end_line": 304, "span_ids": ["lookup_qualified_stnode", "lookup_qualified", "impl"], "tokens": 139}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def lookup_qualified(modules: Dict[str, MypyFile], name: str,\n allow_missing: bool) -> Optional[SymbolNode]:\n stnode = lookup_qualified_stnode(modules, name, allow_missing)\n if stnode is None:\n return None\n else:\n return stnode.node\n\n\ndef lookup_qualified_stnode(modules: Dict[str, MypyFile], name: str,\n allow_missing: bool) -> Optional[SymbolTableNode]:\n return lookup_fully_qualified(name, modules, raise_on_missing=not allow_missing)\n\n\n_SUGGESTION = \"\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fixup.py__type_Final_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fixup.py__type_Final_", "embedding": null, "metadata": {"file_path": "mypy/fixup.py", "file_name": "fixup.py", "file_type": "text/x-python", "category": "implementation", "start_line": 304, "end_line": 324, "span_ids": ["missing_info", "impl", "missing_alias"], "tokens": 163}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": " # type: Final\n\n\ndef missing_info(modules: Dict[str, MypyFile]) -> TypeInfo:\n suggestion = _SUGGESTION.format('info')\n dummy_def = ClassDef(suggestion, Block([]))\n dummy_def.fullname = suggestion\n\n info = TypeInfo(SymbolTable(), dummy_def, \"\")\n obj_type = lookup_qualified(modules, 'builtins.object', False)\n assert isinstance(obj_type, TypeInfo)\n info.bases = [Instance(obj_type, [])]\n info.mro = [info, obj_type]\n return info\n\n\ndef missing_alias() -> TypeAlias:\n suggestion = _SUGGESTION.format('alias')\n return TypeAlias(AnyType(TypeOfAny.special_form), suggestion,\n line=-1, column=-1)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/freetree.py__Generic_node_traverser_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/freetree.py__Generic_node_traverser_", "embedding": null, "metadata": {"file_path": "mypy/freetree.py", "file_name": "freetree.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 22, "span_ids": ["free_tree", "TreeFreer.visit_block", "TreeFreer", "docstring"], "tokens": 138}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Generic node traverser visitor\"\"\"\n\nfrom mypy.traverser import TraverserVisitor\nfrom mypy.nodes import Block, MypyFile\n\n\nclass TreeFreer(TraverserVisitor):\n def visit_block(self, block: Block) -> None:\n super().visit_block(block)\n block.body.clear()\n\n\ndef free_tree(tree: MypyFile) -> None:\n \"\"\"Free all the ASTs associated with a module.\n\n This needs to be done recursively, since symbol tables contain\n references to definitions, so those won't be freed but we want their\n contents to be.\n \"\"\"\n tree.accept(TreeFreer())\n tree.defs.clear()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fscache.py_FileSystemCache_FileSystemCache.flush._type_Set_str_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fscache.py_FileSystemCache_FileSystemCache.flush._type_Set_str_", "embedding": null, "metadata": {"file_path": "mypy/fscache.py", "file_name": "fscache.py", "file_type": "text/x-python", "category": "implementation", "start_line": 39, "end_line": 61, "span_ids": ["FileSystemCache.flush", "FileSystemCache.__init__", "FileSystemCache", "FileSystemCache.set_package_root"], "tokens": 273}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@mypyc_attr(allow_interpreted_subclasses=True) # for tests\nclass FileSystemCache:\n def __init__(self) -> None:\n # The package root is not flushed with the caches.\n # It is set by set_package_root() below.\n self.package_root = [] # type: List[str]\n self.flush()\n\n def set_package_root(self, package_root: List[str]) -> None:\n self.package_root = package_root\n\n def flush(self) -> None:\n \"\"\"Start another transaction and empty all caches.\"\"\"\n self.stat_cache = {} # type: Dict[str, os.stat_result]\n self.stat_error_cache = {} # type: Dict[str, OSError]\n self.listdir_cache = {} # type: Dict[str, List[str]]\n self.listdir_error_cache = {} # type: Dict[str, OSError]\n self.isfile_case_cache = {} # type: Dict[str, bool]\n self.exists_case_cache = {} # type: Dict[str, bool]\n self.read_cache = {} # type: Dict[str, bytes]\n self.read_error_cache = {} # type: Dict[str, Exception]\n self.hash_cache = {} # type: Dict[str, str]\n self.fake_package_cache = set() # type: Set[str]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fscache.py_FileSystemCache.stat_FileSystemCache.stat.return.st": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fscache.py_FileSystemCache.stat_FileSystemCache.stat.return.st", "embedding": null, "metadata": {"file_path": "mypy/fscache.py", "file_name": "fscache.py", "file_type": "text/x-python", "category": "implementation", "start_line": 61, "end_line": 79, "span_ids": ["FileSystemCache.stat"], "tokens": 172}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@mypyc_attr(allow_interpreted_subclasses=True) # for tests\nclass FileSystemCache:\n\n def stat(self, path: str) -> os.stat_result:\n if path in self.stat_cache:\n return self.stat_cache[path]\n if path in self.stat_error_cache:\n raise copy_os_error(self.stat_error_cache[path])\n try:\n st = os.stat(path)\n except OSError as err:\n if self.init_under_package_root(path):\n try:\n return self._fake_init(path)\n except OSError:\n pass\n # Take a copy to get rid of associated traceback and frame objects.\n # Just assigning to __traceback__ doesn't free them.\n self.stat_error_cache[path] = copy_os_error(err)\n raise err\n self.stat_cache[path] = st\n return st", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fscache.py_FileSystemCache.init_under_package_root_FileSystemCache.init_under_package_root.return.ok": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fscache.py_FileSystemCache.init_under_package_root_FileSystemCache.init_under_package_root.return.ok", "embedding": null, "metadata": {"file_path": "mypy/fscache.py", "file_name": "fscache.py", "file_type": "text/x-python", "category": "implementation", "start_line": 81, "end_line": 128, "span_ids": ["FileSystemCache.init_under_package_root"], "tokens": 415}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@mypyc_attr(allow_interpreted_subclasses=True) # for tests\nclass FileSystemCache:\n\n def init_under_package_root(self, path: str) -> bool:\n \"\"\"Is this path an __init__.py under a package root?\n\n This is used to detect packages that don't contain __init__.py\n files, which is needed to support Bazel. The function should\n only be called for non-existing files.\n\n It will return True if it refers to a __init__.py file that\n Bazel would create, so that at runtime Python would think the\n directory containing it is a package. For this to work you\n must pass one or more package roots using the --package-root\n flag.\n\n As an exceptional case, any directory that is a package root\n itself will not be considered to contain a __init__.py file.\n This is different from the rules Bazel itself applies, but is\n necessary for mypy to properly distinguish packages from other\n directories.\n\n See https://docs.bazel.build/versions/master/be/python.html,\n where this behavior is described under legacy_create_init.\n \"\"\"\n if not self.package_root:\n return False\n dirname, basename = os.path.split(path)\n if basename != '__init__.py':\n return False\n try:\n st = self.stat(dirname)\n except OSError:\n return False\n else:\n if not stat.S_ISDIR(st.st_mode):\n return False\n ok = False\n drive, path = os.path.splitdrive(path) # Ignore Windows drive name\n if os.path.isabs(path):\n path = os.path.relpath(path)\n path = os.path.normpath(path)\n for root in self.package_root:\n if path.startswith(root):\n if path == root + basename:\n # A package root itself is never a package.\n ok = False\n break\n else:\n ok = True\n return ok", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fscache.py_FileSystemCache._fake_init_FileSystemCache._fake_init.return.st": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fscache.py_FileSystemCache._fake_init_FileSystemCache._fake_init.return.st", "embedding": null, "metadata": {"file_path": "mypy/fscache.py", "file_name": "fscache.py", "file_type": "text/x-python", "category": "implementation", "start_line": 130, "end_line": 155, "span_ids": ["FileSystemCache._fake_init"], "tokens": 314}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@mypyc_attr(allow_interpreted_subclasses=True) # for tests\nclass FileSystemCache:\n\n def _fake_init(self, path: str) -> os.stat_result:\n \"\"\"Prime the cache with a fake __init__.py file.\n\n This makes code that looks for path believe an empty file by\n that name exists. Should only be called after\n init_under_package_root() returns True.\n \"\"\"\n dirname, basename = os.path.split(path)\n assert basename == '__init__.py', path\n assert not os.path.exists(path), path # Not cached!\n dirname = os.path.normpath(dirname)\n st = self.stat(dirname) # May raise OSError\n # Get stat result as a sequence so we can modify it.\n # (Alas, typeshed's os.stat_result is not a sequence yet.)\n tpl = tuple(st) # type: ignore[arg-type, var-annotated]\n seq = list(tpl) # type: List[float]\n seq[stat.ST_MODE] = stat.S_IFREG | 0o444\n seq[stat.ST_INO] = 1\n seq[stat.ST_NLINK] = 1\n seq[stat.ST_SIZE] = 0\n tpl = tuple(seq)\n st = os.stat_result(tpl)\n self.stat_cache[path] = st\n # Make listdir() and read() also pretend this file exists.\n self.fake_package_cache.add(dirname)\n return st", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fscache.py_FileSystemCache.listdir_FileSystemCache.isfile.return.stat_S_ISREG_st_st_mode_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fscache.py_FileSystemCache.listdir_FileSystemCache.isfile.return.stat_S_ISREG_st_st_mode_", "embedding": null, "metadata": {"file_path": "mypy/fscache.py", "file_name": "fscache.py", "file_type": "text/x-python", "category": "implementation", "start_line": 157, "end_line": 184, "span_ids": ["FileSystemCache.isfile", "FileSystemCache.listdir"], "tokens": 262}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@mypyc_attr(allow_interpreted_subclasses=True) # for tests\nclass FileSystemCache:\n\n def listdir(self, path: str) -> List[str]:\n path = os.path.normpath(path)\n if path in self.listdir_cache:\n res = self.listdir_cache[path]\n # Check the fake cache.\n if path in self.fake_package_cache and '__init__.py' not in res:\n res.append('__init__.py') # Updates the result as well as the cache\n return res\n if path in self.listdir_error_cache:\n raise copy_os_error(self.listdir_error_cache[path])\n try:\n results = os.listdir(path)\n except OSError as err:\n # Like above, take a copy to reduce memory use.\n self.listdir_error_cache[path] = copy_os_error(err)\n raise err\n self.listdir_cache[path] = results\n # Check the fake cache.\n if path in self.fake_package_cache and '__init__.py' not in results:\n results.append('__init__.py')\n return results\n\n def isfile(self, path: str) -> bool:\n try:\n st = self.stat(path)\n except OSError:\n return False\n return stat.S_ISREG(st.st_mode)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fscache.py_FileSystemCache.isfile_case_FileSystemCache.isfile_case.return.res": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fscache.py_FileSystemCache.isfile_case_FileSystemCache.isfile_case.return.res", "embedding": null, "metadata": {"file_path": "mypy/fscache.py", "file_name": "fscache.py", "file_type": "text/x-python", "category": "implementation", "start_line": 188, "end_line": 225, "span_ids": ["FileSystemCache.isfile_case"], "tokens": 361}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@mypyc_attr(allow_interpreted_subclasses=True) # for tests\nclass FileSystemCache:\n\n def isfile_case(self, path: str, prefix: str) -> bool:\n \"\"\"Return whether path exists and is a file.\n\n On case-insensitive filesystems (like Mac or Windows) this returns\n False if the case of path's last component does not exactly match\n the case found in the filesystem.\n\n We check also the case of other path components up to prefix.\n For example, if path is 'user-stubs/pack/mod.pyi' and prefix is 'user-stubs',\n we check that the case of 'pack' and 'mod.py' matches exactly, 'user-stubs' will be\n case insensitive on case insensitive filesystems.\n\n The caller must ensure that prefix is a valid file system prefix of path.\n \"\"\"\n if sys.platform == \"linux\":\n # Assume that the file system on Linux is case sensitive\n return self.isfile(path)\n if not self.isfile(path):\n # Fast path\n return False\n if path in self.isfile_case_cache:\n return self.isfile_case_cache[path]\n head, tail = os.path.split(path)\n if not tail:\n self.isfile_case_cache[path] = False\n return False\n try:\n names = self.listdir(head)\n # This allows one to check file name case sensitively in\n # case-insensitive filesystems.\n res = tail in names\n except OSError:\n res = False\n if res:\n # Also recursively check the other path components in case sensitive way.\n res = self._exists_case(head, prefix)\n self.isfile_case_cache[path] = res\n return res", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fswatcher.py__Watch_parts_of_the_fil_FileSystemWatcher._update.self__file_data_path_F": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fswatcher.py__Watch_parts_of_the_fil_FileSystemWatcher._update.self__file_data_path_F", "embedding": null, "metadata": {"file_path": "mypy/fswatcher.py", "file_name": "fswatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 58, "span_ids": ["FileSystemWatcher.__init__", "FileSystemWatcher.dump_file_data", "FileSystemWatcher.add_watched_paths", "FileSystemWatcher.set_file_data", "docstring", "FileSystemWatcher", "FileSystemWatcher._update", "FileSystemWatcher.remove_watched_paths"], "tokens": 505}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Watch parts of the file system for changes.\"\"\"\n\nfrom mypy.fscache import FileSystemCache\nfrom typing import AbstractSet, Dict, Iterable, List, NamedTuple, Optional, Set, Tuple\n\n\nFileData = NamedTuple('FileData', [('st_mtime', float),\n ('st_size', int),\n ('hash', str)])\n\n\nclass FileSystemWatcher:\n \"\"\"Watcher for file system changes among specific paths.\n\n All file system access is performed using FileSystemCache. We\n detect changed files by stat()ing them all and comparing hashes\n of potentially changed files. If a file has both size and mtime\n unmodified, the file is assumed to be unchanged.\n\n An important goal of this class is to make it easier to eventually\n use file system events to detect file changes.\n\n Note: This class doesn't flush the file system cache. If you don't\n manually flush it, changes won't be seen.\n \"\"\"\n\n # TODO: Watching directories?\n # TODO: Handle non-files\n\n def __init__(self, fs: FileSystemCache) -> None:\n self.fs = fs\n self._paths = set() # type: Set[str]\n self._file_data = {} # type: Dict[str, Optional[FileData]]\n\n def dump_file_data(self) -> Dict[str, Tuple[float, int, str]]:\n return {k: v for k, v in self._file_data.items() if v is not None}\n\n def set_file_data(self, path: str, data: FileData) -> None:\n self._file_data[path] = data\n\n def add_watched_paths(self, paths: Iterable[str]) -> None:\n for path in paths:\n if path not in self._paths:\n # By storing None this path will get reported as changed by\n # find_changed if it exists.\n self._file_data[path] = None\n self._paths |= set(paths)\n\n def remove_watched_paths(self, paths: Iterable[str]) -> None:\n for path in paths:\n if path in self._file_data:\n del self._file_data[path]\n self._paths -= set(paths)\n\n def _update(self, path: str) -> None:\n st = self.fs.stat(path)\n hash_digest = self.fs.hash_digest(path)\n self._file_data[path] = FileData(st.st_mtime, st.st_size, hash_digest)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fswatcher.py_FileSystemWatcher._find_changed_FileSystemWatcher._find_changed.return.changed": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fswatcher.py_FileSystemWatcher._find_changed_FileSystemWatcher._find_changed.return.changed", "embedding": null, "metadata": {"file_path": "mypy/fswatcher.py", "file_name": "fswatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 60, "end_line": 85, "span_ids": ["FileSystemWatcher._find_changed"], "tokens": 220}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FileSystemWatcher:\n\n def _find_changed(self, paths: Iterable[str]) -> AbstractSet[str]:\n changed = set()\n for path in paths:\n old = self._file_data[path]\n try:\n st = self.fs.stat(path)\n except FileNotFoundError:\n if old is not None:\n # File was deleted.\n changed.add(path)\n self._file_data[path] = None\n else:\n if old is None:\n # File is new.\n changed.add(path)\n self._update(path)\n # Round mtimes down, to match the mtimes we write to meta files\n elif st.st_size != old.st_size or int(st.st_mtime) != int(old.st_mtime):\n # Only look for changes if size or mtime has changed as an\n # optimization, since calculating hash is expensive.\n new_hash = self.fs.hash_digest(path)\n self._update(path)\n if st.st_size != old.st_size or new_hash != old.hash:\n # Changed file.\n changed.add(path)\n return changed", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fswatcher.py_FileSystemWatcher.find_changed_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fswatcher.py_FileSystemWatcher.find_changed_", "embedding": null, "metadata": {"file_path": "mypy/fswatcher.py", "file_name": "fswatcher.py", "file_type": "text/x-python", "category": "implementation", "start_line": 87, "end_line": 106, "span_ids": ["FileSystemWatcher.find_changed", "FileSystemWatcher.update_changed"], "tokens": 158}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FileSystemWatcher:\n\n def find_changed(self) -> AbstractSet[str]:\n \"\"\"Return paths that have changes since the last call, in the watched set.\"\"\"\n return self._find_changed(self._paths)\n\n def update_changed(self,\n remove: List[str],\n update: List[str],\n ) -> AbstractSet[str]:\n \"\"\"Alternative to find_changed() given explicit changes.\n\n This only calls self.fs.stat() on added or updated files, not\n on all files. It believes all other files are unchanged!\n\n Implies add_watched_paths() for add and update, and\n remove_watched_paths() for remove.\n \"\"\"\n self.remove_watched_paths(remove)\n self.add_watched_paths(update)\n return self._find_changed(update)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/gclogger.py_gc_GcLogger.gc_callback.if_phase_start_.else_.assert_False_Unrecogniz": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/gclogger.py_gc_GcLogger.gc_callback.if_phase_start_.else_.assert_False_Unrecogniz", "embedding": null, "metadata": {"file_path": "mypy/gclogger.py", "file_name": "gclogger.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 32, "span_ids": ["imports", "GcLogger", "GcLogger.__enter__", "GcLogger.gc_callback"], "tokens": 263}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import gc\nimport time\n\nfrom typing import Mapping, Optional\n\n\nclass GcLogger:\n \"\"\"Context manager to log GC stats and overall time.\"\"\"\n\n def __enter__(self) -> 'GcLogger':\n self.gc_start_time = None # type: Optional[float]\n self.gc_time = 0.0\n self.gc_calls = 0\n self.gc_collected = 0\n self.gc_uncollectable = 0\n gc.callbacks.append(self.gc_callback)\n self.start_time = time.time()\n return self\n\n def gc_callback(self, phase: str, info: Mapping[str, int]) -> None:\n if phase == 'start':\n assert self.gc_start_time is None, \"Start phase out of sequence\"\n self.gc_start_time = time.time()\n elif phase == 'stop':\n assert self.gc_start_time is not None, \"Stop phase out of sequence\"\n self.gc_calls += 1\n self.gc_time += time.time() - self.gc_start_time\n self.gc_start_time = None\n self.gc_collected += info['collected']\n self.gc_uncollectable += info['uncollectable']\n else:\n assert False, \"Unrecognized gc phase (%r)\" % (phase,)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/gclogger.py_GcLogger.__exit___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/gclogger.py_GcLogger.__exit___", "embedding": null, "metadata": {"file_path": "mypy/gclogger.py", "file_name": "gclogger.py", "file_type": "text/x-python", "category": "implementation", "start_line": 34, "end_line": 47, "span_ids": ["GcLogger.__exit__", "GcLogger.get_stats"], "tokens": 127}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GcLogger:\n\n def __exit__(self, *args: object) -> None:\n while self.gc_callback in gc.callbacks:\n gc.callbacks.remove(self.gc_callback)\n\n def get_stats(self) -> Mapping[str, float]:\n end_time = time.time()\n result = {}\n result['gc_time'] = self.gc_time\n result['gc_calls'] = self.gc_calls\n result['gc_collected'] = self.gc_collected\n result['gc_uncollectable'] = self.gc_uncollectable\n result['build_time'] = end_time - self.start_time\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/indirection.py_from_typing_import_Dict__extract_module_names.if_type_name_is_not_None_.else_.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/indirection.py_from_typing_import_Dict__extract_module_names.if_type_name_is_not_None_.else_.return._", "embedding": null, "metadata": {"file_path": "mypy/indirection.py", "file_name": "indirection.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 15, "span_ids": ["imports", "extract_module_names"], "tokens": 117}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from typing import Dict, Iterable, List, Optional, Set, Union\n\nfrom mypy.types import TypeVisitor\nimport mypy.types as types\nfrom mypy.util import split_module_names\n\n\ndef extract_module_names(type_name: Optional[str]) -> List[str]:\n \"\"\"Returns the module names of a fully qualified type name.\"\"\"\n if type_name is not None:\n # Discard the first one, which is just the qualified name of the type\n possible_module_names = split_module_names(type_name)\n return possible_module_names[1:]\n else:\n return []", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/indirection.py_TypeIndirectionVisitor_TypeIndirectionVisitor._visit.return.output": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/indirection.py_TypeIndirectionVisitor_TypeIndirectionVisitor._visit.return.output", "embedding": null, "metadata": {"file_path": "mypy/indirection.py", "file_name": "indirection.py", "file_type": "text/x-python", "category": "implementation", "start_line": 18, "end_line": 44, "span_ids": ["TypeIndirectionVisitor._visit", "TypeIndirectionVisitor.__init__", "TypeIndirectionVisitor.find_modules", "TypeIndirectionVisitor"], "tokens": 257}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeIndirectionVisitor(TypeVisitor[Set[str]]):\n \"\"\"Returns all module references within a particular type.\"\"\"\n\n def __init__(self) -> None:\n self.cache = {} # type: Dict[types.Type, Set[str]]\n self.seen_aliases = set() # type: Set[types.TypeAliasType]\n\n def find_modules(self, typs: Iterable[types.Type]) -> Set[str]:\n self.seen_aliases.clear()\n return self._visit(typs)\n\n def _visit(self, typ_or_typs: Union[types.Type, Iterable[types.Type]]) -> Set[str]:\n typs = [typ_or_typs] if isinstance(typ_or_typs, types.Type) else typ_or_typs\n output = set() # type: Set[str]\n for typ in typs:\n if isinstance(typ, types.TypeAliasType):\n # Avoid infinite recursion for recursive type aliases.\n if typ in self.seen_aliases:\n continue\n self.seen_aliases.add(typ)\n if typ in self.cache:\n modules = self.cache[typ]\n else:\n modules = typ.accept(self)\n self.cache[typ] = set(modules)\n output.update(modules)\n return output", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/indirection.py_TypeIndirectionVisitor.visit_unbound_type_TypeIndirectionVisitor.visit_type_var.return.self__visit_t_values_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/indirection.py_TypeIndirectionVisitor.visit_unbound_type_TypeIndirectionVisitor.visit_type_var.return.self__visit_t_values_s", "embedding": null, "metadata": {"file_path": "mypy/indirection.py", "file_name": "indirection.py", "file_type": "text/x-python", "category": "implementation", "start_line": 46, "end_line": 65, "span_ids": ["TypeIndirectionVisitor.visit_any", "TypeIndirectionVisitor.visit_uninhabited_type", "TypeIndirectionVisitor.visit_type_var", "TypeIndirectionVisitor.visit_deleted_type", "TypeIndirectionVisitor.visit_erased_type", "TypeIndirectionVisitor.visit_none_type", "TypeIndirectionVisitor.visit_unbound_type"], "tokens": 187}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeIndirectionVisitor(TypeVisitor[Set[str]]):\n\n def visit_unbound_type(self, t: types.UnboundType) -> Set[str]:\n return self._visit(t.args)\n\n def visit_any(self, t: types.AnyType) -> Set[str]:\n return set()\n\n def visit_none_type(self, t: types.NoneType) -> Set[str]:\n return set()\n\n def visit_uninhabited_type(self, t: types.UninhabitedType) -> Set[str]:\n return set()\n\n def visit_erased_type(self, t: types.ErasedType) -> Set[str]:\n return set()\n\n def visit_deleted_type(self, t: types.DeletedType) -> Set[str]:\n return set()\n\n def visit_type_var(self, t: types.TypeVarType) -> Set[str]:\n return self._visit(t.values) | self._visit(t.upper_bound)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/indirection.py_TypeIndirectionVisitor.visit_instance_TypeIndirectionVisitor.visit_instance.return.out": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/indirection.py_TypeIndirectionVisitor.visit_instance_TypeIndirectionVisitor.visit_instance.return.out", "embedding": null, "metadata": {"file_path": "mypy/indirection.py", "file_name": "indirection.py", "file_type": "text/x-python", "category": "implementation", "start_line": 67, "end_line": 77, "span_ids": ["TypeIndirectionVisitor.visit_instance"], "tokens": 133}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeIndirectionVisitor(TypeVisitor[Set[str]]):\n\n def visit_instance(self, t: types.Instance) -> Set[str]:\n out = self._visit(t.args)\n if t.type:\n # Uses of a class depend on everything in the MRO,\n # as changes to classes in the MRO can add types to methods,\n # change property types, change the MRO itself, etc.\n for s in t.type.mro:\n out.update(split_module_names(s.module_name))\n if t.type.metaclass_type is not None:\n out.update(split_module_names(t.type.metaclass_type.type.module_name))\n return out", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/indirection.py_TypeIndirectionVisitor.visit_callable_type_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/indirection.py_TypeIndirectionVisitor.visit_callable_type_", "embedding": null, "metadata": {"file_path": "mypy/indirection.py", "file_name": "indirection.py", "file_type": "text/x-python", "category": "implementation", "start_line": 79, "end_line": 108, "span_ids": ["TypeIndirectionVisitor.visit_tuple_type", "TypeIndirectionVisitor.visit_overloaded", "TypeIndirectionVisitor.visit_union_type", "TypeIndirectionVisitor.visit_type_type", "TypeIndirectionVisitor.visit_callable_type", "TypeIndirectionVisitor.visit_typeddict_type", "TypeIndirectionVisitor.visit_partial_type", "TypeIndirectionVisitor.visit_type_alias_type", "TypeIndirectionVisitor.visit_literal_type"], "tokens": 309}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeIndirectionVisitor(TypeVisitor[Set[str]]):\n\n def visit_callable_type(self, t: types.CallableType) -> Set[str]:\n out = self._visit(t.arg_types) | self._visit(t.ret_type)\n if t.definition is not None:\n out.update(extract_module_names(t.definition.fullname))\n return out\n\n def visit_overloaded(self, t: types.Overloaded) -> Set[str]:\n return self._visit(t.items()) | self._visit(t.fallback)\n\n def visit_tuple_type(self, t: types.TupleType) -> Set[str]:\n return self._visit(t.items) | self._visit(t.partial_fallback)\n\n def visit_typeddict_type(self, t: types.TypedDictType) -> Set[str]:\n return self._visit(t.items.values()) | self._visit(t.fallback)\n\n def visit_literal_type(self, t: types.LiteralType) -> Set[str]:\n return self._visit(t.fallback)\n\n def visit_union_type(self, t: types.UnionType) -> Set[str]:\n return self._visit(t.items)\n\n def visit_partial_type(self, t: types.PartialType) -> Set[str]:\n return set()\n\n def visit_type_type(self, t: types.TypeType) -> Set[str]:\n return self._visit(t.item)\n\n def visit_type_alias_type(self, t: types.TypeAliasType) -> Set[str]:\n return self._visit(types.get_proper_type(t))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/infer.py__Utilities_for_type_arg_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/infer.py__Utilities_for_type_arg_", "embedding": null, "metadata": {"file_path": "mypy/infer.py", "file_name": "infer.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 47, "span_ids": ["infer_function_type_arguments", "infer_type_arguments", "docstring"], "tokens": 393}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Utilities for type argument inference.\"\"\"\n\nfrom typing import List, Optional, Sequence\n\nfrom mypy.constraints import (\n infer_constraints, infer_constraints_for_callable, SUBTYPE_OF, SUPERTYPE_OF\n)\nfrom mypy.types import Type, TypeVarId, CallableType\nfrom mypy.solve import solve_constraints\n\n\ndef infer_function_type_arguments(callee_type: CallableType,\n arg_types: Sequence[Optional[Type]],\n arg_kinds: List[int],\n formal_to_actual: List[List[int]],\n strict: bool = True) -> List[Optional[Type]]:\n \"\"\"Infer the type arguments of a generic function.\n\n Return an array of lower bound types for the type variables -1 (at\n index 0), -2 (at index 1), etc. A lower bound is None if a value\n could not be inferred.\n\n Arguments:\n callee_type: the target generic function\n arg_types: argument types at the call site (each optional; if None,\n we are not considering this argument in the current pass)\n arg_kinds: nodes.ARG_* values for arg_types\n formal_to_actual: mapping from formal to actual variable indices\n \"\"\"\n # Infer constraints.\n constraints = infer_constraints_for_callable(\n callee_type, arg_types, arg_kinds, formal_to_actual)\n\n # Solve constraints.\n type_vars = callee_type.type_var_ids()\n return solve_constraints(type_vars, constraints, strict)\n\n\ndef infer_type_arguments(type_var_ids: List[TypeVarId],\n template: Type, actual: Type,\n is_supertype: bool = False) -> List[Optional[Type]]:\n # Like infer_function_type_arguments, but only match a single type\n # against a generic type.\n constraints = infer_constraints(template, actual,\n SUPERTYPE_OF if is_supertype else SUBTYPE_OF)\n return solve_constraints(type_var_ids, constraints)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/ipc.py__Cross_platform_abstrac_IPCException.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/ipc.py__Cross_platform_abstrac_IPCException.pass", "embedding": null, "metadata": {"file_path": "mypy/ipc.py", "file_name": "ipc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 35, "span_ids": ["IPCException", "docstring"], "tokens": 196}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Cross platform abstractions for inter-process communication\n\nOn Unix, this uses AF_UNIX sockets.\nOn Windows, this uses NamedPipes.\n\"\"\"\n\nimport base64\nimport os\nimport shutil\nimport sys\nimport tempfile\n\nfrom typing import Optional, Callable\nfrom typing_extensions import Final, Type\n\nfrom types import TracebackType\n\nif sys.platform == 'win32':\n # This may be private, but it is needed for IPC on Windows, and is basically stable\n import _winapi\n import ctypes\n\n _IPCHandle = int\n\n kernel32 = ctypes.windll.kernel32\n DisconnectNamedPipe = kernel32.DisconnectNamedPipe # type: Callable[[_IPCHandle], int]\n FlushFileBuffers = kernel32.FlushFileBuffers # type: Callable[[_IPCHandle], int]\nelse:\n import socket\n _IPCHandle = socket.socket\n\n\nclass IPCException(Exception):\n \"\"\"Exception for IPC issues.\"\"\"\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/ipc.py_IPCBase_IPCBase.read.return.bytes_bdata_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/ipc.py_IPCBase_IPCBase.read.return.bytes_bdata_", "embedding": null, "metadata": {"file_path": "mypy/ipc.py", "file_name": "ipc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 38, "end_line": 87, "span_ids": ["IPCBase.__init__", "IPCBase", "IPCBase.read"], "tokens": 394}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IPCBase:\n \"\"\"Base class for communication between the dmypy client and server.\n\n This contains logic shared between the client and server, such as reading\n and writing.\n \"\"\"\n\n connection = None # type: _IPCHandle\n\n def __init__(self, name: str, timeout: Optional[float]) -> None:\n self.name = name\n self.timeout = timeout\n\n def read(self, size: int = 100000) -> bytes:\n \"\"\"Read bytes from an IPC connection until its empty.\"\"\"\n bdata = bytearray()\n if sys.platform == 'win32':\n while True:\n ov, err = _winapi.ReadFile(self.connection, size, overlapped=True)\n # TODO: remove once typeshed supports Literal types\n assert isinstance(ov, _winapi.Overlapped)\n assert isinstance(err, int)\n try:\n if err == _winapi.ERROR_IO_PENDING:\n timeout = int(self.timeout * 1000) if self.timeout else _winapi.INFINITE\n res = _winapi.WaitForSingleObject(ov.event, timeout)\n if res != _winapi.WAIT_OBJECT_0:\n raise IPCException(\"Bad result from I/O wait: {}\".format(res))\n except BaseException:\n ov.cancel()\n raise\n _, err = ov.GetOverlappedResult(True)\n more = ov.getbuffer()\n if more:\n bdata.extend(more)\n if err == 0:\n # we are done!\n break\n elif err == _winapi.ERROR_MORE_DATA:\n # read again\n continue\n elif err == _winapi.ERROR_OPERATION_ABORTED:\n raise IPCException(\"ReadFile operation aborted.\")\n else:\n while True:\n more = self.connection.recv(size)\n if not more:\n break\n bdata.extend(more)\n return bytes(bdata)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/ipc.py_IPCBase.write_IPCBase.close.if_sys_platform_win32.else_.self_connection_close_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/ipc.py_IPCBase.write_IPCBase.close.if_sys_platform_win32.else_.self_connection_close_", "embedding": null, "metadata": {"file_path": "mypy/ipc.py", "file_name": "ipc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 89, "end_line": 122, "span_ids": ["IPCBase.write", "IPCBase.close"], "tokens": 324}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IPCBase:\n\n def write(self, data: bytes) -> None:\n \"\"\"Write bytes to an IPC connection.\"\"\"\n if sys.platform == 'win32':\n try:\n ov, err = _winapi.WriteFile(self.connection, data, overlapped=True)\n # TODO: remove once typeshed supports Literal types\n assert isinstance(ov, _winapi.Overlapped)\n assert isinstance(err, int)\n try:\n if err == _winapi.ERROR_IO_PENDING:\n timeout = int(self.timeout * 1000) if self.timeout else _winapi.INFINITE\n res = _winapi.WaitForSingleObject(ov.event, timeout)\n if res != _winapi.WAIT_OBJECT_0:\n raise IPCException(\"Bad result from I/O wait: {}\".format(res))\n elif err != 0:\n raise IPCException(\"Failed writing to pipe with error: {}\".format(err))\n except BaseException:\n ov.cancel()\n raise\n bytes_written, err = ov.GetOverlappedResult(True)\n assert err == 0, err\n assert bytes_written == len(data)\n except WindowsError as e:\n raise IPCException(\"Failed to write with error: {}\".format(e.winerror)) from e\n else:\n self.connection.sendall(data)\n self.connection.shutdown(socket.SHUT_WR)\n\n def close(self) -> None:\n if sys.platform == 'win32':\n if self.connection != _winapi.NULL:\n _winapi.CloseHandle(self.connection)\n else:\n self.connection.close()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/ipc.py_IPCClient_IPCClient.__exit__.self_close_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/ipc.py_IPCClient_IPCClient.__exit__.self_close_", "embedding": null, "metadata": {"file_path": "mypy/ipc.py", "file_name": "ipc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 125, "end_line": 173, "span_ids": ["IPCClient.__exit__", "IPCClient.__init__", "IPCClient", "IPCClient.__enter__"], "tokens": 398}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IPCClient(IPCBase):\n \"\"\"The client side of an IPC connection.\"\"\"\n\n def __init__(self, name: str, timeout: Optional[float]) -> None:\n super().__init__(name, timeout)\n if sys.platform == 'win32':\n timeout = int(self.timeout * 1000) if self.timeout else _winapi.NMPWAIT_WAIT_FOREVER\n try:\n _winapi.WaitNamedPipe(self.name, timeout)\n except FileNotFoundError as e:\n raise IPCException(\"The NamedPipe at {} was not found.\".format(self.name)) from e\n except WindowsError as e:\n if e.winerror == _winapi.ERROR_SEM_TIMEOUT:\n raise IPCException(\"Timed out waiting for connection.\") from e\n else:\n raise\n try:\n self.connection = _winapi.CreateFile(\n self.name,\n _winapi.GENERIC_READ | _winapi.GENERIC_WRITE,\n 0,\n _winapi.NULL,\n _winapi.OPEN_EXISTING,\n _winapi.FILE_FLAG_OVERLAPPED,\n _winapi.NULL,\n )\n except WindowsError as e:\n if e.winerror == _winapi.ERROR_PIPE_BUSY:\n raise IPCException(\"The connection is busy.\") from e\n else:\n raise\n _winapi.SetNamedPipeHandleState(self.connection,\n _winapi.PIPE_READMODE_MESSAGE,\n None,\n None)\n else:\n self.connection = socket.socket(socket.AF_UNIX)\n self.connection.settimeout(timeout)\n self.connection.connect(name)\n\n def __enter__(self) -> 'IPCClient':\n return self\n\n def __exit__(self,\n exc_ty: 'Optional[Type[BaseException]]' = None,\n exc_val: Optional[BaseException] = None,\n exc_tb: Optional[TracebackType] = None,\n ) -> None:\n self.close()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/ipc.py_IPCServer_IPCServer.__init__.None_1.else_.if_timeout_is_not_None_.self_sock_settimeout_time": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/ipc.py_IPCServer_IPCServer.__init__.None_1.else_.if_timeout_is_not_None_.self_sock_settimeout_time", "embedding": null, "metadata": {"file_path": "mypy/ipc.py", "file_name": "ipc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 176, "end_line": 212, "span_ids": ["IPCServer", "IPCServer.__init__"], "tokens": 351}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IPCServer(IPCBase):\n\n BUFFER_SIZE = 2**16 # type: Final\n\n def __init__(self, name: str, timeout: Optional[float] = None) -> None:\n if sys.platform == 'win32':\n name = r'\\\\.\\pipe\\{}-{}.pipe'.format(\n name, base64.urlsafe_b64encode(os.urandom(6)).decode())\n else:\n name = '{}.sock'.format(name)\n super().__init__(name, timeout)\n if sys.platform == 'win32':\n self.connection = _winapi.CreateNamedPipe(self.name,\n _winapi.PIPE_ACCESS_DUPLEX\n | _winapi.FILE_FLAG_FIRST_PIPE_INSTANCE\n | _winapi.FILE_FLAG_OVERLAPPED,\n _winapi.PIPE_READMODE_MESSAGE\n | _winapi.PIPE_TYPE_MESSAGE\n | _winapi.PIPE_WAIT\n | 0x8, # PIPE_REJECT_REMOTE_CLIENTS\n 1, # one instance\n self.BUFFER_SIZE,\n self.BUFFER_SIZE,\n _winapi.NMPWAIT_WAIT_FOREVER,\n 0, # Use default security descriptor\n )\n if self.connection == -1: # INVALID_HANDLE_VALUE\n err = _winapi.GetLastError()\n raise IPCException('Invalid handle to pipe: {}'.format(err))\n else:\n self.sock_directory = tempfile.mkdtemp()\n sockfile = os.path.join(self.sock_directory, self.name)\n self.sock = socket.socket(socket.AF_UNIX)\n self.sock.bind(sockfile)\n self.sock.listen(1)\n if timeout is not None:\n self.sock.settimeout(timeout)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/ipc.py_IPCServer.__enter___IPCServer.__enter__.return.self": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/ipc.py_IPCServer.__enter___IPCServer.__enter__.return.self", "embedding": null, "metadata": {"file_path": "mypy/ipc.py", "file_name": "ipc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 214, "end_line": 242, "span_ids": ["IPCServer.__enter__"], "tokens": 290}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IPCServer(IPCBase):\n\n def __enter__(self) -> 'IPCServer':\n if sys.platform == 'win32':\n # NOTE: It is theoretically possible that this will hang forever if the\n # client never connects, though this can be \"solved\" by killing the server\n try:\n ov = _winapi.ConnectNamedPipe(self.connection, overlapped=True)\n # TODO: remove once typeshed supports Literal types\n assert isinstance(ov, _winapi.Overlapped)\n except WindowsError as e:\n # Don't raise if the client already exists, or the client already connected\n if e.winerror not in (_winapi.ERROR_PIPE_CONNECTED, _winapi.ERROR_NO_DATA):\n raise\n else:\n try:\n timeout = int(self.timeout * 1000) if self.timeout else _winapi.INFINITE\n res = _winapi.WaitForSingleObject(ov.event, timeout)\n assert res == _winapi.WAIT_OBJECT_0\n except BaseException:\n ov.cancel()\n _winapi.CloseHandle(self.connection)\n raise\n _, err = ov.GetOverlappedResult(True)\n assert err == 0\n else:\n try:\n self.connection, _ = self.sock.accept()\n except socket.timeout as e:\n raise IPCException('The socket timed out') from e\n return self", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/ipc.py_IPCServer.__exit___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/ipc.py_IPCServer.__exit___", "embedding": null, "metadata": {"file_path": "mypy/ipc.py", "file_name": "ipc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 244, "end_line": 272, "span_ids": ["IPCServer.connection_name", "IPCServer.cleanup", "IPCServer.__exit__"], "tokens": 203}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IPCServer(IPCBase):\n\n def __exit__(self,\n exc_ty: 'Optional[Type[BaseException]]' = None,\n exc_val: Optional[BaseException] = None,\n exc_tb: Optional[TracebackType] = None,\n ) -> None:\n if sys.platform == 'win32':\n try:\n # Wait for the client to finish reading the last write before disconnecting\n if not FlushFileBuffers(self.connection):\n raise IPCException(\"Failed to flush NamedPipe buffer,\"\n \"maybe the client hung up?\")\n finally:\n DisconnectNamedPipe(self.connection)\n else:\n self.close()\n\n def cleanup(self) -> None:\n if sys.platform == 'win32':\n self.close()\n else:\n shutil.rmtree(self.sock_directory)\n\n @property\n def connection_name(self) -> str:\n if sys.platform == 'win32':\n return self.name\n else:\n return self.sock.getsockname()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py__Calculation_of_the_lea_from_mypy_import_state": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py__Calculation_of_the_lea_from_mypy_import_state", "embedding": null, "metadata": {"file_path": "mypy/join.py", "file_name": "join.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 19, "span_ids": ["docstring"], "tokens": 199}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Calculation of the least upper bound types (joins).\"\"\"\n\nfrom mypy.ordered_dict import OrderedDict\nfrom typing import List, Optional\n\nfrom mypy.types import (\n Type, AnyType, NoneType, TypeVisitor, Instance, UnboundType, TypeVarType, CallableType,\n TupleType, TypedDictType, ErasedType, UnionType, FunctionLike, Overloaded, LiteralType,\n PartialType, DeletedType, UninhabitedType, TypeType, TypeOfAny, get_proper_type,\n ProperType, get_proper_types, TypeAliasType\n)\nfrom mypy.maptype import map_instance_to_supertype\nfrom mypy.subtypes import (\n is_subtype, is_equivalent, is_subtype_ignoring_tvars, is_proper_subtype,\n is_protocol_implementation, find_member\n)\nfrom mypy.nodes import ARG_NAMED, ARG_NAMED_OPT\nimport mypy.typeops\nfrom mypy import state", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_join_simple_trivial_join.if_is_subtype_s_t_.else_.return.object_or_any_from_type_g": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_join_simple_trivial_join.if_is_subtype_s_t_.else_.return.object_or_any_from_type_g", "embedding": null, "metadata": {"file_path": "mypy/join.py", "file_name": "join.py", "file_type": "text/x-python", "category": "implementation", "start_line": 22, "end_line": 69, "span_ids": ["trivial_join", "join_simple"], "tokens": 387}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def join_simple(declaration: Optional[Type], s: Type, t: Type) -> ProperType:\n \"\"\"Return a simple least upper bound given the declared type.\"\"\"\n # TODO: check infinite recursion for aliases here.\n declaration = get_proper_type(declaration)\n s = get_proper_type(s)\n t = get_proper_type(t)\n\n if (s.can_be_true, s.can_be_false) != (t.can_be_true, t.can_be_false):\n # if types are restricted in different ways, use the more general versions\n s = mypy.typeops.true_or_false(s)\n t = mypy.typeops.true_or_false(t)\n\n if isinstance(s, AnyType):\n return s\n\n if isinstance(s, ErasedType):\n return t\n\n if is_proper_subtype(s, t):\n return t\n\n if is_proper_subtype(t, s):\n return s\n\n if isinstance(declaration, UnionType):\n return mypy.typeops.make_simplified_union([s, t])\n\n if isinstance(s, NoneType) and not isinstance(t, NoneType):\n s, t = t, s\n\n if isinstance(s, UninhabitedType) and not isinstance(t, UninhabitedType):\n s, t = t, s\n\n value = t.accept(TypeJoinVisitor(s))\n if declaration is None or is_subtype(value, declaration):\n return value\n\n return declaration\n\n\ndef trivial_join(s: Type, t: Type) -> ProperType:\n \"\"\"Return one of types (expanded) if it is a supertype of other, otherwise top type.\"\"\"\n if is_subtype(s, t):\n return get_proper_type(t)\n elif is_subtype(t, s):\n return get_proper_type(s)\n else:\n return object_or_any_from_type(get_proper_type(t))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_join_types_join_types.return.t_accept_TypeJoinVisitor_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_join_types_join_types.return.t_accept_TypeJoinVisitor_", "embedding": null, "metadata": {"file_path": "mypy/join.py", "file_name": "join.py", "file_type": "text/x-python", "category": "implementation", "start_line": 72, "end_line": 105, "span_ids": ["join_types"], "tokens": 309}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def join_types(s: Type, t: Type) -> ProperType:\n \"\"\"Return the least upper bound of s and t.\n\n For example, the join of 'int' and 'object' is 'object'.\n \"\"\"\n if mypy.typeops.is_recursive_pair(s, t):\n # This case can trigger an infinite recursion, general support for this will be\n # tricky so we use a trivial join (like for protocols).\n return trivial_join(s, t)\n s = get_proper_type(s)\n t = get_proper_type(t)\n\n if (s.can_be_true, s.can_be_false) != (t.can_be_true, t.can_be_false):\n # if types are restricted in different ways, use the more general versions\n s = mypy.typeops.true_or_false(s)\n t = mypy.typeops.true_or_false(t)\n\n if isinstance(s, AnyType):\n return s\n\n if isinstance(s, ErasedType):\n return t\n\n if isinstance(s, UnionType) and not isinstance(t, UnionType):\n s, t = t, s\n\n if isinstance(s, NoneType) and not isinstance(t, NoneType):\n s, t = t, s\n\n if isinstance(s, UninhabitedType) and not isinstance(t, UninhabitedType):\n s, t = t, s\n\n # Use a visitor to handle non-trivial cases.\n return t.accept(TypeJoinVisitor(s))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_TypeJoinVisitor_TypeJoinVisitor.visit_type_var.if_isinstance_self_s_Typ.else_.return.self_default_self_s_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_TypeJoinVisitor_TypeJoinVisitor.visit_type_var.if_isinstance_self_s_Typ.else_.return.self_default_self_s_", "embedding": null, "metadata": {"file_path": "mypy/join.py", "file_name": "join.py", "file_type": "text/x-python", "category": "implementation", "start_line": 108, "end_line": 154, "span_ids": ["TypeJoinVisitor.visit_unbound_type", "TypeJoinVisitor", "TypeJoinVisitor.visit_union_type", "TypeJoinVisitor.__init__", "TypeJoinVisitor.visit_any", "TypeJoinVisitor.visit_type_var", "TypeJoinVisitor.visit_uninhabited_type", "TypeJoinVisitor.visit_erased_type", "TypeJoinVisitor.visit_none_type", "TypeJoinVisitor.visit_deleted_type"], "tokens": 365}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeJoinVisitor(TypeVisitor[ProperType]):\n \"\"\"Implementation of the least upper bound algorithm.\n\n Attributes:\n s: The other (left) type operand.\n \"\"\"\n\n def __init__(self, s: ProperType) -> None:\n self.s = s\n\n def visit_unbound_type(self, t: UnboundType) -> ProperType:\n return AnyType(TypeOfAny.special_form)\n\n def visit_union_type(self, t: UnionType) -> ProperType:\n if is_proper_subtype(self.s, t):\n return t\n else:\n return mypy.typeops.make_simplified_union([self.s, t])\n\n def visit_any(self, t: AnyType) -> ProperType:\n return t\n\n def visit_none_type(self, t: NoneType) -> ProperType:\n if state.strict_optional:\n if isinstance(self.s, (NoneType, UninhabitedType)):\n return t\n elif isinstance(self.s, UnboundType):\n return AnyType(TypeOfAny.special_form)\n else:\n return mypy.typeops.make_simplified_union([self.s, t])\n else:\n return self.s\n\n def visit_uninhabited_type(self, t: UninhabitedType) -> ProperType:\n return self.s\n\n def visit_deleted_type(self, t: DeletedType) -> ProperType:\n return self.s\n\n def visit_erased_type(self, t: ErasedType) -> ProperType:\n return self.s\n\n def visit_type_var(self, t: TypeVarType) -> ProperType:\n if isinstance(self.s, TypeVarType) and self.s.id == t.id:\n return self.s\n else:\n return self.default(self.s)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_TypeJoinVisitor.visit_instance_TypeJoinVisitor.visit_instance.if_isinstance_self_s_Ins.else_.return.self_default_self_s_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_TypeJoinVisitor.visit_instance_TypeJoinVisitor.visit_instance.if_isinstance_self_s_Ins.else_.return.self_default_self_s_", "embedding": null, "metadata": {"file_path": "mypy/join.py", "file_name": "join.py", "file_type": "text/x-python", "category": "implementation", "start_line": 156, "end_line": 185, "span_ids": ["TypeJoinVisitor.visit_instance"], "tokens": 302}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeJoinVisitor(TypeVisitor[ProperType]):\n\n def visit_instance(self, t: Instance) -> ProperType:\n if isinstance(self.s, Instance):\n nominal = join_instances(t, self.s)\n structural = None # type: Optional[Instance]\n if t.type.is_protocol and is_protocol_implementation(self.s, t):\n structural = t\n elif self.s.type.is_protocol and is_protocol_implementation(t, self.s):\n structural = self.s\n # Structural join is preferred in the case where we have found both\n # structural and nominal and they have same MRO length (see two comments\n # in join_instances_via_supertype). Otherwise, just return the nominal join.\n if not structural or is_better(nominal, structural):\n return nominal\n return structural\n elif isinstance(self.s, FunctionLike):\n if t.type.is_protocol:\n call = unpack_callback_protocol(t)\n if call:\n return join_types(call, self.s)\n return join_types(t, self.s.fallback)\n elif isinstance(self.s, TypeType):\n return join_types(t, self.s)\n elif isinstance(self.s, TypedDictType):\n return join_types(t, self.s)\n elif isinstance(self.s, TupleType):\n return join_types(t, self.s)\n elif isinstance(self.s, LiteralType):\n return join_types(t, self.s)\n else:\n return self.default(self.s)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_TypeJoinVisitor.visit_callable_type_TypeJoinVisitor.visit_callable_type.return.join_types_t_fallback_se": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_TypeJoinVisitor.visit_callable_type_TypeJoinVisitor.visit_callable_type.return.join_types_t_fallback_se", "embedding": null, "metadata": {"file_path": "mypy/join.py", "file_name": "join.py", "file_type": "text/x-python", "category": "implementation", "start_line": 187, "end_line": 209, "span_ids": ["TypeJoinVisitor.visit_callable_type"], "tokens": 298}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeJoinVisitor(TypeVisitor[ProperType]):\n\n def visit_callable_type(self, t: CallableType) -> ProperType:\n if isinstance(self.s, CallableType) and is_similar_callables(t, self.s):\n if is_equivalent(t, self.s):\n return combine_similar_callables(t, self.s)\n result = join_similar_callables(t, self.s)\n # We set the from_type_type flag to suppress error when a collection of\n # concrete class objects gets inferred as their common abstract superclass.\n if not ((t.is_type_obj() and t.type_object().is_abstract) or\n (self.s.is_type_obj() and self.s.type_object().is_abstract)):\n result.from_type_type = True\n if any(isinstance(tp, (NoneType, UninhabitedType))\n for tp in get_proper_types(result.arg_types)):\n # We don't want to return unusable Callable, attempt fallback instead.\n return join_types(t.fallback, self.s)\n return result\n elif isinstance(self.s, Overloaded):\n # Switch the order of arguments to that we'll get to visit_overloaded.\n return join_types(t, self.s)\n elif isinstance(self.s, Instance) and self.s.type.is_protocol:\n call = unpack_callback_protocol(self.s)\n if call:\n return join_types(t, call)\n return join_types(t.fallback, self.s)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_TypeJoinVisitor.visit_overloaded_TypeJoinVisitor.visit_overloaded.return.join_types_t_fallback_s_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_TypeJoinVisitor.visit_overloaded_TypeJoinVisitor.visit_overloaded.return.join_types_t_fallback_s_", "embedding": null, "metadata": {"file_path": "mypy/join.py", "file_name": "join.py", "file_type": "text/x-python", "category": "implementation", "start_line": 211, "end_line": 262, "span_ids": ["TypeJoinVisitor.visit_overloaded"], "tokens": 628}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeJoinVisitor(TypeVisitor[ProperType]):\n\n def visit_overloaded(self, t: Overloaded) -> ProperType:\n # This is more complex than most other cases. Here are some\n # examples that illustrate how this works.\n #\n # First let's define a concise notation:\n # - Cn are callable types (for n in 1, 2, ...)\n # - Ov(C1, C2, ...) is an overloaded type with items C1, C2, ...\n # - Callable[[T, ...], S] is written as [T, ...] -> S.\n #\n # We want some basic properties to hold (assume Cn are all\n # unrelated via Any-similarity):\n #\n # join(Ov(C1, C2), C1) == C1\n # join(Ov(C1, C2), Ov(C1, C2)) == Ov(C1, C2)\n # join(Ov(C1, C2), Ov(C1, C3)) == C1\n # join(Ov(C2, C2), C3) == join of fallback types\n #\n # The presence of Any types makes things more interesting. The join is the\n # most general type we can get with respect to Any:\n #\n # join(Ov([int] -> int, [str] -> str), [Any] -> str) == Any -> str\n #\n # We could use a simplification step that removes redundancies, but that's not\n # implemented right now. Consider this example, where we get a redundancy:\n #\n # join(Ov([int, Any] -> Any, [str, Any] -> Any), [Any, int] -> Any) ==\n # Ov([Any, int] -> Any, [Any, int] -> Any)\n #\n # TODO: Consider more cases of callable subtyping.\n result = [] # type: List[CallableType]\n s = self.s\n if isinstance(s, FunctionLike):\n # The interesting case where both types are function types.\n for t_item in t.items():\n for s_item in s.items():\n if is_similar_callables(t_item, s_item):\n if is_equivalent(t_item, s_item):\n result.append(combine_similar_callables(t_item, s_item))\n elif is_subtype(t_item, s_item):\n result.append(s_item)\n if result:\n # TODO: Simplify redundancies from the result.\n if len(result) == 1:\n return result[0]\n else:\n return Overloaded(result)\n return join_types(t.fallback, s.fallback)\n elif isinstance(s, Instance) and s.type.is_protocol:\n call = unpack_callback_protocol(s)\n if call:\n return join_types(t, call)\n return join_types(t.fallback, s)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_TypeJoinVisitor.visit_tuple_type_TypeJoinVisitor.visit_tuple_type.if_isinstance_self_s_Tup.else_.return.join_types_self_s_mypy_t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_TypeJoinVisitor.visit_tuple_type_TypeJoinVisitor.visit_tuple_type.if_isinstance_self_s_Tup.else_.return.join_types_self_s_mypy_t", "embedding": null, "metadata": {"file_path": "mypy/join.py", "file_name": "join.py", "file_type": "text/x-python", "category": "implementation", "start_line": 264, "end_line": 288, "span_ids": ["TypeJoinVisitor.visit_tuple_type"], "tokens": 330}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeJoinVisitor(TypeVisitor[ProperType]):\n\n def visit_tuple_type(self, t: TupleType) -> ProperType:\n # When given two fixed-length tuples:\n # * If they have the same length, join their subtypes item-wise:\n # Tuple[int, bool] + Tuple[bool, bool] becomes Tuple[int, bool]\n # * If lengths do not match, return a variadic tuple:\n # Tuple[bool, int] + Tuple[bool] becomes Tuple[int, ...]\n #\n # Otherwise, `t` is a fixed-length tuple but `self.s` is NOT:\n # * Joining with a variadic tuple returns variadic tuple:\n # Tuple[int, bool] + Tuple[bool, ...] becomes Tuple[int, ...]\n # * Joining with any Sequence also returns a Sequence:\n # Tuple[int, bool] + List[bool] becomes Sequence[int]\n if isinstance(self.s, TupleType) and self.s.length() == t.length():\n fallback = join_instances(mypy.typeops.tuple_fallback(self.s),\n mypy.typeops.tuple_fallback(t))\n assert isinstance(fallback, Instance)\n if self.s.length() == t.length():\n items = [] # type: List[Type]\n for i in range(t.length()):\n items.append(self.join(t.items[i], self.s.items[i]))\n return TupleType(items, fallback)\n else:\n return fallback\n else:\n return join_types(self.s, mypy.typeops.tuple_fallback(t))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_TypeJoinVisitor.visit_typeddict_type_TypeJoinVisitor.visit_typeddict_type.if_isinstance_self_s_Typ.else_.return.self_default_self_s_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_TypeJoinVisitor.visit_typeddict_type_TypeJoinVisitor.visit_typeddict_type.if_isinstance_self_s_Typ.else_.return.self_default_self_s_", "embedding": null, "metadata": {"file_path": "mypy/join.py", "file_name": "join.py", "file_type": "text/x-python", "category": "implementation", "start_line": 290, "end_line": 307, "span_ids": ["TypeJoinVisitor.visit_typeddict_type"], "tokens": 236}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeJoinVisitor(TypeVisitor[ProperType]):\n\n def visit_typeddict_type(self, t: TypedDictType) -> ProperType:\n if isinstance(self.s, TypedDictType):\n items = OrderedDict([\n (item_name, s_item_type)\n for (item_name, s_item_type, t_item_type) in self.s.zip(t)\n if (is_equivalent(s_item_type, t_item_type) and\n (item_name in t.required_keys) == (item_name in self.s.required_keys))\n ])\n mapping_value_type = join_type_list(list(items.values()))\n fallback = self.s.create_anonymous_fallback(value_type=mapping_value_type)\n # We need to filter by items.keys() since some required keys present in both t and\n # self.s might be missing from the join if the types are incompatible.\n required_keys = set(items.keys()) & t.required_keys & self.s.required_keys\n return TypedDictType(items, required_keys, fallback)\n elif isinstance(self.s, Instance):\n return join_types(self.s, t.fallback)\n else:\n return self.default(self.s)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_TypeJoinVisitor.visit_literal_type_TypeJoinVisitor.join.return.join_types_s_t_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_TypeJoinVisitor.visit_literal_type_TypeJoinVisitor.join.return.join_types_s_t_", "embedding": null, "metadata": {"file_path": "mypy/join.py", "file_name": "join.py", "file_type": "text/x-python", "category": "implementation", "start_line": 309, "end_line": 336, "span_ids": ["TypeJoinVisitor.visit_literal_type", "TypeJoinVisitor.visit_type_type", "TypeJoinVisitor.visit_partial_type", "TypeJoinVisitor.visit_type_alias_type", "TypeJoinVisitor.join"], "tokens": 295}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeJoinVisitor(TypeVisitor[ProperType]):\n\n def visit_literal_type(self, t: LiteralType) -> ProperType:\n if isinstance(self.s, LiteralType):\n if t == self.s:\n return t\n if self.s.fallback.type.is_enum and t.fallback.type.is_enum:\n return mypy.typeops.make_simplified_union([self.s, t])\n return join_types(self.s.fallback, t.fallback)\n else:\n return join_types(self.s, t.fallback)\n\n def visit_partial_type(self, t: PartialType) -> ProperType:\n # We only have partial information so we can't decide the join result. We should\n # never get here.\n assert False, \"Internal error\"\n\n def visit_type_type(self, t: TypeType) -> ProperType:\n if isinstance(self.s, TypeType):\n return TypeType.make_normalized(self.join(t.item, self.s.item), line=t.line)\n elif isinstance(self.s, Instance) and self.s.type.fullname == 'builtins.type':\n return self.s\n else:\n return self.default(self.s)\n\n def visit_type_alias_type(self, t: TypeAliasType) -> ProperType:\n assert False, \"This should be never called, got {}\".format(t)\n\n def join(self, s: Type, t: Type) -> ProperType:\n return join_types(s, t)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_TypeJoinVisitor.default_TypeJoinVisitor.default.if_isinstance_typ_Instan.else_.return.AnyType_TypeOfAny_special": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_TypeJoinVisitor.default_TypeJoinVisitor.default.if_isinstance_typ_Instan.else_.return.AnyType_TypeOfAny_special", "embedding": null, "metadata": {"file_path": "mypy/join.py", "file_name": "join.py", "file_type": "text/x-python", "category": "implementation", "start_line": 337, "end_line": 352, "span_ids": ["TypeJoinVisitor.default"], "tokens": 152}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeJoinVisitor(TypeVisitor[ProperType]):\n\n def default(self, typ: Type) -> ProperType:\n typ = get_proper_type(typ)\n if isinstance(typ, Instance):\n return object_from_instance(typ)\n elif isinstance(typ, UnboundType):\n return AnyType(TypeOfAny.special_form)\n elif isinstance(typ, TupleType):\n return self.default(mypy.typeops.tuple_fallback(typ))\n elif isinstance(typ, TypedDictType):\n return self.default(typ.fallback)\n elif isinstance(typ, FunctionLike):\n return self.default(typ.fallback)\n elif isinstance(typ, TypeVarType):\n return self.default(typ.upper_bound)\n else:\n return AnyType(TypeOfAny.special_form)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_join_instances_join_instances.if_t_type_s_type_.else_.return.join_instances_via_supert": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_join_instances_join_instances.if_t_type_s_type_.else_.return.join_instances_via_supert", "embedding": null, "metadata": {"file_path": "mypy/join.py", "file_name": "join.py", "file_type": "text/x-python", "category": "implementation", "start_line": 355, "end_line": 377, "span_ids": ["join_instances"], "tokens": 261}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def join_instances(t: Instance, s: Instance) -> ProperType:\n \"\"\"Calculate the join of two instance types.\"\"\"\n if t.type == s.type:\n # Simplest case: join two types with the same base type (but\n # potentially different arguments).\n if is_subtype(t, s) or is_subtype(s, t):\n # Compatible; combine type arguments.\n args = [] # type: List[Type]\n # N.B: We use zip instead of indexing because the lengths might have\n # mismatches during daemon reprocessing.\n for ta, sa in zip(t.args, s.args):\n args.append(join_types(ta, sa))\n return Instance(t.type, args)\n else:\n # Incompatible; return trivial result object.\n return object_from_instance(t)\n elif t.type.bases and is_subtype_ignoring_tvars(t, s):\n return join_instances_via_supertype(t, s)\n else:\n # Now t is not a subtype of s, and t != s. Now s could be a subtype\n # of t; alternatively, we need to find a common supertype. This works\n # in of the both cases.\n return join_instances_via_supertype(s, t)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_join_instances_via_supertype_join_instances_via_supertype.return.best": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_join_instances_via_supertype_join_instances_via_supertype.return.best", "embedding": null, "metadata": {"file_path": "mypy/join.py", "file_name": "join.py", "file_type": "text/x-python", "category": "implementation", "start_line": 380, "end_line": 402, "span_ids": ["join_instances_via_supertype"], "tokens": 276}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def join_instances_via_supertype(t: Instance, s: Instance) -> ProperType:\n # Give preference to joins via duck typing relationship, so that\n # join(int, float) == float, for example.\n if t.type._promote and is_subtype(t.type._promote, s):\n return join_types(t.type._promote, s)\n elif s.type._promote and is_subtype(s.type._promote, t):\n return join_types(t, s.type._promote)\n # Compute the \"best\" supertype of t when joined with s.\n # The definition of \"best\" may evolve; for now it is the one with\n # the longest MRO. Ties are broken by using the earlier base.\n best = None # type: Optional[ProperType]\n for base in t.type.bases:\n mapped = map_instance_to_supertype(t, base.type)\n res = join_instances(mapped, s)\n if best is None or is_better(res, best):\n best = res\n assert best is not None\n promote = get_proper_type(t.type._promote)\n if isinstance(promote, Instance):\n res = join_instances(promote, s)\n if is_better(res, best):\n best = res\n return best", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_is_better_is_similar_callables.return._len_t_arg_types_len_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_is_better_is_similar_callables.return._len_t_arg_types_len_", "embedding": null, "metadata": {"file_path": "mypy/join.py", "file_name": "join.py", "file_type": "text/x-python", "category": "implementation", "start_line": 405, "end_line": 425, "span_ids": ["is_better", "is_similar_callables"], "tokens": 191}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_better(t: Type, s: Type) -> bool:\n # Given two possible results from join_instances_via_supertype(),\n # indicate whether t is the better one.\n t = get_proper_type(t)\n s = get_proper_type(s)\n\n if isinstance(t, Instance):\n if not isinstance(s, Instance):\n return True\n # Use len(mro) as a proxy for the better choice.\n if len(t.type.mro) > len(s.type.mro):\n return True\n return False\n\n\ndef is_similar_callables(t: CallableType, s: CallableType) -> bool:\n \"\"\"Return True if t and s have identical numbers of\n arguments, default arguments and varargs.\n \"\"\"\n return (len(t.arg_types) == len(s.arg_types) and t.min_args == s.min_args and\n t.is_var_arg == s.is_var_arg)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_join_similar_callables_join_similar_callables.return.t_copy_modified_arg_types": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_join_similar_callables_join_similar_callables.return.t_copy_modified_arg_types", "embedding": null, "metadata": {"file_path": "mypy/join.py", "file_name": "join.py", "file_type": "text/x-python", "category": "implementation", "start_line": 428, "end_line": 444, "span_ids": ["join_similar_callables"], "tokens": 200}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def join_similar_callables(t: CallableType, s: CallableType) -> CallableType:\n from mypy.meet import meet_types\n arg_types = [] # type: List[Type]\n for i in range(len(t.arg_types)):\n arg_types.append(meet_types(t.arg_types[i], s.arg_types[i]))\n # TODO in combine_similar_callables also applies here (names and kinds)\n # The fallback type can be either 'function' or 'type'. The result should have 'type' as\n # fallback only if both operands have it as 'type'.\n if t.fallback.type.fullname != 'builtins.type':\n fallback = t.fallback\n else:\n fallback = s.fallback\n return t.copy_modified(arg_types=arg_types,\n arg_names=combine_arg_names(t, s),\n ret_type=join_types(t.ret_type, s.ret_type),\n fallback=fallback,\n name=None)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_combine_similar_callables_combine_similar_callables.return.t_copy_modified_arg_types": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_combine_similar_callables_combine_similar_callables.return.t_copy_modified_arg_types", "embedding": null, "metadata": {"file_path": "mypy/join.py", "file_name": "join.py", "file_type": "text/x-python", "category": "implementation", "start_line": 447, "end_line": 462, "span_ids": ["combine_similar_callables"], "tokens": 180}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def combine_similar_callables(t: CallableType, s: CallableType) -> CallableType:\n arg_types = [] # type: List[Type]\n for i in range(len(t.arg_types)):\n arg_types.append(join_types(t.arg_types[i], s.arg_types[i]))\n # TODO kinds and argument names\n # The fallback type can be either 'function' or 'type'. The result should have 'type' as\n # fallback only if both operands have it as 'type'.\n if t.fallback.type.fullname != 'builtins.type':\n fallback = t.fallback\n else:\n fallback = s.fallback\n return t.copy_modified(arg_types=arg_types,\n arg_names=combine_arg_names(t, s),\n ret_type=join_types(t.ret_type, s.ret_type),\n fallback=fallback,\n name=None)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_combine_arg_names_combine_arg_names.return.new_names": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_combine_arg_names_combine_arg_names.return.new_names", "embedding": null, "metadata": {"file_path": "mypy/join.py", "file_name": "join.py", "file_type": "text/x-python", "category": "implementation", "start_line": 465, "end_line": 492, "span_ids": ["combine_arg_names"], "tokens": 288}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def combine_arg_names(t: CallableType, s: CallableType) -> List[Optional[str]]:\n \"\"\"Produces a list of argument names compatible with both callables.\n\n For example, suppose 't' and 's' have the following signatures:\n\n - t: (a: int, b: str, X: str) -> None\n - s: (a: int, b: str, Y: str) -> None\n\n This function would return [\"a\", \"b\", None]. This information\n is then used above to compute the join of t and s, which results\n in a signature of (a: int, b: str, str) -> None.\n\n Note that the third argument's name is omitted and 't' and 's'\n are both valid subtypes of this inferred signature.\n\n Precondition: is_similar_types(t, s) is true.\n \"\"\"\n num_args = len(t.arg_types)\n new_names = []\n named = (ARG_NAMED, ARG_NAMED_OPT)\n for i in range(num_args):\n t_name = t.arg_names[i]\n s_name = s.arg_names[i]\n if t_name == s_name or t.arg_kinds[i] in named or s.arg_kinds[i] in named:\n new_names.append(t_name)\n else:\n new_names.append(None)\n return new_names", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_object_from_instance_object_or_any_from_type.return.AnyType_TypeOfAny_impleme": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_object_from_instance_object_or_any_from_type.return.AnyType_TypeOfAny_impleme", "embedding": null, "metadata": {"file_path": "mypy/join.py", "file_name": "join.py", "file_type": "text/x-python", "category": "implementation", "start_line": 495, "end_line": 521, "span_ids": ["object_from_instance", "object_or_any_from_type"], "tokens": 269}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def object_from_instance(instance: Instance) -> Instance:\n \"\"\"Construct the type 'builtins.object' from an instance type.\"\"\"\n # Use the fact that 'object' is always the last class in the mro.\n res = Instance(instance.type.mro[-1], [])\n return res\n\n\ndef object_or_any_from_type(typ: ProperType) -> ProperType:\n # Similar to object_from_instance() but tries hard for all types.\n # TODO: find a better way to get object, or make this more reliable.\n if isinstance(typ, Instance):\n return object_from_instance(typ)\n elif isinstance(typ, (CallableType, TypedDictType, LiteralType)):\n return object_from_instance(typ.fallback)\n elif isinstance(typ, TupleType):\n return object_from_instance(typ.partial_fallback)\n elif isinstance(typ, TypeType):\n return object_or_any_from_type(typ.item)\n elif isinstance(typ, TypeVarType) and isinstance(typ.upper_bound, ProperType):\n return object_or_any_from_type(typ.upper_bound)\n elif isinstance(typ, UnionType):\n for item in typ.items:\n if isinstance(item, ProperType):\n candidate = object_or_any_from_type(item)\n if isinstance(candidate, Instance):\n return candidate\n return AnyType(TypeOfAny.implementation_artifact)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_join_type_list_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/join.py_join_type_list_", "embedding": null, "metadata": {"file_path": "mypy/join.py", "file_name": "join.py", "file_type": "text/x-python", "category": "implementation", "start_line": 524, "end_line": 540, "span_ids": ["join_type_list", "unpack_callback_protocol"], "tokens": 141}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def join_type_list(types: List[Type]) -> ProperType:\n if not types:\n # This is a little arbitrary but reasonable. Any empty tuple should be compatible\n # with all variable length tuples, and this makes it possible.\n return UninhabitedType()\n joined = get_proper_type(types[0])\n for t in types[1:]:\n joined = join_types(joined, t)\n return joined\n\n\ndef unpack_callback_protocol(t: Instance) -> Optional[Type]:\n assert t.type.is_protocol\n if t.type.protocol_members == ['__call__']:\n return find_member('__call__', t, t, is_operator=True)\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/literals.py_from_typing_import_Option_from_mypy_visitor_import_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/literals.py_from_typing_import_Option_from_mypy_visitor_import_", "embedding": null, "metadata": {"file_path": "mypy/literals.py", "file_name": "literals.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 13, "span_ids": ["imports"], "tokens": 205}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from typing import Optional, Union, Any, Tuple, Iterable\nfrom typing_extensions import Final\n\nfrom mypy.nodes import (\n Expression, ComparisonExpr, OpExpr, MemberExpr, UnaryExpr, StarExpr, IndexExpr, LITERAL_YES,\n LITERAL_NO, NameExpr, LITERAL_TYPE, IntExpr, FloatExpr, ComplexExpr, StrExpr, BytesExpr,\n UnicodeExpr, ListExpr, TupleExpr, SetExpr, DictExpr, CallExpr, SliceExpr, CastExpr,\n ConditionalExpr, EllipsisExpr, YieldFromExpr, YieldExpr, RevealExpr, SuperExpr,\n TypeApplication, LambdaExpr, ListComprehension, SetComprehension, DictionaryComprehension,\n GeneratorExpr, BackquoteExpr, TypeVarExpr, TypeAliasExpr, NamedTupleExpr, EnumCallExpr,\n TypedDictExpr, NewTypeExpr, PromoteExpr, AwaitExpr, TempNode, AssignmentExpr, ParamSpecExpr\n)\nfrom mypy.visitor import ExpressionVisitor", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/literals.py__Note_Literals_and_lite_literal_hash.return.e_accept__hasher_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/literals.py__Note_Literals_and_lite_literal_hash.return.e_accept__hasher_", "embedding": null, "metadata": {"file_path": "mypy/literals.py", "file_name": "literals.py", "file_type": "text/x-python", "category": "implementation", "start_line": 15, "end_line": 90, "span_ids": ["subkeys", "impl", "imports", "literal_hash", "literal"], "tokens": 568}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# [Note Literals and literal_hash]\n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n#\n# Mypy uses the term \"literal\" to refer to any expression built out of\n# the following:\n#\n# * Plain literal expressions, like `1` (integer, float, string, etc.)\n#\n# * Compound literal expressions, like `(lit1, lit2)` (list, dict,\n# set, or tuple)\n#\n# * Operator expressions, like `lit1 + lit2`\n#\n# * Variable references, like `x`\n#\n# * Member references, like `lit.m`\n#\n# * Index expressions, like `lit[0]`\n#\n# A typical \"literal\" looks like `x[(i,j+1)].m`.\n#\n# An expression that is a literal has a `literal_hash`, with the\n# following properties.\n#\n# * `literal_hash` is a Key: a tuple containing basic data types and\n# possibly other Keys. So it can be used as a key in a dictionary\n# that will be compared by value (as opposed to the Node itself,\n# which is compared by identity).\n#\n# * Two expressions have equal `literal_hash`es if and only if they\n# are syntactically equal expressions. (NB: Actually, we also\n# identify as equal expressions like `3` and `3.0`; is this a good\n# idea?)\n#\n# * The elements of `literal_hash` that are tuples are exactly the\n# subexpressions of the original expression (e.g. the base and index\n# of an index expression, or the operands of an operator expression).\n\n\ndef literal(e: Expression) -> int:\n if isinstance(e, ComparisonExpr):\n return min(literal(o) for o in e.operands)\n\n elif isinstance(e, OpExpr):\n return min(literal(e.left), literal(e.right))\n\n elif isinstance(e, (MemberExpr, UnaryExpr, StarExpr)):\n return literal(e.expr)\n\n elif isinstance(e, IndexExpr):\n if literal(e.index) == LITERAL_YES:\n return literal(e.base)\n else:\n return LITERAL_NO\n\n elif isinstance(e, NameExpr):\n return LITERAL_TYPE\n\n if isinstance(e, (IntExpr, FloatExpr, ComplexExpr, StrExpr, BytesExpr, UnicodeExpr)):\n return LITERAL_YES\n\n if literal_hash(e):\n return LITERAL_YES\n\n return LITERAL_NO\n\n\nKey = Tuple[Any, ...]\n\n\ndef subkeys(key: Key) -> Iterable[Key]:\n return [elt for elt in key if isinstance(elt, tuple)]\n\n\ndef literal_hash(e: Expression) -> Optional[Key]:\n return e.accept(_hasher)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/literals.py__Hasher__Hasher.visit_yield_from_expr.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/literals.py__Hasher__Hasher.visit_yield_from_expr.return.None", "embedding": null, "metadata": {"file_path": "mypy/literals.py", "file_name": "literals.py", "file_type": "text/x-python", "category": "implementation", "start_line": 93, "end_line": 181, "span_ids": ["_Hasher.visit_member_expr", "_Hasher.visit_unicode_expr", "_Hasher.visit_comparison_expr", "_Hasher", "_Hasher.visit_yield_from_expr", "_Hasher.visit_cast_expr", "_Hasher.visit_star_expr", "_Hasher.visit_bytes_expr", "_Hasher.visit_unary_expr", "_Hasher.visit_int_expr", "_Hasher.visit_dict_expr", "_Hasher.visit_assignment_expr", "_Hasher.visit_call_expr", "_Hasher.visit_slice_expr", "_Hasher.visit_str_expr", "_Hasher.visit_set_expr", "_Hasher.visit_conditional_expr", "_Hasher.visit_name_expr", "_Hasher.seq_expr", "_Hasher.visit_op_expr", "_Hasher.visit_tuple_expr", "_Hasher.visit_complex_expr", "_Hasher.visit_index_expr", "_Hasher.visit_list_expr", "_Hasher.visit_ellipsis", "_Hasher.visit_float_expr"], "tokens": 820}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class _Hasher(ExpressionVisitor[Optional[Key]]):\n def visit_int_expr(self, e: IntExpr) -> Key:\n return ('Literal', e.value)\n\n def visit_str_expr(self, e: StrExpr) -> Key:\n return ('Literal', e.value, e.from_python_3)\n\n def visit_bytes_expr(self, e: BytesExpr) -> Key:\n return ('Literal', e.value)\n\n def visit_unicode_expr(self, e: UnicodeExpr) -> Key:\n return ('Literal', e.value)\n\n def visit_float_expr(self, e: FloatExpr) -> Key:\n return ('Literal', e.value)\n\n def visit_complex_expr(self, e: ComplexExpr) -> Key:\n return ('Literal', e.value)\n\n def visit_star_expr(self, e: StarExpr) -> Key:\n return ('Star', literal_hash(e.expr))\n\n def visit_name_expr(self, e: NameExpr) -> Key:\n # N.B: We use the node itself as the key, and not the name,\n # because using the name causes issues when there is shadowing\n # (for example, in list comprehensions).\n return ('Var', e.node)\n\n def visit_member_expr(self, e: MemberExpr) -> Key:\n return ('Member', literal_hash(e.expr), e.name)\n\n def visit_op_expr(self, e: OpExpr) -> Key:\n return ('Binary', e.op, literal_hash(e.left), literal_hash(e.right))\n\n def visit_comparison_expr(self, e: ComparisonExpr) -> Key:\n rest = tuple(e.operators) # type: Any\n rest += tuple(literal_hash(o) for o in e.operands)\n return ('Comparison',) + rest\n\n def visit_unary_expr(self, e: UnaryExpr) -> Key:\n return ('Unary', e.op, literal_hash(e.expr))\n\n def seq_expr(self, e: Union[ListExpr, TupleExpr, SetExpr], name: str) -> Optional[Key]:\n if all(literal(x) == LITERAL_YES for x in e.items):\n rest = tuple(literal_hash(x) for x in e.items) # type: Any\n return (name,) + rest\n return None\n\n def visit_list_expr(self, e: ListExpr) -> Optional[Key]:\n return self.seq_expr(e, 'List')\n\n def visit_dict_expr(self, e: DictExpr) -> Optional[Key]:\n if all(a and literal(a) == literal(b) == LITERAL_YES for a, b in e.items):\n rest = tuple((literal_hash(a) if a else None, literal_hash(b))\n for a, b in e.items) # type: Any\n return ('Dict',) + rest\n return None\n\n def visit_tuple_expr(self, e: TupleExpr) -> Optional[Key]:\n return self.seq_expr(e, 'Tuple')\n\n def visit_set_expr(self, e: SetExpr) -> Optional[Key]:\n return self.seq_expr(e, 'Set')\n\n def visit_index_expr(self, e: IndexExpr) -> Optional[Key]:\n if literal(e.index) == LITERAL_YES:\n return ('Index', literal_hash(e.base), literal_hash(e.index))\n return None\n\n def visit_assignment_expr(self, e: AssignmentExpr) -> None:\n return None\n\n def visit_call_expr(self, e: CallExpr) -> None:\n return None\n\n def visit_slice_expr(self, e: SliceExpr) -> None:\n return None\n\n def visit_cast_expr(self, e: CastExpr) -> None:\n return None\n\n def visit_conditional_expr(self, e: ConditionalExpr) -> None:\n return None\n\n def visit_ellipsis(self, e: EllipsisExpr) -> None:\n return None\n\n def visit_yield_from_expr(self, e: YieldFromExpr) -> None:\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/literals.py__Hasher.visit_yield_expr_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/literals.py__Hasher.visit_yield_expr_", "embedding": null, "metadata": {"file_path": "mypy/literals.py", "file_name": "literals.py", "file_type": "text/x-python", "category": "implementation", "start_line": 183, "end_line": 245, "span_ids": ["_Hasher.visit_enum_call_expr", "impl:3", "_Hasher.visit_backquote_expr", "_Hasher.visit_namedtuple_expr", "_Hasher.visit_set_comprehension", "_Hasher.visit_paramspec_expr", "_Hasher.visit_list_comprehension", "_Hasher.visit_lambda_expr", "_Hasher.visit_reveal_expr", "_Hasher.visit_type_application", "_Hasher.visit_newtype_expr", "_Hasher.visit_await_expr", "_Hasher.visit_yield_expr", "_Hasher.visit_type_alias_expr", "_Hasher.visit_type_var_expr", "_Hasher.visit_temp_node", "_Hasher.visit_generator_expr", "_Hasher.visit_dictionary_comprehension", "_Hasher.visit_typeddict_expr", "_Hasher.visit__promote_expr", "_Hasher.visit_super_expr"], "tokens": 439}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class _Hasher(ExpressionVisitor[Optional[Key]]):\n\n def visit_yield_expr(self, e: YieldExpr) -> None:\n return None\n\n def visit_reveal_expr(self, e: RevealExpr) -> None:\n return None\n\n def visit_super_expr(self, e: SuperExpr) -> None:\n return None\n\n def visit_type_application(self, e: TypeApplication) -> None:\n return None\n\n def visit_lambda_expr(self, e: LambdaExpr) -> None:\n return None\n\n def visit_list_comprehension(self, e: ListComprehension) -> None:\n return None\n\n def visit_set_comprehension(self, e: SetComprehension) -> None:\n return None\n\n def visit_dictionary_comprehension(self, e: DictionaryComprehension) -> None:\n return None\n\n def visit_generator_expr(self, e: GeneratorExpr) -> None:\n return None\n\n def visit_backquote_expr(self, e: BackquoteExpr) -> None:\n return None\n\n def visit_type_var_expr(self, e: TypeVarExpr) -> None:\n return None\n\n def visit_paramspec_expr(self, e: ParamSpecExpr) -> None:\n return None\n\n def visit_type_alias_expr(self, e: TypeAliasExpr) -> None:\n return None\n\n def visit_namedtuple_expr(self, e: NamedTupleExpr) -> None:\n return None\n\n def visit_enum_call_expr(self, e: EnumCallExpr) -> None:\n return None\n\n def visit_typeddict_expr(self, e: TypedDictExpr) -> None:\n return None\n\n def visit_newtype_expr(self, e: NewTypeExpr) -> None:\n return None\n\n def visit__promote_expr(self, e: PromoteExpr) -> None:\n return None\n\n def visit_await_expr(self, e: AwaitExpr) -> None:\n return None\n\n def visit_temp_node(self, e: TempNode) -> None:\n return None\n\n\n_hasher = _Hasher() # type: Final", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/lookup.py___": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/lookup.py___", "embedding": null, "metadata": {"file_path": "mypy/lookup.py", "file_name": "lookup.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 60, "span_ids": ["lookup_fully_qualified", "docstring"], "tokens": 479}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"\nThis is a module for various lookup functions:\nfunctions that will find a semantic node by its name.\n\"\"\"\n\nfrom mypy.nodes import MypyFile, SymbolTableNode, TypeInfo\nfrom typing import Dict, Optional\n\n# TODO: gradually move existing lookup functions to this module.\n\n\ndef lookup_fully_qualified(name: str, modules: Dict[str, MypyFile],\n raise_on_missing: bool = False) -> Optional[SymbolTableNode]:\n \"\"\"Find a symbol using it fully qualified name.\n\n The algorithm has two steps: first we try splitting the name on '.' to find\n the module, then iteratively look for each next chunk after a '.' (e.g. for\n nested classes).\n\n This function should *not* be used to find a module. Those should be looked\n in the modules dictionary.\n \"\"\"\n head = name\n rest = []\n # 1. Find a module tree in modules dictionary.\n while True:\n if '.' not in head:\n if raise_on_missing:\n assert '.' in head, \"Cannot find module for %s\" % (name,)\n return None\n head, tail = head.rsplit('.', maxsplit=1)\n rest.append(tail)\n mod = modules.get(head)\n if mod is not None:\n break\n names = mod.names\n # 2. Find the symbol in the module tree.\n if not rest:\n # Looks like a module, don't use this to avoid confusions.\n if raise_on_missing:\n assert rest, \"Cannot find %s, got a module symbol\" % (name,)\n return None\n while True:\n key = rest.pop()\n if key not in names:\n if raise_on_missing:\n assert key in names, \"Cannot find component %r for %r\" % (key, name)\n return None\n stnode = names[key]\n if not rest:\n return stnode\n node = stnode.node\n # In fine-grained mode, could be a cross-reference to a deleted module\n # or a Var made up for a missing module.\n if not isinstance(node, TypeInfo):\n if raise_on_missing:\n assert node, \"Cannot find %s\" % (name,)\n return None\n names = node.names", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py__Mypy_type_checker_comm_stat_proxy.try_.else_.return.st": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py__Mypy_type_checker_comm_stat_proxy.try_.else_.return.st", "embedding": null, "metadata": {"file_path": "mypy/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 44, "span_ids": ["stat_proxy", "docstring"], "tokens": 319}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Mypy type checker command line tool.\"\"\"\n\nimport argparse\nfrom gettext import gettext\nimport os\nimport subprocess\nimport sys\nimport time\n\nfrom typing import Any, Dict, IO, List, Optional, Sequence, Tuple, TextIO, Union\nfrom typing_extensions import Final, NoReturn\n\nfrom mypy import build\nfrom mypy import defaults\nfrom mypy import state\nfrom mypy import util\nfrom mypy.modulefinder import (\n BuildSource, FindModuleCache, SearchPaths,\n get_site_packages_dirs, mypy_path,\n)\nfrom mypy.find_sources import create_source_list, InvalidSourceList\nfrom mypy.fscache import FileSystemCache\nfrom mypy.errors import CompileError\nfrom mypy.errorcodes import error_codes\nfrom mypy.options import Options, BuildType\nfrom mypy.config_parser import parse_version, parse_config_file\nfrom mypy.split_namespace import SplitNamespace\n\nfrom mypy.version import __version__\n\norig_stat = os.stat # type: Final\nMEM_PROFILE = False # type: Final # If True, dump memory profile\n\n\ndef stat_proxy(path: str) -> os.stat_result:\n try:\n st = orig_stat(path)\n except os.error as err:\n print(\"stat(%r) -> %s\" % (path, err))\n raise\n else:\n print(\"stat(%r) -> (st_mode=%o, st_mtime=%d, st_size=%d)\" %\n (path, st.st_mode, st.st_mtime, st.st_size))\n return st", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_main_main.list_res_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_main_main.list_res_", "embedding": null, "metadata": {"file_path": "mypy/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 47, "end_line": 144, "span_ids": ["main"], "tokens": 780}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def main(script_path: Optional[str],\n stdout: TextIO,\n stderr: TextIO,\n args: Optional[List[str]] = None,\n ) -> None:\n \"\"\"Main entry point to the type checker.\n\n Args:\n script_path: Path to the 'mypy' script (used for finding data files).\n args: Custom command-line arguments. If not given, sys.argv[1:] will\n be used.\n \"\"\"\n util.check_python_version('mypy')\n t0 = time.time()\n # To log stat() calls: os.stat = stat_proxy\n sys.setrecursionlimit(2 ** 14)\n if args is None:\n args = sys.argv[1:]\n\n fscache = FileSystemCache()\n sources, options = process_options(args, stdout=stdout, stderr=stderr,\n fscache=fscache)\n\n messages = []\n formatter = util.FancyFormatter(stdout, stderr, options.show_error_codes)\n\n if options.install_types and (stdout is not sys.stdout or stderr is not sys.stderr):\n # Since --install-types performs user input, we want regular stdout and stderr.\n fail(\"--install-types not supported in this mode of running mypy\", stderr, options)\n\n if options.install_types and not sources:\n install_types(options.cache_dir, formatter)\n return\n\n def flush_errors(new_messages: List[str], serious: bool) -> None:\n if options.pretty:\n new_messages = formatter.fit_in_terminal(new_messages)\n messages.extend(new_messages)\n f = stderr if serious else stdout\n for msg in new_messages:\n if options.color_output:\n msg = formatter.colorize(msg)\n f.write(msg + '\\n')\n f.flush()\n\n serious = False\n blockers = False\n res = None\n try:\n # Keep a dummy reference (res) for memory profiling below, as otherwise\n # the result could be freed.\n res = build.build(sources, options, None, flush_errors, fscache, stdout, stderr)\n except CompileError as e:\n blockers = True\n if not e.use_stdout:\n serious = True\n if options.warn_unused_configs and options.unused_configs and not options.incremental:\n print(\"Warning: unused section(s) in %s: %s\" %\n (options.config_file,\n \", \".join(\"[mypy-%s]\" % glob for glob in options.per_module_options.keys()\n if glob in options.unused_configs)),\n file=stderr)\n maybe_write_junit_xml(time.time() - t0, serious, messages, options)\n\n if MEM_PROFILE:\n from mypy.memprofile import print_memory_profile\n print_memory_profile()\n\n code = 0\n if messages:\n code = 2 if blockers else 1\n if options.error_summary:\n if messages:\n n_errors, n_files = util.count_stats(messages)\n if n_errors:\n summary = formatter.format_error(\n n_errors, n_files, len(sources), blockers=blockers,\n use_color=options.color_output\n )\n stdout.write(summary + '\\n')\n else:\n stdout.write(formatter.format_success(len(sources), options.color_output) + '\\n')\n stdout.flush()\n\n if options.install_types:\n install_types(options.cache_dir, formatter, after_run=True)\n return\n\n if options.fast_exit:\n # Exit without freeing objects -- it's faster.\n #\n # NOTE: We don't flush all open files on exit (or run other destructors)!\n util.hard_exit(code)\n elif code:\n sys.exit(code)\n\n # HACK: keep res alive so that mypyc won't free it before the hard_exit\n list([res])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py__Make_the_help_output_a__AugmentedHelpFormatter._fill_text.if_n_in_text_.else_.return.argparse_HelpFormatter__f": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py__Make_the_help_output_a__AugmentedHelpFormatter._fill_text.if_n_in_text_.else_.return.argparse_HelpFormatter__f", "embedding": null, "metadata": {"file_path": "mypy/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 132, "end_line": 144, "span_ids": ["AugmentedHelpFormatter._fill_text", "AugmentedHelpFormatter", "AugmentedHelpFormatter.__init__", "main"], "tokens": 147}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Make the help output a little less jarring.\nclass AugmentedHelpFormatter(argparse.RawDescriptionHelpFormatter):\n def __init__(self, prog: str) -> None:\n super().__init__(prog=prog, max_help_position=28)\n\n def _fill_text(self, text: str, width: int, indent: str) -> str:\n if '\\n' in text:\n # Assume we want to manually format the text\n return super()._fill_text(text, width, indent)\n else:\n # Assume we want argparse to manage wrapping, indentating, and\n # formatting the text for us.\n return argparse.HelpFormatter._fill_text(self, text, width, indent)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py__Define_pairs_of_flag_pr_PythonExecutableInferenceError._Represents_a_failure_t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py__Define_pairs_of_flag_pr_PythonExecutableInferenceError._Represents_a_failure_t", "embedding": null, "metadata": {"file_path": "mypy/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 147, "end_line": 171, "span_ids": ["invert_flag_name", "PythonExecutableInferenceError", "impl:5", "AugmentedHelpFormatter._fill_text"], "tokens": 191}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Define pairs of flag prefixes with inverse meaning.\nflag_prefix_pairs = [\n ('allow', 'disallow'),\n ('show', 'hide'),\n] # type: Final\nflag_prefix_map = {} # type: Final[Dict[str, str]]\nfor a, b in flag_prefix_pairs:\n flag_prefix_map[a] = b\n flag_prefix_map[b] = a\n\n\ndef invert_flag_name(flag: str) -> str:\n split = flag[2:].split('-', 1)\n if len(split) == 2:\n prefix, rest = split\n if prefix in flag_prefix_map:\n return '--{}-{}'.format(flag_prefix_map[prefix], rest)\n elif prefix == 'no':\n return '--{}'.format(rest)\n\n return '--no-{}'.format(flag[2:])\n\n\nclass PythonExecutableInferenceError(Exception):\n \"\"\"Represents a failure to infer the version or executable while searching.\"\"\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_python_executable_prefix_python_executable_prefix.if_sys_platform_win32.else_.return._python_format_v_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_python_executable_prefix_python_executable_prefix.if_sys_platform_win32.else_.return._python_format_v_", "embedding": null, "metadata": {"file_path": "mypy/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 174, "end_line": 182, "span_ids": ["python_executable_prefix"], "tokens": 127}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def python_executable_prefix(v: str) -> List[str]:\n if sys.platform == 'win32':\n # on Windows, all Python executables are named `python`. To handle this, there\n # is the `py` launcher, which can be passed a version e.g. `py -3.5`, and it will\n # execute an installed Python 3.5 interpreter. See also:\n # https://docs.python.org/3/using/windows.html#python-launcher-for-windows\n return ['py', '-{}'.format(v)]\n else:\n return ['python{}'.format(v)]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py__python_executable_from_version__python_executable_from_version.try_.except_subprocess_Called.raise_PythonExecutableInf": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py__python_executable_from_version__python_executable_from_version.try_.except_subprocess_Called.raise_PythonExecutableInf", "embedding": null, "metadata": {"file_path": "mypy/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 185, "end_line": 198, "span_ids": ["_python_executable_from_version"], "tokens": 158}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _python_executable_from_version(python_version: Tuple[int, int]) -> str:\n if sys.version_info[:2] == python_version:\n return sys.executable\n str_ver = '.'.join(map(str, python_version))\n try:\n sys_exe = subprocess.check_output(python_executable_prefix(str_ver) +\n ['-c', 'import sys; print(sys.executable)'],\n stderr=subprocess.STDOUT).decode().strip()\n return sys_exe\n except (subprocess.CalledProcessError, FileNotFoundError) as e:\n raise PythonExecutableInferenceError(\n 'failed to find a Python executable matching version {},'\n ' perhaps try --python-executable, or --no-site-packages?'.format(python_version)\n ) from e", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_infer_python_executable_infer_python_executable.options.python_executable.python_executable": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_infer_python_executable_infer_python_executable.options.python_executable.python_executable", "embedding": null, "metadata": {"file_path": "mypy/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 201, "end_line": 219, "span_ids": ["infer_python_executable"], "tokens": 193}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def infer_python_executable(options: Options,\n special_opts: argparse.Namespace) -> None:\n \"\"\"Infer the Python executable from the given version.\n\n This function mutates options based on special_opts to infer the correct Python executable\n to use.\n \"\"\"\n # TODO: (ethanhs) Look at folding these checks and the site packages subprocess calls into\n # one subprocess call for speed.\n\n # Use the command line specified executable, or fall back to one set in the\n # config file. If an executable is not specified, infer it from the version\n # (unless no_executable is set)\n python_executable = special_opts.python_executable or options.python_executable\n\n if python_executable is None:\n if not special_opts.no_executable and not options.no_site_packages:\n python_executable = _python_executable_from_version(options.python_version)\n options.python_executable = python_executable", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_HEADER_FOOTER._Environment_variables_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_HEADER_FOOTER._Environment_variables_", "embedding": null, "metadata": {"file_path": "mypy/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 237, "end_line": 266, "span_ids": ["impl:12"], "tokens": 261}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "HEADER = \"\"\"%(prog)s [-h] [-v] [-V] [more options; see below]\n [-m MODULE] [-p PACKAGE] [-c PROGRAM_TEXT] [files ...]\"\"\" # type: Final\n\n\nDESCRIPTION = \"\"\"\nMypy is a program that will type check your Python code.\n\nPass in any files or folders you want to type check. Mypy will\nrecursively traverse any provided folders to find .py files:\n\n $ mypy my_program.py my_src_folder\n\nFor more information on getting started, see:\n\n- https://mypy.readthedocs.io/en/stable/getting_started.html\n\nFor more details on both running mypy and using the flags below, see:\n\n- https://mypy.readthedocs.io/en/stable/running_mypy.html\n- https://mypy.readthedocs.io/en/stable/command_line.html\n\nYou can also use a config file to configure mypy instead of using\ncommand line flags. For more details, see:\n\n- https://mypy.readthedocs.io/en/stable/config_file.html\n\"\"\" # type: Final\n\nFOOTER = \"\"\"Environment variables:\n Define MYPYPATH for additional module search path entries.\n Define MYPY_CACHE_DIR to override configuration cache_dir path.\"\"\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_None_9_CapturableArgumentParser.exit.sys_exit_status_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_None_9_CapturableArgumentParser.exit.sys_exit_status_", "embedding": null, "metadata": {"file_path": "mypy/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 251, "end_line": 292, "span_ids": ["CapturableArgumentParser.print_help", "CapturableArgumentParser", "CapturableArgumentParser._print_message", "impl:12", "CapturableArgumentParser.print_usage", "CapturableArgumentParser.__init__", "CapturableArgumentParser.exit"], "tokens": 311}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": " # type: Final\n\n\nclass CapturableArgumentParser(argparse.ArgumentParser):\n\n \"\"\"Override ArgumentParser methods that use sys.stdout/sys.stderr directly.\n\n This is needed because hijacking sys.std* is not thread-safe,\n yet output must be captured to properly support mypy.api.run.\n \"\"\"\n\n def __init__(self, *args: Any, **kwargs: Any):\n self.stdout = kwargs.pop('stdout', sys.stdout)\n self.stderr = kwargs.pop('stderr', sys.stderr)\n super().__init__(*args, **kwargs)\n\n # =====================\n # Help-printing methods\n # =====================\n def print_usage(self, file: Optional[IO[str]] = None) -> None:\n if file is None:\n file = self.stdout\n self._print_message(self.format_usage(), file)\n\n def print_help(self, file: Optional[IO[str]] = None) -> None:\n if file is None:\n file = self.stdout\n self._print_message(self.format_help(), file)\n\n def _print_message(self, message: str, file: Optional[IO[str]] = None) -> None:\n if message:\n if file is None:\n file = self.stderr\n file.write(message)\n\n # ===============\n # Exiting methods\n # ===============\n def exit(self, status: int = 0, message: Optional[str] = None) -> NoReturn:\n if message:\n self._print_message(message, self.stderr)\n sys.exit(status)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_CapturableArgumentParser.error_CapturableArgumentParser.error.self_exit_2_gettext_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_CapturableArgumentParser.error_CapturableArgumentParser.error.self_exit_2_gettext_p", "embedding": null, "metadata": {"file_path": "mypy/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 294, "end_line": 305, "span_ids": ["CapturableArgumentParser.error"], "tokens": 115}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CapturableArgumentParser(argparse.ArgumentParser):\n\n def error(self, message: str) -> NoReturn:\n \"\"\"error(message: string)\n\n Prints a usage message incorporating the message to stderr and\n exits.\n\n If you override this in a subclass, it should not return -- it\n should either exit or raise an exception.\n \"\"\"\n self.print_usage(self.stderr)\n args = {'prog': self.prog, 'message': message}\n self.exit(2, gettext('%(prog)s: error: %(message)s\\n') % args)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_CapturableVersionAction_CapturableVersionAction.__call__.parser_exit_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_CapturableVersionAction_CapturableVersionAction.__call__.parser_exit_", "embedding": null, "metadata": {"file_path": "mypy/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 308, "end_line": 344, "span_ids": ["CapturableVersionAction.__init__", "CapturableVersionAction", "CapturableVersionAction.__call__"], "tokens": 271}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CapturableVersionAction(argparse.Action):\n\n \"\"\"Supplement CapturableArgumentParser to handle --version.\n\n This is nearly identical to argparse._VersionAction except,\n like CapturableArgumentParser, it allows output to be captured.\n\n Another notable difference is that version is mandatory.\n This allows removing a line in __call__ that falls back to parser.version\n (which does not appear to exist).\n \"\"\"\n\n def __init__(self,\n option_strings: Sequence[str],\n version: str,\n dest: str = argparse.SUPPRESS,\n default: str = argparse.SUPPRESS,\n help: str = \"show program's version number and exit\",\n stdout: Optional[IO[str]] = None):\n super().__init__(\n option_strings=option_strings,\n dest=dest,\n default=default,\n nargs=0,\n help=help)\n self.version = version\n self.stdout = stdout or sys.stdout\n\n def __call__(self,\n parser: argparse.ArgumentParser,\n namespace: argparse.Namespace,\n values: Union[str, Sequence[Any], None],\n option_string: Optional[str] = None) -> NoReturn:\n formatter = parser._get_formatter()\n formatter.add_text(self.version)\n parser._print_message(formatter.format_help(), self.stdout)\n parser.exit()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_process_options_process_options._type_List_Tuple_str_b": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_process_options_process_options._type_List_Tuple_str_b", "embedding": null, "metadata": {"file_path": "mypy/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 347, "end_line": 375, "span_ids": ["process_options"], "tokens": 241}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def process_options(args: List[str],\n stdout: Optional[TextIO] = None,\n stderr: Optional[TextIO] = None,\n require_targets: bool = True,\n server_options: bool = False,\n fscache: Optional[FileSystemCache] = None,\n program: str = 'mypy',\n header: str = HEADER,\n ) -> Tuple[List[BuildSource], Options]:\n \"\"\"Parse command line arguments.\n\n If a FileSystemCache is passed in, and package_root options are given,\n call fscache.set_package_root() to set the cache's package root.\n \"\"\"\n stdout = stdout or sys.stdout\n stderr = stderr or sys.stderr\n\n parser = CapturableArgumentParser(prog=program,\n usage=header,\n description=DESCRIPTION,\n epilog=FOOTER,\n fromfile_prefix_chars='@',\n formatter_class=AugmentedHelpFormatter,\n add_help=False,\n stdout=stdout,\n stderr=stderr)\n\n strict_flag_names = [] # type: List[str]\n strict_flag_assignments = [] # type: List[Tuple[str, bool]]\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_process_options.add_invertible_flag_process_options.add_invertible_flag.if_strict_flag_.strict_flag_assignments_a": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_process_options.add_invertible_flag_process_options.add_invertible_flag.if_strict_flag_.strict_flag_assignments_a", "embedding": null, "metadata": {"file_path": "mypy/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 377, "end_line": 406, "span_ids": ["process_options"], "tokens": 316}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def process_options(args: List[str],\n stdout: Optional[TextIO] = None,\n stderr: Optional[TextIO] = None,\n require_targets: bool = True,\n server_options: bool = False,\n fscache: Optional[FileSystemCache] = None,\n program: str = 'mypy',\n header: str = HEADER,\n ) -> Tuple[List[BuildSource], Options]:\n # ... other code\n\n def add_invertible_flag(flag: str,\n *,\n inverse: Optional[str] = None,\n default: bool,\n dest: Optional[str] = None,\n help: str,\n strict_flag: bool = False,\n group: Optional[argparse._ActionsContainer] = None\n ) -> None:\n if inverse is None:\n inverse = invert_flag_name(flag)\n if group is None:\n group = parser\n\n if help is not argparse.SUPPRESS:\n help += \" (inverse: {})\".format(inverse)\n\n arg = group.add_argument(flag,\n action='store_false' if default else 'store_true',\n dest=dest,\n help=help)\n dest = arg.dest\n arg = group.add_argument(inverse,\n action='store_true' if default else 'store_false',\n dest=dest,\n help=argparse.SUPPRESS)\n if strict_flag:\n assert dest is not None\n strict_flag_names.append(flag)\n strict_flag_assignments.append((dest, not default))\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_process_options._Unless_otherwise_specif_process_options.platform_group.parser_add_argument_group": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_process_options._Unless_otherwise_specif_process_options.platform_group.parser_add_argument_group", "embedding": null, "metadata": {"file_path": "mypy/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 408, "end_line": 474, "span_ids": ["process_options"], "tokens": 791}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def process_options(args: List[str],\n stdout: Optional[TextIO] = None,\n stderr: Optional[TextIO] = None,\n require_targets: bool = True,\n server_options: bool = False,\n fscache: Optional[FileSystemCache] = None,\n program: str = 'mypy',\n header: str = HEADER,\n ) -> Tuple[List[BuildSource], Options]:\n\n # Unless otherwise specified, arguments will be parsed directly onto an\n # Options object. Options that require further processing should have\n # their `dest` prefixed with `special-opts:`, which will cause them to be\n # parsed into the separate special_opts namespace object.\n\n # Note: we have a style guide for formatting the mypy --help text. See\n # https://github.com/python/mypy/wiki/Documentation-Conventions\n\n general_group = parser.add_argument_group(\n title='Optional arguments')\n general_group.add_argument(\n '-h', '--help', action='help',\n help=\"Show this help message and exit\")\n general_group.add_argument(\n '-v', '--verbose', action='count', dest='verbosity',\n help=\"More verbose messages\")\n general_group.add_argument(\n '-V', '--version', action=CapturableVersionAction,\n version='%(prog)s ' + __version__,\n help=\"Show program's version number and exit\",\n stdout=stdout)\n\n config_group = parser.add_argument_group(\n title='Config file',\n description=\"Use a config file instead of command line arguments. \"\n \"This is useful if you are using many flags or want \"\n \"to set different options per each module.\")\n config_group.add_argument(\n '--config-file',\n help=\"Configuration file, must have a [mypy] section \"\n \"(defaults to {})\".format(', '.join(defaults.CONFIG_FILES)))\n add_invertible_flag('--warn-unused-configs', default=False, strict_flag=True,\n help=\"Warn about unused '[mypy-]' config sections\",\n group=config_group)\n\n imports_group = parser.add_argument_group(\n title='Import discovery',\n description=\"Configure how imports are discovered and followed.\")\n add_invertible_flag(\n '--namespace-packages', default=False,\n help=\"Support namespace packages (PEP 420, __init__.py-less)\",\n group=imports_group)\n imports_group.add_argument(\n '--ignore-missing-imports', action='store_true',\n help=\"Silently ignore imports of missing modules\")\n imports_group.add_argument(\n '--follow-imports', choices=['normal', 'silent', 'skip', 'error'],\n default='normal', help=\"How to treat imports (default normal)\")\n imports_group.add_argument(\n '--python-executable', action='store', metavar='EXECUTABLE',\n help=\"Python executable used for finding PEP 561 compliant installed\"\n \" packages and stubs\",\n dest='special-opts:python_executable')\n imports_group.add_argument(\n '--no-site-packages', action='store_true',\n dest='special-opts:no_executable',\n help=\"Do not search for installed PEP 561 compliant packages\")\n imports_group.add_argument(\n '--no-silence-site-packages', action='store_true',\n help=\"Do not silence errors in PEP 561 compliant installed packages\")\n\n platform_group = parser.add_argument_group(\n title='Platform configuration',\n description=\"Type check code assuming it will be run under certain \"\n \"runtime conditions. By default, mypy assumes your code \"\n \"will be run using the same operating system and Python \"\n \"version you are using to run mypy itself.\")\n # ... other code\n options.disabled_error_codes -= options.enabled_error_codes\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_process_options.platform_group_add_argume_process_options.None_23": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_process_options.platform_group_add_argume_process_options.None_23", "embedding": null, "metadata": {"file_path": "mypy/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 475, "end_line": 530, "span_ids": ["process_options"], "tokens": 754}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def process_options(args: List[str],\n stdout: Optional[TextIO] = None,\n stderr: Optional[TextIO] = None,\n require_targets: bool = True,\n server_options: bool = False,\n fscache: Optional[FileSystemCache] = None,\n program: str = 'mypy',\n header: str = HEADER,\n ) -> Tuple[List[BuildSource], Options]:\n # ... other code\n platform_group.add_argument(\n '--python-version', type=parse_version, metavar='x.y',\n help='Type check code assuming it will be running on Python x.y',\n dest='special-opts:python_version')\n platform_group.add_argument(\n '-2', '--py2', dest='special-opts:python_version', action='store_const',\n const=defaults.PYTHON2_VERSION,\n help=\"Use Python 2 mode (same as --python-version 2.7)\")\n platform_group.add_argument(\n '--platform', action='store', metavar='PLATFORM',\n help=\"Type check special-cased code for the given OS platform \"\n \"(defaults to sys.platform)\")\n platform_group.add_argument(\n '--always-true', metavar='NAME', action='append', default=[],\n help=\"Additional variable to be considered True (may be repeated)\")\n platform_group.add_argument(\n '--always-false', metavar='NAME', action='append', default=[],\n help=\"Additional variable to be considered False (may be repeated)\")\n\n disallow_any_group = parser.add_argument_group(\n title='Disallow dynamic typing',\n description=\"Disallow the use of the dynamic 'Any' type under certain conditions.\")\n disallow_any_group.add_argument(\n '--disallow-any-unimported', default=False, action='store_true',\n help=\"Disallow Any types resulting from unfollowed imports\")\n disallow_any_group.add_argument(\n '--disallow-any-expr', default=False, action='store_true',\n help='Disallow all expressions that have type Any')\n disallow_any_group.add_argument(\n '--disallow-any-decorated', default=False, action='store_true',\n help='Disallow functions that have Any in their signature '\n 'after decorator transformation')\n disallow_any_group.add_argument(\n '--disallow-any-explicit', default=False, action='store_true',\n help='Disallow explicit Any in type positions')\n add_invertible_flag('--disallow-any-generics', default=False, strict_flag=True,\n help='Disallow usage of generic types that do not specify explicit type '\n 'parameters', group=disallow_any_group)\n add_invertible_flag('--disallow-subclassing-any', default=False, strict_flag=True,\n help=\"Disallow subclassing values of type 'Any' when defining classes\",\n group=disallow_any_group)\n\n untyped_group = parser.add_argument_group(\n title='Untyped definitions and calls',\n description=\"Configure how untyped definitions and calls are handled. \"\n \"Note: by default, mypy ignores any untyped function definitions \"\n \"and assumes any calls to such functions have a return \"\n \"type of 'Any'.\")\n add_invertible_flag('--disallow-untyped-calls', default=False, strict_flag=True,\n help=\"Disallow calling functions without type annotations\"\n \" from functions with type annotations\",\n group=untyped_group)\n add_invertible_flag('--disallow-untyped-defs', default=False, strict_flag=True,\n help=\"Disallow defining functions without type annotations\"\n \" or with incomplete type annotations\",\n group=untyped_group)\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_process_options.None_24_process_options.strictness_group.parser_add_argument_group": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_process_options.None_24_process_options.strictness_group.parser_add_argument_group", "embedding": null, "metadata": {"file_path": "mypy/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 546, "end_line": 603, "span_ids": ["process_options"], "tokens": 770}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def process_options(args: List[str],\n stdout: Optional[TextIO] = None,\n stderr: Optional[TextIO] = None,\n require_targets: bool = True,\n server_options: bool = False,\n fscache: Optional[FileSystemCache] = None,\n program: str = 'mypy',\n header: str = HEADER,\n ) -> Tuple[List[BuildSource], Options]:\n # ... other code\n add_invertible_flag('--disallow-incomplete-defs', default=False, strict_flag=True,\n help=\"Disallow defining functions with incomplete type annotations\",\n group=untyped_group)\n add_invertible_flag('--check-untyped-defs', default=False, strict_flag=True,\n help=\"Type check the interior of functions without type annotations\",\n group=untyped_group)\n add_invertible_flag('--disallow-untyped-decorators', default=False, strict_flag=True,\n help=\"Disallow decorating typed functions with untyped decorators\",\n group=untyped_group)\n\n none_group = parser.add_argument_group(\n title='None and Optional handling',\n description=\"Adjust how values of type 'None' are handled. For more context on \"\n \"how mypy handles values of type 'None', see: \"\n \"https://mypy.readthedocs.io/en/stable/kinds_of_types.html#no-strict-optional\")\n add_invertible_flag('--no-implicit-optional', default=False, strict_flag=True,\n help=\"Don't assume arguments with default values of None are Optional\",\n group=none_group)\n none_group.add_argument(\n '--strict-optional', action='store_true',\n help=argparse.SUPPRESS)\n none_group.add_argument(\n '--no-strict-optional', action='store_false', dest='strict_optional',\n help=\"Disable strict Optional checks (inverse: --strict-optional)\")\n none_group.add_argument(\n '--strict-optional-whitelist', metavar='GLOB', nargs='*',\n help=argparse.SUPPRESS)\n\n lint_group = parser.add_argument_group(\n title='Configuring warnings',\n description=\"Detect code that is sound but redundant or problematic.\")\n add_invertible_flag('--warn-redundant-casts', default=False, strict_flag=True,\n help=\"Warn about casting an expression to its inferred type\",\n group=lint_group)\n add_invertible_flag('--warn-unused-ignores', default=False, strict_flag=True,\n help=\"Warn about unneeded '# type: ignore' comments\",\n group=lint_group)\n add_invertible_flag('--no-warn-no-return', dest='warn_no_return', default=True,\n help=\"Do not warn about functions that end without returning\",\n group=lint_group)\n add_invertible_flag('--warn-return-any', default=False, strict_flag=True,\n help=\"Warn about returning values of type Any\"\n \" from non-Any typed functions\",\n group=lint_group)\n add_invertible_flag('--warn-unreachable', default=False, strict_flag=False,\n help=\"Warn about statements or expressions inferred to be\"\n \" unreachable\",\n group=lint_group)\n\n # Note: this group is intentionally added here even though we don't add\n # --strict to this group near the end.\n #\n # That way, this group will appear after the various strictness groups\n # but before the remaining flags.\n # We add `--strict` near the end so we don't accidentally miss any strictness\n # flags that are added after this group.\n strictness_group = parser.add_argument_group(\n title='Miscellaneous strictness flags')\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_process_options.add_invertible_flag_al_process_options.incremental_group.parser_add_argument_group": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_process_options.add_invertible_flag_al_process_options.incremental_group.parser_add_argument_group", "embedding": null, "metadata": {"file_path": "mypy/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 605, "end_line": 671, "span_ids": ["process_options"], "tokens": 763}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def process_options(args: List[str],\n stdout: Optional[TextIO] = None,\n stderr: Optional[TextIO] = None,\n require_targets: bool = True,\n server_options: bool = False,\n fscache: Optional[FileSystemCache] = None,\n program: str = 'mypy',\n header: str = HEADER,\n ) -> Tuple[List[BuildSource], Options]:\n # ... other code\n\n add_invertible_flag('--allow-untyped-globals', default=False, strict_flag=False,\n help=\"Suppress toplevel errors caused by missing annotations\",\n group=strictness_group)\n\n add_invertible_flag('--allow-redefinition', default=False, strict_flag=False,\n help=\"Allow unconditional variable redefinition with a new type\",\n group=strictness_group)\n\n add_invertible_flag('--no-implicit-reexport', default=True, strict_flag=True,\n dest='implicit_reexport',\n help=\"Treat imports as private unless aliased\",\n group=strictness_group)\n\n add_invertible_flag('--strict-equality', default=False, strict_flag=True,\n help=\"Prohibit equality, identity, and container checks for\"\n \" non-overlapping types\",\n group=strictness_group)\n\n strict_help = \"Strict mode; enables the following flags: {}\".format(\n \", \".join(strict_flag_names))\n strictness_group.add_argument(\n '--strict', action='store_true', dest='special-opts:strict',\n help=strict_help)\n\n strictness_group.add_argument(\n '--disable-error-code', metavar='NAME', action='append', default=[],\n help=\"Disable a specific error code\")\n strictness_group.add_argument(\n '--enable-error-code', metavar='NAME', action='append', default=[],\n help=\"Enable a specific error code\"\n )\n\n error_group = parser.add_argument_group(\n title='Configuring error messages',\n description=\"Adjust the amount of detail shown in error messages.\")\n add_invertible_flag('--show-error-context', default=False,\n dest='show_error_context',\n help='Precede errors with \"note:\" messages explaining context',\n group=error_group)\n add_invertible_flag('--show-column-numbers', default=False,\n help=\"Show column numbers in error messages\",\n group=error_group)\n add_invertible_flag('--show-error-codes', default=False,\n help=\"Show error codes in error messages\",\n group=error_group)\n add_invertible_flag('--pretty', default=False,\n help=\"Use visually nicer output in error messages:\"\n \" Use soft word wrap, show source code snippets,\"\n \" and show error location markers\",\n group=error_group)\n add_invertible_flag('--no-color-output', dest='color_output', default=True,\n help=\"Do not colorize error messages\",\n group=error_group)\n add_invertible_flag('--no-error-summary', dest='error_summary', default=True,\n help=\"Do not show error stats summary\",\n group=error_group)\n add_invertible_flag('--show-absolute-path', default=False,\n help=\"Show absolute paths to files\",\n group=error_group)\n\n incremental_group = parser.add_argument_group(\n title='Incremental mode',\n description=\"Adjust how mypy incrementally type checks and caches modules. \"\n \"Mypy caches type information about modules into a cache to \"\n \"let you speed up future invocations of mypy. Also see \"\n \"mypy's daemon mode: \"\n \"mypy.readthedocs.io/en/stable/mypy_daemon.html#mypy-daemon\")\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_process_options.incremental_group_add_arg_process_options.other_group.parser_add_argument_group": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_process_options.incremental_group_add_arg_process_options.other_group.parser_add_argument_group", "embedding": null, "metadata": {"file_path": "mypy/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 657, "end_line": 719, "span_ids": ["process_options"], "tokens": 753}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def process_options(args: List[str],\n stdout: Optional[TextIO] = None,\n stderr: Optional[TextIO] = None,\n require_targets: bool = True,\n server_options: bool = False,\n fscache: Optional[FileSystemCache] = None,\n program: str = 'mypy',\n header: str = HEADER,\n ) -> Tuple[List[BuildSource], Options]:\n # ... other code\n incremental_group.add_argument(\n '-i', '--incremental', action='store_true',\n help=argparse.SUPPRESS)\n incremental_group.add_argument(\n '--no-incremental', action='store_false', dest='incremental',\n help=\"Disable module cache (inverse: --incremental)\")\n incremental_group.add_argument(\n '--cache-dir', action='store', metavar='DIR',\n help=\"Store module cache info in the given folder in incremental mode \"\n \"(defaults to '{}')\".format(defaults.CACHE_DIR))\n add_invertible_flag('--sqlite-cache', default=False,\n help=\"Use a sqlite database to store the cache\",\n group=incremental_group)\n incremental_group.add_argument(\n '--cache-fine-grained', action='store_true',\n help=\"Include fine-grained dependency information in the cache for the mypy daemon\")\n incremental_group.add_argument(\n '--skip-version-check', action='store_true',\n help=\"Allow using cache written by older mypy version\")\n incremental_group.add_argument(\n '--skip-cache-mtime-checks', action='store_true',\n help=\"Skip cache internal consistency checks based on mtime\")\n\n internals_group = parser.add_argument_group(\n title='Advanced options',\n description=\"Debug and customize mypy internals.\")\n internals_group.add_argument(\n '--pdb', action='store_true', help=\"Invoke pdb on fatal error\")\n internals_group.add_argument(\n '--show-traceback', '--tb', action='store_true',\n help=\"Show traceback on fatal error\")\n internals_group.add_argument(\n '--raise-exceptions', action='store_true', help=\"Raise exception on fatal error\"\n )\n internals_group.add_argument(\n '--custom-typing-module', metavar='MODULE', dest='custom_typing_module',\n help=\"Use a custom typing module\")\n internals_group.add_argument(\n '--custom-typeshed-dir', metavar='DIR',\n help=\"Use the custom typeshed in DIR\")\n add_invertible_flag('--warn-incomplete-stub', default=False,\n help=\"Warn if missing type annotation in typeshed, only relevant with\"\n \" --disallow-untyped-defs or --disallow-incomplete-defs enabled\",\n group=internals_group)\n internals_group.add_argument(\n '--shadow-file', nargs=2, metavar=('SOURCE_FILE', 'SHADOW_FILE'),\n dest='shadow_file', action='append',\n help=\"When encountering SOURCE_FILE, read and type check \"\n \"the contents of SHADOW_FILE instead.\")\n add_invertible_flag('--fast-exit', default=False, help=argparse.SUPPRESS,\n group=internals_group)\n\n report_group = parser.add_argument_group(\n title='Report generation',\n description='Generate a report in the specified format.')\n for report_type in sorted(defaults.REPORTER_NAMES):\n if report_type not in {'memory-xml'}:\n report_group.add_argument('--%s-report' % report_type.replace('_', '-'),\n metavar='DIR',\n dest='special-opts:%s_report' % report_type)\n\n other_group = parser.add_argument_group(\n title='Miscellaneous')\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_process_package_roots_process_package_roots.fscache_set_package_root_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_process_package_roots_process_package_roots.fscache_set_package_root_", "embedding": null, "metadata": {"file_path": "mypy/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 970, "end_line": 1002, "span_ids": ["process_package_roots"], "tokens": 350}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def process_package_roots(fscache: Optional[FileSystemCache],\n parser: argparse.ArgumentParser,\n options: Options) -> None:\n \"\"\"Validate and normalize package_root.\"\"\"\n if fscache is None:\n parser.error(\"--package-root does not work here (no fscache)\")\n assert fscache is not None # Since mypy doesn't know parser.error() raises.\n # Do some stuff with drive letters to make Windows happy (esp. tests).\n current_drive, _ = os.path.splitdrive(os.getcwd())\n dot = os.curdir\n dotslash = os.curdir + os.sep\n dotdotslash = os.pardir + os.sep\n trivial_paths = {dot, dotslash}\n package_root = []\n for root in options.package_root:\n if os.path.isabs(root):\n parser.error(\"Package root cannot be absolute: %r\" % root)\n drive, root = os.path.splitdrive(root)\n if drive and drive != current_drive:\n parser.error(\"Package root must be on current drive: %r\" % (drive + root))\n # Empty package root is always okay.\n if root:\n root = os.path.relpath(root) # Normalize the heck out of it.\n if not root.endswith(os.sep):\n root = root + os.sep\n if root.startswith(dotdotslash):\n parser.error(\"Package root cannot be above current directory: %r\" % root)\n if root in trivial_paths:\n root = ''\n package_root.append(root)\n options.package_root = package_root\n # Pass the package root on the the filesystem cache.\n fscache.set_package_root(package_root)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_process_cache_map_process_cache_map.for_i_in_range_0_n_3_.options_cache_map_source_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_process_cache_map_process_cache_map.for_i_in_range_0_n_3_.options_cache_map_source_", "embedding": null, "metadata": {"file_path": "mypy/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 993, "end_line": 1012, "span_ids": ["process_cache_map"], "tokens": 261}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def process_cache_map(parser: argparse.ArgumentParser,\n special_opts: argparse.Namespace,\n options: Options) -> None:\n \"\"\"Validate cache_map and copy into options.cache_map.\"\"\"\n n = len(special_opts.cache_map)\n if n % 3 != 0:\n parser.error(\"--cache-map requires one or more triples (see source)\")\n for i in range(0, n, 3):\n source, meta_file, data_file = special_opts.cache_map[i:i + 3]\n if source in options.cache_map:\n parser.error(\"Duplicate --cache-map source %s)\" % source)\n if not source.endswith('.py') and not source.endswith('.pyi'):\n parser.error(\"Invalid --cache-map source %s (triple[0] must be *.py[i])\" % source)\n if not meta_file.endswith('.meta.json'):\n parser.error(\"Invalid --cache-map meta_file %s (triple[1] must be *.meta.json)\" %\n meta_file)\n if not data_file.endswith('.data.json'):\n parser.error(\"Invalid --cache-map data_file %s (triple[2] must be *.data.json)\" %\n data_file)\n options.cache_map[source] = (meta_file, data_file)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/maptype.py_from_typing_import_Dict__map_instance_to_supertype.return.map_instance_to_supertype": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/maptype.py_from_typing_import_Dict__map_instance_to_supertype.return.map_instance_to_supertype", "embedding": null, "metadata": {"file_path": "mypy/maptype.py", "file_name": "maptype.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 24, "span_ids": ["imports", "map_instance_to_supertype"], "tokens": 195}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from typing import Dict, List\n\nfrom mypy.expandtype import expand_type\nfrom mypy.nodes import TypeInfo\nfrom mypy.types import Type, TypeVarId, Instance, AnyType, TypeOfAny, ProperType\n\n\ndef map_instance_to_supertype(instance: Instance,\n superclass: TypeInfo) -> Instance:\n \"\"\"Produce a supertype of `instance` that is an Instance\n of `superclass`, mapping type arguments up the chain of bases.\n\n If `superclass` is not a nominal superclass of `instance.type`,\n then all type arguments are mapped to 'Any'.\n \"\"\"\n if instance.type == superclass:\n # Fast path: `instance` already belongs to `superclass`.\n return instance\n\n if not superclass.type_vars:\n # Fast path: `superclass` has no type variables to map to.\n return Instance(superclass, [])\n\n return map_instance_to_supertypes(instance, superclass)[0]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/maptype.py_map_instance_to_supertypes_map_instance_to_supertypes.if_result_.else_.return._Instance_supertype_any": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/maptype.py_map_instance_to_supertypes_map_instance_to_supertypes.if_result_.else_.return._Instance_supertype_any", "embedding": null, "metadata": {"file_path": "mypy/maptype.py", "file_name": "maptype.py", "file_type": "text/x-python", "category": "implementation", "start_line": 27, "end_line": 45, "span_ids": ["map_instance_to_supertypes"], "tokens": 189}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def map_instance_to_supertypes(instance: Instance,\n supertype: TypeInfo) -> List[Instance]:\n # FIX: Currently we should only have one supertype per interface, so no\n # need to return an array\n result = [] # type: List[Instance]\n for path in class_derivation_paths(instance.type, supertype):\n types = [instance]\n for sup in path:\n a = [] # type: List[Instance]\n for t in types:\n a.extend(map_instance_to_direct_supertypes(t, sup))\n types = a\n result.extend(types)\n if result:\n return result\n else:\n # Nothing. Presumably due to an error. Construct a dummy using Any.\n any_type = AnyType(TypeOfAny.from_error)\n return [Instance(supertype, [any_type] * len(supertype.type_vars))]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/maptype.py_class_derivation_paths_class_derivation_paths.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/maptype.py_class_derivation_paths_class_derivation_paths.return.result", "embedding": null, "metadata": {"file_path": "mypy/maptype.py", "file_name": "maptype.py", "file_type": "text/x-python", "category": "implementation", "start_line": 48, "end_line": 70, "span_ids": ["class_derivation_paths"], "tokens": 206}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def class_derivation_paths(typ: TypeInfo,\n supertype: TypeInfo) -> List[List[TypeInfo]]:\n \"\"\"Return an array of non-empty paths of direct base classes from\n type to supertype. Return [] if no such path could be found.\n\n InterfaceImplementationPaths(A, B) == [[B]] if A inherits B\n InterfaceImplementationPaths(A, C) == [[B, C]] if A inherits B and\n B inherits C\n \"\"\"\n # FIX: Currently we might only ever have a single path, so this could be\n # simplified\n result = [] # type: List[List[TypeInfo]]\n\n for base in typ.bases:\n btype = base.type\n if btype == supertype:\n result.append([btype])\n else:\n # Try constructing a longer path via the base class.\n for path in class_derivation_paths(btype, supertype):\n result.append([btype] + path)\n\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/maptype.py_map_instance_to_direct_supertypes_map_instance_to_direct_supertypes.if_result_.else_.return._Instance_supertype_any": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/maptype.py_map_instance_to_direct_supertypes_map_instance_to_direct_supertypes.if_result_.else_.return._Instance_supertype_any", "embedding": null, "metadata": {"file_path": "mypy/maptype.py", "file_name": "maptype.py", "file_type": "text/x-python", "category": "implementation", "start_line": 73, "end_line": 93, "span_ids": ["map_instance_to_direct_supertypes"], "tokens": 174}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def map_instance_to_direct_supertypes(instance: Instance,\n supertype: TypeInfo) -> List[Instance]:\n # FIX: There should only be one supertypes, always.\n typ = instance.type\n result = [] # type: List[Instance]\n\n for b in typ.bases:\n if b.type == supertype:\n env = instance_to_type_environment(instance)\n t = expand_type(b, env)\n assert isinstance(t, ProperType)\n assert isinstance(t, Instance)\n result.append(t)\n\n if result:\n return result\n else:\n # Relationship with the supertype not specified explicitly. Use dynamic\n # type arguments implicitly.\n any_type = AnyType(TypeOfAny.unannotated)\n return [Instance(supertype, [any_type] * len(supertype.type_vars))]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/maptype.py_instance_to_type_environment_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/maptype.py_instance_to_type_environment_", "embedding": null, "metadata": {"file_path": "mypy/maptype.py", "file_name": "maptype.py", "file_type": "text/x-python", "category": "implementation", "start_line": 96, "end_line": 107, "span_ids": ["instance_to_type_environment"], "tokens": 126}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def instance_to_type_environment(instance: Instance) -> Dict[TypeVarId, Type]:\n \"\"\"Given an Instance, produce the resulting type environment for type\n variables bound by the Instance's class definition.\n\n An Instance is a type application of a class (a TypeInfo) to its\n required number of type arguments. So this environment consists\n of the class's type variables mapped to the Instance's actual\n arguments. The type variables are mapped by their `id`.\n\n \"\"\"\n return {binder.id: arg for binder, arg in zip(instance.type.defn.type_vars, instance.args)}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_from_mypy_ordered_dict_im_trivial_meet.if_is_subtype_s_t_.else_.if_state_strict_optional_.else_.return.NoneType_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_from_mypy_ordered_dict_im_trivial_meet.if_is_subtype_s_t_.else_.if_state_strict_optional_.else_.return.NoneType_", "embedding": null, "metadata": {"file_path": "mypy/meet.py", "file_name": "meet.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 32, "span_ids": ["imports", "trivial_meet"], "tokens": 312}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from mypy.ordered_dict import OrderedDict\nfrom typing import List, Optional, Tuple, Callable\n\nfrom mypy.join import (\n is_similar_callables, combine_similar_callables, join_type_list, unpack_callback_protocol\n)\nfrom mypy.types import (\n Type, AnyType, TypeVisitor, UnboundType, NoneType, TypeVarType, Instance, CallableType,\n TupleType, TypedDictType, ErasedType, UnionType, PartialType, DeletedType,\n UninhabitedType, TypeType, TypeOfAny, Overloaded, FunctionLike, LiteralType,\n ProperType, get_proper_type, get_proper_types, TypeAliasType\n)\nfrom mypy.subtypes import is_equivalent, is_subtype, is_callable_compatible, is_proper_subtype\nfrom mypy.erasetype import erase_type\nfrom mypy.maptype import map_instance_to_supertype\nfrom mypy.typeops import tuple_fallback, make_simplified_union, is_recursive_pair\nfrom mypy import state\n\n# TODO Describe this module.\n\n\ndef trivial_meet(s: Type, t: Type) -> ProperType:\n \"\"\"Return one of types (expanded) if it is a subtype of other, otherwise bottom type.\"\"\"\n if is_subtype(s, t):\n return get_proper_type(s)\n elif is_subtype(t, s):\n return get_proper_type(t)\n else:\n if state.strict_optional:\n return UninhabitedType()\n else:\n return NoneType()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_meet_types_meet_types.return.t_accept_TypeMeetVisitor_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_meet_types_meet_types.return.t_accept_TypeMeetVisitor_", "embedding": null, "metadata": {"file_path": "mypy/meet.py", "file_name": "meet.py", "file_type": "text/x-python", "category": "implementation", "start_line": 35, "end_line": 50, "span_ids": ["meet_types"], "tokens": 152}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def meet_types(s: Type, t: Type) -> ProperType:\n \"\"\"Return the greatest lower bound of two types.\"\"\"\n if is_recursive_pair(s, t):\n # This case can trigger an infinite recursion, general support for this will be\n # tricky so we use a trivial meet (like for protocols).\n return trivial_meet(s, t)\n s = get_proper_type(s)\n t = get_proper_type(t)\n\n if isinstance(s, ErasedType):\n return s\n if isinstance(s, AnyType):\n return t\n if isinstance(s, UnionType) and not isinstance(t, UnionType):\n s, t = t, s\n return t.accept(TypeMeetVisitor(s))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_narrow_declared_type_narrow_declared_type.return.narrowed": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_narrow_declared_type_narrow_declared_type.return.narrowed", "embedding": null, "metadata": {"file_path": "mypy/meet.py", "file_name": "meet.py", "file_type": "text/x-python", "category": "implementation", "start_line": 53, "end_line": 85, "span_ids": ["narrow_declared_type"], "tokens": 360}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def narrow_declared_type(declared: Type, narrowed: Type) -> Type:\n \"\"\"Return the declared type narrowed down to another type.\"\"\"\n # TODO: check infinite recursion for aliases here.\n declared = get_proper_type(declared)\n narrowed = get_proper_type(narrowed)\n\n if declared == narrowed:\n return declared\n if isinstance(declared, UnionType):\n return make_simplified_union([narrow_declared_type(x, narrowed)\n for x in declared.relevant_items()])\n elif not is_overlapping_types(declared, narrowed,\n prohibit_none_typevar_overlap=True):\n if state.strict_optional:\n return UninhabitedType()\n else:\n return NoneType()\n elif isinstance(narrowed, UnionType):\n return make_simplified_union([narrow_declared_type(declared, x)\n for x in narrowed.relevant_items()])\n elif isinstance(narrowed, AnyType):\n return narrowed\n elif isinstance(declared, TypeType) and isinstance(narrowed, TypeType):\n return TypeType.make_normalized(narrow_declared_type(declared.item, narrowed.item))\n elif isinstance(declared, (Instance, TupleType, TypeType, LiteralType)):\n return meet_types(declared, narrowed)\n elif isinstance(declared, TypedDictType) and isinstance(narrowed, Instance):\n # Special case useful for selecting TypedDicts from unions using isinstance(x, dict).\n if (narrowed.type.fullname == 'builtins.dict' and\n all(isinstance(t, AnyType) for t in get_proper_types(narrowed.args))):\n return declared\n return meet_types(declared, narrowed)\n return narrowed", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_get_possible_variants_get_possible_variants.if_isinstance_typ_TypeVa.else_.return._typ_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_get_possible_variants_get_possible_variants.if_isinstance_typ_TypeVa.else_.return._typ_", "embedding": null, "metadata": {"file_path": "mypy/meet.py", "file_name": "meet.py", "file_type": "text/x-python", "category": "implementation", "start_line": 88, "end_line": 127, "span_ids": ["get_possible_variants"], "tokens": 327}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_possible_variants(typ: Type) -> List[Type]:\n \"\"\"This function takes any \"Union-like\" type and returns a list of the available \"options\".\n\n Specifically, there are currently exactly three different types that can have\n \"variants\" or are \"union-like\":\n\n - Unions\n - TypeVars with value restrictions\n - Overloads\n\n This function will return a list of each \"option\" present in those types.\n\n If this function receives any other type, we return a list containing just that\n original type. (E.g. pretend the type was contained within a singleton union).\n\n The only exception is regular TypeVars: we return a list containing that TypeVar's\n upper bound.\n\n This function is useful primarily when checking to see if two types are overlapping:\n the algorithm to check if two unions are overlapping is fundamentally the same as\n the algorithm for checking if two overloads are overlapping.\n\n Normalizing both kinds of types in the same way lets us reuse the same algorithm\n for both.\n \"\"\"\n typ = get_proper_type(typ)\n\n if isinstance(typ, TypeVarType):\n if len(typ.values) > 0:\n return typ.values\n else:\n return [typ.upper_bound]\n elif isinstance(typ, UnionType):\n return list(typ.items)\n elif isinstance(typ, Overloaded):\n # Note: doing 'return typ.items()' makes mypy\n # infer a too-specific return type of List[CallableType]\n return list(typ.items())\n else:\n return [typ]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_is_overlapping_types_is_overlapping_types._we_skip_these_checks_to": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_is_overlapping_types_is_overlapping_types._we_skip_these_checks_to", "embedding": null, "metadata": {"file_path": "mypy/meet.py", "file_name": "meet.py", "file_type": "text/x-python", "category": "implementation", "start_line": 130, "end_line": 202, "span_ids": ["is_overlapping_types"], "tokens": 761}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_overlapping_types(left: Type,\n right: Type,\n ignore_promotions: bool = False,\n prohibit_none_typevar_overlap: bool = False) -> bool:\n \"\"\"Can a value of type 'left' also be of type 'right' or vice-versa?\n\n If 'ignore_promotions' is True, we ignore promotions while checking for overlaps.\n If 'prohibit_none_typevar_overlap' is True, we disallow None from overlapping with\n TypeVars (in both strict-optional and non-strict-optional mode).\n \"\"\"\n left, right = get_proper_types((left, right))\n\n def _is_overlapping_types(left: Type, right: Type) -> bool:\n '''Encode the kind of overlapping check to perform.\n\n This function mostly exists so we don't have to repeat keyword arguments everywhere.'''\n return is_overlapping_types(\n left, right,\n ignore_promotions=ignore_promotions,\n prohibit_none_typevar_overlap=prohibit_none_typevar_overlap)\n\n # We should never encounter this type.\n if isinstance(left, PartialType) or isinstance(right, PartialType):\n assert False, \"Unexpectedly encountered partial type\"\n\n # We should also never encounter these types, but it's possible a few\n # have snuck through due to unrelated bugs. For now, we handle these\n # in the same way we handle 'Any'.\n #\n # TODO: Replace these with an 'assert False' once we are more confident.\n illegal_types = (UnboundType, ErasedType, DeletedType)\n if isinstance(left, illegal_types) or isinstance(right, illegal_types):\n return True\n\n # When running under non-strict optional mode, simplify away types of\n # the form 'Union[A, B, C, None]' into just 'Union[A, B, C]'.\n\n if not state.strict_optional:\n if isinstance(left, UnionType):\n left = UnionType.make_union(left.relevant_items())\n if isinstance(right, UnionType):\n right = UnionType.make_union(right.relevant_items())\n left, right = get_proper_types((left, right))\n\n # 'Any' may or may not be overlapping with the other type\n if isinstance(left, AnyType) or isinstance(right, AnyType):\n return True\n\n # We check for complete overlaps next as a general-purpose failsafe.\n # If this check fails, we start checking to see if there exists a\n # *partial* overlap between types.\n #\n # These checks will also handle the NoneType and UninhabitedType cases for us.\n\n if (is_proper_subtype(left, right, ignore_promotions=ignore_promotions)\n or is_proper_subtype(right, left, ignore_promotions=ignore_promotions)):\n return True\n\n # See the docstring for 'get_possible_variants' for more info on what the\n # following lines are doing.\n\n left_possible = get_possible_variants(left)\n right_possible = get_possible_variants(right)\n\n # We start by checking multi-variant types like Unions first. We also perform\n # the same logic if either type happens to be a TypeVar.\n #\n # Handling the TypeVars now lets us simulate having them bind to the corresponding\n # type -- if we deferred these checks, the \"return-early\" logic of the other\n # checks will prevent us from detecting certain overlaps.\n #\n # If both types are singleton variants (and are not TypeVars), we've hit the base case:\n # we skip these checks to avoid infinitely recursing.\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_is_overlapping_types.is_none_typevar_overlap_is_overlapping_types.if_isinstance_left_TypeT.return._is_overlapping_types_lef": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_is_overlapping_types.is_none_typevar_overlap_is_overlapping_types.if_isinstance_left_TypeT.return._is_overlapping_types_lef", "embedding": null, "metadata": {"file_path": "mypy/meet.py", "file_name": "meet.py", "file_type": "text/x-python", "category": "implementation", "start_line": 204, "end_line": 262, "span_ids": ["is_overlapping_types"], "tokens": 618}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_overlapping_types(left: Type,\n right: Type,\n ignore_promotions: bool = False,\n prohibit_none_typevar_overlap: bool = False) -> bool:\n # ... other code\n\n def is_none_typevar_overlap(t1: Type, t2: Type) -> bool:\n t1, t2 = get_proper_types((t1, t2))\n return isinstance(t1, NoneType) and isinstance(t2, TypeVarType)\n\n if prohibit_none_typevar_overlap:\n if is_none_typevar_overlap(left, right) or is_none_typevar_overlap(right, left):\n return False\n\n if (len(left_possible) > 1 or len(right_possible) > 1\n or isinstance(left, TypeVarType) or isinstance(right, TypeVarType)):\n for l in left_possible:\n for r in right_possible:\n if _is_overlapping_types(l, r):\n return True\n return False\n\n # Now that we've finished handling TypeVars, we're free to end early\n # if one one of the types is None and we're running in strict-optional mode.\n # (None only overlaps with None in strict-optional mode).\n #\n # We must perform this check after the TypeVar checks because\n # a TypeVar could be bound to None, for example.\n\n if state.strict_optional and isinstance(left, NoneType) != isinstance(right, NoneType):\n return False\n\n # Next, we handle single-variant types that may be inherently partially overlapping:\n #\n # - TypedDicts\n # - Tuples\n #\n # If we cannot identify a partial overlap and end early, we degrade these two types\n # into their 'Instance' fallbacks.\n\n if isinstance(left, TypedDictType) and isinstance(right, TypedDictType):\n return are_typed_dicts_overlapping(left, right, ignore_promotions=ignore_promotions)\n elif typed_dict_mapping_pair(left, right):\n # Overlaps between TypedDicts and Mappings require dedicated logic.\n return typed_dict_mapping_overlap(left, right,\n overlapping=_is_overlapping_types)\n elif isinstance(left, TypedDictType):\n left = left.fallback\n elif isinstance(right, TypedDictType):\n right = right.fallback\n\n if is_tuple(left) and is_tuple(right):\n return are_tuples_overlapping(left, right, ignore_promotions=ignore_promotions)\n elif isinstance(left, TupleType):\n left = tuple_fallback(left)\n elif isinstance(right, TupleType):\n right = tuple_fallback(right)\n\n # Next, we handle single-variant types that cannot be inherently partially overlapping,\n # but do require custom logic to inspect.\n #\n # As before, we degrade into 'Instance' whenever possible.\n\n if isinstance(left, TypeType) and isinstance(right, TypeType):\n return _is_overlapping_types(left.item, right.item)\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_is_overlapping_types._type_object_overlap_is_overlapping_types._type_object_overlap.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_is_overlapping_types._type_object_overlap_is_overlapping_types._type_object_overlap.return.False", "embedding": null, "metadata": {"file_path": "mypy/meet.py", "file_name": "meet.py", "file_type": "text/x-python", "category": "implementation", "start_line": 264, "end_line": 282, "span_ids": ["is_overlapping_types"], "tokens": 310}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_overlapping_types(left: Type,\n right: Type,\n ignore_promotions: bool = False,\n prohibit_none_typevar_overlap: bool = False) -> bool:\n # ... other code\n\n def _type_object_overlap(left: Type, right: Type) -> bool:\n \"\"\"Special cases for type object types overlaps.\"\"\"\n # TODO: these checks are a bit in gray area, adjust if they cause problems.\n left, right = get_proper_types((left, right))\n # 1. Type[C] vs Callable[..., C], where the latter is class object.\n if isinstance(left, TypeType) and isinstance(right, CallableType) and right.is_type_obj():\n return _is_overlapping_types(left.item, right.ret_type)\n # 2. Type[C] vs Meta, where Meta is a metaclass for C.\n if isinstance(left, TypeType) and isinstance(right, Instance):\n if isinstance(left.item, Instance):\n left_meta = left.item.type.metaclass_type\n if left_meta is not None:\n return _is_overlapping_types(left_meta, right)\n # builtins.type (default metaclass) overlaps with all metaclasses\n return right.type.has_base('builtins.type')\n elif isinstance(left.item, AnyType):\n return right.type.has_base('builtins.type')\n # 3. Callable[..., C] vs Meta is considered below, when we switch to fallbacks.\n return False\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_is_overlapping_types.None_11_is_overlapping_types.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_is_overlapping_types.None_11_is_overlapping_types.return.False", "embedding": null, "metadata": {"file_path": "mypy/meet.py", "file_name": "meet.py", "file_type": "text/x-python", "category": "implementation", "start_line": 284, "end_line": 355, "span_ids": ["is_overlapping_types"], "tokens": 738}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_overlapping_types(left: Type,\n right: Type,\n ignore_promotions: bool = False,\n prohibit_none_typevar_overlap: bool = False) -> bool:\n # ... other code\n\n if isinstance(left, TypeType) or isinstance(right, TypeType):\n return _type_object_overlap(left, right) or _type_object_overlap(right, left)\n\n if isinstance(left, CallableType) and isinstance(right, CallableType):\n return is_callable_compatible(left, right,\n is_compat=_is_overlapping_types,\n ignore_pos_arg_names=True,\n allow_partial_overlap=True)\n elif isinstance(left, CallableType):\n left = left.fallback\n elif isinstance(right, CallableType):\n right = right.fallback\n\n if isinstance(left, LiteralType) and isinstance(right, LiteralType):\n if left.value == right.value:\n # If values are the same, we still need to check if fallbacks are overlapping,\n # this is done below.\n left = left.fallback\n right = right.fallback\n else:\n return False\n elif isinstance(left, LiteralType):\n left = left.fallback\n elif isinstance(right, LiteralType):\n right = right.fallback\n\n # Finally, we handle the case where left and right are instances.\n\n if isinstance(left, Instance) and isinstance(right, Instance):\n # First we need to handle promotions and structural compatibility for instances\n # that came as fallbacks, so simply call is_subtype() to avoid code duplication.\n if (is_subtype(left, right, ignore_promotions=ignore_promotions)\n or is_subtype(right, left, ignore_promotions=ignore_promotions)):\n return True\n\n # Two unrelated types cannot be partially overlapping: they're disjoint.\n if left.type.has_base(right.type.fullname):\n left = map_instance_to_supertype(left, right.type)\n elif right.type.has_base(left.type.fullname):\n right = map_instance_to_supertype(right, left.type)\n else:\n return False\n\n if len(left.args) == len(right.args):\n # Note: we don't really care about variance here, since the overlapping check\n # is symmetric and since we want to return 'True' even for partial overlaps.\n #\n # For example, suppose we have two types Wrapper[Parent] and Wrapper[Child].\n # It doesn't matter whether Wrapper is covariant or contravariant since\n # either way, one of the two types will overlap with the other.\n #\n # Similarly, if Wrapper was invariant, the two types could still be partially\n # overlapping -- what if Wrapper[Parent] happened to contain only instances of\n # specifically Child?\n #\n # Or, to use a more concrete example, List[Union[A, B]] and List[Union[B, C]]\n # would be considered partially overlapping since it's possible for both lists\n # to contain only instances of B at runtime.\n if all(_is_overlapping_types(left_arg, right_arg)\n for left_arg, right_arg in zip(left.args, right.args)):\n return True\n\n return False\n\n # We ought to have handled every case by now: we conclude the\n # two types are not overlapping, either completely or partially.\n #\n # Note: it's unclear however, whether returning False is the right thing\n # to do when inferring reachability -- see https://github.com/python/mypy/issues/5529\n\n assert type(left) != type(right)\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_is_overlapping_erased_types_are_typed_dicts_overlapping.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_is_overlapping_erased_types_are_typed_dicts_overlapping.return.True", "embedding": null, "metadata": {"file_path": "mypy/meet.py", "file_name": "meet.py", "file_type": "text/x-python", "category": "implementation", "start_line": 358, "end_line": 390, "span_ids": ["are_typed_dicts_overlapping", "is_overlapping_erased_types"], "tokens": 318}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_overlapping_erased_types(left: Type, right: Type, *,\n ignore_promotions: bool = False) -> bool:\n \"\"\"The same as 'is_overlapping_erased_types', except the types are erased first.\"\"\"\n return is_overlapping_types(erase_type(left), erase_type(right),\n ignore_promotions=ignore_promotions,\n prohibit_none_typevar_overlap=True)\n\n\ndef are_typed_dicts_overlapping(left: TypedDictType, right: TypedDictType, *,\n ignore_promotions: bool = False,\n prohibit_none_typevar_overlap: bool = False) -> bool:\n \"\"\"Returns 'true' if left and right are overlapping TypeDictTypes.\"\"\"\n # All required keys in left are present and overlapping with something in right\n for key in left.required_keys:\n if key not in right.items:\n return False\n if not is_overlapping_types(left.items[key], right.items[key],\n ignore_promotions=ignore_promotions,\n prohibit_none_typevar_overlap=prohibit_none_typevar_overlap):\n return False\n\n # Repeat check in the other direction\n for key in right.required_keys:\n if key not in left.items:\n return False\n if not is_overlapping_types(left.items[key], right.items[key],\n ignore_promotions=ignore_promotions):\n return False\n\n # The presence of any additional optional keys does not affect whether the two\n # TypedDicts are partially overlapping: the dicts would be overlapping if the\n # keys happened to be missing.\n return True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_are_tuples_overlapping_are_tuples_overlapping.return.all_is_overlapping_types_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_are_tuples_overlapping_are_tuples_overlapping.return.all_is_overlapping_types_", "embedding": null, "metadata": {"file_path": "mypy/meet.py", "file_name": "meet.py", "file_type": "text/x-python", "category": "implementation", "start_line": 393, "end_line": 407, "span_ids": ["are_tuples_overlapping"], "tokens": 187}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def are_tuples_overlapping(left: Type, right: Type, *,\n ignore_promotions: bool = False,\n prohibit_none_typevar_overlap: bool = False) -> bool:\n \"\"\"Returns true if left and right are overlapping tuples.\"\"\"\n left, right = get_proper_types((left, right))\n left = adjust_tuple(left, right) or left\n right = adjust_tuple(right, left) or right\n assert isinstance(left, TupleType), 'Type {} is not a tuple'.format(left)\n assert isinstance(right, TupleType), 'Type {} is not a tuple'.format(right)\n if len(left.items) != len(right.items):\n return False\n return all(is_overlapping_types(l, r,\n ignore_promotions=ignore_promotions,\n prohibit_none_typevar_overlap=prohibit_none_typevar_overlap)\n for l, r in zip(left.items, right.items))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_adjust_tuple_is_tuple.return._isinstance_typ_TupleTyp": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_adjust_tuple_is_tuple.return._isinstance_typ_TupleTyp", "embedding": null, "metadata": {"file_path": "mypy/meet.py", "file_name": "meet.py", "file_type": "text/x-python", "category": "implementation", "start_line": 410, "end_line": 421, "span_ids": ["is_tuple", "adjust_tuple"], "tokens": 148}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def adjust_tuple(left: ProperType, r: ProperType) -> Optional[TupleType]:\n \"\"\"Find out if `left` is a Tuple[A, ...], and adjust its length to `right`\"\"\"\n if isinstance(left, Instance) and left.type.fullname == 'builtins.tuple':\n n = r.length() if isinstance(r, TupleType) else 1\n return TupleType([left.args[0]] * n, left)\n return None\n\n\ndef is_tuple(typ: Type) -> bool:\n typ = get_proper_type(typ)\n return (isinstance(typ, TupleType)\n or (isinstance(typ, Instance) and typ.type.fullname == 'builtins.tuple'))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_TypeMeetVisitor_TypeMeetVisitor.visit_type_var.if_isinstance_self_s_Typ.else_.return.self_default_self_s_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_TypeMeetVisitor_TypeMeetVisitor.visit_type_var.if_isinstance_self_s_Typ.else_.return.self_default_self_s_", "embedding": null, "metadata": {"file_path": "mypy/meet.py", "file_name": "meet.py", "file_type": "text/x-python", "category": "implementation", "start_line": 424, "end_line": 484, "span_ids": ["TypeMeetVisitor.visit_union_type", "TypeMeetVisitor.visit_uninhabited_type", "TypeMeetVisitor.visit_deleted_type", "TypeMeetVisitor.visit_none_type", "TypeMeetVisitor.visit_any", "TypeMeetVisitor.visit_erased_type", "TypeMeetVisitor.visit_type_var", "TypeMeetVisitor.visit_unbound_type", "TypeMeetVisitor", "TypeMeetVisitor.__init__"], "tokens": 467}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeMeetVisitor(TypeVisitor[ProperType]):\n def __init__(self, s: ProperType) -> None:\n self.s = s\n\n def visit_unbound_type(self, t: UnboundType) -> ProperType:\n if isinstance(self.s, NoneType):\n if state.strict_optional:\n return AnyType(TypeOfAny.special_form)\n else:\n return self.s\n elif isinstance(self.s, UninhabitedType):\n return self.s\n else:\n return AnyType(TypeOfAny.special_form)\n\n def visit_any(self, t: AnyType) -> ProperType:\n return self.s\n\n def visit_union_type(self, t: UnionType) -> ProperType:\n if isinstance(self.s, UnionType):\n meets = [] # type: List[Type]\n for x in t.items:\n for y in self.s.items:\n meets.append(meet_types(x, y))\n else:\n meets = [meet_types(x, self.s)\n for x in t.items]\n return make_simplified_union(meets)\n\n def visit_none_type(self, t: NoneType) -> ProperType:\n if state.strict_optional:\n if isinstance(self.s, NoneType) or (isinstance(self.s, Instance) and\n self.s.type.fullname == 'builtins.object'):\n return t\n else:\n return UninhabitedType()\n else:\n return t\n\n def visit_uninhabited_type(self, t: UninhabitedType) -> ProperType:\n return t\n\n def visit_deleted_type(self, t: DeletedType) -> ProperType:\n if isinstance(self.s, NoneType):\n if state.strict_optional:\n return t\n else:\n return self.s\n elif isinstance(self.s, UninhabitedType):\n return self.s\n else:\n return t\n\n def visit_erased_type(self, t: ErasedType) -> ProperType:\n return self.s\n\n def visit_type_var(self, t: TypeVarType) -> ProperType:\n if isinstance(self.s, TypeVarType) and self.s.id == t.id:\n return self.s\n else:\n return self.default(self.s)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_TypeMeetVisitor.visit_instance_TypeMeetVisitor.visit_instance.return.self_default_self_s_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_TypeMeetVisitor.visit_instance_TypeMeetVisitor.visit_instance.return.self_default_self_s_", "embedding": null, "metadata": {"file_path": "mypy/meet.py", "file_name": "meet.py", "file_type": "text/x-python", "category": "implementation", "start_line": 486, "end_line": 531, "span_ids": ["TypeMeetVisitor.visit_instance"], "tokens": 402}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeMeetVisitor(TypeVisitor[ProperType]):\n\n def visit_instance(self, t: Instance) -> ProperType:\n if isinstance(self.s, Instance):\n si = self.s\n if t.type == si.type:\n if is_subtype(t, self.s) or is_subtype(self.s, t):\n # Combine type arguments. We could have used join below\n # equivalently.\n args = [] # type: List[Type]\n # N.B: We use zip instead of indexing because the lengths might have\n # mismatches during daemon reprocessing.\n for ta, sia in zip(t.args, si.args):\n args.append(self.meet(ta, sia))\n return Instance(t.type, args)\n else:\n if state.strict_optional:\n return UninhabitedType()\n else:\n return NoneType()\n else:\n if is_subtype(t, self.s):\n return t\n elif is_subtype(self.s, t):\n # See also above comment.\n return self.s\n else:\n if state.strict_optional:\n return UninhabitedType()\n else:\n return NoneType()\n elif isinstance(self.s, FunctionLike) and t.type.is_protocol:\n call = unpack_callback_protocol(t)\n if call:\n return meet_types(call, self.s)\n elif isinstance(self.s, FunctionLike) and self.s.is_type_obj() and t.type.is_metaclass():\n if is_subtype(self.s.fallback, t):\n return self.s\n return self.default(self.s)\n elif isinstance(self.s, TypeType):\n return meet_types(t, self.s)\n elif isinstance(self.s, TupleType):\n return meet_types(t, self.s)\n elif isinstance(self.s, LiteralType):\n return meet_types(t, self.s)\n elif isinstance(self.s, TypedDictType):\n return meet_types(t, self.s)\n return self.default(self.s)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_TypeMeetVisitor.visit_callable_type_TypeMeetVisitor.visit_callable_type.return.self_default_self_s_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_TypeMeetVisitor.visit_callable_type_TypeMeetVisitor.visit_callable_type.return.self_default_self_s_", "embedding": null, "metadata": {"file_path": "mypy/meet.py", "file_name": "meet.py", "file_type": "text/x-python", "category": "implementation", "start_line": 533, "end_line": 557, "span_ids": ["TypeMeetVisitor.visit_callable_type"], "tokens": 327}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeMeetVisitor(TypeVisitor[ProperType]):\n\n def visit_callable_type(self, t: CallableType) -> ProperType:\n if isinstance(self.s, CallableType) and is_similar_callables(t, self.s):\n if is_equivalent(t, self.s):\n return combine_similar_callables(t, self.s)\n result = meet_similar_callables(t, self.s)\n # We set the from_type_type flag to suppress error when a collection of\n # concrete class objects gets inferred as their common abstract superclass.\n if not ((t.is_type_obj() and t.type_object().is_abstract) or\n (self.s.is_type_obj() and self.s.type_object().is_abstract)):\n result.from_type_type = True\n if isinstance(get_proper_type(result.ret_type), UninhabitedType):\n # Return a plain None or instead of a weird function.\n return self.default(self.s)\n return result\n elif isinstance(self.s, TypeType) and t.is_type_obj() and not t.is_generic():\n # In this case we are able to potentially produce a better meet.\n res = meet_types(self.s.item, t.ret_type)\n if not isinstance(res, (NoneType, UninhabitedType)):\n return TypeType.make_normalized(res)\n return self.default(self.s)\n elif isinstance(self.s, Instance) and self.s.type.is_protocol:\n call = unpack_callback_protocol(self.s)\n if call:\n return meet_types(t, call)\n return self.default(self.s)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_TypeMeetVisitor.visit_overloaded_TypeMeetVisitor.visit_overloaded.return.meet_types_t_fallback_s_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_TypeMeetVisitor.visit_overloaded_TypeMeetVisitor.visit_overloaded.return.meet_types_t_fallback_s_", "embedding": null, "metadata": {"file_path": "mypy/meet.py", "file_name": "meet.py", "file_type": "text/x-python", "category": "implementation", "start_line": 559, "end_line": 576, "span_ids": ["TypeMeetVisitor.visit_overloaded"], "tokens": 169}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeMeetVisitor(TypeVisitor[ProperType]):\n\n def visit_overloaded(self, t: Overloaded) -> ProperType:\n # TODO: Implement a better algorithm that covers at least the same cases\n # as TypeJoinVisitor.visit_overloaded().\n s = self.s\n if isinstance(s, FunctionLike):\n if s.items() == t.items():\n return Overloaded(t.items())\n elif is_subtype(s, t):\n return s\n elif is_subtype(t, s):\n return t\n else:\n return meet_types(t.fallback, s.fallback)\n elif isinstance(self.s, Instance) and self.s.type.is_protocol:\n call = unpack_callback_protocol(self.s)\n if call:\n return meet_types(t, call)\n return meet_types(t.fallback, s)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_TypeMeetVisitor.visit_tuple_type_TypeMeetVisitor.visit_tuple_type.return.self_default_self_s_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_TypeMeetVisitor.visit_tuple_type_TypeMeetVisitor.visit_tuple_type.return.self_default_self_s_", "embedding": null, "metadata": {"file_path": "mypy/meet.py", "file_name": "meet.py", "file_type": "text/x-python", "category": "implementation", "start_line": 578, "end_line": 592, "span_ids": ["TypeMeetVisitor.visit_tuple_type"], "tokens": 227}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeMeetVisitor(TypeVisitor[ProperType]):\n\n def visit_tuple_type(self, t: TupleType) -> ProperType:\n if isinstance(self.s, TupleType) and self.s.length() == t.length():\n items = [] # type: List[Type]\n for i in range(t.length()):\n items.append(self.meet(t.items[i], self.s.items[i]))\n # TODO: What if the fallbacks are different?\n return TupleType(items, tuple_fallback(t))\n elif isinstance(self.s, Instance):\n # meet(Tuple[t1, t2, <...>], Tuple[s, ...]) == Tuple[meet(t1, s), meet(t2, s), <...>].\n if self.s.type.fullname == 'builtins.tuple' and self.s.args:\n return t.copy_modified(items=[meet_types(it, self.s.args[0]) for it in t.items])\n elif is_proper_subtype(t, self.s):\n # A named tuple that inherits from a normal class\n return t\n return self.default(self.s)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_TypeMeetVisitor.visit_typeddict_type_TypeMeetVisitor.visit_typeddict_type.if_isinstance_self_s_Typ.else_.return.self_default_self_s_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_TypeMeetVisitor.visit_typeddict_type_TypeMeetVisitor.visit_typeddict_type.if_isinstance_self_s_Typ.else_.return.self_default_self_s_", "embedding": null, "metadata": {"file_path": "mypy/meet.py", "file_name": "meet.py", "file_type": "text/x-python", "category": "implementation", "start_line": 594, "end_line": 616, "span_ids": ["TypeMeetVisitor.visit_typeddict_type"], "tokens": 283}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeMeetVisitor(TypeVisitor[ProperType]):\n\n def visit_typeddict_type(self, t: TypedDictType) -> ProperType:\n if isinstance(self.s, TypedDictType):\n for (name, l, r) in self.s.zip(t):\n if (not is_equivalent(l, r) or\n (name in t.required_keys) != (name in self.s.required_keys)):\n return self.default(self.s)\n item_list = [] # type: List[Tuple[str, Type]]\n for (item_name, s_item_type, t_item_type) in self.s.zipall(t):\n if s_item_type is not None:\n item_list.append((item_name, s_item_type))\n else:\n # at least one of s_item_type and t_item_type is not None\n assert t_item_type is not None\n item_list.append((item_name, t_item_type))\n items = OrderedDict(item_list)\n mapping_value_type = join_type_list(list(items.values()))\n fallback = self.s.create_anonymous_fallback(value_type=mapping_value_type)\n required_keys = t.required_keys | self.s.required_keys\n return TypedDictType(items, required_keys, fallback)\n elif isinstance(self.s, Instance) and is_subtype(t, self.s):\n return t\n else:\n return self.default(self.s)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_TypeMeetVisitor.visit_literal_type_TypeMeetVisitor.visit_type_type.if_isinstance_self_s_Typ.else_.return.self_default_self_s_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_TypeMeetVisitor.visit_literal_type_TypeMeetVisitor.visit_type_type.if_isinstance_self_s_Typ.else_.return.self_default_self_s_", "embedding": null, "metadata": {"file_path": "mypy/meet.py", "file_name": "meet.py", "file_type": "text/x-python", "category": "implementation", "start_line": 618, "end_line": 641, "span_ids": ["TypeMeetVisitor.visit_type_type", "TypeMeetVisitor.visit_literal_type", "TypeMeetVisitor.visit_partial_type"], "tokens": 238}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeMeetVisitor(TypeVisitor[ProperType]):\n\n def visit_literal_type(self, t: LiteralType) -> ProperType:\n if isinstance(self.s, LiteralType) and self.s == t:\n return t\n elif isinstance(self.s, Instance) and is_subtype(t.fallback, self.s):\n return t\n else:\n return self.default(self.s)\n\n def visit_partial_type(self, t: PartialType) -> ProperType:\n # We can't determine the meet of partial types. We should never get here.\n assert False, 'Internal error'\n\n def visit_type_type(self, t: TypeType) -> ProperType:\n if isinstance(self.s, TypeType):\n typ = self.meet(t.item, self.s.item)\n if not isinstance(typ, NoneType):\n typ = TypeType.make_normalized(typ, line=t.line)\n return typ\n elif isinstance(self.s, Instance) and self.s.type.fullname == 'builtins.type':\n return t\n elif isinstance(self.s, CallableType):\n return self.meet(t, self.s)\n else:\n return self.default(self.s)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_TypeMeetVisitor.visit_type_alias_type_TypeMeetVisitor.default.if_isinstance_typ_Unboun.else_.if_state_strict_optional_.else_.return.NoneType_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_TypeMeetVisitor.visit_type_alias_type_TypeMeetVisitor.default.if_isinstance_typ_Unboun.else_.if_state_strict_optional_.else_.return.NoneType_", "embedding": null, "metadata": {"file_path": "mypy/meet.py", "file_name": "meet.py", "file_type": "text/x-python", "category": "implementation", "start_line": 643, "end_line": 656, "span_ids": ["TypeMeetVisitor.visit_type_alias_type", "TypeMeetVisitor.meet", "TypeMeetVisitor.default"], "tokens": 128}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeMeetVisitor(TypeVisitor[ProperType]):\n\n def visit_type_alias_type(self, t: TypeAliasType) -> ProperType:\n assert False, \"This should be never called, got {}\".format(t)\n\n def meet(self, s: Type, t: Type) -> ProperType:\n return meet_types(s, t)\n\n def default(self, typ: Type) -> ProperType:\n if isinstance(typ, UnboundType):\n return AnyType(TypeOfAny.special_form)\n else:\n if state.strict_optional:\n return UninhabitedType()\n else:\n return NoneType()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_meet_similar_callables_meet_type_list.return.met": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_meet_similar_callables_meet_type_list.return.met", "embedding": null, "metadata": {"file_path": "mypy/meet.py", "file_name": "meet.py", "file_type": "text/x-python", "category": "implementation", "start_line": 659, "end_line": 685, "span_ids": ["meet_type_list", "meet_similar_callables"], "tokens": 273}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def meet_similar_callables(t: CallableType, s: CallableType) -> CallableType:\n from mypy.join import join_types\n arg_types = [] # type: List[Type]\n for i in range(len(t.arg_types)):\n arg_types.append(join_types(t.arg_types[i], s.arg_types[i]))\n # TODO in combine_similar_callables also applies here (names and kinds)\n # The fallback type can be either 'function' or 'type'. The result should have 'function' as\n # fallback only if both operands have it as 'function'.\n if t.fallback.type.fullname != 'builtins.function':\n fallback = t.fallback\n else:\n fallback = s.fallback\n return t.copy_modified(arg_types=arg_types,\n ret_type=meet_types(t.ret_type, s.ret_type),\n fallback=fallback,\n name=None)\n\n\ndef meet_type_list(types: List[Type]) -> Type:\n if not types:\n # This should probably be builtins.object but that is hard to get and\n # it doesn't matter for any current users.\n return AnyType(TypeOfAny.implementation_artifact)\n met = types[0]\n for t in types[1:]:\n met = meet_types(met, t)\n return met", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_typed_dict_mapping_pair_typed_dict_mapping_pair.return.isinstance_other_Instanc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_typed_dict_mapping_pair_typed_dict_mapping_pair.return.isinstance_other_Instanc", "embedding": null, "metadata": {"file_path": "mypy/meet.py", "file_name": "meet.py", "file_type": "text/x-python", "category": "implementation", "start_line": 688, "end_line": 705, "span_ids": ["typed_dict_mapping_pair"], "tokens": 197}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def typed_dict_mapping_pair(left: Type, right: Type) -> bool:\n \"\"\"Is this a pair where one type is a TypedDict and another one is an instance of Mapping?\n\n This case requires a precise/principled consideration because there are two use cases\n that push the boundary the opposite ways: we need to avoid spurious overlaps to avoid\n false positives for overloads, but we also need to avoid spuriously non-overlapping types\n to avoid false positives with --strict-equality.\n \"\"\"\n left, right = get_proper_types((left, right))\n assert not isinstance(left, TypedDictType) or not isinstance(right, TypedDictType)\n\n if isinstance(left, TypedDictType):\n _, other = left, right\n elif isinstance(right, TypedDictType):\n _, other = right, left\n else:\n return False\n return isinstance(other, Instance) and other.type.has_base('typing.Mapping')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_typed_dict_mapping_overlap_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/meet.py_typed_dict_mapping_overlap_", "embedding": null, "metadata": {"file_path": "mypy/meet.py", "file_name": "meet.py", "file_type": "text/x-python", "category": "implementation", "start_line": 708, "end_line": 770, "span_ids": ["typed_dict_mapping_overlap"], "tokens": 702}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def typed_dict_mapping_overlap(left: Type, right: Type,\n overlapping: Callable[[Type, Type], bool]) -> bool:\n \"\"\"Check if a TypedDict type is overlapping with a Mapping.\n\n The basic logic here consists of two rules:\n\n * A TypedDict with some required keys is overlapping with Mapping[str, ]\n if and only if every key type is overlapping with . For example:\n\n - TypedDict(x=int, y=str) overlaps with Dict[str, Union[str, int]]\n - TypedDict(x=int, y=str) doesn't overlap with Dict[str, int]\n\n Note that any additional non-required keys can't change the above result.\n\n * A TypedDict with no required keys overlaps with Mapping[str, ] if and\n only if at least one of key types overlaps with . For example:\n\n - TypedDict(x=str, y=str, total=False) overlaps with Dict[str, str]\n - TypedDict(x=str, y=str, total=False) doesn't overlap with Dict[str, int]\n - TypedDict(x=int, y=str, total=False) overlaps with Dict[str, str]\n\n As usual empty, dictionaries lie in a gray area. In general, List[str] and List[str]\n are considered non-overlapping despite empty list belongs to both. However, List[int]\n and List[] are considered overlapping.\n\n So here we follow the same logic: a TypedDict with no required keys is considered\n non-overlapping with Mapping[str, ], but is considered overlapping with\n Mapping[, ]. This way we avoid false positives for overloads, and also\n avoid false positives for comparisons like SomeTypedDict == {} under --strict-equality.\n \"\"\"\n left, right = get_proper_types((left, right))\n assert not isinstance(left, TypedDictType) or not isinstance(right, TypedDictType)\n\n if isinstance(left, TypedDictType):\n assert isinstance(right, Instance)\n typed, other = left, right\n else:\n assert isinstance(left, Instance)\n assert isinstance(right, TypedDictType)\n typed, other = right, left\n\n mapping = next(base for base in other.type.mro if base.fullname == 'typing.Mapping')\n other = map_instance_to_supertype(other, mapping)\n key_type, value_type = get_proper_types(other.args)\n\n # TODO: is there a cleaner way to get str_type here?\n fallback = typed.as_anonymous().fallback\n str_type = fallback.type.bases[0].args[0] # typing._TypedDict inherits Mapping[str, object]\n\n # Special case: a TypedDict with no required keys overlaps with an empty dict.\n if isinstance(key_type, UninhabitedType) and isinstance(value_type, UninhabitedType):\n return not typed.required_keys\n\n if typed.required_keys:\n if not overlapping(key_type, str_type):\n return False\n return all(overlapping(typed.items[k], value_type) for k in typed.required_keys)\n else:\n if not overlapping(key_type, str_type):\n return False\n non_required = set(typed.items.keys()) - typed.required_keys\n return any(overlapping(typed.items[k], value_type) for k in non_required)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/memprofile.py__Utility_for_dumping_me_collect_memory_stats.return.freqs_memuse": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/memprofile.py__Utility_for_dumping_me_collect_memory_stats.return.freqs_memuse", "embedding": null, "metadata": {"file_path": "mypy/memprofile.py", "file_name": "memprofile.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 64, "span_ids": ["collect_memory_stats", "docstring"], "tokens": 521}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Utility for dumping memory usage stats.\n\nThis is tailored to mypy and knows (a little) about which list objects are\nowned by particular AST nodes, etc.\n\"\"\"\n\nfrom collections import defaultdict\nimport gc\nimport sys\nfrom typing import List, Dict, Iterable, Tuple, cast\n\nfrom mypy.nodes import FakeInfo, Node\nfrom mypy.types import Type\nfrom mypy.util import get_class_descriptors\n\n\ndef collect_memory_stats() -> Tuple[Dict[str, int],\n Dict[str, int]]:\n \"\"\"Return stats about memory use.\n\n Return a tuple with these items:\n - Dict from object kind to number of instances of that kind\n - Dict from object kind to total bytes used by all instances of that kind\n \"\"\"\n objs = gc.get_objects()\n find_recursive_objects(objs)\n\n inferred = {}\n for obj in objs:\n if type(obj) is FakeInfo:\n # Processing these would cause a crash.\n continue\n n = type(obj).__name__\n if hasattr(obj, '__dict__'):\n # Keep track of which class a particular __dict__ is associated with.\n inferred[id(obj.__dict__)] = '%s (__dict__)' % n\n if isinstance(obj, (Node, Type)): # type: ignore\n if hasattr(obj, '__dict__'):\n for x in obj.__dict__.values():\n if isinstance(x, list):\n # Keep track of which node a list is associated with.\n inferred[id(x)] = '%s (list)' % n\n if isinstance(x, tuple):\n # Keep track of which node a list is associated with.\n inferred[id(x)] = '%s (tuple)' % n\n\n for k in get_class_descriptors(type(obj)):\n x = getattr(obj, k, None)\n if isinstance(x, list):\n inferred[id(x)] = '%s (list)' % n\n if isinstance(x, tuple):\n inferred[id(x)] = '%s (tuple)' % n\n\n freqs = {} # type: Dict[str, int]\n memuse = {} # type: Dict[str, int]\n for obj in objs:\n if id(obj) in inferred:\n name = inferred[id(obj)]\n else:\n name = type(obj).__name__\n freqs[name] = freqs.get(name, 0) + 1\n memuse[name] = memuse.get(name, 0) + sys.getsizeof(obj)\n\n return freqs, memuse", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/memprofile.py_print_memory_profile_print_memory_profile.print_Total_reachable_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/memprofile.py_print_memory_profile_print_memory_profile.print_Total_reachable_", "embedding": null, "metadata": {"file_path": "mypy/memprofile.py", "file_name": "memprofile.py", "file_type": "text/x-python", "category": "implementation", "start_line": 67, "end_line": 88, "span_ids": ["print_memory_profile"], "tokens": 248}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def print_memory_profile(run_gc: bool = True) -> None:\n if not sys.platform.startswith('win'):\n import resource\n system_memuse = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss\n else:\n system_memuse = -1 # TODO: Support this on Windows\n if run_gc:\n gc.collect()\n freqs, memuse = collect_memory_stats()\n print('%7s %7s %7s %s' % ('Freq', 'Size(k)', 'AvgSize', 'Type'))\n print('-------------------------------------------')\n totalmem = 0\n i = 0\n for n, mem in sorted(memuse.items(), key=lambda x: -x[1]):\n f = freqs[n]\n if i < 50:\n print('%7d %7d %7.0f %s' % (f, mem // 1024, mem / f, n))\n i += 1\n totalmem += mem\n print()\n print('Mem usage RSS ', system_memuse // 1024)\n print('Total reachable ', totalmem // 1024)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/memprofile.py_find_recursive_objects_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/memprofile.py_find_recursive_objects_", "embedding": null, "metadata": {"file_path": "mypy/memprofile.py", "file_name": "memprofile.py", "file_type": "text/x-python", "category": "implementation", "start_line": 91, "end_line": 120, "span_ids": ["find_recursive_objects"], "tokens": 235}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def find_recursive_objects(objs: List[object]) -> None:\n \"\"\"Find additional objects referenced by objs and append them to objs.\n\n We use this since gc.get_objects() does not return objects without pointers\n in them such as strings.\n \"\"\"\n seen = set(id(o) for o in objs)\n\n def visit(o: object) -> None:\n if id(o) not in seen:\n objs.append(o)\n seen.add(id(o))\n\n for obj in objs[:]:\n if type(obj) is FakeInfo:\n # Processing these would cause a crash.\n continue\n if type(obj) in (dict, defaultdict):\n for key, val in cast(Dict[object, object], obj).items():\n visit(key)\n visit(val)\n if type(obj) in (list, tuple, set):\n for x in cast(Iterable[object], obj):\n visit(x)\n if hasattr(obj, '__slots__'):\n for base in type.mro(type(obj)):\n for slot in getattr(base, '__slots__', ()):\n if hasattr(obj, slot):\n visit(getattr(obj, slot))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/message_registry.py__Message_constants_for__None_32": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/message_registry.py__Message_constants_for__None_32", "embedding": null, "metadata": {"file_path": "mypy/message_registry.py", "file_name": "message_registry.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 53, "span_ids": ["docstring:22", "docstring"], "tokens": 812}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Message constants for generating error messages during type checking.\n\nLiteral messages should be defined as constants in this module so they won't get out of sync\nif used in more than one place, and so that they can be easily introspected. These messages are\nultimately consumed by messages.MessageBuilder.fail(). For more non-trivial message generation,\nadd a method to MessageBuilder and call this instead.\n\"\"\"\n\nfrom typing_extensions import Final\n\n# Invalid types\nINVALID_TYPE_RAW_ENUM_VALUE = \"Invalid type: try using Literal[{}.{}] instead?\" # type: Final\n\n# Type checker error message constants\nNO_RETURN_VALUE_EXPECTED = 'No return value expected' # type: Final\nMISSING_RETURN_STATEMENT = 'Missing return statement' # type: Final\nINVALID_IMPLICIT_RETURN = 'Implicit return in function which does not return' # type: Final\nINCOMPATIBLE_RETURN_VALUE_TYPE = 'Incompatible return value type' # type: Final\nRETURN_VALUE_EXPECTED = 'Return value expected' # type: Final\nNO_RETURN_EXPECTED = 'Return statement in function which does not return' # type: Final\nINVALID_EXCEPTION = 'Exception must be derived from BaseException' # type: Final\nINVALID_EXCEPTION_TYPE = 'Exception type must be derived from BaseException' # type: Final\nRETURN_IN_ASYNC_GENERATOR = \"'return' with value in async generator is not allowed\" # type: Final\nINVALID_RETURN_TYPE_FOR_GENERATOR = \\\n 'The return type of a generator function should be \"Generator\"' \\\n ' or one of its supertypes' # type: Final\nINVALID_RETURN_TYPE_FOR_ASYNC_GENERATOR = \\\n 'The return type of an async generator function should be \"AsyncGenerator\" or one of its ' \\\n 'supertypes' # type: Final\nINVALID_GENERATOR_RETURN_ITEM_TYPE = \\\n 'The return type of a generator function must be None in' \\\n ' its third type parameter in Python 2' # type: Final\nYIELD_VALUE_EXPECTED = 'Yield value expected' # type: Final\nINCOMPATIBLE_TYPES = 'Incompatible types' # type: Final\nINCOMPATIBLE_TYPES_IN_ASSIGNMENT = 'Incompatible types in assignment' # type: Final\nINCOMPATIBLE_REDEFINITION = 'Incompatible redefinition' # type: Final\nINCOMPATIBLE_TYPES_IN_AWAIT = 'Incompatible types in \"await\"' # type: Final\nINCOMPATIBLE_TYPES_IN_ASYNC_WITH_AENTER = \\\n 'Incompatible types in \"async with\" for \"__aenter__\"' # type: Final\nINCOMPATIBLE_TYPES_IN_ASYNC_WITH_AEXIT = \\\n 'Incompatible types in \"async with\" for \"__aexit__\"' # type: Final\nINCOMPATIBLE_TYPES_IN_ASYNC_FOR = 'Incompatible types in \"async for\"' # type: Final\n\nINCOMPATIBLE_TYPES_IN_YIELD = 'Incompatible types in \"yield\"' # type: Final\nINCOMPATIBLE_TYPES_IN_YIELD_FROM = 'Incompatible types in \"yield from\"' # type: Final\nINCOMPATIBLE_TYPES_IN_STR_INTERPOLATION = \\\n 'Incompatible types in string interpolation' # type: Final\nMUST_HAVE_NONE_RETURN_TYPE = 'The return type of \"{}\" must be None' # type: Final\nINVALID_TUPLE_INDEX_TYPE = 'Invalid tuple index type' # type: Final\nTUPLE_INDEX_OUT_OF_RANGE = 'Tuple index out of range' # type: Final\nINVALID_SLICE_INDEX = 'Slice index must be an integer or None' # type: Final\nCANNOT_INFER_LAMBDA_TYPE = 'Cannot infer type of lambda' # type: Final\nCANNOT_ACCESS_INIT = 'Cannot access \"__init__\" directly' # type: Final", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/message_registry.py_NON_INSTANCE_NEW_TYPE_None_70": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/message_registry.py_NON_INSTANCE_NEW_TYPE_None_70", "embedding": null, "metadata": {"file_path": "mypy/message_registry.py", "file_name": "message_registry.py", "file_type": "text/x-python", "category": "implementation", "start_line": 54, "end_line": 106, "span_ids": ["docstring:47", "docstring:22"], "tokens": 833}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "NON_INSTANCE_NEW_TYPE = '\"__new__\" must return a class instance (got {})' # type: Final\nINVALID_NEW_TYPE = 'Incompatible return type for \"__new__\"' # type: Final\nBAD_CONSTRUCTOR_TYPE = 'Unsupported decorated constructor type' # type: Final\nCANNOT_ASSIGN_TO_METHOD = 'Cannot assign to a method' # type: Final\nCANNOT_ASSIGN_TO_TYPE = 'Cannot assign to a type' # type: Final\nINCONSISTENT_ABSTRACT_OVERLOAD = \\\n 'Overloaded method has both abstract and non-abstract variants' # type: Final\nMULTIPLE_OVERLOADS_REQUIRED = 'Single overload definition, multiple required' # type: Final\nREAD_ONLY_PROPERTY_OVERRIDES_READ_WRITE = \\\n 'Read-only property cannot override read-write property' # type: Final\nFORMAT_REQUIRES_MAPPING = 'Format requires a mapping' # type: Final\nRETURN_TYPE_CANNOT_BE_CONTRAVARIANT = \\\n \"Cannot use a contravariant type variable as return type\" # type: Final\nFUNCTION_PARAMETER_CANNOT_BE_COVARIANT = \\\n \"Cannot use a covariant type variable as a parameter\" # type: Final\nINCOMPATIBLE_IMPORT_OF = \"Incompatible import of\" # type: Final\nFUNCTION_TYPE_EXPECTED = \"Function is missing a type annotation\" # type: Final\nONLY_CLASS_APPLICATION = \"Type application is only supported for generic classes\" # type: Final\nRETURN_TYPE_EXPECTED = \"Function is missing a return type annotation\" # type: Final\nARGUMENT_TYPE_EXPECTED = \\\n \"Function is missing a type annotation for one or more arguments\" # type: Final\nKEYWORD_ARGUMENT_REQUIRES_STR_KEY_TYPE = \\\n 'Keyword argument only valid with \"str\" key type in call to \"dict\"' # type: Final\nALL_MUST_BE_SEQ_STR = 'Type of __all__ must be {}, not {}' # type: Final\nINVALID_TYPEDDICT_ARGS = \\\n 'Expected keyword arguments, {...}, or dict(...) in TypedDict constructor' # type: Final\nTYPEDDICT_KEY_MUST_BE_STRING_LITERAL = \\\n 'Expected TypedDict key to be string literal' # type: Final\nMALFORMED_ASSERT = 'Assertion is always true, perhaps remove parentheses?' # type: Final\nDUPLICATE_TYPE_SIGNATURES = 'Function has duplicate type signatures' # type: Final\nDESCRIPTOR_SET_NOT_CALLABLE = \"{}.__set__ is not callable\" # type: Final\nDESCRIPTOR_GET_NOT_CALLABLE = \"{}.__get__ is not callable\" # type: Final\nMODULE_LEVEL_GETATTRIBUTE = '__getattribute__ is not valid at the module level' # type: Final\n\n# Generic\nGENERIC_INSTANCE_VAR_CLASS_ACCESS = \\\n 'Access to generic instance variables via class is ambiguous' # type: Final\nGENERIC_CLASS_VAR_ACCESS = \\\n 'Access to generic class variables is ambiguous' # type: Final\nBARE_GENERIC = 'Missing type parameters for generic type {}' # type: Final\nIMPLICIT_GENERIC_ANY_BUILTIN = \\\n 'Implicit generic \"Any\". Use \"{}\" and specify generic parameters' # type: Final\n\n# TypeVar\nINCOMPATIBLE_TYPEVAR_VALUE = 'Value of type variable \"{}\" of {} cannot be {}' # type: Final\nCANNOT_USE_TYPEVAR_AS_EXPRESSION = \\\n 'Type variable \"{}.{}\" cannot be used as an expression' # type: Final\n\n# Super\nTOO_MANY_ARGS_FOR_SUPER = 'Too many arguments for \"super\"' # type: Final\nTOO_FEW_ARGS_FOR_SUPER = 'Too few arguments for \"super\"' # type: Final\nSUPER_WITH_SINGLE_ARG_NOT_SUPPORTED = '\"super\" with a single argument not supported' # type: Final\nUNSUPPORTED_ARG_1_FOR_SUPER = 'Unsupported argument 1 for \"super\"' # type: Final", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/message_registry.py_UNSUPPORTED_ARG_2_FOR_SUPER_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/message_registry.py_UNSUPPORTED_ARG_2_FOR_SUPER_", "embedding": null, "metadata": {"file_path": "mypy/message_registry.py", "file_name": "message_registry.py", "file_type": "text/x-python", "category": "implementation", "start_line": 107, "end_line": 145, "span_ids": ["docstring:47", "docstring:73"], "tokens": 486}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "UNSUPPORTED_ARG_2_FOR_SUPER = 'Unsupported argument 2 for \"super\"' # type: Final\nSUPER_VARARGS_NOT_SUPPORTED = 'Varargs not supported with \"super\"' # type: Final\nSUPER_POSITIONAL_ARGS_REQUIRED = '\"super\" only accepts positional arguments' # type: Final\nSUPER_ARG_2_NOT_INSTANCE_OF_ARG_1 = \\\n 'Argument 2 for \"super\" not an instance of argument 1' # type: Final\nTARGET_CLASS_HAS_NO_BASE_CLASS = 'Target class has no base class' # type: Final\nSUPER_OUTSIDE_OF_METHOD_NOT_SUPPORTED = \\\n 'super() outside of a method is not supported' # type: Final\nSUPER_ENCLOSING_POSITIONAL_ARGS_REQUIRED = \\\n 'super() requires one or more positional arguments in enclosing function' # type: Final\n\n# Self-type\nMISSING_OR_INVALID_SELF_TYPE = \\\n \"Self argument missing for a non-static method (or an invalid type for self)\" # type: Final\nERASED_SELF_TYPE_NOT_SUPERTYPE = \\\n 'The erased type of self \"{}\" is not a supertype of its class \"{}\"' # type: Final\nINVALID_SELF_TYPE_OR_EXTRA_ARG = \\\n \"Invalid type for self, or extra argument type in function annotation\" # type: Final\n\n# Final\nCANNOT_INHERIT_FROM_FINAL = 'Cannot inherit from final class \"{}\"' # type: Final\nDEPENDENT_FINAL_IN_CLASS_BODY = \\\n \"Final name declared in class body cannot depend on type variables\" # type: Final\nCANNOT_ACCESS_FINAL_INSTANCE_ATTR = \\\n 'Cannot access final instance attribute \"{}\" on class object' # type: Final\n\n# ClassVar\nCANNOT_OVERRIDE_INSTANCE_VAR = \\\n 'Cannot override instance variable (previously declared on base class \"{}\") with class ' \\\n 'variable' # type: Final\nCANNOT_OVERRIDE_CLASS_VAR = \\\n 'Cannot override class variable (previously declared on base class \"{}\") with instance ' \\\n 'variable' # type: Final\n\n# Protocol\nRUNTIME_PROTOCOL_EXPECTED = \\\n 'Only @runtime_checkable protocols can be used with instance and class checks' # type: Final\nCANNOT_INSTANTIATE_PROTOCOL = 'Cannot instantiate protocol class \"{}\"' # type: Final", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py__Facilities_for_generat_SUGGESTED_TEST_FIXTURES._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py__Facilities_for_generat_SUGGESTED_TEST_FIXTURES._", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 85, "span_ids": ["docstring:3", "docstring"], "tokens": 746}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Facilities for generating error messages during type checking.\n\nDon't add any non-trivial message construction logic to the type\nchecker, as it can compromise clarity and make messages less\nconsistent. Add such logic to this module instead. Literal messages, including those\nwith format args, should be defined as constants in mypy.message_registry.\n\nHistorically we tried to avoid all message string literals in the type\nchecker but we are moving away from this convention.\n\"\"\"\n\nfrom mypy.ordered_dict import OrderedDict\nimport re\nimport difflib\nfrom textwrap import dedent\n\nfrom typing import cast, List, Dict, Any, Sequence, Iterable, Tuple, Set, Optional, Union\nfrom typing_extensions import Final\n\nfrom mypy.erasetype import erase_type\nfrom mypy.errors import Errors\nfrom mypy.types import (\n Type, CallableType, Instance, TypeVarType, TupleType, TypedDictType, LiteralType,\n UnionType, NoneType, AnyType, Overloaded, FunctionLike, DeletedType, TypeType, TypeVarDef,\n UninhabitedType, TypeOfAny, UnboundType, PartialType, get_proper_type, ProperType,\n get_proper_types\n)\nfrom mypy.typetraverser import TypeTraverserVisitor\nfrom mypy.nodes import (\n TypeInfo, Context, MypyFile, op_methods, op_methods_to_symbols,\n FuncDef, reverse_builtin_aliases,\n ARG_POS, ARG_OPT, ARG_NAMED, ARG_NAMED_OPT, ARG_STAR, ARG_STAR2,\n ReturnStmt, NameExpr, Var, CONTRAVARIANT, COVARIANT, SymbolNode,\n CallExpr, IndexExpr, StrExpr, SymbolTable, TempNode\n)\nfrom mypy.subtypes import (\n is_subtype, find_member, get_member_flags,\n IS_SETTABLE, IS_CLASSVAR, IS_CLASS_OR_STATIC,\n)\nfrom mypy.sametypes import is_same_type\nfrom mypy.util import unmangle\nfrom mypy.errorcodes import ErrorCode\nfrom mypy import message_registry, errorcodes as codes\n\nTYPES_FOR_UNIMPORTED_HINTS = {\n 'typing.Any',\n 'typing.Callable',\n 'typing.Dict',\n 'typing.Iterable',\n 'typing.Iterator',\n 'typing.List',\n 'typing.Optional',\n 'typing.Set',\n 'typing.Tuple',\n 'typing.TypeVar',\n 'typing.Union',\n 'typing.cast',\n} # type: Final\n\n\nARG_CONSTRUCTOR_NAMES = {\n ARG_POS: \"Arg\",\n ARG_OPT: \"DefaultArg\",\n ARG_NAMED: \"NamedArg\",\n ARG_NAMED_OPT: \"DefaultNamedArg\",\n ARG_STAR: \"VarArg\",\n ARG_STAR2: \"KwArg\",\n} # type: Final\n\n\n# Map from the full name of a missing definition to the test fixture (under\n# test-data/unit/fixtures/) that provides the definition. This is used for\n# generating better error messages when running mypy tests only.\nSUGGESTED_TEST_FIXTURES = {\n 'builtins.list': 'list.pyi',\n 'builtins.dict': 'dict.pyi',\n 'builtins.set': 'set.pyi',\n 'builtins.tuple': 'tuple.pyi',\n 'builtins.bool': 'bool.pyi',\n 'builtins.Exception': 'exception.pyi',\n 'builtins.BaseException': 'exception.pyi',\n 'builtins.isinstance': 'isinstancelist.pyi',\n 'builtins.property': 'property.pyi',\n 'builtins.classmethod': 'classmethod.pyi',\n}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_None_6_MessageBuilder.most_recent_context.return.node": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_None_6_MessageBuilder.most_recent_context.return.node", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 85, "end_line": 154, "span_ids": ["MessageBuilder.clean_copy", "MessageBuilder.add_errors", "MessageBuilder.is_errors", "MessageBuilder.most_recent_context", "MessageBuilder.enable_errors", "MessageBuilder.copy", "MessageBuilder.disable_errors", "MessageBuilder", "docstring:3", "MessageBuilder.__init__"], "tokens": 479}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": " # type: Final\n\n\nclass MessageBuilder:\n \"\"\"Helper class for reporting type checker error messages with parameters.\n\n The methods of this class need to be provided with the context within a\n file; the errors member manages the wider context.\n\n IDEA: Support a 'verbose mode' that includes full information about types\n in error messages and that may otherwise produce more detailed error\n messages.\n \"\"\"\n\n # Report errors using this instance. It knows about the current file and\n # import context.\n errors = None # type: Errors\n\n modules = None # type: Dict[str, MypyFile]\n\n # Number of times errors have been disabled.\n disable_count = 0\n\n # Hack to deduplicate error messages from union types\n disable_type_names = 0\n\n def __init__(self, errors: Errors, modules: Dict[str, MypyFile]) -> None:\n self.errors = errors\n self.modules = modules\n self.disable_count = 0\n self.disable_type_names = 0\n\n #\n # Helpers\n #\n\n def copy(self) -> 'MessageBuilder':\n new = MessageBuilder(self.errors.copy(), self.modules)\n new.disable_count = self.disable_count\n new.disable_type_names = self.disable_type_names\n return new\n\n def clean_copy(self) -> 'MessageBuilder':\n errors = self.errors.copy()\n errors.error_info_map = OrderedDict()\n return MessageBuilder(errors, self.modules)\n\n def add_errors(self, messages: 'MessageBuilder') -> None:\n \"\"\"Add errors in messages to this builder.\"\"\"\n if self.disable_count <= 0:\n for errs in messages.errors.error_info_map.values():\n for info in errs:\n self.errors.add_error_info(info)\n\n def disable_errors(self) -> None:\n self.disable_count += 1\n\n def enable_errors(self) -> None:\n self.disable_count -= 1\n\n def is_errors(self) -> bool:\n return self.errors.is_errors()\n\n def most_recent_context(self) -> Context:\n \"\"\"Return a dummy context matching the most recent generated error in current file.\"\"\"\n line, column = self.errors.most_recent_error_location()\n node = TempNode(NoneType())\n node.line = line\n node.column = column\n return node", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.report_MessageBuilder.report.if_self_disable_count_.self_errors_report_contex": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.report_MessageBuilder.report.if_self_disable_count_.self_errors_report_contex", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 156, "end_line": 178, "span_ids": ["MessageBuilder.report"], "tokens": 191}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MessageBuilder:\n\n def report(self,\n msg: str,\n context: Optional[Context],\n severity: str,\n *,\n code: Optional[ErrorCode] = None,\n file: Optional[str] = None,\n origin: Optional[Context] = None,\n offset: int = 0) -> None:\n \"\"\"Report an error or note (unless disabled).\"\"\"\n if origin is not None:\n end_line = origin.end_line\n elif context is not None:\n end_line = context.end_line\n else:\n end_line = None\n if self.disable_count <= 0:\n self.errors.report(context.get_line() if context else -1,\n context.get_column() if context else -1,\n msg, severity=severity, file=file, offset=offset,\n origin_line=origin.get_line() if origin else None,\n end_line=end_line,\n code=code)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.fail_MessageBuilder._on_them_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.fail_MessageBuilder._on_them_", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 180, "end_line": 216, "span_ids": ["MessageBuilder.note_multiline", "MessageBuilder.note", "MessageBuilder.fail"], "tokens": 327}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MessageBuilder:\n\n def fail(self,\n msg: str,\n context: Optional[Context],\n *,\n code: Optional[ErrorCode] = None,\n file: Optional[str] = None,\n origin: Optional[Context] = None) -> None:\n \"\"\"Report an error message (unless disabled).\"\"\"\n self.report(msg, context, 'error', code=code, file=file, origin=origin)\n\n def note(self,\n msg: str,\n context: Context,\n file: Optional[str] = None,\n origin: Optional[Context] = None,\n offset: int = 0,\n *,\n code: Optional[ErrorCode] = None) -> None:\n \"\"\"Report a note (unless disabled).\"\"\"\n self.report(msg, context, 'note', file=file, origin=origin,\n offset=offset, code=code)\n\n def note_multiline(self, messages: str, context: Context, file: Optional[str] = None,\n origin: Optional[Context] = None, offset: int = 0,\n code: Optional[ErrorCode] = None) -> None:\n \"\"\"Report as many notes as lines in the message (unless disabled).\"\"\"\n for msg in messages.splitlines():\n self.report(msg, context, 'note', file=file, origin=origin,\n offset=offset, code=code)\n\n #\n # Specific operations\n #\n\n # The following operations are for generating specific error messages. They\n # get some information as arguments, and they build an error message based\n # on them.", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.has_no_attr_MessageBuilder.has_no_attr.typ.get_proper_type_typ_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.has_no_attr_MessageBuilder.has_no_attr.typ.get_proper_type_typ_", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 218, "end_line": 241, "span_ids": ["MessageBuilder.has_no_attr"], "tokens": 235}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MessageBuilder:\n\n def has_no_attr(self,\n original_type: Type,\n typ: Type,\n member: str,\n context: Context,\n module_symbol_table: Optional[SymbolTable] = None) -> Type:\n \"\"\"Report a missing or non-accessible member.\n\n original_type is the top-level type on which the error occurred.\n typ is the actual type that is missing the member. These can be\n different, e.g., in a union, original_type will be the union and typ\n will be the specific item in the union that does not have the member\n attribute.\n\n 'module_symbol_table' is passed to this function if the type for which we\n are trying to get a member was originally a module. The SymbolTable allows\n us to look up and suggests attributes of the module since they are not\n directly available on original_type\n\n If member corresponds to an operator, use the corresponding operator\n name in the messages. Return type Any.\n \"\"\"\n original_type = get_proper_type(original_type)\n typ = get_proper_type(typ)\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.has_no_attr.if_isinstance_original_t_MessageBuilder.has_no_attr.return.AnyType_TypeOfAny_from_er": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.has_no_attr.if_isinstance_original_t_MessageBuilder.has_no_attr.return.AnyType_TypeOfAny_from_er", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 243, "end_line": 341, "span_ids": ["MessageBuilder.has_no_attr"], "tokens": 1034}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MessageBuilder:\n\n def has_no_attr(self,\n original_type: Type,\n typ: Type,\n member: str,\n context: Context,\n module_symbol_table: Optional[SymbolTable] = None) -> Type:\n # ... other code\n\n if (isinstance(original_type, Instance) and\n original_type.type.has_readable_member(member)):\n self.fail('Member \"{}\" is not assignable'.format(member), context)\n elif member == '__contains__':\n self.fail('Unsupported right operand type for in ({})'.format(\n format_type(original_type)), context, code=codes.OPERATOR)\n elif member in op_methods.values():\n # Access to a binary operator member (e.g. _add). This case does\n # not handle indexing operations.\n for op, method in op_methods.items():\n if method == member:\n self.unsupported_left_operand(op, original_type, context)\n break\n elif member == '__neg__':\n self.fail('Unsupported operand type for unary - ({})'.format(\n format_type(original_type)), context, code=codes.OPERATOR)\n elif member == '__pos__':\n self.fail('Unsupported operand type for unary + ({})'.format(\n format_type(original_type)), context, code=codes.OPERATOR)\n elif member == '__invert__':\n self.fail('Unsupported operand type for ~ ({})'.format(\n format_type(original_type)), context, code=codes.OPERATOR)\n elif member == '__getitem__':\n # Indexed get.\n # TODO: Fix this consistently in format_type\n if isinstance(original_type, CallableType) and original_type.is_type_obj():\n self.fail('The type {} is not generic and not indexable'.format(\n format_type(original_type)), context)\n else:\n self.fail('Value of type {} is not indexable'.format(\n format_type(original_type)), context, code=codes.INDEX)\n elif member == '__setitem__':\n # Indexed set.\n self.fail('Unsupported target for indexed assignment ({})'.format(\n format_type(original_type)), context, code=codes.INDEX)\n elif member == '__call__':\n if isinstance(original_type, Instance) and \\\n (original_type.type.fullname == 'builtins.function'):\n # \"'function' not callable\" is a confusing error message.\n # Explain that the problem is that the type of the function is not known.\n self.fail('Cannot call function of unknown type', context, code=codes.OPERATOR)\n else:\n self.fail('{} not callable'.format(format_type(original_type)), context,\n code=codes.OPERATOR)\n else:\n # The non-special case: a missing ordinary attribute.\n extra = ''\n if member == '__iter__':\n extra = ' (not iterable)'\n elif member == '__aiter__':\n extra = ' (not async iterable)'\n if not self.disable_type_names:\n failed = False\n if isinstance(original_type, Instance) and original_type.type.names:\n alternatives = set(original_type.type.names.keys())\n\n if module_symbol_table is not None:\n alternatives |= {key for key in module_symbol_table.keys()}\n\n # in some situations, the member is in the alternatives set\n # but since we're in this function, we shouldn't suggest it\n if member in alternatives:\n alternatives.remove(member)\n\n matches = [m for m in COMMON_MISTAKES.get(member, []) if m in alternatives]\n matches.extend(best_matches(member, alternatives)[:3])\n if member == '__aiter__' and matches == ['__iter__']:\n matches = [] # Avoid misleading suggestion\n if member == '__div__' and matches == ['__truediv__']:\n # TODO: Handle differences in division between Python 2 and 3 more cleanly\n matches = []\n if matches:\n self.fail(\n '{} has no attribute \"{}\"; maybe {}?{}'.format(\n format_type(original_type),\n member,\n pretty_seq(matches, \"or\"),\n extra,\n ),\n context,\n code=codes.ATTR_DEFINED)\n failed = True\n if not failed:\n self.fail(\n '{} has no attribute \"{}\"{}'.format(\n format_type(original_type), member, extra),\n context,\n code=codes.ATTR_DEFINED)\n elif isinstance(original_type, UnionType):\n # The checker passes \"object\" in lieu of \"None\" for attribute\n # checks, so we manually convert it back.\n typ_format, orig_type_format = format_type_distinctly(typ, original_type)\n if typ_format == '\"object\"' and \\\n any(type(item) == NoneType for item in original_type.items):\n typ_format = '\"None\"'\n self.fail('Item {} of {} has no attribute \"{}\"{}'.format(\n typ_format, orig_type_format, member, extra), context,\n code=codes.UNION_ATTR)\n return AnyType(TypeOfAny.from_error)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.unsupported_operand_types_MessageBuilder.unsupported_operand_types.self_fail_msg_context_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.unsupported_operand_types_MessageBuilder.unsupported_operand_types.self_fail_msg_context_c", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 343, "end_line": 371, "span_ids": ["MessageBuilder.unsupported_operand_types"], "tokens": 198}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MessageBuilder:\n\n def unsupported_operand_types(self,\n op: str,\n left_type: Any,\n right_type: Any,\n context: Context,\n *,\n code: ErrorCode = codes.OPERATOR) -> None:\n \"\"\"Report unsupported operand types for a binary operation.\n\n Types can be Type objects or strings.\n \"\"\"\n left_str = ''\n if isinstance(left_type, str):\n left_str = left_type\n else:\n left_str = format_type(left_type)\n\n right_str = ''\n if isinstance(right_type, str):\n right_str = right_type\n else:\n right_str = format_type(right_type)\n\n if self.disable_type_names:\n msg = 'Unsupported operand types for {} (likely involving Union)'.format(op)\n else:\n msg = 'Unsupported operand types for {} ({} and {})'.format(\n op, left_str, right_str)\n self.fail(msg, context, code=code)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.unsupported_left_operand_MessageBuilder.untyped_function_call.return.AnyType_TypeOfAny_from_er": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.unsupported_left_operand_MessageBuilder.untyped_function_call.return.AnyType_TypeOfAny_from_er", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 373, "end_line": 390, "span_ids": ["MessageBuilder.not_callable", "MessageBuilder.unsupported_left_operand", "MessageBuilder.untyped_function_call"], "tokens": 204}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MessageBuilder:\n\n def unsupported_left_operand(self, op: str, typ: Type,\n context: Context) -> None:\n if self.disable_type_names:\n msg = 'Unsupported left operand type for {} (some union)'.format(op)\n else:\n msg = 'Unsupported left operand type for {} ({})'.format(\n op, format_type(typ))\n self.fail(msg, context, code=codes.OPERATOR)\n\n def not_callable(self, typ: Type, context: Context) -> Type:\n self.fail('{} not callable'.format(format_type(typ)), context)\n return AnyType(TypeOfAny.from_error)\n\n def untyped_function_call(self, callee: CallableType, context: Context) -> Type:\n name = callable_name(callee) or '(unknown)'\n self.fail('Call to untyped function {} in typed context'.format(name), context,\n code=codes.NO_UNTYPED_CALL)\n return AnyType(TypeOfAny.from_error)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.incompatible_argument_MessageBuilder.incompatible_argument._type_List_str_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.incompatible_argument_MessageBuilder.incompatible_argument._type_List_str_", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 392, "end_line": 463, "span_ids": ["MessageBuilder.incompatible_argument"], "tokens": 609}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MessageBuilder:\n\n def incompatible_argument(self,\n n: int,\n m: int,\n callee: CallableType,\n arg_type: Type,\n arg_kind: int,\n object_type: Optional[Type],\n context: Context,\n outer_context: Context) -> Optional[ErrorCode]:\n \"\"\"Report an error about an incompatible argument type.\n\n The argument type is arg_type, argument number is n and the\n callee type is 'callee'. If the callee represents a method\n that corresponds to an operator, use the corresponding\n operator name in the messages.\n\n Return the error code that used for the argument (multiple error\n codes are possible).\n \"\"\"\n arg_type = get_proper_type(arg_type)\n\n target = ''\n callee_name = callable_name(callee)\n if callee_name is not None:\n name = callee_name\n if callee.bound_args and callee.bound_args[0] is not None:\n base = format_type(callee.bound_args[0])\n else:\n base = extract_type(name)\n\n for method, op in op_methods_to_symbols.items():\n for variant in method, '__r' + method[2:]:\n # FIX: do not rely on textual formatting\n if name.startswith('\"{}\" of'.format(variant)):\n if op == 'in' or variant != method:\n # Reversed order of base/argument.\n self.unsupported_operand_types(op, arg_type, base,\n context, code=codes.OPERATOR)\n else:\n self.unsupported_operand_types(op, base, arg_type,\n context, code=codes.OPERATOR)\n return codes.OPERATOR\n\n if name.startswith('\"__cmp__\" of'):\n self.unsupported_operand_types(\"comparison\", arg_type, base,\n context, code=codes.OPERATOR)\n return codes.INDEX\n\n if name.startswith('\"__getitem__\" of'):\n self.invalid_index_type(arg_type, callee.arg_types[n - 1], base, context,\n code=codes.INDEX)\n return codes.INDEX\n\n if name.startswith('\"__setitem__\" of'):\n if n == 1:\n self.invalid_index_type(arg_type, callee.arg_types[n - 1], base, context,\n code=codes.INDEX)\n return codes.INDEX\n else:\n msg = '{} (expression has type {}, target has type {})'\n arg_type_str, callee_type_str = format_type_distinctly(arg_type,\n callee.arg_types[n - 1])\n self.fail(msg.format(message_registry.INCOMPATIBLE_TYPES_IN_ASSIGNMENT,\n arg_type_str, callee_type_str),\n context, code=codes.ASSIGNMENT)\n return codes.ASSIGNMENT\n\n target = 'to {} '.format(name)\n\n msg = ''\n code = codes.MISC\n notes = [] # type: List[str]\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.incompatible_argument.if_callee_name_list__MessageBuilder.incompatible_argument.return.code": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.incompatible_argument.if_callee_name_list__MessageBuilder.incompatible_argument.return.code", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 464, "end_line": 577, "span_ids": ["MessageBuilder.incompatible_argument"], "tokens": 1246}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MessageBuilder:\n\n def incompatible_argument(self,\n n: int,\n m: int,\n callee: CallableType,\n arg_type: Type,\n arg_kind: int,\n object_type: Optional[Type],\n context: Context,\n outer_context: Context) -> Optional[ErrorCode]:\n # ... other code\n if callee_name == '':\n name = callee_name[1:-1]\n n -= 1\n actual_type_str, expected_type_str = format_type_distinctly(arg_type,\n callee.arg_types[0])\n msg = '{} item {} has incompatible type {}; expected {}'.format(\n name.title(), n, actual_type_str, expected_type_str)\n code = codes.LIST_ITEM\n elif callee_name == '':\n name = callee_name[1:-1]\n n -= 1\n key_type, value_type = cast(TupleType, arg_type).items\n expected_key_type, expected_value_type = cast(TupleType, callee.arg_types[0]).items\n\n # don't increase verbosity unless there is need to do so\n if is_subtype(key_type, expected_key_type):\n key_type_str = format_type(key_type)\n expected_key_type_str = format_type(expected_key_type)\n else:\n key_type_str, expected_key_type_str = format_type_distinctly(\n key_type, expected_key_type)\n if is_subtype(value_type, expected_value_type):\n value_type_str = format_type(value_type)\n expected_value_type_str = format_type(expected_value_type)\n else:\n value_type_str, expected_value_type_str = format_type_distinctly(\n value_type, expected_value_type)\n\n msg = '{} entry {} has incompatible type {}: {}; expected {}: {}'.format(\n name.title(), n, key_type_str, value_type_str,\n expected_key_type_str, expected_value_type_str)\n code = codes.DICT_ITEM\n elif callee_name == '':\n actual_type_str, expected_type_str = map(strip_quotes,\n format_type_distinctly(arg_type,\n callee.arg_types[0]))\n msg = 'List comprehension has incompatible type List[{}]; expected List[{}]'.format(\n actual_type_str, expected_type_str)\n elif callee_name == '':\n actual_type_str, expected_type_str = map(strip_quotes,\n format_type_distinctly(arg_type,\n callee.arg_types[0]))\n msg = 'Set comprehension has incompatible type Set[{}]; expected Set[{}]'.format(\n actual_type_str, expected_type_str)\n elif callee_name == '':\n actual_type_str, expected_type_str = format_type_distinctly(arg_type,\n callee.arg_types[n - 1])\n msg = ('{} expression in dictionary comprehension has incompatible type {}; '\n 'expected type {}').format(\n 'Key' if n == 1 else 'Value',\n actual_type_str,\n expected_type_str)\n elif callee_name == '':\n actual_type_str, expected_type_str = format_type_distinctly(arg_type,\n callee.arg_types[0])\n msg = 'Generator has incompatible item type {}; expected {}'.format(\n actual_type_str, expected_type_str)\n else:\n try:\n expected_type = callee.arg_types[m - 1]\n except IndexError: # Varargs callees\n expected_type = callee.arg_types[-1]\n arg_type_str, expected_type_str = format_type_distinctly(\n arg_type, expected_type, bare=True)\n if arg_kind == ARG_STAR:\n arg_type_str = '*' + arg_type_str\n elif arg_kind == ARG_STAR2:\n arg_type_str = '**' + arg_type_str\n\n # For function calls with keyword arguments, display the argument name rather than the\n # number.\n arg_label = str(n)\n if isinstance(outer_context, CallExpr) and len(outer_context.arg_names) >= n:\n arg_name = outer_context.arg_names[n - 1]\n if arg_name is not None:\n arg_label = '\"{}\"'.format(arg_name)\n if (arg_kind == ARG_STAR2\n and isinstance(arg_type, TypedDictType)\n and m <= len(callee.arg_names)\n and callee.arg_names[m - 1] is not None\n and callee.arg_kinds[m - 1] != ARG_STAR2):\n arg_name = callee.arg_names[m - 1]\n assert arg_name is not None\n arg_type_str, expected_type_str = format_type_distinctly(\n arg_type.items[arg_name],\n expected_type,\n bare=True)\n arg_label = '\"{}\"'.format(arg_name)\n if isinstance(outer_context, IndexExpr) and isinstance(outer_context.index, StrExpr):\n msg = 'Value of \"{}\" has incompatible type {}; expected {}' .format(\n outer_context.index.value, quote_type_string(arg_type_str),\n quote_type_string(expected_type_str))\n else:\n msg = 'Argument {} {}has incompatible type {}; expected {}'.format(\n arg_label, target, quote_type_string(arg_type_str),\n quote_type_string(expected_type_str))\n object_type = get_proper_type(object_type)\n if isinstance(object_type, TypedDictType):\n code = codes.TYPEDDICT_ITEM\n else:\n code = codes.ARG_TYPE\n expected_type = get_proper_type(expected_type)\n if isinstance(expected_type, UnionType):\n expected_types = list(expected_type.items)\n else:\n expected_types = [expected_type]\n for type in get_proper_types(expected_types):\n if isinstance(arg_type, Instance) and isinstance(type, Instance):\n notes = append_invariance_notes(notes, arg_type, type)\n self.fail(msg, context, code=code)\n if notes:\n for note_msg in notes:\n self.note(note_msg, context, code=code)\n return code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.missing_named_argument_MessageBuilder.too_many_positional_arguments.self_fail_msg_context_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.missing_named_argument_MessageBuilder.too_many_positional_arguments.self_fail_msg_context_", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 610, "end_line": 635, "span_ids": ["MessageBuilder.too_many_arguments", "MessageBuilder.too_many_positional_arguments", "MessageBuilder.missing_named_argument", "MessageBuilder.too_many_arguments_from_typed_dict"], "tokens": 261}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MessageBuilder:\n\n def missing_named_argument(self, callee: CallableType, context: Context, name: str) -> None:\n msg = 'Missing named argument \"{}\"'.format(name) + for_function(callee)\n self.fail(msg, context, code=codes.CALL_ARG)\n\n def too_many_arguments(self, callee: CallableType, context: Context) -> None:\n msg = 'Too many arguments' + for_function(callee)\n self.fail(msg, context, code=codes.CALL_ARG)\n\n def too_many_arguments_from_typed_dict(self,\n callee: CallableType,\n arg_type: TypedDictType,\n context: Context) -> None:\n # Try to determine the name of the extra argument.\n for key in arg_type.items:\n if key not in callee.arg_names:\n msg = 'Extra argument \"{}\" from **args'.format(key) + for_function(callee)\n break\n else:\n self.too_many_arguments(callee, context)\n return\n self.fail(msg, context)\n\n def too_many_positional_arguments(self, callee: CallableType,\n context: Context) -> None:\n msg = 'Too many positional arguments' + for_function(callee)\n self.fail(msg, context)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.unexpected_keyword_argument_MessageBuilder.unexpected_keyword_argument.if_module_.self_note_defined_her": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.unexpected_keyword_argument_MessageBuilder.unexpected_keyword_argument.if_module_.self_note_defined_her", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 637, "end_line": 663, "span_ids": ["MessageBuilder.unexpected_keyword_argument"], "tokens": 311}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MessageBuilder:\n\n def unexpected_keyword_argument(self, callee: CallableType, name: str, arg_type: Type,\n context: Context) -> None:\n msg = 'Unexpected keyword argument \"{}\"'.format(name) + for_function(callee)\n # Suggest intended keyword, look for type match else fallback on any match.\n matching_type_args = []\n not_matching_type_args = []\n for i, kwarg_type in enumerate(callee.arg_types):\n callee_arg_name = callee.arg_names[i]\n if callee_arg_name is not None and callee.arg_kinds[i] != ARG_STAR:\n if is_subtype(arg_type, kwarg_type):\n matching_type_args.append(callee_arg_name)\n else:\n not_matching_type_args.append(callee_arg_name)\n matches = best_matches(name, matching_type_args)\n if not matches:\n matches = best_matches(name, not_matching_type_args)\n if matches:\n msg += \"; did you mean {}?\".format(pretty_seq(matches[:3], \"or\"))\n self.fail(msg, context, code=codes.CALL_ARG)\n module = find_defining_module(self.modules, callee)\n if module:\n assert callee.definition is not None\n fname = callable_name(callee)\n if not fname: # an alias to function with a different name\n fname = 'Called function'\n self.note('{} defined here'.format(fname), callee.definition,\n file=module.path, origin=context, code=codes.CALL_ARG)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.duplicate_argument_value_MessageBuilder.does_not_return_value.if_name_is_not_None_.else_.self_fail_Function_does_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.duplicate_argument_value_MessageBuilder.does_not_return_value.if_name_is_not_None_.else_.self_fail_Function_does_", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 665, "end_line": 681, "span_ids": ["MessageBuilder.duplicate_argument_value", "MessageBuilder.does_not_return_value"], "tokens": 197}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MessageBuilder:\n\n def duplicate_argument_value(self, callee: CallableType, index: int,\n context: Context) -> None:\n self.fail('{} gets multiple values for keyword argument \"{}\"'.\n format(callable_name(callee) or 'Function', callee.arg_names[index]),\n context)\n\n def does_not_return_value(self, callee_type: Optional[Type], context: Context) -> None:\n \"\"\"Report an error about use of an unusable type.\"\"\"\n name = None # type: Optional[str]\n callee_type = get_proper_type(callee_type)\n if isinstance(callee_type, FunctionLike):\n name = callable_name(callee_type)\n if name is not None:\n self.fail('{} does not return a value'.format(capitalize(name)), context,\n code=codes.FUNC_RETURNS_VALUE)\n else:\n self.fail('Function does not return a value', context, code=codes.FUNC_RETURNS_VALUE)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.deleted_as_rvalue_MessageBuilder.deleted_as_lvalue.self_fail_Assignment_to_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.deleted_as_rvalue_MessageBuilder.deleted_as_lvalue.self_fail_Assignment_to_", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 692, "end_line": 710, "span_ids": ["MessageBuilder.deleted_as_lvalue", "MessageBuilder.deleted_as_rvalue"], "tokens": 182}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MessageBuilder:\n\n def deleted_as_rvalue(self, typ: DeletedType, context: Context) -> None:\n \"\"\"Report an error about using an deleted type as an rvalue.\"\"\"\n if typ.source is None:\n s = \"\"\n else:\n s = ' \"{}\"'.format(typ.source)\n self.fail('Trying to read deleted variable{}'.format(s), context)\n\n def deleted_as_lvalue(self, typ: DeletedType, context: Context) -> None:\n \"\"\"Report an error about using an deleted type as an lvalue.\n\n Currently, this only occurs when trying to assign to an\n exception variable outside the local except: blocks.\n \"\"\"\n if typ.source is None:\n s = \"\"\n else:\n s = ' \"{}\"'.format(typ.source)\n self.fail('Assignment to variable{} outside except: block'.format(s), context)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.no_variant_matches_arguments_MessageBuilder.no_variant_matches_arguments.self_pretty_overload_matc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.no_variant_matches_arguments_MessageBuilder.no_variant_matches_arguments.self_pretty_overload_matc", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 703, "end_line": 729, "span_ids": ["MessageBuilder.no_variant_matches_arguments"], "tokens": 253}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MessageBuilder:\n\n def no_variant_matches_arguments(self,\n plausible_targets: List[CallableType],\n overload: Overloaded,\n arg_types: List[Type],\n context: Context,\n *,\n code: Optional[ErrorCode] = None) -> None:\n code = code or codes.CALL_OVERLOAD\n name = callable_name(overload)\n if name:\n name_str = ' of {}'.format(name)\n else:\n name_str = ''\n arg_types_str = ', '.join(format_type(arg) for arg in arg_types)\n num_args = len(arg_types)\n if num_args == 0:\n self.fail('All overload variants{} require at least one argument'.format(name_str),\n context, code=code)\n elif num_args == 1:\n self.fail('No overload variant{} matches argument type {}'\n .format(name_str, arg_types_str), context, code=code)\n else:\n self.fail('No overload variant{} matches argument types {}'\n .format(name_str, arg_types_str), context, code=code)\n\n self.pretty_overload_matches(plausible_targets, overload, context, offset=2, max_items=2,\n code=code)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.wrong_number_values_to_unpack_MessageBuilder.incompatible_operator_assignment.self_fail_Result_type_of": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.wrong_number_values_to_unpack_MessageBuilder.incompatible_operator_assignment.self_fail_Result_type_of", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 740, "end_line": 762, "span_ids": ["MessageBuilder.type_not_iterable", "MessageBuilder.unpacking_strings_disallowed", "MessageBuilder.incompatible_operator_assignment", "MessageBuilder.wrong_number_values_to_unpack"], "tokens": 227}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MessageBuilder:\n\n def wrong_number_values_to_unpack(self, provided: int, expected: int,\n context: Context) -> None:\n if provided < expected:\n if provided == 1:\n self.fail('Need more than 1 value to unpack ({} expected)'.format(expected),\n context)\n else:\n self.fail('Need more than {} values to unpack ({} expected)'.format(\n provided, expected), context)\n elif provided > expected:\n self.fail('Too many values to unpack ({} expected, {} provided)'.format(\n expected, provided), context)\n\n def unpacking_strings_disallowed(self, context: Context) -> None:\n self.fail(\"Unpacking a string is disallowed\", context)\n\n def type_not_iterable(self, type: Type, context: Context) -> None:\n self.fail('\"{}\" object is not iterable'.format(type), context)\n\n def incompatible_operator_assignment(self, op: str,\n context: Context) -> None:\n self.fail('Result type of {} incompatible in assignment'.format(op),\n context)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.overload_signature_incompatible_with_supertype_MessageBuilder.signature_incompatible_with_supertype.self_fail_Signature_of_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.overload_signature_incompatible_with_supertype_MessageBuilder.signature_incompatible_with_supertype.self_fail_Signature_of_", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 755, "end_line": 770, "span_ids": ["MessageBuilder.overload_signature_incompatible_with_supertype", "MessageBuilder.signature_incompatible_with_supertype"], "tokens": 201}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MessageBuilder:\n\n def overload_signature_incompatible_with_supertype(\n self, name: str, name_in_super: str, supertype: str,\n overload: Overloaded, context: Context) -> None:\n target = self.override_target(name, name_in_super, supertype)\n self.fail('Signature of \"{}\" incompatible with {}'.format(\n name, target), context, code=codes.OVERRIDE)\n\n note_template = 'Overload variants must be defined in the same order as they are in \"{}\"'\n self.note(note_template.format(supertype), context, code=codes.OVERRIDE)\n\n def signature_incompatible_with_supertype(\n self, name: str, name_in_super: str, supertype: str,\n context: Context) -> None:\n target = self.override_target(name, name_in_super, supertype)\n self.fail('Signature of \"{}\" incompatible with {}'.format(\n name, target), context, code=codes.OVERRIDE)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.argument_incompatible_with_supertype_MessageBuilder.argument_incompatible_with_supertype.if_name___eq___and_t.self_note_multiline_multi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.argument_incompatible_with_supertype_MessageBuilder.argument_incompatible_with_supertype.if_name___eq___and_t.self_note_multiline_multi", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 772, "end_line": 794, "span_ids": ["MessageBuilder.argument_incompatible_with_supertype"], "tokens": 254}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MessageBuilder:\n\n def argument_incompatible_with_supertype(\n self, arg_num: int, name: str, type_name: Optional[str],\n name_in_supertype: str, arg_type_in_supertype: Type, supertype: str,\n context: Context) -> None:\n target = self.override_target(name, name_in_supertype, supertype)\n arg_type_in_supertype_f = format_type_bare(arg_type_in_supertype)\n self.fail('Argument {} of \"{}\" is incompatible with {}; '\n 'supertype defines the argument type as \"{}\"'\n .format(arg_num, name, target, arg_type_in_supertype_f),\n context,\n code=codes.OVERRIDE)\n self.note(\n 'This violates the Liskov substitution principle',\n context,\n code=codes.OVERRIDE)\n self.note(\n 'See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides',\n context,\n code=codes.OVERRIDE)\n\n if name == \"__eq__\" and type_name:\n multiline_msg = self.comparison_method_example_msg(class_name=type_name)\n self.note_multiline(multiline_msg, context, code=codes.OVERRIDE)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.comparison_method_example_msg_MessageBuilder.return_type_incompatible_with_supertype.self_fail_Return_type_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.comparison_method_example_msg_MessageBuilder.return_type_incompatible_with_supertype.self_fail_Return_type_", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 796, "end_line": 814, "span_ids": ["MessageBuilder.return_type_incompatible_with_supertype", "MessageBuilder.comparison_method_example_msg"], "tokens": 217}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MessageBuilder:\n\n def comparison_method_example_msg(self, class_name: str) -> str:\n return dedent('''\\\n It is recommended for \"__eq__\" to work with arbitrary objects, for example:\n def __eq__(self, other: object) -> bool:\n if not isinstance(other, {class_name}):\n return NotImplemented\n return \n '''.format(class_name=class_name))\n\n def return_type_incompatible_with_supertype(\n self, name: str, name_in_supertype: str, supertype: str,\n original: Type, override: Type,\n context: Context) -> None:\n target = self.override_target(name, name_in_supertype, supertype)\n override_str, original_str = format_type_distinctly(override, original)\n self.fail('Return type {} of \"{}\" incompatible with return type {} in {}'\n .format(override_str, name, original_str, target),\n context,\n code=codes.OVERRIDE)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.override_target_MessageBuilder.incompatible_type_application.if_expected_arg_count_.else_.self_fail_Type_applicati": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.override_target_MessageBuilder.incompatible_type_application.if_expected_arg_count_.else_.self_fail_Type_applicati", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 816, "end_line": 834, "span_ids": ["MessageBuilder.incompatible_type_application", "MessageBuilder.override_target"], "tokens": 183}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MessageBuilder:\n\n def override_target(self, name: str, name_in_super: str,\n supertype: str) -> str:\n target = 'supertype \"{}\"'.format(supertype)\n if name_in_super != name:\n target = '\"{}\" of {}'.format(name_in_super, target)\n return target\n\n def incompatible_type_application(self, expected_arg_count: int,\n actual_arg_count: int,\n context: Context) -> None:\n if expected_arg_count == 0:\n self.fail('Type application targets a non-generic function or class',\n context)\n elif actual_arg_count > expected_arg_count:\n self.fail('Type application has too many types ({} expected)'\n .format(expected_arg_count), context)\n else:\n self.fail('Type application has too few types ({} expected)'\n .format(expected_arg_count), context)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.could_not_infer_type_arguments_MessageBuilder.undefined_in_superclass.self_fail_undefined": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.could_not_infer_type_arguments_MessageBuilder.undefined_in_superclass.self_fail_undefined", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 836, "end_line": 860, "span_ids": ["MessageBuilder.undefined_in_superclass", "MessageBuilder.could_not_infer_type_arguments", "MessageBuilder.invalid_var_arg", "MessageBuilder.invalid_keyword_var_arg"], "tokens": 262}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MessageBuilder:\n\n def could_not_infer_type_arguments(self, callee_type: CallableType, n: int,\n context: Context) -> None:\n callee_name = callable_name(callee_type)\n if callee_name is not None and n > 0:\n self.fail('Cannot infer type argument {} of {}'.format(n, callee_name), context)\n else:\n self.fail('Cannot infer function type argument', context)\n\n def invalid_var_arg(self, typ: Type, context: Context) -> None:\n self.fail('List or tuple expected as variable arguments', context)\n\n def invalid_keyword_var_arg(self, typ: Type, is_mapping: bool, context: Context) -> None:\n typ = get_proper_type(typ)\n if isinstance(typ, Instance) and is_mapping:\n self.fail('Keywords must be strings', context)\n else:\n suffix = ''\n if isinstance(typ, Instance):\n suffix = ', not {}'.format(format_type(typ))\n self.fail(\n 'Argument after ** must be a mapping{}'.format(suffix),\n context, code=codes.ARG_TYPE)\n\n def undefined_in_superclass(self, member: str, context: Context) -> None:\n self.fail('\"{}\" undefined in superclass'.format(member), context)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.first_argument_for_super_must_be_type_MessageBuilder.first_argument_for_super_must_be_type.self_fail_Argument_1_for": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.first_argument_for_super_must_be_type_MessageBuilder.first_argument_for_super_must_be_type.self_fail_Argument_1_for", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 862, "end_line": 871, "span_ids": ["MessageBuilder.first_argument_for_super_must_be_type"], "tokens": 120}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MessageBuilder:\n\n def first_argument_for_super_must_be_type(self, actual: Type, context: Context) -> None:\n actual = get_proper_type(actual)\n if isinstance(actual, Instance):\n # Don't include type of instance, because it can look confusingly like a type\n # object.\n type_str = 'a non-type instance'\n else:\n type_str = format_type(actual)\n self.fail('Argument 1 for \"super\" must be a type object; got {}'.format(type_str), context,\n code=codes.ARG_TYPE)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.too_few_string_formatting_arguments_MessageBuilder.base_class_definitions_incompatible.self_fail_Definition_of_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.too_few_string_formatting_arguments_MessageBuilder.base_class_definitions_incompatible.self_fail_Definition_of_", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 882, "end_line": 945, "span_ids": ["MessageBuilder.string_interpolation_with_star_and_key", "MessageBuilder.too_few_string_formatting_arguments", "MessageBuilder.requires_int_or_char", "MessageBuilder.no_formal_self", "MessageBuilder.string_interpolation_mixing_key_and_non_keys", "MessageBuilder.cannot_instantiate_abstract_class", "MessageBuilder.base_class_definitions_incompatible", "MessageBuilder.too_many_string_formatting_arguments", "MessageBuilder.incompatible_self_argument", "MessageBuilder.cannot_determine_type", "MessageBuilder.unsupported_placeholder", "MessageBuilder.cannot_determine_type_in_base", "MessageBuilder.key_not_in_mapping", "MessageBuilder.incompatible_conditional_function_def"], "tokens": 746}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MessageBuilder:\n\n def too_few_string_formatting_arguments(self, context: Context) -> None:\n self.fail('Not enough arguments for format string', context,\n code=codes.STRING_FORMATTING)\n\n def too_many_string_formatting_arguments(self, context: Context) -> None:\n self.fail('Not all arguments converted during string formatting', context,\n code=codes.STRING_FORMATTING)\n\n def unsupported_placeholder(self, placeholder: str, context: Context) -> None:\n self.fail('Unsupported format character \\'%s\\'' % placeholder, context,\n code=codes.STRING_FORMATTING)\n\n def string_interpolation_with_star_and_key(self, context: Context) -> None:\n self.fail('String interpolation contains both stars and mapping keys', context,\n code=codes.STRING_FORMATTING)\n\n def requires_int_or_char(self, context: Context,\n format_call: bool = False) -> None:\n self.fail('\"{}c\" requires int or char'.format(':' if format_call else '%'),\n context, code=codes.STRING_FORMATTING)\n\n def key_not_in_mapping(self, key: str, context: Context) -> None:\n self.fail('Key \\'%s\\' not found in mapping' % key, context,\n code=codes.STRING_FORMATTING)\n\n def string_interpolation_mixing_key_and_non_keys(self, context: Context) -> None:\n self.fail('String interpolation mixes specifier with and without mapping keys', context,\n code=codes.STRING_FORMATTING)\n\n def cannot_determine_type(self, name: str, context: Context) -> None:\n self.fail('Cannot determine type of \"%s\"' % name, context, code=codes.HAS_TYPE)\n\n def cannot_determine_type_in_base(self, name: str, base: str, context: Context) -> None:\n self.fail('Cannot determine type of \"%s\" in base class \"%s\"' % (name, base), context)\n\n def no_formal_self(self, name: str, item: CallableType, context: Context) -> None:\n self.fail('Attribute function \"%s\" with type %s does not accept self argument'\n % (name, format_type(item)), context)\n\n def incompatible_self_argument(self, name: str, arg: Type, sig: CallableType,\n is_classmethod: bool, context: Context) -> None:\n kind = 'class attribute function' if is_classmethod else 'attribute function'\n self.fail('Invalid self argument %s to %s \"%s\" with type %s'\n % (format_type(arg), kind, name, format_type(sig)), context)\n\n def incompatible_conditional_function_def(self, defn: FuncDef) -> None:\n self.fail('All conditional function variants must have identical '\n 'signatures', defn)\n\n def cannot_instantiate_abstract_class(self, class_name: str,\n abstract_attributes: List[str],\n context: Context) -> None:\n attrs = format_string_list(['\"%s\"' % a for a in abstract_attributes])\n self.fail('Cannot instantiate abstract class \"%s\" with abstract '\n 'attribute%s %s' % (class_name, plural_s(abstract_attributes),\n attrs),\n context, code=codes.ABSTRACT)\n\n def base_class_definitions_incompatible(self, name: str, base1: TypeInfo,\n base2: TypeInfo,\n context: Context) -> None:\n self.fail('Definition of \"{}\" in base class \"{}\" is incompatible '\n 'with definition in base class \"{}\"'.format(\n name, base1.name, base2.name), context)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.cant_assign_to_method_MessageBuilder.incompatible_typevar_value.self_fail_message_registr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.cant_assign_to_method_MessageBuilder.incompatible_typevar_value.self_fail_message_registr", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 938, "end_line": 979, "span_ids": ["MessageBuilder.read_only_property", "MessageBuilder.cant_assign_to_final", "MessageBuilder.cant_override_final", "MessageBuilder.cant_assign_to_classvar", "MessageBuilder.final_without_value", "MessageBuilder.protocol_members_cant_be_final", "MessageBuilder.final_cant_override_writable", "MessageBuilder.cant_assign_to_method", "MessageBuilder.incompatible_typevar_value"], "tokens": 445}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MessageBuilder:\n\n def cant_assign_to_method(self, context: Context) -> None:\n self.fail(message_registry.CANNOT_ASSIGN_TO_METHOD, context,\n code=codes.ASSIGNMENT)\n\n def cant_assign_to_classvar(self, name: str, context: Context) -> None:\n self.fail('Cannot assign to class variable \"%s\" via instance' % name, context)\n\n def final_cant_override_writable(self, name: str, ctx: Context) -> None:\n self.fail('Cannot override writable attribute \"{}\" with a final one'.format(name), ctx)\n\n def cant_override_final(self, name: str, base_name: str, ctx: Context) -> None:\n self.fail('Cannot override final attribute \"{}\"'\n ' (previously declared in base class \"{}\")'.format(name, base_name), ctx)\n\n def cant_assign_to_final(self, name: str, attr_assign: bool, ctx: Context) -> None:\n \"\"\"Warn about a prohibited assignment to a final attribute.\n\n Pass `attr_assign=True` if the assignment assigns to an attribute.\n \"\"\"\n kind = \"attribute\" if attr_assign else \"name\"\n self.fail('Cannot assign to final {} \"{}\"'.format(kind, unmangle(name)), ctx)\n\n def protocol_members_cant_be_final(self, ctx: Context) -> None:\n self.fail(\"Protocol member cannot be final\", ctx)\n\n def final_without_value(self, ctx: Context) -> None:\n self.fail(\"Final name must be initialized with a value\", ctx)\n\n def read_only_property(self, name: str, type: TypeInfo,\n context: Context) -> None:\n self.fail('Property \"{}\" defined in \"{}\" is read-only'.format(\n name, type.name), context)\n\n def incompatible_typevar_value(self,\n callee: CallableType,\n typ: Type,\n typevar_name: str,\n context: Context) -> None:\n self.fail(message_registry.INCOMPATIBLE_TYPEVAR_VALUE\n .format(typevar_name, callable_name(callee) or 'function', format_type(typ)),\n context,\n code=codes.TYPE_VAR)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.dangerous_comparison_MessageBuilder.dangerous_comparison.self_fail_message_format_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.dangerous_comparison_MessageBuilder.dangerous_comparison.self_fail_message_format_", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 981, "end_line": 987, "span_ids": ["MessageBuilder.dangerous_comparison"], "tokens": 133}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MessageBuilder:\n\n def dangerous_comparison(self, left: Type, right: Type, kind: str, ctx: Context) -> None:\n left_str = 'element' if kind == 'container' else 'left operand'\n right_str = 'container item' if kind == 'container' else 'right operand'\n message = 'Non-overlapping {} check ({} type: {}, {} type: {})'\n left_typ, right_typ = format_type_distinctly(left, right)\n self.fail(message.format(kind, left_str, left_typ, right_str, right_typ), ctx,\n code=codes.COMPARISON_OVERLAP)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.overload_inconsistently_applies_decorator_MessageBuilder.invalid_signature_for_special_method.self_fail_Invalid_signat": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.overload_inconsistently_applies_decorator_MessageBuilder.invalid_signature_for_special_method.self_fail_Invalid_signat", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 989, "end_line": 1056, "span_ids": ["MessageBuilder.overload_inconsistently_applies_decorator", "MessageBuilder.overloaded_signatures_overlap", "MessageBuilder.overloaded_signature_will_never_match", "MessageBuilder.operator_method_signatures_overlap", "MessageBuilder.forward_operator_not_callable", "MessageBuilder.overloaded_signatures_ret_specific", "MessageBuilder.yield_from_invalid_operand_type", "MessageBuilder.invalid_signature", "MessageBuilder.warn_operand_was_from_union", "MessageBuilder.warn_both_operands_are_from_unions", "MessageBuilder.overloaded_signatures_typevar_specific", "MessageBuilder.signatures_incompatible", "MessageBuilder.invalid_signature_for_special_method", "MessageBuilder.overloaded_signatures_arg_specific"], "tokens": 761}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MessageBuilder:\n\n def overload_inconsistently_applies_decorator(self, decorator: str, context: Context) -> None:\n self.fail(\n 'Overload does not consistently use the \"@{}\" '.format(decorator)\n + 'decorator on all function signatures.',\n context)\n\n def overloaded_signatures_overlap(self, index1: int, index2: int, context: Context) -> None:\n self.fail('Overloaded function signatures {} and {} overlap with '\n 'incompatible return types'.format(index1, index2), context)\n\n def overloaded_signature_will_never_match(self, index1: int, index2: int,\n context: Context) -> None:\n self.fail(\n 'Overloaded function signature {index2} will never be matched: '\n 'signature {index1}\\'s parameter type(s) are the same or broader'.format(\n index1=index1,\n index2=index2),\n context)\n\n def overloaded_signatures_typevar_specific(self, index: int, context: Context) -> None:\n self.fail('Overloaded function implementation cannot satisfy signature {} '.format(index) +\n 'due to inconsistencies in how they use type variables', context)\n\n def overloaded_signatures_arg_specific(self, index: int, context: Context) -> None:\n self.fail('Overloaded function implementation does not accept all possible arguments '\n 'of signature {}'.format(index), context)\n\n def overloaded_signatures_ret_specific(self, index: int, context: Context) -> None:\n self.fail('Overloaded function implementation cannot produce return type '\n 'of signature {}'.format(index), context)\n\n def warn_both_operands_are_from_unions(self, context: Context) -> None:\n self.note('Both left and right operands are unions', context, code=codes.OPERATOR)\n\n def warn_operand_was_from_union(self, side: str, original: Type, context: Context) -> None:\n self.note('{} operand is of type {}'.format(side, format_type(original)), context,\n code=codes.OPERATOR)\n\n def operator_method_signatures_overlap(\n self, reverse_class: TypeInfo, reverse_method: str, forward_class: Type,\n forward_method: str, context: Context) -> None:\n self.fail('Signatures of \"{}\" of \"{}\" and \"{}\" of {} '\n 'are unsafely overlapping'.format(\n reverse_method, reverse_class.name,\n forward_method, format_type(forward_class)),\n context)\n\n def forward_operator_not_callable(\n self, forward_method: str, context: Context) -> None:\n self.fail('Forward operator \"{}\" is not callable'.format(\n forward_method), context)\n\n def signatures_incompatible(self, method: str, other_method: str,\n context: Context) -> None:\n self.fail('Signatures of \"{}\" and \"{}\" are incompatible'.format(\n method, other_method), context)\n\n def yield_from_invalid_operand_type(self, expr: Type, context: Context) -> Type:\n text = format_type(expr) if format_type(expr) != 'object' else expr\n self.fail('\"yield from\" can\\'t be applied to {}'.format(text), context)\n return AnyType(TypeOfAny.from_error)\n\n def invalid_signature(self, func_type: Type, context: Context) -> None:\n self.fail('Invalid signature \"{}\"'.format(func_type), context)\n\n def invalid_signature_for_special_method(\n self, func_type: Type, context: Context, method_name: str) -> None:\n self.fail('Invalid signature \"{}\" for \"{}\"'.format(func_type, method_name), context)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.reveal_type_MessageBuilder.reveal_locals.for_line_in_.self_note_line_context_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.reveal_type_MessageBuilder.reveal_locals.for_line_in_.self_note_line_context_", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1067, "end_line": 1076, "span_ids": ["MessageBuilder.reveal_type", "MessageBuilder.reveal_locals"], "tokens": 150}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MessageBuilder:\n\n def reveal_type(self, typ: Type, context: Context) -> None:\n self.note('Revealed type is \"{}\"'.format(typ), context)\n\n def reveal_locals(self, type_map: Dict[str, Optional[Type]], context: Context) -> None:\n # To ensure that the output is predictable on Python < 3.6,\n # use an ordered dictionary sorted by variable name\n sorted_locals = OrderedDict(sorted(type_map.items(), key=lambda t: t[0]))\n self.note(\"Revealed local types are:\", context)\n for line in [' {}: {}'.format(k, v) for k, v in sorted_locals.items()]:\n self.note(line, context)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.unsupported_type_type_MessageBuilder.unimported_type_becomes_any.self_fail_becomes_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.unsupported_type_type_MessageBuilder.unimported_type_becomes_any.self_fail_becomes_", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1069, "end_line": 1078, "span_ids": ["MessageBuilder.unsupported_type_type", "MessageBuilder.unimported_type_becomes_any", "MessageBuilder.redundant_cast"], "tokens": 147}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MessageBuilder:\n\n def unsupported_type_type(self, item: Type, context: Context) -> None:\n self.fail('Cannot instantiate type \"Type[{}]\"'.format(format_type_bare(item)), context)\n\n def redundant_cast(self, typ: Type, context: Context) -> None:\n self.fail('Redundant cast to {}'.format(format_type(typ)), context,\n code=codes.REDUNDANT_CAST)\n\n def unimported_type_becomes_any(self, prefix: str, typ: Type, ctx: Context) -> None:\n self.fail(\"{} becomes {} due to an unfollowed import\".format(prefix, format_type(typ)),\n ctx, code=codes.NO_ANY_UNIMPORTED)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.need_annotation_for_var_MessageBuilder.explicit_any.self_fail_Explicit_Any_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.need_annotation_for_var_MessageBuilder.explicit_any.self_fail_Explicit_Any_", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1089, "end_line": 1115, "span_ids": ["MessageBuilder.need_annotation_for_var", "MessageBuilder.explicit_any"], "tokens": 309}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MessageBuilder:\n\n def need_annotation_for_var(self, node: SymbolNode, context: Context,\n python_version: Optional[Tuple[int, int]] = None) -> None:\n hint = ''\n has_variable_annotations = not python_version or python_version >= (3, 6)\n # Only gives hint if it's a variable declaration and the partial type is a builtin type\n if (python_version and isinstance(node, Var) and isinstance(node.type, PartialType) and\n node.type.type and node.type.type.fullname in reverse_builtin_aliases):\n alias = reverse_builtin_aliases[node.type.type.fullname]\n alias = alias.split('.')[-1]\n type_dec = ''\n if alias == 'Dict':\n type_dec = '{}, {}'.format(type_dec, type_dec)\n if has_variable_annotations:\n hint = ' (hint: \"{}: {}[{}] = ...\")'.format(node.name, alias, type_dec)\n else:\n hint = ' (hint: \"{} = ... # type: {}[{}]\")'.format(node.name, alias, type_dec)\n\n if has_variable_annotations:\n needed = 'annotation'\n else:\n needed = 'comment'\n\n self.fail('Need type {} for \"{}\"{}'.format(needed, unmangle(node.name), hint), context,\n code=codes.VAR_ANNOTATED)\n\n def explicit_any(self, ctx: Context) -> None:\n self.fail('Explicit \"Any\" is not allowed', ctx)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.unexpected_typeddict_keys_MessageBuilder.unexpected_typeddict_keys.self_fail_Expected_bu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.unexpected_typeddict_keys_MessageBuilder.unexpected_typeddict_keys.self_fail_Expected_bu", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1110, "end_line": 1144, "span_ids": ["MessageBuilder.unexpected_typeddict_keys"], "tokens": 335}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MessageBuilder:\n\n def unexpected_typeddict_keys(\n self,\n typ: TypedDictType,\n expected_keys: List[str],\n actual_keys: List[str],\n context: Context) -> None:\n actual_set = set(actual_keys)\n expected_set = set(expected_keys)\n if not typ.is_anonymous():\n # Generate simpler messages for some common special cases.\n if actual_set < expected_set:\n # Use list comprehension instead of set operations to preserve order.\n missing = [key for key in expected_keys if key not in actual_set]\n self.fail('Missing {} for TypedDict {}'.format(\n format_key_list(missing, short=True), format_type(typ)),\n context, code=codes.TYPEDDICT_ITEM)\n return\n else:\n extra = [key for key in actual_keys if key not in expected_set]\n if extra:\n # If there are both extra and missing keys, only report extra ones for\n # simplicity.\n self.fail('Extra {} for TypedDict {}'.format(\n format_key_list(extra, short=True), format_type(typ)),\n context, code=codes.TYPEDDICT_ITEM)\n return\n found = format_key_list(actual_keys, short=True)\n if not expected_keys:\n self.fail('Unexpected TypedDict {}'.format(found), context)\n return\n expected = format_key_list(expected_keys)\n if actual_keys and actual_set < expected_set:\n found = 'only {}'.format(found)\n self.fail('Expected {} but found {}'.format(expected, found), context,\n code=codes.TYPEDDICT_ITEM)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.typeddict_key_must_be_string_literal_MessageBuilder.typeddict_key_not_found.if_typ_is_anonymous_.else_.if_matches_.self_note_Did_you_mean_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.typeddict_key_must_be_string_literal_MessageBuilder.typeddict_key_not_found.if_typ_is_anonymous_.else_.if_matches_.self_note_Did_you_mean_", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1162, "end_line": 1184, "span_ids": ["MessageBuilder.typeddict_key_must_be_string_literal", "MessageBuilder.typeddict_key_not_found"], "tokens": 216}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MessageBuilder:\n\n def typeddict_key_must_be_string_literal(\n self,\n typ: TypedDictType,\n context: Context) -> None:\n self.fail(\n 'TypedDict key must be a string literal; expected one of {}'.format(\n format_item_name_list(typ.items.keys())), context)\n\n def typeddict_key_not_found(\n self,\n typ: TypedDictType,\n item_name: str,\n context: Context) -> None:\n if typ.is_anonymous():\n self.fail('\"{}\" is not a valid TypedDict key; expected one of {}'.format(\n item_name, format_item_name_list(typ.items.keys())), context)\n else:\n self.fail('TypedDict {} has no key \"{}\"'.format(\n format_type(typ), item_name), context, code=codes.TYPEDDICT_ITEM)\n matches = best_matches(item_name, typ.items.keys())\n if matches:\n self.note(\"Did you mean {}?\".format(\n pretty_seq(matches[:3], \"or\")), context)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.typeddict_context_ambiguous_MessageBuilder.incorrectly_returning_any.self_fail_message_contex": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.typeddict_context_ambiguous_MessageBuilder.incorrectly_returning_any.self_fail_message_contex", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1186, "end_line": 1229, "span_ids": ["MessageBuilder.typeddict_context_ambiguous", "MessageBuilder.incorrectly_returning_any", "MessageBuilder.typeddict_key_cannot_be_deleted", "MessageBuilder.typeddict_setdefault_arguments_inconsistent", "MessageBuilder.disallowed_any_type", "MessageBuilder.type_arguments_not_allowed"], "tokens": 407}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MessageBuilder:\n\n def typeddict_context_ambiguous(\n self,\n types: List[TypedDictType],\n context: Context) -> None:\n formatted_types = ', '.join(list(format_type_distinctly(*types)))\n self.fail('Type of TypedDict is ambiguous, could be any of ({})'.format(\n formatted_types), context)\n\n def typeddict_key_cannot_be_deleted(\n self,\n typ: TypedDictType,\n item_name: str,\n context: Context) -> None:\n if typ.is_anonymous():\n self.fail('TypedDict key \"{}\" cannot be deleted'.format(item_name),\n context)\n else:\n self.fail('Key \"{}\" of TypedDict {} cannot be deleted'.format(\n item_name, format_type(typ)), context)\n\n def typeddict_setdefault_arguments_inconsistent(\n self,\n default: Type,\n expected: Type,\n context: Context) -> None:\n msg = 'Argument 2 to \"setdefault\" of \"TypedDict\" has incompatible type {}; expected {}'\n self.fail(msg.format(format_type(default), format_type(expected)), context,\n code=codes.TYPEDDICT_ITEM)\n\n def type_arguments_not_allowed(self, context: Context) -> None:\n self.fail('Parameterized generics cannot be used with class or instance checks', context)\n\n def disallowed_any_type(self, typ: Type, context: Context) -> None:\n typ = get_proper_type(typ)\n if isinstance(typ, AnyType):\n message = 'Expression has type \"Any\"'\n else:\n message = 'Expression type contains \"Any\" (has type {})'.format(format_type(typ))\n self.fail(message, context)\n\n def incorrectly_returning_any(self, typ: Type, context: Context) -> None:\n message = 'Returning Any from function declared to return {}'.format(\n format_type(typ))\n self.fail(message, context, code=codes.NO_ANY_RETURN)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.incorrect__exit__return_MessageBuilder.incorrect__exit__return.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.incorrect__exit__return_MessageBuilder.incorrect__exit__return.None_2", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1211, "end_line": 1221, "span_ids": ["MessageBuilder.incorrect__exit__return"], "tokens": 127}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MessageBuilder:\n\n def incorrect__exit__return(self, context: Context) -> None:\n self.fail(\n '\"bool\" is invalid as return type for \"__exit__\" that always returns False', context,\n code=codes.EXIT_RETURN)\n self.note(\n 'Use \"typing_extensions.Literal[False]\" as the return type or change it to \"None\"',\n context, code=codes.EXIT_RETURN)\n self.note(\n 'If return type of \"__exit__\" implies that it may return True, '\n 'the context manager may swallow exceptions',\n context, code=codes.EXIT_RETURN)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.untyped_decorated_function_MessageBuilder.redundant_condition_in_comprehension.self_redundant_expr_If_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.untyped_decorated_function_MessageBuilder.redundant_condition_in_comprehension.self_redundant_expr_If_c", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1234, "end_line": 1303, "span_ids": ["MessageBuilder.concrete_only_call", "MessageBuilder.bad_proto_variance", "MessageBuilder.cannot_use_function_with_type", "MessageBuilder.unreachable_right_operand", "MessageBuilder.redundant_condition_in_comprehension", "MessageBuilder.typed_function_untyped_decorator", "MessageBuilder.report_non_method_protocol", "MessageBuilder.unreachable_statement", "MessageBuilder.untyped_decorated_function", "MessageBuilder.concrete_only_assign", "MessageBuilder.note_call", "MessageBuilder.redundant_left_operand"], "tokens": 761}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MessageBuilder:\n\n def untyped_decorated_function(self, typ: Type, context: Context) -> None:\n typ = get_proper_type(typ)\n if isinstance(typ, AnyType):\n self.fail(\"Function is untyped after decorator transformation\", context)\n else:\n self.fail('Type of decorated function contains type \"Any\" ({})'.format(\n format_type(typ)), context)\n\n def typed_function_untyped_decorator(self, func_name: str, context: Context) -> None:\n self.fail('Untyped decorator makes function \"{}\" untyped'.format(func_name), context)\n\n def bad_proto_variance(self, actual: int, tvar_name: str, expected: int,\n context: Context) -> None:\n msg = capitalize('{} type variable \"{}\" used in protocol where'\n ' {} one is expected'.format(variance_string(actual),\n tvar_name,\n variance_string(expected)))\n self.fail(msg, context)\n\n def concrete_only_assign(self, typ: Type, context: Context) -> None:\n self.fail(\"Can only assign concrete classes to a variable of type {}\"\n .format(format_type(typ)), context)\n\n def concrete_only_call(self, typ: Type, context: Context) -> None:\n self.fail(\"Only concrete class can be given where {} is expected\"\n .format(format_type(typ)), context)\n\n def cannot_use_function_with_type(\n self, method_name: str, type_name: str, context: Context) -> None:\n self.fail(\"Cannot use {}() with {} type\".format(method_name, type_name), context)\n\n def report_non_method_protocol(self, tp: TypeInfo, members: List[str],\n context: Context) -> None:\n self.fail(\"Only protocols that don't have non-method members can be\"\n \" used with issubclass()\", context)\n if len(members) < 3:\n attrs = ', '.join(members)\n self.note('Protocol \"{}\" has non-method member(s): {}'\n .format(tp.name, attrs), context)\n\n def note_call(self,\n subtype: Type,\n call: Type,\n context: Context,\n *,\n code: Optional[ErrorCode]) -> None:\n self.note('\"{}.__call__\" has type {}'.format(format_type_bare(subtype),\n format_type(call, verbosity=1)),\n context, code=code)\n\n def unreachable_statement(self, context: Context) -> None:\n self.fail(\"Statement is unreachable\", context, code=codes.UNREACHABLE)\n\n def redundant_left_operand(self, op_name: str, context: Context) -> None:\n \"\"\"Indicates that the left operand of a boolean expression is redundant:\n it does not change the truth value of the entire condition as a whole.\n 'op_name' should either be the string \"and\" or the string \"or\".\n \"\"\"\n self.redundant_expr('Left operand of \"{}\"'.format(op_name), op_name == 'and', context)\n\n def unreachable_right_operand(self, op_name: str, context: Context) -> None:\n \"\"\"Indicates that the right operand of a boolean expression is redundant:\n it does not change the truth value of the entire condition as a whole.\n 'op_name' should either be the string \"and\" or the string \"or\".\n \"\"\"\n self.fail('Right operand of \"{}\" is never evaluated'.format(op_name),\n context, code=codes.UNREACHABLE)\n\n def redundant_condition_in_comprehension(self, truthiness: bool, context: Context) -> None:\n self.redundant_expr(\"If condition in comprehension\", truthiness, context)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.redundant_condition_in_if_MessageBuilder.impossible_intersection.self_fail_template_format": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.redundant_condition_in_if_MessageBuilder.impossible_intersection.self_fail_template_format", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1294, "end_line": 1311, "span_ids": ["MessageBuilder.redundant_condition_in_if", "MessageBuilder.redundant_condition_in_assert", "MessageBuilder.redundant_expr", "MessageBuilder.impossible_intersection"], "tokens": 195}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MessageBuilder:\n\n def redundant_condition_in_if(self, truthiness: bool, context: Context) -> None:\n self.redundant_expr(\"If condition\", truthiness, context)\n\n def redundant_condition_in_assert(self, truthiness: bool, context: Context) -> None:\n self.redundant_expr(\"Condition in assert\", truthiness, context)\n\n def redundant_expr(self, description: str, truthiness: bool, context: Context) -> None:\n self.fail(\"{} is always {}\".format(description, str(truthiness).lower()),\n context, code=codes.REDUNDANT_EXPR)\n\n def impossible_intersection(self,\n formatted_base_class_list: str,\n reason: str,\n context: Context,\n ) -> None:\n template = \"Subclass of {} cannot exist: would have {}\"\n self.fail(template.format(formatted_base_class_list, reason), context,\n code=codes.UNREACHABLE)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.report_protocol_problems_MessageBuilder.report_protocol_problems.conflict_types.get_conflict_protocol_typ": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.report_protocol_problems_MessageBuilder.report_protocol_problems.conflict_types.get_conflict_protocol_typ", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1324, "end_line": 1374, "span_ids": ["MessageBuilder.report_protocol_problems"], "tokens": 535}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MessageBuilder:\n\n def report_protocol_problems(self,\n subtype: Union[Instance, TupleType, TypedDictType],\n supertype: Instance,\n context: Context,\n *,\n code: Optional[ErrorCode]) -> None:\n \"\"\"Report possible protocol conflicts between 'subtype' and 'supertype'.\n\n This includes missing members, incompatible types, and incompatible\n attribute flags, such as settable vs read-only or class variable vs\n instance variable.\n \"\"\"\n OFFSET = 4 # Four spaces, so that notes will look like this:\n # note: 'Cls' is missing following 'Proto' members:\n # note: method, attr\n MAX_ITEMS = 2 # Maximum number of conflicts, missing members, and overloads shown\n # List of special situations where we don't want to report additional problems\n exclusions = {TypedDictType: ['typing.Mapping'],\n TupleType: ['typing.Iterable', 'typing.Sequence'],\n Instance: []} # type: Dict[type, List[str]]\n if supertype.type.fullname in exclusions[type(subtype)]:\n return\n if any(isinstance(tp, UninhabitedType) for tp in get_proper_types(supertype.args)):\n # We don't want to add notes for failed inference (e.g. Iterable[]).\n # This will be only confusing a user even more.\n return\n\n if isinstance(subtype, TupleType):\n if not isinstance(subtype.partial_fallback, Instance):\n return\n subtype = subtype.partial_fallback\n elif isinstance(subtype, TypedDictType):\n if not isinstance(subtype.fallback, Instance):\n return\n subtype = subtype.fallback\n\n # Report missing members\n missing = get_missing_protocol_members(subtype, supertype)\n if (missing and len(missing) < len(supertype.type.protocol_members) and\n len(missing) <= MAX_ITEMS):\n self.note('\"{}\" is missing following \"{}\" protocol member{}:'\n .format(subtype.type.name, supertype.type.name, plural_s(missing)),\n context,\n code=code)\n self.note(', '.join(missing), context, offset=OFFSET, code=code)\n elif len(missing) > MAX_ITEMS or len(missing) == len(supertype.type.protocol_members):\n # This is an obviously wrong type: too many missing members\n return\n\n # Report member type conflicts\n conflict_types = get_conflict_protocol_types(subtype, supertype)\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.report_protocol_problems.if_conflict_types_and_no_MessageBuilder.report_protocol_problems.self_print_more_conflict_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.report_protocol_problems.if_conflict_types_and_no_MessageBuilder.report_protocol_problems.self_print_more_conflict_", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1364, "end_line": 1419, "span_ids": ["MessageBuilder.report_protocol_problems"], "tokens": 675}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MessageBuilder:\n\n def report_protocol_problems(self,\n subtype: Union[Instance, TupleType, TypedDictType],\n supertype: Instance,\n context: Context,\n *,\n code: Optional[ErrorCode]) -> None:\n # ... other code\n if conflict_types and (not is_subtype(subtype, erase_type(supertype)) or\n not subtype.type.defn.type_vars or\n not supertype.type.defn.type_vars):\n self.note('Following member(s) of {} have '\n 'conflicts:'.format(format_type(subtype)),\n context,\n code=code)\n for name, got, exp in conflict_types[:MAX_ITEMS]:\n exp = get_proper_type(exp)\n got = get_proper_type(got)\n if (not isinstance(exp, (CallableType, Overloaded)) or\n not isinstance(got, (CallableType, Overloaded))):\n self.note('{}: expected {}, got {}'.format(name,\n *format_type_distinctly(exp, got)),\n context,\n offset=OFFSET,\n code=code)\n else:\n self.note('Expected:', context, offset=OFFSET, code=code)\n if isinstance(exp, CallableType):\n self.note(pretty_callable(exp), context, offset=2 * OFFSET, code=code)\n else:\n assert isinstance(exp, Overloaded)\n self.pretty_overload(exp, context, OFFSET, MAX_ITEMS, code=code)\n self.note('Got:', context, offset=OFFSET, code=code)\n if isinstance(got, CallableType):\n self.note(pretty_callable(got), context, offset=2 * OFFSET, code=code)\n else:\n assert isinstance(got, Overloaded)\n self.pretty_overload(got, context, OFFSET, MAX_ITEMS, code=code)\n self.print_more(conflict_types, context, OFFSET, MAX_ITEMS, code=code)\n\n # Report flag conflicts (i.e. settable vs read-only etc.)\n conflict_flags = get_bad_protocol_flags(subtype, supertype)\n for name, subflags, superflags in conflict_flags[:MAX_ITEMS]:\n if IS_CLASSVAR in subflags and IS_CLASSVAR not in superflags:\n self.note('Protocol member {}.{} expected instance variable,'\n ' got class variable'.format(supertype.type.name, name),\n context,\n code=code)\n if IS_CLASSVAR in superflags and IS_CLASSVAR not in subflags:\n self.note('Protocol member {}.{} expected class variable,'\n ' got instance variable'.format(supertype.type.name, name),\n context,\n code=code)\n if IS_SETTABLE in superflags and IS_SETTABLE not in subflags:\n self.note('Protocol member {}.{} expected settable variable,'\n ' got read-only attribute'.format(supertype.type.name, name),\n context,\n code=code)\n if IS_CLASS_OR_STATIC in superflags and IS_CLASS_OR_STATIC not in subflags:\n self.note('Protocol member {}.{} expected class or static method'\n .format(supertype.type.name, name),\n context,\n code=code)\n self.print_more(conflict_flags, context, OFFSET, MAX_ITEMS, code=code)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.pretty_overload_MessageBuilder.pretty_overload.if_left_0_.self_note_msg_context_o": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.pretty_overload_MessageBuilder.pretty_overload.if_left_0_.self_note_msg_context_o", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1421, "end_line": 1434, "span_ids": ["MessageBuilder.pretty_overload"], "tokens": 151}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MessageBuilder:\n\n def pretty_overload(self,\n tp: Overloaded,\n context: Context,\n offset: int,\n max_items: int,\n *,\n code: Optional[ErrorCode] = None) -> None:\n for item in tp.items()[:max_items]:\n self.note('@overload', context, offset=2 * offset, code=code)\n self.note(pretty_callable(item), context, offset=2 * offset, code=code)\n left = len(tp.items()) - max_items\n if left > 0:\n msg = '<{} more overload{} not shown>'.format(left, plural_s(left))\n self.note(msg, context, offset=2 * offset, code=code)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.pretty_overload_matches_MessageBuilder.print_more.if_len_conflicts_max_i.self_note_more_confl": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.pretty_overload_matches_MessageBuilder.print_more.if_len_conflicts_max_i.self_note_more_confl", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1436, "end_line": 1482, "span_ids": ["MessageBuilder.pretty_overload_matches", "MessageBuilder.print_more"], "tokens": 424}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MessageBuilder:\n\n def pretty_overload_matches(self,\n targets: List[CallableType],\n func: Overloaded,\n context: Context,\n offset: int,\n max_items: int,\n code: ErrorCode) -> None:\n if not targets:\n targets = func.items()\n\n shown = min(max_items, len(targets))\n max_matching = len(targets)\n max_available = len(func.items())\n\n # If there are 3 matches but max_items == 2, we might as well show\n # all three items instead of having the 3rd item be an error message.\n if shown + 1 == max_matching:\n shown = max_matching\n\n self.note('Possible overload variant{}:'.format(plural_s(shown)), context, code=code)\n for item in targets[:shown]:\n self.note(pretty_callable(item), context, offset=2 * offset, code=code)\n\n assert shown <= max_matching <= max_available\n if shown < max_matching <= max_available:\n left = max_matching - shown\n msg = '<{} more similar overload{} not shown, out of {} total overloads>'.format(\n left, plural_s(left), max_available)\n self.note(msg, context, offset=2 * offset, code=code)\n elif shown == max_matching < max_available:\n left = max_available - shown\n msg = '<{} more non-matching overload{} not shown>'.format(left, plural_s(left))\n self.note(msg, context, offset=2 * offset, code=code)\n else:\n assert shown == max_matching == max_available\n\n def print_more(self,\n conflicts: Sequence[Any],\n context: Context,\n offset: int,\n max_items: int,\n *,\n code: Optional[ErrorCode] = None) -> None:\n if len(conflicts) > max_items:\n self.note('<{} more conflict(s) not shown>'\n .format(len(conflicts) - max_items),\n context, offset=offset, code=code)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.try_report_long_tuple_assignment_error_MessageBuilder.try_report_long_tuple_assignment_error.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.try_report_long_tuple_assignment_error_MessageBuilder.try_report_long_tuple_assignment_error.return.False", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1484, "end_line": 1518, "span_ids": ["MessageBuilder.try_report_long_tuple_assignment_error"], "tokens": 358}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MessageBuilder:\n\n def try_report_long_tuple_assignment_error(self,\n subtype: ProperType,\n supertype: ProperType,\n context: Context,\n msg: str = message_registry.INCOMPATIBLE_TYPES,\n subtype_label: Optional[str] = None,\n supertype_label: Optional[str] = None,\n code: Optional[ErrorCode] = None) -> bool:\n \"\"\"Try to generate meaningful error message for very long tuple assignment\n\n Returns a bool: True when generating long tuple assignment error,\n False when no such error reported\n \"\"\"\n if isinstance(subtype, TupleType):\n if (len(subtype.items) > 10 and\n isinstance(supertype, Instance) and\n supertype.type.fullname == 'builtins.tuple'):\n lhs_type = supertype.args[0]\n lhs_types = [lhs_type] * len(subtype.items)\n self.generate_incompatible_tuple_error(lhs_types,\n subtype.items, context, msg, code)\n return True\n elif (isinstance(supertype, TupleType) and\n (len(subtype.items) > 10 or len(supertype.items) > 10)):\n if len(subtype.items) != len(supertype.items):\n if supertype_label is not None and subtype_label is not None:\n error_msg = \"{} ({} {}, {} {})\".format(msg, subtype_label,\n self.format_long_tuple_type(subtype), supertype_label,\n self.format_long_tuple_type(supertype))\n self.fail(error_msg, context, code=code)\n return True\n self.generate_incompatible_tuple_error(supertype.items,\n subtype.items, context, msg, code)\n return True\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.format_long_tuple_type_MessageBuilder.add_fixture_note.if_fullname_in_SUGGESTED_.self_note_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.format_long_tuple_type_MessageBuilder.add_fixture_note.if_fullname_in_SUGGESTED_.self_note_", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1520, "end_line": 1560, "span_ids": ["MessageBuilder.format_long_tuple_type", "MessageBuilder.add_fixture_note", "MessageBuilder.generate_incompatible_tuple_error"], "tokens": 443}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MessageBuilder:\n\n def format_long_tuple_type(self, typ: TupleType) -> str:\n \"\"\"Format very long tuple type using an ellipsis notation\"\"\"\n item_cnt = len(typ.items)\n if item_cnt > 10:\n return 'Tuple[{}, {}, ... <{} more items>]'\\\n .format(format_type_bare(typ.items[0]),\n format_type_bare(typ.items[1]), str(item_cnt - 2))\n else:\n return format_type_bare(typ)\n\n def generate_incompatible_tuple_error(self,\n lhs_types: List[Type],\n rhs_types: List[Type],\n context: Context,\n msg: str = message_registry.INCOMPATIBLE_TYPES,\n code: Optional[ErrorCode] = None) -> None:\n \"\"\"Generate error message for individual incompatible tuple pairs\"\"\"\n error_cnt = 0\n notes = [] # List[str]\n for i, (lhs_t, rhs_t) in enumerate(zip(lhs_types, rhs_types)):\n if not is_subtype(lhs_t, rhs_t):\n if error_cnt < 3:\n notes.append('Expression tuple item {} has type \"{}\"; \"{}\" expected; '\n .format(str(i), format_type_bare(rhs_t), format_type_bare(lhs_t)))\n error_cnt += 1\n\n error_msg = msg + ' ({} tuple items are incompatible'.format(str(error_cnt))\n if error_cnt - 3 > 0:\n error_msg += '; {} items are omitted)'.format(str(error_cnt - 3))\n else:\n error_msg += ')'\n self.fail(error_msg, context, code=code)\n for note in notes:\n self.note(note, context, code=code)\n\n def add_fixture_note(self, fullname: str, ctx: Context) -> None:\n self.note('Maybe your test fixture does not define \"{}\"?'.format(fullname), ctx)\n if fullname in SUGGESTED_TEST_FIXTURES:\n self.note(\n 'Consider adding [builtins fixtures/{}] to your test description'.format(\n SUGGESTED_TEST_FIXTURES[fullname]), ctx)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_quote_type_string_quote_type_string.return._format_type_string": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_quote_type_string_quote_type_string.return._format_type_string", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1563, "end_line": 1571, "span_ids": ["quote_type_string"], "tokens": 125}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def quote_type_string(type_string: str) -> str:\n \"\"\"Quotes a type representation for use in messages.\"\"\"\n no_quote_regex = r'^<(tuple|union): \\d+ items>$'\n if (type_string in ['Module', 'overloaded function', '', '']\n or re.match(no_quote_regex, type_string) is not None or type_string.endswith('?')):\n # Messages are easier to read if these aren't quoted. We use a\n # regex to match strings with variable contents.\n return type_string\n return '\"{}\"'.format(type_string)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_format_type_inner_format_type_inner.if_isinstance_typ_Instan.else_.return._object_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_format_type_inner_format_type_inner.if_isinstance_typ_Instan.else_.return._object_", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1574, "end_line": 1716, "span_ids": ["format_type_inner"], "tokens": 1273}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def format_type_inner(typ: Type,\n verbosity: int,\n fullnames: Optional[Set[str]]) -> str:\n \"\"\"\n Convert a type to a relatively short string suitable for error messages.\n\n Args:\n verbosity: a coarse grained control on the verbosity of the type\n fullnames: a set of names that should be printed in full\n \"\"\"\n def format(typ: Type) -> str:\n return format_type_inner(typ, verbosity, fullnames)\n\n # TODO: show type alias names in errors.\n typ = get_proper_type(typ)\n\n if isinstance(typ, Instance):\n itype = typ\n # Get the short name of the type.\n if itype.type.fullname in ('types.ModuleType', '_importlib_modulespec.ModuleType'):\n # Make some common error messages simpler and tidier.\n return 'Module'\n if verbosity >= 2 or (fullnames and itype.type.fullname in fullnames):\n base_str = itype.type.fullname\n else:\n base_str = itype.type.name\n if not itype.args:\n # No type arguments, just return the type name\n return base_str\n elif itype.type.fullname == 'builtins.tuple':\n item_type_str = format(itype.args[0])\n return 'Tuple[{}, ...]'.format(item_type_str)\n elif itype.type.fullname in reverse_builtin_aliases:\n alias = reverse_builtin_aliases[itype.type.fullname]\n alias = alias.split('.')[-1]\n items = [format(arg) for arg in itype.args]\n return '{}[{}]'.format(alias, ', '.join(items))\n else:\n # There are type arguments. Convert the arguments to strings.\n a = [] # type: List[str]\n for arg in itype.args:\n a.append(format(arg))\n s = ', '.join(a)\n return '{}[{}]'.format(base_str, s)\n elif isinstance(typ, TypeVarType):\n # This is similar to non-generic instance types.\n return typ.name\n elif isinstance(typ, TupleType):\n # Prefer the name of the fallback class (if not tuple), as it's more informative.\n if typ.partial_fallback.type.fullname != 'builtins.tuple':\n return format(typ.partial_fallback)\n items = []\n for t in typ.items:\n items.append(format(t))\n s = 'Tuple[{}]'.format(', '.join(items))\n return s\n elif isinstance(typ, TypedDictType):\n # If the TypedDictType is named, return the name\n if not typ.is_anonymous():\n return format(typ.fallback)\n items = []\n for (item_name, item_type) in typ.items.items():\n modifier = '' if item_name in typ.required_keys else '?'\n items.append('{!r}{}: {}'.format(item_name,\n modifier,\n format(item_type)))\n s = 'TypedDict({{{}}})'.format(', '.join(items))\n return s\n elif isinstance(typ, LiteralType):\n if typ.is_enum_literal():\n underlying_type = format(typ.fallback)\n return 'Literal[{}.{}]'.format(underlying_type, typ.value)\n else:\n return str(typ)\n elif isinstance(typ, UnionType):\n # Only print Unions as Optionals if the Optional wouldn't have to contain another Union\n print_as_optional = (len(typ.items) -\n sum(isinstance(get_proper_type(t), NoneType)\n for t in typ.items) == 1)\n if print_as_optional:\n rest = [t for t in typ.items if not isinstance(get_proper_type(t), NoneType)]\n return 'Optional[{}]'.format(format(rest[0]))\n else:\n items = []\n for t in typ.items:\n items.append(format(t))\n s = 'Union[{}]'.format(', '.join(items))\n return s\n elif isinstance(typ, NoneType):\n return 'None'\n elif isinstance(typ, AnyType):\n return 'Any'\n elif isinstance(typ, DeletedType):\n return ''\n elif isinstance(typ, UninhabitedType):\n if typ.is_noreturn:\n return 'NoReturn'\n else:\n return ''\n elif isinstance(typ, TypeType):\n return 'Type[{}]'.format(format(typ.item))\n elif isinstance(typ, FunctionLike):\n func = typ\n if func.is_type_obj():\n # The type of a type object type can be derived from the\n # return type (this always works).\n return format(TypeType.make_normalized(erase_type(func.items()[0].ret_type)))\n elif isinstance(func, CallableType):\n return_type = format(func.ret_type)\n if func.is_ellipsis_args:\n return 'Callable[..., {}]'.format(return_type)\n arg_strings = []\n for arg_name, arg_type, arg_kind in zip(\n func.arg_names, func.arg_types, func.arg_kinds):\n if (arg_kind == ARG_POS and arg_name is None\n or verbosity == 0 and arg_kind in (ARG_POS, ARG_OPT)):\n\n arg_strings.append(format(arg_type))\n else:\n constructor = ARG_CONSTRUCTOR_NAMES[arg_kind]\n if arg_kind in (ARG_STAR, ARG_STAR2) or arg_name is None:\n arg_strings.append(\"{}({})\".format(\n constructor,\n format(arg_type)))\n else:\n arg_strings.append(\"{}({}, {})\".format(\n constructor,\n format(arg_type),\n repr(arg_name)))\n\n return 'Callable[[{}], {}]'.format(\", \".join(arg_strings), return_type)\n else:\n # Use a simple representation for function types; proper\n # function types may result in long and difficult-to-read\n # error messages.\n return 'overloaded function'\n elif isinstance(typ, UnboundType):\n return str(typ)\n elif typ is None:\n raise RuntimeError('Type is None')\n else:\n # Default case; we simply have to return something meaningful here.\n return 'object'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_collect_all_instances_CollectAllInstancesQuery.visit_instance.super_visit_instance_t_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_collect_all_instances_CollectAllInstancesQuery.visit_instance.super_visit_instance_t_", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1719, "end_line": 1736, "span_ids": ["CollectAllInstancesQuery", "CollectAllInstancesQuery.__init__", "collect_all_instances", "CollectAllInstancesQuery.visit_instance"], "tokens": 134}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def collect_all_instances(t: Type) -> List[Instance]:\n \"\"\"Return all instances that `t` contains (including `t`).\n\n This is similar to collect_all_inner_types from typeanal but only\n returns instances and will recurse into fallbacks.\n \"\"\"\n visitor = CollectAllInstancesQuery()\n t.accept(visitor)\n return visitor.instances\n\n\nclass CollectAllInstancesQuery(TypeTraverserVisitor):\n def __init__(self) -> None:\n self.instances = [] # type: List[Instance]\n\n def visit_instance(self, t: Instance) -> None:\n self.instances.append(t)\n super().visit_instance(t)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_find_type_overlaps_find_type_overlaps.return.overlaps": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_find_type_overlaps_find_type_overlaps.return.overlaps", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1739, "end_line": 1757, "span_ids": ["find_type_overlaps"], "tokens": 182}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def find_type_overlaps(*types: Type) -> Set[str]:\n \"\"\"Return a set of fullnames that share a short name and appear in either type.\n\n This is used to ensure that distinct types with the same short name are printed\n with their fullname.\n \"\"\"\n d = {} # type: Dict[str, Set[str]]\n for type in types:\n for inst in collect_all_instances(type):\n d.setdefault(inst.type.name, set()).add(inst.type.fullname)\n for shortname in d.keys():\n if 'typing.{}'.format(shortname) in TYPES_FOR_UNIMPORTED_HINTS:\n d[shortname].add('typing.{}'.format(shortname))\n\n overlaps = set() # type: Set[str]\n for fullnames in d.values():\n if len(fullnames) > 1:\n overlaps.update(fullnames)\n return overlaps", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_format_type_format_type.return.quote_type_string_format_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_format_type_format_type.return.quote_type_string_format_", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1760, "end_line": 1771, "span_ids": ["format_type"], "tokens": 115}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def format_type(typ: Type, verbosity: int = 0) -> str:\n \"\"\"\n Convert a type to a relatively short string suitable for error messages.\n\n `verbosity` is a coarse grained control on the verbosity of the type\n\n This function returns a string appropriate for unmodified use in error\n messages; this means that it will be quoted in most cases. If\n modification of the formatted string is required, callers should use\n format_type_bare.\n \"\"\"\n return quote_type_string(format_type_bare(typ, verbosity))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_format_type_bare_format_type_bare.return.format_type_inner_typ_ve": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_format_type_bare_format_type_bare.return.format_type_inner_typ_ve", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1774, "end_line": 1788, "span_ids": ["format_type_bare"], "tokens": 161}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def format_type_bare(typ: Type,\n verbosity: int = 0,\n fullnames: Optional[Set[str]] = None) -> str:\n \"\"\"\n Convert a type to a relatively short string suitable for error messages.\n\n `verbosity` is a coarse grained control on the verbosity of the type\n `fullnames` specifies a set of names that should be printed in full\n\n This function will return an unquoted string. If a caller doesn't need to\n perform post-processing on the string output, format_type should be used\n instead. (The caller may want to use quote_type_string after\n processing has happened, to maintain consistent quoting in messages.)\n \"\"\"\n return format_type_inner(typ, verbosity, find_type_overlaps(typ))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_format_type_distinctly_format_type_distinctly.if_bare_.else_.return.tuple_quote_type_string_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_format_type_distinctly_format_type_distinctly.if_bare_.else_.return.tuple_quote_type_string_s", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1791, "end_line": 1814, "span_ids": ["format_type_distinctly"], "tokens": 219}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def format_type_distinctly(*types: Type, bare: bool = False) -> Tuple[str, ...]:\n \"\"\"Jointly format types to distinct strings.\n\n Increase the verbosity of the type strings until they become distinct\n while also requiring that distinct types with the same short name are\n formatted distinctly.\n\n By default, the returned strings are created using format_type() and will be\n quoted accordingly. If ``bare`` is True, the returned strings will not\n be quoted; callers who need to do post-processing of the strings before\n quoting them (such as prepending * or **) should use this.\n \"\"\"\n overlapping = find_type_overlaps(*types)\n for verbosity in range(2):\n strs = [\n format_type_inner(type, verbosity=verbosity, fullnames=overlapping)\n for type in types\n ]\n if len(set(strs)) == len(strs):\n break\n if bare:\n return tuple(strs)\n else:\n return tuple(quote_type_string(s) for s in strs)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_pretty_callable_pretty_callable.return._def_format_s_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_pretty_callable_pretty_callable.return._def_format_s_", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1817, "end_line": 1880, "span_ids": ["pretty_callable"], "tokens": 609}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def pretty_callable(tp: CallableType) -> str:\n \"\"\"Return a nice easily-readable representation of a callable type.\n For example:\n def [T <: int] f(self, x: int, y: T) -> None\n \"\"\"\n s = ''\n asterisk = False\n for i in range(len(tp.arg_types)):\n if s:\n s += ', '\n if tp.arg_kinds[i] in (ARG_NAMED, ARG_NAMED_OPT) and not asterisk:\n s += '*, '\n asterisk = True\n if tp.arg_kinds[i] == ARG_STAR:\n s += '*'\n asterisk = True\n if tp.arg_kinds[i] == ARG_STAR2:\n s += '**'\n name = tp.arg_names[i]\n if name:\n s += name + ': '\n s += format_type_bare(tp.arg_types[i])\n if tp.arg_kinds[i] in (ARG_OPT, ARG_NAMED_OPT):\n s += ' = ...'\n\n # If we got a \"special arg\" (i.e: self, cls, etc...), prepend it to the arg list\n if isinstance(tp.definition, FuncDef) and tp.definition.name is not None:\n definition_args = tp.definition.arg_names\n if definition_args and tp.arg_names != definition_args \\\n and len(definition_args) > 0:\n if s:\n s = ', ' + s\n s = definition_args[0] + s\n s = '{}({})'.format(tp.definition.name, s)\n elif tp.name:\n first_arg = tp.def_extras.get('first_arg')\n if first_arg:\n if s:\n s = ', ' + s\n s = first_arg + s\n s = '{}({})'.format(tp.name.split()[0], s) # skip \"of Class\" part\n else:\n s = '({})'.format(s)\n\n s += ' -> ' + format_type_bare(tp.ret_type)\n if tp.variables:\n tvars = []\n for tvar in tp.variables:\n if isinstance(tvar, TypeVarDef):\n upper_bound = get_proper_type(tvar.upper_bound)\n if (isinstance(upper_bound, Instance) and\n upper_bound.type.fullname != 'builtins.object'):\n tvars.append('{} <: {}'.format(tvar.name, format_type_bare(upper_bound)))\n elif tvar.values:\n tvars.append('{} in ({})'\n .format(tvar.name, ', '.join([format_type_bare(tp)\n for tp in tvar.values])))\n else:\n tvars.append(tvar.name)\n else:\n # For other TypeVarLikeDefs, just use the repr\n tvars.append(repr(tvar))\n s = '[{}] {}'.format(', '.join(tvars), s)\n return 'def {}'.format(s)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_variance_string_get_missing_protocol_members.return.missing": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_variance_string_get_missing_protocol_members.return.missing", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1883, "end_line": 1901, "span_ids": ["variance_string", "get_missing_protocol_members"], "tokens": 141}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def variance_string(variance: int) -> str:\n if variance == COVARIANT:\n return 'covariant'\n elif variance == CONTRAVARIANT:\n return 'contravariant'\n else:\n return 'invariant'\n\n\ndef get_missing_protocol_members(left: Instance, right: Instance) -> List[str]:\n \"\"\"Find all protocol members of 'right' that are not implemented\n (i.e. completely missing) in 'left'.\n \"\"\"\n assert right.type.is_protocol\n missing = [] # type: List[str]\n for member in right.type.protocol_members:\n if not find_member(member, left, left):\n missing.append(member)\n return missing", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_get_conflict_protocol_types_get_conflict_protocol_types.return.conflicts": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_get_conflict_protocol_types_get_conflict_protocol_types.return.conflicts", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1904, "end_line": 1923, "span_ids": ["get_conflict_protocol_types"], "tokens": 212}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_conflict_protocol_types(left: Instance, right: Instance) -> List[Tuple[str, Type, Type]]:\n \"\"\"Find members that are defined in 'left' but have incompatible types.\n Return them as a list of ('member', 'got', 'expected').\n \"\"\"\n assert right.type.is_protocol\n conflicts = [] # type: List[Tuple[str, Type, Type]]\n for member in right.type.protocol_members:\n if member in ('__init__', '__new__'):\n continue\n supertype = find_member(member, right, left)\n assert supertype is not None\n subtype = find_member(member, left, left)\n if not subtype:\n continue\n is_compat = is_subtype(subtype, supertype, ignore_pos_arg_names=True)\n if IS_SETTABLE in get_member_flags(member, right.type):\n is_compat = is_compat and is_subtype(supertype, subtype)\n if not is_compat:\n conflicts.append((member, subtype, supertype))\n return conflicts", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_get_bad_protocol_flags_get_bad_protocol_flags.return.bad_flags": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_get_bad_protocol_flags_get_bad_protocol_flags.return.bad_flags", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1926, "end_line": 1946, "span_ids": ["get_bad_protocol_flags"], "tokens": 236}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_bad_protocol_flags(left: Instance, right: Instance\n ) -> List[Tuple[str, Set[int], Set[int]]]:\n \"\"\"Return all incompatible attribute flags for members that are present in both\n 'left' and 'right'.\n \"\"\"\n assert right.type.is_protocol\n all_flags = [] # type: List[Tuple[str, Set[int], Set[int]]]\n for member in right.type.protocol_members:\n if find_member(member, left, left):\n item = (member,\n get_member_flags(member, left.type),\n get_member_flags(member, right.type))\n all_flags.append(item)\n bad_flags = []\n for name, subflags, superflags in all_flags:\n if (IS_CLASSVAR in subflags and IS_CLASSVAR not in superflags or\n IS_CLASSVAR in superflags and IS_CLASSVAR not in subflags or\n IS_SETTABLE in superflags and IS_SETTABLE not in subflags or\n IS_CLASS_OR_STATIC in superflags and IS_CLASS_OR_STATIC not in subflags):\n bad_flags.append((name, subflags, superflags))\n return bad_flags", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_capitalize_best_matches.return.sorted_o_for_o_in_option": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_capitalize_best_matches.return.sorted_o_for_o_in_option", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1949, "end_line": 2043, "span_ids": ["plural_s", "find_defining_module", "extract_type", "temp_message_builder", "impl:7", "format_string_list", "best_matches", "format_item_name_list", "callable_name", "capitalize", "strip_quotes", "for_function"], "tokens": 762}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def capitalize(s: str) -> str:\n \"\"\"Capitalize the first character of a string.\"\"\"\n if s == '':\n return ''\n else:\n return s[0].upper() + s[1:]\n\n\ndef extract_type(name: str) -> str:\n \"\"\"If the argument is the name of a method (of form C.m), return\n the type portion in quotes (e.g. \"y\"). Otherwise, return the string\n unmodified.\n \"\"\"\n name = re.sub('^\"[a-zA-Z0-9_]+\" of ', '', name)\n return name\n\n\ndef strip_quotes(s: str) -> str:\n \"\"\"Strip a double quote at the beginning and end of the string, if any.\"\"\"\n s = re.sub('^\"', '', s)\n s = re.sub('\"$', '', s)\n return s\n\n\ndef plural_s(s: Union[int, Sequence[Any]]) -> str:\n count = s if isinstance(s, int) else len(s)\n if count > 1:\n return 's'\n else:\n return ''\n\n\ndef format_string_list(lst: List[str]) -> str:\n assert len(lst) > 0\n if len(lst) == 1:\n return lst[0]\n elif len(lst) <= 5:\n return '%s and %s' % (', '.join(lst[:-1]), lst[-1])\n else:\n return '%s, ... and %s (%i methods suppressed)' % (\n ', '.join(lst[:2]), lst[-1], len(lst) - 3)\n\n\ndef format_item_name_list(s: Iterable[str]) -> str:\n lst = list(s)\n if len(lst) <= 5:\n return '(' + ', '.join([\"'%s'\" % name for name in lst]) + ')'\n else:\n return '(' + ', '.join([\"'%s'\" % name for name in lst[:5]]) + ', ...)'\n\n\ndef callable_name(type: FunctionLike) -> Optional[str]:\n name = type.get_name()\n if name is not None and name[0] != '<':\n return '\"{}\"'.format(name).replace(' of ', '\" of \"')\n return name\n\n\ndef for_function(callee: CallableType) -> str:\n name = callable_name(callee)\n if name is not None:\n return ' for {}'.format(name)\n return ''\n\n\ndef find_defining_module(modules: Dict[str, MypyFile], typ: CallableType) -> Optional[MypyFile]:\n if not typ.definition:\n return None\n fullname = typ.definition.fullname\n if fullname is not None and '.' in fullname:\n for i in range(fullname.count('.')):\n module_name = fullname.rsplit('.', i + 1)[0]\n try:\n return modules[module_name]\n except KeyError:\n pass\n assert False, \"Couldn't determine module from CallableType\"\n return None\n\n\ndef temp_message_builder() -> MessageBuilder:\n \"\"\"Return a message builder usable for throwaway errors (which may not format properly).\"\"\"\n return MessageBuilder(Errors(), {})\n\n\n# For hard-coding suggested missing member alternatives.\nCOMMON_MISTAKES = {\n 'add': ('append', 'extend'),\n} # type: Final[Dict[str, Sequence[str]]]\n\n\ndef best_matches(current: str, options: Iterable[str]) -> List[str]:\n ratios = {v: difflib.SequenceMatcher(a=current, b=v).ratio() for v in options}\n return sorted((o for o in options if ratios[o] > 0.75),\n reverse=True, key=lambda v: (ratios[v], v))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_pretty_seq_append_invariance_notes.return.notes": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_pretty_seq_append_invariance_notes.return.notes", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2057, "end_line": 2089, "span_ids": ["pretty_seq", "append_invariance_notes"], "tokens": 387}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def pretty_seq(args: Sequence[str], conjunction: str) -> str:\n quoted = ['\"' + a + '\"' for a in args]\n if len(quoted) == 1:\n return quoted[0]\n if len(quoted) == 2:\n return \"{} {} {}\".format(quoted[0], conjunction, quoted[1])\n last_sep = \", \" + conjunction + \" \"\n return \", \".join(quoted[:-1]) + last_sep + quoted[-1]\n\n\ndef append_invariance_notes(notes: List[str], arg_type: Instance,\n expected_type: Instance) -> List[str]:\n \"\"\"Explain that the type is invariant and give notes for how to solve the issue.\"\"\"\n invariant_type = ''\n covariant_suggestion = ''\n if (arg_type.type.fullname == 'builtins.list' and\n expected_type.type.fullname == 'builtins.list' and\n is_subtype(arg_type.args[0], expected_type.args[0])):\n invariant_type = 'List'\n covariant_suggestion = 'Consider using \"Sequence\" instead, which is covariant'\n elif (arg_type.type.fullname == 'builtins.dict' and\n expected_type.type.fullname == 'builtins.dict' and\n is_same_type(arg_type.args[0], expected_type.args[0]) and\n is_subtype(arg_type.args[1], expected_type.args[1])):\n invariant_type = 'Dict'\n covariant_suggestion = ('Consider using \"Mapping\" instead, '\n 'which is covariant in the value type')\n if invariant_type and covariant_suggestion:\n notes.append(\n '\"{}\" is invariant -- see '.format(invariant_type) +\n \"https://mypy.readthedocs.io/en/stable/common_issues.html#variance\")\n notes.append(covariant_suggestion)\n return notes", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/metastore.py__Interfaces_for_accessi_if_TYPE_CHECKING_.sqlite3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/metastore.py__Interfaces_for_accessi_if_TYPE_CHECKING_.sqlite3", "embedding": null, "metadata": {"file_path": "mypy/metastore.py", "file_name": "metastore.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 21, "span_ids": ["docstring"], "tokens": 140}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Interfaces for accessing metadata.\n\nWe provide two implementations.\n * The \"classic\" file system implementation, which uses a directory\n structure of files.\n * A hokey sqlite backed implementation, which basically simulates\n the file system in an effort to work around poor file system performance\n on OS X.\n\"\"\"\n\nimport binascii\nimport os\nimport time\n\nfrom abc import abstractmethod\nfrom typing import List, Iterable, Any, Optional\nfrom typing_extensions import TYPE_CHECKING\nif TYPE_CHECKING:\n # We avoid importing sqlite3 unless we are using it so we can mostly work\n # on semi-broken pythons that are missing it.\n import sqlite3", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/metastore.py_MetadataStore_MetadataStore.list_all._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/metastore.py_MetadataStore_MetadataStore.list_all._", "embedding": null, "metadata": {"file_path": "mypy/metastore.py", "file_name": "metastore.py", "file_type": "text/x-python", "category": "implementation", "start_line": 24, "end_line": 69, "span_ids": ["MetadataStore.list_all", "MetadataStore.commit", "MetadataStore.getmtime", "MetadataStore.remove", "MetadataStore", "MetadataStore.read", "MetadataStore.write"], "tokens": 283}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MetadataStore:\n \"\"\"Generic interface for metadata storage.\"\"\"\n\n @abstractmethod\n def getmtime(self, name: str) -> float:\n \"\"\"Read the mtime of a metadata entry..\n\n Raises FileNotFound if the entry does not exist.\n \"\"\"\n pass\n\n @abstractmethod\n def read(self, name: str) -> str:\n \"\"\"Read the contents of a metadata entry.\n\n Raises FileNotFound if the entry does not exist.\n \"\"\"\n pass\n\n @abstractmethod\n def write(self, name: str, data: str, mtime: Optional[float] = None) -> bool:\n \"\"\"Write a metadata entry.\n\n If mtime is specified, set it as the mtime of the entry. Otherwise,\n the current time is used.\n\n Returns True if the entry is successfully written, False otherwise.\n \"\"\"\n\n @abstractmethod\n def remove(self, name: str) -> None:\n \"\"\"Delete a metadata entry\"\"\"\n pass\n\n @abstractmethod\n def commit(self) -> None:\n \"\"\"If the backing store requires a commit, do it.\n\n But N.B. that this is not *guaranteed* to do anything, and\n there is no guarantee that changes are not made until it is\n called.\n \"\"\"\n pass\n\n @abstractmethod\n def list_all(self) -> Iterable[str]: ...", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/metastore.py_random_string_FilesystemMetadataStore.read.with_open_os_path_join_se.return.f_read_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/metastore.py_random_string_FilesystemMetadataStore.read.with_open_os_path_join_se.return.f_read_", "embedding": null, "metadata": {"file_path": "mypy/metastore.py", "file_name": "metastore.py", "file_type": "text/x-python", "category": "implementation", "start_line": 72, "end_line": 99, "span_ids": ["FilesystemMetadataStore", "FilesystemMetadataStore.getmtime", "FilesystemMetadataStore.__init__", "FilesystemMetadataStore.read", "random_string"], "tokens": 223}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def random_string() -> str:\n return binascii.hexlify(os.urandom(8)).decode('ascii')\n\n\nclass FilesystemMetadataStore(MetadataStore):\n def __init__(self, cache_dir_prefix: str) -> None:\n # We check startswith instead of equality because the version\n # will have already been appended by the time the cache dir is\n # passed here.\n if cache_dir_prefix.startswith(os.devnull):\n self.cache_dir_prefix = None\n else:\n self.cache_dir_prefix = cache_dir_prefix\n\n def getmtime(self, name: str) -> float:\n if not self.cache_dir_prefix:\n raise FileNotFoundError()\n\n return int(os.path.getmtime(os.path.join(self.cache_dir_prefix, name)))\n\n def read(self, name: str) -> str:\n assert os.path.normpath(name) != os.path.abspath(name), \"Don't use absolute paths!\"\n\n if not self.cache_dir_prefix:\n raise FileNotFoundError()\n\n with open(os.path.join(self.cache_dir_prefix, name), 'r') as f:\n return f.read()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/metastore.py_FilesystemMetadataStore.write_FilesystemMetadataStore.list_all.for_dir___files_in_os_w.for_file_in_files_.yield_os_path_join_dir_f": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/metastore.py_FilesystemMetadataStore.write_FilesystemMetadataStore.list_all.for_dir___files_in_os_w.for_file_in_files_.yield_os_path_join_dir_f", "embedding": null, "metadata": {"file_path": "mypy/metastore.py", "file_name": "metastore.py", "file_type": "text/x-python", "category": "implementation", "start_line": 101, "end_line": 137, "span_ids": ["FilesystemMetadataStore.commit", "FilesystemMetadataStore.write", "FilesystemMetadataStore.list_all", "FilesystemMetadataStore.remove"], "tokens": 277}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FilesystemMetadataStore(MetadataStore):\n\n def write(self, name: str, data: str, mtime: Optional[float] = None) -> bool:\n assert os.path.normpath(name) != os.path.abspath(name), \"Don't use absolute paths!\"\n\n if not self.cache_dir_prefix:\n return False\n\n path = os.path.join(self.cache_dir_prefix, name)\n tmp_filename = path + '.' + random_string()\n try:\n os.makedirs(os.path.dirname(path), exist_ok=True)\n with open(tmp_filename, 'w') as f:\n f.write(data)\n os.replace(tmp_filename, path)\n if mtime is not None:\n os.utime(path, times=(mtime, mtime))\n\n except os.error:\n return False\n return True\n\n def remove(self, name: str) -> None:\n if not self.cache_dir_prefix:\n raise FileNotFoundError()\n\n os.remove(os.path.join(self.cache_dir_prefix, name))\n\n def commit(self) -> None:\n pass\n\n def list_all(self) -> Iterable[str]:\n if not self.cache_dir_prefix:\n return\n\n for dir, _, files in os.walk(self.cache_dir_prefix):\n dir = os.path.relpath(dir, self.cache_dir_prefix)\n for file in files:\n yield os.path.join(dir, file)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/metastore.py_SCHEMA_connect_db.return.db": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/metastore.py_SCHEMA_connect_db.return.db", "embedding": null, "metadata": {"file_path": "mypy/metastore.py", "file_name": "metastore.py", "file_type": "text/x-python", "category": "implementation", "start_line": 140, "end_line": 163, "span_ids": ["impl:2", "connect_db"], "tokens": 136}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "SCHEMA = '''\nCREATE TABLE IF NOT EXISTS files (\n path TEXT UNIQUE NOT NULL,\n mtime REAL,\n data TEXT\n);\nCREATE INDEX IF NOT EXISTS path_idx on files(path);\n'''\n# No migrations yet\nMIGRATIONS = [\n] # type: List[str]\n\n\ndef connect_db(db_file: str) -> 'sqlite3.Connection':\n import sqlite3.dbapi2\n\n db = sqlite3.dbapi2.connect(db_file)\n db.executescript(SCHEMA)\n for migr in MIGRATIONS:\n try:\n db.executescript(migr)\n except sqlite3.OperationalError:\n pass\n return db", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/metastore.py_SqliteMetadataStore_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/metastore.py_SqliteMetadataStore_", "embedding": null, "metadata": {"file_path": "mypy/metastore.py", "file_name": "metastore.py", "file_type": "text/x-python", "category": "implementation", "start_line": 166, "end_line": 224, "span_ids": ["SqliteMetadataStore.getmtime", "SqliteMetadataStore.remove", "SqliteMetadataStore.read", "SqliteMetadataStore._query", "SqliteMetadataStore.__init__", "SqliteMetadataStore.list_all", "SqliteMetadataStore.write", "SqliteMetadataStore.commit", "SqliteMetadataStore"], "tokens": 440}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SqliteMetadataStore(MetadataStore):\n def __init__(self, cache_dir_prefix: str) -> None:\n # We check startswith instead of equality because the version\n # will have already been appended by the time the cache dir is\n # passed here.\n if cache_dir_prefix.startswith(os.devnull):\n self.db = None\n return\n\n os.makedirs(cache_dir_prefix, exist_ok=True)\n self.db = connect_db(os.path.join(cache_dir_prefix, 'cache.db'))\n\n def _query(self, name: str, field: str) -> Any:\n # Raises FileNotFound for consistency with the file system version\n if not self.db:\n raise FileNotFoundError()\n\n cur = self.db.execute('SELECT {} FROM files WHERE path = ?'.format(field), (name,))\n results = cur.fetchall()\n if not results:\n raise FileNotFoundError()\n assert len(results) == 1\n return results[0][0]\n\n def getmtime(self, name: str) -> float:\n return self._query(name, 'mtime')\n\n def read(self, name: str) -> str:\n return self._query(name, 'data')\n\n def write(self, name: str, data: str, mtime: Optional[float] = None) -> bool:\n import sqlite3\n\n if not self.db:\n return False\n try:\n if mtime is None:\n mtime = time.time()\n self.db.execute('INSERT OR REPLACE INTO files(path, mtime, data) VALUES(?, ?, ?)',\n (name, mtime, data))\n except sqlite3.OperationalError:\n return False\n return True\n\n def remove(self, name: str) -> None:\n if not self.db:\n raise FileNotFoundError()\n\n self.db.execute('DELETE FROM files WHERE path = ?', (name,))\n\n def commit(self) -> None:\n if self.db:\n self.db.commit()\n\n def list_all(self) -> Iterable[str]:\n if self.db:\n for row in self.db.execute('SELECT path FROM files'):\n yield row[0]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/mixedtraverser.py_from_typing_import_Option_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/mixedtraverser.py_from_typing_import_Option_", "embedding": null, "metadata": {"file_path": "mypy/mixedtraverser.py", "file_name": "mixedtraverser.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 92, "span_ids": ["MixedTraverserVisitor.visit_type_alias_expr", "MixedTraverserVisitor.visit_var", "MixedTraverserVisitor.visit_typeddict_expr", "MixedTraverserVisitor.visit_class_def", "MixedTraverserVisitor", "imports", "MixedTraverserVisitor.visit_newtype_expr", "MixedTraverserVisitor.visit_type_var_expr", "MixedTraverserVisitor.visit_for_stmt", "MixedTraverserVisitor.visit_namedtuple_expr", "MixedTraverserVisitor.visit_type_application", "MixedTraverserVisitor.visit_optional_type", "MixedTraverserVisitor.visit_assignment_stmt", "MixedTraverserVisitor.visit_func", "MixedTraverserVisitor.visit_cast_expr", "MixedTraverserVisitor.visit_with_stmt", "MixedTraverserVisitor.visit__promote_expr"], "tokens": 683}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from typing import Optional\n\nfrom mypy.nodes import (\n Var, FuncItem, ClassDef, AssignmentStmt, ForStmt, WithStmt,\n CastExpr, TypeApplication, TypeAliasExpr, TypeVarExpr, TypedDictExpr, NamedTupleExpr,\n PromoteExpr, NewTypeExpr\n)\nfrom mypy.types import Type\nfrom mypy.traverser import TraverserVisitor\nfrom mypy.typetraverser import TypeTraverserVisitor\n\n\nclass MixedTraverserVisitor(TraverserVisitor, TypeTraverserVisitor):\n \"\"\"Recursive traversal of both Node and Type objects.\"\"\"\n\n # Symbol nodes\n\n def visit_var(self, var: Var) -> None:\n self.visit_optional_type(var.type)\n\n def visit_func(self, o: FuncItem) -> None:\n super().visit_func(o)\n self.visit_optional_type(o.type)\n\n def visit_class_def(self, o: ClassDef) -> None:\n # TODO: Should we visit generated methods/variables as well, either here or in\n # TraverserVisitor?\n super().visit_class_def(o)\n info = o.info\n if info:\n for base in info.bases:\n base.accept(self)\n\n def visit_type_alias_expr(self, o: TypeAliasExpr) -> None:\n super().visit_type_alias_expr(o)\n o.type.accept(self)\n\n def visit_type_var_expr(self, o: TypeVarExpr) -> None:\n super().visit_type_var_expr(o)\n o.upper_bound.accept(self)\n for value in o.values:\n value.accept(self)\n\n def visit_typeddict_expr(self, o: TypedDictExpr) -> None:\n super().visit_typeddict_expr(o)\n self.visit_optional_type(o.info.typeddict_type)\n\n def visit_namedtuple_expr(self, o: NamedTupleExpr) -> None:\n super().visit_namedtuple_expr(o)\n assert o.info.tuple_type\n o.info.tuple_type.accept(self)\n\n def visit__promote_expr(self, o: PromoteExpr) -> None:\n super().visit__promote_expr(o)\n o.type.accept(self)\n\n def visit_newtype_expr(self, o: NewTypeExpr) -> None:\n super().visit_newtype_expr(o)\n self.visit_optional_type(o.old_type)\n\n # Statements\n\n def visit_assignment_stmt(self, o: AssignmentStmt) -> None:\n super().visit_assignment_stmt(o)\n self.visit_optional_type(o.type)\n\n def visit_for_stmt(self, o: ForStmt) -> None:\n super().visit_for_stmt(o)\n self.visit_optional_type(o.index_type)\n\n def visit_with_stmt(self, o: WithStmt) -> None:\n super().visit_with_stmt(o)\n for typ in o.analyzed_types:\n typ.accept(self)\n\n # Expressions\n\n def visit_cast_expr(self, o: CastExpr) -> None:\n super().visit_cast_expr(o)\n o.type.accept(self)\n\n def visit_type_application(self, o: TypeApplication) -> None:\n super().visit_type_application(o)\n for t in o.types:\n t.accept(self)\n\n # Helpers\n\n def visit_optional_type(self, t: Optional[Type]) -> None:\n if t:\n t.accept(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_FindModuleCache_FindModuleCache.clear.self_ns_ancestors_clear_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_FindModuleCache_FindModuleCache.clear.self_ns_ancestors_clear_", "embedding": null, "metadata": {"file_path": "mypy/modulefinder.py", "file_name": "modulefinder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 109, "end_line": 142, "span_ids": ["FindModuleCache", "FindModuleCache.__init__", "FindModuleCache.clear"], "tokens": 311}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FindModuleCache:\n \"\"\"Module finder with integrated cache.\n\n Module locations and some intermediate results are cached internally\n and can be cleared with the clear() method.\n\n All file system accesses are performed through a FileSystemCache,\n which is not ever cleared by this class. If necessary it must be\n cleared by client code.\n \"\"\"\n\n def __init__(self,\n search_paths: SearchPaths,\n fscache: Optional[FileSystemCache],\n options: Optional[Options]) -> None:\n self.search_paths = search_paths\n self.fscache = fscache or FileSystemCache()\n # Cache for get_toplevel_possibilities:\n # search_paths -> (toplevel_id -> list(package_dirs))\n self.initial_components = {} # type: Dict[Tuple[str, ...], Dict[str, List[str]]]\n # Cache find_module: id -> result\n self.results = {} # type: Dict[str, ModuleSearchResult]\n self.ns_ancestors = {} # type: Dict[str, str]\n self.options = options\n custom_typeshed_dir = None\n if options:\n custom_typeshed_dir = options.custom_typeshed_dir\n self.stdlib_py_versions = load_stdlib_py_versions(custom_typeshed_dir)\n self.python2 = options and options.python_version[0] == 2\n\n def clear(self) -> None:\n self.results.clear()\n self.initial_components.clear()\n self.ns_ancestors.clear()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_FindModuleCache.find_lib_path_dirs_FindModuleCache.find_lib_path_dirs.return.dirs": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_FindModuleCache.find_lib_path_dirs_FindModuleCache.find_lib_path_dirs.return.dirs", "embedding": null, "metadata": {"file_path": "mypy/modulefinder.py", "file_name": "modulefinder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 144, "end_line": 158, "span_ids": ["FindModuleCache.find_lib_path_dirs"], "tokens": 169}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FindModuleCache:\n\n def find_lib_path_dirs(self, id: str, lib_path: Tuple[str, ...]) -> PackageDirs:\n \"\"\"Find which elements of a lib_path have the directory a module needs to exist.\n\n This is run for the python_path, mypy_path, and typeshed_path search paths.\n \"\"\"\n components = id.split('.')\n dir_chain = os.sep.join(components[:-1]) # e.g., 'foo/bar'\n\n dirs = []\n for pathitem in self.get_toplevel_possibilities(lib_path, components[0]):\n # e.g., '/usr/lib/python3.4/foo/bar'\n dir = os.path.normpath(os.path.join(pathitem, dir_chain))\n if self.fscache.isdir(dir):\n dirs.append((dir, True))\n return dirs", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_FindModuleCache.get_toplevel_possibilities_FindModuleCache.get_toplevel_possibilities.return.components_get_id_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_FindModuleCache.get_toplevel_possibilities_FindModuleCache.get_toplevel_possibilities.return.components_get_id_", "embedding": null, "metadata": {"file_path": "mypy/modulefinder.py", "file_name": "modulefinder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 160, "end_line": 193, "span_ids": ["FindModuleCache.get_toplevel_possibilities"], "tokens": 324}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FindModuleCache:\n\n def get_toplevel_possibilities(self, lib_path: Tuple[str, ...], id: str) -> List[str]:\n \"\"\"Find which elements of lib_path could contain a particular top-level module.\n\n In practice, almost all modules can be routed to the correct entry in\n lib_path by looking at just the first component of the module name.\n\n We take advantage of this by enumerating the contents of all of the\n directories on the lib_path and building a map of which entries in\n the lib_path could contain each potential top-level module that appears.\n \"\"\"\n\n if lib_path in self.initial_components:\n return self.initial_components[lib_path].get(id, [])\n\n # Enumerate all the files in the directories on lib_path and produce the map\n components = {} # type: Dict[str, List[str]]\n for dir in lib_path:\n try:\n contents = self.fscache.listdir(dir)\n except OSError:\n contents = []\n # False positives are fine for correctness here, since we will check\n # precisely later, so we only look at the root of every filename without\n # any concern for the exact details.\n for name in contents:\n name = os.path.splitext(name)[0]\n components.setdefault(name, []).append(dir)\n\n if self.python2:\n components = {id: filter_redundant_py2_dirs(dirs)\n for id, dirs in components.items()}\n\n self.initial_components[lib_path] = components\n return components.get(id, [])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_FindModuleCache._update_ns_ancestors_FindModuleCache._can_find_module_in_parent_dir.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_FindModuleCache._update_ns_ancestors_FindModuleCache._can_find_module_in_parent_dir.return.False", "embedding": null, "metadata": {"file_path": "mypy/modulefinder.py", "file_name": "modulefinder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 229, "end_line": 249, "span_ids": ["FindModuleCache._update_ns_ancestors", "FindModuleCache._can_find_module_in_parent_dir"], "tokens": 251}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FindModuleCache:\n\n def _update_ns_ancestors(self, components: List[str], match: Tuple[str, bool]) -> None:\n path, verify = match\n for i in range(1, len(components)):\n pkg_id = '.'.join(components[:-i])\n if pkg_id not in self.ns_ancestors and self.fscache.isdir(path):\n self.ns_ancestors[pkg_id] = path\n path = os.path.dirname(path)\n\n def _can_find_module_in_parent_dir(self, id: str) -> bool:\n \"\"\"Test if a module can be found by checking the parent directories\n of the current working directory.\n \"\"\"\n working_dir = os.getcwd()\n parent_search = FindModuleCache(SearchPaths((), (), (), ()), self.fscache, self.options)\n while any(file.endswith((\"__init__.py\", \"__init__.pyi\"))\n for file in os.listdir(working_dir)):\n working_dir = os.path.dirname(working_dir)\n parent_search.search_paths = SearchPaths((working_dir,), (), (), ())\n if not isinstance(parent_search._find_module(id, False), ModuleNotFoundReason):\n return True\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_highest_init_level_mypy_path.return.path_env_split_os_pathsep": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_highest_init_level_mypy_path.return.path_env_split_os_pathsep", "embedding": null, "metadata": {"file_path": "mypy/modulefinder.py", "file_name": "modulefinder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 413, "end_line": 431, "span_ids": ["highest_init_level", "mypy_path"], "tokens": 169}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def highest_init_level(fscache: FileSystemCache, id: str, path: str, prefix: str) -> int:\n \"\"\"Compute the highest level where an __init__ file is found.\"\"\"\n if path.endswith(('__init__.py', '__init__.pyi')):\n path = os.path.dirname(path)\n level = 0\n for i in range(id.count('.')):\n path = os.path.dirname(path)\n if any(fscache.isfile_case(os.path.join(path, '__init__{}'.format(extension)),\n prefix)\n for extension in PYTHON_EXTENSIONS):\n level = i + 1\n return level\n\n\ndef mypy_path() -> List[str]:\n path_env = os.getenv('MYPYPATH')\n if not path_env:\n return []\n return path_env.split(os.pathsep)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_default_lib_path_default_lib_path.return.path": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_default_lib_path_default_lib_path.return.path", "embedding": null, "metadata": {"file_path": "mypy/modulefinder.py", "file_name": "modulefinder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 528, "end_line": 560, "span_ids": ["default_lib_path"], "tokens": 354}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def default_lib_path(data_dir: str,\n pyversion: Tuple[int, int],\n custom_typeshed_dir: Optional[str]) -> List[str]:\n \"\"\"Return default standard library search paths.\"\"\"\n path = [] # type: List[str]\n\n if custom_typeshed_dir:\n typeshed_dir = os.path.join(custom_typeshed_dir, \"stdlib\")\n versions_file = os.path.join(typeshed_dir, \"VERSIONS\")\n if not os.path.isdir(typeshed_dir) or not os.path.isfile(versions_file):\n print(\"error: --custom-typeshed-dir does not point to a valid typeshed ({})\".format(\n custom_typeshed_dir))\n sys.exit(2)\n else:\n auto = os.path.join(data_dir, 'stubs-auto')\n if os.path.isdir(auto):\n data_dir = auto\n typeshed_dir = os.path.join(data_dir, \"typeshed\", \"stdlib\")\n if pyversion[0] == 2:\n # Python 2 variants of certain stdlib modules are in a separate directory.\n python2_dir = os.path.join(typeshed_dir, PYTHON2_STUB_DIR)\n path.append(python2_dir)\n path.append(typeshed_dir)\n\n # Add fallback path that can be used if we have a broken installation.\n if sys.platform != 'win32':\n path.append('/usr/local/lib/mypy')\n if not path:\n print(\"Could not resolve typeshed subdirectories. Your mypy install is broken.\\n\"\n \"Python executable is located at {0}.\\nMypy located at {1}\".format(\n sys.executable, data_dir), file=sys.stderr)\n sys.exit(1)\n return path", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_get_site_packages_dirs_get_site_packages_dirs.return.expand_site_packages_site": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_get_site_packages_dirs_get_site_packages_dirs.return.expand_site_packages_site", "embedding": null, "metadata": {"file_path": "mypy/modulefinder.py", "file_name": "modulefinder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 563, "end_line": 583, "span_ids": ["get_site_packages_dirs"], "tokens": 189}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@functools.lru_cache(maxsize=None)\ndef get_site_packages_dirs(python_executable: Optional[str]) -> Tuple[List[str], List[str]]:\n \"\"\"Find package directories for given python.\n\n This runs a subprocess call, which generates a list of the egg directories, and the site\n package directories. To avoid repeatedly calling a subprocess (which can be slow!) we\n lru_cache the results.\n \"\"\"\n\n if python_executable is None:\n return [], []\n elif python_executable == sys.executable:\n # Use running Python's package dirs\n site_packages = sitepkgs.getsitepackages()\n else:\n # Use subprocess to get the package directory of given Python\n # executable\n site_packages = ast.literal_eval(\n subprocess.check_output([python_executable, sitepkgs.__file__],\n stderr=subprocess.PIPE).decode())\n return expand_site_packages(site_packages)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_expand_site_packages_expand_site_packages.return.egg_dirs_site_packages": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_expand_site_packages_expand_site_packages.return.egg_dirs_site_packages", "embedding": null, "metadata": {"file_path": "mypy/modulefinder.py", "file_name": "modulefinder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 497, "end_line": 507, "span_ids": ["expand_site_packages"], "tokens": 112}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def expand_site_packages(site_packages: List[str]) -> Tuple[List[str], List[str]]:\n \"\"\"Expands .pth imports in site-packages directories\"\"\"\n egg_dirs = [] # type: List[str]\n for dir in site_packages:\n if not os.path.isdir(dir):\n continue\n pth_filenames = sorted(name for name in os.listdir(dir) if name.endswith(\".pth\"))\n for pth_filename in pth_filenames:\n egg_dirs.extend(_parse_pth_file(dir, pth_filename))\n\n return egg_dirs, site_packages", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_compute_search_paths_compute_search_paths.egg_dirs_site_packages_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_compute_search_paths_compute_search_paths.egg_dirs_site_packages_", "embedding": null, "metadata": {"file_path": "mypy/modulefinder.py", "file_name": "modulefinder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 649, "end_line": 716, "span_ids": ["compute_search_paths"], "tokens": 695}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def compute_search_paths(sources: List[BuildSource],\n options: Options,\n data_dir: str,\n alt_lib_path: Optional[str] = None) -> SearchPaths:\n \"\"\"Compute the search paths as specified in PEP 561.\n\n There are the following 4 members created:\n - User code (from `sources`)\n - MYPYPATH (set either via config or environment variable)\n - installed package directories (which will later be split into stub-only and inline)\n - typeshed\n \"\"\"\n # Determine the default module search path.\n lib_path = collections.deque(\n default_lib_path(data_dir,\n options.python_version,\n custom_typeshed_dir=options.custom_typeshed_dir))\n\n if options.use_builtins_fixtures:\n # Use stub builtins (to speed up test cases and to make them easier to\n # debug). This is a test-only feature, so assume our files are laid out\n # as in the source tree.\n # We also need to allow overriding where to look for it. Argh.\n root_dir = os.getenv('MYPY_TEST_PREFIX', None)\n if not root_dir:\n root_dir = os.path.dirname(os.path.dirname(__file__))\n lib_path.appendleft(os.path.join(root_dir, 'test-data', 'unit', 'lib-stub'))\n # alt_lib_path is used by some tests to bypass the normal lib_path mechanics.\n # If we don't have one, grab directories of source files.\n python_path = [] # type: List[str]\n if not alt_lib_path:\n for source in sources:\n # Include directory of the program file in the module search path.\n if source.base_dir:\n dir = source.base_dir\n if dir not in python_path:\n python_path.append(dir)\n\n # Do this even if running as a file, for sanity (mainly because with\n # multiple builds, there could be a mix of files/modules, so its easier\n # to just define the semantics that we always add the current director\n # to the lib_path\n # TODO: Don't do this in some cases; for motivation see see\n # https://github.com/python/mypy/issues/4195#issuecomment-341915031\n if options.bazel:\n dir = '.'\n else:\n dir = os.getcwd()\n if dir not in lib_path:\n python_path.insert(0, dir)\n\n # Start with a MYPYPATH environment variable at the front of the mypy_path, if defined.\n mypypath = mypy_path()\n\n # Add a config-defined mypy path.\n mypypath.extend(options.mypy_path)\n\n # If provided, insert the caller-supplied extra module path to the\n # beginning (highest priority) of the search path.\n if alt_lib_path:\n mypypath.insert(0, alt_lib_path)\n\n # When type checking in Python 2 module, add @python2 subdirectories of\n # path items into the search path.\n if options.python_version[0] == 2:\n mypypath = add_py2_mypypath_entries(mypypath)\n\n egg_dirs, site_packages = get_site_packages_dirs(options.python_executable)\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/moduleinspect.py__Basic_introspection_of_InspectError.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/moduleinspect.py__Basic_introspection_of_InspectError.pass", "embedding": null, "metadata": {"file_path": "mypy/moduleinspect.py", "file_name": "moduleinspect.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 39, "span_ids": ["ModuleProperties.__init__", "docstring", "is_c_module", "ModuleProperties", "InspectError"], "tokens": 256}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Basic introspection of modules.\"\"\"\n\nfrom typing import List, Optional, Union\nfrom types import ModuleType\nfrom multiprocessing import Process, Queue\nimport importlib\nimport inspect\nimport os\nimport pkgutil\nimport queue\nimport sys\n\n\nclass ModuleProperties:\n def __init__(self,\n name: str,\n file: Optional[str],\n path: Optional[List[str]],\n all: Optional[List[str]],\n is_c_module: bool,\n subpackages: List[str]) -> None:\n self.name = name # __name__ attribute\n self.file = file # __file__ attribute\n self.path = path # __path__ attribute\n self.all = all # __all__ attribute\n self.is_c_module = is_c_module\n self.subpackages = subpackages\n\n\ndef is_c_module(module: ModuleType) -> bool:\n if module.__dict__.get('__file__') is None:\n # Could be a namespace package. These must be handled through\n # introspection, since there is no source file.\n return True\n return os.path.splitext(module.__dict__['__file__'])[-1] in ['.so', '.pyd']\n\n\nclass InspectError(Exception):\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/moduleinspect.py_get_package_properties_get_package_properties.return.ModuleProperties_name_nam": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/moduleinspect.py_get_package_properties_get_package_properties.return.ModuleProperties_name_nam", "embedding": null, "metadata": {"file_path": "mypy/moduleinspect.py", "file_name": "moduleinspect.py", "file_type": "text/x-python", "category": "implementation", "start_line": 42, "end_line": 83, "span_ids": ["get_package_properties"], "tokens": 394}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_package_properties(package_id: str) -> ModuleProperties:\n \"\"\"Use runtime introspection to get information about a module/package.\"\"\"\n try:\n package = importlib.import_module(package_id)\n except BaseException as e:\n raise InspectError(str(e)) from e\n name = getattr(package, '__name__', package_id)\n file = getattr(package, '__file__', None)\n path = getattr(package, '__path__', None) # type: Optional[List[str]]\n if not isinstance(path, list):\n path = None\n pkg_all = getattr(package, '__all__', None)\n if pkg_all is not None:\n try:\n pkg_all = list(pkg_all)\n except Exception:\n pkg_all = None\n is_c = is_c_module(package)\n\n if path is None:\n # Object has no path; this means it's either a module inside a package\n # (and thus no sub-packages), or it could be a C extension package.\n if is_c:\n # This is a C extension module, now get the list of all sub-packages\n # using the inspect module\n subpackages = [package.__name__ + \".\" + name\n for name, val in inspect.getmembers(package)\n if inspect.ismodule(val)\n and val.__name__ == package.__name__ + \".\" + name]\n else:\n # It's a module inside a package. There's nothing else to walk/yield.\n subpackages = []\n else:\n all_packages = pkgutil.walk_packages(path, prefix=package.__name__ + \".\",\n onerror=lambda r: None)\n subpackages = [qualified_name for importer, qualified_name, ispkg in all_packages]\n return ModuleProperties(name=name,\n file=file,\n path=path,\n all=pkg_all,\n is_c_module=is_c,\n subpackages=subpackages)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/moduleinspect.py_worker_ModuleInspect.close.self_proc_terminate_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/moduleinspect.py_worker_ModuleInspect.close.self_proc_terminate_", "embedding": null, "metadata": {"file_path": "mypy/moduleinspect.py", "file_name": "moduleinspect.py", "file_type": "text/x-python", "category": "implementation", "start_line": 86, "end_line": 129, "span_ids": ["ModuleInspect.close", "ModuleInspect._start", "worker", "ModuleInspect.__init__", "ModuleInspect"], "tokens": 336}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def worker(tasks: 'Queue[str]',\n results: 'Queue[Union[str, ModuleProperties]]',\n sys_path: List[str]) -> None:\n \"\"\"The main loop of a worker introspection process.\"\"\"\n sys.path = sys_path\n while True:\n mod = tasks.get()\n try:\n prop = get_package_properties(mod)\n except InspectError as e:\n results.put(str(e))\n continue\n results.put(prop)\n\n\nclass ModuleInspect:\n \"\"\"Perform runtime introspection of modules in a separate process.\n\n Reuse the process for multiple modules for efficiency. However, if there is an\n error, retry using a fresh process to avoid cross-contamination of state between\n modules.\n\n We use a separate process to isolate us from many side effects. For example, the\n import of a module may kill the current process, and we want to recover from that.\n\n Always use in a with statement for proper clean-up:\n\n with ModuleInspect() as m:\n p = m.get_package_properties('urllib.parse')\n \"\"\"\n\n def __init__(self) -> None:\n self._start()\n\n def _start(self) -> None:\n self.tasks = Queue() # type: Queue[str]\n self.results = Queue() # type: Queue[Union[ModuleProperties, str]]\n self.proc = Process(target=worker, args=(self.tasks, self.results, sys.path))\n self.proc.start()\n self.counter = 0 # Number of successful roundtrips\n\n def close(self) -> None:\n \"\"\"Free any resources used.\"\"\"\n self.proc.terminate()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/moduleinspect.py_ModuleInspect.get_package_properties_ModuleInspect.get_package_properties.return.res": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/moduleinspect.py_ModuleInspect.get_package_properties_ModuleInspect.get_package_properties.return.res", "embedding": null, "metadata": {"file_path": "mypy/moduleinspect.py", "file_name": "moduleinspect.py", "file_type": "text/x-python", "category": "implementation", "start_line": 131, "end_line": 152, "span_ids": ["ModuleInspect.get_package_properties"], "tokens": 184}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ModuleInspect:\n\n def get_package_properties(self, package_id: str) -> ModuleProperties:\n \"\"\"Return some properties of a module/package using runtime introspection.\n\n Raise InspectError if the target couldn't be imported.\n \"\"\"\n self.tasks.put(package_id)\n res = self._get_from_queue()\n if res is None:\n # The process died; recover and report error.\n self._start()\n raise InspectError('Process died when importing %r' % package_id)\n if isinstance(res, str):\n # Error importing module\n if self.counter > 0:\n # Also try with a fresh process. Maybe one of the previous imports has\n # corrupted some global state.\n self.close()\n self._start()\n return self.get_package_properties(package_id)\n raise InspectError(res)\n self.counter += 1\n return res", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/moduleinspect.py_ModuleInspect._get_from_queue_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/moduleinspect.py_ModuleInspect._get_from_queue_", "embedding": null, "metadata": {"file_path": "mypy/moduleinspect.py", "file_name": "moduleinspect.py", "file_type": "text/x-python", "category": "implementation", "start_line": 154, "end_line": 176, "span_ids": ["ModuleInspect.__exit__", "ModuleInspect.__enter__", "ModuleInspect._get_from_queue"], "tokens": 154}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ModuleInspect:\n\n def _get_from_queue(self) -> Union[ModuleProperties, str, None]:\n \"\"\"Get value from the queue.\n\n Return the value read from the queue, or None if the process unexpectedly died.\n \"\"\"\n max_iter = 100\n n = 0\n while True:\n if n == max_iter:\n raise RuntimeError('Timeout waiting for subprocess')\n try:\n return self.results.get(timeout=0.05)\n except queue.Empty:\n if not self.proc.is_alive():\n return None\n n += 1\n\n def __enter__(self) -> 'ModuleInspect':\n return self\n\n def __exit__(self, *args: object) -> None:\n self.close()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/mro.py_from_typing_import_Option_MroError._Raised_if_a_consistent": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/mro.py_from_typing_import_Option_MroError._Raised_if_a_consistent", "embedding": null, "metadata": {"file_path": "mypy/mro.py", "file_name": "mro.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 22, "span_ids": ["imports", "calculate_mro", "MroError"], "tokens": 189}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from typing import Optional, Callable, List\n\nfrom mypy.nodes import TypeInfo\nfrom mypy.types import Instance\nfrom mypy.typestate import TypeState\n\n\ndef calculate_mro(info: TypeInfo, obj_type: Optional[Callable[[], Instance]] = None) -> None:\n \"\"\"Calculate and set mro (method resolution order).\n\n Raise MroError if cannot determine mro.\n \"\"\"\n mro = linearize_hierarchy(info, obj_type)\n assert mro, \"Could not produce a MRO at all for %s\" % (info,)\n info.mro = mro\n # The property of falling back to Any is inherited.\n info.fallback_to_any = any(baseinfo.fallback_to_any for baseinfo in info.mro)\n TypeState.reset_all_subtype_caches_for(info)\n\n\nclass MroError(Exception):\n \"\"\"Raised if a consistent mro cannot be determined for a class.\"\"\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/mro.py_linearize_hierarchy_linearize_hierarchy.return._info_merge_lin_bases_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/mro.py_linearize_hierarchy_linearize_hierarchy.return._info_merge_lin_bases_", "embedding": null, "metadata": {"file_path": "mypy/mro.py", "file_name": "mro.py", "file_type": "text/x-python", "category": "implementation", "start_line": 25, "end_line": 42, "span_ids": ["linearize_hierarchy"], "tokens": 197}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def linearize_hierarchy(info: TypeInfo,\n obj_type: Optional[Callable[[], Instance]] = None) -> List[TypeInfo]:\n # TODO describe\n if info.mro:\n return info.mro\n bases = info.direct_base_classes()\n if (not bases and info.fullname != 'builtins.object' and\n obj_type is not None):\n # Second pass in import cycle, add a dummy `object` base class,\n # otherwise MRO calculation may spuriously fail.\n # MRO will be re-calculated for real in the third pass.\n bases = [obj_type().type]\n lin_bases = []\n for base in bases:\n assert base is not None, \"Cannot linearize bases for %s %s\" % (info.fullname, bases)\n lin_bases.append(linearize_hierarchy(base, obj_type))\n lin_bases.append(bases)\n return [info] + merge(lin_bases)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/mro.py_merge_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/mro.py_merge_", "embedding": null, "metadata": {"file_path": "mypy/mro.py", "file_name": "mro.py", "file_type": "text/x-python", "category": "implementation", "start_line": 45, "end_line": 62, "span_ids": ["merge"], "tokens": 139}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def merge(seqs: List[List[TypeInfo]]) -> List[TypeInfo]:\n seqs = [s[:] for s in seqs]\n result = [] # type: List[TypeInfo]\n while True:\n seqs = [s for s in seqs if s]\n if not seqs:\n return result\n for seq in seqs:\n head = seq[0]\n if not [s for s in seqs if head in s[1:]]:\n break\n else:\n raise MroError()\n result.append(head)\n for s in seqs:\n if s[0] is head:\n del s[0]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py__Abstract_syntax_tree_n_from_mypy_bogus_type_impo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py__Abstract_syntax_tree_n_from_mypy_bogus_type_impo", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 17, "span_ids": ["docstring"], "tokens": 127}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Abstract syntax tree node classes (i.e. parse tree).\"\"\"\n\nimport os\nfrom abc import abstractmethod\nfrom mypy.ordered_dict import OrderedDict\nfrom collections import defaultdict\nfrom typing import (\n Any, TypeVar, List, Tuple, cast, Set, Dict, Union, Optional, Callable, Sequence, Iterator\n)\nfrom typing_extensions import DefaultDict, Final, TYPE_CHECKING\nfrom mypy_extensions import trait\n\nimport mypy.strconv\nfrom mypy.util import short_type\nfrom mypy.visitor import NodeVisitor, StatementVisitor, ExpressionVisitor\n\nfrom mypy.bogus_type import Bogus", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_Context_Context.get_column.return.self_column": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_Context_Context.get_column.return.self_column", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 20, "end_line": 56, "span_ids": ["Context.get_line", "Context", "Context.get_column", "Context.__init__", "Context.set_line"], "tokens": 274}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Context:\n \"\"\"Base type for objects that are valid as error message locations.\"\"\"\n __slots__ = ('line', 'column', 'end_line')\n\n def __init__(self, line: int = -1, column: int = -1) -> None:\n self.line = line\n self.column = column\n self.end_line = None # type: Optional[int]\n\n def set_line(self,\n target: Union['Context', int],\n column: Optional[int] = None,\n end_line: Optional[int] = None) -> None:\n \"\"\"If target is a node, pull line (and column) information\n into this node. If column is specified, this will override any column\n information coming from a node.\n \"\"\"\n if isinstance(target, int):\n self.line = target\n else:\n self.line = target.line\n self.column = target.column\n self.end_line = target.end_line\n\n if column is not None:\n self.column = column\n\n if end_line is not None:\n self.end_line = end_line\n\n def get_line(self) -> int:\n \"\"\"Don't use. Use x.line.\"\"\"\n return self.line\n\n def get_column(self) -> int:\n \"\"\"Don't use. Use x.column.\"\"\"\n return self.column", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_SymbolNode_Definition.Tuple_str_SymbolTableNo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_SymbolNode_Definition.Tuple_str_SymbolTableNo", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 202, "end_line": 232, "span_ids": ["SymbolNode", "SymbolNode.fullname", "impl:45", "SymbolNode.deserialize", "SymbolNode.serialize", "SymbolNode.name"], "tokens": 207}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@trait\nclass SymbolNode(Node):\n \"\"\"Nodes that can be stored in a symbol table.\"\"\"\n\n __slots__ = ()\n\n @property\n @abstractmethod\n def name(self) -> str: pass\n\n # fullname can often be None even though the type system\n # disagrees. We mark this with Bogus to let mypyc know not to\n # worry about it.\n @property\n @abstractmethod\n def fullname(self) -> Bogus[str]: pass\n\n @abstractmethod\n def serialize(self) -> JsonDict: pass\n\n @classmethod\n def deserialize(cls, data: JsonDict) -> 'SymbolNode':\n classname = data['.class']\n method = deserialize_map.get(classname)\n if method is not None:\n return method(data)\n raise NotImplementedError('unexpected .class {}'.format(classname))\n\n\n# Items: fullname, related symbol table node, surrounding type (if any)\nDefinition = Tuple[str, 'SymbolTableNode', Optional['TypeInfo']]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_MypyFile_MypyFile.deserialize.return.tree": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_MypyFile_MypyFile.deserialize.return.tree", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 235, "end_line": 323, "span_ids": ["MypyFile.name", "MypyFile.accept", "MypyFile.serialize", "MypyFile", "MypyFile.__init__", "MypyFile.is_package_init_file", "MypyFile.local_definitions", "MypyFile.deserialize", "MypyFile.fullname"], "tokens": 798}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MypyFile(SymbolNode):\n \"\"\"The abstract syntax tree of a single source file.\"\"\"\n\n # Fully qualified module name\n _fullname = None # type: Bogus[str]\n # Path to the file (empty string if not known)\n path = ''\n # Top-level definitions and statements\n defs = None # type: List[Statement]\n # Type alias dependencies as mapping from target to set of alias full names\n alias_deps = None # type: DefaultDict[str, Set[str]]\n # Is there a UTF-8 BOM at the start?\n is_bom = False\n names = None # type: SymbolTable\n # All import nodes within the file (also ones within functions etc.)\n imports = None # type: List[ImportBase]\n # Lines on which to ignore certain errors when checking.\n # If the value is empty, ignore all errors; otherwise, the list contains all\n # error codes to ignore.\n ignored_lines = None # type: Dict[int, List[str]]\n # Is this file represented by a stub file (.pyi)?\n is_stub = False\n # Is this loaded from the cache and thus missing the actual body of the file?\n is_cache_skeleton = False\n # Does this represent an __init__.pyi stub with a module __getattr__\n # (i.e. a partial stub package), for such packages we suppress any missing\n # module errors in addition to missing attribute errors.\n is_partial_stub_package = False\n # Plugin-created dependencies\n plugin_deps = None # type: Dict[str, Set[str]]\n\n def __init__(self,\n defs: List[Statement],\n imports: List['ImportBase'],\n is_bom: bool = False,\n ignored_lines: Optional[Dict[int, List[str]]] = None) -> None:\n super().__init__()\n self.defs = defs\n self.line = 1 # Dummy line number\n self.imports = imports\n self.is_bom = is_bom\n self.alias_deps = defaultdict(set)\n self.plugin_deps = {}\n if ignored_lines:\n self.ignored_lines = ignored_lines\n else:\n self.ignored_lines = {}\n\n def local_definitions(self) -> Iterator[Definition]:\n \"\"\"Return all definitions within the module (including nested).\n\n This doesn't include imported definitions.\n \"\"\"\n return local_definitions(self.names, self.fullname)\n\n @property\n def name(self) -> str:\n return '' if not self._fullname else self._fullname.split('.')[-1]\n\n @property\n def fullname(self) -> Bogus[str]:\n return self._fullname\n\n def accept(self, visitor: NodeVisitor[T]) -> T:\n return visitor.visit_mypy_file(self)\n\n def is_package_init_file(self) -> bool:\n return len(self.path) != 0 and os.path.basename(self.path).startswith('__init__.')\n\n def serialize(self) -> JsonDict:\n return {'.class': 'MypyFile',\n '_fullname': self._fullname,\n 'names': self.names.serialize(self._fullname),\n 'is_stub': self.is_stub,\n 'path': self.path,\n 'is_partial_stub_package': self.is_partial_stub_package,\n }\n\n @classmethod\n def deserialize(cls, data: JsonDict) -> 'MypyFile':\n assert data['.class'] == 'MypyFile', data\n tree = MypyFile([], [])\n tree._fullname = data['_fullname']\n tree.names = SymbolTable.deserialize(data['names'])\n tree.is_stub = data['is_stub']\n tree.path = data['path']\n tree.is_partial_stub_package = data['is_partial_stub_package']\n tree.is_cache_skeleton = True\n return tree", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_ImportBase_ImportBase.__init__.self.assignments._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_ImportBase_ImportBase.__init__.self.assignments._", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 326, "end_line": 343, "span_ids": ["ImportBase", "ImportBase.__init__"], "tokens": 185}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ImportBase(Statement):\n \"\"\"Base class for all import statements.\"\"\"\n\n is_unreachable = False # Set by semanal.SemanticAnalyzerPass1 if inside `if False` etc.\n is_top_level = False # Ditto if outside any class or def\n is_mypy_only = False # Ditto if inside `if TYPE_CHECKING` or `if MYPY`\n\n # If an import replaces existing definitions, we construct dummy assignment\n # statements that assign the imported names to the names in the current scope,\n # for type checking purposes. Example:\n #\n # x = 1\n # from m import x <-- add assignment representing \"x = m.x\"\n assignments = None # type: List[AssignmentStmt]\n\n def __init__(self) -> None:\n super().__init__()\n self.assignments = []", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_Import_ImportFrom.accept.return.visitor_visit_import_from": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_Import_ImportFrom.accept.return.visitor_visit_import_from", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 346, "end_line": 373, "span_ids": ["ImportFrom.accept", "Import", "Import.__init__", "Import.accept", "ImportFrom", "ImportFrom.__init__"], "tokens": 234}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Import(ImportBase):\n \"\"\"import m [as n]\"\"\"\n\n ids = None # type: List[Tuple[str, Optional[str]]] # (module id, as id)\n\n def __init__(self, ids: List[Tuple[str, Optional[str]]]) -> None:\n super().__init__()\n self.ids = ids\n\n def accept(self, visitor: StatementVisitor[T]) -> T:\n return visitor.visit_import(self)\n\n\nclass ImportFrom(ImportBase):\n \"\"\"from m import x [as y], ...\"\"\"\n\n id = None # type: str\n relative = None # type: int\n names = None # type: List[Tuple[str, Optional[str]]] # Tuples (name, as name)\n\n def __init__(self, id: str, relative: int, names: List[Tuple[str, Optional[str]]]) -> None:\n super().__init__()\n self.id = id\n self.names = names\n self.relative = relative\n\n def accept(self, visitor: StatementVisitor[T]) -> T:\n return visitor.visit_import_from(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_ImportAll_ImportAll.accept.return.visitor_visit_import_all_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_ImportAll_ImportAll.accept.return.visitor_visit_import_all_", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 376, "end_line": 390, "span_ids": ["ImportAll.accept", "ImportAll.__init__", "ImportAll"], "tokens": 123}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ImportAll(ImportBase):\n \"\"\"from m import *\"\"\"\n id = None # type: str\n relative = None # type: int\n # NOTE: Only filled and used by old semantic analyzer.\n imported_names = None # type: List[str]\n\n def __init__(self, id: str, relative: int) -> None:\n super().__init__()\n self.id = id\n self.relative = relative\n self.imported_names = []\n\n def accept(self, visitor: StatementVisitor[T]) -> T:\n return visitor.visit_import_all(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_ImportedName_FUNCBASE_FLAGS._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_ImportedName_FUNCBASE_FLAGS._", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 393, "end_line": 430, "span_ids": ["ImportedName", "ImportedName.deserialize", "ImportedName.__init__", "ImportedName.serialize", "ImportedName.__str__", "ImportedName.fullname", "impl:47", "ImportedName.name"], "tokens": 268}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ImportedName(SymbolNode):\n \"\"\"Indirect reference to a fullname stored in symbol table.\n\n This node is not present in the original program as such. This is\n just a temporary artifact in binding imported names. After semantic\n analysis pass 2, these references should be replaced with direct\n reference to a real AST node.\n\n Note that this is neither a Statement nor an Expression so this\n can't be visited.\n \"\"\"\n\n def __init__(self, target_fullname: str) -> None:\n super().__init__()\n self.target_fullname = target_fullname\n\n @property\n def name(self) -> str:\n return self.target_fullname.split('.')[-1]\n\n @property\n def fullname(self) -> str:\n return self.target_fullname\n\n def serialize(self) -> JsonDict:\n assert False, \"ImportedName leaked from semantic analysis\"\n\n @classmethod\n def deserialize(cls, data: JsonDict) -> 'ImportedName':\n assert False, \"ImportedName should never be serialized\"\n\n def __str__(self) -> str:\n return 'ImportedName(%s)' % self.target_fullname\n\n\nFUNCBASE_FLAGS = [\n 'is_property', 'is_class', 'is_static', 'is_final'\n]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_None_35_FuncBase.fullname.return.self__fullname": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_None_35_FuncBase.fullname.return.self__fullname", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 430, "end_line": 481, "span_ids": ["FuncBase", "FuncBase.fullname", "impl:47", "FuncBase.__init__", "FuncBase.name"], "tokens": 416}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": " # type: Final\n\n\nclass FuncBase(Node):\n \"\"\"Abstract base class for function-like nodes.\n\n N.B: Although this has SymbolNode subclasses (FuncDef,\n OverloadedFuncDef), avoid calling isinstance(..., FuncBase) on\n something that is typed as SymbolNode. This is to work around\n mypy bug #3603, in which mypy doesn't understand multiple\n inheritance very well, and will assume that a SymbolNode\n cannot be a FuncBase.\n\n Instead, test against SYMBOL_FUNCBASE_TYPES, which enumerates\n SymbolNode subclasses that are also FuncBase subclasses.\n \"\"\"\n\n __slots__ = ('type',\n 'unanalyzed_type',\n 'info',\n 'is_property',\n 'is_class', # Uses \"@classmethod\" (explicit or implicit)\n 'is_static', # Uses \"@staticmethod\"\n 'is_final', # Uses \"@final\"\n '_fullname',\n )\n\n def __init__(self) -> None:\n super().__init__()\n # Type signature. This is usually CallableType or Overloaded, but it can be\n # something else for decorated functions.\n self.type = None # type: Optional[mypy.types.ProperType]\n # Original, not semantically analyzed type (used for reprocessing)\n self.unanalyzed_type = None # type: Optional[mypy.types.ProperType]\n # If method, reference to TypeInfo\n # TODO: Type should be Optional[TypeInfo]\n self.info = FUNC_NO_INFO\n self.is_property = False\n self.is_class = False\n self.is_static = False\n self.is_final = False\n # Name with module prefix\n # TODO: Type should be Optional[str]\n self._fullname = cast(Bogus[str], None)\n\n @property\n @abstractmethod\n def name(self) -> str: pass\n\n @property\n def fullname(self) -> Bogus[str]:\n return self._fullname", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_OverloadPart_OverloadedFuncDef.serialize.return._class_OverloadedFun": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_OverloadPart_OverloadedFuncDef.serialize.return._class_OverloadedFun", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 484, "end_line": 529, "span_ids": ["impl:49", "OverloadedFuncDef", "OverloadedFuncDef.__init__", "OverloadedFuncDef.name", "OverloadedFuncDef.serialize", "OverloadedFuncDef.accept"], "tokens": 384}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "OverloadPart = Union['FuncDef', 'Decorator']\n\n\nclass OverloadedFuncDef(FuncBase, SymbolNode, Statement):\n \"\"\"A logical node representing all the variants of a multi-declaration function.\n\n A multi-declaration function is often an @overload, but can also be a\n @property with a setter and a/or a deleter.\n\n This node has no explicit representation in the source program.\n Overloaded variants must be consecutive in the source file.\n \"\"\"\n\n items = None # type: List[OverloadPart]\n unanalyzed_items = None # type: List[OverloadPart]\n impl = None # type: Optional[OverloadPart]\n\n def __init__(self, items: List['OverloadPart']) -> None:\n super().__init__()\n self.items = items\n self.unanalyzed_items = items.copy()\n self.impl = None\n if len(items) > 0:\n self.set_line(items[0].line, items[0].column)\n self.is_final = False\n\n @property\n def name(self) -> str:\n if self.items:\n return self.items[0].name\n else:\n # This may happen for malformed overload\n assert self.impl is not None\n return self.impl.name\n\n def accept(self, visitor: StatementVisitor[T]) -> T:\n return visitor.visit_overloaded_func_def(self)\n\n def serialize(self) -> JsonDict:\n return {'.class': 'OverloadedFuncDef',\n 'items': [i.serialize() for i in self.items],\n 'type': None if self.type is None else self.type.serialize(),\n 'fullname': self._fullname,\n 'impl': None if self.impl is None else self.impl.serialize(),\n 'flags': get_flags(self, FUNCBASE_FLAGS),\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_OverloadedFuncDef.deserialize_OverloadedFuncDef.deserialize.return.res": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_OverloadedFuncDef.deserialize_OverloadedFuncDef.deserialize.return.res", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 531, "end_line": 549, "span_ids": ["OverloadedFuncDef.deserialize"], "tokens": 215}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class OverloadedFuncDef(FuncBase, SymbolNode, Statement):\n\n @classmethod\n def deserialize(cls, data: JsonDict) -> 'OverloadedFuncDef':\n assert data['.class'] == 'OverloadedFuncDef'\n res = OverloadedFuncDef([\n cast(OverloadPart, SymbolNode.deserialize(d))\n for d in data['items']])\n if data.get('impl') is not None:\n res.impl = cast(OverloadPart, SymbolNode.deserialize(data['impl']))\n # set line for empty overload items, as not set in __init__\n if len(res.items) > 0:\n res.set_line(res.impl.line)\n if data.get('type') is not None:\n typ = mypy.types.deserialize_type(data['type'])\n assert isinstance(typ, mypy.types.ProperType)\n res.type = typ\n res._fullname = data['fullname']\n set_flags(res, data['flags'])\n # NOTE: res.info will be set in the fixup phase.\n return res", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_Argument_FUNCITEM_FLAGS.FUNCBASE_FLAGS_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_Argument_FUNCITEM_FLAGS.FUNCBASE_FLAGS_", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 552, "end_line": 583, "span_ids": ["Argument.set_line", "Argument", "Argument.__init__", "impl:51"], "tokens": 244}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Argument(Node):\n \"\"\"A single argument in a FuncItem.\"\"\"\n\n __slots__ = ('variable', 'type_annotation', 'initializer', 'kind')\n\n def __init__(self,\n variable: 'Var',\n type_annotation: 'Optional[mypy.types.Type]',\n initializer: Optional[Expression],\n kind: int) -> None:\n super().__init__()\n self.variable = variable\n self.type_annotation = type_annotation\n self.initializer = initializer\n self.kind = kind # must be an ARG_* constant\n\n def set_line(self,\n target: Union[Context, int],\n column: Optional[int] = None,\n end_line: Optional[int] = None) -> None:\n super().set_line(target, column, end_line)\n\n if self.initializer and self.initializer.line < 0:\n self.initializer.set_line(self.line, self.column, self.end_line)\n\n self.variable.set_line(self.line, self.column, self.end_line)\n\n\nFUNCITEM_FLAGS = FUNCBASE_FLAGS + [\n 'is_overload', 'is_generator', 'is_coroutine', 'is_async_generator',\n 'is_awaitable_coroutine',\n]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_None_36_FuncItem.is_dynamic.return.self_type_is_None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_None_36_FuncItem.is_dynamic.return.self_type_is_None", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 583, "end_line": 641, "span_ids": ["FuncItem.set_line", "FuncItem.__init__", "FuncItem", "FuncItem.is_dynamic", "impl:51", "FuncItem.max_fixed_argc"], "tokens": 564}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": " # type: Final\n\n\nclass FuncItem(FuncBase):\n \"\"\"Base class for nodes usable as overloaded function items.\"\"\"\n\n __slots__ = ('arguments', # Note that can be None if deserialized (type is a lie!)\n 'arg_names', # Names of arguments\n 'arg_kinds', # Kinds of arguments\n 'min_args', # Minimum number of arguments\n 'max_pos', # Maximum number of positional arguments, -1 if no explicit\n # limit (*args not included)\n 'body', # Body of the function\n 'is_overload', # Is this an overload variant of function with more than\n # one overload variant?\n 'is_generator', # Contains a yield statement?\n 'is_coroutine', # Defined using 'async def' syntax?\n 'is_async_generator', # Is an async def generator?\n 'is_awaitable_coroutine', # Decorated with '@{typing,asyncio}.coroutine'?\n 'expanded', # Variants of function with type variables with values expanded\n )\n\n def __init__(self,\n arguments: List[Argument],\n body: 'Block',\n typ: 'Optional[mypy.types.FunctionLike]' = None) -> None:\n super().__init__()\n self.arguments = arguments\n self.arg_names = [arg.variable.name for arg in self.arguments]\n self.arg_kinds = [arg.kind for arg in self.arguments] # type: List[int]\n self.max_pos = self.arg_kinds.count(ARG_POS) + self.arg_kinds.count(ARG_OPT)\n self.body = body\n self.type = typ\n self.unanalyzed_type = typ\n self.is_overload = False\n self.is_generator = False\n self.is_coroutine = False\n self.is_async_generator = False\n self.is_awaitable_coroutine = False\n self.expanded = [] # type: List[FuncItem]\n\n self.min_args = 0\n for i in range(len(self.arguments)):\n if self.arguments[i] is None and i < self.max_fixed_argc():\n self.min_args = i + 1\n\n def max_fixed_argc(self) -> int:\n return self.max_pos\n\n def set_line(self,\n target: Union[Context, int],\n column: Optional[int] = None,\n end_line: Optional[int] = None) -> None:\n super().set_line(target, column, end_line)\n for arg in self.arguments:\n arg.set_line(self.line, self.column, self.end_line)\n\n def is_dynamic(self) -> bool:\n return self.type is None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_FUNCDEF_FLAGS_FuncDef.accept.return.visitor_visit_func_def_se": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_FUNCDEF_FLAGS_FuncDef.accept.return.visitor_visit_func_def_se", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 644, "end_line": 681, "span_ids": ["FuncDef.__init__", "FuncDef.name", "impl:53", "FuncDef", "FuncDef.accept"], "tokens": 266}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "FUNCDEF_FLAGS = FUNCITEM_FLAGS + [\n 'is_decorated', 'is_conditional', 'is_abstract',\n] # type: Final\n\n\nclass FuncDef(FuncItem, SymbolNode, Statement):\n \"\"\"Function definition.\n\n This is a non-lambda function defined using 'def'.\n \"\"\"\n\n __slots__ = ('_name',\n 'is_decorated',\n 'is_conditional',\n 'is_abstract',\n 'original_def',\n )\n\n def __init__(self,\n name: str, # Function name\n arguments: List[Argument],\n body: 'Block',\n typ: 'Optional[mypy.types.FunctionLike]' = None) -> None:\n super().__init__(arguments, body, typ)\n self._name = name\n self.is_decorated = False\n self.is_conditional = False # Defined conditionally (within block)?\n self.is_abstract = False\n self.is_final = False\n # Original conditional definition\n self.original_def = None # type: Union[None, FuncDef, Var, Decorator]\n\n @property\n def name(self) -> str:\n return self._name\n\n def accept(self, visitor: StatementVisitor[T]) -> T:\n return visitor.visit_func_def(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_FuncDef.serialize_FuncDef.serialize.return._class_FuncDef_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_FuncDef.serialize_FuncDef.serialize.return._class_FuncDef_", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 683, "end_line": 698, "span_ids": ["FuncDef.serialize"], "tokens": 204}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FuncDef(FuncItem, SymbolNode, Statement):\n\n def serialize(self) -> JsonDict:\n # We're deliberating omitting arguments and storing only arg_names and\n # arg_kinds for space-saving reasons (arguments is not used in later\n # stages of mypy).\n # TODO: After a FuncDef is deserialized, the only time we use `arg_names`\n # and `arg_kinds` is when `type` is None and we need to infer a type. Can\n # we store the inferred type ahead of time?\n return {'.class': 'FuncDef',\n 'name': self._name,\n 'fullname': self._fullname,\n 'arg_names': self.arg_names,\n 'arg_kinds': self.arg_kinds,\n 'type': None if self.type is None else self.type.serialize(),\n 'flags': get_flags(self, FUNCDEF_FLAGS),\n # TODO: Do we need expanded, original_def?\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_FuncDef.deserialize_SYMBOL_FUNCBASE_TYPES._OverloadedFuncDef_FuncD": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_FuncDef.deserialize_SYMBOL_FUNCBASE_TYPES._OverloadedFuncDef_FuncD", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 700, "end_line": 724, "span_ids": ["FuncDef.deserialize", "impl:55"], "tokens": 221}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FuncDef(FuncItem, SymbolNode, Statement):\n\n @classmethod\n def deserialize(cls, data: JsonDict) -> 'FuncDef':\n assert data['.class'] == 'FuncDef'\n body = Block([])\n ret = FuncDef(data['name'],\n [],\n body,\n (None if data['type'] is None\n else cast(mypy.types.FunctionLike,\n mypy.types.deserialize_type(data['type']))))\n ret._fullname = data['fullname']\n set_flags(ret, data['flags'])\n # NOTE: ret.info is set in the fixup phase.\n ret.arg_names = data['arg_names']\n ret.arg_kinds = data['arg_kinds']\n # Leave these uninitialized so that future uses will trigger an error\n del ret.arguments\n del ret.max_pos\n del ret.min_args\n return ret\n\n\n# All types that are both SymbolNodes and FuncBases. See the FuncBase\n# docstring for the rationale.\nSYMBOL_FUNCBASE_TYPES = (OverloadedFuncDef, FuncDef)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_Decorator_VAR_FLAGS._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_Decorator_VAR_FLAGS._", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 727, "end_line": 795, "span_ids": ["Decorator.__init__", "Decorator.type", "Decorator", "Decorator.info", "Decorator.name", "Decorator.serialize", "impl:57", "Decorator.fullname", "Decorator.deserialize", "Decorator.accept", "Decorator.is_final"], "tokens": 523}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Decorator(SymbolNode, Statement):\n \"\"\"A decorated function.\n\n A single Decorator object can include any number of function decorators.\n \"\"\"\n\n func = None # type: FuncDef # Decorated function\n decorators = None # type: List[Expression] # Decorators (may be empty)\n # Some decorators are removed by semanal, keep the original here.\n original_decorators = None # type: List[Expression]\n # TODO: This is mostly used for the type; consider replacing with a 'type' attribute\n var = None # type: Var # Represents the decorated function obj\n is_overload = False\n\n def __init__(self, func: FuncDef, decorators: List[Expression],\n var: 'Var') -> None:\n super().__init__()\n self.func = func\n self.decorators = decorators\n self.original_decorators = decorators.copy()\n self.var = var\n self.is_overload = False\n\n @property\n def name(self) -> str:\n return self.func.name\n\n @property\n def fullname(self) -> Bogus[str]:\n return self.func.fullname\n\n @property\n def is_final(self) -> bool:\n return self.func.is_final\n\n @property\n def info(self) -> 'TypeInfo':\n return self.func.info\n\n @property\n def type(self) -> 'Optional[mypy.types.Type]':\n return self.var.type\n\n def accept(self, visitor: StatementVisitor[T]) -> T:\n return visitor.visit_decorator(self)\n\n def serialize(self) -> JsonDict:\n return {'.class': 'Decorator',\n 'func': self.func.serialize(),\n 'var': self.var.serialize(),\n 'is_overload': self.is_overload,\n }\n\n @classmethod\n def deserialize(cls, data: JsonDict) -> 'Decorator':\n assert data['.class'] == 'Decorator'\n dec = Decorator(FuncDef.deserialize(data['func']),\n [],\n Var.deserialize(data['var']))\n dec.is_overload = data['is_overload']\n return dec\n\n\nVAR_FLAGS = [\n 'is_self', 'is_initialized_in_class', 'is_staticmethod',\n 'is_classmethod', 'is_property', 'is_settable_property', 'is_suppressed_import',\n 'is_classvar', 'is_abstract_var', 'is_final', 'final_unset_in_class', 'final_set_in_init',\n 'explicit_self_type', 'is_ready',\n]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_None_40_Var.accept.return.visitor_visit_var_self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_None_40_Var.accept.return.visitor_visit_var_self_", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 795, "end_line": 879, "span_ids": ["Var.__init__", "impl:57", "Var.fullname", "Var.name", "Var.accept", "Var"], "tokens": 739}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": " # type: Final\n\n\nclass Var(SymbolNode):\n \"\"\"A variable.\n\n It can refer to global/local variable or a data attribute.\n \"\"\"\n\n __slots__ = ('_name',\n '_fullname',\n 'info',\n 'type',\n 'final_value',\n 'is_self',\n 'is_ready',\n 'is_inferred',\n 'is_initialized_in_class',\n 'is_staticmethod',\n 'is_classmethod',\n 'is_property',\n 'is_settable_property',\n 'is_classvar',\n 'is_abstract_var',\n 'is_final',\n 'final_unset_in_class',\n 'final_set_in_init',\n 'is_suppressed_import',\n 'explicit_self_type',\n 'from_module_getattr',\n )\n\n def __init__(self, name: str, type: 'Optional[mypy.types.Type]' = None) -> None:\n super().__init__()\n self._name = name # Name without module prefix\n # TODO: Should be Optional[str]\n self._fullname = cast('Bogus[str]', None) # Name with module prefix\n # TODO: Should be Optional[TypeInfo]\n self.info = VAR_NO_INFO\n self.type = type # type: Optional[mypy.types.Type] # Declared or inferred type, or None\n # Is this the first argument to an ordinary method (usually \"self\")?\n self.is_self = False\n self.is_ready = True # If inferred, is the inferred type available?\n self.is_inferred = (self.type is None)\n # Is this initialized explicitly to a non-None value in class body?\n self.is_initialized_in_class = False\n self.is_staticmethod = False\n self.is_classmethod = False\n self.is_property = False\n self.is_settable_property = False\n self.is_classvar = False\n self.is_abstract_var = False\n # Set to true when this variable refers to a module we were unable to\n # parse for some reason (eg a silenced module)\n self.is_suppressed_import = False\n # Was this \"variable\" (rather a constant) defined as Final[...]?\n self.is_final = False\n # If constant value is a simple literal,\n # store the literal value (unboxed) for the benefit of\n # tools like mypyc.\n self.final_value = None # type: Optional[Union[int, float, bool, str]]\n # Where the value was set (only for class attributes)\n self.final_unset_in_class = False\n self.final_set_in_init = False\n # This is True for a variable that was declared on self with an explicit type:\n # class C:\n # def __init__(self) -> None:\n # self.x: int\n # This case is important because this defines a new Var, even if there is one\n # present in a superclass (without explicit type this doesn't create a new Var).\n # See SemanticAnalyzer.analyze_member_lvalue() for details.\n self.explicit_self_type = False\n # If True, this is an implicit Var created due to module-level __getattr__.\n self.from_module_getattr = False\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def fullname(self) -> Bogus[str]:\n return self._fullname\n\n def accept(self, visitor: NodeVisitor[T]) -> T:\n return visitor.visit_var(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_Var.serialize_Var.serialize.return.data": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_Var.serialize_Var.serialize.return.data", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 881, "end_line": 892, "span_ids": ["Var.serialize"], "tokens": 125}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Var(SymbolNode):\n\n def serialize(self) -> JsonDict:\n # TODO: Leave default values out?\n # NOTE: Sometimes self.is_ready is False here, but we don't care.\n data = {'.class': 'Var',\n 'name': self._name,\n 'fullname': self._fullname,\n 'type': None if self.type is None else self.type.serialize(),\n 'flags': get_flags(self, VAR_FLAGS),\n } # type: JsonDict\n if self.final_value is not None:\n data['final_value'] = self.final_value\n return data", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_Var.deserialize_Var.deserialize.return.v": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_Var.deserialize_Var.deserialize.return.v", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 894, "end_line": 904, "span_ids": ["Var.deserialize"], "tokens": 118}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Var(SymbolNode):\n\n @classmethod\n def deserialize(cls, data: JsonDict) -> 'Var':\n assert data['.class'] == 'Var'\n name = data['name']\n type = None if data['type'] is None else mypy.types.deserialize_type(data['type'])\n v = Var(name, type)\n v.is_ready = False # Override True default set in __init__\n v._fullname = data['fullname']\n set_flags(v, data['flags'])\n v.final_value = data.get('final_value')\n return v", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_ClassDef_ClassDef.deserialize.return.res": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_ClassDef_ClassDef.deserialize.return.res", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 907, "end_line": 966, "span_ids": ["ClassDef.accept", "ClassDef.serialize", "ClassDef.is_generic", "ClassDef.__init__", "ClassDef", "ClassDef.deserialize"], "tokens": 566}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ClassDef(Statement):\n \"\"\"Class definition\"\"\"\n\n name = None # type: str # Name of the class without module prefix\n fullname = None # type: Bogus[str] # Fully qualified name of the class\n defs = None # type: Block\n type_vars = None # type: List[mypy.types.TypeVarDef]\n # Base class expressions (not semantically analyzed -- can be arbitrary expressions)\n base_type_exprs = None # type: List[Expression]\n # Special base classes like Generic[...] get moved here during semantic analysis\n removed_base_type_exprs = None # type: List[Expression]\n info = None # type: TypeInfo # Related TypeInfo\n metaclass = None # type: Optional[Expression]\n decorators = None # type: List[Expression]\n keywords = None # type: OrderedDict[str, Expression]\n analyzed = None # type: Optional[Expression]\n has_incompatible_baseclass = False\n\n def __init__(self,\n name: str,\n defs: 'Block',\n type_vars: Optional[List['mypy.types.TypeVarDef']] = None,\n base_type_exprs: Optional[List[Expression]] = None,\n metaclass: Optional[Expression] = None,\n keywords: Optional[List[Tuple[str, Expression]]] = None) -> None:\n super().__init__()\n self.name = name\n self.defs = defs\n self.type_vars = type_vars or []\n self.base_type_exprs = base_type_exprs or []\n self.removed_base_type_exprs = []\n self.info = CLASSDEF_NO_INFO\n self.metaclass = metaclass\n self.decorators = []\n self.keywords = OrderedDict(keywords or [])\n\n def accept(self, visitor: StatementVisitor[T]) -> T:\n return visitor.visit_class_def(self)\n\n def is_generic(self) -> bool:\n return self.info.is_generic()\n\n def serialize(self) -> JsonDict:\n # Not serialized: defs, base_type_exprs, metaclass, decorators,\n # analyzed (for named tuples etc.)\n return {'.class': 'ClassDef',\n 'name': self.name,\n 'fullname': self.fullname,\n 'type_vars': [v.serialize() for v in self.type_vars],\n }\n\n @classmethod\n def deserialize(self, data: JsonDict) -> 'ClassDef':\n assert data['.class'] == 'ClassDef'\n res = ClassDef(data['name'],\n Block([]),\n [mypy.types.TypeVarDef.deserialize(v) for v in data['type_vars']],\n )\n res.fullname = data['fullname']\n return res", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_GlobalDecl_NonlocalDecl.accept.return.visitor_visit_nonlocal_de": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_GlobalDecl_NonlocalDecl.accept.return.visitor_visit_nonlocal_de", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 969, "end_line": 992, "span_ids": ["GlobalDecl", "GlobalDecl.__init__", "NonlocalDecl.accept", "NonlocalDecl", "NonlocalDecl.__init__", "GlobalDecl.accept"], "tokens": 153}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GlobalDecl(Statement):\n \"\"\"Declaration global x, y, ...\"\"\"\n\n names = None # type: List[str]\n\n def __init__(self, names: List[str]) -> None:\n super().__init__()\n self.names = names\n\n def accept(self, visitor: StatementVisitor[T]) -> T:\n return visitor.visit_global_decl(self)\n\n\nclass NonlocalDecl(Statement):\n \"\"\"Declaration nonlocal x, y, ...\"\"\"\n\n names = None # type: List[str]\n\n def __init__(self, names: List[str]) -> None:\n super().__init__()\n self.names = names\n\n def accept(self, visitor: StatementVisitor[T]) -> T:\n return visitor.visit_nonlocal_decl(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_Block_ExpressionStmt.accept.return.visitor_visit_expression_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_Block_ExpressionStmt.accept.return.visitor_visit_expression_", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 995, "end_line": 1024, "span_ids": ["Block.accept", "ExpressionStmt.accept", "ExpressionStmt", "Block.__init__", "ExpressionStmt.__init__", "Block"], "tokens": 227}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Block(Statement):\n __slots__ = ('body', 'is_unreachable')\n\n def __init__(self, body: List[Statement]) -> None:\n super().__init__()\n self.body = body\n # True if we can determine that this block is not executed during semantic\n # analysis. For example, this applies to blocks that are protected by\n # something like \"if PY3:\" when using Python 2. However, some code is\n # only considered unreachable during type checking and this is not true\n # in those cases.\n self.is_unreachable = False\n\n def accept(self, visitor: StatementVisitor[T]) -> T:\n return visitor.visit_block(self)\n\n\n# Statements\n\n\nclass ExpressionStmt(Statement):\n \"\"\"An expression as a statement, such as print(s).\"\"\"\n expr = None # type: Expression\n\n def __init__(self, expr: Expression) -> None:\n super().__init__()\n self.expr = expr\n\n def accept(self, visitor: StatementVisitor[T]) -> T:\n return visitor.visit_expression_stmt(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_AssignmentStmt_AssignmentStmt.accept.return.visitor_visit_assignment_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_AssignmentStmt_AssignmentStmt.accept.return.visitor_visit_assignment_", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1027, "end_line": 1067, "span_ids": ["AssignmentStmt.accept", "AssignmentStmt.__init__", "AssignmentStmt"], "tokens": 455}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class AssignmentStmt(Statement):\n \"\"\"Assignment statement.\n\n The same node class is used for single assignment, multiple assignment\n (e.g. x, y = z) and chained assignment (e.g. x = y = z), assignments\n that define new names, and assignments with explicit types (\"# type: t\"\n or \"x: t [= ...]\").\n\n An lvalue can be NameExpr, TupleExpr, ListExpr, MemberExpr, or IndexExpr.\n \"\"\"\n\n lvalues = None # type: List[Lvalue]\n # This is a TempNode if and only if no rvalue (x: t).\n rvalue = None # type: Expression\n # Declared type in a comment, may be None.\n type = None # type: Optional[mypy.types.Type]\n # Original, not semantically analyzed type in annotation (used for reprocessing)\n unanalyzed_type = None # type: Optional[mypy.types.Type]\n # This indicates usage of PEP 526 type annotation syntax in assignment.\n new_syntax = False # type: bool\n # Does this assignment define a type alias?\n is_alias_def = False\n # Is this a final definition?\n # Final attributes can't be re-assigned once set, and can't be overridden\n # in a subclass. This flag is not set if an attempted declaration was found to\n # be invalid during semantic analysis. It is still set to `True` if\n # a final declaration overrides another final declaration (this is checked\n # during type checking when MROs are known).\n is_final_def = False\n\n def __init__(self, lvalues: List[Lvalue], rvalue: Expression,\n type: 'Optional[mypy.types.Type]' = None, new_syntax: bool = False) -> None:\n super().__init__()\n self.lvalues = lvalues\n self.rvalue = rvalue\n self.type = type\n self.unanalyzed_type = type\n self.new_syntax = new_syntax\n\n def accept(self, visitor: StatementVisitor[T]) -> T:\n return visitor.visit_assignment_stmt(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_OperatorAssignmentStmt_WhileStmt.accept.return.visitor_visit_while_stmt_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_OperatorAssignmentStmt_WhileStmt.accept.return.visitor_visit_while_stmt_", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1070, "end_line": 1099, "span_ids": ["OperatorAssignmentStmt.accept", "WhileStmt", "OperatorAssignmentStmt", "WhileStmt.__init__", "OperatorAssignmentStmt.__init__", "WhileStmt.accept"], "tokens": 233}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class OperatorAssignmentStmt(Statement):\n \"\"\"Operator assignment statement such as x += 1\"\"\"\n\n op = ''\n lvalue = None # type: Lvalue\n rvalue = None # type: Expression\n\n def __init__(self, op: str, lvalue: Lvalue, rvalue: Expression) -> None:\n super().__init__()\n self.op = op\n self.lvalue = lvalue\n self.rvalue = rvalue\n\n def accept(self, visitor: StatementVisitor[T]) -> T:\n return visitor.visit_operator_assignment_stmt(self)\n\n\nclass WhileStmt(Statement):\n expr = None # type: Expression\n body = None # type: Block\n else_body = None # type: Optional[Block]\n\n def __init__(self, expr: Expression, body: Block, else_body: Optional[Block]) -> None:\n super().__init__()\n self.expr = expr\n self.body = body\n self.else_body = else_body\n\n def accept(self, visitor: StatementVisitor[T]) -> T:\n return visitor.visit_while_stmt(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_ForStmt_ForStmt.accept.return.visitor_visit_for_stmt_se": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_ForStmt_ForStmt.accept.return.visitor_visit_for_stmt_se", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1102, "end_line": 1134, "span_ids": ["ForStmt.__init__", "ForStmt", "ForStmt.accept"], "tokens": 319}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ForStmt(Statement):\n # Index variables\n index = None # type: Lvalue\n # Type given by type comments for index, can be None\n index_type = None # type: Optional[mypy.types.Type]\n # Original, not semantically analyzed type in annotation (used for reprocessing)\n unanalyzed_index_type = None # type: Optional[mypy.types.Type]\n # Inferred iterable item type\n inferred_item_type = None # type: Optional[mypy.types.Type]\n # Inferred iterator type\n inferred_iterator_type = None # type: Optional[mypy.types.Type]\n # Expression to iterate\n expr = None # type: Expression\n body = None # type: Block\n else_body = None # type: Optional[Block]\n is_async = False # True if `async for ...` (PEP 492, Python 3.5)\n\n def __init__(self,\n index: Lvalue,\n expr: Expression,\n body: Block,\n else_body: Optional[Block],\n index_type: 'Optional[mypy.types.Type]' = None) -> None:\n super().__init__()\n self.index = index\n self.index_type = index_type\n self.unanalyzed_index_type = index_type\n self.expr = expr\n self.body = body\n self.else_body = else_body\n\n def accept(self, visitor: StatementVisitor[T]) -> T:\n return visitor.visit_for_stmt(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_ReturnStmt_PassStmt.accept.return.visitor_visit_pass_stmt_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_ReturnStmt_PassStmt.accept.return.visitor_visit_pass_stmt_s", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1137, "end_line": 1184, "span_ids": ["DelStmt", "AssertStmt", "BreakStmt.accept", "PassStmt", "AssertStmt.__init__", "BreakStmt", "ContinueStmt.accept", "ReturnStmt.accept", "ReturnStmt", "ContinueStmt", "PassStmt.accept", "DelStmt.accept", "DelStmt.__init__", "AssertStmt.accept", "ReturnStmt.__init__"], "tokens": 306}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ReturnStmt(Statement):\n expr = None # type: Optional[Expression]\n\n def __init__(self, expr: Optional[Expression]) -> None:\n super().__init__()\n self.expr = expr\n\n def accept(self, visitor: StatementVisitor[T]) -> T:\n return visitor.visit_return_stmt(self)\n\n\nclass AssertStmt(Statement):\n expr = None # type: Expression\n msg = None # type: Optional[Expression]\n\n def __init__(self, expr: Expression, msg: Optional[Expression] = None) -> None:\n super().__init__()\n self.expr = expr\n self.msg = msg\n\n def accept(self, visitor: StatementVisitor[T]) -> T:\n return visitor.visit_assert_stmt(self)\n\n\nclass DelStmt(Statement):\n expr = None # type: Lvalue\n\n def __init__(self, expr: Lvalue) -> None:\n super().__init__()\n self.expr = expr\n\n def accept(self, visitor: StatementVisitor[T]) -> T:\n return visitor.visit_del_stmt(self)\n\n\nclass BreakStmt(Statement):\n def accept(self, visitor: StatementVisitor[T]) -> T:\n return visitor.visit_break_stmt(self)\n\n\nclass ContinueStmt(Statement):\n def accept(self, visitor: StatementVisitor[T]) -> T:\n return visitor.visit_continue_stmt(self)\n\n\nclass PassStmt(Statement):\n def accept(self, visitor: StatementVisitor[T]) -> T:\n return visitor.visit_pass_stmt(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_IfStmt_RaiseStmt.accept.return.visitor_visit_raise_stmt_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_IfStmt_RaiseStmt.accept.return.visitor_visit_raise_stmt_", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1187, "end_line": 1214, "span_ids": ["IfStmt", "IfStmt.accept", "RaiseStmt.__init__", "RaiseStmt.accept", "IfStmt.__init__", "RaiseStmt"], "tokens": 227}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IfStmt(Statement):\n expr = None # type: List[Expression]\n body = None # type: List[Block]\n else_body = None # type: Optional[Block]\n\n def __init__(self, expr: List[Expression], body: List[Block],\n else_body: Optional[Block]) -> None:\n super().__init__()\n self.expr = expr\n self.body = body\n self.else_body = else_body\n\n def accept(self, visitor: StatementVisitor[T]) -> T:\n return visitor.visit_if_stmt(self)\n\n\nclass RaiseStmt(Statement):\n # Plain 'raise' is a valid statement.\n expr = None # type: Optional[Expression]\n from_expr = None # type: Optional[Expression]\n\n def __init__(self, expr: Optional[Expression], from_expr: Optional[Expression]) -> None:\n super().__init__()\n self.expr = expr\n self.from_expr = from_expr\n\n def accept(self, visitor: StatementVisitor[T]) -> T:\n return visitor.visit_raise_stmt(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_TryStmt_TryStmt.accept.return.visitor_visit_try_stmt_se": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_TryStmt_TryStmt.accept.return.visitor_visit_try_stmt_se", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1217, "end_line": 1239, "span_ids": ["TryStmt.accept", "TryStmt.__init__", "TryStmt"], "tokens": 237}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TryStmt(Statement):\n body = None # type: Block # Try body\n # Plain 'except:' also possible\n types = None # type: List[Optional[Expression]] # Except type expressions\n vars = None # type: List[Optional[NameExpr]] # Except variable names\n handlers = None # type: List[Block] # Except bodies\n else_body = None # type: Optional[Block]\n finally_body = None # type: Optional[Block]\n\n def __init__(self, body: Block, vars: List['Optional[NameExpr]'],\n types: List[Optional[Expression]],\n handlers: List[Block], else_body: Optional[Block],\n finally_body: Optional[Block]) -> None:\n super().__init__()\n self.body = body\n self.vars = vars\n self.types = types\n self.handlers = handlers\n self.else_body = else_body\n self.finally_body = finally_body\n\n def accept(self, visitor: StatementVisitor[T]) -> T:\n return visitor.visit_try_stmt(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_WithStmt_WithStmt.accept.return.visitor_visit_with_stmt_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_WithStmt_WithStmt.accept.return.visitor_visit_with_stmt_s", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1242, "end_line": 1262, "span_ids": ["WithStmt", "WithStmt.__init__", "WithStmt.accept"], "tokens": 233}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class WithStmt(Statement):\n expr = None # type: List[Expression]\n target = None # type: List[Optional[Lvalue]]\n # Type given by type comments for target, can be None\n unanalyzed_type = None # type: Optional[mypy.types.Type]\n # Semantically analyzed types from type comment (TypeList type expanded)\n analyzed_types = None # type: List[mypy.types.Type]\n body = None # type: Block\n is_async = False # True if `async with ...` (PEP 492, Python 3.5)\n\n def __init__(self, expr: List[Expression], target: List[Optional[Lvalue]],\n body: Block, target_type: 'Optional[mypy.types.Type]' = None) -> None:\n super().__init__()\n self.expr = expr\n self.target = target\n self.unanalyzed_type = target_type\n self.analyzed_types = []\n self.body = body\n\n def accept(self, visitor: StatementVisitor[T]) -> T:\n return visitor.visit_with_stmt(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_PrintStmt_PrintStmt.accept.return.visitor_visit_print_stmt_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_PrintStmt_PrintStmt.accept.return.visitor_visit_print_stmt_", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1265, "end_line": 1283, "span_ids": ["PrintStmt", "PrintStmt.__init__", "PrintStmt.accept"], "tokens": 133}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PrintStmt(Statement):\n \"\"\"Python 2 print statement\"\"\"\n\n args = None # type: List[Expression]\n newline = False\n # The file-like target object (given using >>).\n target = None # type: Optional[Expression]\n\n def __init__(self,\n args: List[Expression],\n newline: bool,\n target: Optional[Expression] = None) -> None:\n super().__init__()\n self.args = args\n self.newline = newline\n self.target = target\n\n def accept(self, visitor: StatementVisitor[T]) -> T:\n return visitor.visit_print_stmt(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_ExecStmt_IntExpr.accept.return.visitor_visit_int_expr_se": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_ExecStmt_IntExpr.accept.return.visitor_visit_int_expr_se", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1286, "end_line": 1318, "span_ids": ["IntExpr.accept", "IntExpr.__init__", "ExecStmt", "ExecStmt.__init__", "IntExpr", "ExecStmt.accept"], "tokens": 189}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExecStmt(Statement):\n \"\"\"Python 2 exec statement\"\"\"\n\n expr = None # type: Expression\n globals = None # type: Optional[Expression]\n locals = None # type: Optional[Expression]\n\n def __init__(self, expr: Expression,\n globals: Optional[Expression],\n locals: Optional[Expression]) -> None:\n super().__init__()\n self.expr = expr\n self.globals = globals\n self.locals = locals\n\n def accept(self, visitor: StatementVisitor[T]) -> T:\n return visitor.visit_exec_stmt(self)\n\n\n# Expressions\n\n\nclass IntExpr(Expression):\n \"\"\"Integer literal\"\"\"\n\n value = 0\n\n def __init__(self, value: int) -> None:\n super().__init__()\n self.value = value\n\n def accept(self, visitor: ExpressionVisitor[T]) -> T:\n return visitor.visit_int_expr(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py__How_mypy_uses_StrExpr__StrExpr.accept.return.visitor_visit_str_expr_se": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py__How_mypy_uses_StrExpr__StrExpr.accept.return.visitor_visit_str_expr_se", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1321, "end_line": 1357, "span_ids": ["StrExpr", "IntExpr.accept", "StrExpr.__init__", "StrExpr.accept"], "tokens": 336}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# How mypy uses StrExpr, BytesExpr, and UnicodeExpr:\n# In Python 2 mode:\n# b'x', 'x' -> StrExpr\n# u'x' -> UnicodeExpr\n# BytesExpr is unused\n#\n# In Python 3 mode:\n# b'x' -> BytesExpr\n# 'x', u'x' -> StrExpr\n# UnicodeExpr is unused\n\nclass StrExpr(Expression):\n \"\"\"String literal\"\"\"\n\n value = ''\n\n # Keeps track of whether this string originated from Python 2 source code vs\n # Python 3 source code. We need to keep track of this information so we can\n # correctly handle types that have \"nested strings\". For example, consider this\n # type alias, where we have a forward reference to a literal type:\n #\n # Alias = List[\"Literal['foo']\"]\n #\n # When parsing this, we need to know whether the outer string and alias came from\n # Python 2 code vs Python 3 code so we can determine whether the inner `Literal['foo']`\n # is meant to be `Literal[u'foo']` or `Literal[b'foo']`.\n #\n # This field keeps track of that information.\n from_python_3 = True\n\n def __init__(self, value: str, from_python_3: bool = False) -> None:\n super().__init__()\n self.value = value\n self.from_python_3 = from_python_3\n\n def accept(self, visitor: ExpressionVisitor[T]) -> T:\n return visitor.visit_str_expr(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_BytesExpr_BytesExpr.accept.return.visitor_visit_bytes_expr_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_BytesExpr_BytesExpr.accept.return.visitor_visit_bytes_expr_", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1360, "end_line": 1379, "span_ids": ["BytesExpr.accept", "BytesExpr", "BytesExpr.__init__"], "tokens": 167}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BytesExpr(Expression):\n \"\"\"Bytes literal\"\"\"\n\n # Note: we deliberately do NOT use bytes here because it ends up\n # unnecessarily complicating a lot of the result logic. For example,\n # we'd have to worry about converting the bytes into a format we can\n # easily serialize/deserialize to and from JSON, would have to worry\n # about turning the bytes into a human-readable representation in\n # error messages...\n #\n # It's more convenient to just store the human-readable representation\n # from the very start.\n value = ''\n\n def __init__(self, value: str) -> None:\n super().__init__()\n self.value = value\n\n def accept(self, visitor: ExpressionVisitor[T]) -> T:\n return visitor.visit_bytes_expr(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_UnicodeExpr_StarExpr.accept.return.visitor_visit_star_expr_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_UnicodeExpr_StarExpr.accept.return.visitor_visit_star_expr_s", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1382, "end_line": 1439, "span_ids": ["EllipsisExpr.accept", "StarExpr", "ComplexExpr.accept", "StarExpr.accept", "UnicodeExpr.accept", "ComplexExpr", "UnicodeExpr.__init__", "FloatExpr.__init__", "ComplexExpr.__init__", "FloatExpr.accept", "StarExpr.__init__", "UnicodeExpr", "FloatExpr", "EllipsisExpr"], "tokens": 313}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class UnicodeExpr(Expression):\n \"\"\"Unicode literal (Python 2.x)\"\"\"\n\n value = ''\n\n def __init__(self, value: str) -> None:\n super().__init__()\n self.value = value\n\n def accept(self, visitor: ExpressionVisitor[T]) -> T:\n return visitor.visit_unicode_expr(self)\n\n\nclass FloatExpr(Expression):\n \"\"\"Float literal\"\"\"\n\n value = 0.0\n\n def __init__(self, value: float) -> None:\n super().__init__()\n self.value = value\n\n def accept(self, visitor: ExpressionVisitor[T]) -> T:\n return visitor.visit_float_expr(self)\n\n\nclass ComplexExpr(Expression):\n \"\"\"Complex literal\"\"\"\n\n def __init__(self, value: complex) -> None:\n super().__init__()\n self.value = value\n\n def accept(self, visitor: ExpressionVisitor[T]) -> T:\n return visitor.visit_complex_expr(self)\n\n\nclass EllipsisExpr(Expression):\n \"\"\"Ellipsis (...)\"\"\"\n\n def accept(self, visitor: ExpressionVisitor[T]) -> T:\n return visitor.visit_ellipsis(self)\n\n\nclass StarExpr(Expression):\n \"\"\"Star expression\"\"\"\n\n expr = None # type: Expression\n\n def __init__(self, expr: Expression) -> None:\n super().__init__()\n self.expr = expr\n\n # Whether this starred expression is used in a tuple/list and as lvalue\n self.valid = False\n\n def accept(self, visitor: ExpressionVisitor[T]) -> T:\n return visitor.visit_star_expr(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_NameExpr_NameExpr.serialize.assert_False_Serializin": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_NameExpr_NameExpr.serialize.assert_False_Serializin", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1466, "end_line": 1484, "span_ids": ["NameExpr", "NameExpr.serialize", "NameExpr.__init__", "NameExpr.accept"], "tokens": 152}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class NameExpr(RefExpr):\n \"\"\"Name expression\n\n This refers to a local name, global name or a module.\n \"\"\"\n\n __slots__ = ('name', 'is_special_form')\n\n def __init__(self, name: str) -> None:\n super().__init__()\n self.name = name # Name referred to (may be qualified)\n # Is this a l.h.s. of a special form assignment like typed dict or type variable?\n self.is_special_form = False\n\n def accept(self, visitor: ExpressionVisitor[T]) -> T:\n return visitor.visit_name_expr(self)\n\n def serialize(self) -> JsonDict:\n assert False, \"Serializing NameExpr: %s\" % (self,)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_MemberExpr_MemberExpr.accept.return.visitor_visit_member_expr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_MemberExpr_MemberExpr.accept.return.visitor_visit_member_expr", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1487, "end_line": 1501, "span_ids": ["MemberExpr.__init__", "MemberExpr", "MemberExpr.accept"], "tokens": 134}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MemberExpr(RefExpr):\n \"\"\"Member access expression x.y\"\"\"\n\n __slots__ = ('expr', 'name', 'def_var')\n\n def __init__(self, expr: Expression, name: str) -> None:\n super().__init__()\n self.expr = expr\n self.name = name\n # The variable node related to a definition through 'self.x = '.\n # The nodes of other kinds of member expressions are resolved during type checking.\n self.def_var = None # type: Optional[Var]\n\n def accept(self, visitor: ExpressionVisitor[T]) -> T:\n return visitor.visit_member_expr(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py__Kinds_of_arguments_ARG_NAMED_OPT.5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py__Kinds_of_arguments_ARG_NAMED_OPT.5", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1513, "end_line": 1526, "span_ids": ["impl:59", "MemberExpr.accept"], "tokens": 124}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Kinds of arguments\n\n# Positional argument\nARG_POS = 0 # type: Final\n# Positional, optional argument (functions only, not calls)\nARG_OPT = 1 # type: Final\n# *arg argument\nARG_STAR = 2 # type: Final\n# Keyword argument x=y in call, or keyword-only function arg\nARG_NAMED = 3 # type: Final\n# **arg argument\nARG_STAR2 = 4 # type: Final\n# In an argument list, keyword-only and also optional\nARG_NAMED_OPT = 5", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_None_65_CallExpr.accept.return.visitor_visit_call_expr_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_None_65_CallExpr.accept.return.visitor_visit_call_expr_s", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1526, "end_line": 1558, "span_ids": ["CallExpr.__init__", "CallExpr", "impl:59", "CallExpr.accept"], "tokens": 256}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": " # type: Final\n\n\nclass CallExpr(Expression):\n \"\"\"Call expression.\n\n This can also represent several special forms that are syntactically calls\n such as cast(...) and None # type: ....\n \"\"\"\n\n __slots__ = ('callee', 'args', 'arg_kinds', 'arg_names', 'analyzed')\n\n def __init__(self,\n callee: Expression,\n args: List[Expression],\n arg_kinds: List[int],\n arg_names: List[Optional[str]],\n analyzed: Optional[Expression] = None) -> None:\n super().__init__()\n if not arg_names:\n arg_names = [None] * len(args)\n\n self.callee = callee\n self.args = args\n self.arg_kinds = arg_kinds # ARG_ constants\n # Each name can be None if not a keyword argument.\n self.arg_names = arg_names # type: List[Optional[str]]\n # If not None, the node that represents the meaning of the CallExpr. For\n # cast(...) this is a CastExpr.\n self.analyzed = analyzed\n\n def accept(self, visitor: ExpressionVisitor[T]) -> T:\n return visitor.visit_call_expr(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_YieldFromExpr_YieldExpr.accept.return.visitor_visit_yield_expr_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_YieldFromExpr_YieldExpr.accept.return.visitor_visit_yield_expr_", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1552, "end_line": 1571, "span_ids": ["YieldExpr.__init__", "YieldFromExpr", "YieldFromExpr.__init__", "YieldExpr.accept", "YieldFromExpr.accept", "YieldExpr"], "tokens": 130}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class YieldFromExpr(Expression):\n expr = None # type: Expression\n\n def __init__(self, expr: Expression) -> None:\n super().__init__()\n self.expr = expr\n\n def accept(self, visitor: ExpressionVisitor[T]) -> T:\n return visitor.visit_yield_from_expr(self)\n\n\nclass YieldExpr(Expression):\n expr = None # type: Optional[Expression]\n\n def __init__(self, expr: Optional[Expression]) -> None:\n super().__init__()\n self.expr = expr\n\n def accept(self, visitor: ExpressionVisitor[T]) -> T:\n return visitor.visit_yield_expr(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_IndexExpr_IndexExpr.accept.return.visitor_visit_index_expr_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_IndexExpr_IndexExpr.accept.return.visitor_visit_index_expr_", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1574, "end_line": 1595, "span_ids": ["IndexExpr.__init__", "IndexExpr.accept", "IndexExpr"], "tokens": 185}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IndexExpr(Expression):\n \"\"\"Index expression x[y].\n\n Also wraps type application such as List[int] as a special form.\n \"\"\"\n\n base = None # type: Expression\n index = None # type: Expression\n # Inferred __getitem__ method type\n method_type = None # type: Optional[mypy.types.Type]\n # If not None, this is actually semantically a type application\n # Class[type, ...] or a type alias initializer.\n analyzed = None # type: Union[TypeApplication, TypeAliasExpr, None]\n\n def __init__(self, base: Expression, index: Expression) -> None:\n super().__init__()\n self.base = base\n self.index = index\n self.analyzed = None\n\n def accept(self, visitor: ExpressionVisitor[T]) -> T:\n return visitor.visit_index_expr(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_UnaryExpr__This_shortcut_is_used_o": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_UnaryExpr__This_shortcut_is_used_o", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1607, "end_line": 1700, "span_ids": ["AssignmentExpr.__init__", "AssignmentExpr", "UnaryExpr.__init__", "AssignmentExpr.accept", "UnaryExpr", "UnaryExpr.accept", "impl:71"], "tokens": 809}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class UnaryExpr(Expression):\n \"\"\"Unary operation\"\"\"\n\n op = ''\n expr = None # type: Expression\n # Inferred operator method type\n method_type = None # type: Optional[mypy.types.Type]\n\n def __init__(self, op: str, expr: Expression) -> None:\n super().__init__()\n self.op = op\n self.expr = expr\n\n def accept(self, visitor: ExpressionVisitor[T]) -> T:\n return visitor.visit_unary_expr(self)\n\n\nclass AssignmentExpr(Expression):\n \"\"\"Assignment expressions in Python 3.8+, like \"a := 2\".\"\"\"\n def __init__(self, target: Expression, value: Expression) -> None:\n super().__init__()\n self.target = target\n self.value = value\n\n def accept(self, visitor: ExpressionVisitor[T]) -> T:\n return visitor.visit_assignment_expr(self)\n\n\n# Map from binary operator id to related method name (in Python 3).\nop_methods = {\n '+': '__add__',\n '-': '__sub__',\n '*': '__mul__',\n '/': '__truediv__',\n '%': '__mod__',\n 'divmod': '__divmod__',\n '//': '__floordiv__',\n '**': '__pow__',\n '@': '__matmul__',\n '&': '__and__',\n '|': '__or__',\n '^': '__xor__',\n '<<': '__lshift__',\n '>>': '__rshift__',\n '==': '__eq__',\n '!=': '__ne__',\n '<': '__lt__',\n '>=': '__ge__',\n '>': '__gt__',\n '<=': '__le__',\n 'in': '__contains__',\n} # type: Final\n\nop_methods_to_symbols = {v: k for (k, v) in op_methods.items()} # type: Final\nop_methods_to_symbols['__div__'] = '/'\n\ncomparison_fallback_method = '__cmp__' # type: Final\nops_falling_back_to_cmp = {'__ne__', '__eq__',\n '__lt__', '__le__',\n '__gt__', '__ge__'} # type: Final\n\n\nops_with_inplace_method = {\n '+', '-', '*', '/', '%', '//', '**', '@', '&', '|', '^', '<<', '>>'} # type: Final\n\ninplace_operator_methods = set(\n '__i' + op_methods[op][2:] for op in ops_with_inplace_method) # type: Final\n\nreverse_op_methods = {\n '__add__': '__radd__',\n '__sub__': '__rsub__',\n '__mul__': '__rmul__',\n '__truediv__': '__rtruediv__',\n '__mod__': '__rmod__',\n '__divmod__': '__rdivmod__',\n '__floordiv__': '__rfloordiv__',\n '__pow__': '__rpow__',\n '__matmul__': '__rmatmul__',\n '__and__': '__rand__',\n '__or__': '__ror__',\n '__xor__': '__rxor__',\n '__lshift__': '__rlshift__',\n '__rshift__': '__rrshift__',\n '__eq__': '__eq__',\n '__ne__': '__ne__',\n '__lt__': '__gt__',\n '__ge__': '__le__',\n '__gt__': '__lt__',\n '__le__': '__ge__',\n} # type: Final\n\n# Suppose we have some class A. When we do A() + A(), Python will only check\n# the output of A().__add__(A()) and skip calling the __radd__ method entirely.\n# This shortcut is used only for the following methods:", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_op_methods_that_shortcut_unary_op_methods._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_op_methods_that_shortcut_unary_op_methods._", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1692, "end_line": 1717, "span_ids": ["impl:86"], "tokens": 169}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "op_methods_that_shortcut = {\n '__add__',\n '__sub__',\n '__mul__',\n '__div__',\n '__truediv__',\n '__mod__',\n '__divmod__',\n '__floordiv__',\n '__pow__',\n '__matmul__',\n '__and__',\n '__or__',\n '__xor__',\n '__lshift__',\n '__rshift__',\n} # type: Final\n\nnormal_from_reverse_op = dict((m, n) for n, m in reverse_op_methods.items()) # type: Final\nreverse_op_method_set = set(reverse_op_methods.values()) # type: Final\n\nunary_op_methods = {\n '-': '__neg__',\n '+': '__pos__',\n '~': '__invert__',\n}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_None_80_OpExpr.accept.return.visitor_visit_op_expr_sel": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_None_80_OpExpr.accept.return.visitor_visit_op_expr_sel", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1717, "end_line": 1741, "span_ids": ["OpExpr.__init__", "impl:86", "OpExpr", "OpExpr.accept"], "tokens": 187}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": " # type: Final\n\n\nclass OpExpr(Expression):\n \"\"\"Binary operation (other than . or [] or comparison operators,\n which have specific nodes).\"\"\"\n\n op = ''\n left = None # type: Expression\n right = None # type: Expression\n # Inferred type for the operator method type (when relevant).\n method_type = None # type: Optional[mypy.types.Type]\n # Is the right side going to be evaluated every time?\n right_always = False\n # Is the right side unreachable?\n right_unreachable = False\n\n def __init__(self, op: str, left: Expression, right: Expression) -> None:\n super().__init__()\n self.op = op\n self.left = left\n self.right = right\n\n def accept(self, visitor: ExpressionVisitor[T]) -> T:\n return visitor.visit_op_expr(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_ComparisonExpr_ComparisonExpr.accept.return.visitor_visit_comparison_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_ComparisonExpr_ComparisonExpr.accept.return.visitor_visit_comparison_", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1744, "end_line": 1766, "span_ids": ["ComparisonExpr.pairwise", "ComparisonExpr", "ComparisonExpr.__init__", "ComparisonExpr.accept"], "tokens": 234}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ComparisonExpr(Expression):\n \"\"\"Comparison expression (e.g. a < b > c < d).\"\"\"\n\n operators = None # type: List[str]\n operands = None # type: List[Expression]\n # Inferred type for the operator methods (when relevant; None for 'is').\n method_types = None # type: List[Optional[mypy.types.Type]]\n\n def __init__(self, operators: List[str], operands: List[Expression]) -> None:\n super().__init__()\n self.operators = operators\n self.operands = operands\n self.method_types = []\n\n def pairwise(self) -> Iterator[Tuple[str, Expression, Expression]]:\n \"\"\"If this comparison expr is \"a < b is c == d\", yields the sequence\n (\"<\", a, b), (\"is\", b, c), (\"==\", c, d)\n \"\"\"\n for i, operator in enumerate(self.operators):\n yield operator, self.operands[i], self.operands[i + 1]\n\n def accept(self, visitor: ExpressionVisitor[T]) -> T:\n return visitor.visit_comparison_expr(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_SliceExpr_SliceExpr.accept.return.visitor_visit_slice_expr_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_SliceExpr_SliceExpr.accept.return.visitor_visit_slice_expr_", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1769, "end_line": 1788, "span_ids": ["SliceExpr.accept", "SliceExpr.__init__", "SliceExpr"], "tokens": 159}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SliceExpr(Expression):\n \"\"\"Slice expression (e.g. 'x:y', 'x:', '::2' or ':').\n\n This is only valid as index in index expressions.\n \"\"\"\n\n begin_index = None # type: Optional[Expression]\n end_index = None # type: Optional[Expression]\n stride = None # type: Optional[Expression]\n\n def __init__(self, begin_index: Optional[Expression],\n end_index: Optional[Expression],\n stride: Optional[Expression]) -> None:\n super().__init__()\n self.begin_index = begin_index\n self.end_index = end_index\n self.stride = stride\n\n def accept(self, visitor: ExpressionVisitor[T]) -> T:\n return visitor.visit_slice_expr(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_CastExpr_RevealExpr.accept.return.visitor_visit_reveal_expr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_CastExpr_RevealExpr.accept.return.visitor_visit_reveal_expr", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1791, "end_line": 1823, "span_ids": ["RevealExpr.__init__", "CastExpr", "RevealExpr", "CastExpr.accept", "RevealExpr.accept", "CastExpr.__init__"], "tokens": 245}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CastExpr(Expression):\n \"\"\"Cast expression cast(type, expr).\"\"\"\n\n expr = None # type: Expression\n type = None # type: mypy.types.Type\n\n def __init__(self, expr: Expression, typ: 'mypy.types.Type') -> None:\n super().__init__()\n self.expr = expr\n self.type = typ\n\n def accept(self, visitor: ExpressionVisitor[T]) -> T:\n return visitor.visit_cast_expr(self)\n\n\nclass RevealExpr(Expression):\n \"\"\"Reveal type expression reveal_type(expr) or reveal_locals() expression.\"\"\"\n\n expr = None # type: Optional[Expression]\n kind = 0 # type: int\n local_nodes = None # type: Optional[List[Var]]\n\n def __init__(\n self, kind: int,\n expr: Optional[Expression] = None,\n local_nodes: 'Optional[List[Var]]' = None) -> None:\n super().__init__()\n self.expr = expr\n self.kind = kind\n self.local_nodes = local_nodes\n\n def accept(self, visitor: ExpressionVisitor[T]) -> T:\n return visitor.visit_reveal_expr(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_SuperExpr_LambdaExpr.is_dynamic.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_SuperExpr_LambdaExpr.is_dynamic.return.False", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1826, "end_line": 1860, "span_ids": ["LambdaExpr", "LambdaExpr.is_dynamic", "LambdaExpr.accept", "SuperExpr.__init__", "LambdaExpr.name", "LambdaExpr.expr", "SuperExpr", "SuperExpr.accept"], "tokens": 236}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SuperExpr(Expression):\n \"\"\"Expression super().name\"\"\"\n\n name = ''\n info = None # type: Optional[TypeInfo] # Type that contains this super expression\n call = None # type: CallExpr # The expression super(...)\n\n def __init__(self, name: str, call: CallExpr) -> None:\n super().__init__()\n self.name = name\n self.call = call\n\n def accept(self, visitor: ExpressionVisitor[T]) -> T:\n return visitor.visit_super_expr(self)\n\n\nclass LambdaExpr(FuncItem, Expression):\n \"\"\"Lambda expression\"\"\"\n\n @property\n def name(self) -> str:\n return ''\n\n def expr(self) -> Expression:\n \"\"\"Return the expression (the body) of the lambda.\"\"\"\n ret = cast(ReturnStmt, self.body.body[-1])\n expr = ret.expr\n assert expr is not None # lambda can't have empty body\n return expr\n\n def accept(self, visitor: ExpressionVisitor[T]) -> T:\n return visitor.visit_lambda_expr(self)\n\n def is_dynamic(self) -> bool:\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_ListExpr_SetExpr.accept.return.visitor_visit_set_expr_se": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_ListExpr_SetExpr.accept.return.visitor_visit_set_expr_se", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1863, "end_line": 1914, "span_ids": ["TupleExpr", "ListExpr", "SetExpr.__init__", "ListExpr.__init__", "SetExpr.accept", "TupleExpr.__init__", "TupleExpr.accept", "ListExpr.accept", "SetExpr", "DictExpr.__init__", "DictExpr.accept", "DictExpr"], "tokens": 331}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ListExpr(Expression):\n \"\"\"List literal expression [...].\"\"\"\n\n items = None # type: List[Expression]\n\n def __init__(self, items: List[Expression]) -> None:\n super().__init__()\n self.items = items\n\n def accept(self, visitor: ExpressionVisitor[T]) -> T:\n return visitor.visit_list_expr(self)\n\n\nclass DictExpr(Expression):\n \"\"\"Dictionary literal expression {key: value, ...}.\"\"\"\n\n items = None # type: List[Tuple[Optional[Expression], Expression]]\n\n def __init__(self, items: List[Tuple[Optional[Expression], Expression]]) -> None:\n super().__init__()\n self.items = items\n\n def accept(self, visitor: ExpressionVisitor[T]) -> T:\n return visitor.visit_dict_expr(self)\n\n\nclass TupleExpr(Expression):\n \"\"\"Tuple literal expression (..., ...)\n\n Also lvalue sequences (..., ...) and [..., ...]\"\"\"\n\n items = None # type: List[Expression]\n\n def __init__(self, items: List[Expression]) -> None:\n super().__init__()\n self.items = items\n\n def accept(self, visitor: ExpressionVisitor[T]) -> T:\n return visitor.visit_tuple_expr(self)\n\n\nclass SetExpr(Expression):\n \"\"\"Set literal expression {value, ...}.\"\"\"\n\n items = None # type: List[Expression]\n\n def __init__(self, items: List[Expression]) -> None:\n super().__init__()\n self.items = items\n\n def accept(self, visitor: ExpressionVisitor[T]) -> T:\n return visitor.visit_set_expr(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_GeneratorExpr_GeneratorExpr.accept.return.visitor_visit_generator_e": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_GeneratorExpr_GeneratorExpr.accept.return.visitor_visit_generator_e", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1917, "end_line": 1937, "span_ids": ["GeneratorExpr.__init__", "GeneratorExpr.accept", "GeneratorExpr"], "tokens": 196}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GeneratorExpr(Expression):\n \"\"\"Generator expression ... for ... in ... [ for ... in ... ] [ if ... ].\"\"\"\n\n left_expr = None # type: Expression\n sequences = None # type: List[Expression]\n condlists = None # type: List[List[Expression]]\n is_async = None # type: List[bool]\n indices = None # type: List[Lvalue]\n\n def __init__(self, left_expr: Expression, indices: List[Lvalue],\n sequences: List[Expression], condlists: List[List[Expression]],\n is_async: List[bool]) -> None:\n super().__init__()\n self.left_expr = left_expr\n self.sequences = sequences\n self.condlists = condlists\n self.indices = indices\n self.is_async = is_async\n\n def accept(self, visitor: ExpressionVisitor[T]) -> T:\n return visitor.visit_generator_expr(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_ListComprehension_SetComprehension.accept.return.visitor_visit_set_compreh": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_ListComprehension_SetComprehension.accept.return.visitor_visit_set_compreh", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1940, "end_line": 1963, "span_ids": ["SetComprehension", "SetComprehension.__init__", "ListComprehension.accept", "SetComprehension.accept", "ListComprehension.__init__", "ListComprehension"], "tokens": 174}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ListComprehension(Expression):\n \"\"\"List comprehension (e.g. [x + 1 for x in a])\"\"\"\n\n generator = None # type: GeneratorExpr\n\n def __init__(self, generator: GeneratorExpr) -> None:\n super().__init__()\n self.generator = generator\n\n def accept(self, visitor: ExpressionVisitor[T]) -> T:\n return visitor.visit_list_comprehension(self)\n\n\nclass SetComprehension(Expression):\n \"\"\"Set comprehension (e.g. {x + 1 for x in a})\"\"\"\n\n generator = None # type: GeneratorExpr\n\n def __init__(self, generator: GeneratorExpr) -> None:\n super().__init__()\n self.generator = generator\n\n def accept(self, visitor: ExpressionVisitor[T]) -> T:\n return visitor.visit_set_comprehension(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_DictionaryComprehension_DictionaryComprehension.accept.return.visitor_visit_dictionary_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_DictionaryComprehension_DictionaryComprehension.accept.return.visitor_visit_dictionary_", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1966, "end_line": 1988, "span_ids": ["DictionaryComprehension", "DictionaryComprehension.__init__", "DictionaryComprehension.accept"], "tokens": 215}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DictionaryComprehension(Expression):\n \"\"\"Dictionary comprehension (e.g. {k: v for k, v in a}\"\"\"\n\n key = None # type: Expression\n value = None # type: Expression\n sequences = None # type: List[Expression]\n condlists = None # type: List[List[Expression]]\n is_async = None # type: List[bool]\n indices = None # type: List[Lvalue]\n\n def __init__(self, key: Expression, value: Expression, indices: List[Lvalue],\n sequences: List[Expression], condlists: List[List[Expression]],\n is_async: List[bool]) -> None:\n super().__init__()\n self.key = key\n self.value = value\n self.sequences = sequences\n self.condlists = condlists\n self.indices = indices\n self.is_async = is_async\n\n def accept(self, visitor: ExpressionVisitor[T]) -> T:\n return visitor.visit_dictionary_comprehension(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_ConditionalExpr_ConditionalExpr.accept.return.visitor_visit_conditional": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_ConditionalExpr_ConditionalExpr.accept.return.visitor_visit_conditional", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1991, "end_line": 2005, "span_ids": ["ConditionalExpr.accept", "ConditionalExpr", "ConditionalExpr.__init__"], "tokens": 127}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ConditionalExpr(Expression):\n \"\"\"Conditional expression (e.g. x if y else z)\"\"\"\n\n cond = None # type: Expression\n if_expr = None # type: Expression\n else_expr = None # type: Expression\n\n def __init__(self, cond: Expression, if_expr: Expression, else_expr: Expression) -> None:\n super().__init__()\n self.cond = cond\n self.if_expr = if_expr\n self.else_expr = else_expr\n\n def accept(self, visitor: ExpressionVisitor[T]) -> T:\n return visitor.visit_conditional_expr(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_BackquoteExpr_CONTRAVARIANT.2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_BackquoteExpr_CONTRAVARIANT.2", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2017, "end_line": 2056, "span_ids": ["BackquoteExpr.accept", "TypeApplication.accept", "BackquoteExpr.__init__", "impl:94", "TypeApplication", "TypeApplication.__init__", "BackquoteExpr"], "tokens": 318}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BackquoteExpr(Expression):\n \"\"\"Python 2 expression `...`.\"\"\"\n\n expr = None # type: Expression\n\n def __init__(self, expr: Expression) -> None:\n super().__init__()\n self.expr = expr\n\n def accept(self, visitor: ExpressionVisitor[T]) -> T:\n return visitor.visit_backquote_expr(self)\n\n\nclass TypeApplication(Expression):\n \"\"\"Type application expr[type, ...]\"\"\"\n\n expr = None # type: Expression\n types = None # type: List[mypy.types.Type]\n\n def __init__(self, expr: Expression, types: List['mypy.types.Type']) -> None:\n super().__init__()\n self.expr = expr\n self.types = types\n\n def accept(self, visitor: ExpressionVisitor[T]) -> T:\n return visitor.visit_type_application(self)\n\n\n# Variance of a type variable. For example, T in the definition of\n# List[T] is invariant, so List[int] is not a subtype of List[object],\n# and also List[object] is not a subtype of List[int].\n#\n# The T in Iterable[T] is covariant, so Iterable[int] is a subtype of\n# Iterable[object], but not vice versa.\n#\n# If T is contravariant in Foo[T], Foo[object] is a subtype of\n# Foo[int], but not vice versa.\nINVARIANT = 0 # type: Final\nCOVARIANT = 1 # type: Final\nCONTRAVARIANT = 2", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_None_92_TypeVarLikeExpr.fullname.return.self__fullname": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_None_92_TypeVarLikeExpr.fullname.return.self__fullname", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2056, "end_line": 2087, "span_ids": ["TypeVarLikeExpr", "TypeVarLikeExpr.name", "TypeVarLikeExpr.fullname", "TypeVarLikeExpr.__init__", "impl:94"], "tokens": 249}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": " # type: Final\n\n\nclass TypeVarLikeExpr(SymbolNode, Expression):\n \"\"\"Base class for TypeVarExpr and ParamSpecExpr.\"\"\"\n _name = ''\n _fullname = ''\n # Upper bound: only subtypes of upper_bound are valid as values. By default\n # this is 'object', meaning no restriction.\n upper_bound = None # type: mypy.types.Type\n # Variance of the type variable. Invariant is the default.\n # TypeVar(..., covariant=True) defines a covariant type variable.\n # TypeVar(..., contravariant=True) defines a contravariant type\n # variable.\n variance = INVARIANT\n\n def __init__(\n self, name: str, fullname: str, upper_bound: 'mypy.types.Type', variance: int = INVARIANT\n ) -> None:\n super().__init__()\n self._name = name\n self._fullname = fullname\n self.upper_bound = upper_bound\n self.variance = variance\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def fullname(self) -> str:\n return self._fullname", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_TypeVarExpr_TypeVarExpr.deserialize.return.TypeVarExpr_data_name_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_TypeVarExpr_TypeVarExpr.deserialize.return.TypeVarExpr_data_name_", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2081, "end_line": 2122, "span_ids": ["TypeVarExpr.accept", "TypeVarExpr.__init__", "TypeVarExpr", "TypeVarExpr.serialize", "TypeVarExpr.deserialize"], "tokens": 375}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeVarExpr(TypeVarLikeExpr):\n \"\"\"Type variable expression TypeVar(...).\n\n This is also used to represent type variables in symbol tables.\n\n A type variable is not valid as a type unless bound in a TypeVarLikeScope.\n That happens within:\n\n 1. a generic class that uses the type variable as a type argument or\n 2. a generic function that refers to the type variable in its signature.\n \"\"\"\n # Value restriction: only types in the list are valid as values. If the\n # list is empty, there is no restriction.\n values = None # type: List[mypy.types.Type]\n\n def __init__(self, name: str, fullname: str,\n values: List['mypy.types.Type'],\n upper_bound: 'mypy.types.Type',\n variance: int = INVARIANT) -> None:\n super().__init__(name, fullname, upper_bound, variance)\n self.values = values\n\n def accept(self, visitor: ExpressionVisitor[T]) -> T:\n return visitor.visit_type_var_expr(self)\n\n def serialize(self) -> JsonDict:\n return {'.class': 'TypeVarExpr',\n 'name': self._name,\n 'fullname': self._fullname,\n 'values': [t.serialize() for t in self.values],\n 'upper_bound': self.upper_bound.serialize(),\n 'variance': self.variance,\n }\n\n @classmethod\n def deserialize(cls, data: JsonDict) -> 'TypeVarExpr':\n assert data['.class'] == 'TypeVarExpr'\n return TypeVarExpr(data['name'],\n data['fullname'],\n [mypy.types.deserialize_type(v) for v in data['values']],\n mypy.types.deserialize_type(data['upper_bound']),\n data['variance'])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_ParamSpecExpr_ParamSpecExpr.deserialize.return.ParamSpecExpr_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_ParamSpecExpr_ParamSpecExpr.deserialize.return.ParamSpecExpr_", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2125, "end_line": 2146, "span_ids": ["ParamSpecExpr.deserialize", "ParamSpecExpr.accept", "ParamSpecExpr.serialize", "ParamSpecExpr"], "tokens": 158}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ParamSpecExpr(TypeVarLikeExpr):\n def accept(self, visitor: ExpressionVisitor[T]) -> T:\n return visitor.visit_paramspec_expr(self)\n\n def serialize(self) -> JsonDict:\n return {\n '.class': 'ParamSpecExpr',\n 'name': self._name,\n 'fullname': self._fullname,\n 'upper_bound': self.upper_bound.serialize(),\n 'variance': self.variance,\n }\n\n @classmethod\n def deserialize(cls, data: JsonDict) -> 'ParamSpecExpr':\n assert data['.class'] == 'ParamSpecExpr'\n return ParamSpecExpr(\n data['name'],\n data['fullname'],\n mypy.types.deserialize_type(data['upper_bound']),\n data['variance']\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_TypeAliasExpr_TypeAliasExpr.accept.return.visitor_visit_type_alias_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_TypeAliasExpr_TypeAliasExpr.accept.return.visitor_visit_type_alias_", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2149, "end_line": 2171, "span_ids": ["TypeAliasExpr.__init__", "TypeAliasExpr.accept", "TypeAliasExpr"], "tokens": 186}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeAliasExpr(Expression):\n \"\"\"Type alias expression (rvalue).\"\"\"\n\n # The target type.\n type = None # type: mypy.types.Type\n # Names of unbound type variables used to define the alias\n tvars = None # type: List[str]\n # Whether this alias was defined in bare form. Used to distinguish\n # between\n # A = List\n # and\n # A = List[Any]\n no_args = False # type: bool\n\n def __init__(self, node: 'TypeAlias') -> None:\n super().__init__()\n self.type = node.target\n self.tvars = node.alias_tvars\n self.no_args = node.no_args\n self.node = node\n\n def accept(self, visitor: ExpressionVisitor[T]) -> T:\n return visitor.visit_type_alias_expr(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_NamedTupleExpr_TypedDictExpr.accept.return.visitor_visit_typeddict_e": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_NamedTupleExpr_TypedDictExpr.accept.return.visitor_visit_typeddict_e", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2174, "end_line": 2202, "span_ids": ["TypedDictExpr", "NamedTupleExpr.accept", "NamedTupleExpr", "TypedDictExpr.__init__", "NamedTupleExpr.__init__", "TypedDictExpr.accept"], "tokens": 223}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class NamedTupleExpr(Expression):\n \"\"\"Named tuple expression namedtuple(...) or NamedTuple(...).\"\"\"\n\n # The class representation of this named tuple (its tuple_type attribute contains\n # the tuple item types)\n info = None # type: TypeInfo\n is_typed = False # whether this class was created with typing.NamedTuple\n\n def __init__(self, info: 'TypeInfo', is_typed: bool = False) -> None:\n super().__init__()\n self.info = info\n self.is_typed = is_typed\n\n def accept(self, visitor: ExpressionVisitor[T]) -> T:\n return visitor.visit_namedtuple_expr(self)\n\n\nclass TypedDictExpr(Expression):\n \"\"\"Typed dict expression TypedDict(...).\"\"\"\n\n # The class representation of this typed dict\n info = None # type: TypeInfo\n\n def __init__(self, info: 'TypeInfo') -> None:\n super().__init__()\n self.info = info\n\n def accept(self, visitor: ExpressionVisitor[T]) -> T:\n return visitor.visit_typeddict_expr(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_EnumCallExpr_PromoteExpr.accept.return.visitor_visit__promote_ex": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_EnumCallExpr_PromoteExpr.accept.return.visitor_visit__promote_ex", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2205, "end_line": 2235, "span_ids": ["EnumCallExpr", "EnumCallExpr.accept", "PromoteExpr.accept", "PromoteExpr", "PromoteExpr.__init__", "EnumCallExpr.__init__"], "tokens": 238}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class EnumCallExpr(Expression):\n \"\"\"Named tuple expression Enum('name', 'val1 val2 ...').\"\"\"\n\n # The class representation of this enumerated type\n info = None # type: TypeInfo\n # The item names (for debugging)\n items = None # type: List[str]\n values = None # type: List[Optional[Expression]]\n\n def __init__(self, info: 'TypeInfo', items: List[str],\n values: List[Optional[Expression]]) -> None:\n super().__init__()\n self.info = info\n self.items = items\n self.values = values\n\n def accept(self, visitor: ExpressionVisitor[T]) -> T:\n return visitor.visit_enum_call_expr(self)\n\n\nclass PromoteExpr(Expression):\n \"\"\"Ducktype class decorator expression _promote(...).\"\"\"\n\n type = None # type: mypy.types.Type\n\n def __init__(self, type: 'mypy.types.Type') -> None:\n super().__init__()\n self.type = type\n\n def accept(self, visitor: ExpressionVisitor[T]) -> T:\n return visitor.visit__promote_expr(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_NewTypeExpr_AwaitExpr.accept.return.visitor_visit_await_expr_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_NewTypeExpr_AwaitExpr.accept.return.visitor_visit_await_expr_", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2238, "end_line": 2268, "span_ids": ["AwaitExpr.__init__", "AwaitExpr.accept", "NewTypeExpr", "AwaitExpr", "NewTypeExpr.accept", "NewTypeExpr.__init__"], "tokens": 239}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class NewTypeExpr(Expression):\n \"\"\"NewType expression NewType(...).\"\"\"\n name = None # type: str\n # The base type (the second argument to NewType)\n old_type = None # type: Optional[mypy.types.Type]\n # The synthesized class representing the new type (inherits old_type)\n info = None # type: Optional[TypeInfo]\n\n def __init__(self, name: str, old_type: 'Optional[mypy.types.Type]', line: int,\n column: int) -> None:\n super().__init__()\n self.name = name\n self.old_type = old_type\n self.line = line\n self.column = column\n\n def accept(self, visitor: ExpressionVisitor[T]) -> T:\n return visitor.visit_newtype_expr(self)\n\n\nclass AwaitExpr(Expression):\n \"\"\"Await expression (await ...).\"\"\"\n\n expr = None # type: Expression\n\n def __init__(self, expr: Expression) -> None:\n super().__init__()\n self.expr = expr\n\n def accept(self, visitor: ExpressionVisitor[T]) -> T:\n return visitor.visit_await_expr(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py__Constants_TempNode.accept.return.visitor_visit_temp_node_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py__Constants_TempNode.accept.return.visitor_visit_temp_node_s", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2271, "end_line": 2304, "span_ids": ["TempNode", "TempNode.__init__", "TempNode.accept", "AwaitExpr.accept", "TempNode.__repr__"], "tokens": 277}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Constants\n\n\nclass TempNode(Expression):\n \"\"\"Temporary dummy node used during type checking.\n\n This node is not present in the original program; it is just an artifact\n of the type checker implementation. It only represents an opaque node with\n some fixed type.\n \"\"\"\n\n type = None # type: mypy.types.Type\n # Is this TempNode used to indicate absence of a right hand side in an annotated assignment?\n # (e.g. for 'x: int' the rvalue is TempNode(AnyType(TypeOfAny.special_form), no_rhs=True))\n no_rhs = False # type: bool\n\n def __init__(self,\n typ: 'mypy.types.Type',\n no_rhs: bool = False,\n *,\n context: Optional[Context] = None) -> None:\n \"\"\"Construct a dummy node; optionally borrow line/column from context object.\"\"\"\n super().__init__()\n self.type = typ\n self.no_rhs = no_rhs\n if context is not None:\n self.line = context.line\n self.column = context.column\n\n def __repr__(self) -> str:\n return 'TempNode:%d(%s)' % (self.line, str(self.type))\n\n def accept(self, visitor: ExpressionVisitor[T]) -> T:\n return visitor.visit_temp_node(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_TypeInfo_TypeInfo._We_make_assuming_and_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_TypeInfo_TypeInfo._We_make_assuming_and_", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2307, "end_line": 2370, "span_ids": ["TypeInfo"], "tokens": 818}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeInfo(SymbolNode):\n \"\"\"The type structure of a single class.\n\n Each TypeInfo corresponds one-to-one to a ClassDef, which\n represents the AST of the class.\n\n In type-theory terms, this is a \"type constructor\", and if the\n class is generic then it will be a type constructor of higher kind.\n Where the class is used in an actual type, it's in the form of an\n Instance, which amounts to a type application of the tycon to\n the appropriate number of arguments.\n \"\"\"\n\n _fullname = None # type: Bogus[str] # Fully qualified name\n # Fully qualified name for the module this type was defined in. This\n # information is also in the fullname, but is harder to extract in the\n # case of nested class definitions.\n module_name = None # type: str\n defn = None # type: ClassDef # Corresponding ClassDef\n # Method Resolution Order: the order of looking up attributes. The first\n # value always to refers to this class.\n mro = None # type: List[TypeInfo]\n # Used to stash the names of the mro classes temporarily between\n # deserialization and fixup. See deserialize() for why.\n _mro_refs = None # type: Optional[List[str]]\n bad_mro = False # Could not construct full MRO\n\n declared_metaclass = None # type: Optional[mypy.types.Instance]\n metaclass_type = None # type: Optional[mypy.types.Instance]\n\n names = None # type: SymbolTable # Names defined directly in this type\n is_abstract = False # Does the class have any abstract attributes?\n is_protocol = False # Is this a protocol class?\n runtime_protocol = False # Does this protocol support isinstance checks?\n abstract_attributes = None # type: List[str]\n\n # The attributes 'assuming' and 'assuming_proper' represent structural subtype matrices.\n #\n # In languages with structural subtyping, one can keep a global subtype matrix like this:\n # . A B C .\n # A 1 0 0\n # B 1 1 1\n # C 1 0 1\n # .\n # where 1 indicates that the type in corresponding row is a subtype of the type\n # in corresponding column. This matrix typically starts filled with all 1's and\n # a typechecker tries to \"disprove\" every subtyping relation using atomic (or nominal) types.\n # However, we don't want to keep this huge global state. Instead, we keep the subtype\n # information in the form of list of pairs (subtype, supertype) shared by all 'Instance's\n # with given supertype's TypeInfo. When we enter a subtype check we push a pair in this list\n # thus assuming that we started with 1 in corresponding matrix element. Such algorithm allows\n # to treat recursive and mutually recursive protocols and other kinds of complex situations.\n #\n # If concurrent/parallel type checking will be added in future,\n # then there should be one matrix per thread/process to avoid false negatives\n # during the type checking phase.\n assuming = None # type: List[Tuple[mypy.types.Instance, mypy.types.Instance]]\n assuming_proper = None # type: List[Tuple[mypy.types.Instance, mypy.types.Instance]]\n # Ditto for temporary 'inferring' stack of recursive constraint inference.\n # It contains Instance's of protocol types that appeared as an argument to\n # constraints.infer_constraints(). We need 'inferring' to avoid infinite recursion for\n # recursive and mutually recursive protocols.\n #\n # We make 'assuming' and 'inferring' attributes here instead of passing they as kwargs,", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_TypeInfo._since_this_would_requir_TypeInfo.fullname.return.self__fullname": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_TypeInfo._since_this_would_requir_TypeInfo.fullname.return.self__fullname", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2380, "end_line": 2472, "span_ids": ["TypeInfo.__init__", "TypeInfo.fullname", "TypeInfo", "TypeInfo.add_type_vars", "TypeInfo.name"], "tokens": 844}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeInfo(SymbolNode):\n # since this would require to pass them in many dozens of calls. In particular,\n # there is a dependency infer_constraint -> is_subtype -> is_callable_subtype ->\n # -> infer_constraints.\n inferring = None # type: List[mypy.types.Instance]\n # 'inferring' and 'assuming' can't be made sets, since we need to use\n # is_same_type to correctly treat unions.\n\n # Classes inheriting from Enum shadow their true members with a __getattr__, so we\n # have to treat them as a special case.\n is_enum = False\n # If true, any unknown attributes should have type 'Any' instead\n # of generating a type error. This would be true if there is a\n # base class with type 'Any', but other use cases may be\n # possible. This is similar to having __getattr__ that returns Any\n # (and __setattr__), but without the __getattr__ method.\n fallback_to_any = False\n\n # Information related to type annotations.\n\n # Generic type variable names (full names)\n type_vars = None # type: List[str]\n\n # Direct base classes.\n bases = None # type: List[mypy.types.Instance]\n\n # Another type which this type will be treated as a subtype of,\n # even though it's not a subclass in Python. The non-standard\n # `@_promote` decorator introduces this, and there are also\n # several builtin examples, in particular `int` -> `float`.\n _promote = None # type: Optional[mypy.types.Type]\n\n # Representation of a Tuple[...] base class, if the class has any\n # (e.g., for named tuples). If this is not None, the actual Type\n # object used for this class is not an Instance but a TupleType;\n # the corresponding Instance is set as the fallback type of the\n # tuple type.\n tuple_type = None # type: Optional[mypy.types.TupleType]\n\n # Is this a named tuple type?\n is_named_tuple = False\n\n # If this class is defined by the TypedDict type constructor,\n # then this is not None.\n typeddict_type = None # type: Optional[mypy.types.TypedDictType]\n\n # Is this a newtype type?\n is_newtype = False\n\n # Is this a synthesized intersection type?\n is_intersection = False\n\n # This is a dictionary that will be serialized and un-serialized as is.\n # It is useful for plugins to add their data to save in the cache.\n metadata = None # type: Dict[str, JsonDict]\n\n FLAGS = [\n 'is_abstract', 'is_enum', 'fallback_to_any', 'is_named_tuple',\n 'is_newtype', 'is_protocol', 'runtime_protocol', 'is_final',\n 'is_intersection',\n ] # type: Final\n\n def __init__(self, names: 'SymbolTable', defn: ClassDef, module_name: str) -> None:\n \"\"\"Initialize a TypeInfo.\"\"\"\n super().__init__()\n self.names = names\n self.defn = defn\n self.module_name = module_name\n self.type_vars = []\n self.bases = []\n self.mro = []\n self._fullname = defn.fullname\n self.is_abstract = False\n self.abstract_attributes = []\n self.assuming = []\n self.assuming_proper = []\n self.inferring = []\n self.add_type_vars()\n self.metadata = {}\n self.is_final = False\n\n def add_type_vars(self) -> None:\n if self.defn.type_vars:\n for vd in self.defn.type_vars:\n self.type_vars.append(vd.fullname)\n\n @property\n def name(self) -> str:\n \"\"\"Short name.\"\"\"\n return self.defn.name\n\n @property\n def fullname(self) -> Bogus[str]:\n return self._fullname", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_TypeInfo.is_generic_TypeInfo.get_containing_type_info.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_TypeInfo.is_generic_TypeInfo.get_containing_type_info.return.None", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2465, "end_line": 2480, "span_ids": ["TypeInfo.get", "TypeInfo.get_containing_type_info", "TypeInfo.is_generic"], "tokens": 130}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeInfo(SymbolNode):\n\n def is_generic(self) -> bool:\n \"\"\"Is the type generic (i.e. does it have type variables)?\"\"\"\n return len(self.type_vars) > 0\n\n def get(self, name: str) -> 'Optional[SymbolTableNode]':\n for cls in self.mro:\n n = cls.names.get(name)\n if n:\n return n\n return None\n\n def get_containing_type_info(self, name: str) -> 'Optional[TypeInfo]':\n for cls in self.mro:\n if name in cls.names:\n return cls\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_TypeInfo.protocol_members_TypeInfo.protocol_members.return.sorted_list_members_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_TypeInfo.protocol_members_TypeInfo.protocol_members.return.sorted_list_members_", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2482, "end_line": 2492, "span_ids": ["TypeInfo.protocol_members"], "tokens": 132}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeInfo(SymbolNode):\n\n @property\n def protocol_members(self) -> List[str]:\n # Protocol members are names of all attributes/methods defined in a protocol\n # and in all its supertypes (except for 'object').\n members = set() # type: Set[str]\n assert self.mro, \"This property can be only accessed after MRO is (re-)calculated\"\n for base in self.mro[:-1]: # we skip \"object\" since everyone implements it\n if base.is_protocol:\n for name in base.names:\n members.add(name)\n return sorted(list(members))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_TypeInfo.__getitem___TypeInfo.get_method.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_TypeInfo.__getitem___TypeInfo.get_method.return.None", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2494, "end_line": 2521, "span_ids": ["TypeInfo.__bool__", "TypeInfo.has_readable_member", "TypeInfo.get_method", "TypeInfo.__repr__", "TypeInfo.__getitem__"], "tokens": 210}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeInfo(SymbolNode):\n\n def __getitem__(self, name: str) -> 'SymbolTableNode':\n n = self.get(name)\n if n:\n return n\n else:\n raise KeyError(name)\n\n def __repr__(self) -> str:\n return '' % self.fullname\n\n def __bool__(self) -> bool:\n # We defined this here instead of just overriding it in\n # FakeInfo so that mypyc can generate a direct call instead of\n # using the generic bool handling.\n return not isinstance(self, FakeInfo)\n\n def has_readable_member(self, name: str) -> bool:\n return self.get(name) is not None\n\n def get_method(self, name: str) -> Optional[FuncBase]:\n for cls in self.mro:\n if name in cls.names:\n node = cls.names[name].node\n if isinstance(node, FuncBase):\n return node\n else:\n return None\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_TypeInfo.calculate_metaclass_type_TypeInfo.calculate_metaclass_type.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_TypeInfo.calculate_metaclass_type_TypeInfo.calculate_metaclass_type.return.None", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2523, "end_line": 2536, "span_ids": ["TypeInfo.calculate_metaclass_type"], "tokens": 141}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeInfo(SymbolNode):\n\n def calculate_metaclass_type(self) -> 'Optional[mypy.types.Instance]':\n declared = self.declared_metaclass\n if declared is not None and not declared.type.has_base('builtins.type'):\n return declared\n if self._fullname == 'builtins.type':\n return mypy.types.Instance(self, [])\n candidates = [s.declared_metaclass\n for s in self.mro\n if s.declared_metaclass is not None\n and s.declared_metaclass.type is not None]\n for c in candidates:\n if all(other.type in c.type.mro for other in candidates):\n return c\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_TypeInfo.is_metaclass_TypeInfo.__str__.return.self_dump_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_TypeInfo.is_metaclass_TypeInfo.__str__.return.self_dump_", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2538, "end_line": 2564, "span_ids": ["TypeInfo.has_base", "TypeInfo.__str__", "TypeInfo.direct_base_classes", "TypeInfo.is_metaclass"], "tokens": 195}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeInfo(SymbolNode):\n\n def is_metaclass(self) -> bool:\n return (self.has_base('builtins.type') or self.fullname == 'abc.ABCMeta' or\n self.fallback_to_any)\n\n def has_base(self, fullname: str) -> bool:\n \"\"\"Return True if type has a base type with the specified name.\n\n This can be either via extension or via implementation.\n \"\"\"\n for cls in self.mro:\n if cls.fullname == fullname:\n return True\n return False\n\n def direct_base_classes(self) -> 'List[TypeInfo]':\n \"\"\"Return a direct base classes.\n\n Omit base classes of other base classes.\n \"\"\"\n return [base.type for base in self.bases]\n\n def __str__(self) -> str:\n \"\"\"Return a string representation of the type.\n\n This includes the most important information about the type.\n \"\"\"\n return self.dump()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_TypeInfo.dump_TypeInfo.dump.return.mypy_strconv_dump_tagged_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_TypeInfo.dump_TypeInfo.dump.return.mypy_strconv_dump_tagged_", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2566, "end_line": 2605, "span_ids": ["TypeInfo.dump"], "tokens": 365}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeInfo(SymbolNode):\n\n def dump(self,\n str_conv: 'Optional[mypy.strconv.StrConv]' = None,\n type_str_conv: 'Optional[mypy.types.TypeStrVisitor]' = None) -> str:\n \"\"\"Return a string dump of the contents of the TypeInfo.\"\"\"\n if not str_conv:\n str_conv = mypy.strconv.StrConv()\n base = '' # type: str\n\n def type_str(typ: 'mypy.types.Type') -> str:\n if type_str_conv:\n return typ.accept(type_str_conv)\n return str(typ)\n\n head = 'TypeInfo' + str_conv.format_id(self)\n if self.bases:\n base = 'Bases({})'.format(', '.join(type_str(base)\n for base in self.bases))\n mro = 'Mro({})'.format(', '.join(item.fullname + str_conv.format_id(item)\n for item in self.mro))\n names = []\n for name in sorted(self.names):\n description = name + str_conv.format_id(self.names[name].node)\n node = self.names[name].node\n if isinstance(node, Var) and node.type:\n description += ' ({})'.format(type_str(node.type))\n names.append(description)\n items = [\n 'Name({})'.format(self.fullname),\n base,\n mro,\n ('Names', names),\n ]\n if self.declared_metaclass:\n items.append('DeclaredMetaclass({})'.format(type_str(self.declared_metaclass)))\n if self.metaclass_type:\n items.append('MetaclassType({})'.format(type_str(self.metaclass_type)))\n return mypy.strconv.dump_tagged(\n items,\n head,\n str_conv=str_conv)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_TypeInfo.serialize_TypeInfo.serialize.return.data": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_TypeInfo.serialize_TypeInfo.serialize.return.data", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2607, "end_line": 2629, "span_ids": ["TypeInfo.serialize"], "tokens": 267}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeInfo(SymbolNode):\n\n def serialize(self) -> JsonDict:\n # NOTE: This is where all ClassDefs originate, so there shouldn't be duplicates.\n data = {'.class': 'TypeInfo',\n 'module_name': self.module_name,\n 'fullname': self.fullname,\n 'names': self.names.serialize(self.fullname),\n 'defn': self.defn.serialize(),\n 'abstract_attributes': self.abstract_attributes,\n 'type_vars': self.type_vars,\n 'bases': [b.serialize() for b in self.bases],\n 'mro': [c.fullname for c in self.mro],\n '_promote': None if self._promote is None else self._promote.serialize(),\n 'declared_metaclass': (None if self.declared_metaclass is None\n else self.declared_metaclass.serialize()),\n 'metaclass_type':\n None if self.metaclass_type is None else self.metaclass_type.serialize(),\n 'tuple_type': None if self.tuple_type is None else self.tuple_type.serialize(),\n 'typeddict_type':\n None if self.typeddict_type is None else self.typeddict_type.serialize(),\n 'flags': get_flags(self, TypeInfo.FLAGS),\n 'metadata': self.metadata,\n }\n return data", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_TypeInfo.deserialize_TypeInfo.deserialize.return.ti": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_TypeInfo.deserialize_TypeInfo.deserialize.return.ti", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2631, "end_line": 2665, "span_ids": ["TypeInfo.deserialize"], "tokens": 492}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeInfo(SymbolNode):\n\n @classmethod\n def deserialize(cls, data: JsonDict) -> 'TypeInfo':\n names = SymbolTable.deserialize(data['names'])\n defn = ClassDef.deserialize(data['defn'])\n module_name = data['module_name']\n ti = TypeInfo(names, defn, module_name)\n ti._fullname = data['fullname']\n # TODO: Is there a reason to reconstruct ti.subtypes?\n ti.abstract_attributes = data['abstract_attributes']\n ti.type_vars = data['type_vars']\n ti.bases = [mypy.types.Instance.deserialize(b) for b in data['bases']]\n ti._promote = (None if data['_promote'] is None\n else mypy.types.deserialize_type(data['_promote']))\n ti.declared_metaclass = (None if data['declared_metaclass'] is None\n else mypy.types.Instance.deserialize(data['declared_metaclass']))\n ti.metaclass_type = (None if data['metaclass_type'] is None\n else mypy.types.Instance.deserialize(data['metaclass_type']))\n # NOTE: ti.mro will be set in the fixup phase based on these\n # names. The reason we need to store the mro instead of just\n # recomputing it from base classes has to do with a subtle\n # point about fine-grained incremental: the cache files might\n # not be loaded until after a class in the mro has changed its\n # bases, which causes the mro to change. If we recomputed our\n # mro, we would compute the *new* mro, which leaves us with no\n # way to detect that the mro has changed! Thus we need to make\n # sure to load the original mro so that once the class is\n # rechecked, it can tell that the mro has changed.\n ti._mro_refs = data['mro']\n ti.tuple_type = (None if data['tuple_type'] is None\n else mypy.types.TupleType.deserialize(data['tuple_type']))\n ti.typeddict_type = (None if data['typeddict_type'] is None\n else mypy.types.TypedDictType.deserialize(data['typeddict_type']))\n ti.metadata = data['metadata']\n set_flags(ti, data['flags'])\n return ti", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_FakeInfo_FUNC_NO_INFO.FakeInfo_FuncBase_for_no": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_FakeInfo_FUNC_NO_INFO.FakeInfo_FuncBase_for_no", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2668, "end_line": 2701, "span_ids": ["impl:100", "FakeInfo.__getattribute__", "FakeInfo.__init__", "FakeInfo"], "tokens": 441}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FakeInfo(TypeInfo):\n # types.py defines a single instance of this class, called types.NOT_READY.\n # This instance is used as a temporary placeholder in the process of de-serialization\n # of 'Instance' types. The de-serialization happens in two steps: In the first step,\n # Instance.type is set to NOT_READY. In the second step (in fixup.py) it is replaced by\n # an actual TypeInfo. If you see the assertion error below, then most probably something\n # went wrong during the second step and an 'Instance' that raised this error was not fixed.\n # Note:\n # 'None' is not used as a dummy value for two reasons:\n # 1. This will require around 80-100 asserts to make 'mypy --strict-optional mypy'\n # pass cleanly.\n # 2. If NOT_READY value is accidentally used somewhere, it will be obvious where the value\n # is from, whereas a 'None' value could come from anywhere.\n #\n # Additionally, this serves as a more general-purpose placeholder\n # for missing TypeInfos in a number of places where the excuses\n # for not being Optional are a little weaker.\n #\n # TypeInfo defines a __bool__ method that returns False for FakeInfo\n # so that it can be conveniently tested against in the same way that it\n # would be if things were properly optional.\n def __init__(self, msg: str) -> None:\n self.msg = msg\n\n def __getattribute__(self, attr: str) -> None:\n # Handle __class__ so that isinstance still works...\n if attr == '__class__':\n return object.__getattribute__(self, attr)\n raise AssertionError(object.__getattribute__(self, 'msg'))\n\n\nVAR_NO_INFO = FakeInfo('Var is lacking info') # type: Final[TypeInfo]\nCLASSDEF_NO_INFO = FakeInfo('ClassDef is lacking info') # type: Final[TypeInfo]\nFUNC_NO_INFO = FakeInfo('FuncBase for non-methods lack info')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_None_96_TypeAlias._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_None_96_TypeAlias._", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2701, "end_line": 2790, "span_ids": ["impl:100", "TypeAlias"], "tokens": 844}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": " # type: Final[TypeInfo]\n\n\nclass TypeAlias(SymbolNode):\n \"\"\"\n A symbol node representing a type alias.\n\n Type alias is a static concept, in contrast to variables with types\n like Type[...]. Namely:\n * type aliases\n - can be used in type context (annotations)\n - cannot be re-assigned\n * variables with type Type[...]\n - cannot be used in type context\n - but can be re-assigned\n\n An alias can be defined only by an assignment to a name (not any other lvalues).\n\n Such assignment defines an alias by default. To define a variable,\n an explicit Type[...] annotation is required. As an exception,\n at non-global scope non-subscripted rvalue creates a variable even without\n an annotation. This exception exists to accommodate the common use case of\n class-valued attributes. See SemanticAnalyzerPass2.check_and_set_up_type_alias\n for details.\n\n Aliases can be generic. Currently, mypy uses unbound type variables for\n generic aliases and identifies them by name. Essentially, type aliases\n work as macros that expand textually. The definition and expansion rules are\n following:\n\n 1. An alias targeting a generic class without explicit variables act as\n the given class (this doesn't apply to Tuple and Callable, which are not proper\n classes but special type constructors):\n\n A = List\n AA = List[Any]\n\n x: A # same as List[Any]\n x: A[int] # same as List[int]\n\n x: AA # same as List[Any]\n x: AA[int] # Error!\n\n C = Callable # Same as Callable[..., Any]\n T = Tuple # Same as Tuple[Any, ...]\n\n 2. An alias using explicit type variables in its rvalue expects\n replacements (type arguments) for these variables. If missing, they\n are treated as Any, like for other generics:\n\n B = List[Tuple[T, T]]\n\n x: B # same as List[Tuple[Any, Any]]\n x: B[int] # same as List[Tuple[int, int]]\n\n def f(x: B[T]) -> T: ... # without T, Any would be used here\n\n 3. An alias can be defined using another aliases. In the definition\n rvalue the Any substitution doesn't happen for top level unsubscripted\n generic classes:\n\n A = List\n B = A # here A is expanded to List, _not_ List[Any],\n # to match the Python runtime behaviour\n x: B[int] # same as List[int]\n C = List[A] # this expands to List[List[Any]]\n\n AA = List[T]\n D = AA # here AA expands to List[Any]\n x: D[int] # Error!\n\n Note: the fact that we support aliases like `A = List` means that the target\n type will be initially an instance type with wrong number of type arguments.\n Such instances are all fixed in the third pass of semantic analyzis.\n We therefore store the difference between `List` and `List[Any]` rvalues (targets)\n using the `no_args` flag. See also TypeAliasExpr.no_args.\n\n Meaning of other fields:\n\n target: The target type. For generic aliases contains unbound type variables\n as nested types.\n _fullname: Qualified name of this type alias. This is used in particular\n to track fine grained dependencies from aliases.\n alias_tvars: Names of unbound type variables used to define this alias.\n normalized: Used to distinguish between `A = List`, and `A = list`. Both\n are internally stored using `builtins.list` (because `typing.List` is\n itself an alias), while the second cannot be subscripted because of\n Python runtime limitation.\n line and column: Line an column on the original alias definition.\n \"\"\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_TypeAlias.__slots___TypeAlias.accept.return.visitor_visit_type_alias_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_TypeAlias.__slots___TypeAlias.accept.return.visitor_visit_type_alias_", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2791, "end_line": 2832, "span_ids": ["TypeAlias.serialize", "TypeAlias", "TypeAlias.fullname", "TypeAlias.__init__", "TypeAlias.name", "TypeAlias.accept"], "tokens": 350}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeAlias(SymbolNode):\n __slots__ = ('target', '_fullname', 'alias_tvars', 'no_args', 'normalized',\n 'line', 'column', '_is_recursive')\n\n def __init__(self, target: 'mypy.types.Type', fullname: str, line: int, column: int,\n *,\n alias_tvars: Optional[List[str]] = None,\n no_args: bool = False,\n normalized: bool = False) -> None:\n self._fullname = fullname\n self.target = target\n if alias_tvars is None:\n alias_tvars = []\n self.alias_tvars = alias_tvars\n self.no_args = no_args\n self.normalized = normalized\n # This attribute is manipulated by TypeAliasType. If non-None,\n # it is the cached value.\n self._is_recursive = None # type: Optional[bool]\n super().__init__(line, column)\n\n @property\n def name(self) -> str:\n return self._fullname.split('.')[-1]\n\n @property\n def fullname(self) -> str:\n return self._fullname\n\n def serialize(self) -> JsonDict:\n data = {'.class': 'TypeAlias',\n 'fullname': self._fullname,\n 'target': self.target.serialize(),\n 'alias_tvars': self.alias_tvars,\n 'no_args': self.no_args,\n 'normalized': self.normalized,\n 'line': self.line,\n 'column': self.column\n } # type: JsonDict\n return data\n\n def accept(self, visitor: NodeVisitor[T]) -> T:\n return visitor.visit_type_alias(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_TypeAlias.deserialize_TypeAlias.deserialize.return.cls_target_fullname_lin": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_TypeAlias.deserialize_TypeAlias.deserialize.return.cls_target_fullname_lin", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2834, "end_line": 2845, "span_ids": ["TypeAlias.deserialize"], "tokens": 126}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeAlias(SymbolNode):\n\n @classmethod\n def deserialize(cls, data: JsonDict) -> 'TypeAlias':\n assert data['.class'] == 'TypeAlias'\n fullname = data['fullname']\n alias_tvars = data['alias_tvars']\n target = mypy.types.deserialize_type(data['target'])\n no_args = data['no_args']\n normalized = data['normalized']\n line = data['line']\n column = data['column']\n return cls(target, fullname, line, column, alias_tvars=alias_tvars,\n no_args=no_args, normalized=normalized)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_PlaceholderNode_PlaceholderNode.accept.return.visitor_visit_placeholder": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_PlaceholderNode_PlaceholderNode.accept.return.visitor_visit_placeholder", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2848, "end_line": 2916, "span_ids": ["PlaceholderNode.serialize", "PlaceholderNode.__init__", "PlaceholderNode.name", "PlaceholderNode.fullname", "PlaceholderNode", "PlaceholderNode.accept"], "tokens": 509}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PlaceholderNode(SymbolNode):\n \"\"\"Temporary symbol node that will later become a real SymbolNode.\n\n These are only present during semantic analysis when using the new\n semantic analyzer. These are created if some essential dependencies\n of a definition are not yet complete.\n\n A typical use is for names imported from a module which is still\n incomplete (within an import cycle):\n\n from m import f # Initially may create PlaceholderNode\n\n This is particularly important if the imported shadows a name from\n an enclosing scope or builtins:\n\n from m import int # Placeholder avoids mixups with builtins.int\n\n Another case where this is useful is when there is another definition\n or assignment:\n\n from m import f\n def f() -> None: ...\n\n In the above example, the presence of PlaceholderNode allows us to\n handle the second definition as a redefinition.\n\n They are also used to create PlaceholderType instances for types\n that refer to incomplete types. Example:\n\n class C(Sequence[C]): ...\n\n We create a PlaceholderNode (with becomes_typeinfo=True) for C so\n that the type C in Sequence[C] can be bound.\n\n Attributes:\n\n fullname: Full name of of the PlaceholderNode.\n node: AST node that contains the definition that caused this to\n be created. This is useful for tracking order of incomplete definitions\n and for debugging.\n becomes_typeinfo: If True, this refers something that could later\n become a TypeInfo. It can't be used with type variables, in\n particular, as this would cause issues with class type variable\n detection.\n\n The long-term purpose of placeholder nodes/types is to evolve into\n something that can support general recursive types.\n \"\"\"\n\n def __init__(self, fullname: str, node: Node, line: int, *,\n becomes_typeinfo: bool = False) -> None:\n self._fullname = fullname\n self.node = node\n self.becomes_typeinfo = becomes_typeinfo\n self.line = line\n\n @property\n def name(self) -> str:\n return self._fullname.split('.')[-1]\n\n @property\n def fullname(self) -> str:\n return self._fullname\n\n def serialize(self) -> JsonDict:\n assert False, \"PlaceholderNode can't be serialized\"\n\n def accept(self, visitor: NodeVisitor[T]) -> T:\n return visitor.visit_placeholder_node(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_SymbolTableNode_SymbolTableNode.__slots__._kind_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_SymbolTableNode_SymbolTableNode.__slots__._kind_", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2919, "end_line": 2987, "span_ids": ["SymbolTableNode"], "tokens": 685}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SymbolTableNode:\n \"\"\"Description of a name binding in a symbol table.\n\n These are only used as values in module (global), function (local)\n and class symbol tables (see SymbolTable). The name that is bound is\n the key in SymbolTable.\n\n Symbol tables don't contain direct references to AST nodes primarily\n because there can be multiple symbol table references to a single\n AST node (due to imports and aliases), and different references can\n behave differently. This class describes the unique properties of\n each reference.\n\n The most fundamental attribute is 'node', which is the AST node that\n the name refers to.\n\n The kind is usually one of LDEF, GDEF or MDEF, depending on the scope\n of the definition. These three kinds can usually be used\n interchangeably and the difference between local, global and class\n scopes is mostly descriptive, with no semantic significance.\n However, some tools that consume mypy ASTs may care about these so\n they should be correct.\n\n Attributes:\n node: AST node of definition. Among others, this can be one of\n FuncDef, Var, TypeInfo, TypeVarExpr or MypyFile -- or None\n for cross_ref that hasn't been fixed up yet.\n kind: Kind of node. Possible values:\n - LDEF: local definition\n - GDEF: global (module-level) definition\n - MDEF: class member definition\n - UNBOUND_IMPORTED: temporary kind for imported names (we\n don't know the final kind yet)\n module_public: If False, this name won't be imported via\n 'from import *'. This has no effect on names within\n classes.\n module_hidden: If True, the name will be never exported (needed for\n stub files)\n cross_ref: For deserialized MypyFile nodes, the referenced module\n name; for other nodes, optionally the name of the referenced object.\n implicit: Was this defined by assignment to self attribute?\n plugin_generated: Was this symbol generated by a plugin?\n (And therefore needs to be removed in aststrip.)\n no_serialize: Do not serialize this node if True. This is used to prevent\n keys in the cache that refer to modules on which this file does not\n depend. Currently this can happen if there is a module not in build\n used e.g. like this:\n import a.b.c # type: ignore\n This will add a submodule symbol to parent module `a` symbol table,\n but `a.b` is _not_ added as its dependency. Therefore, we should\n not serialize these symbols as they may not be found during fixup\n phase, instead they will be re-added during subsequent patch parents\n phase.\n TODO: Refactor build.py to make dependency tracking more transparent\n and/or refactor look-up functions to not require parent patching.\n\n NOTE: No other attributes should be added to this class unless they\n are shared by all node kinds.\n \"\"\"\n\n __slots__ = ('kind',\n 'node',\n 'module_public',\n 'module_hidden',\n 'cross_ref',\n 'implicit',\n 'plugin_generated',\n 'no_serialize',\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_SymbolTableNode.__init___SymbolTableNode.__str__.return.s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_SymbolTableNode.__init___SymbolTableNode.__str__.return.s", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2989, "end_line": 3040, "span_ids": ["SymbolTableNode.fullname", "SymbolTableNode.__str__", "SymbolTableNode.copy", "SymbolTableNode.type", "SymbolTableNode.__init__"], "tokens": 371}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SymbolTableNode:\n\n def __init__(self,\n kind: int,\n node: Optional[SymbolNode],\n module_public: bool = True,\n implicit: bool = False,\n module_hidden: bool = False,\n *,\n plugin_generated: bool = False,\n no_serialize: bool = False) -> None:\n self.kind = kind\n self.node = node\n self.module_public = module_public\n self.implicit = implicit\n self.module_hidden = module_hidden\n self.cross_ref = None # type: Optional[str]\n self.plugin_generated = plugin_generated\n self.no_serialize = no_serialize\n\n @property\n def fullname(self) -> Optional[str]:\n if self.node is not None:\n return self.node.fullname\n else:\n return None\n\n @property\n def type(self) -> 'Optional[mypy.types.Type]':\n node = self.node\n if isinstance(node, (Var, SYMBOL_FUNCBASE_TYPES)) and node.type is not None:\n return node.type\n elif isinstance(node, Decorator):\n return node.var.type\n else:\n return None\n\n def copy(self) -> 'SymbolTableNode':\n new = SymbolTableNode(self.kind,\n self.node,\n self.module_public,\n self.implicit,\n self.module_hidden)\n new.cross_ref = self.cross_ref\n return new\n\n def __str__(self) -> str:\n s = '{}/{}'.format(node_kinds[self.kind], short_type(self.node))\n if isinstance(self.node, SymbolNode):\n s += ' ({})'.format(self.node.fullname)\n # Include declared type of variables and functions.\n if self.type is not None:\n s += ' : {}'.format(self.type)\n return s", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_SymbolTableNode.serialize_SymbolTableNode.serialize.return.data": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_SymbolTableNode.serialize_SymbolTableNode.serialize.return.data", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3042, "end_line": 3074, "span_ids": ["SymbolTableNode.serialize"], "tokens": 291}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SymbolTableNode:\n\n def serialize(self, prefix: str, name: str) -> JsonDict:\n \"\"\"Serialize a SymbolTableNode.\n\n Args:\n prefix: full name of the containing module or class; or None\n name: name of this object relative to the containing object\n \"\"\"\n data = {'.class': 'SymbolTableNode',\n 'kind': node_kinds[self.kind],\n } # type: JsonDict\n if self.module_hidden:\n data['module_hidden'] = True\n if not self.module_public:\n data['module_public'] = False\n if self.implicit:\n data['implicit'] = True\n if self.plugin_generated:\n data['plugin_generated'] = True\n if isinstance(self.node, MypyFile):\n data['cross_ref'] = self.node.fullname\n else:\n assert self.node is not None, '%s:%s' % (prefix, name)\n if prefix is not None:\n fullname = self.node.fullname\n if (fullname is not None and '.' in fullname\n and fullname != prefix + '.' + name\n and not (isinstance(self.node, Var)\n and self.node.from_module_getattr)):\n assert not isinstance(self.node, PlaceholderNode)\n data['cross_ref'] = fullname\n return data\n data['node'] = self.node.serialize()\n return data", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_SymbolTableNode.deserialize_SymbolTableNode.deserialize.return.stnode": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_SymbolTableNode.deserialize_SymbolTableNode.deserialize.return.stnode", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3076, "end_line": 3096, "span_ids": ["SymbolTableNode.deserialize"], "tokens": 205}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SymbolTableNode:\n\n @classmethod\n def deserialize(cls, data: JsonDict) -> 'SymbolTableNode':\n assert data['.class'] == 'SymbolTableNode'\n kind = inverse_node_kinds[data['kind']]\n if 'cross_ref' in data:\n # This will be fixed up later.\n stnode = SymbolTableNode(kind, None)\n stnode.cross_ref = data['cross_ref']\n else:\n assert 'node' in data, data\n node = SymbolNode.deserialize(data['node'])\n stnode = SymbolTableNode(kind, node)\n if 'module_hidden' in data:\n stnode.module_hidden = data['module_hidden']\n if 'module_public' in data:\n stnode.module_public = data['module_public']\n if 'implicit' in data:\n stnode.implicit = data['implicit']\n if 'plugin_generated' in data:\n stnode.plugin_generated = data['plugin_generated']\n return stnode", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_SymbolTable_SymbolTable.copy.return.SymbolTable_key_node_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_SymbolTable_SymbolTable.copy.return.SymbolTable_key_node_c", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3099, "end_line": 3123, "span_ids": ["SymbolTable", "SymbolTable.__str__", "SymbolTable.copy"], "tokens": 210}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SymbolTable(Dict[str, SymbolTableNode]):\n \"\"\"Static representation of a namespace dictionary.\n\n This is used for module, class and function namespaces.\n \"\"\"\n\n def __str__(self) -> str:\n a = [] # type: List[str]\n for key, value in self.items():\n # Filter out the implicit import of builtins.\n if isinstance(value, SymbolTableNode):\n if (value.fullname != 'builtins' and\n (value.fullname or '').split('.')[-1] not in\n implicit_module_attrs):\n a.append(' ' + str(key) + ' : ' + str(value))\n else:\n a.append(' ')\n a = sorted(a)\n a.insert(0, 'SymbolTable(')\n a[-1] += ')'\n return '\\n'.join(a)\n\n def copy(self) -> 'SymbolTable':\n return SymbolTable([(key, node.copy())\n for key, node in self.items()])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_SymbolTable.serialize_SymbolTable.deserialize.return.st": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_SymbolTable.serialize_SymbolTable.deserialize.return.st", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3125, "end_line": 3144, "span_ids": ["SymbolTable.serialize", "SymbolTable.deserialize"], "tokens": 203}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SymbolTable(Dict[str, SymbolTableNode]):\n\n def serialize(self, fullname: str) -> JsonDict:\n data = {'.class': 'SymbolTable'} # type: JsonDict\n for key, value in self.items():\n # Skip __builtins__: it's a reference to the builtins\n # module that gets added to every module by\n # SemanticAnalyzerPass2.visit_file(), but it shouldn't be\n # accessed by users of the module.\n if key == '__builtins__' or value.no_serialize:\n continue\n data[key] = value.serialize(fullname, key)\n return data\n\n @classmethod\n def deserialize(cls, data: JsonDict) -> 'SymbolTable':\n assert data['.class'] == 'SymbolTable'\n st = SymbolTable()\n for key, value in data.items():\n if key != '.class':\n st[key] = SymbolTableNode.deserialize(value)\n return st", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_get_flags_deserialize_map._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_get_flags_deserialize_map._", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3147, "end_line": 3177, "span_ids": ["get_member_expr_fullname", "impl:106", "set_flags", "get_flags"], "tokens": 238}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_flags(node: Node, names: List[str]) -> List[str]:\n return [name for name in names if getattr(node, name)]\n\n\ndef set_flags(node: Node, flags: List[str]) -> None:\n for name in flags:\n setattr(node, name, True)\n\n\ndef get_member_expr_fullname(expr: MemberExpr) -> Optional[str]:\n \"\"\"Return the qualified name representation of a member expression.\n\n Return a string of form foo.bar, foo.bar.baz, or similar, or None if the\n argument cannot be represented in this form.\n \"\"\"\n initial = None # type: Optional[str]\n if isinstance(expr.expr, NameExpr):\n initial = expr.expr.name\n elif isinstance(expr.expr, MemberExpr):\n initial = get_member_expr_fullname(expr.expr)\n else:\n return None\n return '{}.{}'.format(initial, expr.name)\n\n\ndeserialize_map = {\n key: obj.deserialize\n for key, obj in globals().items()\n if type(obj) is not FakeInfo\n and isinstance(obj, type) and issubclass(obj, SymbolNode) and obj is not SymbolNode\n}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_None_97_check_arg_kinds.for_kind_node_in_zip_arg.if_kind_ARG_POS_.elif_kind_ARG_STAR2_.is_kw_arg.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_None_97_check_arg_kinds.for_kind_node_in_zip_arg.if_kind_ARG_POS_.elif_kind_ARG_STAR2_.is_kw_arg.True", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3177, "end_line": 3211, "span_ids": ["check_arg_kinds", "impl:106"], "tokens": 299}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": " # type: Final\n\n\ndef check_arg_kinds(arg_kinds: List[int], nodes: List[T], fail: Callable[[str, T], None]) -> None:\n is_var_arg = False\n is_kw_arg = False\n seen_named = False\n seen_opt = False\n for kind, node in zip(arg_kinds, nodes):\n if kind == ARG_POS:\n if is_var_arg or is_kw_arg or seen_named or seen_opt:\n fail(\"Required positional args may not appear \"\n \"after default, named or var args\",\n node)\n break\n elif kind == ARG_OPT:\n if is_var_arg or is_kw_arg or seen_named:\n fail(\"Positional default args may not appear after named or var args\", node)\n break\n seen_opt = True\n elif kind == ARG_STAR:\n if is_var_arg or is_kw_arg or seen_named:\n fail(\"Var args may not appear after named or var args\", node)\n break\n is_var_arg = True\n elif kind == ARG_NAMED or kind == ARG_NAMED_OPT:\n seen_named = True\n if is_kw_arg:\n fail(\"A **kwargs argument must be the last argument\", node)\n break\n elif kind == ARG_STAR2:\n if is_kw_arg:\n fail(\"You may only have one **kwargs argument\", node)\n break\n is_kw_arg = True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_check_arg_names_is_final_node.return.isinstance_node_Var_Fu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_check_arg_names_is_final_node.return.isinstance_node_Var_Fu", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3223, "end_line": 3242, "span_ids": ["is_final_node", "is_class_var", "check_arg_names"], "tokens": 195}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def check_arg_names(names: Sequence[Optional[str]], nodes: List[T], fail: Callable[[str, T], None],\n description: str = 'function definition') -> None:\n seen_names = set() # type: Set[Optional[str]]\n for name, node in zip(names, nodes):\n if name is not None and name in seen_names:\n fail('Duplicate argument \"{}\" in {}'.format(name, description), node)\n break\n seen_names.add(name)\n\n\ndef is_class_var(expr: NameExpr) -> bool:\n \"\"\"Return whether the expression is ClassVar[...]\"\"\"\n if isinstance(expr.node, Var):\n return expr.node.is_classvar\n return False\n\n\ndef is_final_node(node: Optional[SymbolNode]) -> bool:\n \"\"\"Check whether `node` corresponds to a final attribute.\"\"\"\n return isinstance(node, (Var, FuncDef, OverloadedFuncDef, Decorator)) and node.is_final", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_local_definitions_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_local_definitions_", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3236, "end_line": 3255, "span_ids": ["local_definitions"], "tokens": 180}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def local_definitions(names: SymbolTable,\n name_prefix: str,\n info: Optional[TypeInfo] = None) -> Iterator[Definition]:\n \"\"\"Iterate over local definitions (not imported) in a symbol table.\n\n Recursively iterate over class members and nested classes.\n \"\"\"\n # TODO: What should the name be? Or maybe remove it?\n for name, symnode in names.items():\n shortname = name\n if '-redef' in name:\n # Restore original name from mangled name of multiply defined function\n shortname = name.split('-redef')[0]\n fullname = name_prefix + '.' + shortname\n node = symnode.node\n if node and node.fullname == fullname:\n yield fullname, symnode, info\n if isinstance(node, TypeInfo):\n yield from local_definitions(node.names, fullname, node)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/options.py_Options._To_avoid_breaking_plugi_Options.apply_changes.return.new_options": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/options.py_Options._To_avoid_breaking_plugi_Options.apply_changes.return.new_options", "embedding": null, "metadata": {"file_path": "mypy/options.py", "file_name": "options.py", "file_type": "text/x-python", "category": "implementation", "start_line": 283, "end_line": 308, "span_ids": ["Options.snapshot", "Options.new_semantic_analyzer", "Options.__repr__", "Options.apply_changes", "Options.__init__"], "tokens": 271}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Options:\n\n # To avoid breaking plugin compatibility, keep providing new_semantic_analyzer\n @property\n def new_semantic_analyzer(self) -> bool:\n return True\n\n def snapshot(self) -> object:\n \"\"\"Produce a comparable snapshot of this Option\"\"\"\n # Under mypyc, we don't have a __dict__, so we need to do worse things.\n d = dict(getattr(self, '__dict__', ()))\n for k in get_class_descriptors(Options):\n if hasattr(self, k) and k != \"new_semantic_analyzer\":\n d[k] = getattr(self, k)\n # Remove private attributes from snapshot\n d = {k: v for k, v in d.items() if not k.startswith('_')}\n return d\n\n def __repr__(self) -> str:\n return 'Options({})'.format(pprint.pformat(self.snapshot()))\n\n def apply_changes(self, changes: Dict[str, object]) -> 'Options':\n new_options = Options()\n # Under mypyc, we don't have a __dict__, so we need to do worse things.\n replace_object_state(new_options, self, copy_dict=True)\n for key, value in changes.items():\n setattr(new_options, key, value)\n return new_options", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/options.py_Options.build_per_module_cache_Options.build_per_module_cache.self_unused_configs_updat": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/options.py_Options.build_per_module_cache_Options.build_per_module_cache.self_unused_configs_updat", "embedding": null, "metadata": {"file_path": "mypy/options.py", "file_name": "options.py", "file_type": "text/x-python", "category": "implementation", "start_line": 310, "end_line": 353, "span_ids": ["Options.build_per_module_cache"], "tokens": 526}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Options:\n\n def build_per_module_cache(self) -> None:\n self._per_module_cache = {}\n\n # Config precedence is as follows:\n # 1. Concrete section names: foo.bar.baz\n # 2. \"Unstructured\" glob patterns: foo.*.baz, in the order\n # they appear in the file (last wins)\n # 3. \"Well-structured\" wildcard patterns: foo.bar.*, in specificity order.\n\n # Since structured configs inherit from structured configs above them in the hierarchy,\n # we need to process per-module configs in a careful order.\n # We have to process foo.* before foo.bar.* before foo.bar,\n # and we need to apply *.bar to foo.bar but not to foo.bar.*.\n # To do this, process all well-structured glob configs before non-glob configs and\n # exploit the fact that foo.* sorts earlier ASCIIbetically (unicodebetically?)\n # than foo.bar.*.\n # (A section being \"processed last\" results in its config \"winning\".)\n # Unstructured glob configs are stored and are all checked for each module.\n unstructured_glob_keys = [k for k in self.per_module_options.keys()\n if '*' in k[:-1]]\n structured_keys = [k for k in self.per_module_options.keys()\n if '*' not in k[:-1]]\n wildcards = sorted(k for k in structured_keys if k.endswith('.*'))\n concrete = [k for k in structured_keys if not k.endswith('.*')]\n\n for glob in unstructured_glob_keys:\n self._glob_options.append((glob, self.compile_glob(glob)))\n\n # We (for ease of implementation) treat unstructured glob\n # sections as used if any real modules use them or if any\n # concrete config sections use them. This means we need to\n # track which get used while constructing.\n self.unused_configs = set(unstructured_glob_keys)\n\n for key in wildcards + concrete:\n # Find what the options for this key would be, just based\n # on inheriting from parent configs.\n options = self.clone_for_module(key)\n # And then update it with its per-module options.\n self._per_module_cache[key] = options.apply_changes(self.per_module_options[key])\n\n # Add the more structured sections into unused configs, since\n # they only count as used if actually used by a real module.\n self.unused_configs.update(structured_keys)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/options.py_Options.clone_for_module_Options.clone_for_module.return.options": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/options.py_Options.clone_for_module_Options.clone_for_module.return.options", "embedding": null, "metadata": {"file_path": "mypy/options.py", "file_name": "options.py", "file_type": "text/x-python", "category": "implementation", "start_line": 355, "end_line": 396, "span_ids": ["Options.clone_for_module"], "tokens": 405}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Options:\n\n def clone_for_module(self, module: str) -> 'Options':\n \"\"\"Create an Options object that incorporates per-module options.\n\n NOTE: Once this method is called all Options objects should be\n considered read-only, else the caching might be incorrect.\n \"\"\"\n if self._per_module_cache is None:\n self.build_per_module_cache()\n assert self._per_module_cache is not None\n\n # If the module just directly has a config entry, use it.\n if module in self._per_module_cache:\n self.unused_configs.discard(module)\n return self._per_module_cache[module]\n\n # If not, search for glob paths at all the parents. So if we are looking for\n # options for foo.bar.baz, we search foo.bar.baz.*, foo.bar.*, foo.*,\n # in that order, looking for an entry.\n # This is technically quadratic in the length of the path, but module paths\n # don't actually get all that long.\n options = self\n path = module.split('.')\n for i in range(len(path), 0, -1):\n key = '.'.join(path[:i] + ['*'])\n if key in self._per_module_cache:\n self.unused_configs.discard(key)\n options = self._per_module_cache[key]\n break\n\n # OK and *now* we need to look for unstructured glob matches.\n # We only do this for concrete modules, not structured wildcards.\n if not module.endswith('.*'):\n for key, pattern in self._glob_options:\n if pattern.match(module):\n self.unused_configs.discard(key)\n options = options.apply_changes(self.per_module_options[key])\n\n # We could update the cache to directly point to modules once\n # they have been looked up, but in testing this made things\n # slower and not faster, so we don't bother.\n\n return options", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/options.py_Options.compile_glob_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/options.py_Options.compile_glob_", "embedding": null, "metadata": {"file_path": "mypy/options.py", "file_name": "options.py", "file_type": "text/x-python", "category": "implementation", "start_line": 398, "end_line": 410, "span_ids": ["Options.select_options_affecting_cache", "Options.compile_glob"], "tokens": 162}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Options:\n\n def compile_glob(self, s: str) -> Pattern[str]:\n # Compile one of the glob patterns to a regex so that '.*' can\n # match *zero or more* module sections. This means we compile\n # '.*' into '(\\..*)?'.\n parts = s.split('.')\n expr = re.escape(parts[0]) if parts[0] != '*' else '.*'\n for part in parts[1:]:\n expr += re.escape('.' + part) if part != '*' else r'(\\..*)?'\n return re.compile(expr + '\\\\Z')\n\n def select_options_affecting_cache(self) -> Mapping[str, object]:\n return {opt: getattr(self, opt) for opt in OPTIONS_AFFECTING_CACHE}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/ordered_dict.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/ordered_dict.py__", "embedding": null, "metadata": {"file_path": "mypy/ordered_dict.py", "file_name": "ordered_dict.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 10, "span_ids": ["docstring"], "tokens": 58}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# OrderedDict is kind of slow, so for most of our uses in Python 3.6\n# and later we'd rather just use dict\n\nimport sys\n\nif sys.version_info < (3, 6):\n from collections import OrderedDict as OrderedDict\nelse:\n OrderedDict = dict", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/parse.py_from_typing_import_Union__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/parse.py_from_typing_import_Union__", "embedding": null, "metadata": {"file_path": "mypy/parse.py", "file_name": "parse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 37, "span_ids": ["imports", "parse"], "tokens": 254}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from typing import Union, Optional\n\nfrom mypy.errors import Errors\nfrom mypy.options import Options\nfrom mypy.nodes import MypyFile\n\n\ndef parse(source: Union[str, bytes],\n fnam: str,\n module: Optional[str],\n errors: Optional[Errors],\n options: Options) -> MypyFile:\n \"\"\"Parse a source file, without doing any semantic analysis.\n\n Return the parse tree. If errors is not provided, raise ParseError\n on failure. Otherwise, use the errors object to report parse errors.\n\n The python_version (major, minor) option determines the Python syntax variant.\n \"\"\"\n is_stub_file = fnam.endswith('.pyi')\n if options.transform_source is not None:\n source = options.transform_source(source)\n if options.python_version[0] >= 3 or is_stub_file:\n import mypy.fastparse\n return mypy.fastparse.parse(source,\n fnam=fnam,\n module=module,\n errors=errors,\n options=options)\n else:\n import mypy.fastparse2\n return mypy.fastparse2.parse(source,\n fnam=fnam,\n module=module,\n errors=errors,\n options=options)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py__Plugin_system_for_exte_from_abc_import_abstractm": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py__Plugin_system_for_exte_from_abc_import_abstractm", "embedding": null, "metadata": {"file_path": "mypy/plugin.py", "file_name": "plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 122, "span_ids": ["imports", "docstring"], "tokens": 1361}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Plugin system for extending mypy.\n\nAt large scale the plugin system works as following:\n\n* Plugins are collected from the corresponding mypy config file option\n (either via paths to Python files, or installed Python modules)\n and imported using importlib.\n\n* Every module should get an entry point function (called 'plugin' by default,\n but may be overridden in the config file) that should accept a single string\n argument that is a full mypy version (includes git commit hash for dev\n versions) and return a subclass of mypy.plugins.Plugin.\n\n* All plugin class constructors should match the signature of mypy.plugin.Plugin\n (i.e. should accept an mypy.options.Options object), and *must* call\n super().__init__().\n\n* At several steps during semantic analysis and type checking mypy calls\n special `get_xxx` methods on user plugins with a single string argument that\n is a fully qualified name (full name) of a relevant definition\n (see mypy.plugin.Plugin method docstrings for details).\n\n* The plugins are called in the order they are passed in the config option.\n Every plugin must decide whether to act on a given full name. The first\n plugin that returns non-None object will be used.\n\n* The above decision should be made using the limited common API specified by\n mypy.plugin.CommonPluginApi.\n\n* The callback returned by the plugin will be called with a larger context that\n includes relevant current state (e.g. a default return type, or a default\n attribute type) and a wider relevant API provider (e.g.\n SemanticAnalyzerPluginInterface or CheckerPluginInterface).\n\n* The result of this is used for further processing. See various `XxxContext`\n named tuples for details about which information is given to each hook.\n\nPlugin developers should ensure that their plugins work well in incremental and\ndaemon modes. In particular, plugins should not hold global state, and should\nalways call add_plugin_dependency() in plugin hooks called during semantic\nanalysis. See the method docstring for more details.\n\nThere is no dedicated cache storage for plugins, but plugins can store\nper-TypeInfo data in a special .metadata attribute that is serialized to the\nmypy caches between incremental runs. To avoid collisions between plugins, they\nare encouraged to store their state under a dedicated key coinciding with\nplugin name in the metadata dictionary. Every value stored there must be\nJSON-serializable.\n\n## Notes about the semantic analyzer\n\nMypy 0.710 introduced a new semantic analyzer that changed how plugins are\nexpected to work in several notable ways (from mypy 0.730 the old semantic\nanalyzer is no longer available):\n\n1. The order of processing AST nodes in modules is different. The old semantic\n analyzer processed modules in textual order, one module at a time. The new\n semantic analyzer first processes the module top levels, including bodies of\n any top-level classes and classes nested within classes. (\"Top-level\" here\n means \"not nested within a function/method\".) Functions and methods are\n processed only after module top levels have been finished. If there is an\n import cycle, all module top levels in the cycle are processed before\n processing any functions or methods. Each unit of processing (a module top\n level or a function/method) is called a *target*.\n\n This also means that function signatures in the same module have not been\n analyzed yet when analyzing the module top level. If you need access to\n a function signature, you'll need to explicitly analyze the signature first\n using `anal_type()`.\n\n2. Each target can be processed multiple times. This may happen if some forward\n references are not ready yet, for example. This means that semantic analyzer\n related plugin hooks can be called multiple times for the same full name.\n These plugin methods must thus be idempotent.\n\n3. The `anal_type` API function returns None if some part of the type is not\n available yet. If this happens, the current target being analyzed will be\n *deferred*, which means that it will be processed again soon, in the hope\n that additional dependencies will be available. This may happen if there are\n forward references to types or inter-module references to types within an\n import cycle.\n\n Note that if there is a circular definition, mypy may decide to stop\n processing to avoid an infinite number of iterations. When this happens,\n `anal_type` will generate an error and return an `AnyType` type object\n during the final iteration (instead of None).\n\n4. There is a new API method `defer()`. This can be used to explicitly request\n the current target to be reprocessed one more time. You don't need this\n to call this if `anal_type` returns None, however.\n\n5. There is a new API property `final_iteration`, which is true once mypy\n detected no progress during the previous iteration or if the maximum\n semantic analysis iteration count has been reached. You must never\n defer during the final iteration, as it will cause a crash.\n\n6. The `node` attribute of SymbolTableNode objects may contain a reference to\n a PlaceholderNode object. This object means that this definition has not\n been fully processed yet. If you encounter a PlaceholderNode, you should\n defer unless it's the final iteration. If it's the final iteration, you\n should generate an error message. It usually means that there's a cyclic\n definition that cannot be resolved by mypy. PlaceholderNodes can only refer\n to references inside an import cycle. If you are looking up things from\n another module, such as the builtins, that is outside the current module or\n import cycle, you can safely assume that you won't receive a placeholder.\n\nWhen testing your plugin, you should have a test case that forces a module top\nlevel to be processed multiple times. The easiest way to do this is to include\na forward reference to a class in a top-level annotation. Example:\n\n c: C # Forward reference causes second analysis pass\n class C: pass\n\nNote that a forward reference in a function signature won't trigger another\npass, since all functions are processed only after the top level has been fully\nanalyzed.\n\nYou can use `api.options.new_semantic_analyzer` to check whether the new\nsemantic analyzer is enabled (it's always true in mypy 0.730 and later).\n\"\"\"\n\nfrom abc import abstractmethod", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_from_typing_import_Any_C_from_mypy_errorcodes_impo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_from_typing_import_Any_C_from_mypy_errorcodes_impo", "embedding": null, "metadata": {"file_path": "mypy/plugin.py", "file_name": "plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 123, "end_line": 134, "span_ids": ["imports"], "tokens": 126}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from typing import Any, Callable, List, Tuple, Optional, NamedTuple, TypeVar, Dict\nfrom mypy_extensions import trait, mypyc_attr\n\nfrom mypy.nodes import (\n Expression, Context, ClassDef, SymbolTableNode, MypyFile, CallExpr\n)\nfrom mypy.tvar_scope import TypeVarLikeScope\nfrom mypy.types import Type, Instance, CallableType, TypeList, UnboundType, ProperType\nfrom mypy.messages import MessageBuilder\nfrom mypy.options import Options\nfrom mypy.lookup import lookup_fully_qualified\nfrom mypy.errorcodes import ErrorCode", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_TypeAnalyzerPluginInterface_TypeAnalyzerPluginInterface.analyze_callable_args.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_TypeAnalyzerPluginInterface_TypeAnalyzerPluginInterface.analyze_callable_args.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "mypy/plugin.py", "file_name": "plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 137, "end_line": 171, "span_ids": ["TypeAnalyzerPluginInterface.analyze_type", "TypeAnalyzerPluginInterface.analyze_callable_args", "TypeAnalyzerPluginInterface.named_type", "TypeAnalyzerPluginInterface", "TypeAnalyzerPluginInterface.fail"], "tokens": 294}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@trait\nclass TypeAnalyzerPluginInterface:\n \"\"\"Interface for accessing semantic analyzer functionality in plugins.\n\n Methods docstrings contain only basic info. Look for corresponding implementation\n docstrings in typeanal.py for more details.\n \"\"\"\n\n # An options object. Note: these are the cloned options for the current file.\n # This might be different from Plugin.options (that contains default/global options)\n # if there are per-file options in the config. This applies to all other interfaces\n # in this file.\n options = None # type: Options\n\n @abstractmethod\n def fail(self, msg: str, ctx: Context, *, code: Optional[ErrorCode] = None) -> None:\n \"\"\"Emit an error message at given location.\"\"\"\n raise NotImplementedError\n\n @abstractmethod\n def named_type(self, name: str, args: List[Type]) -> Instance:\n \"\"\"Construct an instance of a builtin type with given name.\"\"\"\n raise NotImplementedError\n\n @abstractmethod\n def analyze_type(self, typ: Type) -> Type:\n \"\"\"Ananlyze an unbound type using the default mypy logic.\"\"\"\n raise NotImplementedError\n\n @abstractmethod\n def analyze_callable_args(self, arglist: TypeList) -> Optional[Tuple[List[Type],\n List[int],\n List[Optional[str]]]]:\n \"\"\"Find types, kinds, and names of arguments from extended callable syntax.\"\"\"\n raise NotImplementedError", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py__A_context_for_a_hook_th_CommonPluginApi.lookup_fully_qualified.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py__A_context_for_a_hook_th_CommonPluginApi.lookup_fully_qualified.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "mypy/plugin.py", "file_name": "plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 174, "end_line": 201, "span_ids": ["CommonPluginApi.lookup_fully_qualified", "TypeAnalyzerPluginInterface.analyze_callable_args", "CommonPluginApi", "impl"], "tokens": 241}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# A context for a hook that semantically analyzes an unbound type.\nAnalyzeTypeContext = NamedTuple(\n 'AnalyzeTypeContext', [\n ('type', UnboundType), # Type to analyze\n ('context', Context), # Relevant location context (e.g. for error messages)\n ('api', TypeAnalyzerPluginInterface)])\n\n\n@mypyc_attr(allow_interpreted_subclasses=True)\nclass CommonPluginApi:\n \"\"\"\n A common plugin API (shared between semantic analysis and type checking phases)\n that all plugin hooks get independently of the context.\n \"\"\"\n\n # Global mypy options.\n # Per-file options can be only accessed on various\n # XxxPluginInterface classes.\n options = None # type: Options\n\n @abstractmethod\n def lookup_fully_qualified(self, fullname: str) -> Optional[SymbolTableNode]:\n \"\"\"Lookup a symbol by its full name (including module).\n\n This lookup function available for all plugins. Return None if a name\n is not found. This function doesn't support lookup from current scope.\n Use SemanticAnalyzerPluginInterface.lookup_qualified() for this.\"\"\"\n raise NotImplementedError", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_CheckerPluginInterface_CheckerPluginInterface.named_generic_type.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_CheckerPluginInterface_CheckerPluginInterface.named_generic_type.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "mypy/plugin.py", "file_name": "plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 204, "end_line": 231, "span_ids": ["CheckerPluginInterface.type_context", "CheckerPluginInterface.fail", "CheckerPluginInterface.named_generic_type", "CheckerPluginInterface"], "tokens": 205}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@trait\nclass CheckerPluginInterface:\n \"\"\"Interface for accessing type checker functionality in plugins.\n\n Methods docstrings contain only basic info. Look for corresponding implementation\n docstrings in checker.py for more details.\n \"\"\"\n\n msg = None # type: MessageBuilder\n options = None # type: Options\n path = None # type: str\n\n # Type context for type inference\n @property\n @abstractmethod\n def type_context(self) -> List[Optional[Type]]:\n \"\"\"Return the type context of the plugin\"\"\"\n raise NotImplementedError\n\n @abstractmethod\n def fail(self, msg: str, ctx: Context, *, code: Optional[ErrorCode] = None) -> None:\n \"\"\"Emit an error message at given location.\"\"\"\n raise NotImplementedError\n\n @abstractmethod\n def named_generic_type(self, name: str, args: List[Type]) -> Instance:\n \"\"\"Construct an instance of a builtin type with given type arguments.\"\"\"\n raise NotImplementedError", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_SemanticAnalyzerPluginInterface_SemanticAnalyzerPluginInterface.fail.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_SemanticAnalyzerPluginInterface_SemanticAnalyzerPluginInterface.fail.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "mypy/plugin.py", "file_name": "plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 234, "end_line": 264, "span_ids": ["SemanticAnalyzerPluginInterface.named_type", "SemanticAnalyzerPluginInterface.parse_bool", "SemanticAnalyzerPluginInterface.fail", "SemanticAnalyzerPluginInterface"], "tokens": 245}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@trait\nclass SemanticAnalyzerPluginInterface:\n \"\"\"Interface for accessing semantic analyzer functionality in plugins.\n\n Methods docstrings contain only basic info. Look for corresponding implementation\n docstrings in semanal.py for more details.\n\n # TODO: clean-up lookup functions.\n \"\"\"\n\n modules = None # type: Dict[str, MypyFile]\n # Options for current file.\n options = None # type: Options\n cur_mod_id = None # type: str\n msg = None # type: MessageBuilder\n\n @abstractmethod\n def named_type(self, qualified_name: str, args: Optional[List[Type]] = None) -> Instance:\n \"\"\"Construct an instance of a builtin type with given type arguments.\"\"\"\n raise NotImplementedError\n\n @abstractmethod\n def parse_bool(self, expr: Expression) -> Optional[bool]:\n \"\"\"Parse True/False literals.\"\"\"\n raise NotImplementedError\n\n @abstractmethod\n def fail(self, msg: str, ctx: Context, serious: bool = False, *,\n blocker: bool = False, code: Optional[ErrorCode] = None) -> None:\n \"\"\"Emit an error message at given location.\"\"\"\n raise NotImplementedError", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_SemanticAnalyzerPluginInterface.anal_type_SemanticAnalyzerPluginInterface.anal_type.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_SemanticAnalyzerPluginInterface.anal_type_SemanticAnalyzerPluginInterface.anal_type.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "mypy/plugin.py", "file_name": "plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 266, "end_line": 279, "span_ids": ["SemanticAnalyzerPluginInterface.anal_type"], "tokens": 128}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@trait\nclass SemanticAnalyzerPluginInterface:\n\n @abstractmethod\n def anal_type(self, t: Type, *,\n tvar_scope: Optional[TypeVarLikeScope] = None,\n allow_tuple_literal: bool = False,\n allow_unbound_tvars: bool = False,\n report_invalid_types: bool = True,\n third_pass: bool = False) -> Optional[Type]:\n \"\"\"Analyze an unbound type.\n\n Return None if some part of the type is not ready yet. In this\n case the current target being analyzed will be deferred and\n analyzed again.\n \"\"\"\n raise NotImplementedError", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_SemanticAnalyzerPluginInterface.class_type_SemanticAnalyzerPluginInterface.lookup_qualified.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_SemanticAnalyzerPluginInterface.class_type_SemanticAnalyzerPluginInterface.lookup_qualified.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "mypy/plugin.py", "file_name": "plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 281, "end_line": 314, "span_ids": ["SemanticAnalyzerPluginInterface.lookup_fully_qualified", "SemanticAnalyzerPluginInterface.lookup_fully_qualified_or_none", "SemanticAnalyzerPluginInterface.builtin_type", "SemanticAnalyzerPluginInterface.class_type", "SemanticAnalyzerPluginInterface.lookup_qualified"], "tokens": 241}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@trait\nclass SemanticAnalyzerPluginInterface:\n\n @abstractmethod\n def class_type(self, self_type: Type) -> Type:\n \"\"\"Generate type of first argument of class methods from type of self.\"\"\"\n raise NotImplementedError\n\n @abstractmethod\n def builtin_type(self, fully_qualified_name: str) -> Instance:\n \"\"\"Deprecated: use named_type instead.\"\"\"\n raise NotImplementedError\n\n @abstractmethod\n def lookup_fully_qualified(self, name: str) -> SymbolTableNode:\n \"\"\"Lookup a symbol by its fully qualified name.\n\n Raise an error if not found.\n \"\"\"\n raise NotImplementedError\n\n @abstractmethod\n def lookup_fully_qualified_or_none(self, name: str) -> Optional[SymbolTableNode]:\n \"\"\"Lookup a symbol by its fully qualified name.\n\n Return None if not found.\n \"\"\"\n raise NotImplementedError\n\n @abstractmethod\n def lookup_qualified(self, name: str, ctx: Context,\n suppress_errors: bool = False) -> Optional[SymbolTableNode]:\n \"\"\"Lookup symbol using a name in current scope.\n\n This follows Python local->non-local->global->builtins rules.\n \"\"\"\n raise NotImplementedError", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_SemanticAnalyzerPluginInterface.add_plugin_dependency_SemanticAnalyzerPluginInterface.add_plugin_dependency.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_SemanticAnalyzerPluginInterface.add_plugin_dependency_SemanticAnalyzerPluginInterface.add_plugin_dependency.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "mypy/plugin.py", "file_name": "plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 316, "end_line": 332, "span_ids": ["SemanticAnalyzerPluginInterface.add_plugin_dependency"], "tokens": 190}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@trait\nclass SemanticAnalyzerPluginInterface:\n\n @abstractmethod\n def add_plugin_dependency(self, trigger: str, target: Optional[str] = None) -> None:\n \"\"\"Specify semantic dependencies for generated methods/variables.\n\n If the symbol with full name given by trigger is found to be stale by mypy,\n then the body of node with full name given by target will be re-checked.\n By default, this is the node that is currently analyzed.\n\n For example, the dataclass plugin adds a generated __init__ method with\n a signature that depends on types of attributes in ancestor classes. If any\n attribute in an ancestor class gets stale (modified), we need to reprocess\n the subclasses (and thus regenerate __init__ methods).\n\n This is used by fine-grained incremental mode (mypy daemon). See mypy/server/deps.py\n for more details.\n \"\"\"\n raise NotImplementedError", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_SemanticAnalyzerPluginInterface.add_symbol_table_node_SemanticAnalyzerPluginInterface.final_iteration.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_SemanticAnalyzerPluginInterface.add_symbol_table_node_SemanticAnalyzerPluginInterface.final_iteration.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "mypy/plugin.py", "file_name": "plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 334, "end_line": 356, "span_ids": ["SemanticAnalyzerPluginInterface.qualified_name", "SemanticAnalyzerPluginInterface.final_iteration", "SemanticAnalyzerPluginInterface.add_symbol_table_node", "SemanticAnalyzerPluginInterface.defer"], "tokens": 169}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@trait\nclass SemanticAnalyzerPluginInterface:\n\n @abstractmethod\n def add_symbol_table_node(self, name: str, stnode: SymbolTableNode) -> Any:\n \"\"\"Add node to global symbol table (or to nearest class if there is one).\"\"\"\n raise NotImplementedError\n\n @abstractmethod\n def qualified_name(self, n: str) -> str:\n \"\"\"Make qualified name using current module and enclosing class (if any).\"\"\"\n raise NotImplementedError\n\n @abstractmethod\n def defer(self) -> None:\n \"\"\"Call this to defer the processing of the current node.\n\n This will request an additional iteration of semantic analysis.\n \"\"\"\n raise NotImplementedError\n\n @property\n @abstractmethod\n def final_iteration(self) -> bool:\n \"\"\"Is this the final iteration of semantic analysis?\"\"\"\n raise NotImplementedError", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py__A_context_for_querying___This_is_very_similar_to": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py__A_context_for_querying___This_is_very_similar_to", "embedding": null, "metadata": {"file_path": "mypy/plugin.py", "file_name": "plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 359, "end_line": 417, "span_ids": ["impl:9", "impl:3", "SemanticAnalyzerPluginInterface.final_iteration"], "tokens": 687}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# A context for querying for configuration data about a module for\n# cache invalidation purposes.\nReportConfigContext = NamedTuple(\n 'ReportConfigContext', [\n ('id', str), # Module name\n ('path', str), # Module file path\n ('is_check', bool) # Is this invocation for checking whether the config matches\n ])\n\n# A context for a function signature hook that infers a better signature for a\n# function. Note that argument types aren't available yet. If you need them,\n# you have to use a method hook instead.\nFunctionSigContext = NamedTuple(\n 'FunctionSigContext', [\n ('args', List[List[Expression]]), # Actual expressions for each formal argument\n ('default_signature', CallableType), # Original signature of the method\n ('context', Context), # Relevant location context (e.g. for error messages)\n ('api', CheckerPluginInterface)])\n\n# A context for a function hook that infers the return type of a function with\n# a special signature.\n#\n# A no-op callback would just return the inferred return type, but a useful\n# callback at least sometimes can infer a more precise type.\nFunctionContext = NamedTuple(\n 'FunctionContext', [\n ('arg_types', List[List[Type]]), # List of actual caller types for each formal argument\n ('arg_kinds', List[List[int]]), # Ditto for argument kinds, see nodes.ARG_* constants\n # Names of formal parameters from the callee definition,\n # these will be sufficient in most cases.\n ('callee_arg_names', List[Optional[str]]),\n # Names of actual arguments in the call expression. For example,\n # in a situation like this:\n # def func(**kwargs) -> None:\n # pass\n # func(kw1=1, kw2=2)\n # callee_arg_names will be ['kwargs'] and arg_names will be [['kw1', 'kw2']].\n ('arg_names', List[List[Optional[str]]]),\n ('default_return_type', Type), # Return type inferred from signature\n ('args', List[List[Expression]]), # Actual expressions for each formal argument\n ('context', Context), # Relevant location context (e.g. for error messages)\n ('api', CheckerPluginInterface)])\n\n# A context for a method signature hook that infers a better signature for a\n# method. Note that argument types aren't available yet. If you need them,\n# you have to use a method hook instead.\n# TODO: document ProperType in the plugin changelog/update issue.\nMethodSigContext = NamedTuple(\n 'MethodSigContext', [\n ('type', ProperType), # Base object type for method call\n ('args', List[List[Expression]]), # Actual expressions for each formal argument\n ('default_signature', CallableType), # Original signature of the method\n ('context', Context), # Relevant location context (e.g. for error messages)\n ('api', CheckerPluginInterface)])\n\n# A context for a method hook that infers the return type of a method with a\n# special signature.\n#\n# This is very similar to FunctionContext (only differences are documented).", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_MethodContext_DynamicClassDefContext.NamedTuple_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_MethodContext_DynamicClassDefContext.NamedTuple_", "embedding": null, "metadata": {"file_path": "mypy/plugin.py", "file_name": "plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 418, "end_line": 454, "span_ids": ["impl:9"], "tokens": 387}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "MethodContext = NamedTuple(\n 'MethodContext', [\n ('type', ProperType), # Base object type for method call\n ('arg_types', List[List[Type]]), # List of actual caller types for each formal argument\n # see FunctionContext for details about names and kinds\n ('arg_kinds', List[List[int]]),\n ('callee_arg_names', List[Optional[str]]),\n ('arg_names', List[List[Optional[str]]]),\n ('default_return_type', Type), # Return type inferred by mypy\n ('args', List[List[Expression]]), # Lists of actual expressions for every formal argument\n ('context', Context),\n ('api', CheckerPluginInterface)])\n\n# A context for an attribute type hook that infers the type of an attribute.\nAttributeContext = NamedTuple(\n 'AttributeContext', [\n ('type', ProperType), # Type of object with attribute\n ('default_attr_type', Type), # Original attribute type\n ('context', Context), # Relevant location context (e.g. for error messages)\n ('api', CheckerPluginInterface)])\n\n# A context for a class hook that modifies the class definition.\nClassDefContext = NamedTuple(\n 'ClassDefContext', [\n ('cls', ClassDef), # The class definition\n ('reason', Expression), # The expression being applied (decorator, metaclass, base class)\n ('api', SemanticAnalyzerPluginInterface)\n ])\n\n# A context for dynamic class definitions like\n# Base = declarative_base()\nDynamicClassDefContext = NamedTuple(\n 'DynamicClassDefContext', [\n ('call', CallExpr), # The r.h.s. of dynamic class definition\n ('name', str), # The name this class is being assigned to\n ('api', SemanticAnalyzerPluginInterface)\n ])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_Plugin_Plugin.lookup_fully_qualified.return.lookup_fully_qualified_fu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_Plugin_Plugin.lookup_fully_qualified.return.lookup_fully_qualified_fu", "embedding": null, "metadata": {"file_path": "mypy/plugin.py", "file_name": "plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 457, "end_line": 485, "span_ids": ["Plugin", "Plugin.lookup_fully_qualified", "Plugin.__init__", "Plugin.set_modules"], "tokens": 275}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@mypyc_attr(allow_interpreted_subclasses=True)\nclass Plugin(CommonPluginApi):\n \"\"\"Base class of all type checker plugins.\n\n This defines a no-op plugin. Subclasses can override some methods to\n provide some actual functionality.\n\n All get_ methods are treated as pure functions (you should assume that\n results might be cached). A plugin should return None from a get_ method\n to give way to other plugins.\n\n Look at the comments of various *Context objects for additional information on\n various hooks.\n \"\"\"\n\n def __init__(self, options: Options) -> None:\n self.options = options\n self.python_version = options.python_version\n # This can't be set in __init__ because it is executed too soon in build.py.\n # Therefore, build.py *must* set it later before graph processing starts\n # by calling set_modules().\n self._modules = None # type: Optional[Dict[str, MypyFile]]\n\n def set_modules(self, modules: Dict[str, MypyFile]) -> None:\n self._modules = modules\n\n def lookup_fully_qualified(self, fullname: str) -> Optional[SymbolTableNode]:\n assert self._modules is not None\n return lookup_fully_qualified(fullname, self._modules)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_Plugin.report_config_data_Plugin.report_config_data.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_Plugin.report_config_data_Plugin.report_config_data.return.None", "embedding": null, "metadata": {"file_path": "mypy/plugin.py", "file_name": "plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 487, "end_line": 508, "span_ids": ["Plugin.report_config_data"], "tokens": 218}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@mypyc_attr(allow_interpreted_subclasses=True)\nclass Plugin(CommonPluginApi):\n\n def report_config_data(self, ctx: ReportConfigContext) -> Any:\n \"\"\"Get representation of configuration data for a module.\n\n The data must be encodable as JSON and will be stored in the\n cache metadata for the module. A mismatch between the cached\n values and the returned will result in that module's cache\n being invalidated and the module being rechecked.\n\n This can be called twice for each module, once after loading\n the cache to check if it is valid and once while writing new\n cache information.\n\n If is_check in the context is true, then the return of this\n call will be checked against the cached version. Otherwise the\n call is being made to determine what to put in the cache. This\n can be used to allow consulting extra cache files in certain\n complex situations.\n\n This can be used to incorporate external configuration information\n that might require changes to typechecking.\n \"\"\"\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_Plugin.get_additional_deps_Plugin.get_additional_deps.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_Plugin.get_additional_deps_Plugin.get_additional_deps.return._", "embedding": null, "metadata": {"file_path": "mypy/plugin.py", "file_name": "plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 510, "end_line": 525, "span_ids": ["Plugin.get_additional_deps"], "tokens": 165}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@mypyc_attr(allow_interpreted_subclasses=True)\nclass Plugin(CommonPluginApi):\n\n def get_additional_deps(self, file: MypyFile) -> List[Tuple[int, str, int]]:\n \"\"\"Customize dependencies for a module.\n\n This hook allows adding in new dependencies for a module. It\n is called after parsing a file but before analysis. This can\n be useful if a library has dependencies that are dynamic based\n on configuration information, for example.\n\n Returns a list of (priority, module name, line number) tuples.\n\n The line number can be -1 when there is not a known real line number.\n\n Priorities are defined in mypy.build (but maybe shouldn't be).\n 10 is a good choice for priority.\n \"\"\"\n return []", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_Plugin.get_type_analyze_hook_Plugin.get_type_analyze_hook.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_Plugin.get_type_analyze_hook_Plugin.get_type_analyze_hook.return.None", "embedding": null, "metadata": {"file_path": "mypy/plugin.py", "file_name": "plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 527, "end_line": 544, "span_ids": ["Plugin.get_type_analyze_hook"], "tokens": 164}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@mypyc_attr(allow_interpreted_subclasses=True)\nclass Plugin(CommonPluginApi):\n\n def get_type_analyze_hook(self, fullname: str\n ) -> Optional[Callable[[AnalyzeTypeContext], Type]]:\n \"\"\"Customize behaviour of the type analyzer for given full names.\n\n This method is called during the semantic analysis pass whenever mypy sees an\n unbound type. For example, while analysing this code:\n\n from lib import Special, Other\n\n var: Special\n def func(x: Other[int]) -> None:\n ...\n\n this method will be called with 'lib.Special', and then with 'lib.Other'.\n The callback returned by plugin must return an analyzed type,\n i.e. an instance of `mypy.types.Type`.\n \"\"\"\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_Plugin.get_function_signature_hook_Plugin.get_function_hook.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_Plugin.get_function_signature_hook_Plugin.get_function_hook.return.None", "embedding": null, "metadata": {"file_path": "mypy/plugin.py", "file_name": "plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 546, "end_line": 577, "span_ids": ["Plugin.get_function_hook", "Plugin.get_function_signature_hook"], "tokens": 248}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@mypyc_attr(allow_interpreted_subclasses=True)\nclass Plugin(CommonPluginApi):\n\n def get_function_signature_hook(self, fullname: str\n ) -> Optional[Callable[[FunctionSigContext], CallableType]]:\n \"\"\"Adjust the signature of a function.\n\n This method is called before type checking a function call. Plugin\n may infer a better type for the function.\n\n from lib import Class, do_stuff\n\n do_stuff(42)\n Class()\n\n This method will be called with 'lib.do_stuff' and then with 'lib.Class'.\n \"\"\"\n return None\n\n def get_function_hook(self, fullname: str\n ) -> Optional[Callable[[FunctionContext], Type]]:\n \"\"\"Adjust the return type of a function call.\n\n This method is called after type checking a call. Plugin may adjust the return\n type inferred by mypy, and/or emit some error messages. Note, this hook is also\n called for class instantiation calls, so that in this example:\n\n from lib import Class, do_stuff\n\n do_stuff(42)\n Class()\n\n This method will be called with 'lib.do_stuff' and then with 'lib.Class'.\n \"\"\"\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_Plugin.get_method_signature_hook_Plugin.get_method_hook.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_Plugin.get_method_signature_hook_Plugin.get_method_hook.return.None", "embedding": null, "metadata": {"file_path": "mypy/plugin.py", "file_name": "plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 579, "end_line": 615, "span_ids": ["Plugin.get_method_hook", "Plugin.get_method_signature_hook"], "tokens": 292}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@mypyc_attr(allow_interpreted_subclasses=True)\nclass Plugin(CommonPluginApi):\n\n def get_method_signature_hook(self, fullname: str\n ) -> Optional[Callable[[MethodSigContext], CallableType]]:\n \"\"\"Adjust the signature of a method.\n\n This method is called before type checking a method call. Plugin\n may infer a better type for the method. The hook is also called for special\n Python dunder methods except __init__ and __new__ (use get_function_hook to customize\n class instantiation). This function is called with the method full name using\n the class where it was _defined_. For example, in this code:\n\n from lib import Special\n\n class Base:\n def method(self, arg: Any) -> Any:\n ...\n class Derived(Base):\n ...\n\n var: Derived\n var.method(42)\n\n x: Special\n y = x[0]\n\n this method is called with '__main__.Base.method', and then with\n 'lib.Special.__getitem__'.\n \"\"\"\n return None\n\n def get_method_hook(self, fullname: str\n ) -> Optional[Callable[[MethodContext], Type]]:\n \"\"\"Adjust return type of a method call.\n\n This is the same as get_function_hook(), but is called with the\n method full name (again, using the class where the method is defined).\n \"\"\"\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_Plugin.get_attribute_hook_Plugin.get_attribute_hook.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_Plugin.get_attribute_hook_Plugin.get_attribute_hook.return.None", "embedding": null, "metadata": {"file_path": "mypy/plugin.py", "file_name": "plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 617, "end_line": 647, "span_ids": ["Plugin.get_attribute_hook"], "tokens": 265}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@mypyc_attr(allow_interpreted_subclasses=True)\nclass Plugin(CommonPluginApi):\n\n def get_attribute_hook(self, fullname: str\n ) -> Optional[Callable[[AttributeContext], Type]]:\n \"\"\"Adjust type of a class attribute.\n\n This method is called with attribute full name using the class where the attribute was\n defined (or Var.info.fullname for generated attributes).\n\n For classes without __getattr__ or __getattribute__, this hook is only called for\n names of fields/properties (but not methods) that exist in the instance MRO.\n\n For classes that implement __getattr__ or __getattribute__, this hook is called\n for all fields/properties, including nonexistent ones (but still not methods).\n\n For example:\n\n class Base:\n x: Any\n def __getattr__(self, attr: str) -> Any: ...\n\n class Derived(Base):\n ...\n\n var: Derived\n var.x\n var.y\n\n get_attribute_hook is called with '__main__.Base.x' and '__main__.Base.y'.\n However, if we had not implemented __getattr__ on Base, you would only get\n the callback for 'var.x'; 'var.y' would produce an error without calling the hook.\n \"\"\"\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_Plugin.get_class_decorator_hook_Plugin.get_customize_class_mro_hook.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_Plugin.get_class_decorator_hook_Plugin.get_customize_class_mro_hook.return.None", "embedding": null, "metadata": {"file_path": "mypy/plugin.py", "file_name": "plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 649, "end_line": 690, "span_ids": ["Plugin.get_class_decorator_hook", "Plugin.get_base_class_hook", "Plugin.get_metaclass_hook", "Plugin.get_customize_class_mro_hook"], "tokens": 372}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@mypyc_attr(allow_interpreted_subclasses=True)\nclass Plugin(CommonPluginApi):\n\n def get_class_decorator_hook(self, fullname: str\n ) -> Optional[Callable[[ClassDefContext], None]]:\n \"\"\"Update class definition for given class decorators.\n\n The plugin can modify a TypeInfo _in place_ (for example add some generated\n methods to the symbol table). This hook is called after the class body was\n semantically analyzed.\n\n The hook is called with full names of all class decorators, for example\n \"\"\"\n return None\n\n def get_metaclass_hook(self, fullname: str\n ) -> Optional[Callable[[ClassDefContext], None]]:\n \"\"\"Update class definition for given declared metaclasses.\n\n Same as get_class_decorator_hook() but for metaclasses. Note:\n this hook will be only called for explicit metaclasses, not for\n inherited ones.\n\n TODO: probably it should also be called on inherited metaclasses.\n \"\"\"\n return None\n\n def get_base_class_hook(self, fullname: str\n ) -> Optional[Callable[[ClassDefContext], None]]:\n \"\"\"Update class definition for given base classes.\n\n Same as get_class_decorator_hook() but for base classes. Base classes\n don't need to refer to TypeInfos, if a base class refers to a variable with\n Any type, this hook will still be called.\n \"\"\"\n return None\n\n def get_customize_class_mro_hook(self, fullname: str\n ) -> Optional[Callable[[ClassDefContext], None]]:\n \"\"\"Customize MRO for given classes.\n\n The plugin can modify the class MRO _in place_. This method is called\n with the class full name before its body was semantically analyzed.\n \"\"\"\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_Plugin.get_dynamic_class_hook_T.TypeVar_T_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_Plugin.get_dynamic_class_hook_T.TypeVar_T_", "embedding": null, "metadata": {"file_path": "mypy/plugin.py", "file_name": "plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 692, "end_line": 709, "span_ids": ["impl:19", "Plugin.get_dynamic_class_hook"], "tokens": 146}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@mypyc_attr(allow_interpreted_subclasses=True)\nclass Plugin(CommonPluginApi):\n\n def get_dynamic_class_hook(self, fullname: str\n ) -> Optional[Callable[[DynamicClassDefContext], None]]:\n \"\"\"Semantically analyze a dynamic class definition.\n\n This plugin hook allows one to semantically analyze dynamic class definitions like:\n\n from lib import dynamic_class\n\n X = dynamic_class('X', [])\n\n For such definition, this hook will be called with 'lib.dynamic_class'.\n The plugin should create the corresponding TypeInfo, and place it into a relevant\n symbol table, e.g. using ctx.api.add_symbol_table_node().\n \"\"\"\n return None\n\n\nT = TypeVar('T')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_ChainedPlugin_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugin.py_ChainedPlugin_", "embedding": null, "metadata": {"file_path": "mypy/plugin.py", "file_name": "plugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 712, "end_line": 796, "span_ids": ["ChainedPlugin.get_additional_deps", "ChainedPlugin.get_function_hook", "ChainedPlugin.__init__", "ChainedPlugin.get_type_analyze_hook", "ChainedPlugin.get_method_hook", "ChainedPlugin.get_base_class_hook", "ChainedPlugin.get_class_decorator_hook", "ChainedPlugin.get_function_signature_hook", "ChainedPlugin.get_dynamic_class_hook", "ChainedPlugin.get_customize_class_mro_hook", "ChainedPlugin.report_config_data", "ChainedPlugin.get_metaclass_hook", "ChainedPlugin", "ChainedPlugin._find_hook", "ChainedPlugin.set_modules", "ChainedPlugin.get_attribute_hook", "ChainedPlugin.get_method_signature_hook"], "tokens": 777}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ChainedPlugin(Plugin):\n \"\"\"A plugin that represents a sequence of chained plugins.\n\n Each lookup method returns the hook for the first plugin that\n reports a match.\n\n This class should not be subclassed -- use Plugin as the base class\n for all plugins.\n \"\"\"\n\n # TODO: Support caching of lookup results (through a LRU cache, for example).\n\n def __init__(self, options: Options, plugins: List[Plugin]) -> None:\n \"\"\"Initialize chained plugin.\n\n Assume that the child plugins aren't mutated (results may be cached).\n \"\"\"\n super().__init__(options)\n self._plugins = plugins\n\n def set_modules(self, modules: Dict[str, MypyFile]) -> None:\n for plugin in self._plugins:\n plugin.set_modules(modules)\n\n def report_config_data(self, ctx: ReportConfigContext) -> Any:\n config_data = [plugin.report_config_data(ctx) for plugin in self._plugins]\n return config_data if any(x is not None for x in config_data) else None\n\n def get_additional_deps(self, file: MypyFile) -> List[Tuple[int, str, int]]:\n deps = []\n for plugin in self._plugins:\n deps.extend(plugin.get_additional_deps(file))\n return deps\n\n def get_type_analyze_hook(self, fullname: str\n ) -> Optional[Callable[[AnalyzeTypeContext], Type]]:\n return self._find_hook(lambda plugin: plugin.get_type_analyze_hook(fullname))\n\n def get_function_signature_hook(self, fullname: str\n ) -> Optional[Callable[[FunctionSigContext], CallableType]]:\n return self._find_hook(lambda plugin: plugin.get_function_signature_hook(fullname))\n\n def get_function_hook(self, fullname: str\n ) -> Optional[Callable[[FunctionContext], Type]]:\n return self._find_hook(lambda plugin: plugin.get_function_hook(fullname))\n\n def get_method_signature_hook(self, fullname: str\n ) -> Optional[Callable[[MethodSigContext], CallableType]]:\n return self._find_hook(lambda plugin: plugin.get_method_signature_hook(fullname))\n\n def get_method_hook(self, fullname: str\n ) -> Optional[Callable[[MethodContext], Type]]:\n return self._find_hook(lambda plugin: plugin.get_method_hook(fullname))\n\n def get_attribute_hook(self, fullname: str\n ) -> Optional[Callable[[AttributeContext], Type]]:\n return self._find_hook(lambda plugin: plugin.get_attribute_hook(fullname))\n\n def get_class_decorator_hook(self, fullname: str\n ) -> Optional[Callable[[ClassDefContext], None]]:\n return self._find_hook(lambda plugin: plugin.get_class_decorator_hook(fullname))\n\n def get_metaclass_hook(self, fullname: str\n ) -> Optional[Callable[[ClassDefContext], None]]:\n return self._find_hook(lambda plugin: plugin.get_metaclass_hook(fullname))\n\n def get_base_class_hook(self, fullname: str\n ) -> Optional[Callable[[ClassDefContext], None]]:\n return self._find_hook(lambda plugin: plugin.get_base_class_hook(fullname))\n\n def get_customize_class_mro_hook(self, fullname: str\n ) -> Optional[Callable[[ClassDefContext], None]]:\n return self._find_hook(lambda plugin: plugin.get_customize_class_mro_hook(fullname))\n\n def get_dynamic_class_hook(self, fullname: str\n ) -> Optional[Callable[[DynamicClassDefContext], None]]:\n return self._find_hook(lambda plugin: plugin.get_dynamic_class_hook(fullname))\n\n def _find_hook(self, lookup: Callable[[Plugin], T]) -> Optional[T]:\n for plugin in self._plugins:\n hook = lookup(plugin)\n if hook:\n return hook\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py__Plugin_for_supporting__Converter.__init__.self.is_attr_converters_optional.is_attr_converters_option": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py__Plugin_for_supporting__Converter.__init__.self.is_attr_converters_optional.is_attr_converters_option", "embedding": null, "metadata": {"file_path": "mypy/plugins/attrs.py", "file_name": "attrs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 67, "span_ids": ["Converter", "Converter.__init__", "docstring"], "tokens": 550}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Plugin for supporting the attrs library (http://www.attrs.org)\"\"\"\n\nfrom mypy.ordered_dict import OrderedDict\n\nfrom typing import Optional, Dict, List, cast, Tuple, Iterable\nfrom typing_extensions import Final\n\nimport mypy.plugin # To avoid circular imports.\nfrom mypy.exprtotype import expr_to_unanalyzed_type, TypeTranslationError\nfrom mypy.fixup import lookup_qualified_stnode\nfrom mypy.nodes import (\n Context, Argument, Var, ARG_OPT, ARG_POS, TypeInfo, AssignmentStmt,\n TupleExpr, ListExpr, NameExpr, CallExpr, RefExpr, FuncDef,\n is_class_var, TempNode, Decorator, MemberExpr, Expression,\n SymbolTableNode, MDEF, JsonDict, OverloadedFuncDef, ARG_NAMED_OPT, ARG_NAMED,\n TypeVarExpr, PlaceholderNode\n)\nfrom mypy.plugin import SemanticAnalyzerPluginInterface\nfrom mypy.plugins.common import (\n _get_argument, _get_bool_argument, _get_decorator_bool_argument, add_method,\n deserialize_and_fixup_type\n)\nfrom mypy.types import (\n Type, AnyType, TypeOfAny, CallableType, NoneType, TypeVarDef, TypeVarType,\n Overloaded, UnionType, FunctionLike, get_proper_type\n)\nfrom mypy.typeops import make_simplified_union, map_type_from_supertype\nfrom mypy.typevars import fill_typevars\nfrom mypy.util import unmangle\nfrom mypy.server.trigger import make_wildcard_trigger\n\nKW_ONLY_PYTHON_2_UNSUPPORTED = \"kw_only is not supported in Python 2\"\n\n# The names of the different functions that create classes or arguments.\nattr_class_makers = {\n 'attr.s',\n 'attr.attrs',\n 'attr.attributes',\n} # type: Final\nattr_dataclass_makers = {\n 'attr.dataclass',\n} # type: Final\nattr_frozen_makers = {\n 'attr.frozen'\n} # type: Final\nattr_define_makers = {\n 'attr.define',\n 'attr.mutable'\n} # type: Final\nattr_attrib_makers = {\n 'attr.ib',\n 'attr.attrib',\n 'attr.attr',\n 'attr.field',\n} # type: Final\n\nSELF_TVAR_NAME = '_AT' # type: Final\n\n\nclass Converter:\n \"\"\"Holds information about a `converter=` argument\"\"\"\n\n def __init__(self,\n name: Optional[str] = None,\n is_attr_converters_optional: bool = False) -> None:\n self.name = name\n self.is_attr_converters_optional = is_attr_converters_optional", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py_Attribute_Attribute.argument.return.Argument_Var_self_name_ls": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py_Attribute_Attribute.argument.return.Argument_Var_self_name_ls", "embedding": null, "metadata": {"file_path": "mypy/plugins/attrs.py", "file_name": "attrs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 70, "end_line": 163, "span_ids": ["Attribute.__init__", "Attribute.argument", "Attribute"], "tokens": 902}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Attribute:\n \"\"\"The value of an attr.ib() call.\"\"\"\n\n def __init__(self, name: str, info: TypeInfo,\n has_default: bool, init: bool, kw_only: bool, converter: Converter,\n context: Context,\n init_type: Optional[Type]) -> None:\n self.name = name\n self.info = info\n self.has_default = has_default\n self.init = init\n self.kw_only = kw_only\n self.converter = converter\n self.context = context\n self.init_type = init_type\n\n def argument(self, ctx: 'mypy.plugin.ClassDefContext') -> Argument:\n \"\"\"Return this attribute as an argument to __init__.\"\"\"\n assert self.init\n\n init_type = self.init_type or self.info[self.name].type\n\n if self.converter.name:\n # When a converter is set the init_type is overridden by the first argument\n # of the converter method.\n converter = lookup_qualified_stnode(ctx.api.modules, self.converter.name, True)\n if not converter:\n # The converter may be a local variable. Check there too.\n converter = ctx.api.lookup_qualified(self.converter.name, self.info, True)\n\n # Get the type of the converter.\n converter_type = None # type: Optional[Type]\n if converter and isinstance(converter.node, TypeInfo):\n from mypy.checkmember import type_object_type # To avoid import cycle.\n converter_type = type_object_type(converter.node, ctx.api.builtin_type)\n elif converter and isinstance(converter.node, OverloadedFuncDef):\n converter_type = converter.node.type\n elif converter and converter.type:\n converter_type = converter.type\n\n init_type = None\n converter_type = get_proper_type(converter_type)\n if isinstance(converter_type, CallableType) and converter_type.arg_types:\n init_type = ctx.api.anal_type(converter_type.arg_types[0])\n elif isinstance(converter_type, Overloaded):\n types = [] # type: List[Type]\n for item in converter_type.items():\n # Walk the overloads looking for methods that can accept one argument.\n num_arg_types = len(item.arg_types)\n if not num_arg_types:\n continue\n if num_arg_types > 1 and any(kind == ARG_POS for kind in item.arg_kinds[1:]):\n continue\n types.append(item.arg_types[0])\n # Make a union of all the valid types.\n if types:\n args = make_simplified_union(types)\n init_type = ctx.api.anal_type(args)\n\n if self.converter.is_attr_converters_optional and init_type:\n # If the converter was attr.converter.optional(type) then add None to\n # the allowed init_type.\n init_type = UnionType.make_union([init_type, NoneType()])\n\n if not init_type:\n ctx.api.fail(\"Cannot determine __init__ type from converter\", self.context)\n init_type = AnyType(TypeOfAny.from_error)\n elif self.converter.name == '':\n # This means we had a converter but it's not of a type we can infer.\n # Error was shown in _get_converter_name\n init_type = AnyType(TypeOfAny.from_error)\n\n if init_type is None:\n if ctx.api.options.disallow_untyped_defs:\n # This is a compromise. If you don't have a type here then the\n # __init__ will be untyped. But since the __init__ is added it's\n # pointing at the decorator. So instead we also show the error in the\n # assignment, which is where you would fix the issue.\n node = self.info[self.name].node\n assert node is not None\n ctx.api.msg.need_annotation_for_var(node, self.context)\n\n # Convert type not set to Any.\n init_type = AnyType(TypeOfAny.unannotated)\n\n if self.kw_only:\n arg_kind = ARG_NAMED_OPT if self.has_default else ARG_NAMED\n else:\n arg_kind = ARG_OPT if self.has_default else ARG_POS\n\n # Attrs removes leading underscores when creating the __init__ arguments.\n return Argument(Var(self.name.lstrip(\"_\"), init_type), init_type,\n None,\n arg_kind)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py__determine_eq_order__determine_eq_order.return.order": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py__determine_eq_order__determine_eq_order.return.order", "embedding": null, "metadata": {"file_path": "mypy/plugins/attrs.py", "file_name": "attrs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 205, "end_line": 231, "span_ids": ["_determine_eq_order"], "tokens": 220}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _determine_eq_order(ctx: 'mypy.plugin.ClassDefContext') -> bool:\n \"\"\"\n Validate the combination of *cmp*, *eq*, and *order*. Derive the effective\n value of order.\n \"\"\"\n cmp = _get_decorator_optional_bool_argument(ctx, 'cmp')\n eq = _get_decorator_optional_bool_argument(ctx, 'eq')\n order = _get_decorator_optional_bool_argument(ctx, 'order')\n\n if cmp is not None and any((eq is not None, order is not None)):\n ctx.api.fail('Don\\'t mix \"cmp\" with \"eq\" and \"order\"', ctx.reason)\n\n # cmp takes precedence due to bw-compatibility.\n if cmp is not None:\n return cmp\n\n # If left None, equality is on and ordering mirrors equality.\n if eq is None:\n eq = True\n\n if order is None:\n order = eq\n\n if eq is False and order is True:\n ctx.api.fail('eq must be True if order is True', ctx.reason)\n\n return order", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py__get_decorator_optional_bool_argument__get_decorator_optional_bool_argument.if_isinstance_ctx_reason_.else_.return.default": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py__get_decorator_optional_bool_argument__get_decorator_optional_bool_argument.if_isinstance_ctx_reason_.else_.return.default", "embedding": null, "metadata": {"file_path": "mypy/plugins/attrs.py", "file_name": "attrs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 208, "end_line": 231, "span_ids": ["_get_decorator_optional_bool_argument"], "tokens": 185}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _get_decorator_optional_bool_argument(\n ctx: 'mypy.plugin.ClassDefContext',\n name: str,\n default: Optional[bool] = None,\n) -> Optional[bool]:\n \"\"\"Return the Optional[bool] argument for the decorator.\n\n This handles both @decorator(...) and @decorator.\n \"\"\"\n if isinstance(ctx.reason, CallExpr):\n attr_value = _get_argument(ctx.reason, name)\n if attr_value:\n if isinstance(attr_value, NameExpr):\n if attr_value.fullname == 'builtins.True':\n return True\n if attr_value.fullname == 'builtins.False':\n return False\n if attr_value.fullname == 'builtins.None':\n return None\n ctx.api.fail('\"{}\" argument must be True or False.'.format(name), ctx.reason)\n return default\n return default\n else:\n return default", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py_attr_class_maker_callback__get_frozen.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py_attr_class_maker_callback__get_frozen.return.False", "embedding": null, "metadata": {"file_path": "mypy/plugins/attrs.py", "file_name": "attrs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 260, "end_line": 331, "span_ids": ["attr_class_maker_callback", "_get_frozen"], "tokens": 660}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def attr_class_maker_callback(ctx: 'mypy.plugin.ClassDefContext',\n auto_attribs_default: Optional[bool] = False,\n frozen_default: bool = False) -> None:\n \"\"\"Add necessary dunder methods to classes decorated with attr.s.\n\n attrs is a package that lets you define classes without writing dull boilerplate code.\n\n At a quick glance, the decorator searches the class body for assignments of `attr.ib`s (or\n annotated variables if auto_attribs=True), then depending on how the decorator is called,\n it will add an __init__ or all the __cmp__ methods. For frozen=True it will turn the attrs\n into properties.\n\n See http://www.attrs.org/en/stable/how-does-it-work.html for information on how attrs works.\n \"\"\"\n info = ctx.cls.info\n\n init = _get_decorator_bool_argument(ctx, 'init', True)\n frozen = _get_frozen(ctx, frozen_default)\n order = _determine_eq_order(ctx)\n\n auto_attribs = _get_decorator_optional_bool_argument(ctx, 'auto_attribs', auto_attribs_default)\n kw_only = _get_decorator_bool_argument(ctx, 'kw_only', False)\n\n if ctx.api.options.python_version[0] < 3:\n if auto_attribs:\n ctx.api.fail(\"auto_attribs is not supported in Python 2\", ctx.reason)\n return\n if not info.defn.base_type_exprs:\n # Note: This will not catch subclassing old-style classes.\n ctx.api.fail(\"attrs only works with new-style classes\", info.defn)\n return\n if kw_only:\n ctx.api.fail(KW_ONLY_PYTHON_2_UNSUPPORTED, ctx.reason)\n return\n\n attributes = _analyze_class(ctx, auto_attribs, kw_only)\n\n # Check if attribute types are ready.\n for attr in attributes:\n node = info.get(attr.name)\n if node is None:\n # This name is likely blocked by a star import. We don't need to defer because\n # defer() is already called by mark_incomplete().\n return\n if node.type is None and not ctx.api.final_iteration:\n ctx.api.defer()\n return\n\n # Save the attributes so that subclasses can reuse them.\n ctx.cls.info.metadata['attrs'] = {\n 'attributes': [attr.serialize() for attr in attributes],\n 'frozen': frozen,\n }\n\n adder = MethodAdder(ctx)\n if init:\n _add_init(ctx, attributes, adder)\n if order:\n _add_order(ctx, adder)\n if frozen:\n _make_frozen(ctx, attributes)\n\n\ndef _get_frozen(ctx: 'mypy.plugin.ClassDefContext', frozen_default: bool) -> bool:\n \"\"\"Return whether this class is frozen.\"\"\"\n if _get_decorator_bool_argument(ctx, 'frozen', frozen_default):\n return True\n # Subclasses of frozen classes are frozen so check that.\n for super_info in ctx.cls.info.mro[1:-1]:\n if 'attrs' in super_info.metadata and super_info.metadata['attrs']['frozen']:\n return True\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py__analyze_class__analyze_class.return.attributes": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py__analyze_class__analyze_class.return.attributes", "embedding": null, "metadata": {"file_path": "mypy/plugins/attrs.py", "file_name": "attrs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 334, "end_line": 412, "span_ids": ["_analyze_class"], "tokens": 744}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _analyze_class(ctx: 'mypy.plugin.ClassDefContext',\n auto_attribs: Optional[bool],\n kw_only: bool) -> List[Attribute]:\n \"\"\"Analyze the class body of an attr maker, its parents, and return the Attributes found.\n\n auto_attribs=True means we'll generate attributes from type annotations also.\n auto_attribs=None means we'll detect which mode to use.\n kw_only=True means that all attributes created here will be keyword only args in __init__.\n \"\"\"\n own_attrs = OrderedDict() # type: OrderedDict[str, Attribute]\n if auto_attribs is None:\n auto_attribs = _detect_auto_attribs(ctx)\n\n # Walk the body looking for assignments and decorators.\n for stmt in ctx.cls.defs.body:\n if isinstance(stmt, AssignmentStmt):\n for attr in _attributes_from_assignment(ctx, stmt, auto_attribs, kw_only):\n # When attrs are defined twice in the same body we want to use the 2nd definition\n # in the 2nd location. So remove it from the OrderedDict.\n # Unless it's auto_attribs in which case we want the 2nd definition in the\n # 1st location.\n if not auto_attribs and attr.name in own_attrs:\n del own_attrs[attr.name]\n own_attrs[attr.name] = attr\n elif isinstance(stmt, Decorator):\n _cleanup_decorator(stmt, own_attrs)\n\n for attribute in own_attrs.values():\n # Even though these look like class level assignments we want them to look like\n # instance level assignments.\n if attribute.name in ctx.cls.info.names:\n node = ctx.cls.info.names[attribute.name].node\n if isinstance(node, PlaceholderNode):\n # This node is not ready yet.\n continue\n assert isinstance(node, Var)\n node.is_initialized_in_class = False\n\n # Traverse the MRO and collect attributes from the parents.\n taken_attr_names = set(own_attrs)\n super_attrs = []\n for super_info in ctx.cls.info.mro[1:-1]:\n if 'attrs' in super_info.metadata:\n # Each class depends on the set of attributes in its attrs ancestors.\n ctx.api.add_plugin_dependency(make_wildcard_trigger(super_info.fullname))\n\n for data in super_info.metadata['attrs']['attributes']:\n # Only add an attribute if it hasn't been defined before. This\n # allows for overwriting attribute definitions by subclassing.\n if data['name'] not in taken_attr_names:\n a = Attribute.deserialize(super_info, data, ctx.api)\n a.expand_typevar_from_subtype(ctx.cls.info)\n super_attrs.append(a)\n taken_attr_names.add(a.name)\n attributes = super_attrs + list(own_attrs.values())\n\n # Check the init args for correct default-ness. Note: This has to be done after all the\n # attributes for all classes have been read, because subclasses can override parents.\n last_default = False\n\n for i, attribute in enumerate(attributes):\n if not attribute.init:\n continue\n\n if attribute.kw_only:\n # Keyword-only attributes don't care whether they are default or not.\n continue\n\n # If the issue comes from merging different classes, report it\n # at the class definition point.\n context = attribute.context if i >= len(super_attrs) else ctx.cls\n\n if not attribute.has_default and last_default:\n ctx.api.fail(\n \"Non-default attributes not allowed after default attributes.\",\n context)\n last_default |= attribute.has_default\n\n return attributes", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py__attributes_from_assignment__attributes_from_assignment.for_lvalue_in_stmt_lvalue.for_lhs_rvalue_in_zip_lv.if_isinstance_rvalue_Ca.elif_auto_attribs_and_stm.yield__attribute_from_aut": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py__attributes_from_assignment__attributes_from_assignment.for_lvalue_in_stmt_lvalue.for_lhs_rvalue_in_zip_lv.if_isinstance_rvalue_Ca.elif_auto_attribs_and_stm.yield__attribute_from_aut", "embedding": null, "metadata": {"file_path": "mypy/plugins/attrs.py", "file_name": "attrs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 383, "end_line": 413, "span_ids": ["_attributes_from_assignment"], "tokens": 311}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _attributes_from_assignment(ctx: 'mypy.plugin.ClassDefContext',\n stmt: AssignmentStmt, auto_attribs: bool,\n kw_only: bool) -> Iterable[Attribute]:\n \"\"\"Return Attribute objects that are created by this assignment.\n\n The assignments can look like this:\n x = attr.ib()\n x = y = attr.ib()\n x, y = attr.ib(), attr.ib()\n or if auto_attribs is enabled also like this:\n x: type\n x: type = default_value\n \"\"\"\n for lvalue in stmt.lvalues:\n lvalues, rvalues = _parse_assignments(lvalue, stmt)\n\n if len(lvalues) != len(rvalues):\n # This means we have some assignment that isn't 1 to 1.\n # It can't be an attrib.\n continue\n\n for lhs, rvalue in zip(lvalues, rvalues):\n # Check if the right hand side is a call to an attribute maker.\n if (isinstance(rvalue, CallExpr)\n and isinstance(rvalue.callee, RefExpr)\n and rvalue.callee.fullname in attr_attrib_makers):\n attr = _attribute_from_attrib_maker(ctx, auto_attribs, kw_only, lhs, rvalue, stmt)\n if attr:\n yield attr\n elif auto_attribs and stmt.type and stmt.new_syntax and not is_class_var(lhs):\n yield _attribute_from_auto_attrib(ctx, kw_only, lhs, rvalue, stmt)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py__cleanup_decorator__cleanup_decorator.for_dec_in_remove_me_.stmt_decorators_remove_de": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py__cleanup_decorator__cleanup_decorator.for_dec_in_remove_me_.stmt_decorators_remove_de", "embedding": null, "metadata": {"file_path": "mypy/plugins/attrs.py", "file_name": "attrs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 416, "end_line": 442, "span_ids": ["_cleanup_decorator"], "tokens": 279}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _cleanup_decorator(stmt: Decorator, attr_map: Dict[str, Attribute]) -> None:\n \"\"\"Handle decorators in class bodies.\n\n `x.default` will set a default value on x\n `x.validator` and `x.default` will get removed to avoid throwing a type error.\n \"\"\"\n remove_me = []\n for func_decorator in stmt.decorators:\n if (isinstance(func_decorator, MemberExpr)\n and isinstance(func_decorator.expr, NameExpr)\n and func_decorator.expr.name in attr_map):\n\n if func_decorator.name == 'default':\n attr_map[func_decorator.expr.name].has_default = True\n\n if func_decorator.name in ('default', 'validator'):\n # These are decorators on the attrib object that only exist during\n # class creation time. In order to not trigger a type error later we\n # just remove them. This might leave us with a Decorator with no\n # decorators (Emperor's new clothes?)\n # TODO: It would be nice to type-check these rather than remove them.\n # default should be Callable[[], T]\n # validator should be Callable[[Any, 'Attribute', T], Any]\n # where T is the type of the attribute.\n remove_me.append(func_decorator)\n for dec in remove_me:\n stmt.decorators.remove(dec)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py__attribute_from_auto_attrib__attribute_from_auto_attrib.return.Attribute_name_ctx_cls_i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py__attribute_from_auto_attrib__attribute_from_auto_attrib.return.Attribute_name_ctx_cls_i", "embedding": null, "metadata": {"file_path": "mypy/plugins/attrs.py", "file_name": "attrs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 504, "end_line": 515, "span_ids": ["_attribute_from_auto_attrib"], "tokens": 141}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _attribute_from_auto_attrib(ctx: 'mypy.plugin.ClassDefContext',\n kw_only: bool,\n lhs: NameExpr,\n rvalue: Expression,\n stmt: AssignmentStmt) -> Attribute:\n \"\"\"Return an Attribute for a new type assignment.\"\"\"\n name = unmangle(lhs.name)\n # `x: int` (without equal sign) assigns rvalue to TempNode(AnyType())\n has_rhs = not isinstance(rvalue, TempNode)\n sym = ctx.cls.info.names.get(name)\n init_type = sym.type if sym else None\n return Attribute(name, ctx.cls.info, has_rhs, True, kw_only, Converter(), stmt, init_type)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py__attribute_from_attrib_maker__attribute_from_attrib_maker.return.Attribute_name_ctx_cls_i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py__attribute_from_attrib_maker__attribute_from_attrib_maker.return.Attribute_name_ctx_cls_i", "embedding": null, "metadata": {"file_path": "mypy/plugins/attrs.py", "file_name": "attrs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 518, "end_line": 582, "span_ids": ["_attribute_from_attrib_maker"], "tokens": 648}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _attribute_from_attrib_maker(ctx: 'mypy.plugin.ClassDefContext',\n auto_attribs: bool,\n kw_only: bool,\n lhs: NameExpr,\n rvalue: CallExpr,\n stmt: AssignmentStmt) -> Optional[Attribute]:\n \"\"\"Return an Attribute from the assignment or None if you can't make one.\"\"\"\n if auto_attribs and not stmt.new_syntax:\n # auto_attribs requires an annotation on *every* attr.ib.\n assert lhs.node is not None\n ctx.api.msg.need_annotation_for_var(lhs.node, stmt)\n return None\n\n if len(stmt.lvalues) > 1:\n ctx.api.fail(\"Too many names for one attribute\", stmt)\n return None\n\n # This is the type that belongs in the __init__ method for this attrib.\n init_type = stmt.type\n\n # Read all the arguments from the call.\n init = _get_bool_argument(ctx, rvalue, 'init', True)\n # Note: If the class decorator says kw_only=True the attribute is ignored.\n # See https://github.com/python-attrs/attrs/issues/481 for explanation.\n kw_only |= _get_bool_argument(ctx, rvalue, 'kw_only', False)\n if kw_only and ctx.api.options.python_version[0] < 3:\n ctx.api.fail(KW_ONLY_PYTHON_2_UNSUPPORTED, stmt)\n return None\n\n # TODO: Check for attr.NOTHING\n attr_has_default = bool(_get_argument(rvalue, 'default'))\n attr_has_factory = bool(_get_argument(rvalue, 'factory'))\n\n if attr_has_default and attr_has_factory:\n ctx.api.fail(\"Can't pass both `default` and `factory`.\", rvalue)\n elif attr_has_factory:\n attr_has_default = True\n\n # If the type isn't set through annotation but is passed through `type=` use that.\n type_arg = _get_argument(rvalue, 'type')\n if type_arg and not init_type:\n try:\n un_type = expr_to_unanalyzed_type(type_arg)\n except TypeTranslationError:\n ctx.api.fail('Invalid argument to type', type_arg)\n else:\n init_type = ctx.api.anal_type(un_type)\n if init_type and isinstance(lhs.node, Var) and not lhs.node.type:\n # If there is no annotation, add one.\n lhs.node.type = init_type\n lhs.is_inferred_def = False\n\n # Note: convert is deprecated but works the same as converter.\n converter = _get_argument(rvalue, 'converter')\n convert = _get_argument(rvalue, 'convert')\n if convert and converter:\n ctx.api.fail(\"Can't pass both `convert` and `converter`.\", rvalue)\n elif convert:\n ctx.api.fail(\"convert is deprecated, use converter\", rvalue)\n converter = convert\n converter_info = _parse_converter(ctx, converter)\n\n name = unmangle(lhs.name)\n return Attribute(name, ctx.cls.info, attr_has_default, init,\n kw_only, converter_info, stmt, init_type)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py__parse_converter__parse_converter.return.Converter_None_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py__parse_converter__parse_converter.return.Converter_None_", "embedding": null, "metadata": {"file_path": "mypy/plugins/attrs.py", "file_name": "attrs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 523, "end_line": 556, "span_ids": ["_parse_converter"], "tokens": 305}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _parse_converter(ctx: 'mypy.plugin.ClassDefContext',\n converter: Optional[Expression]) -> Converter:\n \"\"\"Return the Converter object from an Expression.\"\"\"\n # TODO: Support complex converters, e.g. lambdas, calls, etc.\n if converter:\n if isinstance(converter, RefExpr) and converter.node:\n if (isinstance(converter.node, FuncDef)\n and converter.node.type\n and isinstance(converter.node.type, FunctionLike)):\n return Converter(converter.node.fullname)\n elif (isinstance(converter.node, OverloadedFuncDef)\n and is_valid_overloaded_converter(converter.node)):\n return Converter(converter.node.fullname)\n elif isinstance(converter.node, TypeInfo):\n return Converter(converter.node.fullname)\n\n if (isinstance(converter, CallExpr)\n and isinstance(converter.callee, RefExpr)\n and converter.callee.fullname == \"attr.converters.optional\"\n and converter.args\n and converter.args[0]):\n # Special handling for attr.converters.optional(type)\n # We extract the type and add make the init_args Optional in Attribute.argument\n argument = _parse_converter(ctx, converter.args[0])\n argument.is_attr_converters_optional = True\n return argument\n\n # Signal that we have an unsupported converter.\n ctx.api.fail(\n \"Unsupported converter, only named functions and types are currently supported\",\n converter\n )\n return Converter('')\n return Converter(None)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py_is_valid_overloaded_converter__parse_assignments.return.lvalues_rvalues": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py_is_valid_overloaded_converter__parse_assignments.return.lvalues_rvalues", "embedding": null, "metadata": {"file_path": "mypy/plugins/attrs.py", "file_name": "attrs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 559, "end_line": 578, "span_ids": ["_parse_assignments", "is_valid_overloaded_converter"], "tokens": 217}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_valid_overloaded_converter(defn: OverloadedFuncDef) -> bool:\n return all((not isinstance(item, Decorator) or isinstance(item.func.type, FunctionLike))\n for item in defn.items)\n\n\ndef _parse_assignments(\n lvalue: Expression,\n stmt: AssignmentStmt) -> Tuple[List[NameExpr], List[Expression]]:\n \"\"\"Convert a possibly complex assignment expression into lists of lvalues and rvalues.\"\"\"\n lvalues = [] # type: List[NameExpr]\n rvalues = [] # type: List[Expression]\n if isinstance(lvalue, (TupleExpr, ListExpr)):\n if all(isinstance(item, NameExpr) for item in lvalue.items):\n lvalues = cast(List[NameExpr], lvalue.items)\n if isinstance(stmt.rvalue, (TupleExpr, ListExpr)):\n rvalues = stmt.rvalue.items\n elif isinstance(lvalue, NameExpr):\n lvalues = [lvalue]\n rvalues = [stmt.rvalue]\n return lvalues, rvalues", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py__add_order__add_order.for_method_in___lt___.adder_add_method_method_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py__add_order__add_order.for_method_in___lt___.adder_add_method_method_", "embedding": null, "metadata": {"file_path": "mypy/plugins/attrs.py", "file_name": "attrs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 581, "end_line": 598, "span_ids": ["_add_order"], "tokens": 275}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _add_order(ctx: 'mypy.plugin.ClassDefContext', adder: 'MethodAdder') -> None:\n \"\"\"Generate all the ordering methods for this class.\"\"\"\n bool_type = ctx.api.named_type('__builtins__.bool')\n object_type = ctx.api.named_type('__builtins__.object')\n # Make the types be:\n # AT = TypeVar('AT')\n # def __lt__(self: AT, other: AT) -> bool\n # This way comparisons with subclasses will work correctly.\n tvd = TypeVarDef(SELF_TVAR_NAME, ctx.cls.info.fullname + '.' + SELF_TVAR_NAME,\n -1, [], object_type)\n tvd_type = TypeVarType(tvd)\n self_tvar_expr = TypeVarExpr(SELF_TVAR_NAME, ctx.cls.info.fullname + '.' + SELF_TVAR_NAME,\n [], object_type)\n ctx.cls.info.names[SELF_TVAR_NAME] = SymbolTableNode(MDEF, self_tvar_expr)\n\n args = [Argument(Var('other', tvd_type), tvd_type, None, ARG_POS)]\n for method in ['__lt__', '__le__', '__gt__', '__ge__']:\n adder.add_method(method, args, bool_type, self_type=tvd_type, tvd=tvd)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py__make_frozen__make_frozen.for_attribute_in_attribut.if_attribute_name_in_ctx_.else_.var.is_property.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py__make_frozen__make_frozen.for_attribute_in_attribut.if_attribute_name_in_ctx_.else_.var.is_property.True", "embedding": null, "metadata": {"file_path": "mypy/plugins/attrs.py", "file_name": "attrs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 601, "end_line": 616, "span_ids": ["_make_frozen"], "tokens": 187}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _make_frozen(ctx: 'mypy.plugin.ClassDefContext', attributes: List[Attribute]) -> None:\n \"\"\"Turn all the attributes into properties to simulate frozen classes.\"\"\"\n for attribute in attributes:\n if attribute.name in ctx.cls.info.names:\n # This variable belongs to this class so we can modify it.\n node = ctx.cls.info.names[attribute.name].node\n assert isinstance(node, Var)\n node.is_property = True\n else:\n # This variable belongs to a super class so create new Var so we\n # can modify it.\n var = Var(attribute.name, ctx.cls.info[attribute.name].type)\n var.info = ctx.cls.info\n var._fullname = '%s.%s' % (ctx.cls.info.fullname, var.name)\n ctx.cls.info.names[var.name] = SymbolTableNode(MDEF, var)\n var.is_property = True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py__add_init__add_init.adder_add_method___init_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py__add_init__add_init.adder_add_method___init_", "embedding": null, "metadata": {"file_path": "mypy/plugins/attrs.py", "file_name": "attrs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 619, "end_line": 647, "span_ids": ["_add_init"], "tokens": 311}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _add_init(ctx: 'mypy.plugin.ClassDefContext', attributes: List[Attribute],\n adder: 'MethodAdder') -> None:\n \"\"\"Generate an __init__ method for the attributes and add it to the class.\"\"\"\n # Convert attributes to arguments with kw_only arguments at the end of\n # the argument list\n pos_args = []\n kw_only_args = []\n for attribute in attributes:\n if not attribute.init:\n continue\n if attribute.kw_only:\n kw_only_args.append(attribute.argument(ctx))\n else:\n pos_args.append(attribute.argument(ctx))\n args = pos_args + kw_only_args\n if all(\n # We use getattr rather than instance checks because the variable.type\n # might be wrapped into a Union or some other type, but even non-Any\n # types reliably track the fact that the argument was not annotated.\n getattr(arg.variable.type, \"type_of_any\", None) == TypeOfAny.unannotated\n for arg in args\n ):\n # This workaround makes --disallow-incomplete-defs usable with attrs,\n # but is definitely suboptimal as a long-term solution.\n # See https://github.com/python/mypy/issues/5954 for discussion.\n for a in args:\n a.variable.type = AnyType(TypeOfAny.implementation_artifact)\n a.type_annotation = AnyType(TypeOfAny.implementation_artifact)\n adder.add_method('__init__', args, NoneType())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py_MethodAdder_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py_MethodAdder_", "embedding": null, "metadata": {"file_path": "mypy/plugins/attrs.py", "file_name": "attrs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 650, "end_line": 673, "span_ids": ["MethodAdder.__init__", "MethodAdder", "MethodAdder.add_method"], "tokens": 241}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MethodAdder:\n \"\"\"Helper to add methods to a TypeInfo.\n\n ctx: The ClassDefCtx we are using on which we will add methods.\n \"\"\"\n\n # TODO: Combine this with the code build_namedtuple_typeinfo to support both.\n\n def __init__(self, ctx: 'mypy.plugin.ClassDefContext') -> None:\n self.ctx = ctx\n self.self_type = fill_typevars(ctx.cls.info)\n\n def add_method(self,\n method_name: str, args: List[Argument], ret_type: Type,\n self_type: Optional[Type] = None,\n tvd: Optional[TypeVarDef] = None) -> None:\n \"\"\"Add a method: def (self, ) -> ): ... to info.\n\n self_type: The type to use for the self argument or None to use the inferred self type.\n tvd: If the method is generic these should be the type variables.\n \"\"\"\n self_type = self_type if self_type is not None else self.self_type\n add_method(self.ctx, method_name, args, ret_type, self_type, tvd)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/common.py_from_typing_import_List___get_decorator_bool_argument.if_isinstance_ctx_reason_.else_.return.default": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/common.py_from_typing_import_List___get_decorator_bool_argument.if_isinstance_ctx_reason_.else_.return.default", "embedding": null, "metadata": {"file_path": "mypy/plugins/common.py", "file_name": "common.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 30, "span_ids": ["imports", "_get_decorator_bool_argument"], "tokens": 250}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from typing import List, Optional, Union\n\nfrom mypy.nodes import (\n ARG_POS, MDEF, Argument, Block, CallExpr, ClassDef, Expression, SYMBOL_FUNCBASE_TYPES,\n FuncDef, PassStmt, RefExpr, SymbolTableNode, Var, JsonDict,\n)\nfrom mypy.plugin import ClassDefContext, SemanticAnalyzerPluginInterface\nfrom mypy.semanal import set_callable_name\nfrom mypy.types import (\n CallableType, Overloaded, Type, TypeVarDef, deserialize_type, get_proper_type,\n)\nfrom mypy.typevars import fill_typevars\nfrom mypy.util import get_unique_redefinition_name\nfrom mypy.typeops import try_getting_str_literals # noqa: F401 # Part of public API\nfrom mypy.fixup import TypeFixer\n\n\ndef _get_decorator_bool_argument(\n ctx: ClassDefContext,\n name: str,\n default: bool,\n) -> bool:\n \"\"\"Return the bool argument for the decorator.\n\n This handles both @decorator(...) and @decorator.\n \"\"\"\n if isinstance(ctx.reason, CallExpr):\n return _get_bool_argument(ctx, ctx.reason, name, default)\n else:\n return default", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/common.py__get_bool_argument__get_bool_argument.return.default": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/common.py__get_bool_argument__get_bool_argument.return.default", "embedding": null, "metadata": {"file_path": "mypy/plugins/common.py", "file_name": "common.py", "file_type": "text/x-python", "category": "implementation", "start_line": 33, "end_line": 45, "span_ids": ["_get_bool_argument"], "tokens": 115}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _get_bool_argument(ctx: ClassDefContext, expr: CallExpr,\n name: str, default: bool) -> bool:\n \"\"\"Return the boolean value for an argument to a call or the\n default if it's not found.\n \"\"\"\n attr_value = _get_argument(expr, name)\n if attr_value:\n ret = ctx.api.parse_bool(attr_value)\n if ret is None:\n ctx.api.fail('\"{}\" argument must be True or False.'.format(name), expr)\n return default\n return ret\n return default", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/common.py__get_argument__get_argument.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/common.py__get_argument__get_argument.return.None", "embedding": null, "metadata": {"file_path": "mypy/plugins/common.py", "file_name": "common.py", "file_type": "text/x-python", "category": "implementation", "start_line": 48, "end_line": 82, "span_ids": ["_get_argument"], "tokens": 302}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _get_argument(call: CallExpr, name: str) -> Optional[Expression]:\n \"\"\"Return the expression for the specific argument.\"\"\"\n # To do this we use the CallableType of the callee to find the FormalArgument,\n # then walk the actual CallExpr looking for the appropriate argument.\n #\n # Note: I'm not hard-coding the index so that in the future we can support other\n # attrib and class makers.\n if not isinstance(call.callee, RefExpr):\n return None\n\n callee_type = None\n callee_node = call.callee.node\n if (isinstance(callee_node, (Var, SYMBOL_FUNCBASE_TYPES))\n and callee_node.type):\n callee_node_type = get_proper_type(callee_node.type)\n if isinstance(callee_node_type, Overloaded):\n # We take the last overload.\n callee_type = callee_node_type.items()[-1]\n elif isinstance(callee_node_type, CallableType):\n callee_type = callee_node_type\n\n if not callee_type:\n return None\n\n argument = callee_type.argument_by_name(name)\n if not argument:\n return None\n assert argument.name\n\n for i, (attr_name, attr_value) in enumerate(zip(call.arg_names, call.args)):\n if argument.pos is not None and not attr_name and i == argument.pos:\n return attr_value\n if attr_name == argument.name:\n return attr_value\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/common.py_add_method_add_method.add_method_to_class_ctx_a": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/common.py_add_method_add_method.add_method_to_class_ctx_a", "embedding": null, "metadata": {"file_path": "mypy/plugins/common.py", "file_name": "common.py", "file_type": "text/x-python", "category": "implementation", "start_line": 85, "end_line": 102, "span_ids": ["add_method"], "tokens": 122}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_method(\n ctx: ClassDefContext,\n name: str,\n args: List[Argument],\n return_type: Type,\n self_type: Optional[Type] = None,\n tvar_def: Optional[TypeVarDef] = None,\n) -> None:\n \"\"\"\n Adds a new method to a class.\n Deprecated, use add_method_to_class() instead.\n \"\"\"\n add_method_to_class(ctx.api, ctx.cls,\n name=name,\n args=args,\n return_type=return_type,\n self_type=self_type,\n tvar_def=tvar_def)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/common.py_add_method_to_class_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/common.py_add_method_to_class_", "embedding": null, "metadata": {"file_path": "mypy/plugins/common.py", "file_name": "common.py", "file_type": "text/x-python", "category": "implementation", "start_line": 105, "end_line": 163, "span_ids": ["add_method_to_class", "deserialize_and_fixup_type"], "tokens": 491}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_method_to_class(\n api: SemanticAnalyzerPluginInterface,\n cls: ClassDef,\n name: str,\n args: List[Argument],\n return_type: Type,\n self_type: Optional[Type] = None,\n tvar_def: Optional[TypeVarDef] = None,\n) -> None:\n \"\"\"Adds a new method to a class definition.\n \"\"\"\n info = cls.info\n\n # First remove any previously generated methods with the same name\n # to avoid clashes and problems in the semantic analyzer.\n if name in info.names:\n sym = info.names[name]\n if sym.plugin_generated and isinstance(sym.node, FuncDef):\n cls.defs.body.remove(sym.node)\n\n self_type = self_type or fill_typevars(info)\n function_type = api.named_type('__builtins__.function')\n\n args = [Argument(Var('self'), self_type, None, ARG_POS)] + args\n arg_types, arg_names, arg_kinds = [], [], []\n for arg in args:\n assert arg.type_annotation, 'All arguments must be fully typed.'\n arg_types.append(arg.type_annotation)\n arg_names.append(arg.variable.name)\n arg_kinds.append(arg.kind)\n\n signature = CallableType(arg_types, arg_kinds, arg_names, return_type, function_type)\n if tvar_def:\n signature.variables = [tvar_def]\n\n func = FuncDef(name, args, Block([PassStmt()]))\n func.info = info\n func.type = set_callable_name(signature, func)\n func._fullname = info.fullname + '.' + name\n func.line = info.line\n\n # NOTE: we would like the plugin generated node to dominate, but we still\n # need to keep any existing definitions so they get semantically analyzed.\n if name in info.names:\n # Get a nice unique name instead.\n r_name = get_unique_redefinition_name(name, info.names)\n info.names[r_name] = info.names[name]\n\n info.names[name] = SymbolTableNode(MDEF, func, plugin_generated=True)\n info.defn.defs.body.append(func)\n\n\ndef deserialize_and_fixup_type(\n data: Union[str, JsonDict], api: SemanticAnalyzerPluginInterface\n) -> Type:\n typ = deserialize_type(data)\n typ.accept(TypeFixer(api.modules, allow_missing=False))\n return typ", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/ctypes.py__Plugin_to_provide_accu__get_text_type.return.api_named_generic_type_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/ctypes.py__Plugin_to_provide_accu__get_text_type.return.api_named_generic_type_", "embedding": null, "metadata": {"file_path": "mypy/plugins/ctypes.py", "file_name": "ctypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 33, "span_ids": ["_get_text_type", "_get_bytes_type", "docstring"], "tokens": 292}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Plugin to provide accurate types for some parts of the ctypes module.\"\"\"\n\nfrom typing import List, Optional\n\n# Fully qualified instead of \"from mypy.plugin import ...\" to avoid circular import problems.\nimport mypy.plugin\nfrom mypy import nodes\nfrom mypy.maptype import map_instance_to_supertype\nfrom mypy.messages import format_type\nfrom mypy.subtypes import is_subtype\nfrom mypy.types import (\n AnyType, CallableType, Instance, NoneType, Type, TypeOfAny, UnionType,\n union_items, ProperType, get_proper_type\n)\nfrom mypy.typeops import make_simplified_union\n\n\ndef _get_bytes_type(api: 'mypy.plugin.CheckerPluginInterface') -> Instance:\n \"\"\"Return the type corresponding to bytes on the current Python version.\n\n This is bytes in Python 3, and str in Python 2.\n \"\"\"\n return api.named_generic_type(\n 'builtins.bytes' if api.options.python_version >= (3,) else 'builtins.str', [])\n\n\ndef _get_text_type(api: 'mypy.plugin.CheckerPluginInterface') -> Instance:\n \"\"\"Return the type corresponding to Text on the current Python version.\n\n This is str in Python 3, and unicode in Python 2.\n \"\"\"\n return api.named_generic_type(\n 'builtins.str' if api.options.python_version >= (3,) else 'builtins.unicode', [])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/ctypes.py__find_simplecdata_base_arg__find_simplecdata_base_arg.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/ctypes.py__find_simplecdata_base_arg__find_simplecdata_base_arg.return.None", "embedding": null, "metadata": {"file_path": "mypy/plugins/ctypes.py", "file_name": "ctypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 36, "end_line": 47, "span_ids": ["_find_simplecdata_base_arg"], "tokens": 173}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _find_simplecdata_base_arg(tp: Instance, api: 'mypy.plugin.CheckerPluginInterface'\n ) -> Optional[ProperType]:\n \"\"\"Try to find a parametrized _SimpleCData in tp's bases and return its single type argument.\n\n None is returned if _SimpleCData appears nowhere in tp's (direct or indirect) bases.\n \"\"\"\n if tp.type.has_base('ctypes._SimpleCData'):\n simplecdata_base = map_instance_to_supertype(tp,\n api.named_generic_type('ctypes._SimpleCData', [AnyType(TypeOfAny.special_form)]).type)\n assert len(simplecdata_base.args) == 1, '_SimpleCData takes exactly one type argument'\n return get_proper_type(simplecdata_base.args[0])\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/ctypes.py__autoconvertible_to_cdata__autoconvertible_to_cdata.return.make_simplified_union_all": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/ctypes.py__autoconvertible_to_cdata__autoconvertible_to_cdata.return.make_simplified_union_all", "embedding": null, "metadata": {"file_path": "mypy/plugins/ctypes.py", "file_name": "ctypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 50, "end_line": 81, "span_ids": ["_autoconvertible_to_cdata"], "tokens": 359}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _autoconvertible_to_cdata(tp: Type, api: 'mypy.plugin.CheckerPluginInterface') -> Type:\n \"\"\"Get a type that is compatible with all types that can be implicitly converted to the given\n CData type.\n\n Examples:\n * c_int -> Union[c_int, int]\n * c_char_p -> Union[c_char_p, bytes, int, NoneType]\n * MyStructure -> MyStructure\n \"\"\"\n allowed_types = []\n # If tp is a union, we allow all types that are convertible to at least one of the union\n # items. This is not quite correct - strictly speaking, only types convertible to *all* of the\n # union items should be allowed. This may be worth changing in the future, but the more\n # correct algorithm could be too strict to be useful.\n for t in union_items(tp):\n # Every type can be converted from itself (obviously).\n allowed_types.append(t)\n if isinstance(t, Instance):\n unboxed = _find_simplecdata_base_arg(t, api)\n if unboxed is not None:\n # If _SimpleCData appears in tp's (direct or indirect) bases, its type argument\n # specifies the type's \"unboxed\" version, which can always be converted back to\n # the original \"boxed\" type.\n allowed_types.append(unboxed)\n\n if t.type.has_base('ctypes._PointerLike'):\n # Pointer-like _SimpleCData subclasses can also be converted from\n # an int or None.\n allowed_types.append(api.named_generic_type('builtins.int', []))\n allowed_types.append(NoneType())\n\n return make_simplified_union(allowed_types)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/ctypes.py__autounboxed_cdata__get_array_element_type.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/ctypes.py__autounboxed_cdata__get_array_element_type.return.None", "embedding": null, "metadata": {"file_path": "mypy/plugins/ctypes.py", "file_name": "ctypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 84, "end_line": 114, "span_ids": ["_get_array_element_type", "_autounboxed_cdata"], "tokens": 334}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _autounboxed_cdata(tp: Type) -> ProperType:\n \"\"\"Get the auto-unboxed version of a CData type, if applicable.\n\n For *direct* _SimpleCData subclasses, the only type argument of _SimpleCData in the bases list\n is returned.\n For all other CData types, including indirect _SimpleCData subclasses, tp is returned as-is.\n \"\"\"\n tp = get_proper_type(tp)\n\n if isinstance(tp, UnionType):\n return make_simplified_union([_autounboxed_cdata(t) for t in tp.items])\n elif isinstance(tp, Instance):\n for base in tp.type.bases:\n if base.type.fullname == 'ctypes._SimpleCData':\n # If tp has _SimpleCData as a direct base class,\n # the auto-unboxed type is the single type argument of the _SimpleCData type.\n assert len(base.args) == 1\n return get_proper_type(base.args[0])\n # If tp is not a concrete type, or if there is no _SimpleCData in the bases,\n # the type is not auto-unboxed.\n return tp\n\n\ndef _get_array_element_type(tp: Type) -> Optional[ProperType]:\n \"\"\"Get the element type of the Array type tp, or None if not specified.\"\"\"\n tp = get_proper_type(tp)\n if isinstance(tp, Instance):\n assert tp.type.fullname == 'ctypes.Array'\n if len(tp.args) == 1:\n return get_proper_type(tp.args[0])\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/ctypes.py_array_constructor_callback_array_constructor_callback.return.ctx_default_return_type": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/ctypes.py_array_constructor_callback_array_constructor_callback.return.ctx_default_return_type", "embedding": null, "metadata": {"file_path": "mypy/plugins/ctypes.py", "file_name": "ctypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 117, "end_line": 141, "span_ids": ["array_constructor_callback"], "tokens": 321}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def array_constructor_callback(ctx: 'mypy.plugin.FunctionContext') -> Type:\n \"\"\"Callback to provide an accurate signature for the ctypes.Array constructor.\"\"\"\n # Extract the element type from the constructor's return type, i. e. the type of the array\n # being constructed.\n et = _get_array_element_type(ctx.default_return_type)\n if et is not None:\n allowed = _autoconvertible_to_cdata(et, ctx.api)\n assert len(ctx.arg_types) == 1, \\\n \"The stub of the ctypes.Array constructor should have a single vararg parameter\"\n for arg_num, (arg_kind, arg_type) in enumerate(zip(ctx.arg_kinds[0], ctx.arg_types[0]), 1):\n if arg_kind == nodes.ARG_POS and not is_subtype(arg_type, allowed):\n ctx.api.msg.fail(\n 'Array constructor argument {} of type {}'\n ' is not convertible to the array element type {}'\n .format(arg_num, format_type(arg_type), format_type(et)), ctx.context)\n elif arg_kind == nodes.ARG_STAR:\n ty = ctx.api.named_generic_type(\"typing.Iterable\", [allowed])\n if not is_subtype(arg_type, ty):\n it = ctx.api.named_generic_type(\"typing.Iterable\", [et])\n ctx.api.msg.fail(\n 'Array constructor argument {} of type {}'\n ' is not convertible to the array element type {}'\n .format(arg_num, format_type(arg_type), format_type(it)), ctx.context)\n\n return ctx.default_return_type", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/ctypes.py_array_getitem_callback_array_getitem_callback.return.ctx_default_return_type": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/ctypes.py_array_getitem_callback_array_getitem_callback.return.ctx_default_return_type", "embedding": null, "metadata": {"file_path": "mypy/plugins/ctypes.py", "file_name": "ctypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 144, "end_line": 159, "span_ids": ["array_getitem_callback"], "tokens": 197}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def array_getitem_callback(ctx: 'mypy.plugin.MethodContext') -> Type:\n \"\"\"Callback to provide an accurate return type for ctypes.Array.__getitem__.\"\"\"\n et = _get_array_element_type(ctx.type)\n if et is not None:\n unboxed = _autounboxed_cdata(et)\n assert len(ctx.arg_types) == 1, \\\n 'The stub of ctypes.Array.__getitem__ should have exactly one parameter'\n assert len(ctx.arg_types[0]) == 1, \\\n \"ctypes.Array.__getitem__'s parameter should not be variadic\"\n index_type = get_proper_type(ctx.arg_types[0][0])\n if isinstance(index_type, Instance):\n if index_type.type.has_base('builtins.int'):\n return unboxed\n elif index_type.type.has_base('builtins.slice'):\n return ctx.api.named_generic_type('builtins.list', [unboxed])\n return ctx.default_return_type", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/ctypes.py_array_setitem_callback_array_setitem_callback.return.ctx_default_signature": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/ctypes.py_array_setitem_callback_array_setitem_callback.return.ctx_default_signature", "embedding": null, "metadata": {"file_path": "mypy/plugins/ctypes.py", "file_name": "ctypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 162, "end_line": 181, "span_ids": ["array_setitem_callback"], "tokens": 235}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def array_setitem_callback(ctx: 'mypy.plugin.MethodSigContext') -> CallableType:\n \"\"\"Callback to provide an accurate signature for ctypes.Array.__setitem__.\"\"\"\n et = _get_array_element_type(ctx.type)\n if et is not None:\n allowed = _autoconvertible_to_cdata(et, ctx.api)\n assert len(ctx.default_signature.arg_types) == 2\n index_type = get_proper_type(ctx.default_signature.arg_types[0])\n if isinstance(index_type, Instance):\n arg_type = None\n if index_type.type.has_base('builtins.int'):\n arg_type = allowed\n elif index_type.type.has_base('builtins.slice'):\n arg_type = ctx.api.named_generic_type('builtins.list', [allowed])\n if arg_type is not None:\n # Note: arg_type can only be None if index_type is invalid, in which case we use\n # the default signature and let mypy report an error about it.\n return ctx.default_signature.copy_modified(\n arg_types=ctx.default_signature.arg_types[:1] + [arg_type],\n )\n return ctx.default_signature", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/ctypes.py_array_iter_callback_array_value_callback.return.ctx_default_attr_type": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/ctypes.py_array_iter_callback_array_value_callback.return.ctx_default_attr_type", "embedding": null, "metadata": {"file_path": "mypy/plugins/ctypes.py", "file_name": "ctypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 184, "end_line": 211, "span_ids": ["array_iter_callback", "array_value_callback"], "tokens": 299}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def array_iter_callback(ctx: 'mypy.plugin.MethodContext') -> Type:\n \"\"\"Callback to provide an accurate return type for ctypes.Array.__iter__.\"\"\"\n et = _get_array_element_type(ctx.type)\n if et is not None:\n unboxed = _autounboxed_cdata(et)\n return ctx.api.named_generic_type('typing.Iterator', [unboxed])\n return ctx.default_return_type\n\n\ndef array_value_callback(ctx: 'mypy.plugin.AttributeContext') -> Type:\n \"\"\"Callback to provide an accurate type for ctypes.Array.value.\"\"\"\n et = _get_array_element_type(ctx.type)\n if et is not None:\n types = [] # type: List[Type]\n for tp in union_items(et):\n if isinstance(tp, AnyType):\n types.append(AnyType(TypeOfAny.from_another_any, source_any=tp))\n elif isinstance(tp, Instance) and tp.type.fullname == 'ctypes.c_char':\n types.append(_get_bytes_type(ctx.api))\n elif isinstance(tp, Instance) and tp.type.fullname == 'ctypes.c_wchar':\n types.append(_get_text_type(ctx.api))\n else:\n ctx.api.msg.fail(\n 'Array attribute \"value\" is only available'\n ' with element type \"c_char\" or \"c_wchar\", not {}'\n .format(format_type(et)), ctx.context)\n return make_simplified_union(types)\n return ctx.default_attr_type", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/ctypes.py_array_raw_callback_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/ctypes.py_array_raw_callback_", "embedding": null, "metadata": {"file_path": "mypy/plugins/ctypes.py", "file_name": "ctypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 214, "end_line": 230, "span_ids": ["array_raw_callback"], "tokens": 162}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def array_raw_callback(ctx: 'mypy.plugin.AttributeContext') -> Type:\n \"\"\"Callback to provide an accurate type for ctypes.Array.raw.\"\"\"\n et = _get_array_element_type(ctx.type)\n if et is not None:\n types = [] # type: List[Type]\n for tp in union_items(et):\n if (isinstance(tp, AnyType)\n or isinstance(tp, Instance) and tp.type.fullname == 'ctypes.c_char'):\n types.append(_get_bytes_type(ctx.api))\n else:\n ctx.api.msg.fail(\n 'Array attribute \"raw\" is only available'\n ' with element type \"c_char\", not {}'\n .format(format_type(et)), ctx.context)\n return make_simplified_union(types)\n return ctx.default_attr_type", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/dataclasses.py__Plugin_that_provides_s_SELF_TVAR_NAME.__DT_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/dataclasses.py__Plugin_that_provides_s_SELF_TVAR_NAME.__DT_", "embedding": null, "metadata": {"file_path": "mypy/plugins/dataclasses.py", "file_name": "dataclasses.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 28, "span_ids": ["docstring"], "tokens": 223}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Plugin that provides support for dataclasses.\"\"\"\n\nfrom typing import Dict, List, Set, Tuple, Optional\nfrom typing_extensions import Final\n\nfrom mypy.nodes import (\n ARG_OPT, ARG_POS, MDEF, Argument, AssignmentStmt, CallExpr,\n Context, Expression, JsonDict, NameExpr, RefExpr,\n SymbolTableNode, TempNode, TypeInfo, Var, TypeVarExpr, PlaceholderNode\n)\nfrom mypy.plugin import ClassDefContext, SemanticAnalyzerPluginInterface\nfrom mypy.plugins.common import (\n add_method, _get_decorator_bool_argument, deserialize_and_fixup_type,\n)\nfrom mypy.typeops import map_type_from_supertype\nfrom mypy.types import (\n Type, Instance, NoneType, TypeVarDef, TypeVarType, CallableType,\n get_proper_type\n)\nfrom mypy.server.trigger import make_wildcard_trigger\n\n# The set of decorators that generate dataclasses.\ndataclass_makers = {\n 'dataclass',\n 'dataclasses.dataclass',\n} # type: Final\n\nSELF_TVAR_NAME = '_DT'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/dataclasses.py_DataclassTransformer_DataclassTransformer.transform.info_metadata_dataclass_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/dataclasses.py_DataclassTransformer_DataclassTransformer.transform.info_metadata_dataclass_", "embedding": null, "metadata": {"file_path": "mypy/plugins/dataclasses.py", "file_name": "dataclasses.py", "file_type": "text/x-python", "category": "implementation", "start_line": 92, "end_line": 184, "span_ids": ["DataclassTransformer", "DataclassTransformer.transform", "DataclassTransformer.__init__"], "tokens": 851}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DataclassTransformer:\n def __init__(self, ctx: ClassDefContext) -> None:\n self._ctx = ctx\n\n def transform(self) -> None:\n \"\"\"Apply all the necessary transformations to the underlying\n dataclass so as to ensure it is fully type checked according\n to the rules in PEP 557.\n \"\"\"\n ctx = self._ctx\n info = self._ctx.cls.info\n attributes = self.collect_attributes()\n if attributes is None:\n # Some definitions are not ready, defer() should be already called.\n return\n for attr in attributes:\n if attr.type is None:\n ctx.api.defer()\n return\n decorator_arguments = {\n 'init': _get_decorator_bool_argument(self._ctx, 'init', True),\n 'eq': _get_decorator_bool_argument(self._ctx, 'eq', True),\n 'order': _get_decorator_bool_argument(self._ctx, 'order', False),\n 'frozen': _get_decorator_bool_argument(self._ctx, 'frozen', False),\n }\n\n # If there are no attributes, it may be that the semantic analyzer has not\n # processed them yet. In order to work around this, we can simply skip generating\n # __init__ if there are no attributes, because if the user truly did not define any,\n # then the object default __init__ with an empty signature will be present anyway.\n if (decorator_arguments['init'] and\n ('__init__' not in info.names or info.names['__init__'].plugin_generated) and\n attributes):\n add_method(\n ctx,\n '__init__',\n args=[attr.to_argument() for attr in attributes if attr.is_in_init],\n return_type=NoneType(),\n )\n\n if (decorator_arguments['eq'] and info.get('__eq__') is None or\n decorator_arguments['order']):\n # Type variable for self types in generated methods.\n obj_type = ctx.api.named_type('__builtins__.object')\n self_tvar_expr = TypeVarExpr(SELF_TVAR_NAME, info.fullname + '.' + SELF_TVAR_NAME,\n [], obj_type)\n info.names[SELF_TVAR_NAME] = SymbolTableNode(MDEF, self_tvar_expr)\n\n # Add <, >, <=, >=, but only if the class has an eq method.\n if decorator_arguments['order']:\n if not decorator_arguments['eq']:\n ctx.api.fail('eq must be True if order is True', ctx.cls)\n\n for method_name in ['__lt__', '__gt__', '__le__', '__ge__']:\n # Like for __eq__ and __ne__, we want \"other\" to match\n # the self type.\n obj_type = ctx.api.named_type('__builtins__.object')\n order_tvar_def = TypeVarDef(SELF_TVAR_NAME, info.fullname + '.' + SELF_TVAR_NAME,\n -1, [], obj_type)\n order_other_type = TypeVarType(order_tvar_def)\n order_return_type = ctx.api.named_type('__builtins__.bool')\n order_args = [\n Argument(Var('other', order_other_type), order_other_type, None, ARG_POS)\n ]\n\n existing_method = info.get(method_name)\n if existing_method is not None and not existing_method.plugin_generated:\n assert existing_method.node\n ctx.api.fail(\n 'You may not have a custom %s method when order=True' % method_name,\n existing_method.node,\n )\n\n add_method(\n ctx,\n method_name,\n args=order_args,\n return_type=order_return_type,\n self_type=order_other_type,\n tvar_def=order_tvar_def,\n )\n\n if decorator_arguments['frozen']:\n self._freeze(attributes)\n else:\n self._propertize_callables(attributes)\n\n self.reset_init_only_vars(info, attributes)\n\n info.metadata['dataclass'] = {\n 'attributes': [attr.serialize() for attr in attributes],\n 'frozen': decorator_arguments['frozen'],\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/dataclasses.py_DataclassTransformer.reset_init_only_vars_DataclassTransformer.reset_init_only_vars.for_attr_in_attributes_.if_attr_is_init_var_.for_stmt_in_info_defn_def.if_isinstance_stmt_Assig.if_isinstance_lvalue_Nam.lvalue.node.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/dataclasses.py_DataclassTransformer.reset_init_only_vars_DataclassTransformer.reset_init_only_vars.for_attr_in_attributes_.if_attr_is_init_var_.for_stmt_in_info_defn_def.if_isinstance_stmt_Assig.if_isinstance_lvalue_Nam.lvalue.node.None", "embedding": null, "metadata": {"file_path": "mypy/plugins/dataclasses.py", "file_name": "dataclasses.py", "file_type": "text/x-python", "category": "implementation", "start_line": 170, "end_line": 185, "span_ids": ["DataclassTransformer.reset_init_only_vars"], "tokens": 179}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DataclassTransformer:\n\n def reset_init_only_vars(self, info: TypeInfo, attributes: List[DataclassAttribute]) -> None:\n \"\"\"Remove init-only vars from the class and reset init var declarations.\"\"\"\n for attr in attributes:\n if attr.is_init_var:\n if attr.name in info.names:\n del info.names[attr.name]\n else:\n # Nodes of superclass InitVars not used in __init__ cannot be reached.\n assert attr.is_init_var\n for stmt in info.defn.defs.body:\n if isinstance(stmt, AssignmentStmt) and stmt.unanalyzed_type:\n lvalue = stmt.lvalues[0]\n if isinstance(lvalue, NameExpr) and lvalue.name == attr.name:\n # Reset node so that another semantic analysis pass will\n # recreate a symbol node for this attribute.\n lvalue.node = None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/dataclasses.py_DataclassTransformer.collect_attributes_DataclassTransformer.collect_attributes.all_attrs.attrs_copy_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/dataclasses.py_DataclassTransformer.collect_attributes_DataclassTransformer.collect_attributes.all_attrs.attrs_copy_", "embedding": null, "metadata": {"file_path": "mypy/plugins/dataclasses.py", "file_name": "dataclasses.py", "file_type": "text/x-python", "category": "implementation", "start_line": 198, "end_line": 289, "span_ids": ["DataclassTransformer.collect_attributes"], "tokens": 751}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DataclassTransformer:\n\n def collect_attributes(self) -> Optional[List[DataclassAttribute]]:\n \"\"\"Collect all attributes declared in the dataclass and its parents.\n\n All assignments of the form\n\n a: SomeType\n b: SomeOtherType = ...\n\n are collected.\n \"\"\"\n # First, collect attributes belonging to the current class.\n ctx = self._ctx\n cls = self._ctx.cls\n attrs = [] # type: List[DataclassAttribute]\n known_attrs = set() # type: Set[str]\n for stmt in cls.defs.body:\n # Any assignment that doesn't use the new type declaration\n # syntax can be ignored out of hand.\n if not (isinstance(stmt, AssignmentStmt) and stmt.new_syntax):\n continue\n\n # a: int, b: str = 1, 'foo' is not supported syntax so we\n # don't have to worry about it.\n lhs = stmt.lvalues[0]\n if not isinstance(lhs, NameExpr):\n continue\n\n sym = cls.info.names.get(lhs.name)\n if sym is None:\n # This name is likely blocked by a star import. We don't need to defer because\n # defer() is already called by mark_incomplete().\n continue\n\n node = sym.node\n if isinstance(node, PlaceholderNode):\n # This node is not ready yet.\n return None\n assert isinstance(node, Var)\n\n # x: ClassVar[int] is ignored by dataclasses.\n if node.is_classvar:\n continue\n\n # x: InitVar[int] is turned into x: int and is removed from the class.\n is_init_var = False\n node_type = get_proper_type(node.type)\n if (isinstance(node_type, Instance) and\n node_type.type.fullname == 'dataclasses.InitVar'):\n is_init_var = True\n node.type = node_type.args[0]\n\n has_field_call, field_args = _collect_field_args(stmt.rvalue)\n\n is_in_init_param = field_args.get('init')\n if is_in_init_param is None:\n is_in_init = True\n else:\n is_in_init = bool(ctx.api.parse_bool(is_in_init_param))\n\n has_default = False\n # Ensure that something like x: int = field() is rejected\n # after an attribute with a default.\n if has_field_call:\n has_default = 'default' in field_args or 'default_factory' in field_args\n\n # All other assignments are already type checked.\n elif not isinstance(stmt.rvalue, TempNode):\n has_default = True\n\n if not has_default:\n # Make all non-default attributes implicit because they are de-facto set\n # on self in the generated __init__(), not in the class body.\n sym.implicit = True\n\n known_attrs.add(lhs.name)\n attrs.append(DataclassAttribute(\n name=lhs.name,\n is_in_init=is_in_init,\n is_init_var=is_init_var,\n has_default=has_default,\n line=stmt.line,\n column=stmt.column,\n type=sym.type,\n info=cls.info,\n ))\n\n # Next, collect attributes belonging to any class in the MRO\n # as long as those attributes weren't already collected. This\n # makes it possible to overwrite attributes in subclasses.\n # copy() because we potentially modify all_attrs below and if this code requires debugging\n # we'll have unmodified attrs laying around.\n all_attrs = attrs.copy()\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/dataclasses.py_DataclassTransformer.collect_attributes.for_info_in_cls_info_mro__DataclassTransformer.collect_attributes.return.all_attrs": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/dataclasses.py_DataclassTransformer.collect_attributes.for_info_in_cls_info_mro__DataclassTransformer.collect_attributes.return.all_attrs", "embedding": null, "metadata": {"file_path": "mypy/plugins/dataclasses.py", "file_name": "dataclasses.py", "file_type": "text/x-python", "category": "implementation", "start_line": 290, "end_line": 336, "span_ids": ["DataclassTransformer.collect_attributes"], "tokens": 426}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DataclassTransformer:\n\n def collect_attributes(self) -> Optional[List[DataclassAttribute]]:\n # ... other code\n for info in cls.info.mro[1:-1]:\n if 'dataclass' not in info.metadata:\n continue\n\n super_attrs = []\n # Each class depends on the set of attributes in its dataclass ancestors.\n ctx.api.add_plugin_dependency(make_wildcard_trigger(info.fullname))\n\n for data in info.metadata['dataclass']['attributes']:\n name = data['name'] # type: str\n if name not in known_attrs:\n attr = DataclassAttribute.deserialize(info, data, ctx.api)\n attr.expand_typevar_from_subtype(ctx.cls.info)\n known_attrs.add(name)\n super_attrs.append(attr)\n elif all_attrs:\n # How early in the attribute list an attribute appears is determined by the\n # reverse MRO, not simply MRO.\n # See https://docs.python.org/3/library/dataclasses.html#inheritance for\n # details.\n for attr in all_attrs:\n if attr.name == name:\n all_attrs.remove(attr)\n super_attrs.append(attr)\n break\n all_attrs = super_attrs + all_attrs\n\n # Ensure that arguments without a default don't follow\n # arguments that have a default.\n found_default = False\n for attr in all_attrs:\n # If we find any attribute that is_in_init but that\n # doesn't have a default after one that does have one,\n # then that's an error.\n if found_default and attr.is_in_init and not attr.has_default:\n # If the issue comes from merging different classes, report it\n # at the class definition point.\n context = (Context(line=attr.line, column=attr.column) if attr in attrs\n else ctx.cls)\n ctx.api.fail(\n 'Attributes without a default cannot follow attributes with one',\n context,\n )\n\n found_default = found_default or (attr.has_default and attr.is_in_init)\n\n return all_attrs", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py_from_functools_import_par_from_mypy_checkexpr_impor": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py_from_functools_import_par_from_mypy_checkexpr_impor", "embedding": null, "metadata": {"file_path": "mypy/plugins/default.py", "file_name": "default.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 17, "span_ids": ["imports"], "tokens": 166}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from functools import partial\nfrom typing import Callable, Optional, List\n\nfrom mypy import message_registry\nfrom mypy.nodes import Expression, StrExpr, IntExpr, DictExpr, UnaryExpr\nfrom mypy.plugin import (\n Plugin, FunctionContext, MethodContext, MethodSigContext, AttributeContext, ClassDefContext,\n CheckerPluginInterface,\n)\nfrom mypy.plugins.common import try_getting_str_literals\nfrom mypy.types import (\n Type, Instance, AnyType, TypeOfAny, CallableType, NoneType, TypedDictType,\n TypeVarDef, TypeVarType, TPDICT_FB_NAMES, get_proper_type, LiteralType\n)\nfrom mypy.subtypes import is_subtype\nfrom mypy.typeops import make_simplified_union\nfrom mypy.checkexpr import is_literal_type_like", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py_DefaultPlugin_DefaultPlugin.get_method_signature_hook.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py_DefaultPlugin_DefaultPlugin.get_method_signature_hook.return.None", "embedding": null, "metadata": {"file_path": "mypy/plugins/default.py", "file_name": "default.py", "file_type": "text/x-python", "category": "implementation", "start_line": 20, "end_line": 51, "span_ids": ["DefaultPlugin.get_method_signature_hook", "DefaultPlugin", "DefaultPlugin.get_function_hook"], "tokens": 297}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DefaultPlugin(Plugin):\n \"\"\"Type checker plugin that is enabled by default.\"\"\"\n\n def get_function_hook(self, fullname: str\n ) -> Optional[Callable[[FunctionContext], Type]]:\n from mypy.plugins import ctypes\n\n if fullname == 'contextlib.contextmanager':\n return contextmanager_callback\n elif fullname == 'builtins.open' and self.python_version[0] == 3:\n return open_callback\n elif fullname == 'ctypes.Array':\n return ctypes.array_constructor_callback\n return None\n\n def get_method_signature_hook(self, fullname: str\n ) -> Optional[Callable[[MethodSigContext], CallableType]]:\n from mypy.plugins import ctypes\n\n if fullname == 'typing.Mapping.get':\n return typed_dict_get_signature_callback\n elif fullname in set(n + '.setdefault' for n in TPDICT_FB_NAMES):\n return typed_dict_setdefault_signature_callback\n elif fullname in set(n + '.pop' for n in TPDICT_FB_NAMES):\n return typed_dict_pop_signature_callback\n elif fullname in set(n + '.update' for n in TPDICT_FB_NAMES):\n return typed_dict_update_signature_callback\n elif fullname in set(n + '.__delitem__' for n in TPDICT_FB_NAMES):\n return typed_dict_delitem_signature_callback\n elif fullname == 'ctypes.Array.__setitem__':\n return ctypes.array_setitem_callback\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py_DefaultPlugin.get_method_hook_DefaultPlugin.get_method_hook.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py_DefaultPlugin.get_method_hook_DefaultPlugin.get_method_hook.return.None", "embedding": null, "metadata": {"file_path": "mypy/plugins/default.py", "file_name": "default.py", "file_type": "text/x-python", "category": "implementation", "start_line": 53, "end_line": 75, "span_ids": ["DefaultPlugin.get_method_hook"], "tokens": 227}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DefaultPlugin(Plugin):\n\n def get_method_hook(self, fullname: str\n ) -> Optional[Callable[[MethodContext], Type]]:\n from mypy.plugins import ctypes\n\n if fullname == 'typing.Mapping.get':\n return typed_dict_get_callback\n elif fullname == 'builtins.int.__pow__':\n return int_pow_callback\n elif fullname == 'builtins.int.__neg__':\n return int_neg_callback\n elif fullname in set(n + '.setdefault' for n in TPDICT_FB_NAMES):\n return typed_dict_setdefault_callback\n elif fullname in set(n + '.pop' for n in TPDICT_FB_NAMES):\n return typed_dict_pop_callback\n elif fullname in set(n + '.__delitem__' for n in TPDICT_FB_NAMES):\n return typed_dict_delitem_callback\n elif fullname == 'ctypes.Array.__getitem__':\n return ctypes.array_getitem_callback\n elif fullname == 'ctypes.Array.__iter__':\n return ctypes.array_iter_callback\n elif fullname == 'pathlib.Path.open':\n return path_open_callback\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py_DefaultPlugin.get_attribute_hook_DefaultPlugin.get_class_decorator_hook.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py_DefaultPlugin.get_attribute_hook_DefaultPlugin.get_class_decorator_hook.return.None", "embedding": null, "metadata": {"file_path": "mypy/plugins/default.py", "file_name": "default.py", "file_type": "text/x-python", "category": "implementation", "start_line": 77, "end_line": 121, "span_ids": ["DefaultPlugin.get_attribute_hook", "DefaultPlugin.get_class_decorator_hook"], "tokens": 332}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DefaultPlugin(Plugin):\n\n def get_attribute_hook(self, fullname: str\n ) -> Optional[Callable[[AttributeContext], Type]]:\n from mypy.plugins import ctypes\n from mypy.plugins import enums\n\n if fullname == 'ctypes.Array.value':\n return ctypes.array_value_callback\n elif fullname == 'ctypes.Array.raw':\n return ctypes.array_raw_callback\n elif fullname in enums.ENUM_NAME_ACCESS:\n return enums.enum_name_callback\n elif fullname in enums.ENUM_VALUE_ACCESS:\n return enums.enum_value_callback\n return None\n\n def get_class_decorator_hook(self, fullname: str\n ) -> Optional[Callable[[ClassDefContext], None]]:\n from mypy.plugins import attrs\n from mypy.plugins import dataclasses\n from mypy.plugins import functools\n\n if fullname in attrs.attr_class_makers:\n return attrs.attr_class_maker_callback\n elif fullname in attrs.attr_dataclass_makers:\n return partial(\n attrs.attr_class_maker_callback,\n auto_attribs_default=True,\n )\n elif fullname in attrs.attr_frozen_makers:\n return partial(\n attrs.attr_class_maker_callback,\n auto_attribs_default=None,\n frozen_default=True,\n )\n elif fullname in attrs.attr_define_makers:\n return partial(\n attrs.attr_class_maker_callback,\n auto_attribs_default=None,\n )\n elif fullname in dataclasses.dataclass_makers:\n return dataclasses.dataclass_class_maker_callback\n elif fullname in functools.functools_total_ordering_makers:\n return functools.functools_total_ordering_maker_callback\n\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py_open_callback_path_open_callback.return._analyze_open_signature_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py_open_callback_path_open_callback.return._analyze_open_signature_", "embedding": null, "metadata": {"file_path": "mypy/plugins/default.py", "file_name": "default.py", "file_type": "text/x-python", "category": "implementation", "start_line": 109, "end_line": 128, "span_ids": ["path_open_callback", "open_callback"], "tokens": 144}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def open_callback(ctx: FunctionContext) -> Type:\n \"\"\"Infer a better return type for 'open'.\"\"\"\n return _analyze_open_signature(\n arg_types=ctx.arg_types,\n args=ctx.args,\n mode_arg_index=1,\n default_return_type=ctx.default_return_type,\n api=ctx.api,\n )\n\n\ndef path_open_callback(ctx: MethodContext) -> Type:\n \"\"\"Infer a better return type for 'pathlib.Path.open'.\"\"\"\n return _analyze_open_signature(\n arg_types=ctx.arg_types,\n args=ctx.args,\n mode_arg_index=0,\n default_return_type=ctx.default_return_type,\n api=ctx.api,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py__analyze_open_signature__analyze_open_signature.return.default_return_type": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py__analyze_open_signature__analyze_open_signature.return.default_return_type", "embedding": null, "metadata": {"file_path": "mypy/plugins/default.py", "file_name": "default.py", "file_type": "text/x-python", "category": "implementation", "start_line": 131, "end_line": 158, "span_ids": ["_analyze_open_signature"], "tokens": 253}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _analyze_open_signature(arg_types: List[List[Type]],\n args: List[List[Expression]],\n mode_arg_index: int,\n default_return_type: Type,\n api: CheckerPluginInterface,\n ) -> Type:\n \"\"\"A helper for analyzing any function that has approximately\n the same signature as the builtin 'open(...)' function.\n\n Currently, the only thing the caller can customize is the index\n of the 'mode' argument. If the mode argument is omitted or is a\n string literal, we refine the return type to either 'TextIO' or\n 'BinaryIO' as appropriate.\n \"\"\"\n mode = None\n if not arg_types or len(arg_types[mode_arg_index]) != 1:\n mode = 'r'\n else:\n mode_expr = args[mode_arg_index][0]\n if isinstance(mode_expr, StrExpr):\n mode = mode_expr.value\n if mode is not None:\n assert isinstance(default_return_type, Instance) # type: ignore\n if 'b' in mode:\n return api.named_generic_type('typing.BinaryIO', [])\n else:\n return api.named_generic_type('typing.TextIO', [])\n return default_return_type", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py_contextmanager_callback_contextmanager_callback.return.ctx_default_return_type": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py_contextmanager_callback_contextmanager_callback.return.ctx_default_return_type", "embedding": null, "metadata": {"file_path": "mypy/plugins/default.py", "file_name": "default.py", "file_type": "text/x-python", "category": "implementation", "start_line": 161, "end_line": 177, "span_ids": ["contextmanager_callback"], "tokens": 185}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def contextmanager_callback(ctx: FunctionContext) -> Type:\n \"\"\"Infer a better return type for 'contextlib.contextmanager'.\"\"\"\n # Be defensive, just in case.\n if ctx.arg_types and len(ctx.arg_types[0]) == 1:\n arg_type = get_proper_type(ctx.arg_types[0][0])\n default_return = get_proper_type(ctx.default_return_type)\n if (isinstance(arg_type, CallableType)\n and isinstance(default_return, CallableType)):\n # The stub signature doesn't preserve information about arguments so\n # add them back here.\n return default_return.copy_modified(\n arg_types=arg_type.arg_types,\n arg_kinds=arg_type.arg_kinds,\n arg_names=arg_type.arg_names,\n variables=arg_type.variables,\n is_ellipsis_args=arg_type.is_ellipsis_args)\n return ctx.default_return_type", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py_typed_dict_get_signature_callback_typed_dict_get_signature_callback.return.signature": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py_typed_dict_get_signature_callback_typed_dict_get_signature_callback.return.signature", "embedding": null, "metadata": {"file_path": "mypy/plugins/default.py", "file_name": "default.py", "file_type": "text/x-python", "category": "implementation", "start_line": 180, "end_line": 213, "span_ids": ["typed_dict_get_signature_callback"], "tokens": 351}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def typed_dict_get_signature_callback(ctx: MethodSigContext) -> CallableType:\n \"\"\"Try to infer a better signature type for TypedDict.get.\n\n This is used to get better type context for the second argument that\n depends on a TypedDict value type.\n \"\"\"\n signature = ctx.default_signature\n if (isinstance(ctx.type, TypedDictType)\n and len(ctx.args) == 2\n and len(ctx.args[0]) == 1\n and isinstance(ctx.args[0][0], StrExpr)\n and len(signature.arg_types) == 2\n and len(signature.variables) == 1\n and len(ctx.args[1]) == 1):\n key = ctx.args[0][0].value\n value_type = get_proper_type(ctx.type.items.get(key))\n ret_type = signature.ret_type\n if value_type:\n default_arg = ctx.args[1][0]\n if (isinstance(value_type, TypedDictType)\n and isinstance(default_arg, DictExpr)\n and len(default_arg.items) == 0):\n # Caller has empty dict {} as default for typed dict.\n value_type = value_type.copy_modified(required_keys=set())\n # Tweak the signature to include the value type as context. It's\n # only needed for type inference since there's a union with a type\n # variable that accepts everything.\n assert isinstance(signature.variables[0], TypeVarDef)\n tv = TypeVarType(signature.variables[0])\n return signature.copy_modified(\n arg_types=[signature.arg_types[0],\n make_simplified_union([value_type, tv])],\n ret_type=ret_type)\n return signature", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py_typed_dict_get_callback_typed_dict_get_callback.return.ctx_default_return_type": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py_typed_dict_get_callback_typed_dict_get_callback.return.ctx_default_return_type", "embedding": null, "metadata": {"file_path": "mypy/plugins/default.py", "file_name": "default.py", "file_type": "text/x-python", "category": "implementation", "start_line": 227, "end_line": 259, "span_ids": ["typed_dict_get_callback"], "tokens": 325}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def typed_dict_get_callback(ctx: MethodContext) -> Type:\n \"\"\"Infer a precise return type for TypedDict.get with literal first argument.\"\"\"\n if (isinstance(ctx.type, TypedDictType)\n and len(ctx.arg_types) >= 1\n and len(ctx.arg_types[0]) == 1):\n keys = try_getting_str_literals(ctx.args[0][0], ctx.arg_types[0][0])\n if keys is None:\n return ctx.default_return_type\n\n output_types = [] # type: List[Type]\n for key in keys:\n value_type = get_proper_type(ctx.type.items.get(key))\n if value_type is None:\n return ctx.default_return_type\n\n if len(ctx.arg_types) == 1:\n output_types.append(value_type)\n elif (len(ctx.arg_types) == 2 and len(ctx.arg_types[1]) == 1\n and len(ctx.args[1]) == 1):\n default_arg = ctx.args[1][0]\n if (isinstance(default_arg, DictExpr) and len(default_arg.items) == 0\n and isinstance(value_type, TypedDictType)):\n # Special case '{}' as the default for a typed dict type.\n output_types.append(value_type.copy_modified(required_keys=set()))\n else:\n output_types.append(value_type)\n output_types.append(ctx.arg_types[1][0])\n\n if len(ctx.arg_types) == 1:\n output_types.append(NoneType())\n\n return make_simplified_union(output_types)\n return ctx.default_return_type", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py_typed_dict_pop_signature_callback_typed_dict_pop_signature_callback.return.signature_copy_modified_a": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py_typed_dict_pop_signature_callback_typed_dict_pop_signature_callback.return.signature_copy_modified_a", "embedding": null, "metadata": {"file_path": "mypy/plugins/default.py", "file_name": "default.py", "file_type": "text/x-python", "category": "implementation", "start_line": 252, "end_line": 279, "span_ids": ["typed_dict_pop_signature_callback"], "tokens": 299}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def typed_dict_pop_signature_callback(ctx: MethodSigContext) -> CallableType:\n \"\"\"Try to infer a better signature type for TypedDict.pop.\n\n This is used to get better type context for the second argument that\n depends on a TypedDict value type.\n \"\"\"\n signature = ctx.default_signature\n str_type = ctx.api.named_generic_type('builtins.str', [])\n if (isinstance(ctx.type, TypedDictType)\n and len(ctx.args) == 2\n and len(ctx.args[0]) == 1\n and isinstance(ctx.args[0][0], StrExpr)\n and len(signature.arg_types) == 2\n and len(signature.variables) == 1\n and len(ctx.args[1]) == 1):\n key = ctx.args[0][0].value\n value_type = ctx.type.items.get(key)\n if value_type:\n # Tweak the signature to include the value type as context. It's\n # only needed for type inference since there's a union with a type\n # variable that accepts everything.\n assert isinstance(signature.variables[0], TypeVarDef)\n tv = TypeVarType(signature.variables[0])\n typ = make_simplified_union([value_type, tv])\n return signature.copy_modified(\n arg_types=[str_type, typ],\n ret_type=typ)\n return signature.copy_modified(arg_types=[str_type, signature.arg_types[1]])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py_typed_dict_pop_callback_typed_dict_pop_callback.return.ctx_default_return_type": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py_typed_dict_pop_callback_typed_dict_pop_callback.return.ctx_default_return_type", "embedding": null, "metadata": {"file_path": "mypy/plugins/default.py", "file_name": "default.py", "file_type": "text/x-python", "category": "implementation", "start_line": 282, "end_line": 309, "span_ids": ["typed_dict_pop_callback"], "tokens": 298}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def typed_dict_pop_callback(ctx: MethodContext) -> Type:\n \"\"\"Type check and infer a precise return type for TypedDict.pop.\"\"\"\n if (isinstance(ctx.type, TypedDictType)\n and len(ctx.arg_types) >= 1\n and len(ctx.arg_types[0]) == 1):\n keys = try_getting_str_literals(ctx.args[0][0], ctx.arg_types[0][0])\n if keys is None:\n ctx.api.fail(message_registry.TYPEDDICT_KEY_MUST_BE_STRING_LITERAL, ctx.context)\n return AnyType(TypeOfAny.from_error)\n\n value_types = []\n for key in keys:\n if key in ctx.type.required_keys:\n ctx.api.msg.typeddict_key_cannot_be_deleted(ctx.type, key, ctx.context)\n\n value_type = ctx.type.items.get(key)\n if value_type:\n value_types.append(value_type)\n else:\n ctx.api.msg.typeddict_key_not_found(ctx.type, key, ctx.context)\n return AnyType(TypeOfAny.from_error)\n\n if len(ctx.args[1]) == 0:\n return make_simplified_union(value_types)\n elif (len(ctx.arg_types) == 2 and len(ctx.arg_types[1]) == 1\n and len(ctx.args[1]) == 1):\n return make_simplified_union([*value_types, ctx.arg_types[1][0]])\n return ctx.default_return_type", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py_typed_dict_setdefault_signature_callback_typed_dict_setdefault_signature_callback.return.signature_copy_modified_a": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py_typed_dict_setdefault_signature_callback_typed_dict_setdefault_signature_callback.return.signature_copy_modified_a", "embedding": null, "metadata": {"file_path": "mypy/plugins/default.py", "file_name": "default.py", "file_type": "text/x-python", "category": "implementation", "start_line": 312, "end_line": 330, "span_ids": ["typed_dict_setdefault_signature_callback"], "tokens": 207}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def typed_dict_setdefault_signature_callback(ctx: MethodSigContext) -> CallableType:\n \"\"\"Try to infer a better signature type for TypedDict.setdefault.\n\n This is used to get better type context for the second argument that\n depends on a TypedDict value type.\n \"\"\"\n signature = ctx.default_signature\n str_type = ctx.api.named_generic_type('builtins.str', [])\n if (isinstance(ctx.type, TypedDictType)\n and len(ctx.args) == 2\n and len(ctx.args[0]) == 1\n and isinstance(ctx.args[0][0], StrExpr)\n and len(signature.arg_types) == 2\n and len(ctx.args[1]) == 1):\n key = ctx.args[0][0].value\n value_type = ctx.type.items.get(key)\n if value_type:\n return signature.copy_modified(arg_types=[str_type, value_type])\n return signature.copy_modified(arg_types=[str_type, signature.arg_types[1]])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py_typed_dict_setdefault_callback_typed_dict_setdefault_callback.return.ctx_default_return_type": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py_typed_dict_setdefault_callback_typed_dict_setdefault_callback.return.ctx_default_return_type", "embedding": null, "metadata": {"file_path": "mypy/plugins/default.py", "file_name": "default.py", "file_type": "text/x-python", "category": "implementation", "start_line": 333, "end_line": 366, "span_ids": ["typed_dict_setdefault_callback"], "tokens": 337}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def typed_dict_setdefault_callback(ctx: MethodContext) -> Type:\n \"\"\"Type check TypedDict.setdefault and infer a precise return type.\"\"\"\n if (isinstance(ctx.type, TypedDictType)\n and len(ctx.arg_types) == 2\n and len(ctx.arg_types[0]) == 1\n and len(ctx.arg_types[1]) == 1):\n keys = try_getting_str_literals(ctx.args[0][0], ctx.arg_types[0][0])\n if keys is None:\n ctx.api.fail(message_registry.TYPEDDICT_KEY_MUST_BE_STRING_LITERAL, ctx.context)\n return AnyType(TypeOfAny.from_error)\n\n default_type = ctx.arg_types[1][0]\n\n value_types = []\n for key in keys:\n value_type = ctx.type.items.get(key)\n\n if value_type is None:\n ctx.api.msg.typeddict_key_not_found(ctx.type, key, ctx.context)\n return AnyType(TypeOfAny.from_error)\n\n # The signature_callback above can't always infer the right signature\n # (e.g. when the expression is a variable that happens to be a Literal str)\n # so we need to handle the check ourselves here and make sure the provided\n # default can be assigned to all key-value pairs we're updating.\n if not is_subtype(default_type, value_type):\n ctx.api.msg.typeddict_setdefault_arguments_inconsistent(\n default_type, value_type, ctx.context)\n return AnyType(TypeOfAny.from_error)\n\n value_types.append(value_type)\n\n return make_simplified_union(value_types)\n return ctx.default_return_type", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py_typed_dict_delitem_signature_callback_typed_dict_delitem_callback.return.ctx_default_return_type": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py_typed_dict_delitem_signature_callback_typed_dict_delitem_callback.return.ctx_default_return_type", "embedding": null, "metadata": {"file_path": "mypy/plugins/default.py", "file_name": "default.py", "file_type": "text/x-python", "category": "implementation", "start_line": 369, "end_line": 390, "span_ids": ["typed_dict_delitem_signature_callback", "typed_dict_delitem_callback"], "tokens": 244}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def typed_dict_delitem_signature_callback(ctx: MethodSigContext) -> CallableType:\n # Replace NoReturn as the argument type.\n str_type = ctx.api.named_generic_type('builtins.str', [])\n return ctx.default_signature.copy_modified(arg_types=[str_type])\n\n\ndef typed_dict_delitem_callback(ctx: MethodContext) -> Type:\n \"\"\"Type check TypedDict.__delitem__.\"\"\"\n if (isinstance(ctx.type, TypedDictType)\n and len(ctx.arg_types) == 1\n and len(ctx.arg_types[0]) == 1):\n keys = try_getting_str_literals(ctx.args[0][0], ctx.arg_types[0][0])\n if keys is None:\n ctx.api.fail(message_registry.TYPEDDICT_KEY_MUST_BE_STRING_LITERAL, ctx.context)\n return AnyType(TypeOfAny.from_error)\n\n for key in keys:\n if key in ctx.type.required_keys:\n ctx.api.msg.typeddict_key_cannot_be_deleted(ctx.type, key, ctx.context)\n elif key not in ctx.type.items:\n ctx.api.msg.typeddict_key_not_found(ctx.type, key, ctx.context)\n return ctx.default_return_type", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py_typed_dict_update_signature_callback_typed_dict_update_signature_callback.return.signature": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py_typed_dict_update_signature_callback_typed_dict_update_signature_callback.return.signature", "embedding": null, "metadata": {"file_path": "mypy/plugins/default.py", "file_name": "default.py", "file_type": "text/x-python", "category": "implementation", "start_line": 393, "end_line": 403, "span_ids": ["typed_dict_update_signature_callback"], "tokens": 120}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def typed_dict_update_signature_callback(ctx: MethodSigContext) -> CallableType:\n \"\"\"Try to infer a better signature type for TypedDict.update.\"\"\"\n signature = ctx.default_signature\n if (isinstance(ctx.type, TypedDictType)\n and len(signature.arg_types) == 1):\n arg_type = get_proper_type(signature.arg_types[0])\n assert isinstance(arg_type, TypedDictType)\n arg_type = arg_type.as_anonymous()\n arg_type = arg_type.copy_modified(required_keys=set())\n return signature.copy_modified(arg_types=[arg_type])\n return signature", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py_int_pow_callback_int_pow_callback.return.ctx_default_return_type": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py_int_pow_callback_int_pow_callback.return.ctx_default_return_type", "embedding": null, "metadata": {"file_path": "mypy/plugins/default.py", "file_name": "default.py", "file_type": "text/x-python", "category": "implementation", "start_line": 406, "end_line": 424, "span_ids": ["int_pow_callback"], "tokens": 207}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def int_pow_callback(ctx: MethodContext) -> Type:\n \"\"\"Infer a more precise return type for int.__pow__.\"\"\"\n # int.__pow__ has an optional modulo argument,\n # so we expect 2 argument positions\n if (len(ctx.arg_types) == 2\n and len(ctx.arg_types[0]) == 1 and len(ctx.arg_types[1]) == 0):\n arg = ctx.args[0][0]\n if isinstance(arg, IntExpr):\n exponent = arg.value\n elif isinstance(arg, UnaryExpr) and arg.op == '-' and isinstance(arg.expr, IntExpr):\n exponent = -arg.expr.value\n else:\n # Right operand not an int literal or a negated literal -- give up.\n return ctx.default_return_type\n if exponent >= 0:\n return ctx.api.named_generic_type('builtins.int', [])\n else:\n return ctx.api.named_generic_type('builtins.float', [])\n return ctx.default_return_type", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py_int_neg_callback_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/default.py_int_neg_callback_", "embedding": null, "metadata": {"file_path": "mypy/plugins/default.py", "file_name": "default.py", "file_type": "text/x-python", "category": "implementation", "start_line": 427, "end_line": 452, "span_ids": ["int_neg_callback"], "tokens": 218}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def int_neg_callback(ctx: MethodContext) -> Type:\n \"\"\"Infer a more precise return type for int.__neg__.\n\n This is mainly used to infer the return type as LiteralType\n if the original underlying object is a LiteralType object\n \"\"\"\n if isinstance(ctx.type, Instance) and ctx.type.last_known_value is not None:\n value = ctx.type.last_known_value.value\n fallback = ctx.type.last_known_value.fallback\n if isinstance(value, int):\n if is_literal_type_like(ctx.api.type_context[-1]):\n return LiteralType(value=-value, fallback=fallback)\n else:\n return ctx.type.copy_modified(last_known_value=LiteralType(\n value=-value,\n fallback=ctx.type,\n line=ctx.type.line,\n column=ctx.type.column,\n ))\n elif isinstance(ctx.type, LiteralType):\n value = ctx.type.value\n fallback = ctx.type.fallback\n if isinstance(value, int):\n return LiteralType(value=-value, fallback=fallback)\n return ctx.default_return_type", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/enums.py___ENUM_VALUE_ACCESS._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/enums.py___ENUM_VALUE_ACCESS._", "embedding": null, "metadata": {"file_path": "mypy/plugins/enums.py", "file_name": "enums.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 30, "span_ids": ["docstring"], "tokens": 323}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"\nThis file contains a variety of plugins for refining how mypy infers types of\nexpressions involving Enums.\n\nCurrently, this file focuses on providing better inference for expressions like\n'SomeEnum.FOO.name' and 'SomeEnum.FOO.value'. Note that the type of both expressions\nwill vary depending on exactly which instance of SomeEnum we're looking at.\n\nNote that this file does *not* contain all special-cased logic related to enums:\nwe actually bake some of it directly in to the semantic analysis layer (see\nsemanal_enum.py).\n\"\"\"\nfrom typing import Iterable, Optional, TypeVar\nfrom typing_extensions import Final\n\nimport mypy.plugin # To avoid circular imports.\nfrom mypy.types import Type, Instance, LiteralType, CallableType, ProperType, get_proper_type\nfrom mypy.nodes import TypeInfo\n\n# Note: 'enum.EnumMeta' is deliberately excluded from this list. Classes that directly use\n# enum.EnumMeta do not necessarily automatically have the 'name' and 'value' attributes.\nENUM_PREFIXES = {'enum.Enum', 'enum.IntEnum', 'enum.Flag', 'enum.IntFlag'} # type: Final\nENUM_NAME_ACCESS = (\n {'{}.name'.format(prefix) for prefix in ENUM_PREFIXES}\n | {'{}._name_'.format(prefix) for prefix in ENUM_PREFIXES}\n) # type: Final\nENUM_VALUE_ACCESS = (\n {'{}.value'.format(prefix) for prefix in ENUM_PREFIXES}\n | {'{}._value_'.format(prefix) for prefix in ENUM_PREFIXES}\n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/enums.py_None_6__first.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/enums.py_None_6__first.return.None", "embedding": null, "metadata": {"file_path": "mypy/plugins/enums.py", "file_name": "enums.py", "file_type": "text/x-python", "category": "implementation", "start_line": 29, "end_line": 66, "span_ids": ["enum_name_callback", "_first", "impl:7", "docstring"], "tokens": 297}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": " # type: Final\n\n\ndef enum_name_callback(ctx: 'mypy.plugin.AttributeContext') -> Type:\n \"\"\"This plugin refines the 'name' attribute in enums to act as if\n they were declared to be final.\n\n For example, the expression 'MyEnum.FOO.name' normally is inferred\n to be of type 'str'.\n\n This plugin will instead make the inferred type be a 'str' where the\n last known value is 'Literal[\"FOO\"]'. This means it would be legal to\n use 'MyEnum.FOO.name' in contexts that expect a Literal type, just like\n any other Final variable or attribute.\n\n This plugin assumes that the provided context is an attribute access\n matching one of the strings found in 'ENUM_NAME_ACCESS'.\n \"\"\"\n enum_field_name = _extract_underlying_field_name(ctx.type)\n if enum_field_name is None:\n return ctx.default_attr_type\n else:\n str_type = ctx.api.named_generic_type('builtins.str', [])\n literal_type = LiteralType(enum_field_name, fallback=str_type)\n return str_type.copy_modified(last_known_value=literal_type)\n\n\n_T = TypeVar('_T')\n\n\ndef _first(it: Iterable[_T]) -> Optional[_T]:\n \"\"\"Return the first value from any iterable.\n\n Returns ``None`` if the iterable is empty.\n \"\"\"\n for val in it:\n return val\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/enums.py__infer_value_type_with_auto_fallback__infer_value_type_with_auto_fallback.return.ctx_default_attr_type": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/enums.py__infer_value_type_with_auto_fallback__infer_value_type_with_auto_fallback.return.ctx_default_attr_type", "embedding": null, "metadata": {"file_path": "mypy/plugins/enums.py", "file_name": "enums.py", "file_type": "text/x-python", "category": "implementation", "start_line": 69, "end_line": 103, "span_ids": ["_infer_value_type_with_auto_fallback"], "tokens": 381}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _infer_value_type_with_auto_fallback(\n ctx: 'mypy.plugin.AttributeContext',\n proper_type: Optional[ProperType]) -> Optional[Type]:\n \"\"\"Figure out the type of an enum value accounting for `auto()`.\n\n This method is a no-op for a `None` proper_type and also in the case where\n the type is not \"enum.auto\"\n \"\"\"\n if proper_type is None:\n return None\n if not ((isinstance(proper_type, Instance) and\n proper_type.type.fullname == 'enum.auto')):\n return proper_type\n assert isinstance(ctx.type, Instance), 'An incorrect ctx.type was passed.'\n info = ctx.type.type\n # Find the first _generate_next_value_ on the mro. We need to know\n # if it is `Enum` because `Enum` types say that the return-value of\n # `_generate_next_value_` is `Any`. In reality the default `auto()`\n # returns an `int` (presumably the `Any` in typeshed is to make it\n # easier to subclass and change the returned type).\n type_with_gnv = _first(\n ti for ti in info.mro if ti.names.get('_generate_next_value_'))\n if type_with_gnv is None:\n return ctx.default_attr_type\n\n stnode = type_with_gnv.names['_generate_next_value_']\n\n # This should be a `CallableType`\n node_type = get_proper_type(stnode.type)\n if isinstance(node_type, CallableType):\n if type_with_gnv.fullname == 'enum.Enum':\n int_type = ctx.api.named_generic_type('builtins.int', [])\n return int_type\n return get_proper_type(node_type.ret_type)\n return ctx.default_attr_type", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/enums.py_enum_value_callback_enum_value_callback.return.underlying_type": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/enums.py_enum_value_callback_enum_value_callback.return.underlying_type", "embedding": null, "metadata": {"file_path": "mypy/plugins/enums.py", "file_name": "enums.py", "file_type": "text/x-python", "category": "implementation", "start_line": 118, "end_line": 199, "span_ids": ["enum_value_callback"], "tokens": 737}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def enum_value_callback(ctx: 'mypy.plugin.AttributeContext') -> Type:\n \"\"\"This plugin refines the 'value' attribute in enums to refer to\n the original underlying value. For example, suppose we have the\n following:\n\n class SomeEnum:\n FOO = A()\n BAR = B()\n\n By default, mypy will infer that 'SomeEnum.FOO.value' and\n 'SomeEnum.BAR.value' both are of type 'Any'. This plugin refines\n this inference so that mypy understands the expressions are\n actually of types 'A' and 'B' respectively. This better reflects\n the actual runtime behavior.\n\n This plugin works simply by looking up the original value assigned\n to the enum. For example, when this plugin sees 'SomeEnum.BAR.value',\n it will look up whatever type 'BAR' had in the SomeEnum TypeInfo and\n use that as the inferred type of the overall expression.\n\n This plugin assumes that the provided context is an attribute access\n matching one of the strings found in 'ENUM_VALUE_ACCESS'.\n \"\"\"\n enum_field_name = _extract_underlying_field_name(ctx.type)\n if enum_field_name is None:\n # We do not know the enum field name (perhaps it was passed to a\n # function and we only know that it _is_ a member). All is not lost\n # however, if we can prove that the all of the enum members have the\n # same value-type, then it doesn't matter which member was passed in.\n # The value-type is still known.\n if isinstance(ctx.type, Instance):\n info = ctx.type.type\n\n # As long as mypy doesn't understand attribute creation in __new__,\n # there is no way to predict the value type if the enum class has a\n # custom implementation\n if _implements_new(info):\n return ctx.default_attr_type\n\n stnodes = (info.get(name) for name in info.names)\n\n # Enums _can_ have methods and instance attributes.\n # Omit methods and attributes created by assigning to self.*\n # for our value inference.\n node_types = (\n get_proper_type(n.type) if n else None\n for n in stnodes\n if n is None or not n.implicit)\n proper_types = (\n _infer_value_type_with_auto_fallback(ctx, t)\n for t in node_types\n if t is None or not isinstance(t, CallableType))\n underlying_type = _first(proper_types)\n if underlying_type is None:\n return ctx.default_attr_type\n all_same_value_type = all(\n proper_type is not None and proper_type == underlying_type\n for proper_type in proper_types)\n if all_same_value_type:\n if underlying_type is not None:\n return underlying_type\n return ctx.default_attr_type\n\n assert isinstance(ctx.type, Instance)\n info = ctx.type.type\n\n # As long as mypy doesn't understand attribute creation in __new__,\n # there is no way to predict the value type if the enum class has a\n # custom implementation\n if _implements_new(info):\n return ctx.default_attr_type\n\n stnode = info.get(enum_field_name)\n if stnode is None:\n return ctx.default_attr_type\n\n underlying_type = _infer_value_type_with_auto_fallback(\n ctx, get_proper_type(stnode.type))\n if underlying_type is None:\n return ctx.default_attr_type\n\n return underlying_type", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/enums.py__extract_underlying_field_name_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/enums.py__extract_underlying_field_name_", "embedding": null, "metadata": {"file_path": "mypy/plugins/enums.py", "file_name": "enums.py", "file_type": "text/x-python", "category": "implementation", "start_line": 173, "end_line": 200, "span_ids": ["_extract_underlying_field_name"], "tokens": 238}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _extract_underlying_field_name(typ: Type) -> Optional[str]:\n \"\"\"If the given type corresponds to some Enum instance, returns the\n original name of that enum. For example, if we receive in the type\n corresponding to 'SomeEnum.FOO', we return the string \"SomeEnum.Foo\".\n\n This helper takes advantage of the fact that Enum instances are valid\n to use inside Literal[...] types. An expression like 'SomeEnum.FOO' is\n actually represented by an Instance type with a Literal enum fallback.\n\n We can examine this Literal fallback to retrieve the string.\n \"\"\"\n typ = get_proper_type(typ)\n if not isinstance(typ, Instance):\n return None\n\n if not typ.type.is_enum:\n return None\n\n underlying_literal = typ.last_known_value\n if underlying_literal is None:\n return None\n\n # The checks above have verified this LiteralType is representing an enum value,\n # which means the 'value' field is guaranteed to be the name of the enum field\n # as a string.\n assert isinstance(underlying_literal.value, str)\n return underlying_literal.value", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/reachability.py_infer_condition_value_infer_condition_value.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/reachability.py_infer_condition_value_infer_condition_value.return.result", "embedding": null, "metadata": {"file_path": "mypy/reachability.py", "file_name": "reachability.py", "file_type": "text/x-python", "category": "implementation", "start_line": 61, "end_line": 109, "span_ids": ["infer_condition_value"], "tokens": 482}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def infer_condition_value(expr: Expression, options: Options) -> int:\n \"\"\"Infer whether the given condition is always true/false.\n\n Return ALWAYS_TRUE if always true, ALWAYS_FALSE if always false,\n MYPY_TRUE if true under mypy and false at runtime, MYPY_FALSE if\n false under mypy and true at runtime, else TRUTH_VALUE_UNKNOWN.\n \"\"\"\n pyversion = options.python_version\n name = ''\n negated = False\n alias = expr\n if isinstance(alias, UnaryExpr):\n if alias.op == 'not':\n expr = alias.expr\n negated = True\n result = TRUTH_VALUE_UNKNOWN\n if isinstance(expr, NameExpr):\n name = expr.name\n elif isinstance(expr, MemberExpr):\n name = expr.name\n elif isinstance(expr, OpExpr) and expr.op in ('and', 'or'):\n left = infer_condition_value(expr.left, options)\n if ((left in (ALWAYS_TRUE, MYPY_TRUE) and expr.op == 'and') or\n (left in (ALWAYS_FALSE, MYPY_FALSE) and expr.op == 'or')):\n # Either `True and ` or `False or `: the result will\n # always be the right-hand-side.\n return infer_condition_value(expr.right, options)\n else:\n # The result will always be the left-hand-side (e.g. ALWAYS_* or\n # TRUTH_VALUE_UNKNOWN).\n return left\n else:\n result = consider_sys_version_info(expr, pyversion)\n if result == TRUTH_VALUE_UNKNOWN:\n result = consider_sys_platform(expr, options.platform)\n if result == TRUTH_VALUE_UNKNOWN:\n if name == 'PY2':\n result = ALWAYS_TRUE if pyversion[0] == 2 else ALWAYS_FALSE\n elif name == 'PY3':\n result = ALWAYS_TRUE if pyversion[0] == 3 else ALWAYS_FALSE\n elif name == 'MYPY' or name == 'TYPE_CHECKING':\n result = MYPY_TRUE\n elif name in options.always_true:\n result = ALWAYS_TRUE\n elif name in options.always_false:\n result = ALWAYS_FALSE\n if negated:\n result = inverted_truth_mapping[result]\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/reachability.py_consider_sys_version_info_consider_sys_version_info.return.TRUTH_VALUE_UNKNOWN": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/reachability.py_consider_sys_version_info_consider_sys_version_info.return.TRUTH_VALUE_UNKNOWN", "embedding": null, "metadata": {"file_path": "mypy/reachability.py", "file_name": "reachability.py", "file_type": "text/x-python", "category": "implementation", "start_line": 120, "end_line": 161, "span_ids": ["consider_sys_version_info"], "tokens": 463}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def consider_sys_version_info(expr: Expression, pyversion: Tuple[int, ...]) -> int:\n \"\"\"Consider whether expr is a comparison involving sys.version_info.\n\n Return ALWAYS_TRUE, ALWAYS_FALSE, or TRUTH_VALUE_UNKNOWN.\n \"\"\"\n # Cases supported:\n # - sys.version_info[] \n # - sys.version_info[:] \n # - sys.version_info \n # (in this case must be >, >=, <, <=, but cannot be ==, !=)\n if not isinstance(expr, ComparisonExpr):\n return TRUTH_VALUE_UNKNOWN\n # Let's not yet support chained comparisons.\n if len(expr.operators) > 1:\n return TRUTH_VALUE_UNKNOWN\n op = expr.operators[0]\n if op not in ('==', '!=', '<=', '>=', '<', '>'):\n return TRUTH_VALUE_UNKNOWN\n\n index = contains_sys_version_info(expr.operands[0])\n thing = contains_int_or_tuple_of_ints(expr.operands[1])\n if index is None or thing is None:\n index = contains_sys_version_info(expr.operands[1])\n thing = contains_int_or_tuple_of_ints(expr.operands[0])\n op = reverse_op[op]\n if isinstance(index, int) and isinstance(thing, int):\n # sys.version_info[i] k\n if 0 <= index <= 1:\n return fixed_comparison(pyversion[index], op, thing)\n else:\n return TRUTH_VALUE_UNKNOWN\n elif isinstance(index, tuple) and isinstance(thing, tuple):\n lo, hi = index\n if lo is None:\n lo = 0\n if hi is None:\n hi = 2\n if 0 <= lo < hi <= 2:\n val = pyversion[lo:hi]\n if len(val) == len(thing) or len(val) > len(thing) and op not in ('==', '!='):\n return fixed_comparison(val, op, thing)\n return TRUTH_VALUE_UNKNOWN", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/reachability.py_consider_sys_platform_consider_sys_platform.if_isinstance_expr_Compa.else_.return.TRUTH_VALUE_UNKNOWN": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/reachability.py_consider_sys_platform_consider_sys_platform.if_isinstance_expr_Compa.else_.return.TRUTH_VALUE_UNKNOWN", "embedding": null, "metadata": {"file_path": "mypy/reachability.py", "file_name": "reachability.py", "file_type": "text/x-python", "category": "implementation", "start_line": 153, "end_line": 189, "span_ids": ["consider_sys_platform"], "tokens": 329}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def consider_sys_platform(expr: Expression, platform: str) -> int:\n \"\"\"Consider whether expr is a comparison involving sys.platform.\n\n Return ALWAYS_TRUE, ALWAYS_FALSE, or TRUTH_VALUE_UNKNOWN.\n \"\"\"\n # Cases supported:\n # - sys.platform == 'posix'\n # - sys.platform != 'win32'\n # - sys.platform.startswith('win')\n if isinstance(expr, ComparisonExpr):\n # Let's not yet support chained comparisons.\n if len(expr.operators) > 1:\n return TRUTH_VALUE_UNKNOWN\n op = expr.operators[0]\n if op not in ('==', '!='):\n return TRUTH_VALUE_UNKNOWN\n if not is_sys_attr(expr.operands[0], 'platform'):\n return TRUTH_VALUE_UNKNOWN\n right = expr.operands[1]\n if not isinstance(right, (StrExpr, UnicodeExpr)):\n return TRUTH_VALUE_UNKNOWN\n return fixed_comparison(platform, op, right.value)\n elif isinstance(expr, CallExpr):\n if not isinstance(expr.callee, MemberExpr):\n return TRUTH_VALUE_UNKNOWN\n if len(expr.args) != 1 or not isinstance(expr.args[0], (StrExpr, UnicodeExpr)):\n return TRUTH_VALUE_UNKNOWN\n if not is_sys_attr(expr.callee.expr, 'platform'):\n return TRUTH_VALUE_UNKNOWN\n if expr.callee.name != 'startswith':\n return TRUTH_VALUE_UNKNOWN\n if platform.startswith(expr.args[0].value):\n return ALWAYS_TRUE\n else:\n return ALWAYS_FALSE\n else:\n return TRUTH_VALUE_UNKNOWN", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/reachability.py_Targ_contains_int_or_tuple_of_ints.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/reachability.py_Targ_contains_int_or_tuple_of_ints.return.None", "embedding": null, "metadata": {"file_path": "mypy/reachability.py", "file_name": "reachability.py", "file_type": "text/x-python", "category": "implementation", "start_line": 203, "end_line": 235, "span_ids": ["impl:15", "fixed_comparison", "contains_int_or_tuple_of_ints"], "tokens": 246}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "Targ = TypeVar('Targ', int, str, Tuple[int, ...])\n\n\ndef fixed_comparison(left: Targ, op: str, right: Targ) -> int:\n rmap = {False: ALWAYS_FALSE, True: ALWAYS_TRUE}\n if op == '==':\n return rmap[left == right]\n if op == '!=':\n return rmap[left != right]\n if op == '<=':\n return rmap[left <= right]\n if op == '>=':\n return rmap[left >= right]\n if op == '<':\n return rmap[left < right]\n if op == '>':\n return rmap[left > right]\n return TRUTH_VALUE_UNKNOWN\n\n\ndef contains_int_or_tuple_of_ints(expr: Expression\n ) -> Union[None, int, Tuple[int], Tuple[int, ...]]:\n if isinstance(expr, IntExpr):\n return expr.value\n if isinstance(expr, TupleExpr):\n if literal(expr) == LITERAL_YES:\n thing = []\n for x in expr.items:\n if not isinstance(x, IntExpr):\n return None\n thing.append(x.value)\n return tuple(thing)\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/reachability.py_contains_sys_version_info_contains_sys_version_info.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/reachability.py_contains_sys_version_info_contains_sys_version_info.return.None", "embedding": null, "metadata": {"file_path": "mypy/reachability.py", "file_name": "reachability.py", "file_type": "text/x-python", "category": "implementation", "start_line": 227, "end_line": 249, "span_ids": ["contains_sys_version_info"], "tokens": 210}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def contains_sys_version_info(expr: Expression\n ) -> Union[None, int, Tuple[Optional[int], Optional[int]]]:\n if is_sys_attr(expr, 'version_info'):\n return (None, None) # Same as sys.version_info[:]\n if isinstance(expr, IndexExpr) and is_sys_attr(expr.base, 'version_info'):\n index = expr.index\n if isinstance(index, IntExpr):\n return index.value\n if isinstance(index, SliceExpr):\n if index.stride is not None:\n if not isinstance(index.stride, IntExpr) or index.stride.value != 1:\n return None\n begin = end = None\n if index.begin_index is not None:\n if not isinstance(index.begin_index, IntExpr):\n return None\n begin = index.begin_index.value\n if index.end_index is not None:\n if not isinstance(index.end_index, IntExpr):\n return None\n end = index.end_index.value\n return (begin, end)\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/reachability.py_is_sys_attr_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/reachability.py_is_sys_attr_", "embedding": null, "metadata": {"file_path": "mypy/reachability.py", "file_name": "reachability.py", "file_type": "text/x-python", "category": "implementation", "start_line": 252, "end_line": 297, "span_ids": ["is_sys_attr", "MarkImportsUnreachableVisitor.visit_import_from", "MarkImportsMypyOnlyVisitor.visit_import_from", "MarkImportsUnreachableVisitor.visit_import_all", "MarkImportsMypyOnlyVisitor.visit_import", "MarkImportsMypyOnlyVisitor", "MarkImportsMypyOnlyVisitor.visit_import_all", "mark_block_unreachable", "MarkImportsUnreachableVisitor", "mark_block_mypy_only", "MarkImportsUnreachableVisitor.visit_import"], "tokens": 355}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_sys_attr(expr: Expression, name: str) -> bool:\n # TODO: This currently doesn't work with code like this:\n # - import sys as _sys\n # - from sys import version_info\n if isinstance(expr, MemberExpr) and expr.name == name:\n if isinstance(expr.expr, NameExpr) and expr.expr.name == 'sys':\n # TODO: Guard against a local named sys, etc.\n # (Though later passes will still do most checking.)\n return True\n return False\n\n\ndef mark_block_unreachable(block: Block) -> None:\n block.is_unreachable = True\n block.accept(MarkImportsUnreachableVisitor())\n\n\nclass MarkImportsUnreachableVisitor(TraverserVisitor):\n \"\"\"Visitor that flags all imports nested within a node as unreachable.\"\"\"\n\n def visit_import(self, node: Import) -> None:\n node.is_unreachable = True\n\n def visit_import_from(self, node: ImportFrom) -> None:\n node.is_unreachable = True\n\n def visit_import_all(self, node: ImportAll) -> None:\n node.is_unreachable = True\n\n\ndef mark_block_mypy_only(block: Block) -> None:\n block.accept(MarkImportsMypyOnlyVisitor())\n\n\nclass MarkImportsMypyOnlyVisitor(TraverserVisitor):\n \"\"\"Visitor that sets is_mypy_only (which affects priority).\"\"\"\n\n def visit_import(self, node: Import) -> None:\n node.is_mypy_only = True\n\n def visit_import_from(self, node: ImportFrom) -> None:\n node.is_mypy_only = True\n\n def visit_import_all(self, node: ImportAll) -> None:\n node.is_mypy_only = True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/renaming.py_from_typing_import_Dict__CLASS.2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/renaming.py_from_typing_import_Dict__CLASS.2", "embedding": null, "metadata": {"file_path": "mypy/renaming.py", "file_name": "renaming.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 14, "span_ids": ["imports"], "tokens": 122}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from typing import Dict, List\nfrom typing_extensions import Final\n\nfrom mypy.nodes import (\n Block, AssignmentStmt, NameExpr, MypyFile, FuncDef, Lvalue, ListExpr, TupleExpr,\n WhileStmt, ForStmt, BreakStmt, ContinueStmt, TryStmt, WithStmt, StarExpr, ImportFrom,\n MemberExpr, IndexExpr, Import, ClassDef\n)\nfrom mypy.traverser import TraverserVisitor\n\n# Scope kinds\nFILE = 0 # type: Final\nFUNCTION = 1 # type: Final\nCLASS = 2", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/renaming.py_None_3_VariableRenameVisitor.visit_mypy_file.self_leave_scope_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/renaming.py_None_3_VariableRenameVisitor.visit_mypy_file.self_leave_scope_", "embedding": null, "metadata": {"file_path": "mypy/renaming.py", "file_name": "renaming.py", "file_type": "text/x-python", "category": "implementation", "start_line": 14, "end_line": 84, "span_ids": ["imports", "VariableRenameVisitor", "VariableRenameVisitor.__init__", "VariableRenameVisitor.visit_mypy_file"], "tokens": 545}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": " # type: Final\n\n\nclass VariableRenameVisitor(TraverserVisitor):\n \"\"\"Rename variables to allow redefinition of variables.\n\n For example, consider this code:\n\n x = 0\n f(x)\n\n x = \"a\"\n g(x)\n\n It will be transformed like this:\n\n x' = 0\n f(x')\n\n x = \"a\"\n g(x)\n\n There will be two independent variables (x' and x) that will have separate\n inferred types. The publicly exposed variant will get the non-suffixed name.\n This is the last definition at module top level and the first definition\n (argument) within a function.\n\n Renaming only happens for assignments within the same block. Renaming is\n performed before semantic analysis, immediately after parsing.\n\n The implementation performs a rudimentary static analysis. The analysis is\n overly conservative to keep things simple.\n \"\"\"\n\n def __init__(self) -> None:\n # Counter for labeling new blocks\n self.block_id = 0\n # Number of surrounding try statements that disallow variable redefinition\n self.disallow_redef_depth = 0\n # Number of surrounding loop statements\n self.loop_depth = 0\n # Map block id to loop depth.\n self.block_loop_depth = {} # type: Dict[int, int]\n # Stack of block ids being processed.\n self.blocks = [] # type: List[int]\n # List of scopes; each scope maps short (unqualified) name to block id.\n self.var_blocks = [] # type: List[Dict[str, int]]\n\n # References to variables that we may need to rename. List of\n # scopes; each scope is a mapping from name to list of collections\n # of names that refer to the same logical variable.\n self.refs = [] # type: List[Dict[str, List[List[NameExpr]]]]\n # Number of reads of the most recent definition of a variable (per scope)\n self.num_reads = [] # type: List[Dict[str, int]]\n # Kinds of nested scopes (FILE, FUNCTION or CLASS)\n self.scope_kinds = [] # type: List[int]\n\n def visit_mypy_file(self, file_node: MypyFile) -> None:\n \"\"\"Rename variables within a file.\n\n This is the main entry point to this class.\n \"\"\"\n self.clear()\n self.enter_scope(FILE)\n self.enter_block()\n\n for d in file_node.defs:\n d.accept(self)\n\n self.leave_block()\n self.leave_scope()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/renaming.py_VariableRenameVisitor.visit_func_def_VariableRenameVisitor.visit_func_def.self_leave_scope_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/renaming.py_VariableRenameVisitor.visit_func_def_VariableRenameVisitor.visit_func_def.self_leave_scope_", "embedding": null, "metadata": {"file_path": "mypy/renaming.py", "file_name": "renaming.py", "file_type": "text/x-python", "category": "implementation", "start_line": 86, "end_line": 106, "span_ids": ["VariableRenameVisitor.visit_func_def"], "tokens": 193}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class VariableRenameVisitor(TraverserVisitor):\n\n def visit_func_def(self, fdef: FuncDef) -> None:\n # Conservatively do not allow variable defined before a function to\n # be redefined later, since function could refer to either definition.\n self.reject_redefinition_of_vars_in_scope()\n\n self.enter_scope(FUNCTION)\n self.enter_block()\n\n for arg in fdef.arguments:\n name = arg.variable.name\n # 'self' can't be redefined since it's special as it allows definition of\n # attributes. 'cls' can't be used to define attributes so we can ignore it.\n can_be_redefined = name != 'self' # TODO: Proper check\n self.record_assignment(arg.variable.name, can_be_redefined)\n self.handle_arg(name)\n\n for stmt in fdef.body.body:\n stmt.accept(self)\n\n self.leave_block()\n self.leave_scope()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/renaming.py_VariableRenameVisitor.visit_class_def_VariableRenameVisitor.visit_try_stmt.self_leave_try_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/renaming.py_VariableRenameVisitor.visit_class_def_VariableRenameVisitor.visit_try_stmt.self_leave_try_", "embedding": null, "metadata": {"file_path": "mypy/renaming.py", "file_name": "renaming.py", "file_type": "text/x-python", "category": "implementation", "start_line": 108, "end_line": 147, "span_ids": ["VariableRenameVisitor.visit_class_def", "VariableRenameVisitor.visit_try_stmt", "VariableRenameVisitor.visit_while_stmt", "VariableRenameVisitor.visit_for_stmt", "VariableRenameVisitor.visit_continue_stmt", "VariableRenameVisitor.visit_break_stmt", "VariableRenameVisitor.visit_block"], "tokens": 331}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class VariableRenameVisitor(TraverserVisitor):\n\n def visit_class_def(self, cdef: ClassDef) -> None:\n self.reject_redefinition_of_vars_in_scope()\n self.enter_scope(CLASS)\n super().visit_class_def(cdef)\n self.leave_scope()\n\n def visit_block(self, block: Block) -> None:\n self.enter_block()\n super().visit_block(block)\n self.leave_block()\n\n def visit_while_stmt(self, stmt: WhileStmt) -> None:\n self.enter_loop()\n super().visit_while_stmt(stmt)\n self.leave_loop()\n\n def visit_for_stmt(self, stmt: ForStmt) -> None:\n stmt.expr.accept(self)\n self.analyze_lvalue(stmt.index, True)\n # Also analyze as non-lvalue so that every for loop index variable is assumed to be read.\n stmt.index.accept(self)\n self.enter_loop()\n stmt.body.accept(self)\n self.leave_loop()\n if stmt.else_body:\n stmt.else_body.accept(self)\n\n def visit_break_stmt(self, stmt: BreakStmt) -> None:\n self.reject_redefinition_of_vars_in_loop()\n\n def visit_continue_stmt(self, stmt: ContinueStmt) -> None:\n self.reject_redefinition_of_vars_in_loop()\n\n def visit_try_stmt(self, stmt: TryStmt) -> None:\n # Variables defined by a try statement get special treatment in the\n # type checker which allows them to be always redefined, so no need to\n # do renaming here.\n self.enter_try()\n super().visit_try_stmt(stmt)\n self.leave_try()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/renaming.py_VariableRenameVisitor.visit_with_stmt_VariableRenameVisitor.visit_with_stmt.stmt_body_accept_self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/renaming.py_VariableRenameVisitor.visit_with_stmt_VariableRenameVisitor.visit_with_stmt.stmt_body_accept_self_", "embedding": null, "metadata": {"file_path": "mypy/renaming.py", "file_name": "renaming.py", "file_type": "text/x-python", "category": "implementation", "start_line": 149, "end_line": 161, "span_ids": ["VariableRenameVisitor.visit_with_stmt"], "tokens": 145}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class VariableRenameVisitor(TraverserVisitor):\n\n def visit_with_stmt(self, stmt: WithStmt) -> None:\n for expr in stmt.expr:\n expr.accept(self)\n for target in stmt.target:\n if target is not None:\n self.analyze_lvalue(target)\n # We allow redefinitions in the body of a with statement for\n # convenience. This is unsafe since with statements can affect control\n # flow by catching exceptions, but this is rare except for\n # assertRaises() and other similar functions, where the exception is\n # raised by the last statement in the body, which usually isn't a\n # problem.\n stmt.body.accept(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/renaming.py_VariableRenameVisitor.visit_import_VariableRenameVisitor.visit_assignment_stmt.for_lvalue_in_s_lvalues_.self_analyze_lvalue_lvalu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/renaming.py_VariableRenameVisitor.visit_import_VariableRenameVisitor.visit_assignment_stmt.for_lvalue_in_s_lvalues_.self_analyze_lvalue_lvalu", "embedding": null, "metadata": {"file_path": "mypy/renaming.py", "file_name": "renaming.py", "file_type": "text/x-python", "category": "implementation", "start_line": 163, "end_line": 174, "span_ids": ["VariableRenameVisitor.visit_assignment_stmt", "VariableRenameVisitor.visit_import_from", "VariableRenameVisitor.visit_import"], "tokens": 120}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class VariableRenameVisitor(TraverserVisitor):\n\n def visit_import(self, imp: Import) -> None:\n for id, as_id in imp.ids:\n self.record_assignment(as_id or id, False)\n\n def visit_import_from(self, imp: ImportFrom) -> None:\n for id, as_id in imp.names:\n self.record_assignment(as_id or id, False)\n\n def visit_assignment_stmt(self, s: AssignmentStmt) -> None:\n s.rvalue.accept(self)\n for lvalue in s.lvalues:\n self.analyze_lvalue(lvalue)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/renaming.py_VariableRenameVisitor.analyze_lvalue_VariableRenameVisitor.analyze_lvalue.if_isinstance_lvalue_Nam.elif_isinstance_lvalue_S.self_analyze_lvalue_lvalu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/renaming.py_VariableRenameVisitor.analyze_lvalue_VariableRenameVisitor.analyze_lvalue.if_isinstance_lvalue_Nam.elif_isinstance_lvalue_S.self_analyze_lvalue_lvalu", "embedding": null, "metadata": {"file_path": "mypy/renaming.py", "file_name": "renaming.py", "file_type": "text/x-python", "category": "implementation", "start_line": 176, "end_line": 205, "span_ids": ["VariableRenameVisitor.analyze_lvalue"], "tokens": 307}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class VariableRenameVisitor(TraverserVisitor):\n\n def analyze_lvalue(self, lvalue: Lvalue, is_nested: bool = False) -> None:\n \"\"\"Process assignment; in particular, keep track of (re)defined names.\n\n Args:\n is_nested: True for non-outermost Lvalue in a multiple assignment such as\n \"x, y = ...\"\n \"\"\"\n if isinstance(lvalue, NameExpr):\n name = lvalue.name\n is_new = self.record_assignment(name, True)\n if is_new:\n self.handle_def(lvalue)\n else:\n self.handle_refine(lvalue)\n if is_nested:\n # This allows these to be redefined freely even if never read. Multiple\n # assignment like \"x, _ _ = y\" defines dummy variables that are never read.\n self.handle_ref(lvalue)\n elif isinstance(lvalue, (ListExpr, TupleExpr)):\n for item in lvalue.items:\n self.analyze_lvalue(item, is_nested=True)\n elif isinstance(lvalue, MemberExpr):\n lvalue.expr.accept(self)\n elif isinstance(lvalue, IndexExpr):\n lvalue.base.accept(self)\n lvalue.index.accept(self)\n elif isinstance(lvalue, StarExpr):\n # Propagate is_nested since in a typical use case like \"x, *rest = ...\" 'rest' may\n # be freely reused.\n self.analyze_lvalue(lvalue.expr, is_nested=is_nested)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/renaming.py_VariableRenameVisitor.visit_name_expr_VariableRenameVisitor.handle_ref.num_reads_name_num_rea": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/renaming.py_VariableRenameVisitor.visit_name_expr_VariableRenameVisitor.handle_ref.num_reads_name_num_rea", "embedding": null, "metadata": {"file_path": "mypy/renaming.py", "file_name": "renaming.py", "file_type": "text/x-python", "category": "implementation", "start_line": 207, "end_line": 242, "span_ids": ["VariableRenameVisitor.visit_name_expr", "VariableRenameVisitor.handle_refine", "VariableRenameVisitor.handle_ref", "VariableRenameVisitor.handle_def", "VariableRenameVisitor.handle_arg"], "tokens": 306}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class VariableRenameVisitor(TraverserVisitor):\n\n def visit_name_expr(self, expr: NameExpr) -> None:\n self.handle_ref(expr)\n\n # Helpers for renaming references\n\n def handle_arg(self, name: str) -> None:\n \"\"\"Store function argument.\"\"\"\n self.refs[-1][name] = [[]]\n self.num_reads[-1][name] = 0\n\n def handle_def(self, expr: NameExpr) -> None:\n \"\"\"Store new name definition.\"\"\"\n name = expr.name\n names = self.refs[-1].setdefault(name, [])\n names.append([expr])\n self.num_reads[-1][name] = 0\n\n def handle_refine(self, expr: NameExpr) -> None:\n \"\"\"Store assignment to an existing name (that replaces previous value, if any).\"\"\"\n name = expr.name\n if name in self.refs[-1]:\n names = self.refs[-1][name]\n if not names:\n names.append([])\n names[-1].append(expr)\n\n def handle_ref(self, expr: NameExpr) -> None:\n \"\"\"Store reference to defined name.\"\"\"\n name = expr.name\n if name in self.refs[-1]:\n names = self.refs[-1][name]\n if not names:\n names.append([])\n names[-1].append(expr)\n num_reads = self.num_reads[-1]\n num_reads[name] = num_reads.get(name, 0) + 1", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/renaming.py_VariableRenameVisitor.flush_refs_VariableRenameVisitor.flush_refs.self_refs_pop_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/renaming.py_VariableRenameVisitor.flush_refs_VariableRenameVisitor.flush_refs.self_refs_pop_", "embedding": null, "metadata": {"file_path": "mypy/renaming.py", "file_name": "renaming.py", "file_type": "text/x-python", "category": "implementation", "start_line": 244, "end_line": 264, "span_ids": ["VariableRenameVisitor.flush_refs"], "tokens": 194}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class VariableRenameVisitor(TraverserVisitor):\n\n def flush_refs(self) -> None:\n \"\"\"Rename all references within the current scope.\n\n This will be called at the end of a scope.\n \"\"\"\n is_func = self.scope_kinds[-1] == FUNCTION\n for name, refs in self.refs[-1].items():\n if len(refs) == 1:\n # Only one definition -- no renaming needed.\n continue\n if is_func:\n # In a function, don't rename the first definition, as it\n # may be an argument that must preserve the name.\n to_rename = refs[1:]\n else:\n # At module top level, don't rename the final definition,\n # as it will be publicly visible outside the module.\n to_rename = refs[:-1]\n for i, item in enumerate(to_rename):\n self.rename_refs(item, i)\n self.refs.pop()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/renaming.py_VariableRenameVisitor.rename_refs_VariableRenameVisitor.is_nested.return.len_self_var_blocks_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/renaming.py_VariableRenameVisitor.rename_refs_VariableRenameVisitor.is_nested.return.len_self_var_blocks_1", "embedding": null, "metadata": {"file_path": "mypy/renaming.py", "file_name": "renaming.py", "file_type": "text/x-python", "category": "implementation", "start_line": 266, "end_line": 314, "span_ids": ["VariableRenameVisitor.leave_try", "VariableRenameVisitor.is_nested", "VariableRenameVisitor.leave_block", "VariableRenameVisitor.enter_block", "VariableRenameVisitor.enter_try", "VariableRenameVisitor.leave_loop", "VariableRenameVisitor.current_block", "VariableRenameVisitor.leave_scope", "VariableRenameVisitor.enter_scope", "VariableRenameVisitor.enter_loop", "VariableRenameVisitor.rename_refs", "VariableRenameVisitor.clear"], "tokens": 329}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class VariableRenameVisitor(TraverserVisitor):\n\n def rename_refs(self, names: List[NameExpr], index: int) -> None:\n name = names[0].name\n new_name = name + \"'\" * (index + 1)\n for expr in names:\n expr.name = new_name\n\n # Helpers for determining which assignments define new variables\n\n def clear(self) -> None:\n self.blocks = []\n self.var_blocks = []\n\n def enter_block(self) -> None:\n self.block_id += 1\n self.blocks.append(self.block_id)\n self.block_loop_depth[self.block_id] = self.loop_depth\n\n def leave_block(self) -> None:\n self.blocks.pop()\n\n def enter_try(self) -> None:\n self.disallow_redef_depth += 1\n\n def leave_try(self) -> None:\n self.disallow_redef_depth -= 1\n\n def enter_loop(self) -> None:\n self.loop_depth += 1\n\n def leave_loop(self) -> None:\n self.loop_depth -= 1\n\n def current_block(self) -> int:\n return self.blocks[-1]\n\n def enter_scope(self, kind: int) -> None:\n self.var_blocks.append({})\n self.refs.append({})\n self.num_reads.append({})\n self.scope_kinds.append(kind)\n\n def leave_scope(self) -> None:\n self.flush_refs()\n self.var_blocks.pop()\n self.num_reads.pop()\n self.scope_kinds.pop()\n\n def is_nested(self) -> int:\n return len(self.var_blocks) > 1", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/renaming.py_VariableRenameVisitor.reject_redefinition_of_vars_in_scope_VariableRenameVisitor.reject_redefinition_of_vars_in_scope.for_key_in_var_blocks_.var_blocks_key_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/renaming.py_VariableRenameVisitor.reject_redefinition_of_vars_in_scope_VariableRenameVisitor.reject_redefinition_of_vars_in_scope.for_key_in_var_blocks_.var_blocks_key_1", "embedding": null, "metadata": {"file_path": "mypy/renaming.py", "file_name": "renaming.py", "file_type": "text/x-python", "category": "implementation", "start_line": 316, "end_line": 331, "span_ids": ["VariableRenameVisitor.reject_redefinition_of_vars_in_scope"], "tokens": 121}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class VariableRenameVisitor(TraverserVisitor):\n\n def reject_redefinition_of_vars_in_scope(self) -> None:\n \"\"\"Make it impossible to redefine defined variables in the current scope.\n\n This is used if we encounter a function definition that\n can make it ambiguous which definition is live. Example:\n\n x = 0\n\n def f() -> int:\n return x\n\n x = '' # Error -- cannot redefine x across function definition\n \"\"\"\n var_blocks = self.var_blocks[-1]\n for key in var_blocks:\n var_blocks[key] = -1", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/renaming.py_VariableRenameVisitor.reject_redefinition_of_vars_in_loop_VariableRenameVisitor.reject_redefinition_of_vars_in_loop.for_key_block_in_var_blo.if_self_block_loop_depth_.var_blocks_key_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/renaming.py_VariableRenameVisitor.reject_redefinition_of_vars_in_loop_VariableRenameVisitor.reject_redefinition_of_vars_in_loop.for_key_block_in_var_blo.if_self_block_loop_depth_.var_blocks_key_1", "embedding": null, "metadata": {"file_path": "mypy/renaming.py", "file_name": "renaming.py", "file_type": "text/x-python", "category": "implementation", "start_line": 333, "end_line": 352, "span_ids": ["VariableRenameVisitor.reject_redefinition_of_vars_in_loop"], "tokens": 173}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class VariableRenameVisitor(TraverserVisitor):\n\n def reject_redefinition_of_vars_in_loop(self) -> None:\n \"\"\"Reject redefinition of variables in the innermost loop.\n\n If there is an early exit from a loop, there may be ambiguity about which\n value may escpae the loop. Example where this matters:\n\n while f():\n x = 0\n if g():\n break\n x = '' # Error -- not a redefinition\n reveal_type(x) # int\n\n This method ensures that the second assignment to 'x' doesn't introduce a new\n variable.\n \"\"\"\n var_blocks = self.var_blocks[-1]\n for key, block in var_blocks.items():\n if self.block_loop_depth.get(block) == self.loop_depth:\n var_blocks[key] = -1", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/renaming.py_VariableRenameVisitor.record_assignment_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/renaming.py_VariableRenameVisitor.record_assignment_", "embedding": null, "metadata": {"file_path": "mypy/renaming.py", "file_name": "renaming.py", "file_type": "text/x-python", "category": "implementation", "start_line": 354, "end_line": 385, "span_ids": ["VariableRenameVisitor.record_assignment"], "tokens": 288}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class VariableRenameVisitor(TraverserVisitor):\n\n def record_assignment(self, name: str, can_be_redefined: bool) -> bool:\n \"\"\"Record assignment to given name and return True if it defines a new variable.\n\n Args:\n can_be_redefined: If True, allows assignment in the same block to redefine\n this name (if this is a new definition)\n \"\"\"\n if self.num_reads[-1].get(name, -1) == 0:\n # Only set, not read, so no reason to redefine\n return False\n if self.disallow_redef_depth > 0:\n # Can't redefine within try/with a block.\n can_be_redefined = False\n block = self.current_block()\n var_blocks = self.var_blocks[-1]\n if name not in var_blocks:\n # New definition in this scope.\n if can_be_redefined:\n # Store the block where this was defined to allow redefinition in\n # the same block only.\n var_blocks[name] = block\n else:\n # This doesn't support arbitrary redefinition.\n var_blocks[name] = -1\n return True\n elif var_blocks[name] == block:\n # Redefinition -- defines a new variable with the same name.\n return True\n else:\n # Assigns to an existing variable.\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py__Classes_for_producing__reporter_classes._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py__Classes_for_producing__reporter_classes._", "embedding": null, "metadata": {"file_path": "mypy/report.py", "file_name": "report.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 48, "span_ids": ["docstring"], "tokens": 376}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Classes for producing HTML reports about imprecision.\"\"\"\n\nfrom abc import ABCMeta, abstractmethod\nimport collections\nimport json\nimport os\nimport shutil\nimport tokenize\nimport time\nimport sys\nimport itertools\nfrom operator import attrgetter\nfrom urllib.request import pathname2url\n\nimport typing\nfrom typing import Any, Callable, Dict, List, Optional, Tuple, cast, Iterator\nfrom typing_extensions import Final\n\nfrom mypy.nodes import MypyFile, Expression, FuncDef\nfrom mypy import stats\nfrom mypy.options import Options\nfrom mypy.traverser import TraverserVisitor\nfrom mypy.types import Type, TypeOfAny\nfrom mypy.version import __version__\nfrom mypy.defaults import REPORTER_NAMES\n\ntry:\n # mypyc doesn't properly handle import from of submodules that we\n # don't have stubs for, hence the hacky double import\n import lxml.etree # type: ignore # noqa: F401\n from lxml import etree\n LXML_INSTALLED = True\nexcept ImportError:\n LXML_INSTALLED = False\n\ntype_of_any_name_map = collections.OrderedDict([\n (TypeOfAny.unannotated, \"Unannotated\"),\n (TypeOfAny.explicit, \"Explicit\"),\n (TypeOfAny.from_unimported_type, \"Unimported\"),\n (TypeOfAny.from_omitted_generics, \"Omitted Generics\"),\n (TypeOfAny.from_error, \"Error\"),\n (TypeOfAny.special_form, \"Special Form\"),\n (TypeOfAny.implementation_artifact, \"Implementation Artifact\"),\n]) # type: Final[collections.OrderedDict[int, str]]\n\nReporterClasses = Dict[str, Tuple[Callable[['Reports', str], 'AbstractReporter'], bool]]\n\nreporter_classes = {}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py__type_Final_ReporterCla_Reports.finish.for_reporter_in_self_repo.reporter_on_finish_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py__type_Final_ReporterCla_Reports.finish.for_reporter_in_self_repo.reporter_on_finish_", "embedding": null, "metadata": {"file_path": "mypy/report.py", "file_name": "report.py", "file_type": "text/x-python", "category": "implementation", "start_line": 48, "end_line": 87, "span_ids": ["Reports.file", "Reports", "Reports.__init__", "docstring", "Reports.finish", "Reports.add_report"], "tokens": 339}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": " # type: Final[ReporterClasses]\n\n\nclass Reports:\n def __init__(self, data_dir: str, report_dirs: Dict[str, str]) -> None:\n self.data_dir = data_dir\n self.reporters = [] # type: List[AbstractReporter]\n self.named_reporters = {} # type: Dict[str, AbstractReporter]\n\n for report_type, report_dir in sorted(report_dirs.items()):\n self.add_report(report_type, report_dir)\n\n def add_report(self, report_type: str, report_dir: str) -> 'AbstractReporter':\n try:\n return self.named_reporters[report_type]\n except KeyError:\n pass\n reporter_cls, needs_lxml = reporter_classes[report_type]\n if needs_lxml and not LXML_INSTALLED:\n print(('You must install the lxml package before you can run mypy'\n ' with `--{}-report`.\\n'\n 'You can do this with `python3 -m pip install lxml`.').format(report_type),\n file=sys.stderr)\n raise ImportError\n reporter = reporter_cls(self, report_dir)\n self.reporters.append(reporter)\n self.named_reporters[report_type] = reporter\n return reporter\n\n def file(self,\n tree: MypyFile,\n modules: Dict[str, MypyFile],\n type_map: Dict[Expression, Type],\n options: Options) -> None:\n for reporter in self.reporters:\n reporter.on_file(tree, modules, type_map, options)\n\n def finish(self) -> None:\n for reporter in self.reporters:\n reporter.on_finish()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_AbstractReporter_AbstractReporter.on_finish.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_AbstractReporter_AbstractReporter.on_finish.pass", "embedding": null, "metadata": {"file_path": "mypy/report.py", "file_name": "report.py", "file_type": "text/x-python", "category": "implementation", "start_line": 90, "end_line": 106, "span_ids": ["AbstractReporter.__init__", "AbstractReporter.on_finish", "AbstractReporter", "AbstractReporter.on_file"], "tokens": 118}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class AbstractReporter(metaclass=ABCMeta):\n def __init__(self, reports: Reports, output_dir: str) -> None:\n self.output_dir = output_dir\n if output_dir != '':\n stats.ensure_dir_exists(output_dir)\n\n @abstractmethod\n def on_file(self,\n tree: MypyFile,\n modules: Dict[str, MypyFile],\n type_map: Dict[Expression, Type],\n options: Options) -> None:\n pass\n\n @abstractmethod\n def on_finish(self) -> None:\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_register_reporter_FuncCounterVisitor.visit_func_def.self_counts_defn_type_is_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_register_reporter_FuncCounterVisitor.visit_func_def.self_counts_defn_type_is_", "embedding": null, "metadata": {"file_path": "mypy/report.py", "file_name": "report.py", "file_type": "text/x-python", "category": "implementation", "start_line": 109, "end_line": 142, "span_ids": ["register_reporter", "alias_reporter", "FuncCounterVisitor.__init__", "FuncCounterVisitor.visit_func_def", "iterate_python_lines", "FuncCounterVisitor", "should_skip_path"], "tokens": 273}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def register_reporter(report_name: str,\n reporter: Callable[[Reports, str], AbstractReporter],\n needs_lxml: bool = False) -> None:\n reporter_classes[report_name] = (reporter, needs_lxml)\n\n\ndef alias_reporter(source_reporter: str, target_reporter: str) -> None:\n reporter_classes[target_reporter] = reporter_classes[source_reporter]\n\n\ndef should_skip_path(path: str) -> bool:\n if stats.is_special_module(path):\n return True\n if path.startswith('..'):\n return True\n if 'stubs' in path.split('/') or 'stubs' in path.split(os.sep):\n return True\n return False\n\n\ndef iterate_python_lines(path: str) -> Iterator[Tuple[int, str]]:\n \"\"\"Return an iterator over (line number, line text) from a Python file.\"\"\"\n with tokenize.open(path) as input_file:\n for line_info in enumerate(input_file, 1):\n yield line_info\n\n\nclass FuncCounterVisitor(TraverserVisitor):\n def __init__(self) -> None:\n super().__init__()\n self.counts = [0, 0]\n\n def visit_func_def(self, defn: FuncDef) -> None:\n self.counts[defn.type is not None] += 1", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_LineCountReporter_LineCountReporter.on_file.self_counts_tree__fullnam": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_LineCountReporter_LineCountReporter.on_file.self_counts_tree__fullnam", "embedding": null, "metadata": {"file_path": "mypy/report.py", "file_name": "report.py", "file_type": "text/x-python", "category": "implementation", "start_line": 145, "end_line": 173, "span_ids": ["LineCountReporter.on_file", "LineCountReporter.__init__", "LineCountReporter"], "tokens": 277}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LineCountReporter(AbstractReporter):\n def __init__(self, reports: Reports, output_dir: str) -> None:\n super().__init__(reports, output_dir)\n self.counts = {} # type: Dict[str, Tuple[int, int, int, int]]\n\n def on_file(self,\n tree: MypyFile,\n modules: Dict[str, MypyFile],\n type_map: Dict[Expression, Type],\n options: Options) -> None:\n # Count physical lines. This assumes the file's encoding is a\n # superset of ASCII (or at least uses \\n in its line endings).\n with open(tree.path, 'rb') as f:\n physical_lines = len(f.readlines())\n\n func_counter = FuncCounterVisitor()\n tree.accept(func_counter)\n unannotated_funcs, annotated_funcs = func_counter.counts\n total_funcs = annotated_funcs + unannotated_funcs\n\n # Don't count lines or functions as annotated if they have their errors ignored.\n if options.ignore_errors:\n annotated_funcs = 0\n\n imputed_annotated_lines = (physical_lines * annotated_funcs // total_funcs\n if total_funcs else physical_lines)\n\n self.counts[tree._fullname] = (imputed_annotated_lines, physical_lines,\n annotated_funcs, total_funcs)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_LineCountReporter.on_finish_register_reporter_lineco": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_LineCountReporter.on_finish_register_reporter_lineco", "embedding": null, "metadata": {"file_path": "mypy/report.py", "file_name": "report.py", "file_type": "text/x-python", "category": "implementation", "start_line": 175, "end_line": 187, "span_ids": ["impl:13", "LineCountReporter.on_finish"], "tokens": 186}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LineCountReporter(AbstractReporter):\n\n def on_finish(self) -> None:\n counts = sorted(((c, p) for p, c in self.counts.items()),\n reverse=True) # type: List[Tuple[Tuple[int, int, int, int], str]]\n total_counts = tuple(sum(c[i] for c, p in counts)\n for i in range(4))\n with open(os.path.join(self.output_dir, 'linecount.txt'), 'w') as f:\n f.write('{:7} {:7} {:6} {:6} total\\n'.format(*total_counts))\n for c, p in counts:\n f.write('{:7} {:7} {:6} {:6} {}\\n'.format(\n c[0], c[1], c[2], c[3], p))\n\n\nregister_reporter('linecount', LineCountReporter)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_AnyExpressionsReporter_AnyExpressionsReporter.on_finish.self__report_types_of_any": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_AnyExpressionsReporter_AnyExpressionsReporter.on_finish.self__report_types_of_any", "embedding": null, "metadata": {"file_path": "mypy/report.py", "file_name": "report.py", "file_type": "text/x-python", "category": "implementation", "start_line": 190, "end_line": 220, "span_ids": ["AnyExpressionsReporter.on_file", "AnyExpressionsReporter.on_finish", "AnyExpressionsReporter", "AnyExpressionsReporter.__init__"], "tokens": 315}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class AnyExpressionsReporter(AbstractReporter):\n \"\"\"Report frequencies of different kinds of Any types.\"\"\"\n\n def __init__(self, reports: Reports, output_dir: str) -> None:\n super().__init__(reports, output_dir)\n self.counts = {} # type: Dict[str, Tuple[int, int]]\n self.any_types_counter = {} # type: Dict[str, typing.Counter[int]]\n\n def on_file(self,\n tree: MypyFile,\n modules: Dict[str, MypyFile],\n type_map: Dict[Expression, Type],\n options: Options) -> None:\n visitor = stats.StatisticsVisitor(inferred=True,\n filename=tree.fullname,\n modules=modules,\n typemap=type_map,\n all_nodes=True,\n visit_untyped_defs=False)\n tree.accept(visitor)\n self.any_types_counter[tree.fullname] = visitor.type_of_any_counter\n num_unanalyzed_lines = list(visitor.line_map.values()).count(stats.TYPE_UNANALYZED)\n # count each line of dead code as one expression of type \"Any\"\n num_any = visitor.num_any_exprs + num_unanalyzed_lines\n num_total = visitor.num_imprecise_exprs + visitor.num_precise_exprs + num_any\n if num_total > 0:\n self.counts[tree.fullname] = (num_any, num_total)\n\n def on_finish(self) -> None:\n self._report_any_exprs()\n self._report_types_of_anys()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_AnyExpressionsReporter._write_out_report_AnyExpressionsReporter._write_out_report.with_open_os_path_join_se.f_writelines_footer_str_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_AnyExpressionsReporter._write_out_report_AnyExpressionsReporter._write_out_report.with_open_os_path_join_se.f_writelines_footer_str_", "embedding": null, "metadata": {"file_path": "mypy/report.py", "file_name": "report.py", "file_type": "text/x-python", "category": "implementation", "start_line": 222, "end_line": 249, "span_ids": ["AnyExpressionsReporter._write_out_report"], "tokens": 323}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class AnyExpressionsReporter(AbstractReporter):\n\n def _write_out_report(self,\n filename: str,\n header: List[str],\n rows: List[List[str]],\n footer: List[str],\n ) -> None:\n row_len = len(header)\n assert all(len(row) == row_len for row in rows + [header, footer])\n min_column_distance = 3 # minimum distance between numbers in two columns\n widths = [-1] * row_len\n for row in rows + [header, footer]:\n for i, value in enumerate(row):\n widths[i] = max(widths[i], len(value))\n for i, w in enumerate(widths):\n # Do not add min_column_distance to the first column.\n if i > 0:\n widths[i] = w + min_column_distance\n with open(os.path.join(self.output_dir, filename), 'w') as f:\n header_str = (\"{:>{}}\" * len(widths)).format(*itertools.chain(*zip(header, widths)))\n separator = '-' * len(header_str)\n f.write(header_str + '\\n')\n f.write(separator + '\\n')\n for row_values in rows:\n r = (\"{:>{}}\" * len(widths)).format(*itertools.chain(*zip(row_values, widths)))\n f.writelines(r + '\\n')\n f.write(separator + '\\n')\n footer_str = (\"{:>{}}\" * len(widths)).format(*itertools.chain(*zip(footer, widths)))\n f.writelines(footer_str + '\\n')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_AnyExpressionsReporter._report_any_exprs_AnyExpressionsReporter._report_any_exprs.self__write_out_report_a": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_AnyExpressionsReporter._report_any_exprs_AnyExpressionsReporter._report_any_exprs.self__write_out_report_a", "embedding": null, "metadata": {"file_path": "mypy/report.py", "file_name": "report.py", "file_type": "text/x-python", "category": "implementation", "start_line": 251, "end_line": 267, "span_ids": ["AnyExpressionsReporter._report_any_exprs"], "tokens": 252}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class AnyExpressionsReporter(AbstractReporter):\n\n def _report_any_exprs(self) -> None:\n total_any = sum(num_any for num_any, _ in self.counts.values())\n total_expr = sum(total for _, total in self.counts.values())\n total_coverage = 100.0\n if total_expr > 0:\n total_coverage = (float(total_expr - total_any) / float(total_expr)) * 100\n\n column_names = [\"Name\", \"Anys\", \"Exprs\", \"Coverage\"]\n rows = [] # type: List[List[str]]\n for filename in sorted(self.counts):\n (num_any, num_total) = self.counts[filename]\n coverage = (float(num_total - num_any) / float(num_total)) * 100\n coverage_str = '{:.2f}%'.format(coverage)\n rows.append([filename, str(num_any), str(num_total), coverage_str])\n rows.sort(key=lambda x: x[0])\n total_row = [\"Total\", str(total_any), str(total_expr), '{:.2f}%'.format(total_coverage)]\n self._write_out_report('any-exprs.txt', column_names, rows, total_row)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_AnyExpressionsReporter._report_types_of_anys_register_reporter_any_ex": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_AnyExpressionsReporter._report_types_of_anys_register_reporter_any_ex", "embedding": null, "metadata": {"file_path": "mypy/report.py", "file_name": "report.py", "file_type": "text/x-python", "category": "implementation", "start_line": 269, "end_line": 286, "span_ids": ["impl:14", "AnyExpressionsReporter._report_types_of_anys"], "tokens": 217}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class AnyExpressionsReporter(AbstractReporter):\n\n def _report_types_of_anys(self) -> None:\n total_counter = collections.Counter() # type: typing.Counter[int]\n for counter in self.any_types_counter.values():\n for any_type, value in counter.items():\n total_counter[any_type] += value\n file_column_name = \"Name\"\n total_row_name = \"Total\"\n column_names = [file_column_name] + list(type_of_any_name_map.values())\n rows = [] # type: List[List[str]]\n for filename, counter in self.any_types_counter.items():\n rows.append([filename] + [str(counter[typ]) for typ in type_of_any_name_map])\n rows.sort(key=lambda x: x[0])\n total_row = [total_row_name] + [str(total_counter[typ])\n for typ in type_of_any_name_map]\n self._write_out_report('types-of-anys.txt', column_names, rows, total_row)\n\n\nregister_reporter('any-exprs', AnyExpressionsReporter)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_LineCoverageVisitor_LineCoverageVisitor._by_PEP_8_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_LineCoverageVisitor_LineCoverageVisitor._by_PEP_8_", "embedding": null, "metadata": {"file_path": "mypy/report.py", "file_name": "report.py", "file_type": "text/x-python", "category": "implementation", "start_line": 289, "end_line": 308, "span_ids": ["LineCoverageVisitor", "LineCoverageVisitor.__init__"], "tokens": 212}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LineCoverageVisitor(TraverserVisitor):\n def __init__(self, source: List[str]) -> None:\n self.source = source\n\n # For each line of source, we maintain a pair of\n # * the indentation level of the surrounding function\n # (-1 if not inside a function), and\n # * whether the surrounding function is typed.\n # Initially, everything is covered at indentation level -1.\n self.lines_covered = [(-1, True) for l in source]\n\n # The Python AST has position information for the starts of\n # elements, but not for their ends. Fortunately the\n # indentation-based syntax makes it pretty easy to find where a\n # block ends without doing any real parsing.\n\n # TODO: Handle line continuations (explicit and implicit) and\n # multi-line string literals. (But at least line continuations\n # are normally more indented than their surrounding block anyways,\n # by PEP 8.)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_LineCoverageVisitor.indentation_level_LineCoverageVisitor.indentation_level.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_LineCoverageVisitor.indentation_level_LineCoverageVisitor.indentation_level.return.None", "embedding": null, "metadata": {"file_path": "mypy/report.py", "file_name": "report.py", "file_type": "text/x-python", "category": "implementation", "start_line": 310, "end_line": 332, "span_ids": ["LineCoverageVisitor.indentation_level"], "tokens": 202}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LineCoverageVisitor(TraverserVisitor):\n\n def indentation_level(self, line_number: int) -> Optional[int]:\n \"\"\"Return the indentation of a line of the source (specified by\n zero-indexed line number). Returns None for blank lines or comments.\"\"\"\n line = self.source[line_number]\n indent = 0\n for char in list(line):\n if char == ' ':\n indent += 1\n elif char == '\\t':\n indent = 8 * ((indent + 8) // 8)\n elif char == '#':\n # Line is a comment; ignore it\n return None\n elif char == '\\n':\n # Line is entirely whitespace; ignore it\n return None\n # TODO line continuation (\\)\n else:\n # Found a non-whitespace character\n return indent\n # Line is entirely whitespace, and at end of file\n # with no trailing newline; ignore it\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_LineCoverageVisitor.visit_func_def_LineCoverageVisitor.visit_func_def.super_visit_func_def_de": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_LineCoverageVisitor.visit_func_def_LineCoverageVisitor.visit_func_def.super_visit_func_def_de", "embedding": null, "metadata": {"file_path": "mypy/report.py", "file_name": "report.py", "file_type": "text/x-python", "category": "implementation", "start_line": 334, "end_line": 377, "span_ids": ["LineCoverageVisitor.visit_func_def"], "tokens": 444}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LineCoverageVisitor(TraverserVisitor):\n\n def visit_func_def(self, defn: FuncDef) -> None:\n start_line = defn.get_line() - 1\n start_indent = None\n # When a function is decorated, sometimes the start line will point to\n # whitespace or comments between the decorator and the function, so\n # we have to look for the start.\n while start_line < len(self.source):\n start_indent = self.indentation_level(start_line)\n if start_indent is not None:\n break\n start_line += 1\n # If we can't find the function give up and don't annotate anything.\n # Our line numbers are not reliable enough to be asserting on.\n if start_indent is None:\n return\n\n cur_line = start_line + 1\n end_line = cur_line\n # After this loop, function body will be lines [start_line, end_line)\n while cur_line < len(self.source):\n cur_indent = self.indentation_level(cur_line)\n if cur_indent is None:\n # Consume the line, but don't mark it as belonging to the function yet.\n cur_line += 1\n elif start_indent is not None and cur_indent > start_indent:\n # A non-blank line that belongs to the function.\n cur_line += 1\n end_line = cur_line\n else:\n # We reached a line outside the function definition.\n break\n\n is_typed = defn.type is not None\n for line in range(start_line, end_line):\n old_indent, _ = self.lines_covered[line]\n # If there was an old indent level for this line, and the new\n # level isn't increasing the indentation, ignore it.\n # This is to be defensive against funniness in our line numbers,\n # which are not always reliable.\n if old_indent <= start_indent:\n self.lines_covered[line] = (start_indent, is_typed)\n\n # Visit the body, in case there are nested functions\n super().visit_func_def(defn)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_LineCoverageReporter_LineCoverageReporter.__init__._type_Dict_str_List_in": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_LineCoverageReporter_LineCoverageReporter.__init__._type_Dict_str_List_in", "embedding": null, "metadata": {"file_path": "mypy/report.py", "file_name": "report.py", "file_type": "text/x-python", "category": "implementation", "start_line": 380, "end_line": 392, "span_ids": ["LineCoverageReporter", "LineCoverageReporter.__init__"], "tokens": 127}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LineCoverageReporter(AbstractReporter):\n \"\"\"Exact line coverage reporter.\n\n This reporter writes a JSON dictionary with one field 'lines' to\n the file 'coverage.json' in the specified report directory. The\n value of that field is a dictionary which associates to each\n source file's absolute pathname the list of line numbers that\n belong to typed functions in that file.\n \"\"\"\n\n def __init__(self, reports: Reports, output_dir: str) -> None:\n super().__init__(reports, output_dir)\n self.lines_covered = {} # type: Dict[str, List[int]]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_LineCoverageReporter.on_file_FileInfo.attrib.return._name_str_val_for_name_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_LineCoverageReporter.on_file_FileInfo.attrib.return._name_str_val_for_name_", "embedding": null, "metadata": {"file_path": "mypy/report.py", "file_name": "report.py", "file_type": "text/x-python", "category": "implementation", "start_line": 394, "end_line": 430, "span_ids": ["LineCoverageReporter.on_file", "FileInfo.attrib", "FileInfo.__init__", "LineCoverageReporter.on_finish", "FileInfo", "FileInfo.total", "impl:15"], "tokens": 283}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LineCoverageReporter(AbstractReporter):\n\n def on_file(self,\n tree: MypyFile,\n modules: Dict[str, MypyFile],\n type_map: Dict[Expression, Type],\n options: Options) -> None:\n with open(tree.path) as f:\n tree_source = f.readlines()\n\n coverage_visitor = LineCoverageVisitor(tree_source)\n tree.accept(coverage_visitor)\n\n covered_lines = []\n for line_number, (_, typed) in enumerate(coverage_visitor.lines_covered):\n if typed:\n covered_lines.append(line_number + 1)\n\n self.lines_covered[os.path.abspath(tree.path)] = covered_lines\n\n def on_finish(self) -> None:\n with open(os.path.join(self.output_dir, 'coverage.json'), 'w') as f:\n json.dump({'lines': self.lines_covered}, f)\n\n\nregister_reporter('linecoverage', LineCoverageReporter)\n\n\nclass FileInfo:\n def __init__(self, name: str, module: str) -> None:\n self.name = name\n self.module = module\n self.counts = [0] * len(stats.precision_names)\n\n def total(self) -> int:\n return sum(self.counts)\n\n def attrib(self) -> Dict[str, str]:\n return {name: str(val) for name, val in sorted(zip(stats.precision_names, self.counts))}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_MemoryXmlReporter_MemoryXmlReporter._type_Final": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_MemoryXmlReporter_MemoryXmlReporter._type_Final", "embedding": null, "metadata": {"file_path": "mypy/report.py", "file_name": "report.py", "file_type": "text/x-python", "category": "implementation", "start_line": 433, "end_line": 454, "span_ids": ["MemoryXmlReporter", "MemoryXmlReporter:3", "MemoryXmlReporter.__init__"], "tokens": 279}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MemoryXmlReporter(AbstractReporter):\n \"\"\"Internal reporter that generates XML in memory.\n\n This is used by all other XML-based reporters to avoid duplication.\n \"\"\"\n\n def __init__(self, reports: Reports, output_dir: str) -> None:\n super().__init__(reports, output_dir)\n\n self.xslt_html_path = os.path.join(reports.data_dir, 'xml', 'mypy-html.xslt')\n self.xslt_txt_path = os.path.join(reports.data_dir, 'xml', 'mypy-txt.xslt')\n self.css_html_path = os.path.join(reports.data_dir, 'xml', 'mypy-html.css')\n xsd_path = os.path.join(reports.data_dir, 'xml', 'mypy.xsd')\n self.schema = etree.XMLSchema(etree.parse(xsd_path))\n self.last_xml = None # type: Optional[Any]\n self.files = [] # type: List[FileInfo]\n\n # XML doesn't like control characters, but they are sometimes\n # legal in source code (e.g. comments, string literals).\n # Tabs (#x09) are allowed in XML content.\n control_fixer = str.maketrans(\n ''.join(chr(i) for i in range(32) if i != 9), '?' * 31) # type: Final", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_MemoryXmlReporter.on_file_MemoryXmlReporter.on_file.self_files_append_file_in": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_MemoryXmlReporter.on_file_MemoryXmlReporter.on_file.self_files_append_file_in", "embedding": null, "metadata": {"file_path": "mypy/report.py", "file_name": "report.py", "file_type": "text/x-python", "category": "implementation", "start_line": 456, "end_line": 498, "span_ids": ["MemoryXmlReporter.on_file"], "tokens": 346}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MemoryXmlReporter(AbstractReporter):\n\n def on_file(self,\n tree: MypyFile,\n modules: Dict[str, MypyFile],\n type_map: Dict[Expression, Type],\n options: Options) -> None:\n self.last_xml = None\n\n try:\n path = os.path.relpath(tree.path)\n except ValueError:\n return\n\n if should_skip_path(path):\n return\n\n visitor = stats.StatisticsVisitor(inferred=True,\n filename=tree.fullname,\n modules=modules,\n typemap=type_map,\n all_nodes=True)\n tree.accept(visitor)\n\n root = etree.Element('mypy-report-file', name=path, module=tree._fullname)\n doc = etree.ElementTree(root)\n file_info = FileInfo(path, tree._fullname)\n\n for lineno, line_text in iterate_python_lines(path):\n status = visitor.line_map.get(lineno, stats.TYPE_EMPTY)\n file_info.counts[status] += 1\n etree.SubElement(root, 'line',\n any_info=self._get_any_info_for_line(visitor, lineno),\n content=line_text.rstrip('\\n').translate(self.control_fixer),\n number=str(lineno),\n precision=stats.precision_names[status])\n # Assumes a layout similar to what XmlReporter uses.\n xslt_path = os.path.relpath('mypy-html.xslt', path)\n transform_pi = etree.ProcessingInstruction('xml-stylesheet',\n 'type=\"text/xsl\" href=\"%s\"' % pathname2url(xslt_path))\n root.addprevious(transform_pi)\n self.schema.assertValid(doc)\n\n self.last_xml = doc\n self.files.append(file_info)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_MemoryXmlReporter._get_any_info_for_line_MemoryXmlReporter._get_any_info_for_line.if_lineno_in_visitor_any_.else_.return._No_Anys_on_this_line_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_MemoryXmlReporter._get_any_info_for_line_MemoryXmlReporter._get_any_info_for_line.if_lineno_in_visitor_any_.else_.return._No_Anys_on_this_line_", "embedding": null, "metadata": {"file_path": "mypy/report.py", "file_name": "report.py", "file_type": "text/x-python", "category": "implementation", "start_line": 500, "end_line": 511, "span_ids": ["MemoryXmlReporter._get_any_info_for_line"], "tokens": 139}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MemoryXmlReporter(AbstractReporter):\n\n @staticmethod\n def _get_any_info_for_line(visitor: stats.StatisticsVisitor, lineno: int) -> str:\n if lineno in visitor.any_line_map:\n result = \"Any Types on this line: \"\n counter = collections.Counter() # type: typing.Counter[int]\n for typ in visitor.any_line_map[lineno]:\n counter[typ.type_of_any] += 1\n for any_type, occurrences in counter.items():\n result += \"\\n{} (x{})\".format(type_of_any_name_map[any_type], occurrences)\n return result\n else:\n return \"No Anys on this line!\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_MemoryXmlReporter.on_finish_get_line_rate.if_total_lines_0_.else_.return._4f_format_covered_l": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_MemoryXmlReporter.on_finish_get_line_rate.if_total_lines_0_.else_.return._4f_format_covered_l", "embedding": null, "metadata": {"file_path": "mypy/report.py", "file_name": "report.py", "file_type": "text/x-python", "category": "implementation", "start_line": 513, "end_line": 543, "span_ids": ["MemoryXmlReporter.on_finish", "impl:16", "get_line_rate"], "tokens": 262}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MemoryXmlReporter(AbstractReporter):\n\n def on_finish(self) -> None:\n self.last_xml = None\n # index_path = os.path.join(self.output_dir, 'index.xml')\n output_files = sorted(self.files, key=lambda x: x.module)\n\n root = etree.Element('mypy-report-index', name='index')\n doc = etree.ElementTree(root)\n\n for file_info in output_files:\n etree.SubElement(root, 'file',\n file_info.attrib(),\n module=file_info.module,\n name=pathname2url(file_info.name),\n total=str(file_info.total()))\n xslt_path = os.path.relpath('mypy-html.xslt', '.')\n transform_pi = etree.ProcessingInstruction('xml-stylesheet',\n 'type=\"text/xsl\" href=\"%s\"' % pathname2url(xslt_path))\n root.addprevious(transform_pi)\n self.schema.assertValid(doc)\n\n self.last_xml = doc\n\n\nregister_reporter('memory-xml', MemoryXmlReporter, needs_lxml=True)\n\n\ndef get_line_rate(covered_lines: int, total_lines: int) -> str:\n if total_lines == 0:\n return str(1.0)\n else:\n return '{:.4f}'.format(covered_lines / total_lines)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_CoberturaPackage_CoberturaPackage.add_packages.if_self_packages_.for_package_in_sorted_sel.packages_element_append_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_CoberturaPackage_CoberturaPackage.add_packages.if_self_packages_.for_package_in_sorted_sel.packages_element_append_p", "embedding": null, "metadata": {"file_path": "mypy/report.py", "file_name": "report.py", "file_type": "text/x-python", "category": "implementation", "start_line": 546, "end_line": 572, "span_ids": ["CoberturaPackage.add_packages", "CoberturaPackage.__init__", "CoberturaPackage.as_xml", "CoberturaPackage"], "tokens": 251}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CoberturaPackage(object):\n \"\"\"Container for XML and statistics mapping python modules to Cobertura package.\"\"\"\n\n def __init__(self, name: str) -> None:\n self.name = name\n self.classes = {} # type: Dict[str, Any]\n self.packages = {} # type: Dict[str, CoberturaPackage]\n self.total_lines = 0\n self.covered_lines = 0\n\n def as_xml(self) -> Any:\n package_element = etree.Element('package',\n complexity='1.0',\n name=self.name)\n package_element.attrib['branch-rate'] = '0'\n package_element.attrib['line-rate'] = get_line_rate(self.covered_lines, self.total_lines)\n classes_element = etree.SubElement(package_element, 'classes')\n for class_name in sorted(self.classes):\n classes_element.append(self.classes[class_name])\n self.add_packages(package_element)\n return package_element\n\n def add_packages(self, parent_element: Any) -> None:\n if self.packages:\n packages_element = etree.SubElement(parent_element, 'packages')\n for package in sorted(self.packages.values(), key=attrgetter('name')):\n packages_element.append(package.as_xml())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_CoberturaXmlReporter_CoberturaXmlReporter.on_file.with_tokenize_open_path_.current_package_classes_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_CoberturaXmlReporter_CoberturaXmlReporter.on_file.with_tokenize_open_path_.current_package_classes_c", "embedding": null, "metadata": {"file_path": "mypy/report.py", "file_name": "report.py", "file_type": "text/x-python", "category": "implementation", "start_line": 575, "end_line": 649, "span_ids": ["CoberturaXmlReporter.on_file", "CoberturaXmlReporter", "CoberturaXmlReporter.__init__"], "tokens": 655}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CoberturaXmlReporter(AbstractReporter):\n \"\"\"Reporter for generating Cobertura compliant XML.\"\"\"\n\n def __init__(self, reports: Reports, output_dir: str) -> None:\n super().__init__(reports, output_dir)\n\n self.root = etree.Element('coverage',\n timestamp=str(int(time.time())),\n version=__version__)\n self.doc = etree.ElementTree(self.root)\n self.root_package = CoberturaPackage('.')\n\n def on_file(self,\n tree: MypyFile,\n modules: Dict[str, MypyFile],\n type_map: Dict[Expression, Type],\n options: Options) -> None:\n path = os.path.relpath(tree.path)\n visitor = stats.StatisticsVisitor(inferred=True,\n filename=tree.fullname,\n modules=modules,\n typemap=type_map,\n all_nodes=True)\n tree.accept(visitor)\n\n class_name = os.path.basename(path)\n file_info = FileInfo(path, tree._fullname)\n class_element = etree.Element('class',\n complexity='1.0',\n filename=path,\n name=class_name)\n etree.SubElement(class_element, 'methods')\n lines_element = etree.SubElement(class_element, 'lines')\n\n with tokenize.open(path) as input_file:\n class_lines_covered = 0\n class_total_lines = 0\n for lineno, _ in enumerate(input_file, 1):\n status = visitor.line_map.get(lineno, stats.TYPE_EMPTY)\n hits = 0\n branch = False\n if status == stats.TYPE_EMPTY:\n continue\n class_total_lines += 1\n if status != stats.TYPE_ANY:\n class_lines_covered += 1\n hits = 1\n if status == stats.TYPE_IMPRECISE:\n branch = True\n file_info.counts[status] += 1\n line_element = etree.SubElement(lines_element, 'line',\n branch=str(branch).lower(),\n hits=str(hits),\n number=str(lineno),\n precision=stats.precision_names[status])\n if branch:\n line_element.attrib['condition-coverage'] = '50% (1/2)'\n class_element.attrib['branch-rate'] = '0'\n class_element.attrib['line-rate'] = get_line_rate(class_lines_covered,\n class_total_lines)\n # parent_module is set to whichever module contains this file. For most files, we want\n # to simply strip the last element off of the module. But for __init__.py files,\n # the module == the parent module.\n parent_module = file_info.module.rsplit('.', 1)[0]\n if file_info.name.endswith('__init__.py'):\n parent_module = file_info.module\n\n if parent_module not in self.root_package.packages:\n self.root_package.packages[parent_module] = CoberturaPackage(parent_module)\n current_package = self.root_package.packages[parent_module]\n packages_to_update = [self.root_package, current_package]\n for package in packages_to_update:\n package.total_lines += class_total_lines\n package.covered_lines += class_lines_covered\n current_package.classes[class_name] = class_element", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_CoberturaXmlReporter.on_finish_CoberturaXmlReporter.on_finish.print_Generated_Cobertur": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_CoberturaXmlReporter.on_finish_CoberturaXmlReporter.on_finish.print_Generated_Cobertur", "embedding": null, "metadata": {"file_path": "mypy/report.py", "file_name": "report.py", "file_type": "text/x-python", "category": "implementation", "start_line": 651, "end_line": 661, "span_ids": ["CoberturaXmlReporter.on_finish"], "tokens": 142}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CoberturaXmlReporter(AbstractReporter):\n\n def on_finish(self) -> None:\n self.root.attrib['line-rate'] = get_line_rate(self.root_package.covered_lines,\n self.root_package.total_lines)\n self.root.attrib['branch-rate'] = '0'\n sources = etree.SubElement(self.root, 'sources')\n source_element = etree.SubElement(sources, 'source')\n source_element.text = os.getcwd()\n self.root_package.add_packages(self.root)\n out_path = os.path.join(self.output_dir, 'cobertura.xml')\n self.doc.write(out_path, encoding='utf-8', pretty_print=True)\n print('Generated Cobertura report:', os.path.abspath(out_path))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_register_reporter_cobert_AbstractXmlReporter.__init__.self.memory_xml.cast_MemoryXmlReporter_m": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_register_reporter_cobert_AbstractXmlReporter.__init__.self.memory_xml.cast_MemoryXmlReporter_m", "embedding": null, "metadata": {"file_path": "mypy/report.py", "file_name": "report.py", "file_type": "text/x-python", "category": "implementation", "start_line": 664, "end_line": 675, "span_ids": ["AbstractXmlReporter", "AbstractXmlReporter.__init__", "impl:17"], "tokens": 107}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "register_reporter('cobertura-xml', CoberturaXmlReporter, needs_lxml=True)\n\n\nclass AbstractXmlReporter(AbstractReporter):\n \"\"\"Internal abstract class for reporters that work via XML.\"\"\"\n\n def __init__(self, reports: Reports, output_dir: str) -> None:\n super().__init__(reports, output_dir)\n\n memory_reporter = reports.add_report('memory-xml', '')\n # The dependency will be called first.\n self.memory_xml = cast(MemoryXmlReporter, memory_reporter)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_XmlReporter_XmlReporter.on_file.last_xml_write_out_path_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_XmlReporter_XmlReporter.on_file.last_xml_write_out_path_", "embedding": null, "metadata": {"file_path": "mypy/report.py", "file_name": "report.py", "file_type": "text/x-python", "category": "implementation", "start_line": 678, "end_line": 701, "span_ids": ["XmlReporter", "XmlReporter.on_file"], "tokens": 204}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class XmlReporter(AbstractXmlReporter):\n \"\"\"Public reporter that exports XML.\n\n The produced XML files contain a reference to the absolute path\n of the html transform, so they will be locally viewable in a browser.\n\n However, there is a bug in Chrome and all other WebKit-based browsers\n that makes it fail from file:// URLs but work on http:// URLs.\n \"\"\"\n\n def on_file(self,\n tree: MypyFile,\n modules: Dict[str, MypyFile],\n type_map: Dict[Expression, Type],\n options: Options) -> None:\n last_xml = self.memory_xml.last_xml\n if last_xml is None:\n return\n path = os.path.relpath(tree.path)\n if path.startswith('..'):\n return\n out_path = os.path.join(self.output_dir, 'xml', path + '.xml')\n stats.ensure_dir_exists(os.path.dirname(out_path))\n last_xml.write(out_path, encoding='utf-8')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_XmlReporter.on_finish_XmlReporter.on_finish.print_Generated_XML_repo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_XmlReporter.on_finish_XmlReporter.on_finish.print_Generated_XML_repo", "embedding": null, "metadata": {"file_path": "mypy/report.py", "file_name": "report.py", "file_type": "text/x-python", "category": "implementation", "start_line": 703, "end_line": 712, "span_ids": ["XmlReporter.on_finish"], "tokens": 141}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class XmlReporter(AbstractXmlReporter):\n\n def on_finish(self) -> None:\n last_xml = self.memory_xml.last_xml\n assert last_xml is not None\n out_path = os.path.join(self.output_dir, 'index.xml')\n out_xslt = os.path.join(self.output_dir, 'mypy-html.xslt')\n out_css = os.path.join(self.output_dir, 'mypy-html.css')\n last_xml.write(out_path, encoding='utf-8')\n shutil.copyfile(self.memory_xml.xslt_html_path, out_xslt)\n shutil.copyfile(self.memory_xml.css_html_path, out_css)\n print('Generated XML report:', os.path.abspath(out_path))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_register_reporter_xml__XsltHtmlReporter.__init__.self.param_html.etree_XSLT_strparam_html": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_register_reporter_xml__XsltHtmlReporter.__init__.self.param_html.etree_XSLT_strparam_html", "embedding": null, "metadata": {"file_path": "mypy/report.py", "file_name": "report.py", "file_type": "text/x-python", "category": "implementation", "start_line": 715, "end_line": 729, "span_ids": ["XsltHtmlReporter", "impl:18", "XsltHtmlReporter.__init__"], "tokens": 130}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "register_reporter('xml', XmlReporter, needs_lxml=True)\n\n\nclass XsltHtmlReporter(AbstractXmlReporter):\n \"\"\"Public reporter that exports HTML via XSLT.\n\n This is slightly different than running `xsltproc` on the .xml files,\n because it passes a parameter to rewrite the links.\n \"\"\"\n\n def __init__(self, reports: Reports, output_dir: str) -> None:\n super().__init__(reports, output_dir)\n\n self.xslt_html = etree.XSLT(etree.parse(self.memory_xml.xslt_html_path))\n self.param_html = etree.XSLT.strparam('html')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_XsltHtmlReporter.on_file_XsltHtmlReporter.on_file.with_open_out_path_wb_.out_file_write_transforme": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_XsltHtmlReporter.on_file_XsltHtmlReporter.on_file.with_open_out_path_wb_.out_file_write_transforme", "embedding": null, "metadata": {"file_path": "mypy/report.py", "file_name": "report.py", "file_type": "text/x-python", "category": "implementation", "start_line": 731, "end_line": 746, "span_ids": ["XsltHtmlReporter.on_file"], "tokens": 158}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class XsltHtmlReporter(AbstractXmlReporter):\n\n def on_file(self,\n tree: MypyFile,\n modules: Dict[str, MypyFile],\n type_map: Dict[Expression, Type],\n options: Options) -> None:\n last_xml = self.memory_xml.last_xml\n if last_xml is None:\n return\n path = os.path.relpath(tree.path)\n if path.startswith('..'):\n return\n out_path = os.path.join(self.output_dir, 'html', path + '.html')\n stats.ensure_dir_exists(os.path.dirname(out_path))\n transformed_html = bytes(self.xslt_html(last_xml, ext=self.param_html))\n with open(out_path, 'wb') as out_file:\n out_file.write(transformed_html)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_XsltHtmlReporter.on_finish_register_reporter_xslt_h": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_XsltHtmlReporter.on_finish_register_reporter_xslt_h", "embedding": null, "metadata": {"file_path": "mypy/report.py", "file_name": "report.py", "file_type": "text/x-python", "category": "implementation", "start_line": 748, "end_line": 760, "span_ids": ["XsltHtmlReporter.on_finish", "impl:19"], "tokens": 157}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class XsltHtmlReporter(AbstractXmlReporter):\n\n def on_finish(self) -> None:\n last_xml = self.memory_xml.last_xml\n assert last_xml is not None\n out_path = os.path.join(self.output_dir, 'index.html')\n out_css = os.path.join(self.output_dir, 'mypy-html.css')\n transformed_html = bytes(self.xslt_html(last_xml, ext=self.param_html))\n with open(out_path, 'wb') as out_file:\n out_file.write(transformed_html)\n shutil.copyfile(self.memory_xml.css_html_path, out_css)\n print('Generated HTML report (via XSLT):', os.path.abspath(out_path))\n\n\nregister_reporter('xslt-html', XsltHtmlReporter, needs_lxml=True)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_XsltTxtReporter_XsltTxtReporter.on_finish.print_Generated_TXT_repo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_XsltTxtReporter_XsltTxtReporter.on_finish.print_Generated_TXT_repo", "embedding": null, "metadata": {"file_path": "mypy/report.py", "file_name": "report.py", "file_type": "text/x-python", "category": "implementation", "start_line": 763, "end_line": 788, "span_ids": ["XsltTxtReporter.on_finish", "XsltTxtReporter.__init__", "XsltTxtReporter", "XsltTxtReporter.on_file"], "tokens": 224}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class XsltTxtReporter(AbstractXmlReporter):\n \"\"\"Public reporter that exports TXT via XSLT.\n\n Currently this only does the summary, not the individual reports.\n \"\"\"\n\n def __init__(self, reports: Reports, output_dir: str) -> None:\n super().__init__(reports, output_dir)\n\n self.xslt_txt = etree.XSLT(etree.parse(self.memory_xml.xslt_txt_path))\n\n def on_file(self,\n tree: MypyFile,\n modules: Dict[str, MypyFile],\n type_map: Dict[Expression, Type],\n options: Options) -> None:\n pass\n\n def on_finish(self) -> None:\n last_xml = self.memory_xml.last_xml\n assert last_xml is not None\n out_path = os.path.join(self.output_dir, 'index.txt')\n transformed_txt = bytes(self.xslt_txt(last_xml))\n with open(out_path, 'wb') as out_file:\n out_file.write(transformed_txt)\n print('Generated TXT report (via XSLT):', os.path.abspath(out_path))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_register_reporter_xslt_t_LinePrecisionReporter.__init__._type_List_FileInfo_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_register_reporter_xslt_t_LinePrecisionReporter.__init__._type_List_FileInfo_", "embedding": null, "metadata": {"file_path": "mypy/report.py", "file_name": "report.py", "file_type": "text/x-python", "category": "implementation", "start_line": 791, "end_line": 814, "span_ids": ["LinePrecisionReporter", "impl:20", "LinePrecisionReporter.__init__"], "tokens": 191}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "register_reporter('xslt-txt', XsltTxtReporter, needs_lxml=True)\n\nalias_reporter('xslt-html', 'html')\nalias_reporter('xslt-txt', 'txt')\n\n\nclass LinePrecisionReporter(AbstractReporter):\n \"\"\"Report per-module line counts for typing precision.\n\n Each line is classified into one of these categories:\n\n * precise (fully type checked)\n * imprecise (Any types in a type component, such as List[Any])\n * any (something with an Any type, implicit or explicit)\n * empty (empty line, comment or docstring)\n * unanalyzed (mypy considers line unreachable)\n\n The meaning of these categories varies slightly depending on\n context.\n \"\"\"\n\n def __init__(self, reports: Reports, output_dir: str) -> None:\n super().__init__(reports, output_dir)\n self.files = [] # type: List[FileInfo]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_LinePrecisionReporter.on_file_LinePrecisionReporter.on_file.self_files_append_file_in": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_LinePrecisionReporter.on_file_LinePrecisionReporter.on_file.self_files_append_file_in", "embedding": null, "metadata": {"file_path": "mypy/report.py", "file_name": "report.py", "file_type": "text/x-python", "category": "implementation", "start_line": 816, "end_line": 842, "span_ids": ["LinePrecisionReporter.on_file"], "tokens": 174}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LinePrecisionReporter(AbstractReporter):\n\n def on_file(self,\n tree: MypyFile,\n modules: Dict[str, MypyFile],\n type_map: Dict[Expression, Type],\n options: Options) -> None:\n\n try:\n path = os.path.relpath(tree.path)\n except ValueError:\n return\n\n if should_skip_path(path):\n return\n\n visitor = stats.StatisticsVisitor(inferred=True,\n filename=tree.fullname,\n modules=modules,\n typemap=type_map,\n all_nodes=True)\n tree.accept(visitor)\n\n file_info = FileInfo(path, tree._fullname)\n for lineno, _ in iterate_python_lines(path):\n status = visitor.line_map.get(lineno, stats.TYPE_EMPTY)\n file_info.counts[status] += 1\n\n self.files.append(file_info)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_LinePrecisionReporter.on_finish_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/report.py_LinePrecisionReporter.on_finish_", "embedding": null, "metadata": {"file_path": "mypy/report.py", "file_name": "report.py", "file_type": "text/x-python", "category": "implementation", "start_line": 844, "end_line": 875, "span_ids": ["LinePrecisionReporter.on_finish", "impl:23"], "tokens": 337}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LinePrecisionReporter(AbstractReporter):\n\n def on_finish(self) -> None:\n if not self.files:\n # Nothing to do.\n return\n output_files = sorted(self.files, key=lambda x: x.module)\n report_file = os.path.join(self.output_dir, 'lineprecision.txt')\n width = max(4, max(len(info.module) for info in output_files))\n titles = ('Lines', 'Precise', 'Imprecise', 'Any', 'Empty', 'Unanalyzed')\n widths = (width,) + tuple(len(t) for t in titles)\n fmt = '{:%d} {:%d} {:%d} {:%d} {:%d} {:%d} {:%d}\\n' % widths\n with open(report_file, 'w') as f:\n f.write(\n fmt.format('Name', *titles))\n f.write('-' * (width + 51) + '\\n')\n for file_info in output_files:\n counts = file_info.counts\n f.write(fmt.format(file_info.module.ljust(width),\n file_info.total(),\n counts[stats.TYPE_PRECISE],\n counts[stats.TYPE_IMPRECISE],\n counts[stats.TYPE_ANY],\n counts[stats.TYPE_EMPTY],\n counts[stats.TYPE_UNANALYZED]))\n\n\nregister_reporter('lineprecision', LinePrecisionReporter)\n\n\n# Reporter class names are defined twice to speed up mypy startup, as this\n# module is slow to import. Ensure that the two definitions match.\nassert set(reporter_classes) == set(REPORTER_NAMES)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/sametypes.py_from_typing_import_Sequen_is_same_types.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/sametypes.py_from_typing_import_Sequen_is_same_types.return.True", "embedding": null, "metadata": {"file_path": "mypy/sametypes.py", "file_name": "sametypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 47, "span_ids": ["simplify_union", "imports", "is_same_types", "is_same_type"], "tokens": 416}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from typing import Sequence\n\nfrom mypy.types import (\n Type, UnboundType, AnyType, NoneType, TupleType, TypedDictType,\n UnionType, CallableType, TypeVarType, Instance, TypeVisitor, ErasedType,\n Overloaded, PartialType, DeletedType, UninhabitedType, TypeType, LiteralType,\n ProperType, get_proper_type, TypeAliasType)\nfrom mypy.typeops import tuple_fallback, make_simplified_union\n\n\ndef is_same_type(left: Type, right: Type) -> bool:\n \"\"\"Is 'left' the same type as 'right'?\"\"\"\n left = get_proper_type(left)\n right = get_proper_type(right)\n\n if isinstance(right, UnboundType):\n # Make unbound types same as anything else to reduce the number of\n # generated spurious error messages.\n return True\n else:\n # Simplify types to canonical forms.\n #\n # There are multiple possible union types that represent the same type,\n # such as Union[int, bool, str] and Union[int, str]. Also, some union\n # types can be simplified to non-union types such as Union[int, bool]\n # -> int. It would be nice if we always had simplified union types but\n # this is currently not the case, though it often is.\n left = simplify_union(left)\n right = simplify_union(right)\n\n return left.accept(SameTypeVisitor(right))\n\n\ndef simplify_union(t: Type) -> ProperType:\n t = get_proper_type(t)\n if isinstance(t, UnionType):\n return make_simplified_union(t.items)\n return t\n\n\ndef is_same_types(a1: Sequence[Type], a2: Sequence[Type]) -> bool:\n if len(a1) != len(a2):\n return False\n for i in range(len(a1)):\n if not is_same_type(a1[i], a2[i]):\n return False\n return True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/sametypes.py_SameTypeVisitor_SameTypeVisitor.visit_type_var.return._isinstance_self_right_T": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/sametypes.py_SameTypeVisitor_SameTypeVisitor.visit_type_var.return._isinstance_self_right_T", "embedding": null, "metadata": {"file_path": "mypy/sametypes.py", "file_name": "sametypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 50, "end_line": 96, "span_ids": ["SameTypeVisitor", "SameTypeVisitor.visit_type_var", "SameTypeVisitor.visit_erased_type", "SameTypeVisitor.visit_deleted_type", "SameTypeVisitor.visit_any", "SameTypeVisitor.visit_none_type", "SameTypeVisitor.__init__", "SameTypeVisitor.visit_unbound_type", "SameTypeVisitor.visit_uninhabited_type", "SameTypeVisitor.visit_instance", "SameTypeVisitor.visit_type_alias_type"], "tokens": 471}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SameTypeVisitor(TypeVisitor[bool]):\n \"\"\"Visitor for checking whether two types are the 'same' type.\"\"\"\n\n def __init__(self, right: ProperType) -> None:\n self.right = right\n\n # visit_x(left) means: is left (which is an instance of X) the same type as\n # right?\n\n def visit_unbound_type(self, left: UnboundType) -> bool:\n return True\n\n def visit_any(self, left: AnyType) -> bool:\n return isinstance(self.right, AnyType)\n\n def visit_none_type(self, left: NoneType) -> bool:\n return isinstance(self.right, NoneType)\n\n def visit_uninhabited_type(self, t: UninhabitedType) -> bool:\n return isinstance(self.right, UninhabitedType)\n\n def visit_erased_type(self, left: ErasedType) -> bool:\n # We can get here when isinstance is used inside a lambda\n # whose type is being inferred. In any event, we have no reason\n # to think that an ErasedType will end up being the same as\n # any other type, except another ErasedType (for protocols).\n return isinstance(self.right, ErasedType)\n\n def visit_deleted_type(self, left: DeletedType) -> bool:\n return isinstance(self.right, DeletedType)\n\n def visit_instance(self, left: Instance) -> bool:\n return (isinstance(self.right, Instance) and\n left.type == self.right.type and\n is_same_types(left.args, self.right.args) and\n left.last_known_value == self.right.last_known_value)\n\n def visit_type_alias_type(self, left: TypeAliasType) -> bool:\n # Similar to protocols, two aliases with the same targets return False here,\n # but both is_subtype(t, s) and is_subtype(s, t) return True.\n return (isinstance(self.right, TypeAliasType) and\n left.alias == self.right.alias and\n is_same_types(left.args, self.right.args))\n\n def visit_type_var(self, left: TypeVarType) -> bool:\n return (isinstance(self.right, TypeVarType) and\n left.id == self.right.id)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/sametypes.py_SameTypeVisitor.visit_callable_type_SameTypeVisitor.visit_callable_type.if_isinstance_self_right_.else_.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/sametypes.py_SameTypeVisitor.visit_callable_type_SameTypeVisitor.visit_callable_type.if_isinstance_self_right_.else_.return.False", "embedding": null, "metadata": {"file_path": "mypy/sametypes.py", "file_name": "sametypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 98, "end_line": 109, "span_ids": ["SameTypeVisitor.visit_callable_type"], "tokens": 137}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SameTypeVisitor(TypeVisitor[bool]):\n\n def visit_callable_type(self, left: CallableType) -> bool:\n # FIX generics\n if isinstance(self.right, CallableType):\n cright = self.right\n return (is_same_type(left.ret_type, cright.ret_type) and\n is_same_types(left.arg_types, cright.arg_types) and\n left.arg_names == cright.arg_names and\n left.arg_kinds == cright.arg_kinds and\n left.is_type_obj() == cright.is_type_obj() and\n left.is_ellipsis_args == cright.is_ellipsis_args)\n else:\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/sametypes.py_SameTypeVisitor.visit_tuple_type_SameTypeVisitor.visit_literal_type.if_isinstance_self_right_.else_.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/sametypes.py_SameTypeVisitor.visit_tuple_type_SameTypeVisitor.visit_literal_type.if_isinstance_self_right_.else_.return.False", "embedding": null, "metadata": {"file_path": "mypy/sametypes.py", "file_name": "sametypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 111, "end_line": 135, "span_ids": ["SameTypeVisitor.visit_literal_type", "SameTypeVisitor.visit_typeddict_type", "SameTypeVisitor.visit_tuple_type"], "tokens": 217}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SameTypeVisitor(TypeVisitor[bool]):\n\n def visit_tuple_type(self, left: TupleType) -> bool:\n if isinstance(self.right, TupleType):\n return (is_same_type(tuple_fallback(left), tuple_fallback(self.right))\n and is_same_types(left.items, self.right.items))\n else:\n return False\n\n def visit_typeddict_type(self, left: TypedDictType) -> bool:\n if isinstance(self.right, TypedDictType):\n if left.items.keys() != self.right.items.keys():\n return False\n for (_, left_item_type, right_item_type) in left.zip(self.right):\n if not is_same_type(left_item_type, right_item_type):\n return False\n return True\n else:\n return False\n\n def visit_literal_type(self, left: LiteralType) -> bool:\n if isinstance(self.right, LiteralType):\n if left.value != self.right.value:\n return False\n return is_same_type(left.fallback, self.right.fallback)\n else:\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/sametypes.py_SameTypeVisitor.visit_union_type_SameTypeVisitor.visit_union_type.if_isinstance_self_right_.else_.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/sametypes.py_SameTypeVisitor.visit_union_type_SameTypeVisitor.visit_union_type.if_isinstance_self_right_.else_.return.False", "embedding": null, "metadata": {"file_path": "mypy/sametypes.py", "file_name": "sametypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 137, "end_line": 151, "span_ids": ["SameTypeVisitor.visit_union_type"], "tokens": 132}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SameTypeVisitor(TypeVisitor[bool]):\n\n def visit_union_type(self, left: UnionType) -> bool:\n if isinstance(self.right, UnionType):\n # Check that everything in left is in right\n for left_item in left.items:\n if not any(is_same_type(left_item, right_item) for right_item in self.right.items):\n return False\n\n # Check that everything in right is in left\n for right_item in self.right.items:\n if not any(is_same_type(right_item, left_item) for left_item in left.items):\n return False\n\n return True\n else:\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/sametypes.py_SameTypeVisitor.visit_overloaded_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/sametypes.py_SameTypeVisitor.visit_overloaded_", "embedding": null, "metadata": {"file_path": "mypy/sametypes.py", "file_name": "sametypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 153, "end_line": 169, "span_ids": ["SameTypeVisitor.visit_type_type", "SameTypeVisitor.visit_overloaded", "SameTypeVisitor.visit_partial_type"], "tokens": 140}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SameTypeVisitor(TypeVisitor[bool]):\n\n def visit_overloaded(self, left: Overloaded) -> bool:\n if isinstance(self.right, Overloaded):\n return is_same_types(left.items(), self.right.items())\n else:\n return False\n\n def visit_partial_type(self, left: PartialType) -> bool:\n # A partial type is not fully defined, so the result is indeterminate. We shouldn't\n # get here.\n raise RuntimeError\n\n def visit_type_type(self, left: TypeType) -> bool:\n if isinstance(self.right, TypeType):\n return is_same_type(left.item, self.right.item)\n else:\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/scope.py__Track_current_scope_to_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/scope.py__Track_current_scope_to_", "embedding": null, "metadata": {"file_path": "mypy/scope.py", "file_name": "scope.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 125, "span_ids": ["Scope.saved_scope", "Scope.class_scope", "Scope.current_full_target", "Scope", "Scope.current_module_id", "Scope.current_type_name", "Scope.current_function_name", "Scope.enter_class", "Scope.enter_function", "Scope.leave", "Scope.current_target", "docstring", "Scope.save", "Scope.function_scope", "Scope.enter_file", "Scope.__init__"], "tokens": 858}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Track current scope to easily calculate the corresponding fine-grained target.\n\nTODO: Use everywhere where we track targets, including in mypy.errors.\n\"\"\"\n\nfrom contextlib import contextmanager\nfrom typing import List, Optional, Iterator, Tuple\n\nfrom mypy.nodes import TypeInfo, FuncBase\n\n\nSavedScope = Tuple[str, Optional[TypeInfo], Optional[FuncBase]]\n\n\nclass Scope:\n \"\"\"Track which target we are processing at any given time.\"\"\"\n\n def __init__(self) -> None:\n self.module = None # type: Optional[str]\n self.classes = [] # type: List[TypeInfo]\n self.function = None # type: Optional[FuncBase]\n # Number of nested scopes ignored (that don't get their own separate targets)\n self.ignored = 0\n\n def current_module_id(self) -> str:\n assert self.module\n return self.module\n\n def current_target(self) -> str:\n \"\"\"Return the current target (non-class; for a class return enclosing module).\"\"\"\n assert self.module\n if self.function:\n fullname = self.function.fullname\n return fullname or ''\n return self.module\n\n def current_full_target(self) -> str:\n \"\"\"Return the current target (may be a class).\"\"\"\n assert self.module\n if self.function:\n return self.function.fullname\n if self.classes:\n return self.classes[-1].fullname\n return self.module\n\n def current_type_name(self) -> Optional[str]:\n \"\"\"Return the current type's short name if it exists\"\"\"\n return self.classes[-1].name if self.classes else None\n\n def current_function_name(self) -> Optional[str]:\n \"\"\"Return the current function's short name if it exists\"\"\"\n return self.function.name if self.function else None\n\n def enter_file(self, prefix: str) -> None:\n self.module = prefix\n self.classes = []\n self.function = None\n self.ignored = 0\n\n def enter_function(self, fdef: FuncBase) -> None:\n if not self.function:\n self.function = fdef\n else:\n # Nested functions are part of the topmost function target.\n self.ignored += 1\n\n def enter_class(self, info: TypeInfo) -> None:\n \"\"\"Enter a class target scope.\"\"\"\n if not self.function:\n self.classes.append(info)\n else:\n # Classes within functions are part of the enclosing function target.\n self.ignored += 1\n\n def leave(self) -> None:\n \"\"\"Leave the innermost scope (can be any kind of scope).\"\"\"\n if self.ignored:\n # Leave a scope that's included in the enclosing target.\n self.ignored -= 1\n elif self.function:\n # Function is always the innermost target.\n self.function = None\n elif self.classes:\n # Leave the innermost class.\n self.classes.pop()\n else:\n # Leave module.\n assert self.module\n self.module = None\n\n def save(self) -> SavedScope:\n \"\"\"Produce a saved scope that can be entered with saved_scope()\"\"\"\n assert self.module\n # We only save the innermost class, which is sufficient since\n # the rest are only needed for when classes are left.\n cls = self.classes[-1] if self.classes else None\n return (self.module, cls, self.function)\n\n @contextmanager\n def function_scope(self, fdef: FuncBase) -> Iterator[None]:\n self.enter_function(fdef)\n yield\n self.leave()\n\n @contextmanager\n def class_scope(self, info: TypeInfo) -> Iterator[None]:\n self.enter_class(info)\n yield\n self.leave()\n\n @contextmanager\n def saved_scope(self, saved: SavedScope) -> Iterator[None]:\n module, info, function = saved\n self.enter_file(module)\n if info:\n self.enter_class(info)\n if function:\n self.enter_function(function)\n yield\n if function:\n self.leave()\n if info:\n self.leave()\n self.leave()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py__The_semantic_analyzer__from_typing_extensions_im": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py__The_semantic_analyzer__from_typing_extensions_im", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 56, "span_ids": ["docstring"], "tokens": 477}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"The semantic analyzer.\n\nBind names to definitions and do various other simple consistency\nchecks. Populate symbol tables. The semantic analyzer also detects\nspecial forms which reuse generic syntax such as NamedTuple and\ncast(). Multiple analysis iterations may be needed to analyze forward\nreferences and import cycles. Each iteration \"fills in\" additional\nbindings and references until everything has been bound.\n\nFor example, consider this program:\n\n x = 1\n y = x\n\nHere semantic analysis would detect that the assignment 'x = 1'\ndefines a new variable, the type of which is to be inferred (in a\nlater pass; type inference or type checking is not part of semantic\nanalysis). Also, it would bind both references to 'x' to the same\nmodule-level variable (Var) node. The second assignment would also\nbe analyzed, and the type of 'y' marked as being inferred.\n\nSemantic analysis of types is implemented in typeanal.py.\n\nSee semanal_main.py for the top-level logic.\n\nSome important properties:\n\n* After semantic analysis is complete, no PlaceholderNode and\n PlaceholderType instances should remain. During semantic analysis,\n if we encounter one of these, the current target should be deferred.\n\n* A TypeInfo is only created once we know certain basic information about\n a type, such as the MRO, existence of a Tuple base class (e.g., for named\n tuples), and whether we have a TypedDict. We use a temporary\n PlaceholderNode node in the symbol table if some such information is\n missing.\n\n* For assignments, we only add a non-placeholder symbol table entry once\n we know the sort of thing being defined (variable, NamedTuple, type alias,\n etc.).\n\n* Every part of the analysis step must support multiple iterations over\n the same AST nodes, and each iteration must be able to fill in arbitrary\n things that were missing or incomplete in previous iterations.\n\n* Changes performed by the analysis need to be reversible, since mypy\n daemon strips and reuses existing ASTs (to improve performance and/or\n reduce memory use).\n\"\"\"\n\nfrom contextlib import contextmanager\n\nfrom typing import (\n List, Dict, Set, Tuple, cast, TypeVar, Union, Optional, Callable, Iterator, Iterable\n)\nfrom typing_extensions import Final", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_from_mypy_nodes_import__from_mypy_semanal_namedtu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_from_mypy_nodes_import__from_mypy_semanal_namedtu", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 58, "end_line": 114, "span_ids": ["imports:4", "imports:12"], "tokens": 758}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from mypy.nodes import (\n MypyFile, TypeInfo, Node, AssignmentStmt, FuncDef, OverloadedFuncDef,\n ClassDef, Var, GDEF, FuncItem, Import, Expression, Lvalue,\n ImportFrom, ImportAll, Block, LDEF, NameExpr, MemberExpr,\n IndexExpr, TupleExpr, ListExpr, ExpressionStmt, ReturnStmt,\n RaiseStmt, AssertStmt, OperatorAssignmentStmt, WhileStmt,\n ForStmt, BreakStmt, ContinueStmt, IfStmt, TryStmt, WithStmt, DelStmt,\n GlobalDecl, SuperExpr, DictExpr, CallExpr, RefExpr, OpExpr, UnaryExpr,\n SliceExpr, CastExpr, RevealExpr, TypeApplication, Context, SymbolTable,\n SymbolTableNode, ListComprehension, GeneratorExpr,\n LambdaExpr, MDEF, Decorator, SetExpr, TypeVarExpr,\n StrExpr, BytesExpr, PrintStmt, ConditionalExpr, PromoteExpr,\n ComparisonExpr, StarExpr, ARG_POS, ARG_NAMED, type_aliases,\n YieldFromExpr, NamedTupleExpr, NonlocalDecl, SymbolNode,\n SetComprehension, DictionaryComprehension, TypeAlias, TypeAliasExpr,\n YieldExpr, ExecStmt, BackquoteExpr, ImportBase, AwaitExpr,\n IntExpr, FloatExpr, UnicodeExpr, TempNode, OverloadPart,\n PlaceholderNode, COVARIANT, CONTRAVARIANT, INVARIANT,\n get_nongen_builtins, get_member_expr_fullname, REVEAL_TYPE,\n REVEAL_LOCALS, is_final_node, TypedDictExpr, type_aliases_source_versions,\n EnumCallExpr, RUNTIME_PROTOCOL_DECOS, FakeExpression, Statement, AssignmentExpr,\n ParamSpecExpr\n)\nfrom mypy.tvar_scope import TypeVarLikeScope\nfrom mypy.typevars import fill_typevars\nfrom mypy.visitor import NodeVisitor\nfrom mypy.errors import Errors, report_internal_error\nfrom mypy.messages import (\n best_matches, MessageBuilder, pretty_seq, SUGGESTED_TEST_FIXTURES, TYPES_FOR_UNIMPORTED_HINTS\n)\nfrom mypy.errorcodes import ErrorCode\nfrom mypy import message_registry, errorcodes as codes\nfrom mypy.types import (\n FunctionLike, UnboundType, TypeVarDef, TupleType, UnionType, StarType,\n CallableType, Overloaded, Instance, Type, AnyType, LiteralType, LiteralValue,\n TypeTranslator, TypeOfAny, TypeType, NoneType, PlaceholderType, TPDICT_NAMES, ProperType,\n get_proper_type, get_proper_types, TypeAliasType)\nfrom mypy.typeops import function_type\nfrom mypy.type_visitor import TypeQuery\nfrom mypy.nodes import implicit_module_attrs\nfrom mypy.typeanal import (\n TypeAnalyser, analyze_type_alias, no_subscript_builtin_alias,\n TypeVarLikeQuery, TypeVarLikeList, remove_dups, has_any_from_unimported_type,\n check_for_explicit_any, type_constructors, fix_instance_types\n)\nfrom mypy.exprtotype import expr_to_unanalyzed_type, TypeTranslationError\nfrom mypy.options import Options\nfrom mypy.plugin import (\n Plugin, ClassDefContext, SemanticAnalyzerPluginInterface,\n DynamicClassDefContext\n)\nfrom mypy.util import correct_relative_import, unmangle, module_prefix, is_typeshed_file\nfrom mypy.scope import Scope\nfrom mypy.semanal_shared import (\n SemanticAnalyzerInterface, set_callable_name, calculate_tuple_fallback, PRIORITY_FALLBACKS\n)\nfrom mypy.semanal_namedtuple import NamedTupleAnalyzer", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_from_mypy_semanal_typeddi_Tag.int": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_from_mypy_semanal_typeddi_Tag.int", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 115, "end_line": 147, "span_ids": ["imports:12", "impl:5"], "tokens": 282}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from mypy.semanal_typeddict import TypedDictAnalyzer\nfrom mypy.semanal_enum import EnumCallAnalyzer\nfrom mypy.semanal_newtype import NewTypeAnalyzer\nfrom mypy.reachability import (\n infer_reachability_of_if_statement, infer_condition_value, ALWAYS_FALSE, ALWAYS_TRUE,\n MYPY_TRUE, MYPY_FALSE\n)\nfrom mypy.mro import calculate_mro, MroError\n\nT = TypeVar('T')\n\n\nFUTURE_IMPORTS = {\n '__future__.nested_scopes': 'nested_scopes',\n '__future__.generators': 'generators',\n '__future__.division': 'division',\n '__future__.absolute_import': 'absolute_import',\n '__future__.with_statement': 'with_statement',\n '__future__.print_function': 'print_function',\n '__future__.unicode_literals': 'unicode_literals',\n '__future__.barry_as_FLUFL': 'barry_as_FLUFL',\n '__future__.generator_stop': 'generator_stop',\n '__future__.annotations': 'annotations',\n} # type: Final\n\n\n# Special cased built-in classes that are needed for basic functionality and need to be\n# available very early on.\nCORE_BUILTIN_CLASSES = ['object', 'bool', 'function'] # type: Final\n\n\n# Used for tracking incomplete references\nTag = int", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer_SemanticAnalyzer._type_Optional_Statemen": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer_SemanticAnalyzer._type_Optional_Statemen", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 150, "end_line": 216, "span_ids": ["SemanticAnalyzer"], "tokens": 853}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n \"\"\"Semantically analyze parsed mypy files.\n\n The analyzer binds names and does various consistency checks for an\n AST. Note that type checking is performed as a separate pass.\n \"\"\"\n\n # Module name space\n modules = None # type: Dict[str, MypyFile]\n # Global name space for current module\n globals = None # type: SymbolTable\n # Names declared using \"global\" (separate set for each scope)\n global_decls = None # type: List[Set[str]]\n # Names declated using \"nonlocal\" (separate set for each scope)\n nonlocal_decls = None # type: List[Set[str]]\n # Local names of function scopes; None for non-function scopes.\n locals = None # type: List[Optional[SymbolTable]]\n # Whether each scope is a comprehension scope.\n is_comprehension_stack = None # type: List[bool]\n # Nested block depths of scopes\n block_depth = None # type: List[int]\n # TypeInfo of directly enclosing class (or None)\n type = None # type: Optional[TypeInfo]\n # Stack of outer classes (the second tuple item contains tvars).\n type_stack = None # type: List[Optional[TypeInfo]]\n # Type variables bound by the current scope, be it class or function\n tvar_scope = None # type: TypeVarLikeScope\n # Per-module options\n options = None # type: Options\n\n # Stack of functions being analyzed\n function_stack = None # type: List[FuncItem]\n\n # Set to True if semantic analysis defines a name, or replaces a\n # placeholder definition. If some iteration makes no progress,\n # there can be at most one additional final iteration (see below).\n progress = False\n deferred = False # Set to true if another analysis pass is needed\n incomplete = False # Set to true if current module namespace is missing things\n # Is this the final iteration of semantic analysis (where we report\n # unbound names due to cyclic definitions and should not defer)?\n _final_iteration = False\n # These names couldn't be added to the symbol table due to incomplete deps.\n # Note that missing names are per module, _not_ per namespace. This means that e.g.\n # a missing name at global scope will block adding same name at a class scope.\n # This should not affect correctness and is purely a performance issue,\n # since it can cause unnecessary deferrals. These are represented as\n # PlaceholderNodes in the symbol table. We use this to ensure that the first\n # definition takes precedence even if it's incomplete.\n #\n # Note that a star import adds a special name '*' to the set, this blocks\n # adding _any_ names in the current file.\n missing_names = None # type: List[Set[str]]\n # Callbacks that will be called after semantic analysis to tweak things.\n patches = None # type: List[Tuple[int, Callable[[], None]]]\n loop_depth = 0 # Depth of breakable loops\n cur_mod_id = '' # Current module id (or None) (phase 2)\n _is_stub_file = False # Are we analyzing a stub file?\n _is_typeshed_stub_file = False # Are we analyzing a typeshed stub file?\n imports = None # type: Set[str] # Imported modules (during phase 2 analysis)\n # Note: some imports (and therefore dependencies) might\n # not be found in phase 1, for example due to * imports.\n errors = None # type: Errors # Keeps track of generated errors\n plugin = None # type: Plugin # Mypy plugin for special casing of library features\n statement = None # type: Optional[Statement] # Statement/definition being analyzed", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.future_import_flags_SemanticAnalyzer.None_65": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.future_import_flags_SemanticAnalyzer.None_65", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 217, "end_line": 297, "span_ids": ["SemanticAnalyzer.is_typeshed_stub_file", "SemanticAnalyzer.final_iteration", "SemanticAnalyzer", "SemanticAnalyzer.is_stub_file", "SemanticAnalyzer.__init__"], "tokens": 794}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n future_import_flags = None # type: Set[str]\n\n # Mapping from 'async def' function definitions to their return type wrapped as a\n # 'Coroutine[Any, Any, T]'. Used to keep track of whether a function definition's\n # return type has already been wrapped, by checking if the function definition's\n # type is stored in this mapping and that it still matches.\n wrapped_coro_return_types = {} # type: Dict[FuncDef, Type]\n\n def __init__(self,\n modules: Dict[str, MypyFile],\n missing_modules: Set[str],\n incomplete_namespaces: Set[str],\n errors: Errors,\n plugin: Plugin) -> None:\n \"\"\"Construct semantic analyzer.\n\n We reuse the same semantic analyzer instance across multiple modules.\n\n Args:\n modules: Global modules dictionary\n missing_modules: Modules that could not be imported encountered so far\n incomplete_namespaces: Namespaces that are being populated during semantic analysis\n (can contain modules and classes within the current SCC; mutated by the caller)\n errors: Report analysis errors using this instance\n \"\"\"\n self.locals = [None]\n self.is_comprehension_stack = [False]\n # Saved namespaces from previous iteration. Every top-level function/method body is\n # analyzed in several iterations until all names are resolved. We need to save\n # the local namespaces for the top level function and all nested functions between\n # these iterations. See also semanal_main.process_top_level_function().\n self.saved_locals = {} \\\n # type: Dict[Union[FuncItem, GeneratorExpr, DictionaryComprehension], SymbolTable]\n self.imports = set()\n self.type = None\n self.type_stack = []\n self.tvar_scope = TypeVarLikeScope()\n self.function_stack = []\n self.block_depth = [0]\n self.loop_depth = 0\n self.errors = errors\n self.modules = modules\n self.msg = MessageBuilder(errors, modules)\n self.missing_modules = missing_modules\n self.missing_names = [set()]\n # These namespaces are still in process of being populated. If we encounter a\n # missing name in these namespaces, we need to defer the current analysis target,\n # since it's possible that the name will be there once the namespace is complete.\n self.incomplete_namespaces = incomplete_namespaces\n self.all_exports = [] # type: List[str]\n # Map from module id to list of explicitly exported names (i.e. names in __all__).\n self.export_map = {} # type: Dict[str, List[str]]\n self.plugin = plugin\n # If True, process function definitions. If False, don't. This is used\n # for processing module top levels in fine-grained incremental mode.\n self.recurse_into_functions = True\n self.scope = Scope()\n\n # Trace line numbers for every file where deferral happened during analysis of\n # current SCC or top-level function.\n self.deferral_debug_context = [] # type: List[Tuple[str, int]]\n\n self.future_import_flags = set() # type: Set[str]\n\n # mypyc doesn't properly handle implementing an abstractproperty\n # with a regular attribute so we make them properties\n @property\n def is_stub_file(self) -> bool:\n return self._is_stub_file\n\n @property\n def is_typeshed_stub_file(self) -> bool:\n return self._is_typeshed_stub_file\n\n @property\n def final_iteration(self) -> bool:\n return self._final_iteration\n\n #\n # Preparing module (performed before semantic analysis)\n #", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.prepare_file_SemanticAnalyzer.prepare_typing_namespace._builtins_typing_import_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.prepare_file_SemanticAnalyzer.prepare_typing_namespace._builtins_typing_import_", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 295, "end_line": 316, "span_ids": ["SemanticAnalyzer.prepare_file", "SemanticAnalyzer.prepare_typing_namespace"], "tokens": 275}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def prepare_file(self, file_node: MypyFile) -> None:\n \"\"\"Prepare a freshly parsed file for semantic analysis.\"\"\"\n if 'builtins' in self.modules:\n file_node.names['__builtins__'] = SymbolTableNode(GDEF,\n self.modules['builtins'])\n if file_node.fullname == 'builtins':\n self.prepare_builtins_namespace(file_node)\n if file_node.fullname == 'typing':\n self.prepare_typing_namespace(file_node)\n\n def prepare_typing_namespace(self, file_node: MypyFile) -> None:\n \"\"\"Remove dummy alias definitions such as List = TypeAlias(object) from typing.\n\n They will be replaced with real aliases when corresponding targets are ready.\n \"\"\"\n # This is all pretty unfortunate. typeshed now has a\n # sys.version_info check for OrderedDict, and we shouldn't\n # take it out, because it is correct and a typechecker should\n # use that as a source of truth. But instead we rummage\n # through IfStmts to remove the info first. (I tried to\n # remove this whole machinery and ran into issues with the\n # builtins/typing import cycle.)\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.prepare_typing_namespace.helper_SemanticAnalyzer.prepare_typing_namespace.helper_file_node_defs_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.prepare_typing_namespace.helper_SemanticAnalyzer.prepare_typing_namespace.helper_file_node_defs_", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 317, "end_line": 330, "span_ids": ["SemanticAnalyzer.prepare_typing_namespace"], "tokens": 170}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def prepare_typing_namespace(self, file_node: MypyFile) -> None:\n def helper(defs: List[Statement]) -> None:\n for stmt in defs.copy():\n if isinstance(stmt, IfStmt):\n for body in stmt.body:\n helper(body.body)\n if stmt.else_body:\n helper(stmt.else_body.body)\n if (isinstance(stmt, AssignmentStmt) and len(stmt.lvalues) == 1 and\n isinstance(stmt.lvalues[0], NameExpr)):\n # Assignment to a simple name, remove it if it is a dummy alias.\n if 'typing.' + stmt.lvalues[0].name in type_aliases:\n defs.remove(stmt)\n\n helper(file_node.defs)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.prepare_builtins_namespace_SemanticAnalyzer.prepare_builtins_namespace.for_name_typ_in_special_.file_node_names_name_S": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.prepare_builtins_namespace_SemanticAnalyzer.prepare_builtins_namespace.for_name_typ_in_special_.file_node_names_name_S", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 332, "end_line": 368, "span_ids": ["SemanticAnalyzer.prepare_builtins_namespace"], "tokens": 375}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def prepare_builtins_namespace(self, file_node: MypyFile) -> None:\n \"\"\"Add certain special-cased definitions to the builtins module.\n\n Some definitions are too special or fundamental to be processed\n normally from the AST.\n \"\"\"\n names = file_node.names\n\n # Add empty definition for core built-in classes, since they are required for basic\n # operation. These will be completed later on.\n for name in CORE_BUILTIN_CLASSES:\n cdef = ClassDef(name, Block([])) # Dummy ClassDef, will be replaced later\n info = TypeInfo(SymbolTable(), cdef, 'builtins')\n info._fullname = 'builtins.%s' % name\n names[name] = SymbolTableNode(GDEF, info)\n\n bool_info = names['bool'].node\n assert isinstance(bool_info, TypeInfo)\n bool_type = Instance(bool_info, [])\n\n special_var_types = [\n ('None', NoneType()),\n # reveal_type is a mypy-only function that gives an error with\n # the type of its arg.\n ('reveal_type', AnyType(TypeOfAny.special_form)),\n # reveal_locals is a mypy-only function that gives an error with the types of\n # locals\n ('reveal_locals', AnyType(TypeOfAny.special_form)),\n ('True', bool_type),\n ('False', bool_type),\n ('__debug__', bool_type),\n ] # type: List[Tuple[str, Type]]\n\n for name, typ in special_var_types:\n v = Var(name, typ)\n v._fullname = 'builtins.%s' % name\n file_node.names[name] = SymbolTableNode(GDEF, v)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.None_66_SemanticAnalyzer.refresh_top_level.self.all_exports._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.None_66_SemanticAnalyzer.refresh_top_level.self.all_exports._", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 370, "end_line": 406, "span_ids": ["SemanticAnalyzer.prepare_builtins_namespace", "SemanticAnalyzer.refresh_top_level", "SemanticAnalyzer.refresh_partial"], "tokens": 317}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n #\n # Analyzing a target\n #\n\n def refresh_partial(self,\n node: Union[MypyFile, FuncDef, OverloadedFuncDef],\n patches: List[Tuple[int, Callable[[], None]]],\n final_iteration: bool,\n file_node: MypyFile,\n options: Options,\n active_type: Optional[TypeInfo] = None) -> None:\n \"\"\"Refresh a stale target in fine-grained incremental mode.\"\"\"\n self.patches = patches\n self.deferred = False\n self.incomplete = False\n self._final_iteration = final_iteration\n self.missing_names[-1] = set()\n\n with self.file_context(file_node, options, active_type):\n if isinstance(node, MypyFile):\n self.refresh_top_level(node)\n else:\n self.recurse_into_functions = True\n self.accept(node)\n del self.patches\n\n def refresh_top_level(self, file_node: MypyFile) -> None:\n \"\"\"Reanalyze a stale module top-level in fine-grained incremental mode.\"\"\"\n self.recurse_into_functions = False\n self.add_implicit_module_attrs(file_node)\n for d in file_node.defs:\n self.accept(d)\n if file_node.fullname == 'typing':\n self.add_builtin_aliases(file_node)\n self.adjust_public_exports()\n self.export_map[self.cur_mod_id] = self.all_exports\n self.all_exports = []", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.add_implicit_module_attrs_SemanticAnalyzer.add_implicit_module_attrs.for_name_t_in_implicit_m.if_an_type_.else_.self_add_symbol_name_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.add_implicit_module_attrs_SemanticAnalyzer.add_implicit_module_attrs.for_name_t_in_implicit_m.if_an_type_.else_.self_add_symbol_name_", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 408, "end_line": 436, "span_ids": ["SemanticAnalyzer.add_implicit_module_attrs"], "tokens": 284}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def add_implicit_module_attrs(self, file_node: MypyFile) -> None:\n \"\"\"Manually add implicit definitions of module '__name__' etc.\"\"\"\n for name, t in implicit_module_attrs.items():\n # unicode docstrings should be accepted in Python 2\n if name == '__doc__':\n if self.options.python_version >= (3, 0):\n typ = UnboundType('__builtins__.str') # type: Type\n else:\n typ = UnionType([UnboundType('__builtins__.str'),\n UnboundType('__builtins__.unicode')])\n else:\n assert t is not None, 'type should be specified for {}'.format(name)\n typ = UnboundType(t)\n\n existing = file_node.names.get(name)\n if existing is not None and not isinstance(existing.node, PlaceholderNode):\n # Already exists.\n continue\n\n an_type = self.anal_type(typ)\n if an_type:\n var = Var(name, an_type)\n var._fullname = self.qualified_name(name)\n var.is_ready = True\n self.add_symbol(name, var, dummy_context())\n else:\n self.add_symbol(name,\n PlaceholderNode(self.qualified_name(name), file_node, -1),\n dummy_context())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.add_builtin_aliases_SemanticAnalyzer.add_builtin_aliases.for_alias_target_name_in.if_n_.else_.if_name_in_tree_names_.del_tree_names_name_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.add_builtin_aliases_SemanticAnalyzer.add_builtin_aliases.for_alias_target_name_in.if_n_.else_.if_name_in_tree_names_.del_tree_names_name_", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 442, "end_line": 481, "span_ids": ["SemanticAnalyzer.add_builtin_aliases"], "tokens": 425}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def add_builtin_aliases(self, tree: MypyFile) -> None:\n \"\"\"Add builtin type aliases to typing module.\n\n For historical reasons, the aliases like `List = list` are not defined\n in typeshed stubs for typing module. Instead we need to manually add the\n corresponding nodes on the fly. We explicitly mark these aliases as normalized,\n so that a user can write `typing.List[int]`.\n \"\"\"\n assert tree.fullname == 'typing'\n for alias, target_name in type_aliases.items():\n if type_aliases_source_versions[alias] > self.options.python_version:\n # This alias is not available on this Python version.\n continue\n name = alias.split('.')[-1]\n if name in tree.names and not isinstance(tree.names[name].node, PlaceholderNode):\n continue\n tag = self.track_incomplete_refs()\n n = self.lookup_fully_qualified_or_none(target_name)\n if n:\n if isinstance(n.node, PlaceholderNode):\n self.mark_incomplete(name, tree)\n else:\n # Found built-in class target. Create alias.\n target = self.named_type_or_none(target_name, [])\n assert target is not None\n # Transform List to List[Any], etc.\n fix_instance_types(target, self.fail, self.note, self.options.python_version)\n alias_node = TypeAlias(target, alias,\n line=-1, column=-1, # there is no context\n no_args=True, normalized=True)\n self.add_symbol(name, alias_node, tree)\n elif self.found_incomplete_ref(tag):\n # Built-in class target may not ready yet -- defer.\n self.mark_incomplete(name, tree)\n else:\n # Test fixtures may be missing some builtin classes, which is okay.\n # Kill the placeholder if there is one.\n if name in tree.names:\n assert isinstance(tree.names[name].node, PlaceholderNode)\n del tree.names[name]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.adjust_public_exports_SemanticAnalyzer.adjust_public_exports.if___all___in_self_glob.for_name_g_in_self_globa.if_name_in_self_all_expor.else_.g.module_public.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.adjust_public_exports_SemanticAnalyzer.adjust_public_exports.if___all___in_self_glob.for_name_g_in_self_globa.if_name_in_self_all_expor.else_.g.module_public.False", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 479, "end_line": 490, "span_ids": ["SemanticAnalyzer.adjust_public_exports"], "tokens": 136}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def adjust_public_exports(self) -> None:\n \"\"\"Adjust the module visibility of globals due to __all__.\"\"\"\n if '__all__' in self.globals:\n for name, g in self.globals.items():\n # Being included in __all__ explicitly exports and makes public.\n if name in self.all_exports:\n g.module_public = True\n g.module_hidden = False\n # But when __all__ is defined, and a symbol is not included in it,\n # it cannot be public.\n else:\n g.module_public = False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.file_context_SemanticAnalyzer.file_context.del_self_options": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.file_context_SemanticAnalyzer.file_context.del_self_options", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 496, "end_line": 541, "span_ids": ["SemanticAnalyzer.file_context"], "tokens": 388}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n @contextmanager\n def file_context(self,\n file_node: MypyFile,\n options: Options,\n active_type: Optional[TypeInfo] = None) -> Iterator[None]:\n \"\"\"Configure analyzer for analyzing targets within a file/class.\n\n Args:\n file_node: target file\n options: options specific to the file\n active_type: must be the surrounding class to analyze method targets\n \"\"\"\n scope = self.scope\n self.options = options\n self.errors.set_file(file_node.path, file_node.fullname, scope=scope)\n self.cur_mod_node = file_node\n self.cur_mod_id = file_node.fullname\n scope.enter_file(self.cur_mod_id)\n self._is_stub_file = file_node.path.lower().endswith('.pyi')\n self._is_typeshed_stub_file = is_typeshed_file(file_node.path)\n self.globals = file_node.names\n self.tvar_scope = TypeVarLikeScope()\n\n self.named_tuple_analyzer = NamedTupleAnalyzer(options, self)\n self.typed_dict_analyzer = TypedDictAnalyzer(options, self, self.msg)\n self.enum_call_analyzer = EnumCallAnalyzer(options, self)\n self.newtype_analyzer = NewTypeAnalyzer(options, self, self.msg)\n\n # Counter that keeps track of references to undefined things potentially caused by\n # incomplete namespaces.\n self.num_incomplete_refs = 0\n\n if active_type:\n scope.enter_class(active_type)\n self.enter_class(active_type.defn.info)\n for tvar in active_type.defn.type_vars:\n self.tvar_scope.bind_existing(tvar)\n\n yield\n\n if active_type:\n scope.leave()\n self.leave_class()\n self.type = None\n scope.leave()\n del self.options", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.None_69_SemanticAnalyzer.visit_func_def.with_self_scope_function_.self_analyze_func_def_def": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.None_69_SemanticAnalyzer.visit_func_def.with_self_scope_function_.self_analyze_func_def_def", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 539, "end_line": 569, "span_ids": ["SemanticAnalyzer.visit_func_def", "SemanticAnalyzer.file_context"], "tokens": 274}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n #\n # Functions\n #\n\n def visit_func_def(self, defn: FuncDef) -> None:\n self.statement = defn\n\n # Visit default values because they may contain assignment expressions.\n for arg in defn.arguments:\n if arg.initializer:\n arg.initializer.accept(self)\n\n defn.is_conditional = self.block_depth[-1] > 0\n\n # Set full names even for those definitions that aren't added\n # to a symbol table. For example, for overload items.\n defn._fullname = self.qualified_name(defn.name)\n\n # We don't add module top-level functions to symbol tables\n # when we analyze their bodies in the second phase on analysis,\n # since they were added in the first phase. Nested functions\n # get always added, since they aren't separate targets.\n if not self.recurse_into_functions or len(self.function_stack) > 0:\n if not defn.is_decorated and not defn.is_overload:\n self.add_function_to_symbol_table(defn)\n\n if not self.recurse_into_functions:\n return\n\n with self.scope.function_scope(defn):\n self.analyze_func_def(defn)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_func_def_SemanticAnalyzer.analyze_func_def.if_defn_is_coroutine_and.if_defn_is_async_generato.else_.self_wrapped_coro_return_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_func_def_SemanticAnalyzer.analyze_func_def.if_defn_is_coroutine_and.if_defn_is_async_generato.else_.self_wrapped_coro_return_", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 571, "end_line": 627, "span_ids": ["SemanticAnalyzer.analyze_func_def"], "tokens": 592}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def analyze_func_def(self, defn: FuncDef) -> None:\n self.function_stack.append(defn)\n\n if defn.type:\n assert isinstance(defn.type, CallableType)\n self.update_function_type_variables(defn.type, defn)\n self.function_stack.pop()\n\n if self.is_class_scope():\n # Method definition\n assert self.type is not None\n defn.info = self.type\n if defn.type is not None and defn.name in ('__init__', '__init_subclass__'):\n assert isinstance(defn.type, CallableType)\n if isinstance(get_proper_type(defn.type.ret_type), AnyType):\n defn.type = defn.type.copy_modified(ret_type=NoneType())\n self.prepare_method_signature(defn, self.type)\n\n # Analyze function signature\n with self.tvar_scope_frame(self.tvar_scope.method_frame()):\n if defn.type:\n self.check_classvar_in_signature(defn.type)\n assert isinstance(defn.type, CallableType)\n # Signature must be analyzed in the surrounding scope so that\n # class-level imported names and type variables are in scope.\n analyzer = self.type_analyzer()\n tag = self.track_incomplete_refs()\n result = analyzer.visit_callable_type(defn.type, nested=False)\n # Don't store not ready types (including placeholders).\n if self.found_incomplete_ref(tag) or has_placeholder(result):\n self.defer(defn)\n return\n assert isinstance(result, ProperType)\n defn.type = result\n self.add_type_alias_deps(analyzer.aliases_used)\n self.check_function_signature(defn)\n if isinstance(defn, FuncDef):\n assert isinstance(defn.type, CallableType)\n defn.type = set_callable_name(defn.type, defn)\n\n self.analyze_arg_initializers(defn)\n self.analyze_function_body(defn)\n if (defn.is_coroutine and\n isinstance(defn.type, CallableType) and\n self.wrapped_coro_return_types.get(defn) != defn.type):\n if defn.is_async_generator:\n # Async generator types are handled elsewhere\n pass\n else:\n # A coroutine defined as `async def foo(...) -> T: ...`\n # has external return type `Coroutine[Any, Any, T]`.\n any_type = AnyType(TypeOfAny.special_form)\n ret_type = self.named_type_or_none('typing.Coroutine',\n [any_type, any_type, defn.type.ret_type])\n assert ret_type is not None, \"Internal error: typing.Coroutine not found\"\n defn.type = defn.type.copy_modified(ret_type=ret_type)\n self.wrapped_coro_return_types[defn] = defn.type", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.prepare_method_signature_SemanticAnalyzer.prepare_method_signature.if_not_func_is_static_.if_not_func_arguments_.elif_isinstance_functype_.if_isinstance_self_type_.func.type.replace_implicit_first_ty": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.prepare_method_signature_SemanticAnalyzer.prepare_method_signature.if_not_func_is_static_.if_not_func_arguments_.elif_isinstance_functype_.if_isinstance_self_type_.func.type.replace_implicit_first_ty", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 629, "end_line": 644, "span_ids": ["SemanticAnalyzer.prepare_method_signature"], "tokens": 206}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def prepare_method_signature(self, func: FuncDef, info: TypeInfo) -> None:\n \"\"\"Check basic signature validity and tweak annotation of self/cls argument.\"\"\"\n # Only non-static methods are special.\n functype = func.type\n if not func.is_static:\n if func.name in ['__init_subclass__', '__class_getitem__']:\n func.is_class = True\n if not func.arguments:\n self.fail('Method must have at least one argument', func)\n elif isinstance(functype, CallableType):\n self_type = get_proper_type(functype.arg_types[0])\n if isinstance(self_type, AnyType):\n leading_type = fill_typevars(info) # type: Type\n if func.is_class or func.name == '__new__':\n leading_type = self.class_type(leading_type)\n func.type = replace_implicit_first_type(functype, leading_type)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.set_original_def_SemanticAnalyzer.set_original_def.if_isinstance_previous_.else_.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.set_original_def_SemanticAnalyzer.set_original_def.if_isinstance_previous_.else_.return.False", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 646, "end_line": 661, "span_ids": ["SemanticAnalyzer.set_original_def"], "tokens": 159}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def set_original_def(self, previous: Optional[Node], new: Union[FuncDef, Decorator]) -> bool:\n \"\"\"If 'new' conditionally redefine 'previous', set 'previous' as original\n\n We reject straight redefinitions of functions, as they are usually\n a programming error. For example:\n\n def f(): ...\n def f(): ... # Error: 'f' redefined\n \"\"\"\n if isinstance(new, Decorator):\n new = new.func\n if isinstance(previous, (FuncDef, Var, Decorator)) and new.is_conditional:\n new.original_def = previous\n return True\n else:\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.update_function_type_variables_SemanticAnalyzer.visit_overloaded_func_def.with_self_scope_function_.self_analyze_overloaded_f": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.update_function_type_variables_SemanticAnalyzer.visit_overloaded_func_def.with_self_scope_function_.self_analyze_overloaded_f", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 663, "end_line": 685, "span_ids": ["SemanticAnalyzer.update_function_type_variables", "SemanticAnalyzer.visit_overloaded_func_def"], "tokens": 240}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def update_function_type_variables(self, fun_type: CallableType, defn: FuncItem) -> None:\n \"\"\"Make any type variables in the signature of defn explicit.\n\n Update the signature of defn to contain type variable definitions\n if defn is generic.\n \"\"\"\n with self.tvar_scope_frame(self.tvar_scope.method_frame()):\n a = self.type_analyzer()\n fun_type.variables = a.bind_function_type_variables(fun_type, defn)\n\n def visit_overloaded_func_def(self, defn: OverloadedFuncDef) -> None:\n self.statement = defn\n self.add_function_to_symbol_table(defn)\n\n if not self.recurse_into_functions:\n return\n\n # NB: Since _visit_overloaded_func_def will call accept on the\n # underlying FuncDefs, the function might get entered twice.\n # This is fine, though, because only the outermost function is\n # used to compute targets.\n with self.scope.function_scope(defn):\n self.analyze_overloaded_func_def(defn)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_overloaded_func_def_SemanticAnalyzer.analyze_overloaded_func_def.self_process_static_or_cl": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_overloaded_func_def_SemanticAnalyzer.analyze_overloaded_func_def.self_process_static_or_cl", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 687, "end_line": 740, "span_ids": ["SemanticAnalyzer.analyze_overloaded_func_def"], "tokens": 563}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def analyze_overloaded_func_def(self, defn: OverloadedFuncDef) -> None:\n # OverloadedFuncDef refers to any legitimate situation where you have\n # more than one declaration for the same function in a row. This occurs\n # with a @property with a setter or a deleter, and for a classic\n # @overload.\n\n defn._fullname = self.qualified_name(defn.name)\n # TODO: avoid modifying items.\n defn.items = defn.unanalyzed_items.copy()\n\n first_item = defn.items[0]\n first_item.is_overload = True\n first_item.accept(self)\n\n if isinstance(first_item, Decorator) and first_item.func.is_property:\n # This is a property.\n first_item.func.is_overload = True\n self.analyze_property_with_multi_part_definition(defn)\n typ = function_type(first_item.func, self.builtin_type('builtins.function'))\n assert isinstance(typ, CallableType)\n types = [typ]\n else:\n # This is an a normal overload. Find the item signatures, the\n # implementation (if outside a stub), and any missing @overload\n # decorators.\n types, impl, non_overload_indexes = self.analyze_overload_sigs_and_impl(defn)\n defn.impl = impl\n if non_overload_indexes:\n self.handle_missing_overload_decorators(defn, non_overload_indexes,\n some_overload_decorators=len(types) > 0)\n # If we found an implementation, remove it from the overload item list,\n # as it's special.\n if impl is not None:\n assert impl is defn.items[-1]\n defn.items = defn.items[:-1]\n elif not non_overload_indexes:\n self.handle_missing_overload_implementation(defn)\n\n if types:\n defn.type = Overloaded(types)\n defn.type.line = defn.line\n\n if not defn.items:\n # It was not a real overload after all, but function redefinition. We've\n # visited the redefinition(s) already.\n if not defn.impl:\n # For really broken overloads with no items and no implementation we need to keep\n # at least one item to hold basic information like function name.\n defn.impl = defn.unanalyzed_items[-1]\n return\n\n # We know this is an overload def. Infer properties and perform some checks.\n self.process_final_in_overload(defn)\n self.process_static_or_class_method_in_overload(defn)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_overload_sigs_and_impl_SemanticAnalyzer.analyze_overload_sigs_and_impl.return.types_impl_non_overload": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_overload_sigs_and_impl_SemanticAnalyzer.analyze_overload_sigs_and_impl.return.types_impl_non_overload", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 742, "end_line": 782, "span_ids": ["SemanticAnalyzer.analyze_overload_sigs_and_impl"], "tokens": 389}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def analyze_overload_sigs_and_impl(\n self,\n defn: OverloadedFuncDef) -> Tuple[List[CallableType],\n Optional[OverloadPart],\n List[int]]:\n \"\"\"Find overload signatures, the implementation, and items with missing @overload.\n\n Assume that the first was already analyzed. As a side effect:\n analyzes remaining items and updates 'is_overload' flags.\n \"\"\"\n types = []\n non_overload_indexes = []\n impl = None # type: Optional[OverloadPart]\n for i, item in enumerate(defn.items):\n if i != 0:\n # Assume that the first item was already visited\n item.is_overload = True\n item.accept(self)\n # TODO: support decorated overloaded functions properly\n if isinstance(item, Decorator):\n callable = function_type(item.func, self.builtin_type('builtins.function'))\n assert isinstance(callable, CallableType)\n if not any(refers_to_fullname(dec, 'typing.overload')\n for dec in item.decorators):\n if i == len(defn.items) - 1 and not self.is_stub_file:\n # Last item outside a stub is impl\n impl = item\n else:\n # Oops it wasn't an overload after all. A clear error\n # will vary based on where in the list it is, record\n # that.\n non_overload_indexes.append(i)\n else:\n item.func.is_overload = True\n types.append(callable)\n elif isinstance(item, FuncDef):\n if i == len(defn.items) - 1 and not self.is_stub_file:\n impl = item\n else:\n non_overload_indexes.append(i)\n return types, impl, non_overload_indexes", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.handle_missing_overload_decorators_SemanticAnalyzer.handle_missing_overload_decorators.for_idx_in_reversed_non_o.del_defn_items_idx_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.handle_missing_overload_decorators_SemanticAnalyzer.handle_missing_overload_decorators.for_idx_in_reversed_non_o.del_defn_items_idx_", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 784, "end_line": 808, "span_ids": ["SemanticAnalyzer.handle_missing_overload_decorators"], "tokens": 255}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def handle_missing_overload_decorators(self,\n defn: OverloadedFuncDef,\n non_overload_indexes: List[int],\n some_overload_decorators: bool) -> None:\n \"\"\"Generate errors for overload items without @overload.\n\n Side effect: remote non-overload items.\n \"\"\"\n if some_overload_decorators:\n # Some of them were overloads, but not all.\n for idx in non_overload_indexes:\n if self.is_stub_file:\n self.fail(\"An implementation for an overloaded function \"\n \"is not allowed in a stub file\", defn.items[idx])\n else:\n self.fail(\"The implementation for an overloaded function \"\n \"must come last\", defn.items[idx])\n else:\n for idx in non_overload_indexes[1:]:\n self.name_already_defined(defn.name, defn.items[idx], defn.items[0])\n if defn.impl:\n self.name_already_defined(defn.name, defn.impl, defn.items[0])\n # Remove the non-overloads\n for idx in reversed(non_overload_indexes):\n del defn.items[idx]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.handle_missing_overload_implementation_SemanticAnalyzer.handle_missing_overload_implementation.if_not_self_is_stub_file_.if_self_type_and_self_typ.else_.self_fail_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.handle_missing_overload_implementation_SemanticAnalyzer.handle_missing_overload_implementation.if_not_self_is_stub_file_.if_self_type_and_self_typ.else_.self_fail_", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 810, "end_line": 823, "span_ids": ["SemanticAnalyzer.handle_missing_overload_implementation"], "tokens": 150}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def handle_missing_overload_implementation(self, defn: OverloadedFuncDef) -> None:\n \"\"\"Generate error about missing overload implementation (only if needed).\"\"\"\n if not self.is_stub_file:\n if self.type and self.type.is_protocol and not self.is_func_scope():\n # An overloded protocol method doesn't need an implementation.\n for item in defn.items:\n if isinstance(item, Decorator):\n item.func.is_abstract = True\n else:\n item.is_abstract = True\n else:\n self.fail(\n \"An overloaded function outside a stub file must have an implementation\",\n defn)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.process_final_in_overload_SemanticAnalyzer.process_final_in_overload.if_defn_impl_is_not_None_.defn.is_final.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.process_final_in_overload_SemanticAnalyzer.process_final_in_overload.if_defn_impl_is_not_None_.defn.is_final.True", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 825, "end_line": 842, "span_ids": ["SemanticAnalyzer.process_final_in_overload"], "tokens": 258}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def process_final_in_overload(self, defn: OverloadedFuncDef) -> None:\n \"\"\"Detect the @final status of an overloaded function (and perform checks).\"\"\"\n # If the implementation is marked as @final (or the first overload in\n # stubs), then the whole overloaded definition if @final.\n if any(item.is_final for item in defn.items):\n # We anyway mark it as final because it was probably the intention.\n defn.is_final = True\n # Only show the error once per overload\n bad_final = next(ov for ov in defn.items if ov.is_final)\n if not self.is_stub_file:\n self.fail(\"@final should be applied only to overload implementation\",\n bad_final)\n elif any(item.is_final for item in defn.items[1:]):\n bad_final = next(ov for ov in defn.items[1:] if ov.is_final)\n self.fail(\"In a stub file @final must be applied only to the first overload\",\n bad_final)\n if defn.impl is not None and defn.impl.is_final:\n defn.is_final = True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.process_static_or_class_method_in_overload_SemanticAnalyzer.process_static_or_class_method_in_overload.if_len_set_class_status_.else_.defn.is_static.static_status_0_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.process_static_or_class_method_in_overload_SemanticAnalyzer.process_static_or_class_method_in_overload.if_len_set_class_status_.else_.defn.is_static.static_status_0_", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 844, "end_line": 873, "span_ids": ["SemanticAnalyzer.process_static_or_class_method_in_overload"], "tokens": 288}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def process_static_or_class_method_in_overload(self, defn: OverloadedFuncDef) -> None:\n class_status = []\n static_status = []\n for item in defn.items:\n if isinstance(item, Decorator):\n inner = item.func\n elif isinstance(item, FuncDef):\n inner = item\n else:\n assert False, \"The 'item' variable is an unexpected type: {}\".format(type(item))\n class_status.append(inner.is_class)\n static_status.append(inner.is_static)\n\n if defn.impl is not None:\n if isinstance(defn.impl, Decorator):\n inner = defn.impl.func\n elif isinstance(defn.impl, FuncDef):\n inner = defn.impl\n else:\n assert False, \"Unexpected impl type: {}\".format(type(defn.impl))\n class_status.append(inner.is_class)\n static_status.append(inner.is_static)\n\n if len(set(class_status)) != 1:\n self.msg.overload_inconsistently_applies_decorator('classmethod', defn)\n elif len(set(static_status)) != 1:\n self.msg.overload_inconsistently_applies_decorator('staticmethod', defn)\n else:\n defn.is_class = class_status[0]\n defn.is_static = static_status[0]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_property_with_multi_part_definition_SemanticAnalyzer.analyze_property_with_multi_part_definition.for_i_in_reversed_deleted.del_items_i_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_property_with_multi_part_definition_SemanticAnalyzer.analyze_property_with_multi_part_definition.for_i_in_reversed_deleted.del_items_i_", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 875, "end_line": 902, "span_ids": ["SemanticAnalyzer.analyze_property_with_multi_part_definition"], "tokens": 273}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def analyze_property_with_multi_part_definition(self, defn: OverloadedFuncDef) -> None:\n \"\"\"Analyze a property defined using multiple methods (e.g., using @x.setter).\n\n Assume that the first method (@property) has already been analyzed.\n \"\"\"\n defn.is_property = True\n items = defn.items\n first_item = cast(Decorator, defn.items[0])\n deleted_items = []\n for i, item in enumerate(items[1:]):\n if isinstance(item, Decorator):\n if len(item.decorators) == 1:\n node = item.decorators[0]\n if isinstance(node, MemberExpr):\n if node.name == 'setter':\n # The first item represents the entire property.\n first_item.var.is_settable_property = True\n # Get abstractness from the original definition.\n item.func.is_abstract = first_item.func.is_abstract\n else:\n self.fail(\"Decorated property not supported\", item)\n item.func.accept(self)\n else:\n self.fail('Unexpected definition for property \"{}\"'.format(first_item.func.name),\n item)\n deleted_items.append(i + 1)\n for i in reversed(deleted_items):\n del items[i]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.add_function_to_symbol_table_SemanticAnalyzer.analyze_arg_initializers.with_self_tvar_scope_fram.for_arg_in_defn_arguments.if_arg_initializer_.arg_initializer_accept_se": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.add_function_to_symbol_table_SemanticAnalyzer.analyze_arg_initializers.with_self_tvar_scope_fram.for_arg_in_defn_arguments.if_arg_initializer_.arg_initializer_accept_se", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 904, "end_line": 916, "span_ids": ["SemanticAnalyzer.add_function_to_symbol_table", "SemanticAnalyzer.analyze_arg_initializers"], "tokens": 147}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def add_function_to_symbol_table(self, func: Union[FuncDef, OverloadedFuncDef]) -> None:\n if self.is_class_scope():\n assert self.type is not None\n func.info = self.type\n func._fullname = self.qualified_name(func.name)\n self.add_symbol(func.name, func, func)\n\n def analyze_arg_initializers(self, defn: FuncItem) -> None:\n with self.tvar_scope_frame(self.tvar_scope.method_frame()):\n # Analyze default arguments\n for arg in defn.arguments:\n if arg.initializer:\n arg.initializer.accept(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_function_body_SemanticAnalyzer.analyze_function_body.with_self_tvar_scope_fram.self_function_stack_pop_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_function_body_SemanticAnalyzer.analyze_function_body.with_self_tvar_scope_fram.self_function_stack_pop_", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 918, "end_line": 938, "span_ids": ["SemanticAnalyzer.analyze_function_body"], "tokens": 225}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def analyze_function_body(self, defn: FuncItem) -> None:\n is_method = self.is_class_scope()\n with self.tvar_scope_frame(self.tvar_scope.method_frame()):\n # Bind the type variables again to visit the body.\n if defn.type:\n a = self.type_analyzer()\n a.bind_function_type_variables(cast(CallableType, defn.type), defn)\n self.function_stack.append(defn)\n self.enter(defn)\n for arg in defn.arguments:\n self.add_local(arg.variable, defn)\n\n # The first argument of a non-static, non-class method is like 'self'\n # (though the name could be different), having the enclosing class's\n # instance type.\n if is_method and not defn.is_static and not defn.is_class and defn.arguments:\n defn.arguments[0].variable.is_self = True\n\n defn.body.accept(self)\n self.leave()\n self.function_stack.pop()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.check_classvar_in_signature_SemanticAnalyzer.check_function_signature.if_len_sig_arg_types_l.elif_len_sig_arg_types_.self_fail_Type_signature": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.check_classvar_in_signature_SemanticAnalyzer.check_function_signature.if_len_sig_arg_types_l.elif_len_sig_arg_types_.self_fail_Type_signature", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 940, "end_line": 963, "span_ids": ["SemanticAnalyzer.check_classvar_in_signature", "SemanticAnalyzer.check_function_signature"], "tokens": 278}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def check_classvar_in_signature(self, typ: ProperType) -> None:\n if isinstance(typ, Overloaded):\n for t in typ.items(): # type: ProperType\n self.check_classvar_in_signature(t)\n return\n if not isinstance(typ, CallableType):\n return\n for t in get_proper_types(typ.arg_types) + [get_proper_type(typ.ret_type)]:\n if self.is_classvar(t):\n self.fail_invalid_classvar(t)\n # Show only one error per signature\n break\n\n def check_function_signature(self, fdef: FuncItem) -> None:\n sig = fdef.type\n assert isinstance(sig, CallableType)\n if len(sig.arg_types) < len(fdef.arguments):\n self.fail('Type signature has too few arguments', fdef)\n # Add dummy Any arguments to prevent crashes later.\n num_extra_anys = len(fdef.arguments) - len(sig.arg_types)\n extra_anys = [AnyType(TypeOfAny.from_error)] * num_extra_anys\n sig.arg_types.extend(extra_anys)\n elif len(sig.arg_types) > len(fdef.arguments):\n self.fail('Type signature has too many arguments', fdef, blocker=True)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_decorator_SemanticAnalyzer.visit_class_def.with_self_tvar_scope_fram.self_analyze_class_defn_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_decorator_SemanticAnalyzer.visit_class_def.with_self_tvar_scope_fram.self_analyze_class_defn_", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 965, "end_line": 1044, "span_ids": ["SemanticAnalyzer.visit_decorator", "SemanticAnalyzer.visit_class_def", "SemanticAnalyzer.check_decorated_function_is_method"], "tokens": 796}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def visit_decorator(self, dec: Decorator) -> None:\n self.statement = dec\n # TODO: better don't modify them at all.\n dec.decorators = dec.original_decorators.copy()\n dec.func.is_conditional = self.block_depth[-1] > 0\n if not dec.is_overload:\n self.add_symbol(dec.name, dec, dec)\n dec.func._fullname = self.qualified_name(dec.name)\n for d in dec.decorators:\n d.accept(self)\n removed = [] # type: List[int]\n no_type_check = False\n for i, d in enumerate(dec.decorators):\n # A bunch of decorators are special cased here.\n if refers_to_fullname(d, 'abc.abstractmethod'):\n removed.append(i)\n dec.func.is_abstract = True\n self.check_decorated_function_is_method('abstractmethod', dec)\n elif (refers_to_fullname(d, 'asyncio.coroutines.coroutine') or\n refers_to_fullname(d, 'types.coroutine')):\n removed.append(i)\n dec.func.is_awaitable_coroutine = True\n elif refers_to_fullname(d, 'builtins.staticmethod'):\n removed.append(i)\n dec.func.is_static = True\n dec.var.is_staticmethod = True\n self.check_decorated_function_is_method('staticmethod', dec)\n elif refers_to_fullname(d, 'builtins.classmethod'):\n removed.append(i)\n dec.func.is_class = True\n dec.var.is_classmethod = True\n self.check_decorated_function_is_method('classmethod', dec)\n elif (refers_to_fullname(d, 'builtins.property') or\n refers_to_fullname(d, 'abc.abstractproperty')):\n removed.append(i)\n dec.func.is_property = True\n dec.var.is_property = True\n if refers_to_fullname(d, 'abc.abstractproperty'):\n dec.func.is_abstract = True\n self.check_decorated_function_is_method('property', dec)\n if len(dec.func.arguments) > 1:\n self.fail('Too many arguments', dec.func)\n elif refers_to_fullname(d, 'typing.no_type_check'):\n dec.var.type = AnyType(TypeOfAny.special_form)\n no_type_check = True\n elif (refers_to_fullname(d, 'typing.final') or\n refers_to_fullname(d, 'typing_extensions.final')):\n if self.is_class_scope():\n assert self.type is not None, \"No type set at class scope\"\n if self.type.is_protocol:\n self.msg.protocol_members_cant_be_final(d)\n else:\n dec.func.is_final = True\n dec.var.is_final = True\n removed.append(i)\n else:\n self.fail(\"@final cannot be used with non-method functions\", d)\n for i in reversed(removed):\n del dec.decorators[i]\n if (not dec.is_overload or dec.var.is_property) and self.type:\n dec.var.info = self.type\n dec.var.is_initialized_in_class = True\n if not no_type_check and self.recurse_into_functions:\n dec.func.accept(self)\n if dec.decorators and dec.var.is_property:\n self.fail('Decorated property not supported', dec)\n\n def check_decorated_function_is_method(self, decorator: str,\n context: Context) -> None:\n if not self.type or self.is_func_scope():\n self.fail(\"'%s' used with a non-method\" % decorator, context)\n\n #\n # Classes\n #\n\n def visit_class_def(self, defn: ClassDef) -> None:\n self.statement = defn\n with self.tvar_scope_frame(self.tvar_scope.class_frame()):\n self.analyze_class(defn)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_class_SemanticAnalyzer.analyze_class.with_self_scope_class_sco.self_analyze_class_body_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_class_SemanticAnalyzer.analyze_class.with_self_scope_class_sco.self_analyze_class_body_c", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1046, "end_line": 1121, "span_ids": ["SemanticAnalyzer.analyze_class"], "tokens": 736}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def analyze_class(self, defn: ClassDef) -> None:\n fullname = self.qualified_name(defn.name)\n if not defn.info and not self.is_core_builtin_class(defn):\n # Add placeholder so that self-references in base classes can be\n # resolved. We don't want this to cause a deferral, since if there\n # are no incomplete references, we'll replace this with a TypeInfo\n # before returning.\n placeholder = PlaceholderNode(fullname, defn, defn.line, becomes_typeinfo=True)\n self.add_symbol(defn.name, placeholder, defn, can_defer=False)\n\n tag = self.track_incomplete_refs()\n\n # Restore base classes after previous iteration (things like Generic[T] might be removed).\n defn.base_type_exprs.extend(defn.removed_base_type_exprs)\n defn.removed_base_type_exprs.clear()\n\n self.update_metaclass(defn)\n\n bases = defn.base_type_exprs\n bases, tvar_defs, is_protocol = self.clean_up_bases_and_infer_type_variables(defn, bases,\n context=defn)\n\n for tvd in tvar_defs:\n if any(has_placeholder(t) for t in [tvd.upper_bound] + tvd.values):\n # Some type variable bounds or values are not ready, we need\n # to re-analyze this class.\n self.defer()\n\n self.analyze_class_keywords(defn)\n result = self.analyze_base_classes(bases)\n\n if result is None or self.found_incomplete_ref(tag):\n # Something was incomplete. Defer current target.\n self.mark_incomplete(defn.name, defn)\n return\n\n base_types, base_error = result\n if any(isinstance(base, PlaceholderType) for base, _ in base_types):\n # We need to know the TypeInfo of each base to construct the MRO. Placeholder types\n # are okay in nested positions, since they can't affect the MRO.\n self.mark_incomplete(defn.name, defn)\n return\n\n is_typeddict, info = self.typed_dict_analyzer.analyze_typeddict_classdef(defn)\n if is_typeddict:\n for decorator in defn.decorators:\n decorator.accept(self)\n if isinstance(decorator, RefExpr):\n if decorator.fullname in ('typing.final',\n 'typing_extensions.final'):\n self.fail(\"@final cannot be used with TypedDict\", decorator)\n if info is None:\n self.mark_incomplete(defn.name, defn)\n else:\n self.prepare_class_def(defn, info)\n return\n\n if self.analyze_namedtuple_classdef(defn):\n return\n\n # Create TypeInfo for class now that base classes and the MRO can be calculated.\n self.prepare_class_def(defn)\n\n defn.type_vars = tvar_defs\n defn.info.type_vars = [tvar.name for tvar in tvar_defs]\n if base_error:\n defn.info.fallback_to_any = True\n\n with self.scope.class_scope(defn.info):\n self.configure_base_classes(defn, base_types)\n defn.info.is_protocol = is_protocol\n self.analyze_metaclass(defn)\n defn.info.runtime_protocol = False\n for decorator in defn.decorators:\n self.analyze_class_decorator(defn, decorator)\n self.analyze_class_body_common(defn)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.is_core_builtin_class_SemanticAnalyzer.analyze_namedtuple_classdef.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.is_core_builtin_class_SemanticAnalyzer.analyze_namedtuple_classdef.return.False", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1123, "end_line": 1151, "span_ids": ["SemanticAnalyzer.is_core_builtin_class", "SemanticAnalyzer.analyze_namedtuple_classdef", "SemanticAnalyzer.analyze_class_body_common"], "tokens": 319}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def is_core_builtin_class(self, defn: ClassDef) -> bool:\n return self.cur_mod_id == 'builtins' and defn.name in CORE_BUILTIN_CLASSES\n\n def analyze_class_body_common(self, defn: ClassDef) -> None:\n \"\"\"Parts of class body analysis that are common to all kinds of class defs.\"\"\"\n self.enter_class(defn.info)\n defn.defs.accept(self)\n self.apply_class_plugin_hooks(defn)\n self.leave_class()\n\n def analyze_namedtuple_classdef(self, defn: ClassDef) -> bool:\n \"\"\"Check if this class can define a named tuple.\"\"\"\n if defn.info and defn.info.is_named_tuple:\n # Don't reprocess everything. We just need to process methods defined\n # in the named tuple class body.\n is_named_tuple, info = True, defn.info # type: bool, Optional[TypeInfo]\n else:\n is_named_tuple, info = self.named_tuple_analyzer.analyze_namedtuple_classdef(\n defn, self.is_stub_file)\n if is_named_tuple:\n if info is None:\n self.mark_incomplete(defn.name, defn)\n else:\n self.prepare_class_def(defn, info)\n with self.scope.class_scope(defn.info):\n with self.named_tuple_analyzer.save_namedtuple_body(info):\n self.analyze_class_body_common(defn)\n return True\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.apply_class_plugin_hooks_SemanticAnalyzer.apply_class_plugin_hooks.get_fullname.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.apply_class_plugin_hooks_SemanticAnalyzer.apply_class_plugin_hooks.get_fullname.return.None", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1153, "end_line": 1169, "span_ids": ["SemanticAnalyzer.apply_class_plugin_hooks"], "tokens": 195}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def apply_class_plugin_hooks(self, defn: ClassDef) -> None:\n \"\"\"Apply a plugin hook that may infer a more precise definition for a class.\"\"\"\n def get_fullname(expr: Expression) -> Optional[str]:\n if isinstance(expr, CallExpr):\n return get_fullname(expr.callee)\n elif isinstance(expr, IndexExpr):\n return get_fullname(expr.base)\n elif isinstance(expr, RefExpr):\n if expr.fullname:\n return expr.fullname\n # If we don't have a fullname look it up. This happens because base classes are\n # analyzed in a different manner (see exprtotype.py) and therefore those AST\n # nodes will not have full names.\n sym = self.lookup_type_node(expr)\n if sym:\n return sym.fullname\n return None\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.apply_class_plugin_hooks.for_decorator_in_defn_dec_SemanticAnalyzer.apply_class_plugin_hooks.for_base_expr_in_defn_bas.if_base_name_.if_hook_.hook_ClassDefContext_defn": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.apply_class_plugin_hooks.for_decorator_in_defn_dec_SemanticAnalyzer.apply_class_plugin_hooks.for_base_expr_in_defn_bas.if_base_name_.if_hook_.hook_ClassDefContext_defn", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1171, "end_line": 1190, "span_ids": ["SemanticAnalyzer.apply_class_plugin_hooks"], "tokens": 211}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def apply_class_plugin_hooks(self, defn: ClassDef) -> None:\n # ... other code\n\n for decorator in defn.decorators:\n decorator_name = get_fullname(decorator)\n if decorator_name:\n hook = self.plugin.get_class_decorator_hook(decorator_name)\n if hook:\n hook(ClassDefContext(defn, decorator, self))\n\n if defn.metaclass:\n metaclass_name = get_fullname(defn.metaclass)\n if metaclass_name:\n hook = self.plugin.get_metaclass_hook(metaclass_name)\n if hook:\n hook(ClassDefContext(defn, defn.metaclass, self))\n\n for base_expr in defn.base_type_exprs:\n base_name = get_fullname(base_expr)\n if base_name:\n hook = self.plugin.get_base_class_hook(base_name)\n if hook:\n hook(ClassDefContext(defn, base_expr, self))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_class_keywords_SemanticAnalyzer.analyze_class_decorator.if_isinstance_decorator_.if_decorator_fullname_in_.elif_decorator_fullname_i.defn.info.is_final.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_class_keywords_SemanticAnalyzer.analyze_class_decorator.if_isinstance_decorator_.if_decorator_fullname_in_.elif_decorator_fullname_i.defn.info.is_final.True", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1192, "end_line": 1224, "span_ids": ["SemanticAnalyzer.analyze_class_keywords", "SemanticAnalyzer.enter_class", "SemanticAnalyzer.leave_class", "SemanticAnalyzer.analyze_class_decorator"], "tokens": 294}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def analyze_class_keywords(self, defn: ClassDef) -> None:\n for value in defn.keywords.values():\n value.accept(self)\n\n def enter_class(self, info: TypeInfo) -> None:\n # Remember previous active class\n self.type_stack.append(self.type)\n self.locals.append(None) # Add class scope\n self.is_comprehension_stack.append(False)\n self.block_depth.append(-1) # The class body increments this to 0\n self.type = info\n self.missing_names.append(set())\n\n def leave_class(self) -> None:\n \"\"\" Restore analyzer state. \"\"\"\n self.block_depth.pop()\n self.locals.pop()\n self.is_comprehension_stack.pop()\n self.type = self.type_stack.pop()\n self.missing_names.pop()\n\n def analyze_class_decorator(self, defn: ClassDef, decorator: Expression) -> None:\n decorator.accept(self)\n if isinstance(decorator, RefExpr):\n if decorator.fullname in RUNTIME_PROTOCOL_DECOS:\n if defn.info.is_protocol:\n defn.info.runtime_protocol = True\n else:\n self.fail('@runtime_checkable can only be used with protocol classes',\n defn)\n elif decorator.fullname in ('typing.final',\n 'typing_extensions.final'):\n defn.info.is_final = True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.clean_up_bases_and_infer_type_variables_SemanticAnalyzer.clean_up_bases_and_infer_type_variables.return.base_type_exprs_tvar_def": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.clean_up_bases_and_infer_type_variables_SemanticAnalyzer.clean_up_bases_and_infer_type_variables.return.base_type_exprs_tvar_def", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1226, "end_line": 1299, "span_ids": ["SemanticAnalyzer.clean_up_bases_and_infer_type_variables"], "tokens": 732}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def clean_up_bases_and_infer_type_variables(\n self,\n defn: ClassDef,\n base_type_exprs: List[Expression],\n context: Context) -> Tuple[List[Expression],\n List[TypeVarDef],\n bool]:\n \"\"\"Remove extra base classes such as Generic and infer type vars.\n\n For example, consider this class:\n\n class Foo(Bar, Generic[T]): ...\n\n Now we will remove Generic[T] from bases of Foo and infer that the\n type variable 'T' is a type argument of Foo.\n\n Note that this is performed *before* semantic analysis.\n\n Returns (remaining base expressions, inferred type variables, is protocol).\n \"\"\"\n removed = [] # type: List[int]\n declared_tvars = [] # type: TypeVarLikeList\n is_protocol = False\n for i, base_expr in enumerate(base_type_exprs):\n self.analyze_type_expr(base_expr)\n\n try:\n base = expr_to_unanalyzed_type(base_expr)\n except TypeTranslationError:\n # This error will be caught later.\n continue\n result = self.analyze_class_typevar_declaration(base)\n if result is not None:\n if declared_tvars:\n self.fail('Only single Generic[...] or Protocol[...] can be in bases', context)\n removed.append(i)\n tvars = result[0]\n is_protocol |= result[1]\n declared_tvars.extend(tvars)\n if isinstance(base, UnboundType):\n sym = self.lookup_qualified(base.name, base)\n if sym is not None and sym.node is not None:\n if (sym.node.fullname in ('typing.Protocol', 'typing_extensions.Protocol') and\n i not in removed):\n # also remove bare 'Protocol' bases\n removed.append(i)\n is_protocol = True\n\n all_tvars = self.get_all_bases_tvars(base_type_exprs, removed)\n if declared_tvars:\n if len(remove_dups(declared_tvars)) < len(declared_tvars):\n self.fail(\"Duplicate type variables in Generic[...] or Protocol[...]\", context)\n declared_tvars = remove_dups(declared_tvars)\n if not set(all_tvars).issubset(set(declared_tvars)):\n self.fail(\"If Generic[...] or Protocol[...] is present\"\n \" it should list all type variables\", context)\n # In case of error, Generic tvars will go first\n declared_tvars = remove_dups(declared_tvars + all_tvars)\n else:\n declared_tvars = all_tvars\n for i in reversed(removed):\n # We need to actually remove the base class expressions like Generic[T],\n # mostly because otherwise they will create spurious dependencies in fine\n # grained incremental mode.\n defn.removed_base_type_exprs.append(defn.base_type_exprs[i])\n del base_type_exprs[i]\n tvar_defs = [] # type: List[TypeVarDef]\n for name, tvar_expr in declared_tvars:\n tvar_def = self.tvar_scope.bind_new(name, tvar_expr)\n assert isinstance(tvar_def, TypeVarDef), (\n \"mypy does not currently support ParamSpec use in generic classes\"\n )\n tvar_defs.append(tvar_def)\n return base_type_exprs, tvar_defs, is_protocol", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_class_typevar_declaration_SemanticAnalyzer.analyze_class_typevar_declaration.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_class_typevar_declaration_SemanticAnalyzer.analyze_class_typevar_declaration.return.None", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1301, "end_line": 1333, "span_ids": ["SemanticAnalyzer.analyze_class_typevar_declaration"], "tokens": 306}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def analyze_class_typevar_declaration(\n self,\n base: Type\n ) -> Optional[Tuple[TypeVarLikeList, bool]]:\n \"\"\"Analyze type variables declared using Generic[...] or Protocol[...].\n\n Args:\n base: Non-analyzed base class\n\n Return None if the base class does not declare type variables. Otherwise,\n return the type variables.\n \"\"\"\n if not isinstance(base, UnboundType):\n return None\n unbound = base\n sym = self.lookup_qualified(unbound.name, unbound)\n if sym is None or sym.node is None:\n return None\n if (sym.node.fullname == 'typing.Generic' or\n sym.node.fullname == 'typing.Protocol' and base.args or\n sym.node.fullname == 'typing_extensions.Protocol' and base.args):\n is_proto = sym.node.fullname != 'typing.Generic'\n tvars = [] # type: TypeVarLikeList\n for arg in unbound.args:\n tag = self.track_incomplete_refs()\n tvar = self.analyze_unbound_tvar(arg)\n if tvar:\n tvars.append(tvar)\n elif not self.found_incomplete_ref(tag):\n self.fail('Free type variable expected in %s[...]' %\n sym.node.name, base)\n return tvars, is_proto\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_unbound_tvar_SemanticAnalyzer.analyze_unbound_tvar.if_sym_is_None_or_not_isi.else_.return.unbound_name_sym_node": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_unbound_tvar_SemanticAnalyzer.analyze_unbound_tvar.if_sym_is_None_or_not_isi.else_.return.unbound_name_sym_node", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1335, "end_line": 1349, "span_ids": ["SemanticAnalyzer.analyze_unbound_tvar"], "tokens": 166}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def analyze_unbound_tvar(self, t: Type) -> Optional[Tuple[str, TypeVarExpr]]:\n if not isinstance(t, UnboundType):\n return None\n unbound = t\n sym = self.lookup_qualified(unbound.name, unbound)\n if sym and isinstance(sym.node, PlaceholderNode):\n self.record_incomplete_ref()\n if sym is None or not isinstance(sym.node, TypeVarExpr):\n return None\n elif sym.fullname and not self.tvar_scope.allow_binding(sym.fullname):\n # It's bound by our type variable scope\n return None\n else:\n assert isinstance(sym.node, TypeVarExpr)\n return unbound.name, sym.node", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.get_all_bases_tvars_SemanticAnalyzer.get_all_bases_tvars.return.remove_dups_tvars_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.get_all_bases_tvars_SemanticAnalyzer.get_all_bases_tvars.return.remove_dups_tvars_", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1351, "end_line": 1365, "span_ids": ["SemanticAnalyzer.get_all_bases_tvars"], "tokens": 164}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def get_all_bases_tvars(self,\n base_type_exprs: List[Expression],\n removed: List[int]) -> TypeVarLikeList:\n \"\"\"Return all type variable references in bases.\"\"\"\n tvars = [] # type: TypeVarLikeList\n for i, base_expr in enumerate(base_type_exprs):\n if i not in removed:\n try:\n base = expr_to_unanalyzed_type(base_expr)\n except TypeTranslationError:\n # This error will be caught later.\n continue\n base_tvars = base.accept(TypeVarLikeQuery(self.lookup_qualified, self.tvar_scope))\n tvars.extend(base_tvars)\n return remove_dups(tvars)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.prepare_class_def_SemanticAnalyzer.prepare_class_def.if_self_is_nested_within_.self_globals_local_name_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.prepare_class_def_SemanticAnalyzer.prepare_class_def.if_self_is_nested_within_.self_globals_local_name_", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1367, "end_line": 1402, "span_ids": ["SemanticAnalyzer.prepare_class_def"], "tokens": 423}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def prepare_class_def(self, defn: ClassDef, info: Optional[TypeInfo] = None) -> None:\n \"\"\"Prepare for the analysis of a class definition.\n\n Create an empty TypeInfo and store it in a symbol table, or if the 'info'\n argument is provided, store it instead (used for magic type definitions).\n \"\"\"\n if not defn.info:\n defn.fullname = self.qualified_name(defn.name)\n # TODO: Nested classes\n info = info or self.make_empty_type_info(defn)\n defn.info = info\n info.defn = defn\n if not self.is_func_scope():\n info._fullname = self.qualified_name(defn.name)\n else:\n info._fullname = info.name\n self.add_symbol(defn.name, defn.info, defn)\n if self.is_nested_within_func_scope():\n # We need to preserve local classes, let's store them\n # in globals under mangled unique names\n #\n # TODO: Putting local classes into globals breaks assumptions in fine-grained\n # incremental mode and we should avoid it. In general, this logic is too\n # ad-hoc and needs to be removed/refactored.\n if '@' not in defn.info._fullname:\n local_name = defn.info._fullname + '@' + str(defn.line)\n if defn.info.is_named_tuple:\n # Module is already correctly set in _fullname for named tuples.\n defn.info._fullname += '@' + str(defn.line)\n else:\n defn.info._fullname = self.cur_mod_id + '.' + local_name\n else:\n # Preserve name from previous fine-grained incremental run.\n local_name = defn.info._fullname\n defn.fullname = defn.info._fullname\n self.globals[local_name] = SymbolTableNode(GDEF, defn.info)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.make_empty_type_info_SemanticAnalyzer.get_name_repr_of_expr.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.make_empty_type_info_SemanticAnalyzer.get_name_repr_of_expr.return.None", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1404, "end_line": 1428, "span_ids": ["SemanticAnalyzer.make_empty_type_info", "SemanticAnalyzer.get_name_repr_of_expr"], "tokens": 259}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def make_empty_type_info(self, defn: ClassDef) -> TypeInfo:\n if (self.is_module_scope()\n and self.cur_mod_id == 'builtins'\n and defn.name in CORE_BUILTIN_CLASSES):\n # Special case core built-in classes. A TypeInfo was already\n # created for it before semantic analysis, but with a dummy\n # ClassDef. Patch the real ClassDef object.\n info = self.globals[defn.name].node\n assert isinstance(info, TypeInfo)\n else:\n info = TypeInfo(SymbolTable(), defn, self.cur_mod_id)\n info.set_line(defn)\n return info\n\n def get_name_repr_of_expr(self, expr: Expression) -> Optional[str]:\n \"\"\"Try finding a short simplified textual representation of a base class expression.\"\"\"\n if isinstance(expr, NameExpr):\n return expr.name\n if isinstance(expr, MemberExpr):\n return get_member_expr_fullname(expr)\n if isinstance(expr, IndexExpr):\n return self.get_name_repr_of_expr(expr.base)\n if isinstance(expr, CallExpr):\n return self.get_name_repr_of_expr(expr.callee)\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_base_classes_SemanticAnalyzer.analyze_base_classes.return.bases_is_error": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_base_classes_SemanticAnalyzer.analyze_base_classes.return.bases_is_error", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1430, "end_line": 1468, "span_ids": ["SemanticAnalyzer.analyze_base_classes"], "tokens": 308}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def analyze_base_classes(\n self,\n base_type_exprs: List[Expression]) -> Optional[Tuple[List[Tuple[ProperType,\n Expression]],\n bool]]:\n \"\"\"Analyze base class types.\n\n Return None if some definition was incomplete. Otherwise, return a tuple\n with these items:\n\n * List of (analyzed type, original expression) tuples\n * Boolean indicating whether one of the bases had a semantic analysis error\n \"\"\"\n is_error = False\n bases = []\n for base_expr in base_type_exprs:\n if (isinstance(base_expr, RefExpr) and\n base_expr.fullname in ('typing.NamedTuple',) + TPDICT_NAMES):\n # Ignore magic bases for now.\n continue\n\n try:\n base = self.expr_to_analyzed_type(base_expr, allow_placeholder=True)\n except TypeTranslationError:\n name = self.get_name_repr_of_expr(base_expr)\n if isinstance(base_expr, CallExpr):\n msg = 'Unsupported dynamic base class'\n else:\n msg = 'Invalid base class'\n if name:\n msg += ' \"{}\"'.format(name)\n self.fail(msg, base_expr)\n is_error = True\n continue\n if base is None:\n return None\n base = get_proper_type(base)\n bases.append((base, base_expr))\n return bases, is_error", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.configure_base_classes_SemanticAnalyzer.configure_base_classes.self_calculate_class_mro_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.configure_base_classes_SemanticAnalyzer.configure_base_classes.self_calculate_class_mro_", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1470, "end_line": 1525, "span_ids": ["SemanticAnalyzer.configure_base_classes"], "tokens": 542}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def configure_base_classes(self,\n defn: ClassDef,\n bases: List[Tuple[ProperType, Expression]]) -> None:\n \"\"\"Set up base classes.\n\n This computes several attributes on the corresponding TypeInfo defn.info\n related to the base classes: defn.info.bases, defn.info.mro, and\n miscellaneous others (at least tuple_type, fallback_to_any, and is_enum.)\n \"\"\"\n base_types = [] # type: List[Instance]\n info = defn.info\n\n info.tuple_type = None\n for base, base_expr in bases:\n if isinstance(base, TupleType):\n actual_base = self.configure_tuple_base_class(defn, base, base_expr)\n base_types.append(actual_base)\n elif isinstance(base, Instance):\n if base.type.is_newtype:\n self.fail(\"Cannot subclass NewType\", defn)\n base_types.append(base)\n elif isinstance(base, AnyType):\n if self.options.disallow_subclassing_any:\n if isinstance(base_expr, (NameExpr, MemberExpr)):\n msg = \"Class cannot subclass '{}' (has type 'Any')\".format(base_expr.name)\n else:\n msg = \"Class cannot subclass value of type 'Any'\"\n self.fail(msg, base_expr)\n info.fallback_to_any = True\n else:\n msg = 'Invalid base class'\n name = self.get_name_repr_of_expr(base_expr)\n if name:\n msg += ' \"{}\"'.format(name)\n self.fail(msg, base_expr)\n info.fallback_to_any = True\n if self.options.disallow_any_unimported and has_any_from_unimported_type(base):\n if isinstance(base_expr, (NameExpr, MemberExpr)):\n prefix = \"Base type {}\".format(base_expr.name)\n else:\n prefix = \"Base type\"\n self.msg.unimported_type_becomes_any(prefix, base, base_expr)\n check_for_explicit_any(base, self.options, self.is_typeshed_stub_file, self.msg,\n context=base_expr)\n\n # Add 'object' as implicit base if there is no other base class.\n if not base_types and defn.fullname != 'builtins.object':\n base_types.append(self.object_type())\n\n info.bases = base_types\n\n # Calculate the MRO.\n if not self.verify_base_classes(defn):\n self.set_dummy_mro(defn.info)\n return\n self.calculate_class_mro(defn, self.object_type)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.configure_tuple_base_class_SemanticAnalyzer.configure_tuple_base_class.return.base_partial_fallback": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.configure_tuple_base_class_SemanticAnalyzer.configure_tuple_base_class.return.base_partial_fallback", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1527, "end_line": 1549, "span_ids": ["SemanticAnalyzer.configure_tuple_base_class"], "tokens": 247}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def configure_tuple_base_class(self,\n defn: ClassDef,\n base: TupleType,\n base_expr: Expression) -> Instance:\n info = defn.info\n\n # There may be an existing valid tuple type from previous semanal iterations.\n # Use equality to check if it is the case.\n if info.tuple_type and info.tuple_type != base:\n self.fail(\"Class has two incompatible bases derived from tuple\", defn)\n defn.has_incompatible_baseclass = True\n info.tuple_type = base\n if isinstance(base_expr, CallExpr):\n defn.analyzed = NamedTupleExpr(base.partial_fallback.type)\n defn.analyzed.line = defn.line\n defn.analyzed.column = defn.column\n\n if base.partial_fallback.type.fullname == 'builtins.tuple':\n # Fallback can only be safely calculated after semantic analysis, since base\n # classes may be incomplete. Postpone the calculation.\n self.schedule_patch(PRIORITY_FALLBACKS, lambda: calculate_tuple_fallback(base))\n\n return base.partial_fallback", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.set_dummy_mro_SemanticAnalyzer.calculate_class_mro.if_defn_fullname_.if_hook_.hook_ClassDefContext_defn": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.set_dummy_mro_SemanticAnalyzer.calculate_class_mro.if_defn_fullname_.if_hook_.hook_ClassDefContext_defn", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1551, "end_line": 1575, "span_ids": ["SemanticAnalyzer.calculate_class_mro", "SemanticAnalyzer.set_dummy_mro"], "tokens": 287}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def set_dummy_mro(self, info: TypeInfo) -> None:\n # Give it an MRO consisting of just the class itself and object.\n info.mro = [info, self.object_type().type]\n info.bad_mro = True\n\n def calculate_class_mro(self, defn: ClassDef,\n obj_type: Optional[Callable[[], Instance]] = None) -> None:\n \"\"\"Calculate method resolution order for a class.\n\n `obj_type` may be omitted in the third pass when all classes are already analyzed.\n It exists just to fill in empty base class list during second pass in case of\n an import cycle.\n \"\"\"\n try:\n calculate_mro(defn.info, obj_type)\n except MroError:\n self.fail('Cannot determine consistent method resolution '\n 'order (MRO) for \"%s\"' % defn.name, defn)\n self.set_dummy_mro(defn.info)\n # Allow plugins to alter the MRO to handle the fact that `def mro()`\n # on metaclasses permits MRO rewriting.\n if defn.fullname:\n hook = self.plugin.get_customize_class_mro_hook(defn.fullname)\n if hook:\n hook(ClassDefContext(defn, FakeExpression(), self))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.update_metaclass_SemanticAnalyzer.update_metaclass.defn.metaclass.metas_pop_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.update_metaclass_SemanticAnalyzer.update_metaclass.defn.metaclass.metas_pop_", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1577, "end_line": 1630, "span_ids": ["SemanticAnalyzer.update_metaclass"], "tokens": 635}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def update_metaclass(self, defn: ClassDef) -> None:\n \"\"\"Lookup for special metaclass declarations, and update defn fields accordingly.\n\n * __metaclass__ attribute in Python 2\n * six.with_metaclass(M, B1, B2, ...)\n * @six.add_metaclass(M)\n * future.utils.with_metaclass(M, B1, B2, ...)\n * past.utils.with_metaclass(M, B1, B2, ...)\n \"\"\"\n\n # Look for \"__metaclass__ = \" in Python 2\n python2_meta_expr = None # type: Optional[Expression]\n if self.options.python_version[0] == 2:\n for body_node in defn.defs.body:\n if isinstance(body_node, ClassDef) and body_node.name == \"__metaclass__\":\n self.fail(\"Metaclasses defined as inner classes are not supported\", body_node)\n break\n elif isinstance(body_node, AssignmentStmt) and len(body_node.lvalues) == 1:\n lvalue = body_node.lvalues[0]\n if isinstance(lvalue, NameExpr) and lvalue.name == \"__metaclass__\":\n python2_meta_expr = body_node.rvalue\n\n # Look for six.with_metaclass(M, B1, B2, ...)\n with_meta_expr = None # type: Optional[Expression]\n if len(defn.base_type_exprs) == 1:\n base_expr = defn.base_type_exprs[0]\n if isinstance(base_expr, CallExpr) and isinstance(base_expr.callee, RefExpr):\n base_expr.accept(self)\n if (base_expr.callee.fullname in {'six.with_metaclass',\n 'future.utils.with_metaclass',\n 'past.utils.with_metaclass'}\n and len(base_expr.args) >= 1\n and all(kind == ARG_POS for kind in base_expr.arg_kinds)):\n with_meta_expr = base_expr.args[0]\n defn.base_type_exprs = base_expr.args[1:]\n\n # Look for @six.add_metaclass(M)\n add_meta_expr = None # type: Optional[Expression]\n for dec_expr in defn.decorators:\n if isinstance(dec_expr, CallExpr) and isinstance(dec_expr.callee, RefExpr):\n dec_expr.callee.accept(self)\n if (dec_expr.callee.fullname == 'six.add_metaclass'\n and len(dec_expr.args) == 1\n and dec_expr.arg_kinds[0] == ARG_POS):\n add_meta_expr = dec_expr.args[0]\n break\n\n metas = {defn.metaclass, python2_meta_expr, with_meta_expr, add_meta_expr} - {None}\n if len(metas) == 0:\n return\n if len(metas) > 1:\n self.fail(\"Multiple metaclass definitions\", defn)\n return\n defn.metaclass = metas.pop()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.verify_base_classes_SemanticAnalyzer.verify_base_classes.return.not_cycle": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.verify_base_classes_SemanticAnalyzer.verify_base_classes.return.not_cycle", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1632, "end_line": 1648, "span_ids": ["SemanticAnalyzer.verify_base_classes"], "tokens": 174}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def verify_base_classes(self, defn: ClassDef) -> bool:\n info = defn.info\n cycle = False\n for base in info.bases:\n baseinfo = base.type\n if self.is_base_class(info, baseinfo):\n self.fail('Cycle in inheritance hierarchy', defn)\n cycle = True\n if baseinfo.fullname == 'builtins.bool':\n self.fail(\"'%s' is not a valid base class\" %\n baseinfo.name, defn, blocker=True)\n return False\n dup = find_duplicate(info.direct_base_classes())\n if dup:\n self.fail('Duplicate base class \"%s\"' % dup.name, defn, blocker=True)\n return False\n return not cycle", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.is_base_class_SemanticAnalyzer.is_base_class.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.is_base_class_SemanticAnalyzer.is_base_class.return.False", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1650, "end_line": 1663, "span_ids": ["SemanticAnalyzer.is_base_class"], "tokens": 139}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def is_base_class(self, t: TypeInfo, s: TypeInfo) -> bool:\n \"\"\"Determine if t is a base class of s (but do not use mro).\"\"\"\n # Search the base class graph for t, starting from s.\n worklist = [s]\n visited = {s}\n while worklist:\n nxt = worklist.pop()\n if nxt == t:\n return True\n for base in nxt.bases:\n if base.type not in visited:\n worklist.append(base.type)\n visited.add(base.type)\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_metaclass_SemanticAnalyzer.analyze_metaclass.if_defn_info_metaclass_ty.else_.if_defn_info_metaclass_ty.if_defn_type_vars_.self_fail_Enum_class_can": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_metaclass_SemanticAnalyzer.analyze_metaclass.if_defn_info_metaclass_ty.else_.if_defn_info_metaclass_ty.if_defn_type_vars_.self_fail_Enum_class_can", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1669, "end_line": 1721, "span_ids": ["SemanticAnalyzer.analyze_metaclass"], "tokens": 636}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def analyze_metaclass(self, defn: ClassDef) -> None:\n if defn.metaclass:\n metaclass_name = None\n if isinstance(defn.metaclass, NameExpr):\n metaclass_name = defn.metaclass.name\n elif isinstance(defn.metaclass, MemberExpr):\n metaclass_name = get_member_expr_fullname(defn.metaclass)\n if metaclass_name is None:\n self.fail('Dynamic metaclass not supported for \"%s\"' % defn.name, defn.metaclass)\n return\n sym = self.lookup_qualified(metaclass_name, defn.metaclass)\n if sym is None:\n # Probably a name error - it is already handled elsewhere\n return\n if isinstance(sym.node, Var) and isinstance(get_proper_type(sym.node.type), AnyType):\n # 'Any' metaclass -- just ignore it.\n #\n # TODO: A better approach would be to record this information\n # and assume that the type object supports arbitrary\n # attributes, similar to an 'Any' base class.\n return\n if isinstance(sym.node, PlaceholderNode):\n self.defer(defn)\n return\n if not isinstance(sym.node, TypeInfo) or sym.node.tuple_type is not None:\n self.fail('Invalid metaclass \"%s\"' % metaclass_name, defn.metaclass)\n return\n if not sym.node.is_metaclass():\n self.fail('Metaclasses not inheriting from \"type\" are not supported',\n defn.metaclass)\n return\n inst = fill_typevars(sym.node)\n assert isinstance(inst, Instance)\n defn.info.declared_metaclass = inst\n defn.info.metaclass_type = defn.info.calculate_metaclass_type()\n if any(info.is_protocol for info in defn.info.mro):\n if (not defn.info.metaclass_type or\n defn.info.metaclass_type.type.fullname == 'builtins.type'):\n # All protocols and their subclasses have ABCMeta metaclass by default.\n # TODO: add a metaclass conflict check if there is another metaclass.\n abc_meta = self.named_type_or_none('abc.ABCMeta', [])\n if abc_meta is not None: # May be None in tests with incomplete lib-stub.\n defn.info.metaclass_type = abc_meta\n if defn.info.metaclass_type is None:\n # Inconsistency may happen due to multiple baseclasses even in classes that\n # do not declare explicit metaclass, but it's harder to catch at this stage\n if defn.metaclass is not None:\n self.fail('Inconsistent metaclass structure for \"%s\"' % defn.name, defn)\n else:\n if defn.info.metaclass_type.type.has_base('enum.EnumMeta'):\n defn.info.is_enum = True\n if defn.type_vars:\n self.fail(\"Enum class cannot be generic\", defn)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.None_75_SemanticAnalyzer.visit_import.for_id_as_id_in_i_ids_.self_add_module_symbol_ba": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.None_75_SemanticAnalyzer.visit_import.for_id_as_id_in_i_ids_.self_add_module_symbol_ba", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1719, "end_line": 1738, "span_ids": ["SemanticAnalyzer.analyze_metaclass", "SemanticAnalyzer.visit_import"], "tokens": 215}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n #\n # Imports\n #\n\n def visit_import(self, i: Import) -> None:\n self.statement = i\n for id, as_id in i.ids:\n # Modules imported in a stub file without using 'import X as X' won't get exported\n # When implicit re-exporting is disabled, we have the same behavior as stubs.\n use_implicit_reexport = not self.is_stub_file and self.options.implicit_reexport\n if as_id is not None:\n base_id = id\n imported_id = as_id\n module_public = use_implicit_reexport or id.split(\".\")[-1] == as_id\n else:\n base_id = id.split('.')[0]\n imported_id = base_id\n module_public = use_implicit_reexport\n self.add_module_symbol(base_id, imported_id, context=i, module_public=module_public,\n module_hidden=not module_public)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_import_from_SemanticAnalyzer.visit_import_from.for_id_as_id_in_imp_name.if_node_and_not_node_modu.else_.self_add_unknown_imported": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_import_from_SemanticAnalyzer.visit_import_from.for_id_as_id_in_imp_name.if_node_and_not_node_modu.else_.self_add_unknown_imported", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1744, "end_line": 1809, "span_ids": ["SemanticAnalyzer.visit_import_from"], "tokens": 703}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def visit_import_from(self, imp: ImportFrom) -> None:\n self.statement = imp\n module_id = self.correct_relative_import(imp)\n module = self.modules.get(module_id)\n for id, as_id in imp.names:\n fullname = module_id + '.' + id\n self.set_future_import_flags(fullname)\n if module is None:\n node = None\n elif module_id == self.cur_mod_id and fullname in self.modules:\n # Submodule takes precedence over definition in surround package, for\n # compatibility with runtime semantics in typical use cases. This\n # could more precisely model runtime semantics by taking into account\n # the line number beyond which the local definition should take\n # precedence, but doesn't seem to be important in most use cases.\n node = SymbolTableNode(GDEF, self.modules[fullname])\n else:\n if id == as_id == '__all__' and module_id in self.export_map:\n self.all_exports[:] = self.export_map[module_id]\n node = module.names.get(id)\n\n missing_submodule = False\n imported_id = as_id or id\n\n # If the module does not contain a symbol with the name 'id',\n # try checking if it's a module instead.\n if not node:\n mod = self.modules.get(fullname)\n if mod is not None:\n kind = self.current_symbol_kind()\n node = SymbolTableNode(kind, mod)\n elif fullname in self.missing_modules:\n missing_submodule = True\n # If it is still not resolved, check for a module level __getattr__\n if (module and not node and (module.is_stub or self.options.python_version >= (3, 7))\n and '__getattr__' in module.names):\n # We store the fullname of the original definition so that we can\n # detect whether two imported names refer to the same thing.\n fullname = module_id + '.' + id\n gvar = self.create_getattr_var(module.names['__getattr__'], imported_id, fullname)\n if gvar:\n self.add_symbol(imported_id, gvar, imp)\n continue\n\n # Modules imported in a stub file without using 'from Y import X as X' will\n # not get exported.\n # When implicit re-exporting is disabled, we have the same behavior as stubs.\n use_implicit_reexport = not self.is_stub_file and self.options.implicit_reexport\n module_public = use_implicit_reexport or (as_id is not None and id == as_id)\n\n if node and not node.module_hidden:\n self.process_imported_symbol(\n node, module_id, id, imported_id, fullname, module_public, context=imp\n )\n elif module and not missing_submodule:\n # Target module exists but the imported name is missing or hidden.\n self.report_missing_module_attribute(\n module_id, id, imported_id, module_public=module_public,\n module_hidden=not module_public, context=imp\n )\n else:\n # Import of a missing (sub)module.\n self.add_unknown_imported_symbol(\n imported_id, imp, target_name=fullname, module_public=module_public,\n module_hidden=not module_public\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.process_imported_symbol_SemanticAnalyzer.process_imported_symbol.self_add_imported_symbol_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.process_imported_symbol_SemanticAnalyzer.process_imported_symbol.self_add_imported_symbol_", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1805, "end_line": 1843, "span_ids": ["SemanticAnalyzer.process_imported_symbol"], "tokens": 363}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def process_imported_symbol(self,\n node: SymbolTableNode,\n module_id: str,\n id: str,\n imported_id: str,\n fullname: str,\n module_public: bool,\n context: ImportBase) -> None:\n module_hidden = not module_public and fullname not in self.modules\n\n if isinstance(node.node, PlaceholderNode):\n if self.final_iteration:\n self.report_missing_module_attribute(\n module_id, id, imported_id, module_public=module_public,\n module_hidden=module_hidden, context=context\n )\n return\n else:\n # This might become a type.\n self.mark_incomplete(imported_id, node.node,\n module_public=module_public,\n module_hidden=module_hidden,\n becomes_typeinfo=True)\n existing_symbol = self.globals.get(imported_id)\n if (existing_symbol and not isinstance(existing_symbol.node, PlaceholderNode) and\n not isinstance(node.node, PlaceholderNode)):\n # Import can redefine a variable. They get special treatment.\n if self.process_import_over_existing_name(\n imported_id, existing_symbol, node, context):\n return\n if existing_symbol and isinstance(node.node, PlaceholderNode):\n # Imports are special, some redefinitions are allowed, so wait until\n # we know what is the new symbol node.\n return\n # NOTE: we take the original node even for final `Var`s. This is to support\n # a common pattern when constants are re-exported (same applies to import *).\n self.add_imported_symbol(imported_id, node, context,\n module_public=module_public,\n module_hidden=module_hidden)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.report_missing_module_attribute_SemanticAnalyzer.report_missing_module_attribute.if_import_id_typing_.if_self_lookup_fully_qua.self_msg_add_fixture_note": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.report_missing_module_attribute_SemanticAnalyzer.report_missing_module_attribute.if_import_id_typing_.if_self_lookup_fully_qua.self_msg_add_fixture_note", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1849, "end_line": 1884, "span_ids": ["SemanticAnalyzer.report_missing_module_attribute"], "tokens": 405}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def report_missing_module_attribute(\n self, import_id: str, source_id: str, imported_id: str, module_public: bool,\n module_hidden: bool, context: Node\n ) -> None:\n # Missing attribute.\n if self.is_incomplete_namespace(import_id):\n # We don't know whether the name will be there, since the namespace\n # is incomplete. Defer the current target.\n self.mark_incomplete(imported_id, context)\n return\n message = 'Module \"{}\" has no attribute \"{}\"'.format(import_id, source_id)\n # Suggest alternatives, if any match is found.\n module = self.modules.get(import_id)\n if module:\n if not self.options.implicit_reexport and source_id in module.names.keys():\n message = (\"Module '{}' does not explicitly export attribute '{}'\"\n \"; implicit reexport disabled\".format(import_id, source_id))\n else:\n alternatives = set(module.names.keys()).difference({source_id})\n matches = best_matches(source_id, alternatives)[:3]\n if matches:\n suggestion = \"; maybe {}?\".format(pretty_seq(matches, \"or\"))\n message += \"{}\".format(suggestion)\n self.fail(message, context, code=codes.ATTR_DEFINED)\n self.add_unknown_imported_symbol(\n imported_id, context, target_name=None, module_public=module_public,\n module_hidden=not module_public\n )\n\n if import_id == 'typing':\n # The user probably has a missing definition in a test fixture. Let's verify.\n fullname = 'builtins.{}'.format(source_id.lower())\n if (self.lookup_fully_qualified_or_none(fullname) is None and\n fullname in SUGGESTED_TEST_FIXTURES):\n # Yes. Generate a helpful note.\n self.msg.add_fixture_note(fullname, context)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.process_import_over_existing_name_SemanticAnalyzer.correct_relative_import.return.import_id": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.process_import_over_existing_name_SemanticAnalyzer.correct_relative_import.return.import_id", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1882, "end_line": 1915, "span_ids": ["SemanticAnalyzer.process_import_over_existing_name", "SemanticAnalyzer.correct_relative_import"], "tokens": 381}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def process_import_over_existing_name(self,\n imported_id: str, existing_symbol: SymbolTableNode,\n module_symbol: SymbolTableNode,\n import_node: ImportBase) -> bool:\n if existing_symbol.node is module_symbol.node:\n # We added this symbol on previous iteration.\n return False\n if (existing_symbol.kind in (LDEF, GDEF, MDEF) and\n isinstance(existing_symbol.node, (Var, FuncDef, TypeInfo, Decorator, TypeAlias))):\n # This is a valid import over an existing definition in the file. Construct a dummy\n # assignment that we'll use to type check the import.\n lvalue = NameExpr(imported_id)\n lvalue.kind = existing_symbol.kind\n lvalue.node = existing_symbol.node\n rvalue = NameExpr(imported_id)\n rvalue.kind = module_symbol.kind\n rvalue.node = module_symbol.node\n if isinstance(rvalue.node, TypeAlias):\n # Suppress bogus errors from the dummy assignment if rvalue is an alias.\n # Otherwise mypy may complain that alias is invalid in runtime context.\n rvalue.is_alias_rvalue = True\n assignment = AssignmentStmt([lvalue], rvalue)\n for node in assignment, lvalue, rvalue:\n node.set_line(import_node)\n import_node.assignments.append(assignment)\n return True\n return False\n\n def correct_relative_import(self, node: Union[ImportFrom, ImportAll]) -> str:\n import_id, ok = correct_relative_import(self.cur_mod_id, node.relative, node.id,\n self.cur_mod_node.is_package_init_file())\n if not ok:\n self.fail(\"Relative import climbs too many namespaces\", node)\n return import_id", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_import_all_SemanticAnalyzer.visit_assignment_expr.self_analyze_lvalue_s_tar": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_import_all_SemanticAnalyzer.visit_assignment_expr.self_analyze_lvalue_s_tar", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1917, "end_line": 1959, "span_ids": ["SemanticAnalyzer.visit_assignment_expr", "SemanticAnalyzer.visit_import_all"], "tokens": 437}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def visit_import_all(self, i: ImportAll) -> None:\n i_id = self.correct_relative_import(i)\n if i_id in self.modules:\n m = self.modules[i_id]\n if self.is_incomplete_namespace(i_id):\n # Any names could be missing from the current namespace if the target module\n # namespace is incomplete.\n self.mark_incomplete('*', i)\n for name, node in m.names.items():\n fullname = i_id + '.' + name\n self.set_future_import_flags(fullname)\n if node is None:\n continue\n # if '__all__' exists, all nodes not included have had module_public set to\n # False, and we can skip checking '_' because it's been explicitly included.\n if node.module_public and (not name.startswith('_') or '__all__' in m.names):\n if isinstance(node.node, MypyFile):\n # Star import of submodule from a package, add it as a dependency.\n self.imports.add(node.node.fullname)\n existing_symbol = self.lookup_current_scope(name)\n if existing_symbol and not isinstance(node.node, PlaceholderNode):\n # Import can redefine a variable. They get special treatment.\n if self.process_import_over_existing_name(\n name, existing_symbol, node, i):\n continue\n # In stub files, `from x import *` always reexports the symbols.\n # In regular files, only if implicit reexports are enabled.\n module_public = self.is_stub_file or self.options.implicit_reexport\n self.add_imported_symbol(name, node, i,\n module_public=module_public,\n module_hidden=not module_public)\n\n else:\n # Don't add any dummy symbols for 'from x import *' if 'x' is unknown.\n pass\n\n #\n # Assignment\n #\n\n def visit_assignment_expr(self, s: AssignmentExpr) -> None:\n s.value.accept(self)\n self.analyze_lvalue(s.target, escape_comprehensions=True)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_assignment_stmt_SemanticAnalyzer.visit_assignment_stmt.self_process__all___s_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_assignment_stmt_SemanticAnalyzer.visit_assignment_stmt.self_process__all___s_", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1961, "end_line": 2012, "span_ids": ["SemanticAnalyzer.visit_assignment_stmt"], "tokens": 466}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def visit_assignment_stmt(self, s: AssignmentStmt) -> None:\n self.statement = s\n\n # Special case assignment like X = X.\n if self.analyze_identity_global_assignment(s):\n return\n\n tag = self.track_incomplete_refs()\n s.rvalue.accept(self)\n if self.found_incomplete_ref(tag) or self.should_wait_rhs(s.rvalue):\n # Initializer couldn't be fully analyzed. Defer the current node and give up.\n # Make sure that if we skip the definition of some local names, they can't be\n # added later in this scope, since an earlier definition should take precedence.\n for expr in names_modified_by_assignment(s):\n self.mark_incomplete(expr.name, expr)\n return\n\n # The r.h.s. is now ready to be classified, first check if it is a special form:\n special_form = False\n # * type alias\n if self.check_and_set_up_type_alias(s):\n s.is_alias_def = True\n special_form = True\n # * type variable definition\n elif self.process_typevar_declaration(s):\n special_form = True\n elif self.process_paramspec_declaration(s):\n special_form = True\n # * type constructors\n elif self.analyze_namedtuple_assign(s):\n special_form = True\n elif self.analyze_typeddict_assign(s):\n special_form = True\n elif self.newtype_analyzer.process_newtype_declaration(s):\n special_form = True\n elif self.analyze_enum_assign(s):\n special_form = True\n if special_form:\n self.record_special_form_lvalue(s)\n return\n\n # OK, this is a regular assignment, perform the necessary analysis steps.\n s.is_final_def = self.unwrap_final(s)\n self.analyze_lvalues(s)\n self.check_final_implicit_def(s)\n self.check_classvar(s)\n self.process_type_annotation(s)\n self.apply_dynamic_class_hook(s)\n self.store_final_status(s)\n if not s.type:\n self.process_module_assignment(s.lvalues, s.rvalue, s)\n self.process__all__(s)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_identity_global_assignment_SemanticAnalyzer.analyze_identity_global_assignment.if_sym_is_None_.else_.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_identity_global_assignment_SemanticAnalyzer.analyze_identity_global_assignment.if_sym_is_None_.else_.return.True", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2014, "end_line": 2053, "span_ids": ["SemanticAnalyzer.analyze_identity_global_assignment"], "tokens": 351}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def analyze_identity_global_assignment(self, s: AssignmentStmt) -> bool:\n \"\"\"Special case 'X = X' in global scope.\n\n This allows supporting some important use cases.\n\n Return true if special casing was applied.\n \"\"\"\n if not isinstance(s.rvalue, NameExpr) or len(s.lvalues) != 1:\n # Not of form 'X = X'\n return False\n lvalue = s.lvalues[0]\n if not isinstance(lvalue, NameExpr) or s.rvalue.name != lvalue.name:\n # Not of form 'X = X'\n return False\n if self.type is not None or self.is_func_scope():\n # Not in global scope\n return False\n # It's an assignment like 'X = X' in the global scope.\n name = lvalue.name\n sym = self.lookup(name, s)\n if sym is None:\n if self.final_iteration:\n # Fall back to normal assignment analysis.\n return False\n else:\n self.defer()\n return True\n else:\n if sym.node is None:\n # Something special -- fall back to normal assignment analysis.\n return False\n if name not in self.globals:\n # The name is from builtins. Add an alias to the current module.\n self.add_symbol(name, sym.node, s)\n if not isinstance(sym.node, PlaceholderNode):\n for node in s.rvalue, lvalue:\n node.node = sym.node\n node.kind = GDEF\n node.fullname = sym.node.fullname\n return True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.should_wait_rhs_SemanticAnalyzer.should_wait_rhs.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.should_wait_rhs_SemanticAnalyzer.should_wait_rhs.return.False", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2055, "end_line": 2082, "span_ids": ["SemanticAnalyzer.should_wait_rhs"], "tokens": 316}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def should_wait_rhs(self, rv: Expression) -> bool:\n \"\"\"Can we already classify this r.h.s. of an assignment or should we wait?\n\n This returns True if we don't have enough information to decide whether\n an assignment is just a normal variable definition or a special form.\n Always return False if this is a final iteration. This will typically cause\n the lvalue to be classified as a variable plus emit an error.\n \"\"\"\n if self.final_iteration:\n # No chance, nothing has changed.\n return False\n if isinstance(rv, NameExpr):\n n = self.lookup(rv.name, rv)\n if n and isinstance(n.node, PlaceholderNode) and not n.node.becomes_typeinfo:\n return True\n elif isinstance(rv, MemberExpr):\n fname = get_member_expr_fullname(rv)\n if fname:\n n = self.lookup_qualified(fname, rv, suppress_errors=True)\n if n and isinstance(n.node, PlaceholderNode) and not n.node.becomes_typeinfo:\n return True\n elif isinstance(rv, IndexExpr) and isinstance(rv.base, RefExpr):\n return self.should_wait_rhs(rv.base)\n elif isinstance(rv, CallExpr) and isinstance(rv.callee, RefExpr):\n # This is only relevant for builtin SCC where things like 'TypeVar'\n # may be not ready.\n return self.should_wait_rhs(rv.callee)\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.can_be_type_alias_SemanticAnalyzer.can_be_type_alias.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.can_be_type_alias_SemanticAnalyzer.can_be_type_alias.return.False", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2084, "end_line": 2096, "span_ids": ["SemanticAnalyzer.can_be_type_alias"], "tokens": 132}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def can_be_type_alias(self, rv: Expression) -> bool:\n \"\"\"Is this a valid r.h.s. for an alias definition?\n\n Note: this function should be only called for expressions where self.should_wait_rhs()\n returns False.\n \"\"\"\n if isinstance(rv, RefExpr) and self.is_type_ref(rv, bare=True):\n return True\n if isinstance(rv, IndexExpr) and self.is_type_ref(rv.base, bare=False):\n return True\n if self.is_none_alias(rv):\n return True\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.is_type_ref_SemanticAnalyzer.is_type_ref.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.is_type_ref_SemanticAnalyzer.is_type_ref.return.False", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2098, "end_line": 2150, "span_ids": ["SemanticAnalyzer.is_type_ref"], "tokens": 516}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def is_type_ref(self, rv: Expression, bare: bool = False) -> bool:\n \"\"\"Does this expression refer to a type?\n\n This includes:\n * Special forms, like Any or Union\n * Classes (except subscripted enums)\n * Other type aliases\n * PlaceholderNodes with becomes_typeinfo=True (these can be not ready class\n definitions, and not ready aliases).\n\n If bare is True, this is not a base of an index expression, so some special\n forms are not valid (like a bare Union).\n\n Note: This method should be only used in context of a type alias definition.\n This method can only return True for RefExprs, to check if C[int] is a valid\n target for type alias call this method on expr.base (i.e. on C in C[int]).\n See also can_be_type_alias().\n \"\"\"\n if not isinstance(rv, RefExpr):\n return False\n if isinstance(rv.node, TypeVarExpr):\n self.fail('Type variable \"{}\" is invalid as target for type alias'.format(\n rv.fullname), rv)\n return False\n\n if bare:\n # These three are valid even if bare, for example\n # A = Tuple is just equivalent to A = Tuple[Any, ...].\n valid_refs = {'typing.Any', 'typing.Tuple', 'typing.Callable'}\n else:\n valid_refs = type_constructors\n\n if isinstance(rv.node, TypeAlias) or rv.fullname in valid_refs:\n return True\n if isinstance(rv.node, TypeInfo):\n if bare:\n return True\n # Assignment color = Color['RED'] defines a variable, not an alias.\n return not rv.node.is_enum\n\n if isinstance(rv, NameExpr):\n n = self.lookup(rv.name, rv)\n if n and isinstance(n.node, PlaceholderNode) and n.node.becomes_typeinfo:\n return True\n elif isinstance(rv, MemberExpr):\n fname = get_member_expr_fullname(rv)\n if fname:\n # The r.h.s. for variable definitions may not be a type reference but just\n # an instance attribute, so suppress the errors.\n n = self.lookup_qualified(fname, rv, suppress_errors=True)\n if n and isinstance(n.node, PlaceholderNode) and n.node.becomes_typeinfo:\n return True\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.is_none_alias_SemanticAnalyzer.is_none_alias.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.is_none_alias_SemanticAnalyzer.is_none_alias.return.False", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2152, "end_line": 2166, "span_ids": ["SemanticAnalyzer.is_none_alias"], "tokens": 195}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def is_none_alias(self, node: Expression) -> bool:\n \"\"\"Is this a r.h.s. for a None alias?\n\n We special case the assignments like Void = type(None), to allow using\n Void in type annotations.\n \"\"\"\n if isinstance(node, CallExpr):\n if (isinstance(node.callee, NameExpr) and len(node.args) == 1 and\n isinstance(node.args[0], NameExpr)):\n call = self.lookup_qualified(node.callee.name, node.callee)\n arg = self.lookup_qualified(node.args[0].name, node.args[0])\n if (call is not None and call.node and call.node.fullname == 'builtins.type' and\n arg is not None and arg.node and arg.node.fullname == 'builtins.None'):\n return True\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.record_special_form_lvalue_SemanticAnalyzer.analyze_enum_assign.return.self_enum_call_analyzer_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.record_special_form_lvalue_SemanticAnalyzer.analyze_enum_assign.return.self_enum_call_analyzer_p", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2168, "end_line": 2185, "span_ids": ["SemanticAnalyzer.analyze_enum_assign", "SemanticAnalyzer.record_special_form_lvalue"], "tokens": 207}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def record_special_form_lvalue(self, s: AssignmentStmt) -> None:\n \"\"\"Record minimal necessary information about l.h.s. of a special form.\n\n This exists mostly for compatibility with the old semantic analyzer.\n \"\"\"\n lvalue = s.lvalues[0]\n assert isinstance(lvalue, NameExpr)\n lvalue.is_special_form = True\n if self.current_symbol_kind() == GDEF:\n lvalue.fullname = self.qualified_name(lvalue.name)\n lvalue.kind = self.current_symbol_kind()\n\n def analyze_enum_assign(self, s: AssignmentStmt) -> bool:\n \"\"\"Check if s defines an Enum.\"\"\"\n if isinstance(s.rvalue, CallExpr) and isinstance(s.rvalue.analyzed, EnumCallExpr):\n # Already analyzed enum -- nothing to do here.\n return True\n return self.enum_call_analyzer.process_enum_call(s, self.is_func_scope())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_namedtuple_assign_SemanticAnalyzer.analyze_namedtuple_assign.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_namedtuple_assign_SemanticAnalyzer.analyze_namedtuple_assign.return.True", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2191, "end_line": 2213, "span_ids": ["SemanticAnalyzer.analyze_namedtuple_assign"], "tokens": 287}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def analyze_namedtuple_assign(self, s: AssignmentStmt) -> bool:\n \"\"\"Check if s defines a namedtuple.\"\"\"\n if isinstance(s.rvalue, CallExpr) and isinstance(s.rvalue.analyzed, NamedTupleExpr):\n return True # This is a valid and analyzed named tuple definition, nothing to do here.\n if len(s.lvalues) != 1 or not isinstance(s.lvalues[0], (NameExpr, MemberExpr)):\n return False\n lvalue = s.lvalues[0]\n name = lvalue.name\n internal_name, info = self.named_tuple_analyzer.check_namedtuple(s.rvalue, name,\n self.is_func_scope())\n if internal_name is None:\n return False\n if isinstance(lvalue, MemberExpr):\n self.fail(\"NamedTuple type as an attribute is not supported\", lvalue)\n return False\n if internal_name != name:\n self.fail('First argument to namedtuple() should be \"{}\", not \"{}\"'.format(\n name, internal_name), s.rvalue, code=codes.NAME_MATCH)\n return True\n # Yes, it's a valid namedtuple, but defer if it is not ready.\n if not info:\n self.mark_incomplete(name, lvalue, becomes_typeinfo=True)\n return True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_typeddict_assign_SemanticAnalyzer.analyze_typeddict_assign.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_typeddict_assign_SemanticAnalyzer.analyze_typeddict_assign.return.True", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2211, "end_line": 2229, "span_ids": ["SemanticAnalyzer.analyze_typeddict_assign"], "tokens": 248}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def analyze_typeddict_assign(self, s: AssignmentStmt) -> bool:\n \"\"\"Check if s defines a typed dict.\"\"\"\n if isinstance(s.rvalue, CallExpr) and isinstance(s.rvalue.analyzed, TypedDictExpr):\n return True # This is a valid and analyzed typed dict definition, nothing to do here.\n if len(s.lvalues) != 1 or not isinstance(s.lvalues[0], (NameExpr, MemberExpr)):\n return False\n lvalue = s.lvalues[0]\n name = lvalue.name\n is_typed_dict, info = self.typed_dict_analyzer.check_typeddict(s.rvalue, name,\n self.is_func_scope())\n if not is_typed_dict:\n return False\n if isinstance(lvalue, MemberExpr):\n self.fail(\"TypedDict type as attribute is not supported\", lvalue)\n return False\n # Yes, it's a valid typed dict, but defer if it is not ready.\n if not info:\n self.mark_incomplete(name, lvalue, becomes_typeinfo=True)\n return True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_lvalues_SemanticAnalyzer.analyze_lvalues.for_lval_in_s_lvalues_.self_analyze_lvalue_lval_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_lvalues_SemanticAnalyzer.analyze_lvalues.for_lval_in_s_lvalues_.self_analyze_lvalue_lval_", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2231, "end_line": 2242, "span_ids": ["SemanticAnalyzer.analyze_lvalues"], "tokens": 145}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def analyze_lvalues(self, s: AssignmentStmt) -> None:\n # We cannot use s.type, because analyze_simple_literal_type() will set it.\n explicit = s.unanalyzed_type is not None\n if self.is_final_type(s.unanalyzed_type):\n # We need to exclude bare Final.\n assert isinstance(s.unanalyzed_type, UnboundType)\n if not s.unanalyzed_type.args:\n explicit = False\n for lval in s.lvalues:\n self.analyze_lvalue(lval,\n explicit_type=explicit,\n is_final=s.is_final_def)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.apply_dynamic_class_hook_SemanticAnalyzer.apply_dynamic_class_hook.if_fname_.if_hook_.hook_DynamicClassDefConte": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.apply_dynamic_class_hook_SemanticAnalyzer.apply_dynamic_class_hook.if_fname_.if_hook_.hook_DynamicClassDefConte", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2244, "end_line": 2263, "span_ids": ["SemanticAnalyzer.apply_dynamic_class_hook"], "tokens": 215}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def apply_dynamic_class_hook(self, s: AssignmentStmt) -> None:\n if len(s.lvalues) > 1:\n return\n lval = s.lvalues[0]\n if not isinstance(lval, NameExpr) or not isinstance(s.rvalue, CallExpr):\n return\n call = s.rvalue\n fname = None\n if isinstance(call.callee, RefExpr):\n fname = call.callee.fullname\n # check if method call\n if fname is None and isinstance(call.callee, MemberExpr):\n callee_expr = call.callee.expr\n if isinstance(callee_expr, RefExpr) and callee_expr.fullname:\n method_name = call.callee.name\n fname = callee_expr.fullname + '.' + method_name\n if fname:\n hook = self.plugin.get_dynamic_class_hook(fname)\n if hook:\n hook(DynamicClassDefContext(call, lval.name, self))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.unwrap_final_SemanticAnalyzer.unwrap_final.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.unwrap_final_SemanticAnalyzer.unwrap_final.return.True", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2265, "end_line": 2309, "span_ids": ["SemanticAnalyzer.unwrap_final"], "tokens": 500}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def unwrap_final(self, s: AssignmentStmt) -> bool:\n \"\"\"Strip Final[...] if present in an assignment.\n\n This is done to invoke type inference during type checking phase for this\n assignment. Also, Final[...] desn't affect type in any way -- it is rather an\n access qualifier for given `Var`.\n\n Also perform various consistency checks.\n\n Returns True if Final[...] was present.\n \"\"\"\n if not s.unanalyzed_type or not self.is_final_type(s.unanalyzed_type):\n return False\n assert isinstance(s.unanalyzed_type, UnboundType)\n if len(s.unanalyzed_type.args) > 1:\n self.fail(\"Final[...] takes at most one type argument\", s.unanalyzed_type)\n invalid_bare_final = False\n if not s.unanalyzed_type.args:\n s.type = None\n if isinstance(s.rvalue, TempNode) and s.rvalue.no_rhs:\n invalid_bare_final = True\n self.fail(\"Type in Final[...] can only be omitted if there is an initializer\", s)\n else:\n s.type = s.unanalyzed_type.args[0]\n if len(s.lvalues) != 1 or not isinstance(s.lvalues[0], RefExpr):\n self.fail(\"Invalid final declaration\", s)\n return False\n lval = s.lvalues[0]\n assert isinstance(lval, RefExpr)\n\n # Reset inferred status if it was set due to simple literal rvalue on previous iteration.\n # TODO: this is a best-effort quick fix, we should avoid the need to manually sync this,\n # see https://github.com/python/mypy/issues/6458.\n if lval.is_new_def:\n lval.is_inferred_def = s.type is None\n\n if self.loop_depth > 0:\n self.fail(\"Cannot use Final inside a loop\", s)\n if self.type and self.type.is_protocol:\n self.msg.protocol_members_cant_be_final(s)\n if (isinstance(s.rvalue, TempNode) and s.rvalue.no_rhs and\n not self.is_stub_file and not self.is_class_scope()):\n if not invalid_bare_final: # Skip extra error messages.\n self.msg.final_without_value(s)\n return True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.check_final_implicit_def_SemanticAnalyzer.check_final_implicit_def.if_isinstance_lval_Membe.if_not_self_is_self_membe.else_.if_self_function_stack_1.return": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.check_final_implicit_def_SemanticAnalyzer.check_final_implicit_def.if_isinstance_lval_Membe.if_not_self_is_self_membe.else_.if_self_function_stack_1.return", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2311, "end_line": 2330, "span_ids": ["SemanticAnalyzer.check_final_implicit_def"], "tokens": 199}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def check_final_implicit_def(self, s: AssignmentStmt) -> None:\n \"\"\"Do basic checks for final declaration on self in __init__.\n\n Additional re-definition checks are performed by `analyze_lvalue`.\n \"\"\"\n if not s.is_final_def:\n return\n lval = s.lvalues[0]\n assert isinstance(lval, RefExpr)\n if isinstance(lval, MemberExpr):\n if not self.is_self_member_ref(lval):\n self.fail(\"Final can be only applied to a name or an attribute on self\", s)\n s.is_final_def = False\n return\n else:\n assert self.function_stack\n if self.function_stack[-1].name != '__init__':\n self.fail(\"Can only declare a final attribute in class body or __init__\", s)\n s.is_final_def = False\n return", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.store_final_status_SemanticAnalyzer.store_final_status.if_s_is_final_def_.else_.for_lval_in_self_flatten_.if_isinstance_lval_Membe.if_cur_node_and_isinstanc.if_top_function_name_.s.is_final_def.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.store_final_status_SemanticAnalyzer.store_final_status.if_s_is_final_def_.else_.for_lval_in_self_flatten_.if_isinstance_lval_Membe.if_cur_node_and_isinstanc.if_top_function_name_.s.is_final_def.True", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2332, "end_line": 2359, "span_ids": ["SemanticAnalyzer.store_final_status"], "tokens": 365}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def store_final_status(self, s: AssignmentStmt) -> None:\n \"\"\"If this is a locally valid final declaration, set the corresponding flag on `Var`.\"\"\"\n if s.is_final_def:\n if len(s.lvalues) == 1 and isinstance(s.lvalues[0], RefExpr):\n node = s.lvalues[0].node\n if isinstance(node, Var):\n node.is_final = True\n node.final_value = self.unbox_literal(s.rvalue)\n if (self.is_class_scope() and\n (isinstance(s.rvalue, TempNode) and s.rvalue.no_rhs)):\n node.final_unset_in_class = True\n else:\n # Special case: deferred initialization of a final attribute in __init__.\n # In this case we just pretend this is a valid final definition to suppress\n # errors about assigning to final attribute.\n for lval in self.flatten_lvalues(s.lvalues):\n if isinstance(lval, MemberExpr) and self.is_self_member_ref(lval):\n assert self.type, \"Self member outside a class\"\n cur_node = self.type.names.get(lval.name, None)\n if cur_node and isinstance(cur_node.node, Var) and cur_node.node.is_final:\n assert self.function_stack\n top_function = self.function_stack[-1]\n if (top_function.name == '__init__' and\n cur_node.node.final_unset_in_class and\n not cur_node.node.final_set_in_init and\n not (isinstance(s.rvalue, TempNode) and s.rvalue.no_rhs)):\n cur_node.node.final_set_in_init = True\n s.is_final_def = True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.flatten_lvalues_SemanticAnalyzer.unbox_literal.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.flatten_lvalues_SemanticAnalyzer.unbox_literal.return.None", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2361, "end_line": 2375, "span_ids": ["SemanticAnalyzer.flatten_lvalues", "SemanticAnalyzer.unbox_literal"], "tokens": 171}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def flatten_lvalues(self, lvalues: List[Expression]) -> List[Expression]:\n res = [] # type: List[Expression]\n for lv in lvalues:\n if isinstance(lv, (TupleExpr, ListExpr)):\n res.extend(self.flatten_lvalues(lv.items))\n else:\n res.append(lv)\n return res\n\n def unbox_literal(self, e: Expression) -> Optional[Union[int, float, bool, str]]:\n if isinstance(e, (IntExpr, FloatExpr, StrExpr)):\n return e.value\n elif isinstance(e, NameExpr) and e.name in ('True', 'False'):\n return True if e.name == 'True' else False\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.process_type_annotation_SemanticAnalyzer.is_annotated_protocol_member.return.any_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.process_type_annotation_SemanticAnalyzer.is_annotated_protocol_member.return.any_", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2377, "end_line": 2415, "span_ids": ["SemanticAnalyzer.is_annotated_protocol_member", "SemanticAnalyzer.process_type_annotation"], "tokens": 423}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def process_type_annotation(self, s: AssignmentStmt) -> None:\n \"\"\"Analyze type annotation or infer simple literal type.\"\"\"\n if s.type:\n lvalue = s.lvalues[-1]\n allow_tuple_literal = isinstance(lvalue, TupleExpr)\n analyzed = self.anal_type(s.type, allow_tuple_literal=allow_tuple_literal)\n # Don't store not ready types (including placeholders).\n if analyzed is None or has_placeholder(analyzed):\n return\n s.type = analyzed\n if (self.type and self.type.is_protocol and isinstance(lvalue, NameExpr) and\n isinstance(s.rvalue, TempNode) and s.rvalue.no_rhs):\n if isinstance(lvalue.node, Var):\n lvalue.node.is_abstract_var = True\n else:\n if (self.type and self.type.is_protocol and\n self.is_annotated_protocol_member(s) and not self.is_func_scope()):\n self.fail('All protocol members must have explicitly declared types', s)\n # Set the type if the rvalue is a simple literal (even if the above error occurred).\n if len(s.lvalues) == 1 and isinstance(s.lvalues[0], RefExpr):\n if s.lvalues[0].is_inferred_def:\n s.type = self.analyze_simple_literal_type(s.rvalue, s.is_final_def)\n if s.type:\n # Store type into nodes.\n for lvalue in s.lvalues:\n self.store_declared_types(lvalue, s.type)\n\n def is_annotated_protocol_member(self, s: AssignmentStmt) -> bool:\n \"\"\"Check whether a protocol member is annotated.\n\n There are some exceptions that can be left unannotated, like ``__slots__``.\"\"\"\n return any(\n (\n isinstance(lv, NameExpr)\n and lv.name != '__slots__'\n and lv.is_inferred_def\n )\n for lv in s.lvalues\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_simple_literal_type_SemanticAnalyzer.analyze_simple_literal_type.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_simple_literal_type_SemanticAnalyzer.analyze_simple_literal_type.return.None", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2417, "end_line": 2455, "span_ids": ["SemanticAnalyzer.analyze_simple_literal_type"], "tokens": 378}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def analyze_simple_literal_type(self, rvalue: Expression, is_final: bool) -> Optional[Type]:\n \"\"\"Return builtins.int if rvalue is an int literal, etc.\n\n If this is a 'Final' context, we return \"Literal[...]\" instead.\"\"\"\n if self.options.semantic_analysis_only or self.function_stack:\n # Skip this if we're only doing the semantic analysis pass.\n # This is mostly to avoid breaking unit tests.\n # Also skip inside a function; this is to avoid confusing\n # the code that handles dead code due to isinstance()\n # inside type variables with value restrictions (like\n # AnyStr).\n return None\n if isinstance(rvalue, FloatExpr):\n return self.named_type_or_none('builtins.float')\n\n value = None # type: Optional[LiteralValue]\n type_name = None # type: Optional[str]\n if isinstance(rvalue, IntExpr):\n value, type_name = rvalue.value, 'builtins.int'\n if isinstance(rvalue, StrExpr):\n value, type_name = rvalue.value, 'builtins.str'\n if isinstance(rvalue, BytesExpr):\n value, type_name = rvalue.value, 'builtins.bytes'\n if isinstance(rvalue, UnicodeExpr):\n value, type_name = rvalue.value, 'builtins.unicode'\n\n if type_name is not None:\n assert value is not None\n typ = self.named_type_or_none(type_name)\n if typ and is_final:\n return typ.copy_modified(last_known_value=LiteralType(\n value=value,\n fallback=typ,\n line=typ.line,\n column=typ.column,\n ))\n return typ\n\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_alias_SemanticAnalyzer.analyze_alias.return.typ_alias_tvars_depends": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_alias_SemanticAnalyzer.analyze_alias.return.typ_alias_tvars_depends", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2457, "end_line": 2492, "span_ids": ["SemanticAnalyzer.analyze_alias"], "tokens": 379}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def analyze_alias(self, rvalue: Expression,\n allow_placeholder: bool = False) -> Tuple[Optional[Type], List[str],\n Set[str], List[str]]:\n \"\"\"Check if 'rvalue' is a valid type allowed for aliasing (e.g. not a type variable).\n\n If yes, return the corresponding type, a list of\n qualified type variable names for generic aliases, a set of names the alias depends on,\n and a list of type variables if the alias is generic.\n An schematic example for the dependencies:\n A = int\n B = str\n analyze_alias(Dict[A, B])[2] == {'__main__.A', '__main__.B'}\n \"\"\"\n dynamic = bool(self.function_stack and self.function_stack[-1].is_dynamic())\n global_scope = not self.type and not self.function_stack\n res = analyze_type_alias(rvalue,\n self,\n self.tvar_scope,\n self.plugin,\n self.options,\n self.is_typeshed_stub_file,\n allow_unnormalized=self.is_stub_file,\n allow_placeholder=allow_placeholder,\n in_dynamic_func=dynamic,\n global_scope=global_scope)\n typ = None # type: Optional[Type]\n if res:\n typ, depends_on = res\n found_type_vars = typ.accept(TypeVarLikeQuery(self.lookup_qualified, self.tvar_scope))\n alias_tvars = [name for (name, node) in found_type_vars]\n qualified_tvars = [node.fullname for (name, node) in found_type_vars]\n else:\n alias_tvars = []\n depends_on = set()\n qualified_tvars = []\n return typ, alias_tvars, depends_on, qualified_tvars", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.check_and_set_up_type_alias_SemanticAnalyzer.check_and_set_up_type_alias._type_Optional_Type_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.check_and_set_up_type_alias_SemanticAnalyzer.check_and_set_up_type_alias._type_Optional_Type_", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2494, "end_line": 2553, "span_ids": ["SemanticAnalyzer.check_and_set_up_type_alias"], "tokens": 633}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def check_and_set_up_type_alias(self, s: AssignmentStmt) -> bool:\n \"\"\"Check if assignment creates a type alias and set it up as needed.\n\n Return True if it is a type alias (even if the target is not ready),\n or False otherwise.\n\n Note: the resulting types for subscripted (including generic) aliases\n are also stored in rvalue.analyzed.\n \"\"\"\n lvalue = s.lvalues[0]\n if len(s.lvalues) > 1 or not isinstance(lvalue, NameExpr):\n # First rule: Only simple assignments like Alias = ... create aliases.\n return False\n if s.unanalyzed_type is not None:\n # Second rule: Explicit type (cls: Type[A] = A) always creates variable, not alias.\n return False\n\n existing = self.current_symbol_table().get(lvalue.name)\n # Third rule: type aliases can't be re-defined. For example:\n # A: Type[float] = int\n # A = float # OK, but this doesn't define an alias\n # B = int\n # B = float # Error!\n # Don't create an alias in these cases:\n if (existing\n and (isinstance(existing.node, Var) # existing variable\n or (isinstance(existing.node, TypeAlias)\n and not s.is_alias_def) # existing alias\n or (isinstance(existing.node, PlaceholderNode)\n and existing.node.node.line < s.line))): # previous incomplete definition\n # TODO: find a more robust way to track the order of definitions.\n # Note: if is_alias_def=True, this is just a node from previous iteration.\n if isinstance(existing.node, TypeAlias) and not s.is_alias_def:\n self.fail('Cannot assign multiple types to name \"{}\"'\n ' without an explicit \"Type[...]\" annotation'\n .format(lvalue.name), lvalue)\n return False\n\n non_global_scope = self.type or self.is_func_scope()\n if isinstance(s.rvalue, RefExpr) and non_global_scope:\n # Fourth rule (special case): Non-subscripted right hand side creates a variable\n # at class and function scopes. For example:\n #\n # class Model:\n # ...\n # class C:\n # model = Model # this is automatically a variable with type 'Type[Model]'\n #\n # without this rule, this typical use case will require a lot of explicit\n # annotations (see the second rule).\n return False\n rvalue = s.rvalue\n if not self.can_be_type_alias(rvalue):\n return False\n\n if existing and not isinstance(existing.node, (PlaceholderNode, TypeAlias)):\n # Cannot redefine existing node as type alias.\n return False\n\n res = None # type: Optional[Type]\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.check_and_set_up_type_alias.if_self_is_none_alias_rva_SemanticAnalyzer.check_and_set_up_type_alias.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.check_and_set_up_type_alias.if_self_is_none_alias_rva_SemanticAnalyzer.check_and_set_up_type_alias.return.True", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2558, "end_line": 2630, "span_ids": ["SemanticAnalyzer.check_and_set_up_type_alias"], "tokens": 857}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def check_and_set_up_type_alias(self, s: AssignmentStmt) -> bool:\n # ... other code\n if self.is_none_alias(rvalue):\n res = NoneType()\n alias_tvars, depends_on, qualified_tvars = \\\n [], set(), [] # type: List[str], Set[str], List[str]\n else:\n tag = self.track_incomplete_refs()\n res, alias_tvars, depends_on, qualified_tvars = \\\n self.analyze_alias(rvalue, allow_placeholder=True)\n if not res:\n return False\n # TODO: Maybe we only need to reject top-level placeholders, similar\n # to base classes.\n if self.found_incomplete_ref(tag) or has_placeholder(res):\n # Since we have got here, we know this must be a type alias (incomplete refs\n # may appear in nested positions), therefore use becomes_typeinfo=True.\n self.mark_incomplete(lvalue.name, rvalue, becomes_typeinfo=True)\n return True\n self.add_type_alias_deps(depends_on)\n # In addition to the aliases used, we add deps on unbound\n # type variables, since they are erased from target type.\n self.add_type_alias_deps(qualified_tvars)\n # The above are only direct deps on other aliases.\n # For subscripted aliases, type deps from expansion are added in deps.py\n # (because the type is stored).\n check_for_explicit_any(res, self.options, self.is_typeshed_stub_file, self.msg,\n context=s)\n # When this type alias gets \"inlined\", the Any is not explicit anymore,\n # so we need to replace it with non-explicit Anys.\n if not has_placeholder(res):\n res = make_any_non_explicit(res)\n # Note: with the new (lazy) type alias representation we only need to set no_args to True\n # if the expected number of arguments is non-zero, so that aliases like A = List work.\n # However, eagerly expanding aliases like Text = str is a nice performance optimization.\n no_args = isinstance(res, Instance) and not res.args # type: ignore\n fix_instance_types(res, self.fail, self.note, self.options.python_version)\n alias_node = TypeAlias(res, self.qualified_name(lvalue.name), s.line, s.column,\n alias_tvars=alias_tvars, no_args=no_args)\n if isinstance(s.rvalue, (IndexExpr, CallExpr)): # CallExpr is for `void = type(None)`\n s.rvalue.analyzed = TypeAliasExpr(alias_node)\n s.rvalue.analyzed.line = s.line\n # we use the column from resulting target, to get better location for errors\n s.rvalue.analyzed.column = res.column\n elif isinstance(s.rvalue, RefExpr):\n s.rvalue.is_alias_rvalue = True\n\n if existing:\n # An alias gets updated.\n updated = False\n if isinstance(existing.node, TypeAlias):\n if existing.node.target != res:\n # Copy expansion to the existing alias, this matches how we update base classes\n # for a TypeInfo _in place_ if there are nested placeholders.\n existing.node.target = res\n existing.node.alias_tvars = alias_tvars\n existing.node.no_args = no_args\n updated = True\n else:\n # Otherwise just replace existing placeholder with type alias.\n existing.node = alias_node\n updated = True\n if updated:\n if self.final_iteration:\n self.cannot_resolve_name(lvalue.name, 'name', s)\n return True\n else:\n self.progress = True\n # We need to defer so that this change can get propagated to base classes.\n self.defer(s)\n else:\n self.add_symbol(lvalue.name, alias_node, s)\n if isinstance(rvalue, RefExpr) and isinstance(rvalue.node, TypeAlias):\n alias_node.normalized = rvalue.node.normalized\n return True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_lvalue_SemanticAnalyzer.analyze_lvalue.if_isinstance_lval_NameE.else_.self_fail_Invalid_assign": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_lvalue_SemanticAnalyzer.analyze_lvalue.if_isinstance_lval_NameE.else_.self_fail_Invalid_assign", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2628, "end_line": 2665, "span_ids": ["SemanticAnalyzer.analyze_lvalue"], "tokens": 405}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def analyze_lvalue(self,\n lval: Lvalue,\n nested: bool = False,\n explicit_type: bool = False,\n is_final: bool = False,\n escape_comprehensions: bool = False) -> None:\n \"\"\"Analyze an lvalue or assignment target.\n\n Args:\n lval: The target lvalue\n nested: If true, the lvalue is within a tuple or list lvalue expression\n explicit_type: Assignment has type annotation\n escape_comprehensions: If we are inside a comprehension, set the variable\n in the enclosing scope instead. This implements\n https://www.python.org/dev/peps/pep-0572/#scope-of-the-target\n \"\"\"\n if escape_comprehensions:\n assert isinstance(lval, NameExpr), \"assignment expression target must be NameExpr\"\n if isinstance(lval, NameExpr):\n self.analyze_name_lvalue(lval, explicit_type, is_final, escape_comprehensions)\n elif isinstance(lval, MemberExpr):\n self.analyze_member_lvalue(lval, explicit_type, is_final)\n if explicit_type and not self.is_self_member_ref(lval):\n self.fail('Type cannot be declared in assignment to non-self '\n 'attribute', lval)\n elif isinstance(lval, IndexExpr):\n if explicit_type:\n self.fail('Unexpected type declaration', lval)\n lval.accept(self)\n elif isinstance(lval, TupleExpr):\n self.analyze_tuple_or_list_lvalue(lval, explicit_type)\n elif isinstance(lval, StarExpr):\n if nested:\n self.analyze_lvalue(lval.expr, nested, explicit_type)\n else:\n self.fail('Starred assignment target must be in a list or tuple', lval)\n else:\n self.fail('Invalid assignment target', lval)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_name_lvalue_SemanticAnalyzer.analyze_name_lvalue.if_not_existing_or_isins.else_.self_make_name_lvalue_poi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_name_lvalue_SemanticAnalyzer.analyze_name_lvalue.if_not_existing_or_isins.else_.self_make_name_lvalue_poi", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2667, "end_line": 2714, "span_ids": ["SemanticAnalyzer.analyze_name_lvalue"], "tokens": 446}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def analyze_name_lvalue(self,\n lvalue: NameExpr,\n explicit_type: bool,\n is_final: bool,\n escape_comprehensions: bool) -> None:\n \"\"\"Analyze an lvalue that targets a name expression.\n\n Arguments are similar to \"analyze_lvalue\".\n \"\"\"\n if lvalue.node:\n # This has been bound already in a previous iteration.\n return\n\n name = lvalue.name\n if self.is_alias_for_final_name(name):\n if is_final:\n self.fail(\"Cannot redefine an existing name as final\", lvalue)\n else:\n self.msg.cant_assign_to_final(name, self.type is not None, lvalue)\n\n kind = self.current_symbol_kind()\n names = self.current_symbol_table()\n existing = names.get(name)\n\n outer = self.is_global_or_nonlocal(name)\n if (not existing or isinstance(existing.node, PlaceholderNode)) and not outer:\n # Define new variable.\n var = self.make_name_lvalue_var(lvalue, kind, not explicit_type)\n added = self.add_symbol(name, var, lvalue, escape_comprehensions=escape_comprehensions)\n # Only bind expression if we successfully added name to symbol table.\n if added:\n lvalue.is_new_def = True\n lvalue.is_inferred_def = True\n lvalue.kind = kind\n lvalue.node = var\n if kind == GDEF:\n lvalue.fullname = var._fullname\n else:\n lvalue.fullname = lvalue.name\n if self.is_func_scope():\n if unmangle(name) == '_':\n # Special case for assignment to local named '_': always infer 'Any'.\n typ = AnyType(TypeOfAny.special_form)\n self.store_declared_types(lvalue, typ)\n if is_final and self.is_final_redefinition(kind, name):\n self.fail(\"Cannot redefine an existing name as final\", lvalue)\n else:\n self.make_name_lvalue_point_to_existing_def(lvalue, explicit_type, is_final)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.is_final_redefinition_SemanticAnalyzer.is_alias_for_final_name.if_self_is_func_scope_.else_.return.existing_is_not_None_and_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.is_final_redefinition_SemanticAnalyzer.is_alias_for_final_name.if_self_is_func_scope_.else_.return.existing_is_not_None_and_", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2716, "end_line": 2743, "span_ids": ["SemanticAnalyzer.is_final_redefinition", "SemanticAnalyzer.is_alias_for_final_name"], "tokens": 289}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def is_final_redefinition(self, kind: int, name: str) -> bool:\n if kind == GDEF:\n return self.is_mangled_global(name) and not self.is_initial_mangled_global(name)\n elif kind == MDEF and self.type:\n return unmangle(name) + \"'\" in self.type.names\n return False\n\n def is_alias_for_final_name(self, name: str) -> bool:\n if self.is_func_scope():\n if not name.endswith(\"'\"):\n # Not a mangled name -- can't be an alias\n return False\n name = unmangle(name)\n assert self.locals[-1] is not None, \"No locals at function scope\"\n existing = self.locals[-1].get(name)\n return existing is not None and is_final_node(existing.node)\n elif self.type is not None:\n orig_name = unmangle(name) + \"'\"\n if name == orig_name:\n return False\n existing = self.type.names.get(orig_name)\n return existing is not None and is_final_node(existing.node)\n else:\n orig_name = unmangle(name) + \"'\"\n if name == orig_name:\n return False\n existing = self.globals.get(orig_name)\n return existing is not None and is_final_node(existing.node)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.make_name_lvalue_var_SemanticAnalyzer.make_name_lvalue_var.return.v": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.make_name_lvalue_var_SemanticAnalyzer.make_name_lvalue_var.return.v", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2745, "end_line": 2760, "span_ids": ["SemanticAnalyzer.make_name_lvalue_var"], "tokens": 173}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def make_name_lvalue_var(self, lvalue: NameExpr, kind: int, inferred: bool) -> Var:\n \"\"\"Return a Var node for an lvalue that is a name expression.\"\"\"\n v = Var(lvalue.name)\n v.set_line(lvalue)\n v.is_inferred = inferred\n if kind == MDEF:\n assert self.type is not None\n v.info = self.type\n v.is_initialized_in_class = True\n if kind != LDEF:\n v._fullname = self.qualified_name(lvalue.name)\n else:\n # fullanme should never stay None\n v._fullname = lvalue.name\n v.is_ready = False # Type not inferred yet\n return v", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.make_name_lvalue_point_to_existing_def_SemanticAnalyzer.make_name_lvalue_point_to_existing_def.if_explicit_type_.else_.self_check_lvalue_validit": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.make_name_lvalue_point_to_existing_def_SemanticAnalyzer.make_name_lvalue_point_to_existing_def.if_explicit_type_.else_.self_check_lvalue_validit", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2762, "end_line": 2789, "span_ids": ["SemanticAnalyzer.make_name_lvalue_point_to_existing_def"], "tokens": 275}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def make_name_lvalue_point_to_existing_def(\n self,\n lval: NameExpr,\n explicit_type: bool,\n is_final: bool) -> None:\n \"\"\"Update an lvalue to point to existing definition in the same scope.\n\n Arguments are similar to \"analyze_lvalue\".\n\n Assume that an existing name exists.\n \"\"\"\n if is_final:\n # Redefining an existing name with final is always an error.\n self.fail(\"Cannot redefine an existing name as final\", lval)\n original_def = self.lookup(lval.name, lval, suppress_errors=True)\n if original_def is None and self.type and not self.is_func_scope():\n # Workaround to allow \"x, x = ...\" in class body.\n original_def = self.type.get(lval.name)\n if explicit_type:\n # Don't re-bind if there is a type annotation.\n self.name_already_defined(lval.name, lval, original_def)\n else:\n # Bind to an existing name.\n if original_def:\n self.bind_name_expr(lval, original_def)\n else:\n self.name_not_defined(lval.name, lval)\n self.check_lvalue_validity(lval.node, lval)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_tuple_or_list_lvalue_SemanticAnalyzer.analyze_tuple_or_list_lvalue.if_len_star_exprs_1_.else_.for_i_in_items_.self_analyze_lvalue_i_ne": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_tuple_or_list_lvalue_SemanticAnalyzer.analyze_tuple_or_list_lvalue.if_len_star_exprs_1_.else_.for_i_in_items_.self_analyze_lvalue_i_ne", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2791, "end_line": 2803, "span_ids": ["SemanticAnalyzer.analyze_tuple_or_list_lvalue"], "tokens": 162}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def analyze_tuple_or_list_lvalue(self, lval: TupleExpr,\n explicit_type: bool = False) -> None:\n \"\"\"Analyze an lvalue or assignment target that is a list or tuple.\"\"\"\n items = lval.items\n star_exprs = [item for item in items if isinstance(item, StarExpr)]\n\n if len(star_exprs) > 1:\n self.fail('Two starred expressions in assignment', lval)\n else:\n if len(star_exprs) == 1:\n star_exprs[0].valid = True\n for i in items:\n self.analyze_lvalue(i, nested=True, explicit_type=explicit_type)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_member_lvalue_SemanticAnalyzer.analyze_member_lvalue.self_check_lvalue_validit": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_member_lvalue_SemanticAnalyzer.analyze_member_lvalue.self_check_lvalue_validit", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2805, "end_line": 2852, "span_ids": ["SemanticAnalyzer.analyze_member_lvalue"], "tokens": 560}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def analyze_member_lvalue(self, lval: MemberExpr, explicit_type: bool, is_final: bool) -> None:\n \"\"\"Analyze lvalue that is a member expression.\n\n Arguments:\n lval: The target lvalue\n explicit_type: Assignment has type annotation\n is_final: Is the target final\n \"\"\"\n if lval.node:\n # This has been bound already in a previous iteration.\n return\n lval.accept(self)\n if self.is_self_member_ref(lval):\n assert self.type, \"Self member outside a class\"\n cur_node = self.type.names.get(lval.name)\n node = self.type.get(lval.name)\n if cur_node and is_final:\n # Overrides will be checked in type checker.\n self.fail(\"Cannot redefine an existing name as final\", lval)\n # On first encounter with this definition, if this attribute was defined before\n # with an inferred type and it's marked with an explicit type now, give an error.\n if (not lval.node and cur_node and isinstance(cur_node.node, Var) and\n cur_node.node.is_inferred and explicit_type):\n self.attribute_already_defined(lval.name, lval, cur_node)\n # If the attribute of self is not defined in superclasses, create a new Var, ...\n if (node is None\n or (isinstance(node.node, Var) and node.node.is_abstract_var)\n # ... also an explicit declaration on self also creates a new Var.\n # Note that `explicit_type` might has been erased for bare `Final`,\n # so we also check if `is_final` is passed.\n or (cur_node is None and (explicit_type or is_final))):\n if self.type.is_protocol and node is None:\n self.fail(\"Protocol members cannot be defined via assignment to self\", lval)\n else:\n # Implicit attribute definition in __init__.\n lval.is_new_def = True\n lval.is_inferred_def = True\n v = Var(lval.name)\n v.set_line(lval)\n v._fullname = self.qualified_name(lval.name)\n v.info = self.type\n v.is_ready = False\n v.explicit_self_type = explicit_type or is_final\n lval.def_var = v\n lval.node = v\n # TODO: should we also set lval.kind = MDEF?\n self.type.names[lval.name] = SymbolTableNode(MDEF, v, implicit=True)\n self.check_lvalue_validity(lval.node, lval)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.is_self_member_ref_SemanticAnalyzer.check_lvalue_validity.if_isinstance_node_TypeV.elif_isinstance_node_Typ.self_fail_message_registr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.is_self_member_ref_SemanticAnalyzer.check_lvalue_validity.if_isinstance_node_TypeV.elif_isinstance_node_Typ.self_fail_message_registr", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2854, "end_line": 2866, "span_ids": ["SemanticAnalyzer.is_self_member_ref", "SemanticAnalyzer.check_lvalue_validity"], "tokens": 152}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def is_self_member_ref(self, memberexpr: MemberExpr) -> bool:\n \"\"\"Does memberexpr to refer to an attribute of self?\"\"\"\n if not isinstance(memberexpr.expr, NameExpr):\n return False\n node = memberexpr.expr.node\n return isinstance(node, Var) and node.is_self\n\n def check_lvalue_validity(self, node: Union[Expression, SymbolNode, None],\n ctx: Context) -> None:\n if isinstance(node, TypeVarExpr):\n self.fail('Invalid assignment target', ctx)\n elif isinstance(node, TypeInfo):\n self.fail(message_registry.CANNOT_ASSIGN_TO_TYPE, ctx)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.store_declared_types_SemanticAnalyzer.store_declared_types.if_isinstance_lvalue_Ref.else_.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.store_declared_types_SemanticAnalyzer.store_declared_types.if_isinstance_lvalue_Ref.else_.pass", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2868, "end_line": 2897, "span_ids": ["SemanticAnalyzer.store_declared_types"], "tokens": 309}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def store_declared_types(self, lvalue: Lvalue, typ: Type) -> None:\n if isinstance(typ, StarType) and not isinstance(lvalue, StarExpr):\n self.fail('Star type only allowed for starred expressions', lvalue)\n if isinstance(lvalue, RefExpr):\n lvalue.is_inferred_def = False\n if isinstance(lvalue.node, Var):\n var = lvalue.node\n var.type = typ\n var.is_ready = True\n # If node is not a variable, we'll catch it elsewhere.\n elif isinstance(lvalue, TupleExpr):\n typ = get_proper_type(typ)\n if isinstance(typ, TupleType):\n if len(lvalue.items) != len(typ.items):\n self.fail('Incompatible number of tuple items', lvalue)\n return\n for item, itemtype in zip(lvalue.items, typ.items):\n self.store_declared_types(item, itemtype)\n else:\n self.fail('Tuple type expected for multiple variables',\n lvalue)\n elif isinstance(lvalue, StarExpr):\n # Historical behavior for the old parser\n if isinstance(typ, StarType):\n self.store_declared_types(lvalue.expr, typ.type)\n else:\n self.store_declared_types(lvalue.expr, typ)\n else:\n # This has been flagged elsewhere as an error, so just ignore here.\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.process_typevar_declaration_SemanticAnalyzer.process_typevar_declaration.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.process_typevar_declaration_SemanticAnalyzer.process_typevar_declaration.return.True", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2903, "end_line": 2978, "span_ids": ["SemanticAnalyzer.process_typevar_declaration"], "tokens": 699}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def process_typevar_declaration(self, s: AssignmentStmt) -> bool:\n \"\"\"Check if s declares a TypeVar; it yes, store it in symbol table.\n\n Return True if this looks like a type variable declaration (but maybe\n with errors), otherwise return False.\n \"\"\"\n call = self.get_typevarlike_declaration(s, (\"typing.TypeVar\",))\n if not call:\n return False\n\n lvalue = s.lvalues[0]\n assert isinstance(lvalue, NameExpr)\n if s.type:\n self.fail(\"Cannot declare the type of a type variable\", s)\n return False\n\n name = lvalue.name\n if not self.check_typevarlike_name(call, name, s):\n return False\n\n # Constraining types\n n_values = call.arg_kinds[1:].count(ARG_POS)\n values = self.analyze_value_types(call.args[1:1 + n_values])\n\n res = self.process_typevar_parameters(call.args[1 + n_values:],\n call.arg_names[1 + n_values:],\n call.arg_kinds[1 + n_values:],\n n_values,\n s)\n if res is None:\n return False\n variance, upper_bound = res\n\n existing = self.current_symbol_table().get(name)\n if existing and not (isinstance(existing.node, PlaceholderNode) or\n # Also give error for another type variable with the same name.\n (isinstance(existing.node, TypeVarExpr) and\n existing.node is call.analyzed)):\n self.fail('Cannot redefine \"%s\" as a type variable' % name, s)\n return False\n\n if self.options.disallow_any_unimported:\n for idx, constraint in enumerate(values, start=1):\n if has_any_from_unimported_type(constraint):\n prefix = \"Constraint {}\".format(idx)\n self.msg.unimported_type_becomes_any(prefix, constraint, s)\n\n if has_any_from_unimported_type(upper_bound):\n prefix = \"Upper bound of type variable\"\n self.msg.unimported_type_becomes_any(prefix, upper_bound, s)\n\n for t in values + [upper_bound]:\n check_for_explicit_any(t, self.options, self.is_typeshed_stub_file, self.msg,\n context=s)\n\n # mypyc suppresses making copies of a function to check each\n # possible type, so set the upper bound to Any to prevent that\n # from causing errors.\n if values and self.options.mypyc:\n upper_bound = AnyType(TypeOfAny.implementation_artifact)\n\n # Yes, it's a valid type variable definition! Add it to the symbol table.\n if not call.analyzed:\n type_var = TypeVarExpr(name, self.qualified_name(name),\n values, upper_bound, variance)\n type_var.line = call.line\n call.analyzed = type_var\n else:\n assert isinstance(call.analyzed, TypeVarExpr)\n if call.analyzed.values != values or call.analyzed.upper_bound != upper_bound:\n self.progress = True\n call.analyzed.upper_bound = upper_bound\n call.analyzed.values = values\n\n self.add_symbol(name, call.analyzed, s)\n return True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.check_typevarlike_name_SemanticAnalyzer.check_typevarlike_name.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.check_typevarlike_name_SemanticAnalyzer.check_typevarlike_name.return.True", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2980, "end_line": 2999, "span_ids": ["SemanticAnalyzer.check_typevarlike_name"], "tokens": 260}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def check_typevarlike_name(self, call: CallExpr, name: str, context: Context) -> bool:\n \"\"\"Checks that the name of a TypeVar or ParamSpec matches its variable.\"\"\"\n name = unmangle(name)\n assert isinstance(call.callee, RefExpr)\n typevarlike_type = (\n call.callee.name if isinstance(call.callee, NameExpr) else call.callee.fullname\n )\n if len(call.args) < 1:\n self.fail(\"Too few arguments for {}()\".format(typevarlike_type), context)\n return False\n if (not isinstance(call.args[0], (StrExpr, BytesExpr, UnicodeExpr))\n or not call.arg_kinds[0] == ARG_POS):\n self.fail(\"{}() expects a string literal as first argument\".format(typevarlike_type),\n context)\n return False\n elif call.args[0].value != name:\n msg = 'String argument 1 \"{}\" to {}(...) does not match variable name \"{}\"'\n self.fail(msg.format(call.args[0].value, typevarlike_type, name), context)\n return False\n return True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.get_typevarlike_declaration_SemanticAnalyzer.get_typevarlike_declaration.return.call": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.get_typevarlike_declaration_SemanticAnalyzer.get_typevarlike_declaration.return.call", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2997, "end_line": 3012, "span_ids": ["SemanticAnalyzer.get_typevarlike_declaration"], "tokens": 172}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def get_typevarlike_declaration(self, s: AssignmentStmt,\n typevarlike_types: Tuple[str, ...]) -> Optional[CallExpr]:\n \"\"\"Returns the call expression if `s` is a declaration of `typevarlike_type`\n (TypeVar or ParamSpec), or None otherwise.\n \"\"\"\n if len(s.lvalues) != 1 or not isinstance(s.lvalues[0], NameExpr):\n return None\n if not isinstance(s.rvalue, CallExpr):\n return None\n call = s.rvalue\n callee = call.callee\n if not isinstance(callee, RefExpr):\n return None\n if callee.fullname not in typevarlike_types:\n return None\n return call", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.process_typevar_parameters_SemanticAnalyzer.process_typevar_parameters.return.variance_upper_bound": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.process_typevar_parameters_SemanticAnalyzer.process_typevar_parameters.return.variance_upper_bound", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3018, "end_line": 3099, "span_ids": ["SemanticAnalyzer.process_typevar_parameters"], "tokens": 796}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def process_typevar_parameters(self, args: List[Expression],\n names: List[Optional[str]],\n kinds: List[int],\n num_values: int,\n context: Context) -> Optional[Tuple[int, Type]]:\n has_values = (num_values > 0)\n covariant = False\n contravariant = False\n upper_bound = self.object_type() # type: Type\n for param_value, param_name, param_kind in zip(args, names, kinds):\n if not param_kind == ARG_NAMED:\n self.fail(\"Unexpected argument to TypeVar()\", context)\n return None\n if param_name == 'covariant':\n if isinstance(param_value, NameExpr):\n if param_value.name == 'True':\n covariant = True\n else:\n self.fail(\"TypeVar 'covariant' may only be 'True'\", context)\n return None\n else:\n self.fail(\"TypeVar 'covariant' may only be 'True'\", context)\n return None\n elif param_name == 'contravariant':\n if isinstance(param_value, NameExpr):\n if param_value.name == 'True':\n contravariant = True\n else:\n self.fail(\"TypeVar 'contravariant' may only be 'True'\", context)\n return None\n else:\n self.fail(\"TypeVar 'contravariant' may only be 'True'\", context)\n return None\n elif param_name == 'bound':\n if has_values:\n self.fail(\"TypeVar cannot have both values and an upper bound\", context)\n return None\n try:\n # We want to use our custom error message below, so we suppress\n # the default error message for invalid types here.\n analyzed = self.expr_to_analyzed_type(param_value,\n allow_placeholder=True,\n report_invalid_types=False)\n if analyzed is None:\n # Type variables are special: we need to place them in the symbol table\n # soon, even if upper bound is not ready yet. Otherwise avoiding\n # a \"deadlock\" in this common pattern would be tricky:\n # T = TypeVar('T', bound=Custom[Any])\n # class Custom(Generic[T]):\n # ...\n analyzed = PlaceholderType(None, [], context.line)\n upper_bound = get_proper_type(analyzed)\n if isinstance(upper_bound, AnyType) and upper_bound.is_from_error:\n self.fail('TypeVar \"bound\" must be a type', param_value)\n # Note: we do not return 'None' here -- we want to continue\n # using the AnyType as the upper bound.\n except TypeTranslationError:\n self.fail('TypeVar \"bound\" must be a type', param_value)\n return None\n elif param_name == 'values':\n # Probably using obsolete syntax with values=(...). Explain the current syntax.\n self.fail('TypeVar \"values\" argument not supported', context)\n self.fail(\"Use TypeVar('T', t, ...) instead of TypeVar('T', values=(t, ...))\",\n context)\n return None\n else:\n self.fail('Unexpected argument to TypeVar(): \"{}\"'.format(param_name), context)\n return None\n\n if covariant and contravariant:\n self.fail(\"TypeVar cannot be both covariant and contravariant\", context)\n return None\n elif num_values == 1:\n self.fail(\"TypeVar cannot have only a single constraint\", context)\n return None\n elif covariant:\n variance = COVARIANT\n elif contravariant:\n variance = CONTRAVARIANT\n else:\n variance = INVARIANT\n return variance, upper_bound", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.process_paramspec_declaration_SemanticAnalyzer.process_paramspec_declaration.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.process_paramspec_declaration_SemanticAnalyzer.process_paramspec_declaration.return.True", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3101, "end_line": 3136, "span_ids": ["SemanticAnalyzer.process_paramspec_declaration"], "tokens": 342}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def process_paramspec_declaration(self, s: AssignmentStmt) -> bool:\n \"\"\"Checks if s declares a ParamSpec; if yes, store it in symbol table.\n\n Return True if this looks like a ParamSpec (maybe with errors), otherwise return False.\n\n In the future, ParamSpec may accept bounds and variance arguments, in which\n case more aggressive sharing of code with process_typevar_declaration should be pursued.\n \"\"\"\n if not self.options.wip_pep_612:\n return False\n call = self.get_typevarlike_declaration(\n s, (\"typing_extensions.ParamSpec\", \"typing.ParamSpec\")\n )\n if not call:\n return False\n\n lvalue = s.lvalues[0]\n assert isinstance(lvalue, NameExpr)\n if s.type:\n self.fail(\"Cannot declare the type of a parameter specification\", s)\n return False\n\n name = lvalue.name\n if not self.check_typevarlike_name(call, name, s):\n return False\n\n # PEP 612 reserves the right to define bound, covariant and contravariant arguments to\n # ParamSpec in a later PEP. If and when that happens, we should do something\n # on the lines of process_typevar_parameters\n paramspec_var = ParamSpecExpr(\n name, self.qualified_name(name), self.object_type(), INVARIANT\n )\n paramspec_var.line = call.line\n call.analyzed = paramspec_var\n self.add_symbol(name, call.analyzed, s)\n return True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.basic_new_typeinfo_SemanticAnalyzer.basic_new_typeinfo.return.info": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.basic_new_typeinfo_SemanticAnalyzer.basic_new_typeinfo.return.info", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3132, "end_line": 3151, "span_ids": ["SemanticAnalyzer.basic_new_typeinfo"], "tokens": 270}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def basic_new_typeinfo(self, name: str, basetype_or_fallback: Instance) -> TypeInfo:\n class_def = ClassDef(name, Block([]))\n if self.is_func_scope() and not self.type:\n # Full names of generated classes should always be prefixed with the module names\n # even if they are nested in a function, since these classes will be (de-)serialized.\n # (Note that the caller should append @line to the name to avoid collisions.)\n # TODO: clean this up, see #6422.\n class_def.fullname = self.cur_mod_id + '.' + self.qualified_name(name)\n else:\n class_def.fullname = self.qualified_name(name)\n\n info = TypeInfo(SymbolTable(), class_def, self.cur_mod_id)\n class_def.info = info\n mro = basetype_or_fallback.type.mro\n if not mro:\n # Forward reference, MRO should be recalculated in third pass.\n mro = [basetype_or_fallback.type, self.object_type().type]\n info.mro = [info] + mro\n info.bases = [basetype_or_fallback]\n return info", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_value_types_SemanticAnalyzer.analyze_value_types.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_value_types_SemanticAnalyzer.analyze_value_types.return.result", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3153, "end_line": 3169, "span_ids": ["SemanticAnalyzer.analyze_value_types"], "tokens": 186}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def analyze_value_types(self, items: List[Expression]) -> List[Type]:\n \"\"\"Analyze types from values expressions in type variable definition.\"\"\"\n result = [] # type: List[Type]\n for node in items:\n try:\n analyzed = self.anal_type(expr_to_unanalyzed_type(node),\n allow_placeholder=True)\n if analyzed is None:\n # Type variables are special: we need to place them in the symbol table\n # soon, even if some value is not ready yet, see process_typevar_parameters()\n # for an example.\n analyzed = PlaceholderType(None, [], node.line)\n result.append(analyzed)\n except TypeTranslationError:\n self.fail('Type expected', node)\n result.append(AnyType(TypeOfAny.from_error))\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.check_classvar_SemanticAnalyzer.check_classvar.if_self_is_class_scope_.elif_not_isinstance_lvalu.self_fail_invalid_classva": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.check_classvar_SemanticAnalyzer.check_classvar.if_self_is_class_scope_.elif_not_isinstance_lvalu.self_fail_invalid_classva", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3171, "end_line": 3185, "span_ids": ["SemanticAnalyzer.check_classvar"], "tokens": 186}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def check_classvar(self, s: AssignmentStmt) -> None:\n \"\"\"Check if assignment defines a class variable.\"\"\"\n lvalue = s.lvalues[0]\n if len(s.lvalues) != 1 or not isinstance(lvalue, RefExpr):\n return\n if not s.type or not self.is_classvar(s.type):\n return\n if self.is_class_scope() and isinstance(lvalue, NameExpr):\n node = lvalue.node\n if isinstance(node, Var):\n node.is_classvar = True\n elif not isinstance(lvalue, MemberExpr) or self.is_self_member_ref(lvalue):\n # In case of member access, report error only when assigning to self\n # Other kinds of member assignments should be already reported\n self.fail_invalid_classvar(lvalue)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.is_classvar_SemanticAnalyzer.fail_invalid_classvar.self_fail_ClassVar_can_o": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.is_classvar_SemanticAnalyzer.fail_invalid_classvar.self_fail_ClassVar_can_o", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3187, "end_line": 3204, "span_ids": ["SemanticAnalyzer.is_final_type", "SemanticAnalyzer.is_classvar", "SemanticAnalyzer.fail_invalid_classvar"], "tokens": 190}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def is_classvar(self, typ: Type) -> bool:\n if not isinstance(typ, UnboundType):\n return False\n sym = self.lookup_qualified(typ.name, typ)\n if not sym or not sym.node:\n return False\n return sym.node.fullname == 'typing.ClassVar'\n\n def is_final_type(self, typ: Optional[Type]) -> bool:\n if not isinstance(typ, UnboundType):\n return False\n sym = self.lookup_qualified(typ.name, typ)\n if not sym or not sym.node:\n return False\n return sym.node.fullname in ('typing.Final', 'typing_extensions.Final')\n\n def fail_invalid_classvar(self, context: Context) -> None:\n self.fail('ClassVar can only be used for assignments in class body', context)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.process_module_assignment_SemanticAnalyzer.process_module_assignment.if_isinstance_rval_Tup.elif_isinstance_rval_Ref.if_rnode_and_isinstance_r.for_lval_in_lvals_.if_lnode_.if_isinstance_lnode_node_.elif_lval_is_inferred_def.lnode.node.rnode_node": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.process_module_assignment_SemanticAnalyzer.process_module_assignment.if_isinstance_rval_Tup.elif_isinstance_rval_Ref.if_rnode_and_isinstance_r.for_lval_in_lvals_.if_lnode_.if_isinstance_lnode_node_.elif_lval_is_inferred_def.lnode.node.rnode_node", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3212, "end_line": 3279, "span_ids": ["SemanticAnalyzer.process_module_assignment"], "tokens": 781}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def process_module_assignment(self, lvals: List[Lvalue], rval: Expression,\n ctx: AssignmentStmt) -> None:\n \"\"\"Propagate module references across assignments.\n\n Recursively handles the simple form of iterable unpacking; doesn't\n handle advanced unpacking with *rest, dictionary unpacking, etc.\n\n In an expression like x = y = z, z is the rval and lvals will be [x,\n y].\n\n \"\"\"\n if (isinstance(rval, (TupleExpr, ListExpr))\n and all(isinstance(v, TupleExpr) for v in lvals)):\n # rval and all lvals are either list or tuple, so we are dealing\n # with unpacking assignment like `x, y = a, b`. Mypy didn't\n # understand our all(isinstance(...)), so cast them as TupleExpr\n # so mypy knows it is safe to access their .items attribute.\n seq_lvals = cast(List[TupleExpr], lvals)\n # given an assignment like:\n # (x, y) = (m, n) = (a, b)\n # we now have:\n # seq_lvals = [(x, y), (m, n)]\n # seq_rval = (a, b)\n # We now zip this into:\n # elementwise_assignments = [(a, x, m), (b, y, n)]\n # where each elementwise assignment includes one element of rval and the\n # corresponding element of each lval. Basically we unpack\n # (x, y) = (m, n) = (a, b)\n # into elementwise assignments\n # x = m = a\n # y = n = b\n # and then we recursively call this method for each of those assignments.\n # If the rval and all lvals are not all of the same length, zip will just ignore\n # extra elements, so no error will be raised here; mypy will later complain\n # about the length mismatch in type-checking.\n elementwise_assignments = zip(rval.items, *[v.items for v in seq_lvals])\n for rv, *lvs in elementwise_assignments:\n self.process_module_assignment(lvs, rv, ctx)\n elif isinstance(rval, RefExpr):\n rnode = self.lookup_type_node(rval)\n if rnode and isinstance(rnode.node, MypyFile):\n for lval in lvals:\n if not isinstance(lval, RefExpr):\n continue\n # respect explicitly annotated type\n if (isinstance(lval.node, Var) and lval.node.type is not None):\n continue\n\n # We can handle these assignments to locals and to self\n if isinstance(lval, NameExpr):\n lnode = self.current_symbol_table().get(lval.name)\n elif isinstance(lval, MemberExpr) and self.is_self_member_ref(lval):\n assert self.type is not None\n lnode = self.type.names.get(lval.name)\n else:\n continue\n\n if lnode:\n if isinstance(lnode.node, MypyFile) and lnode.node is not rnode.node:\n assert isinstance(lval, (NameExpr, MemberExpr))\n self.fail(\n 'Cannot assign multiple modules to name \"{}\" '\n 'without explicit \"types.ModuleType\" annotation'.format(lval.name),\n ctx)\n # never create module alias except on initial var definition\n elif lval.is_inferred_def:\n assert rnode.node is not None\n lnode.node = rnode.node", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.process__all___SemanticAnalyzer.visit_while_stmt.self_visit_block_maybe_s_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.process__all___SemanticAnalyzer.visit_while_stmt.self_visit_block_maybe_s_", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3275, "end_line": 3338, "span_ids": ["SemanticAnalyzer.visit_raise_stmt", "SemanticAnalyzer.visit_assert_stmt", "SemanticAnalyzer.visit_return_stmt", "SemanticAnalyzer.visit_block", "SemanticAnalyzer.process__all__", "SemanticAnalyzer.visit_while_stmt", "SemanticAnalyzer.visit_operator_assignment_stmt", "SemanticAnalyzer.visit_expression_stmt", "SemanticAnalyzer.visit_block_maybe"], "tokens": 537}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def process__all__(self, s: AssignmentStmt) -> None:\n \"\"\"Export names if argument is a __all__ assignment.\"\"\"\n if (len(s.lvalues) == 1 and isinstance(s.lvalues[0], NameExpr) and\n s.lvalues[0].name == '__all__' and s.lvalues[0].kind == GDEF and\n isinstance(s.rvalue, (ListExpr, TupleExpr))):\n self.add_exports(s.rvalue.items)\n\n #\n # Misc statements\n #\n\n def visit_block(self, b: Block) -> None:\n if b.is_unreachable:\n return\n self.block_depth[-1] += 1\n for s in b.body:\n self.accept(s)\n self.block_depth[-1] -= 1\n\n def visit_block_maybe(self, b: Optional[Block]) -> None:\n if b:\n self.visit_block(b)\n\n def visit_expression_stmt(self, s: ExpressionStmt) -> None:\n self.statement = s\n s.expr.accept(self)\n\n def visit_return_stmt(self, s: ReturnStmt) -> None:\n self.statement = s\n if not self.is_func_scope():\n self.fail(\"'return' outside function\", s)\n if s.expr:\n s.expr.accept(self)\n\n def visit_raise_stmt(self, s: RaiseStmt) -> None:\n self.statement = s\n if s.expr:\n s.expr.accept(self)\n if s.from_expr:\n s.from_expr.accept(self)\n\n def visit_assert_stmt(self, s: AssertStmt) -> None:\n self.statement = s\n if s.expr:\n s.expr.accept(self)\n if s.msg:\n s.msg.accept(self)\n\n def visit_operator_assignment_stmt(self,\n s: OperatorAssignmentStmt) -> None:\n self.statement = s\n s.lvalue.accept(self)\n s.rvalue.accept(self)\n if (isinstance(s.lvalue, NameExpr) and s.lvalue.name == '__all__' and\n s.lvalue.kind == GDEF and isinstance(s.rvalue, (ListExpr, TupleExpr))):\n self.add_exports(s.rvalue.items)\n\n def visit_while_stmt(self, s: WhileStmt) -> None:\n self.statement = s\n s.expr.accept(self)\n self.loop_depth += 1\n s.body.accept(self)\n self.loop_depth -= 1\n self.visit_block_maybe(s.else_body)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_for_stmt_SemanticAnalyzer.visit_for_stmt.self_visit_block_maybe_s_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_for_stmt_SemanticAnalyzer.visit_for_stmt.self_visit_block_maybe_s_", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3340, "end_line": 3359, "span_ids": ["SemanticAnalyzer.visit_for_stmt"], "tokens": 193}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def visit_for_stmt(self, s: ForStmt) -> None:\n self.statement = s\n s.expr.accept(self)\n\n # Bind index variables and check if they define new names.\n self.analyze_lvalue(s.index, explicit_type=s.index_type is not None)\n if s.index_type:\n if self.is_classvar(s.index_type):\n self.fail_invalid_classvar(s.index)\n allow_tuple_literal = isinstance(s.index, TupleExpr)\n analyzed = self.anal_type(s.index_type, allow_tuple_literal=allow_tuple_literal)\n if analyzed is not None:\n self.store_declared_types(s.index, analyzed)\n s.index_type = analyzed\n\n self.loop_depth += 1\n self.visit_block(s.body)\n self.loop_depth -= 1\n\n self.visit_block_maybe(s.else_body)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_break_stmt_SemanticAnalyzer.analyze_try_stmt.if_s_finally_body_.s_finally_body_accept_vis": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_break_stmt_SemanticAnalyzer.analyze_try_stmt.if_s_finally_body_.s_finally_body_accept_vis", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3361, "end_line": 3394, "span_ids": ["SemanticAnalyzer.visit_break_stmt", "SemanticAnalyzer.analyze_try_stmt", "SemanticAnalyzer.visit_try_stmt", "SemanticAnalyzer.visit_if_stmt", "SemanticAnalyzer.visit_continue_stmt"], "tokens": 320}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def visit_break_stmt(self, s: BreakStmt) -> None:\n self.statement = s\n if self.loop_depth == 0:\n self.fail(\"'break' outside loop\", s, serious=True, blocker=True)\n\n def visit_continue_stmt(self, s: ContinueStmt) -> None:\n self.statement = s\n if self.loop_depth == 0:\n self.fail(\"'continue' outside loop\", s, serious=True, blocker=True)\n\n def visit_if_stmt(self, s: IfStmt) -> None:\n self.statement = s\n infer_reachability_of_if_statement(s, self.options)\n for i in range(len(s.expr)):\n s.expr[i].accept(self)\n self.visit_block(s.body[i])\n self.visit_block_maybe(s.else_body)\n\n def visit_try_stmt(self, s: TryStmt) -> None:\n self.statement = s\n self.analyze_try_stmt(s, self)\n\n def analyze_try_stmt(self, s: TryStmt, visitor: NodeVisitor[None]) -> None:\n s.body.accept(visitor)\n for type, var, handler in zip(s.types, s.vars, s.handlers):\n if type:\n type.accept(visitor)\n if var:\n self.analyze_lvalue(var)\n handler.accept(visitor)\n if s.else_body:\n s.else_body.accept(visitor)\n if s.finally_body:\n s.finally_body.accept(visitor)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_with_stmt_SemanticAnalyzer.visit_with_stmt.self_visit_block_s_body_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_with_stmt_SemanticAnalyzer.visit_with_stmt.self_visit_block_s_body_", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3396, "end_line": 3440, "span_ids": ["SemanticAnalyzer.visit_with_stmt"], "tokens": 440}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def visit_with_stmt(self, s: WithStmt) -> None:\n self.statement = s\n types = [] # type: List[Type]\n\n if s.unanalyzed_type:\n assert isinstance(s.unanalyzed_type, ProperType)\n actual_targets = [t for t in s.target if t is not None]\n if len(actual_targets) == 0:\n # We have a type for no targets\n self.fail('Invalid type comment: \"with\" statement has no targets', s)\n elif len(actual_targets) == 1:\n # We have one target and one type\n types = [s.unanalyzed_type]\n elif isinstance(s.unanalyzed_type, TupleType):\n # We have multiple targets and multiple types\n if len(actual_targets) == len(s.unanalyzed_type.items):\n types = s.unanalyzed_type.items.copy()\n else:\n # But it's the wrong number of items\n self.fail('Incompatible number of types for \"with\" targets', s)\n else:\n # We have multiple targets and one type\n self.fail('Multiple types expected for multiple \"with\" targets', s)\n\n new_types = [] # type: List[Type]\n for e, n in zip(s.expr, s.target):\n e.accept(self)\n if n:\n self.analyze_lvalue(n, explicit_type=s.unanalyzed_type is not None)\n\n # Since we have a target, pop the next type from types\n if types:\n t = types.pop(0)\n if self.is_classvar(t):\n self.fail_invalid_classvar(n)\n allow_tuple_literal = isinstance(n, TupleExpr)\n analyzed = self.anal_type(t, allow_tuple_literal=allow_tuple_literal)\n if analyzed is not None:\n # TODO: Deal with this better\n new_types.append(analyzed)\n self.store_declared_types(n, analyzed)\n\n s.analyzed_types = new_types\n\n self.visit_block(s.body)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_del_stmt_SemanticAnalyzer.visit_global_decl.for_name_in_g_names_.self_global_decls_1_add": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_del_stmt_SemanticAnalyzer.visit_global_decl.for_name_in_g_names_.self_global_decls_1_add", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3448, "end_line": 3467, "span_ids": ["SemanticAnalyzer.visit_del_stmt", "SemanticAnalyzer.visit_global_decl", "SemanticAnalyzer.is_valid_del_target"], "tokens": 207}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def visit_del_stmt(self, s: DelStmt) -> None:\n self.statement = s\n s.expr.accept(self)\n if not self.is_valid_del_target(s.expr):\n self.fail('Invalid delete target', s)\n\n def is_valid_del_target(self, s: Expression) -> bool:\n if isinstance(s, (IndexExpr, NameExpr, MemberExpr)):\n return True\n elif isinstance(s, (TupleExpr, ListExpr)):\n return all(self.is_valid_del_target(item) for item in s.items)\n else:\n return False\n\n def visit_global_decl(self, g: GlobalDecl) -> None:\n self.statement = g\n for name in g.names:\n if name in self.nonlocal_decls[-1]:\n self.fail('Name \"{}\" is nonlocal and global'.format(name), g)\n self.global_decls[-1].add(name)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_nonlocal_decl_SemanticAnalyzer.visit_nonlocal_decl.if_not_self_is_func_scope.else_.for_name_in_d_names_.self_nonlocal_decls_1_a": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_nonlocal_decl_SemanticAnalyzer.visit_nonlocal_decl.if_not_self_is_func_scope.else_.for_name_in_d_names_.self_nonlocal_decls_1_a", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3469, "end_line": 3487, "span_ids": ["SemanticAnalyzer.visit_nonlocal_decl"], "tokens": 206}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def visit_nonlocal_decl(self, d: NonlocalDecl) -> None:\n self.statement = d\n if not self.is_func_scope():\n self.fail(\"nonlocal declaration not allowed at module level\", d)\n else:\n for name in d.names:\n for table in reversed(self.locals[:-1]):\n if table is not None and name in table:\n break\n else:\n self.fail('No binding for nonlocal \"{}\" found'.format(name), d)\n\n if self.locals[-1] is not None and name in self.locals[-1]:\n self.fail('Name \"{}\" is already defined in local '\n 'scope before nonlocal declaration'.format(name), d)\n\n if name in self.global_decls[-1]:\n self.fail('Name \"{}\" is nonlocal and global'.format(name), d)\n self.nonlocal_decls[-1].add(name)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_print_stmt_SemanticAnalyzer.visit_name_expr.if_n_.self_bind_name_expr_expr_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_print_stmt_SemanticAnalyzer.visit_name_expr.if_n_.self_bind_name_expr_expr_", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3483, "end_line": 3505, "span_ids": ["SemanticAnalyzer.visit_print_stmt", "SemanticAnalyzer.visit_exec_stmt", "SemanticAnalyzer.visit_name_expr"], "tokens": 163}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def visit_print_stmt(self, s: PrintStmt) -> None:\n self.statement = s\n for arg in s.args:\n arg.accept(self)\n if s.target:\n s.target.accept(self)\n\n def visit_exec_stmt(self, s: ExecStmt) -> None:\n self.statement = s\n s.expr.accept(self)\n if s.globals:\n s.globals.accept(self)\n if s.locals:\n s.locals.accept(self)\n\n #\n # Expressions\n #\n\n def visit_name_expr(self, expr: NameExpr) -> None:\n n = self.lookup(expr.name, expr)\n if n:\n self.bind_name_expr(expr, n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.bind_name_expr_SemanticAnalyzer.bind_name_expr.if_isinstance_sym_node_T.else_.expr.fullname.sym_fullname": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.bind_name_expr_SemanticAnalyzer.bind_name_expr.if_isinstance_sym_node_T.else_.expr.fullname.sym_fullname", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3507, "end_line": 3517, "span_ids": ["SemanticAnalyzer.bind_name_expr"], "tokens": 142}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def bind_name_expr(self, expr: NameExpr, sym: SymbolTableNode) -> None:\n \"\"\"Bind name expression to a symbol table node.\"\"\"\n if isinstance(sym.node, TypeVarExpr) and self.tvar_scope.get_binding(sym):\n self.fail(\"'{}' is a type variable and only valid in type \"\n \"context\".format(expr.name), expr)\n elif isinstance(sym.node, PlaceholderNode):\n self.process_placeholder(expr.name, 'name', expr)\n else:\n expr.kind = sym.kind\n expr.node = sym.node\n expr.fullname = sym.fullname", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_super_expr_SemanticAnalyzer.visit_yield_from_expr.if_e_expr_.e_expr_accept_self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_super_expr_SemanticAnalyzer.visit_yield_from_expr.if_e_expr_.e_expr_accept_self_", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3525, "end_line": 3573, "span_ids": ["SemanticAnalyzer.visit_tuple_expr", "SemanticAnalyzer.visit_yield_from_expr", "SemanticAnalyzer.visit_dict_expr", "SemanticAnalyzer.visit_list_expr", "SemanticAnalyzer.visit_star_expr", "SemanticAnalyzer.visit_set_expr", "SemanticAnalyzer.visit_super_expr"], "tokens": 406}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def visit_super_expr(self, expr: SuperExpr) -> None:\n if not self.type and not expr.call.args:\n self.fail('\"super\" used outside class', expr)\n return\n expr.info = self.type\n for arg in expr.call.args:\n arg.accept(self)\n\n def visit_tuple_expr(self, expr: TupleExpr) -> None:\n for item in expr.items:\n if isinstance(item, StarExpr):\n item.valid = True\n item.accept(self)\n\n def visit_list_expr(self, expr: ListExpr) -> None:\n for item in expr.items:\n if isinstance(item, StarExpr):\n item.valid = True\n item.accept(self)\n\n def visit_set_expr(self, expr: SetExpr) -> None:\n for item in expr.items:\n if isinstance(item, StarExpr):\n item.valid = True\n item.accept(self)\n\n def visit_dict_expr(self, expr: DictExpr) -> None:\n for key, value in expr.items:\n if key is not None:\n key.accept(self)\n value.accept(self)\n\n def visit_star_expr(self, expr: StarExpr) -> None:\n if not expr.valid:\n # XXX TODO Change this error message\n self.fail('Can use starred expression only as assignment target', expr)\n else:\n expr.expr.accept(self)\n\n def visit_yield_from_expr(self, e: YieldFromExpr) -> None:\n if not self.is_func_scope(): # not sure\n self.fail(\"'yield from' outside function\", e, serious=True, blocker=True)\n else:\n if self.function_stack[-1].is_coroutine:\n self.fail('\"yield from\" in async function', e, serious=True, blocker=True)\n else:\n self.function_stack[-1].is_generator = True\n if e.expr:\n e.expr.accept(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_call_expr_SemanticAnalyzer.visit_call_expr.if_refers_to_fullname_exp.else_.if_isinstance_expr_calle.if_expr_callee_name_a.elif_expr_callee_name_.self_add_exports_expr_arg": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_call_expr_SemanticAnalyzer.visit_call_expr.if_refers_to_fullname_exp.else_.if_isinstance_expr_calle.if_expr_callee_name_a.elif_expr_callee_name_.self_add_exports_expr_arg", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3569, "end_line": 3669, "span_ids": ["SemanticAnalyzer.visit_call_expr"], "tokens": 1061}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def visit_call_expr(self, expr: CallExpr) -> None:\n \"\"\"Analyze a call expression.\n\n Some call expressions are recognized as special forms, including\n cast(...).\n \"\"\"\n expr.callee.accept(self)\n if refers_to_fullname(expr.callee, 'typing.cast'):\n # Special form cast(...).\n if not self.check_fixed_args(expr, 2, 'cast'):\n return\n # Translate first argument to an unanalyzed type.\n try:\n target = expr_to_unanalyzed_type(expr.args[0])\n except TypeTranslationError:\n self.fail('Cast target is not a type', expr)\n return\n # Piggyback CastExpr object to the CallExpr object; it takes\n # precedence over the CallExpr semantics.\n expr.analyzed = CastExpr(expr.args[1], target)\n expr.analyzed.line = expr.line\n expr.analyzed.column = expr.column\n expr.analyzed.accept(self)\n elif refers_to_fullname(expr.callee, 'builtins.reveal_type'):\n if not self.check_fixed_args(expr, 1, 'reveal_type'):\n return\n expr.analyzed = RevealExpr(kind=REVEAL_TYPE, expr=expr.args[0])\n expr.analyzed.line = expr.line\n expr.analyzed.column = expr.column\n expr.analyzed.accept(self)\n elif refers_to_fullname(expr.callee, 'builtins.reveal_locals'):\n # Store the local variable names into the RevealExpr for use in the\n # type checking pass\n local_nodes = [] # type: List[Var]\n if self.is_module_scope():\n # try to determine just the variable declarations in module scope\n # self.globals.values() contains SymbolTableNode's\n # Each SymbolTableNode has an attribute node that is nodes.Var\n # look for variable nodes that marked as is_inferred\n # Each symboltable node has a Var node as .node\n local_nodes = [n.node\n for name, n in self.globals.items()\n if getattr(n.node, 'is_inferred', False)\n and isinstance(n.node, Var)]\n elif self.is_class_scope():\n # type = None # type: Optional[TypeInfo]\n if self.type is not None:\n local_nodes = [st.node\n for st in self.type.names.values()\n if isinstance(st.node, Var)]\n elif self.is_func_scope():\n # locals = None # type: List[Optional[SymbolTable]]\n if self.locals is not None:\n symbol_table = self.locals[-1]\n if symbol_table is not None:\n local_nodes = [st.node\n for st in symbol_table.values()\n if isinstance(st.node, Var)]\n expr.analyzed = RevealExpr(kind=REVEAL_LOCALS, local_nodes=local_nodes)\n expr.analyzed.line = expr.line\n expr.analyzed.column = expr.column\n expr.analyzed.accept(self)\n elif refers_to_fullname(expr.callee, 'typing.Any'):\n # Special form Any(...) no longer supported.\n self.fail('Any(...) is no longer supported. Use cast(Any, ...) instead', expr)\n elif refers_to_fullname(expr.callee, 'typing._promote'):\n # Special form _promote(...).\n if not self.check_fixed_args(expr, 1, '_promote'):\n return\n # Translate first argument to an unanalyzed type.\n try:\n target = expr_to_unanalyzed_type(expr.args[0])\n except TypeTranslationError:\n self.fail('Argument 1 to _promote is not a type', expr)\n return\n expr.analyzed = PromoteExpr(target)\n expr.analyzed.line = expr.line\n expr.analyzed.accept(self)\n elif refers_to_fullname(expr.callee, 'builtins.dict'):\n expr.analyzed = self.translate_dict_call(expr)\n elif refers_to_fullname(expr.callee, 'builtins.divmod'):\n if not self.check_fixed_args(expr, 2, 'divmod'):\n return\n expr.analyzed = OpExpr('divmod', expr.args[0], expr.args[1])\n expr.analyzed.line = expr.line\n expr.analyzed.accept(self)\n else:\n # Normal call expression.\n for a in expr.args:\n a.accept(self)\n\n if (isinstance(expr.callee, MemberExpr) and\n isinstance(expr.callee.expr, NameExpr) and\n expr.callee.expr.name == '__all__' and\n expr.callee.expr.kind == GDEF and\n expr.callee.name in ('append', 'extend')):\n if expr.callee.name == 'append' and expr.args:\n self.add_exports(expr.args[0])\n elif (expr.callee.name == 'extend' and expr.args and\n isinstance(expr.args[0], (ListExpr, TupleExpr))):\n self.add_exports(expr.args[0].items)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.translate_dict_call_SemanticAnalyzer.translate_dict_call.return.expr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.translate_dict_call_SemanticAnalyzer.translate_dict_call.return.expr", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3671, "end_line": 3685, "span_ids": ["SemanticAnalyzer.translate_dict_call"], "tokens": 170}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def translate_dict_call(self, call: CallExpr) -> Optional[DictExpr]:\n \"\"\"Translate 'dict(x=y, ...)' to {'x': y, ...} and 'dict()' to {}.\n\n For other variants of dict(...), return None.\n \"\"\"\n if not all(kind == ARG_NAMED for kind in call.arg_kinds):\n # Must still accept those args.\n for a in call.args:\n a.accept(self)\n return None\n expr = DictExpr([(StrExpr(cast(str, key)), value) # since they are all ARG_NAMED\n for key, value in zip(call.arg_names, call.args)])\n expr.set_line(call)\n expr.accept(self)\n return expr", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.check_fixed_args_SemanticAnalyzer.check_fixed_args.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.check_fixed_args_SemanticAnalyzer.check_fixed_args.return.True", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3687, "end_line": 3704, "span_ids": ["SemanticAnalyzer.check_fixed_args"], "tokens": 175}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def check_fixed_args(self, expr: CallExpr, numargs: int,\n name: str) -> bool:\n \"\"\"Verify that expr has specified number of positional args.\n\n Return True if the arguments are valid.\n \"\"\"\n s = 's'\n if numargs == 1:\n s = ''\n if len(expr.args) != numargs:\n self.fail(\"'%s' expects %d argument%s\" % (name, numargs, s),\n expr)\n return False\n if expr.arg_kinds != [ARG_POS] * numargs:\n self.fail(\"'%s' must be called with %s positional argument%s\" %\n (name, numargs, s), expr)\n return False\n return True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_member_expr_SemanticAnalyzer.visit_member_expr.if_isinstance_base_RefEx.elif_isinstance_base_Ref.if_type_info_.if_n_is_not_None_and_isin.expr.node.n_node": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_member_expr_SemanticAnalyzer.visit_member_expr.if_isinstance_base_RefEx.elif_isinstance_base_Ref.if_type_info_.if_n_is_not_None_and_isin.expr.node.n_node", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3706, "end_line": 3750, "span_ids": ["SemanticAnalyzer.visit_member_expr"], "tokens": 480}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def visit_member_expr(self, expr: MemberExpr) -> None:\n base = expr.expr\n base.accept(self)\n if isinstance(base, RefExpr) and isinstance(base.node, MypyFile):\n # Handle module attribute.\n sym = self.get_module_symbol(base.node, expr.name)\n if sym:\n if isinstance(sym.node, PlaceholderNode):\n self.process_placeholder(expr.name, 'attribute', expr)\n return\n expr.kind = sym.kind\n expr.fullname = sym.fullname\n expr.node = sym.node\n elif isinstance(base, RefExpr):\n # This branch handles the case C.bar (or cls.bar or self.bar inside\n # a classmethod/method), where C is a class and bar is a type\n # definition or a module resulting from `import bar` (or a module\n # assignment) inside class C. We look up bar in the class' TypeInfo\n # namespace. This is done only when bar is a module or a type;\n # other things (e.g. methods) are handled by other code in\n # checkmember.\n type_info = None\n if isinstance(base.node, TypeInfo):\n # C.bar where C is a class\n type_info = base.node\n elif isinstance(base.node, Var) and self.type and self.function_stack:\n # check for self.bar or cls.bar in method/classmethod\n func_def = self.function_stack[-1]\n if not func_def.is_static and isinstance(func_def.type, CallableType):\n formal_arg = func_def.type.argument_by_name(base.node.name)\n if formal_arg and formal_arg.pos == 0:\n type_info = self.type\n elif isinstance(base.node, TypeAlias) and base.node.no_args:\n assert isinstance(base.node.target, ProperType)\n if isinstance(base.node.target, Instance):\n type_info = base.node.target.type\n\n if type_info:\n n = type_info.names.get(expr.name)\n if n is not None and isinstance(n.node, (MypyFile, TypeInfo, TypeAlias)):\n if not n:\n return\n expr.kind = n.kind\n expr.fullname = n.fullname\n expr.node = n.node", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_op_expr_SemanticAnalyzer.visit_op_expr.expr_right_accept_self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_op_expr_SemanticAnalyzer.visit_op_expr.expr_right_accept_self_", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3752, "end_line": 3765, "span_ids": ["SemanticAnalyzer.visit_op_expr"], "tokens": 182}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def visit_op_expr(self, expr: OpExpr) -> None:\n expr.left.accept(self)\n\n if expr.op in ('and', 'or'):\n inferred = infer_condition_value(expr.left, self.options)\n if ((inferred in (ALWAYS_FALSE, MYPY_FALSE) and expr.op == 'and') or\n (inferred in (ALWAYS_TRUE, MYPY_TRUE) and expr.op == 'or')):\n expr.right_unreachable = True\n return\n elif ((inferred in (ALWAYS_TRUE, MYPY_TRUE) and expr.op == 'and') or\n (inferred in (ALWAYS_FALSE, MYPY_FALSE) and expr.op == 'or')):\n expr.right_always = True\n\n expr.right.accept(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_comparison_expr_SemanticAnalyzer.visit_index_expr.if_isinstance_base_RefE.else_.expr_index_accept_self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_comparison_expr_SemanticAnalyzer.visit_index_expr.if_isinstance_base_RefE.else_.expr_index_accept_self_", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3767, "end_line": 3787, "span_ids": ["SemanticAnalyzer.visit_comparison_expr", "SemanticAnalyzer.visit_index_expr", "SemanticAnalyzer.visit_unary_expr"], "tokens": 195}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def visit_comparison_expr(self, expr: ComparisonExpr) -> None:\n for operand in expr.operands:\n operand.accept(self)\n\n def visit_unary_expr(self, expr: UnaryExpr) -> None:\n expr.expr.accept(self)\n\n def visit_index_expr(self, expr: IndexExpr) -> None:\n base = expr.base\n base.accept(self)\n if (isinstance(base, RefExpr)\n and isinstance(base.node, TypeInfo)\n and not base.node.is_generic()):\n expr.index.accept(self)\n elif ((isinstance(base, RefExpr) and isinstance(base.node, TypeAlias))\n or refers_to_class_or_function(base)):\n # We need to do full processing on every iteration, since some type\n # arguments may contain placeholder types.\n self.analyze_type_application(expr)\n else:\n expr.index.accept(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_type_application_args_SemanticAnalyzer.analyze_type_application_args.return.types": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_type_application_args_SemanticAnalyzer.analyze_type_application_args.return.types", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3814, "end_line": 3843, "span_ids": ["SemanticAnalyzer.analyze_type_application_args"], "tokens": 262}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def analyze_type_application_args(self, expr: IndexExpr) -> Optional[List[Type]]:\n \"\"\"Analyze type arguments (index) in a type application.\n\n Return None if anything was incomplete.\n \"\"\"\n index = expr.index\n tag = self.track_incomplete_refs()\n self.analyze_type_expr(index)\n if self.found_incomplete_ref(tag):\n return None\n types = [] # type: List[Type]\n if isinstance(index, TupleExpr):\n items = index.items\n else:\n items = [index]\n for item in items:\n try:\n typearg = expr_to_unanalyzed_type(item)\n except TypeTranslationError:\n self.fail('Type expected within [...]', expr)\n return None\n # We always allow unbound type variables in IndexExpr, since we\n # may be analysing a type alias definition rvalue. The error will be\n # reported elsewhere if it is not the case.\n analyzed = self.anal_type(typearg, allow_unbound_tvars=True,\n allow_placeholder=True)\n if analyzed is None:\n return None\n types.append(analyzed)\n return types", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_slice_expr_SemanticAnalyzer.visit_generator_expr.self_analyze_comp_for_2_e": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_slice_expr_SemanticAnalyzer.visit_generator_expr.self_analyze_comp_for_2_e", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3845, "end_line": 3894, "span_ids": ["SemanticAnalyzer.visit_reveal_expr", "SemanticAnalyzer.visit_cast_expr", "SemanticAnalyzer.visit_slice_expr", "SemanticAnalyzer.visit_type_application", "SemanticAnalyzer.visit_generator_expr", "SemanticAnalyzer.visit_list_comprehension", "SemanticAnalyzer.visit_set_comprehension", "SemanticAnalyzer.visit_dictionary_comprehension"], "tokens": 399}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def visit_slice_expr(self, expr: SliceExpr) -> None:\n if expr.begin_index:\n expr.begin_index.accept(self)\n if expr.end_index:\n expr.end_index.accept(self)\n if expr.stride:\n expr.stride.accept(self)\n\n def visit_cast_expr(self, expr: CastExpr) -> None:\n expr.expr.accept(self)\n analyzed = self.anal_type(expr.type)\n if analyzed is not None:\n expr.type = analyzed\n\n def visit_reveal_expr(self, expr: RevealExpr) -> None:\n if expr.kind == REVEAL_TYPE:\n if expr.expr is not None:\n expr.expr.accept(self)\n else:\n # Reveal locals doesn't have an inner expression, there's no\n # need to traverse inside it\n pass\n\n def visit_type_application(self, expr: TypeApplication) -> None:\n expr.expr.accept(self)\n for i in range(len(expr.types)):\n analyzed = self.anal_type(expr.types[i])\n if analyzed is not None:\n expr.types[i] = analyzed\n\n def visit_list_comprehension(self, expr: ListComprehension) -> None:\n expr.generator.accept(self)\n\n def visit_set_comprehension(self, expr: SetComprehension) -> None:\n expr.generator.accept(self)\n\n def visit_dictionary_comprehension(self, expr: DictionaryComprehension) -> None:\n self.enter(expr)\n self.analyze_comp_for(expr)\n expr.key.accept(self)\n expr.value.accept(self)\n self.leave()\n self.analyze_comp_for_2(expr)\n\n def visit_generator_expr(self, expr: GeneratorExpr) -> None:\n self.enter(expr)\n self.analyze_comp_for(expr)\n expr.left_expr.accept(self)\n self.leave()\n self.analyze_comp_for_2(expr)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_comp_for_SemanticAnalyzer.analyze_comp_for.for_i_index_sequence_.for_cond_in_conditions_.cond_accept_self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_comp_for_SemanticAnalyzer.analyze_comp_for.for_i_index_sequence_.for_cond_in_conditions_.cond_accept_self_", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3896, "end_line": 3911, "span_ids": ["SemanticAnalyzer.analyze_comp_for"], "tokens": 160}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def analyze_comp_for(self, expr: Union[GeneratorExpr,\n DictionaryComprehension]) -> None:\n \"\"\"Analyses the 'comp_for' part of comprehensions (part 1).\n\n That is the part after 'for' in (x for x in l if p). This analyzes\n variables and conditions which are analyzed in a local scope.\n \"\"\"\n for i, (index, sequence, conditions) in enumerate(zip(expr.indices,\n expr.sequences,\n expr.condlists)):\n if i > 0:\n sequence.accept(self)\n # Bind index variables.\n self.analyze_lvalue(index)\n for cond in conditions:\n cond.accept(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_comp_for_2_SemanticAnalyzer.visit__promote_expr.if_analyzed_is_not_None_.expr.type.analyzed": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_comp_for_2_SemanticAnalyzer.visit__promote_expr.if_analyzed_is_not_None_.expr.type.analyzed", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3913, "end_line": 3937, "span_ids": ["SemanticAnalyzer.analyze_comp_for_2", "SemanticAnalyzer.visit_lambda_expr", "SemanticAnalyzer.visit_conditional_expr", "SemanticAnalyzer.visit__promote_expr", "SemanticAnalyzer.visit_backquote_expr"], "tokens": 242}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def analyze_comp_for_2(self, expr: Union[GeneratorExpr,\n DictionaryComprehension]) -> None:\n \"\"\"Analyses the 'comp_for' part of comprehensions (part 2).\n\n That is the part after 'for' in (x for x in l if p). This analyzes\n the 'l' part which is analyzed in the surrounding scope.\n \"\"\"\n expr.sequences[0].accept(self)\n\n def visit_lambda_expr(self, expr: LambdaExpr) -> None:\n self.analyze_arg_initializers(expr)\n self.analyze_function_body(expr)\n\n def visit_conditional_expr(self, expr: ConditionalExpr) -> None:\n expr.if_expr.accept(self)\n expr.cond.accept(self)\n expr.else_expr.accept(self)\n\n def visit_backquote_expr(self, expr: BackquoteExpr) -> None:\n expr.expr.accept(self)\n\n def visit__promote_expr(self, expr: PromoteExpr) -> None:\n analyzed = self.anal_type(expr.type)\n if analyzed is not None:\n expr.type = analyzed", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_yield_expr_SemanticAnalyzer.None_89": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.visit_yield_expr_SemanticAnalyzer.None_89", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3946, "end_line": 3970, "span_ids": ["SemanticAnalyzer.visit_await_expr", "SemanticAnalyzer.visit_yield_expr"], "tokens": 237}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def visit_yield_expr(self, expr: YieldExpr) -> None:\n if not self.is_func_scope():\n self.fail(\"'yield' outside function\", expr, serious=True, blocker=True)\n else:\n if self.function_stack[-1].is_coroutine:\n if self.options.python_version < (3, 6):\n self.fail('\"yield\" in async function', expr, serious=True, blocker=True)\n else:\n self.function_stack[-1].is_generator = True\n self.function_stack[-1].is_async_generator = True\n else:\n self.function_stack[-1].is_generator = True\n if expr.expr:\n expr.expr.accept(self)\n\n def visit_await_expr(self, expr: AwaitExpr) -> None:\n if not self.is_func_scope():\n self.fail(\"'await' outside function\", expr)\n elif not self.function_stack[-1].is_coroutine:\n self.fail(\"'await' outside coroutine ('async def')\", expr)\n expr.expr.accept(self)\n\n #\n # Lookup functions\n #", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.lookup_SemanticAnalyzer.lookup.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.lookup_SemanticAnalyzer.lookup.return.None", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3965, "end_line": 4028, "span_ids": ["SemanticAnalyzer.lookup"], "tokens": 543}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def lookup(self, name: str, ctx: Context,\n suppress_errors: bool = False) -> Optional[SymbolTableNode]:\n \"\"\"Look up an unqualified (no dots) name in all active namespaces.\n\n Note that the result may contain a PlaceholderNode. The caller may\n want to defer in that case.\n\n Generate an error if the name is not defined unless suppress_errors\n is true or the current namespace is incomplete. In the latter case\n defer.\n \"\"\"\n implicit_name = False\n # 1a. Name declared using 'global x' takes precedence\n if name in self.global_decls[-1]:\n if name in self.globals:\n return self.globals[name]\n if not suppress_errors:\n self.name_not_defined(name, ctx)\n return None\n # 1b. Name declared using 'nonlocal x' takes precedence\n if name in self.nonlocal_decls[-1]:\n for table in reversed(self.locals[:-1]):\n if table is not None and name in table:\n return table[name]\n else:\n if not suppress_errors:\n self.name_not_defined(name, ctx)\n return None\n # 2. Class attributes (if within class definition)\n if self.type and not self.is_func_scope() and name in self.type.names:\n node = self.type.names[name]\n if not node.implicit:\n if self.is_active_symbol_in_class_body(node.node):\n return node\n else:\n # Defined through self.x assignment\n implicit_name = True\n implicit_node = node\n # 3. Local (function) scopes\n for table in reversed(self.locals):\n if table is not None and name in table:\n return table[name]\n # 4. Current file global scope\n if name in self.globals:\n return self.globals[name]\n # 5. Builtins\n b = self.globals.get('__builtins__', None)\n if b:\n assert isinstance(b.node, MypyFile)\n table = b.node.names\n if name in table:\n if name[0] == \"_\" and name[1] != \"_\":\n if not suppress_errors:\n self.name_not_defined(name, ctx)\n return None\n node = table[name]\n return node\n # Give up.\n if not implicit_name and not suppress_errors:\n self.name_not_defined(name, ctx)\n else:\n if implicit_name:\n return implicit_node\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.is_active_symbol_in_class_body_SemanticAnalyzer.is_active_symbol_in_class_body.return._node_is_None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.is_active_symbol_in_class_body_SemanticAnalyzer.is_active_symbol_in_class_body.return._node_is_None", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4030, "end_line": 4052, "span_ids": ["SemanticAnalyzer.is_active_symbol_in_class_body"], "tokens": 218}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def is_active_symbol_in_class_body(self, node: Optional[SymbolNode]) -> bool:\n \"\"\"Can a symbol defined in class body accessed at current statement?\n\n Only allow access to class attributes textually after\n the definition, so that it's possible to fall back to the\n outer scope. Example:\n\n class X: ...\n\n class C:\n X = X # Initializer refers to outer scope\n\n Nested classes are an exception, since we want to support\n arbitrary forward references in type annotations.\n \"\"\"\n # TODO: Forward reference to name imported in class body is not\n # caught.\n assert self.statement # we are at class scope\n return (node is None\n or self.is_textually_before_statement(node)\n or not self.is_defined_in_current_module(node.fullname)\n or isinstance(node, TypeInfo)\n or (isinstance(node, PlaceholderNode) and node.becomes_typeinfo))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.is_textually_before_statement_SemanticAnalyzer.is_textually_before_statement.if_self_is_overloaded_ite.else_.return.line_diff_0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.is_textually_before_statement_SemanticAnalyzer.is_textually_before_statement.if_self_is_overloaded_ite.else_.return.line_diff_0", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4054, "end_line": 4071, "span_ids": ["SemanticAnalyzer.is_textually_before_statement"], "tokens": 194}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def is_textually_before_statement(self, node: SymbolNode) -> bool:\n \"\"\"Check if a node is defined textually before the current statement\n\n Note that decorated functions' line number are the same as\n the top decorator.\n \"\"\"\n assert self.statement\n line_diff = self.statement.line - node.line\n\n # The first branch handles reference an overloaded function variant inside itself,\n # this is a corner case where mypy technically deviates from runtime name resolution,\n # but it is fine because we want an overloaded function to be treated as a single unit.\n if self.is_overloaded_item(node, self.statement):\n return False\n elif isinstance(node, Decorator) and not node.is_overload:\n return line_diff > len(node.original_decorators)\n else:\n return line_diff > 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.is_overloaded_item_SemanticAnalyzer.is_defined_in_current_module.return.module_prefix_self_module": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.is_overloaded_item_SemanticAnalyzer.is_defined_in_current_module.return.module_prefix_self_module", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4073, "end_line": 4087, "span_ids": ["SemanticAnalyzer.is_defined_in_current_module", "SemanticAnalyzer.is_overloaded_item"], "tokens": 184}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def is_overloaded_item(self, node: SymbolNode, statement: Statement) -> bool:\n \"\"\"Check whehter the function belongs to the overloaded variants\"\"\"\n if isinstance(node, OverloadedFuncDef) and isinstance(statement, FuncDef):\n in_items = statement in {item.func if isinstance(item, Decorator)\n else item for item in node.items}\n in_impl = (node.impl is not None and\n ((isinstance(node.impl, Decorator) and statement is node.impl.func)\n or statement is node.impl))\n return in_items or in_impl\n return False\n\n def is_defined_in_current_module(self, fullname: Optional[str]) -> bool:\n if fullname is None:\n return False\n return module_prefix(self.modules, fullname) == self.cur_mod_id", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.lookup_qualified_SemanticAnalyzer.lookup_qualified.return.sym": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.lookup_qualified_SemanticAnalyzer.lookup_qualified.return.sym", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4089, "end_line": 4134, "span_ids": ["SemanticAnalyzer.lookup_qualified"], "tokens": 419}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def lookup_qualified(self, name: str, ctx: Context,\n suppress_errors: bool = False) -> Optional[SymbolTableNode]:\n \"\"\"Lookup a qualified name in all activate namespaces.\n\n Note that the result may contain a PlaceholderNode. The caller may\n want to defer in that case.\n\n Generate an error if the name is not defined unless suppress_errors\n is true or the current namespace is incomplete. In the latter case\n defer.\n \"\"\"\n if '.' not in name:\n # Simple case: look up a short name.\n return self.lookup(name, ctx, suppress_errors=suppress_errors)\n parts = name.split('.')\n namespace = self.cur_mod_id\n sym = self.lookup(parts[0], ctx, suppress_errors=suppress_errors)\n if sym:\n for i in range(1, len(parts)):\n node = sym.node\n part = parts[i]\n if isinstance(node, TypeInfo):\n nextsym = node.get(part)\n elif isinstance(node, MypyFile):\n nextsym = self.get_module_symbol(node, part)\n namespace = node.fullname\n elif isinstance(node, PlaceholderNode):\n return sym\n elif isinstance(node, TypeAlias) and node.no_args:\n assert isinstance(node.target, ProperType)\n if isinstance(node.target, Instance):\n nextsym = node.target.type.get(part)\n else:\n if isinstance(node, Var):\n typ = get_proper_type(node.type)\n if isinstance(typ, AnyType):\n # Allow access through Var with Any type without error.\n return self.implicit_symbol(sym, name, parts[i:], typ)\n # Lookup through invalid node, such as variable or function\n nextsym = None\n if not nextsym or nextsym.module_hidden:\n if not suppress_errors:\n self.name_not_defined(name, ctx, namespace=namespace)\n return None\n sym = nextsym\n return sym", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.lookup_type_node_SemanticAnalyzer.get_module_symbol.return.sym": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.lookup_type_node_SemanticAnalyzer.get_module_symbol.return.sym", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4136, "end_line": 4175, "span_ids": ["SemanticAnalyzer.lookup_type_node", "SemanticAnalyzer.get_module_symbol"], "tokens": 371}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def lookup_type_node(self, expr: Expression) -> Optional[SymbolTableNode]:\n try:\n t = expr_to_unanalyzed_type(expr)\n except TypeTranslationError:\n return None\n if isinstance(t, UnboundType):\n n = self.lookup_qualified(t.name, expr, suppress_errors=True)\n return n\n return None\n\n def get_module_symbol(self, node: MypyFile, name: str) -> Optional[SymbolTableNode]:\n \"\"\"Look up a symbol from a module.\n\n Return None if no matching symbol could be bound.\n \"\"\"\n module = node.fullname\n names = node.names\n sym = names.get(name)\n if not sym:\n fullname = module + '.' + name\n if fullname in self.modules:\n sym = SymbolTableNode(GDEF, self.modules[fullname])\n elif self.is_incomplete_namespace(module):\n self.record_incomplete_ref()\n elif ('__getattr__' in names\n and (node.is_stub\n or self.options.python_version >= (3, 7))):\n gvar = self.create_getattr_var(names['__getattr__'], name, fullname)\n if gvar:\n sym = SymbolTableNode(GDEF, gvar)\n elif self.is_missing_module(fullname):\n # We use the fullname of the original definition so that we can\n # detect whether two names refer to the same thing.\n var_type = AnyType(TypeOfAny.from_unimported_type)\n v = Var(name, type=var_type)\n v._fullname = fullname\n sym = SymbolTableNode(GDEF, v)\n elif sym.module_hidden:\n sym = None\n return sym", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.is_missing_module_SemanticAnalyzer.implicit_symbol.return.SymbolTableNode_GDEF_var": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.is_missing_module_SemanticAnalyzer.implicit_symbol.return.SymbolTableNode_GDEF_var", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4177, "end_line": 4194, "span_ids": ["SemanticAnalyzer.implicit_symbol", "SemanticAnalyzer.is_missing_module"], "tokens": 182}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def is_missing_module(self, module: str) -> bool:\n return module in self.missing_modules\n\n def implicit_symbol(self, sym: SymbolTableNode, name: str, parts: List[str],\n source_type: AnyType) -> SymbolTableNode:\n \"\"\"Create symbol for a qualified name reference through Any type.\"\"\"\n if sym.node is None:\n basename = None\n else:\n basename = sym.node.fullname\n if basename is None:\n fullname = name\n else:\n fullname = basename + '.' + '.'.join(parts)\n var_type = AnyType(TypeOfAny.from_another_any, source_type)\n var = Var(parts[-1], var_type)\n var._fullname = fullname\n return SymbolTableNode(GDEF, var)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.create_getattr_var_SemanticAnalyzer.create_getattr_var.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.create_getattr_var_SemanticAnalyzer.create_getattr_var.return.None", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4196, "end_line": 4218, "span_ids": ["SemanticAnalyzer.create_getattr_var"], "tokens": 232}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def create_getattr_var(self, getattr_defn: SymbolTableNode,\n name: str, fullname: str) -> Optional[Var]:\n \"\"\"Create a dummy variable using module-level __getattr__ return type.\n\n If not possible, return None.\n\n Note that multiple Var nodes can be created for a single name. We\n can use the from_module_getattr and the fullname attributes to\n check if two dummy Var nodes refer to the same thing. Reusing Var\n nodes would require non-local mutable state, which we prefer to\n avoid.\n \"\"\"\n if isinstance(getattr_defn.node, (FuncDef, Var)):\n node_type = get_proper_type(getattr_defn.node.type)\n if isinstance(node_type, CallableType):\n typ = node_type.ret_type\n else:\n typ = AnyType(TypeOfAny.from_error)\n v = Var(name, type=typ)\n v._fullname = fullname\n v.from_module_getattr = True\n return v\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.lookup_fully_qualified_SemanticAnalyzer.lookup_fully_qualified.return.n_names_parts_1_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.lookup_fully_qualified_SemanticAnalyzer.lookup_fully_qualified.return.n_names_parts_1_", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4220, "end_line": 4235, "span_ids": ["SemanticAnalyzer.lookup_fully_qualified"], "tokens": 158}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def lookup_fully_qualified(self, name: str) -> SymbolTableNode:\n \"\"\"Lookup a fully qualified name.\n\n Assume that the name is defined. This happens in the global namespace --\n the local module namespace is ignored.\n\n Note that this doesn't support visibility, module-level __getattr__, or\n nested classes.\n \"\"\"\n parts = name.split('.')\n n = self.modules[parts[0]]\n for i in range(1, len(parts) - 1):\n next_sym = n.names[parts[i]]\n assert isinstance(next_sym.node, MypyFile)\n n = next_sym.node\n return n.names[parts[-1]]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.lookup_fully_qualified_or_none_SemanticAnalyzer.lookup_fully_qualified_or_none.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.lookup_fully_qualified_or_none_SemanticAnalyzer.lookup_fully_qualified_or_none.return.result", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4237, "end_line": 4258, "span_ids": ["SemanticAnalyzer.lookup_fully_qualified_or_none"], "tokens": 244}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def lookup_fully_qualified_or_none(self, fullname: str) -> Optional[SymbolTableNode]:\n \"\"\"Lookup a fully qualified name that refers to a module-level definition.\n\n Don't assume that the name is defined. This happens in the global namespace --\n the local module namespace is ignored. This does not dereference indirect\n refs.\n\n Note that this can't be used for names nested in class namespaces.\n \"\"\"\n # TODO: unify/clean-up/simplify lookup methods, see #4157.\n # TODO: support nested classes (but consider performance impact,\n # we might keep the module level only lookup for thing like 'builtins.int').\n assert '.' in fullname\n module, name = fullname.rsplit('.', maxsplit=1)\n if module not in self.modules:\n return None\n filenode = self.modules[module]\n result = filenode.names.get(name)\n if result is None and self.is_incomplete_namespace(module):\n # TODO: More explicit handling of incomplete refs?\n self.record_incomplete_ref()\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.builtin_type_SemanticAnalyzer.named_type.return.Instance_node_AnyType_T": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.builtin_type_SemanticAnalyzer.named_type.return.Instance_node_AnyType_T", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4260, "end_line": 4280, "span_ids": ["SemanticAnalyzer.named_type", "SemanticAnalyzer.object_type", "SemanticAnalyzer.builtin_type", "SemanticAnalyzer.str_type"], "tokens": 238}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def builtin_type(self, fully_qualified_name: str) -> Instance:\n sym = self.lookup_fully_qualified(fully_qualified_name)\n node = sym.node\n assert isinstance(node, TypeInfo)\n return Instance(node, [AnyType(TypeOfAny.special_form)] * len(node.defn.type_vars))\n\n def object_type(self) -> Instance:\n return self.named_type('__builtins__.object')\n\n def str_type(self) -> Instance:\n return self.named_type('__builtins__.str')\n\n def named_type(self, qualified_name: str, args: Optional[List[Type]] = None) -> Instance:\n sym = self.lookup_qualified(qualified_name, Context())\n assert sym, \"Internal error: attempted to construct unknown type\"\n node = sym.node\n assert isinstance(node, TypeInfo)\n if args:\n # TODO: assert len(args) == len(node.defn.type_vars)\n return Instance(node, args)\n return Instance(node, [AnyType(TypeOfAny.special_form)] * len(node.defn.type_vars))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.named_type_or_none_SemanticAnalyzer.None_92": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.named_type_or_none_SemanticAnalyzer.None_92", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4282, "end_line": 4307, "span_ids": ["SemanticAnalyzer.named_type_or_none", "SemanticAnalyzer.lookup_current_scope"], "tokens": 251}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def named_type_or_none(self, qualified_name: str,\n args: Optional[List[Type]] = None) -> Optional[Instance]:\n sym = self.lookup_fully_qualified_or_none(qualified_name)\n if not sym or isinstance(sym.node, PlaceholderNode):\n return None\n node = sym.node\n if isinstance(node, TypeAlias):\n assert isinstance(node.target, Instance) # type: ignore\n node = node.target.type\n assert isinstance(node, TypeInfo), node\n if args is not None:\n # TODO: assert len(args) == len(node.defn.type_vars)\n return Instance(node, args)\n return Instance(node, [AnyType(TypeOfAny.unannotated)] * len(node.defn.type_vars))\n\n def lookup_current_scope(self, name: str) -> Optional[SymbolTableNode]:\n if self.locals[-1] is not None:\n return self.locals[-1].get(name)\n elif self.type is not None:\n return self.type.names.get(name)\n else:\n return self.globals.get(name)\n\n #\n # Adding symbols\n #", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.add_symbol_SemanticAnalyzer.add_symbol.return.self_add_symbol_table_nod": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.add_symbol_SemanticAnalyzer.add_symbol.return.self_add_symbol_table_nod", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4309, "end_line": 4338, "span_ids": ["SemanticAnalyzer.add_symbol"], "tokens": 256}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def add_symbol(self,\n name: str,\n node: SymbolNode,\n context: Context,\n module_public: bool = True,\n module_hidden: bool = False,\n can_defer: bool = True,\n escape_comprehensions: bool = False) -> bool:\n \"\"\"Add symbol to the currently active symbol table.\n\n Generally additions to symbol table should go through this method or\n one of the methods below so that kinds, redefinitions, conditional\n definitions, and skipped names are handled consistently.\n\n Return True if we actually added the symbol, or False if we refused to do so\n (because something is not ready).\n\n If can_defer is True, defer current target if adding a placeholder.\n \"\"\"\n if self.is_func_scope():\n kind = LDEF\n elif self.type is not None:\n kind = MDEF\n else:\n kind = GDEF\n symbol = SymbolTableNode(kind,\n node,\n module_public=module_public,\n module_hidden=module_hidden)\n return self.add_symbol_table_node(name, symbol, context, can_defer, escape_comprehensions)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.add_symbol_skip_local_SemanticAnalyzer.add_symbol_skip_local.names_name_symbol": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.add_symbol_skip_local_SemanticAnalyzer.add_symbol_skip_local.names_name_symbol", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4340, "end_line": 4360, "span_ids": ["SemanticAnalyzer.add_symbol_skip_local"], "tokens": 203}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def add_symbol_skip_local(self, name: str, node: SymbolNode) -> None:\n \"\"\"Same as above, but skipping the local namespace.\n\n This doesn't check for previous definition and is only used\n for serialization of method-level classes.\n\n Classes defined within methods can be exposed through an\n attribute type, but method-level symbol tables aren't serialized.\n This method can be used to add such classes to an enclosing,\n serialized symbol table.\n \"\"\"\n # TODO: currently this is only used by named tuples. Use this method\n # also by typed dicts and normal classes, see issue #6422.\n if self.type is not None:\n names = self.type.names\n kind = MDEF\n else:\n names = self.globals\n kind = GDEF\n symbol = SymbolTableNode(kind, node)\n names[name] = symbol", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.add_symbol_table_node_SemanticAnalyzer.add_symbol_table_node.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.add_symbol_table_node_SemanticAnalyzer.add_symbol_table_node.return.False", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4362, "end_line": 4412, "span_ids": ["SemanticAnalyzer.add_symbol_table_node"], "tokens": 513}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def add_symbol_table_node(self,\n name: str,\n symbol: SymbolTableNode,\n context: Optional[Context] = None,\n can_defer: bool = True,\n escape_comprehensions: bool = False) -> bool:\n \"\"\"Add symbol table node to the currently active symbol table.\n\n Return True if we actually added the symbol, or False if we refused\n to do so (because something is not ready or it was a no-op).\n\n Generate an error if there is an invalid redefinition.\n\n If context is None, unconditionally add node, since we can't report\n an error. Note that this is used by plugins to forcibly replace nodes!\n\n TODO: Prevent plugins from replacing nodes, as it could cause problems?\n\n Args:\n name: short name of symbol\n symbol: Node to add\n can_defer: if True, defer current target if adding a placeholder\n context: error context (see above about None value)\n \"\"\"\n names = self.current_symbol_table(escape_comprehensions=escape_comprehensions)\n existing = names.get(name)\n if isinstance(symbol.node, PlaceholderNode) and can_defer:\n self.defer(context)\n if (existing is not None\n and context is not None\n and not is_valid_replacement(existing, symbol)):\n # There is an existing node, so this may be a redefinition.\n # If the new node points to the same node as the old one,\n # or if both old and new nodes are placeholders, we don't\n # need to do anything.\n old = existing.node\n new = symbol.node\n if isinstance(new, PlaceholderNode):\n # We don't know whether this is okay. Let's wait until the next iteration.\n return False\n if not is_same_symbol(old, new):\n if isinstance(new, (FuncDef, Decorator, OverloadedFuncDef, TypeInfo)):\n self.add_redefinition(names, name, symbol)\n if not (isinstance(new, (FuncDef, Decorator))\n and self.set_original_def(old, new)):\n self.name_already_defined(name, context, existing)\n elif (name not in self.missing_names[-1] and '*' not in self.missing_names[-1]):\n names[name] = symbol\n self.progress = True\n return True\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.add_redefinition_SemanticAnalyzer.add_redefinition.while_True_.i_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.add_redefinition_SemanticAnalyzer.add_redefinition.while_True_.i_1", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4414, "end_line": 4446, "span_ids": ["SemanticAnalyzer.add_redefinition"], "tokens": 321}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def add_redefinition(self,\n names: SymbolTable,\n name: str,\n symbol: SymbolTableNode) -> None:\n \"\"\"Add a symbol table node that reflects a redefinition as a function or a class.\n\n Redefinitions need to be added to the symbol table so that they can be found\n through AST traversal, but they have dummy names of form 'name-redefinition[N]',\n where N ranges over 2, 3, ... (omitted for the first redefinition).\n\n Note: we always store redefinitions independently of whether they are valid or not\n (so they will be semantically analyzed), the caller should give an error for invalid\n redefinitions (such as e.g. variable redefined as a class).\n \"\"\"\n i = 1\n # Don't serialize redefined nodes. They are likely to have\n # busted internal references which can cause problems with\n # serialization and they can't have any external references to\n # them.\n symbol.no_serialize = True\n while True:\n if i == 1:\n new_name = '{}-redefinition'.format(name)\n else:\n new_name = '{}-redefinition{}'.format(name, i)\n existing = names.get(new_name)\n if existing is None:\n names[new_name] = symbol\n return\n elif existing.node is symbol.node:\n # Already there\n return\n i += 1", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.add_local_SemanticAnalyzer.add_imported_symbol.self_add_symbol_table_nod": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.add_local_SemanticAnalyzer.add_imported_symbol.self_add_symbol_table_nod", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4448, "end_line": 4484, "span_ids": ["SemanticAnalyzer.add_local", "SemanticAnalyzer.add_imported_symbol", "SemanticAnalyzer.add_module_symbol"], "tokens": 310}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def add_local(self, node: Union[Var, FuncDef, OverloadedFuncDef], context: Context) -> None:\n \"\"\"Add local variable or function.\"\"\"\n assert self.is_func_scope()\n name = node.name\n node._fullname = name\n self.add_symbol(name, node, context)\n\n def add_module_symbol(self,\n id: str,\n as_id: str,\n context: Context,\n module_public: bool,\n module_hidden: bool) -> None:\n \"\"\"Add symbol that is a reference to a module object.\"\"\"\n if id in self.modules:\n node = self.modules[id]\n self.add_symbol(as_id, node, context,\n module_public=module_public,\n module_hidden=module_hidden)\n else:\n self.add_unknown_imported_symbol(\n as_id, context, target_name=id, module_public=module_public,\n module_hidden=module_hidden\n )\n\n def add_imported_symbol(self,\n name: str,\n node: SymbolTableNode,\n context: Context,\n module_public: bool,\n module_hidden: bool) -> None:\n \"\"\"Add an alias to an existing symbol through import.\"\"\"\n assert not module_hidden or not module_public\n symbol = SymbolTableNode(node.kind, node.node,\n module_public=module_public,\n module_hidden=module_hidden)\n self.add_symbol_table_node(name, symbol, context)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.add_unknown_imported_symbol_SemanticAnalyzer.add_unknown_imported_symbol.self_add_symbol_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.add_unknown_imported_symbol_SemanticAnalyzer.add_unknown_imported_symbol.self_add_symbol_", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4486, "end_line": 4521, "span_ids": ["SemanticAnalyzer.add_unknown_imported_symbol"], "tokens": 403}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def add_unknown_imported_symbol(self,\n name: str,\n context: Context,\n target_name: Optional[str],\n module_public: bool,\n module_hidden: bool) -> None:\n \"\"\"Add symbol that we don't know what it points to because resolving an import failed.\n\n This can happen if a module is missing, or it is present, but doesn't have\n the imported attribute. The `target_name` is the name of symbol in the namespace\n it is imported from. For example, for 'from mod import x as y' the target_name is\n 'mod.x'. This is currently used only to track logical dependencies.\n \"\"\"\n existing = self.current_symbol_table().get(name)\n if existing and isinstance(existing.node, Var) and existing.node.is_suppressed_import:\n # This missing import was already added -- nothing to do here.\n return\n var = Var(name)\n if self.options.logical_deps and target_name is not None:\n # This makes it possible to add logical fine-grained dependencies\n # from a missing module. We can't use this by default, since in a\n # few places we assume that the full name points to a real\n # definition, but this name may point to nothing.\n var._fullname = target_name\n elif self.type:\n var._fullname = self.type.fullname + \".\" + name\n var.info = self.type\n else:\n var._fullname = self.qualified_name(name)\n var.is_ready = True\n any_type = AnyType(TypeOfAny.from_unimported_type, missing_import_name=var._fullname)\n var.type = any_type\n var.is_suppressed_import = True\n self.add_symbol(\n name, var, context, module_public=module_public, module_hidden=module_hidden\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.None_93_SemanticAnalyzer.defer.self_deferral_debug_conte": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.None_93_SemanticAnalyzer.defer.self_deferral_debug_conte", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4523, "end_line": 4552, "span_ids": ["SemanticAnalyzer.add_unknown_imported_symbol", "SemanticAnalyzer.tvar_scope_frame", "SemanticAnalyzer.defer"], "tokens": 298}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n #\n # Other helpers\n #\n\n @contextmanager\n def tvar_scope_frame(self, frame: TypeVarLikeScope) -> Iterator[None]:\n old_scope = self.tvar_scope\n self.tvar_scope = frame\n yield\n self.tvar_scope = old_scope\n\n def defer(self, debug_context: Optional[Context] = None) -> None:\n \"\"\"Defer current analysis target to be analyzed again.\n\n This must be called if something in the current target is\n incomplete or has a placeholder node. However, this must *not*\n be called during the final analysis iteration! Instead, an error\n should be generated. Often 'process_placeholder' is a good\n way to either defer or generate an error.\n\n NOTE: Some methods, such as 'anal_type', 'mark_incomplete' and\n 'record_incomplete_ref', call this implicitly, or when needed.\n They are usually preferable to a direct defer() call.\n \"\"\"\n assert not self.final_iteration, 'Must not defer during final iteration'\n self.deferred = True\n # Store debug info for this deferral.\n line = (debug_context.line if debug_context else\n self.statement.line if self.statement else -1)\n self.deferral_debug_context.append((self.cur_mod_id, line))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.track_incomplete_refs_SemanticAnalyzer.mark_incomplete.self_missing_names_1_ad": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.track_incomplete_refs_SemanticAnalyzer.mark_incomplete.self_missing_names_1_ad", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4554, "end_line": 4592, "span_ids": ["SemanticAnalyzer.record_incomplete_ref", "SemanticAnalyzer.found_incomplete_ref", "SemanticAnalyzer.mark_incomplete", "SemanticAnalyzer.track_incomplete_refs"], "tokens": 373}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def track_incomplete_refs(self) -> Tag:\n \"\"\"Return tag that can be used for tracking references to incomplete names.\"\"\"\n return self.num_incomplete_refs\n\n def found_incomplete_ref(self, tag: Tag) -> bool:\n \"\"\"Have we encountered an incomplete reference since starting tracking?\"\"\"\n return self.num_incomplete_refs != tag\n\n def record_incomplete_ref(self) -> None:\n \"\"\"Record the encounter of an incomplete reference and defer current analysis target.\"\"\"\n self.defer()\n self.num_incomplete_refs += 1\n\n def mark_incomplete(self, name: str, node: Node,\n becomes_typeinfo: bool = False,\n module_public: bool = True,\n module_hidden: bool = False) -> None:\n \"\"\"Mark a definition as incomplete (and defer current analysis target).\n\n Also potentially mark the current namespace as incomplete.\n\n Args:\n name: The name that we weren't able to define (or '*' if the name is unknown)\n node: The node that refers to the name (definition or lvalue)\n becomes_typeinfo: Pass this to PlaceholderNode (used by special forms like\n named tuples that will create TypeInfos).\n \"\"\"\n self.defer(node)\n if name == '*':\n self.incomplete = True\n elif not self.is_global_or_nonlocal(name):\n fullname = self.qualified_name(name)\n assert self.statement\n placeholder = PlaceholderNode(fullname, node, self.statement.line,\n becomes_typeinfo=becomes_typeinfo)\n self.add_symbol(name, placeholder,\n module_public=module_public, module_hidden=module_hidden,\n context=dummy_context())\n self.missing_names[-1].add(name)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.is_incomplete_namespace_SemanticAnalyzer.qualified_name.if_self_type_is_not_None_.else_.return.self_cur_mod_id_n": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.is_incomplete_namespace_SemanticAnalyzer.qualified_name.if_self_type_is_not_None_.else_.return.self_cur_mod_id_n", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4594, "end_line": 4625, "span_ids": ["SemanticAnalyzer.process_placeholder", "SemanticAnalyzer.is_incomplete_namespace", "SemanticAnalyzer.qualified_name", "SemanticAnalyzer.cannot_resolve_name"], "tokens": 282}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def is_incomplete_namespace(self, fullname: str) -> bool:\n \"\"\"Is a module or class namespace potentially missing some definitions?\n\n If a name is missing from an incomplete namespace, we'll need to defer the\n current analysis target.\n \"\"\"\n return fullname in self.incomplete_namespaces\n\n def process_placeholder(self, name: str, kind: str, ctx: Context) -> None:\n \"\"\"Process a reference targeting placeholder node.\n\n If this is not a final iteration, defer current node,\n otherwise report an error.\n\n The 'kind' argument indicates if this a name or attribute expression\n (used for better error message).\n \"\"\"\n if self.final_iteration:\n self.cannot_resolve_name(name, kind, ctx)\n else:\n self.defer(ctx)\n\n def cannot_resolve_name(self, name: str, kind: str, ctx: Context) -> None:\n self.fail('Cannot resolve {} \"{}\" (possible cyclic definition)'.format(kind, name), ctx)\n\n def qualified_name(self, name: str) -> str:\n if self.type is not None:\n return self.type._fullname + '.' + name\n elif self.is_func_scope():\n return name\n else:\n return self.cur_mod_id + '.' + name", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.enter_SemanticAnalyzer.enter.self_missing_names_append": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.enter_SemanticAnalyzer.enter.self_missing_names_append", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4627, "end_line": 4637, "span_ids": ["SemanticAnalyzer.enter"], "tokens": 149}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def enter(self, function: Union[FuncItem, GeneratorExpr, DictionaryComprehension]) -> None:\n \"\"\"Enter a function, generator or comprehension scope.\"\"\"\n names = self.saved_locals.setdefault(function, SymbolTable())\n self.locals.append(names)\n is_comprehension = isinstance(function, (GeneratorExpr, DictionaryComprehension))\n self.is_comprehension_stack.append(is_comprehension)\n self.global_decls.append(set())\n self.nonlocal_decls.append(set())\n # -1 since entering block will increment this to 0.\n self.block_depth.append(-1)\n self.missing_names.append(set())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.leave_SemanticAnalyzer.current_symbol_kind.return.kind": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.leave_SemanticAnalyzer.current_symbol_kind.return.kind", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4639, "end_line": 4667, "span_ids": ["SemanticAnalyzer.is_nested_within_func_scope", "SemanticAnalyzer.is_module_scope", "SemanticAnalyzer.current_symbol_kind", "SemanticAnalyzer.is_func_scope", "SemanticAnalyzer.leave", "SemanticAnalyzer.is_class_scope"], "tokens": 232}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def leave(self) -> None:\n self.locals.pop()\n self.is_comprehension_stack.pop()\n self.global_decls.pop()\n self.nonlocal_decls.pop()\n self.block_depth.pop()\n self.missing_names.pop()\n\n def is_func_scope(self) -> bool:\n return self.locals[-1] is not None\n\n def is_nested_within_func_scope(self) -> bool:\n \"\"\"Are we underneath a function scope, even if we are in a nested class also?\"\"\"\n return any(l is not None for l in self.locals)\n\n def is_class_scope(self) -> bool:\n return self.type is not None and not self.is_func_scope()\n\n def is_module_scope(self) -> bool:\n return not (self.is_class_scope() or self.is_func_scope())\n\n def current_symbol_kind(self) -> int:\n if self.is_class_scope():\n kind = MDEF\n elif self.is_func_scope():\n kind = LDEF\n else:\n kind = GDEF\n return kind", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.current_symbol_table_SemanticAnalyzer.current_symbol_table.return.names": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.current_symbol_table_SemanticAnalyzer.current_symbol_table.return.names", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4669, "end_line": 4695, "span_ids": ["SemanticAnalyzer.current_symbol_table"], "tokens": 265}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def current_symbol_table(self, escape_comprehensions: bool = False) -> SymbolTable:\n if self.is_func_scope():\n assert self.locals[-1] is not None\n if escape_comprehensions:\n assert len(self.locals) == len(self.is_comprehension_stack)\n # Retrieve the symbol table from the enclosing non-comprehension scope.\n for i, is_comprehension in enumerate(reversed(self.is_comprehension_stack)):\n if not is_comprehension:\n if i == len(self.locals) - 1: # The last iteration.\n # The caller of the comprehension is in the global space.\n names = self.globals\n else:\n names_candidate = self.locals[-1 - i]\n assert names_candidate is not None, \\\n \"Escaping comprehension from invalid scope\"\n names = names_candidate\n break\n else:\n assert False, \"Should have at least one non-comprehension scope\"\n else:\n names = self.locals[-1]\n assert names is not None\n elif self.type is not None:\n names = self.type.names\n else:\n names = self.globals\n return names", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.is_global_or_nonlocal_SemanticAnalyzer.add_exports.for_exp_in_exps_.if_isinstance_exp_StrExp.self_all_exports_append_e": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.is_global_or_nonlocal_SemanticAnalyzer.add_exports.for_exp_in_exps_.if_isinstance_exp_StrExp.self_all_exports_append_e", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4697, "end_line": 4706, "span_ids": ["SemanticAnalyzer.add_exports", "SemanticAnalyzer.is_global_or_nonlocal"], "tokens": 137}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def is_global_or_nonlocal(self, name: str) -> bool:\n return (self.is_func_scope()\n and (name in self.global_decls[-1]\n or name in self.nonlocal_decls[-1]))\n\n def add_exports(self, exp_or_exps: Union[Iterable[Expression], Expression]) -> None:\n exps = [exp_or_exps] if isinstance(exp_or_exps, Expression) else exp_or_exps\n for exp in exps:\n if isinstance(exp, StrExpr):\n self.all_exports.append(exp.value)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.check_no_global_SemanticAnalyzer.check_no_global.if_name_in_self_globals_.if_is_overloaded_func_and.else_.self_name_already_defined": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.check_no_global_SemanticAnalyzer.check_no_global.if_name_in_self_globals_.if_is_overloaded_func_and.else_.self_name_already_defined", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4708, "end_line": 4719, "span_ids": ["SemanticAnalyzer.check_no_global"], "tokens": 144}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def check_no_global(self,\n name: str,\n ctx: Context,\n is_overloaded_func: bool = False) -> None:\n if name in self.globals:\n prev_is_overloaded = isinstance(self.globals[name], OverloadedFuncDef)\n if is_overloaded_func and prev_is_overloaded:\n self.fail(\"Nonconsecutive overload {} found\".format(name), ctx)\n elif prev_is_overloaded:\n self.fail(\"Definition of '{}' missing 'overload'\".format(name), ctx)\n else:\n self.name_already_defined(name, ctx, self.globals[name])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.name_not_defined_SemanticAnalyzer.name_not_defined.for_module_in_modules_wit.self_note_hint_ctx_code": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.name_not_defined_SemanticAnalyzer.name_not_defined.for_module_in_modules_wit.self_note_hint_ctx_code", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4728, "end_line": 4761, "span_ids": ["SemanticAnalyzer.name_not_defined"], "tokens": 383}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def name_not_defined(self, name: str, ctx: Context, namespace: Optional[str] = None) -> None:\n if self.is_incomplete_namespace(namespace or self.cur_mod_id):\n # Target namespace is incomplete, so it's possible that the name will be defined\n # later on. Defer current target.\n self.record_incomplete_ref()\n return\n message = 'Name \"{}\" is not defined'.format(name)\n self.fail(message, ctx, code=codes.NAME_DEFINED)\n\n if 'builtins.{}'.format(name) in SUGGESTED_TEST_FIXTURES:\n # The user probably has a missing definition in a test fixture. Let's verify.\n fullname = 'builtins.{}'.format(name)\n if self.lookup_fully_qualified_or_none(fullname) is None:\n # Yes. Generate a helpful note.\n self.msg.add_fixture_note(fullname, ctx)\n\n modules_with_unimported_hints = {\n name.split('.', 1)[0]\n for name in TYPES_FOR_UNIMPORTED_HINTS\n }\n lowercased = {\n name.lower(): name\n for name in TYPES_FOR_UNIMPORTED_HINTS\n }\n for module in modules_with_unimported_hints:\n fullname = '{}.{}'.format(module, name).lower()\n if fullname not in lowercased:\n continue\n # User probably forgot to import these types.\n hint = (\n 'Did you forget to import it from \"{module}\"?'\n ' (Suggestion: \"from {module} import {name}\")'\n ).format(module=module, name=lowercased[fullname].rsplit('.', 1)[-1])\n self.note(hint, ctx, code=codes.NAME_DEFINED)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.already_defined_SemanticAnalyzer.already_defined.self_fail_alread": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.already_defined_SemanticAnalyzer.already_defined.self_fail_alread", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4763, "end_line": 4787, "span_ids": ["SemanticAnalyzer.already_defined"], "tokens": 280}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def already_defined(self,\n name: str,\n ctx: Context,\n original_ctx: Optional[Union[SymbolTableNode, SymbolNode]],\n noun: str) -> None:\n if isinstance(original_ctx, SymbolTableNode):\n node = original_ctx.node # type: Optional[SymbolNode]\n elif isinstance(original_ctx, SymbolNode):\n node = original_ctx\n else:\n node = None\n\n if isinstance(original_ctx, SymbolTableNode) and isinstance(original_ctx.node, MypyFile):\n # Since this is an import, original_ctx.node points to the module definition.\n # Therefore its line number is always 1, which is not useful for this\n # error message.\n extra_msg = ' (by an import)'\n elif node and node.line != -1 and self.is_local_name(node.fullname):\n # TODO: Using previous symbol node may give wrong line. We should use\n # the line number where the binding was established instead.\n extra_msg = ' on line {}'.format(node.line)\n else:\n extra_msg = ' (possibly by an import)'\n self.fail('{} \"{}\" already defined{}'.format(noun, unmangle(name), extra_msg), ctx,\n code=codes.NO_REDEF)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.name_already_defined_SemanticAnalyzer.is_local_name.return.self_is_defined_in_curren": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.name_already_defined_SemanticAnalyzer.is_local_name.return.self_is_defined_in_curren", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4782, "end_line": 4798, "span_ids": ["SemanticAnalyzer.attribute_already_defined", "SemanticAnalyzer.is_local_name", "SemanticAnalyzer.name_already_defined"], "tokens": 176}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def name_already_defined(self,\n name: str,\n ctx: Context,\n original_ctx: Optional[Union[SymbolTableNode, SymbolNode]] = None\n ) -> None:\n self.already_defined(name, ctx, original_ctx, noun='Name')\n\n def attribute_already_defined(self,\n name: str,\n ctx: Context,\n original_ctx: Optional[Union[SymbolTableNode, SymbolNode]] = None\n ) -> None:\n self.already_defined(name, ctx, original_ctx, noun='Attribute')\n\n def is_local_name(self, name: str) -> bool:\n \"\"\"Does name look like reference to a definition in the current module?\"\"\"\n return self.is_defined_in_current_module(name) or '.' not in name", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.fail_SemanticAnalyzer.fail.self_errors_report_ctx_ge": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.fail_SemanticAnalyzer.fail.self_errors_report_ctx_ge", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4800, "end_line": 4814, "span_ids": ["SemanticAnalyzer.fail"], "tokens": 147}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def fail(self,\n msg: str,\n ctx: Context,\n serious: bool = False,\n *,\n code: Optional[ErrorCode] = None,\n blocker: bool = False) -> None:\n if (not serious and\n not self.options.check_untyped_defs and\n self.function_stack and\n self.function_stack[-1].is_dynamic()):\n return\n # In case it's a bug and we don't really have context\n assert ctx is not None, msg\n self.errors.report(ctx.get_line(), ctx.get_column(), msg, blocker=blocker, code=code)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.fail_blocker_SemanticAnalyzer.accept.try_.except_Exception_as_err_.report_internal_error_err": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.fail_blocker_SemanticAnalyzer.accept.try_.except_Exception_as_err_.report_internal_error_err", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4816, "end_line": 4830, "span_ids": ["SemanticAnalyzer.fail_blocker", "SemanticAnalyzer.note", "SemanticAnalyzer.accept"], "tokens": 170}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def fail_blocker(self, msg: str, ctx: Context) -> None:\n self.fail(msg, ctx, blocker=True)\n\n def note(self, msg: str, ctx: Context, code: Optional[ErrorCode] = None) -> None:\n if (not self.options.check_untyped_defs and\n self.function_stack and\n self.function_stack[-1].is_dynamic()):\n return\n self.errors.report(ctx.get_line(), ctx.get_column(), msg, severity='note', code=code)\n\n def accept(self, node: Node) -> None:\n try:\n node.accept(self)\n except Exception as err:\n report_internal_error(err, self.errors.file, node.line, self.errors, self.options)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.expr_to_analyzed_type_SemanticAnalyzer.expr_to_analyzed_type.return.self_anal_type_typ_repor": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.expr_to_analyzed_type_SemanticAnalyzer.expr_to_analyzed_type.return.self_anal_type_typ_repor", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4832, "end_line": 4852, "span_ids": ["SemanticAnalyzer.expr_to_analyzed_type"], "tokens": 216}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def expr_to_analyzed_type(self,\n expr: Expression,\n report_invalid_types: bool = True,\n allow_placeholder: bool = False) -> Optional[Type]:\n if isinstance(expr, CallExpr):\n expr.accept(self)\n internal_name, info = self.named_tuple_analyzer.check_namedtuple(expr, None,\n self.is_func_scope())\n if internal_name is None:\n # Some form of namedtuple is the only valid type that looks like a call\n # expression. This isn't a valid type.\n raise TypeTranslationError()\n elif not info:\n self.defer(expr)\n return None\n assert info.tuple_type, \"NamedTuple without tuple type\"\n fallback = Instance(info, [])\n return TupleType(info.tuple_type.items, fallback=fallback)\n typ = expr_to_unanalyzed_type(expr)\n return self.anal_type(typ, report_invalid_types=report_invalid_types,\n allow_placeholder=allow_placeholder)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_type_expr_SemanticAnalyzer.analyze_type_expr.with_self_tvar_scope_fram.expr_accept_self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_type_expr_SemanticAnalyzer.analyze_type_expr.with_self_tvar_scope_fram.expr_accept_self_", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4854, "end_line": 4862, "span_ids": ["SemanticAnalyzer.analyze_type_expr"], "tokens": 168}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def analyze_type_expr(self, expr: Expression) -> None:\n # There are certain expressions that mypy does not need to semantically analyze,\n # since they analyzed solely as type. (For example, indexes in type alias definitions\n # and base classes in class defs). External consumers of the mypy AST may need\n # them semantically analyzed, however, if they need to treat it as an expression\n # and not a type. (Which is to say, mypyc needs to do this.) Do the analysis\n # in a fresh tvar scope in order to suppress any errors about using type variables.\n with self.tvar_scope_frame(TypeVarLikeScope()):\n expr.accept(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.type_analyzer_SemanticAnalyzer.type_analyzer.return.tpan": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.type_analyzer_SemanticAnalyzer.type_analyzer.return.tpan", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4864, "end_line": 4884, "span_ids": ["SemanticAnalyzer.type_analyzer"], "tokens": 219}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def type_analyzer(self, *,\n tvar_scope: Optional[TypeVarLikeScope] = None,\n allow_tuple_literal: bool = False,\n allow_unbound_tvars: bool = False,\n allow_placeholder: bool = False,\n report_invalid_types: bool = True) -> TypeAnalyser:\n if tvar_scope is None:\n tvar_scope = self.tvar_scope\n tpan = TypeAnalyser(self,\n tvar_scope,\n self.plugin,\n self.options,\n self.is_typeshed_stub_file,\n allow_unbound_tvars=allow_unbound_tvars,\n allow_tuple_literal=allow_tuple_literal,\n report_invalid_types=report_invalid_types,\n allow_unnormalized=self.is_stub_file,\n allow_placeholder=allow_placeholder)\n tpan.in_dynamic_func = bool(self.function_stack and self.function_stack[-1].is_dynamic())\n tpan.global_scope = not self.type and not self.function_stack\n return tpan", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.anal_type_SemanticAnalyzer.anal_type.return.typ": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.anal_type_SemanticAnalyzer.anal_type.return.typ", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4886, "end_line": 4925, "span_ids": ["SemanticAnalyzer.anal_type"], "tokens": 369}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def anal_type(self,\n typ: Type, *,\n tvar_scope: Optional[TypeVarLikeScope] = None,\n allow_tuple_literal: bool = False,\n allow_unbound_tvars: bool = False,\n allow_placeholder: bool = False,\n report_invalid_types: bool = True,\n third_pass: bool = False) -> Optional[Type]:\n \"\"\"Semantically analyze a type.\n\n Args:\n typ: Type to analyze (if already analyzed, this is a no-op)\n allow_placeholder: If True, may return PlaceholderType if\n encountering an incomplete definition\n third_pass: Unused; only for compatibility with old semantic\n analyzer\n\n Return None only if some part of the type couldn't be bound *and* it\n referred to an incomplete namespace or definition. In this case also\n defer as needed. During a final iteration this won't return None;\n instead report an error if the type can't be analyzed and return\n AnyType.\n\n In case of other errors, report an error message and return AnyType.\n\n NOTE: The caller shouldn't defer even if this returns None or a\n placeholder type.\n \"\"\"\n a = self.type_analyzer(tvar_scope=tvar_scope,\n allow_unbound_tvars=allow_unbound_tvars,\n allow_tuple_literal=allow_tuple_literal,\n allow_placeholder=allow_placeholder,\n report_invalid_types=report_invalid_types)\n tag = self.track_incomplete_refs()\n typ = typ.accept(a)\n if self.found_incomplete_ref(tag):\n # Something could not be bound yet.\n return None\n self.add_type_alias_deps(a.aliases_used)\n return typ", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.class_type_SemanticAnalyzer.add_plugin_dependency.self_cur_mod_node_plugin_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.class_type_SemanticAnalyzer.add_plugin_dependency.self_cur_mod_node_plugin_", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4927, "end_line": 4948, "span_ids": ["SemanticAnalyzer.add_plugin_dependency", "SemanticAnalyzer.report_hang", "SemanticAnalyzer.schedule_patch", "SemanticAnalyzer.class_type"], "tokens": 215}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def class_type(self, self_type: Type) -> Type:\n return TypeType.make_normalized(self_type)\n\n def schedule_patch(self, priority: int, patch: Callable[[], None]) -> None:\n self.patches.append((priority, patch))\n\n def report_hang(self) -> None:\n print('Deferral trace:')\n for mod, line in self.deferral_debug_context:\n print(' {}:{}'.format(mod, line))\n self.errors.report(-1, -1,\n 'INTERNAL ERROR: maximum semantic analysis iteration count reached',\n blocker=True)\n\n def add_plugin_dependency(self, trigger: str, target: Optional[str] = None) -> None:\n \"\"\"Add dependency from trigger to a target.\n\n If the target is not given explicitly, use the current target.\n \"\"\"\n if target is None:\n target = self.scope.current_target()\n self.cur_mod_node.plugin_deps.setdefault(trigger, set()).add(target)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.add_type_alias_deps_SemanticAnalyzer.add_type_alias_deps.self_cur_mod_node_alias_d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.add_type_alias_deps_SemanticAnalyzer.add_type_alias_deps.self_cur_mod_node_alias_d", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4950, "end_line": 4964, "span_ids": ["SemanticAnalyzer.add_type_alias_deps"], "tokens": 159}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def add_type_alias_deps(self,\n aliases_used: Iterable[str],\n target: Optional[str] = None) -> None:\n \"\"\"Add full names of type aliases on which the current node depends.\n\n This is used by fine-grained incremental mode to re-check the corresponding nodes.\n If `target` is None, then the target node used will be the current scope.\n \"\"\"\n if not aliases_used:\n # A basic optimization to avoid adding targets with no dependencies to\n # the `alias_deps` dict.\n return\n if target is None:\n target = self.scope.current_target()\n self.cur_mod_node.alias_deps[target].update(aliases_used)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.is_mangled_global_SemanticAnalyzer.is_future_flag_set.return.flag_in_self_future_impor": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.is_mangled_global_SemanticAnalyzer.is_future_flag_set.return.flag_in_self_future_impor", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4966, "end_line": 4987, "span_ids": ["SemanticAnalyzer.parse_bool", "SemanticAnalyzer.is_mangled_global", "SemanticAnalyzer.is_future_flag_set", "SemanticAnalyzer.is_initial_mangled_global", "SemanticAnalyzer.set_future_import_flags"], "tokens": 229}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def is_mangled_global(self, name: str) -> bool:\n # A global is mangled if there exists at least one renamed variant.\n return unmangle(name) + \"'\" in self.globals\n\n def is_initial_mangled_global(self, name: str) -> bool:\n # If there are renamed definitions for a global, the first one has exactly one prime.\n return name == unmangle(name) + \"'\"\n\n def parse_bool(self, expr: Expression) -> Optional[bool]:\n if isinstance(expr, NameExpr):\n if expr.fullname == 'builtins.True':\n return True\n if expr.fullname == 'builtins.False':\n return False\n return None\n\n def set_future_import_flags(self, module_name: str) -> None:\n if module_name in FUTURE_IMPORTS:\n self.future_import_flags.add(FUTURE_IMPORTS[module_name])\n\n def is_future_flag_set(self, flag: str) -> bool:\n return flag in self.future_import_flags", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_HasPlaceholders_names_modified_by_assignment.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_HasPlaceholders_names_modified_by_assignment.return.result", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4990, "end_line": 5090, "span_ids": ["apply_semantic_analyzer_patches", "MakeAnyNonExplicit", "find_duplicate", "MakeAnyNonExplicit.visit_any", "make_any_non_explicit", "remove_imported_names_from_symtable", "HasPlaceholders", "HasPlaceholders.__init__", "MakeAnyNonExplicit.visit_type_alias_type", "refers_to_class_or_function", "refers_to_fullname", "HasPlaceholders.visit_placeholder_type", "replace_implicit_first_type", "has_placeholder", "names_modified_by_assignment"], "tokens": 777}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class HasPlaceholders(TypeQuery[bool]):\n def __init__(self) -> None:\n super().__init__(any)\n\n def visit_placeholder_type(self, t: PlaceholderType) -> bool:\n return True\n\n\ndef has_placeholder(typ: Type) -> bool:\n \"\"\"Check if a type contains any placeholder types (recursively).\"\"\"\n return typ.accept(HasPlaceholders())\n\n\ndef replace_implicit_first_type(sig: FunctionLike, new: Type) -> FunctionLike:\n if isinstance(sig, CallableType):\n if len(sig.arg_types) == 0:\n return sig\n return sig.copy_modified(arg_types=[new] + sig.arg_types[1:])\n elif isinstance(sig, Overloaded):\n return Overloaded([cast(CallableType, replace_implicit_first_type(i, new))\n for i in sig.items()])\n else:\n assert False\n\n\ndef refers_to_fullname(node: Expression, fullname: str) -> bool:\n \"\"\"Is node a name or member expression with the given full name?\"\"\"\n if not isinstance(node, RefExpr):\n return False\n if node.fullname == fullname:\n return True\n if isinstance(node.node, TypeAlias):\n target = get_proper_type(node.node.target)\n if isinstance(target, Instance) and target.type.fullname == fullname:\n return True\n return False\n\n\ndef refers_to_class_or_function(node: Expression) -> bool:\n \"\"\"Does semantically analyzed node refer to a class?\"\"\"\n return (isinstance(node, RefExpr) and\n isinstance(node.node, (TypeInfo, FuncDef, OverloadedFuncDef)))\n\n\ndef find_duplicate(list: List[T]) -> Optional[T]:\n \"\"\"If the list has duplicates, return one of the duplicates.\n\n Otherwise, return None.\n \"\"\"\n for i in range(1, len(list)):\n if list[i] in list[:i]:\n return list[i]\n return None\n\n\ndef remove_imported_names_from_symtable(names: SymbolTable,\n module: str) -> None:\n \"\"\"Remove all imported names from the symbol table of a module.\"\"\"\n removed = [] # type: List[str]\n for name, node in names.items():\n if node.node is None:\n continue\n fullname = node.node.fullname\n prefix = fullname[:fullname.rfind('.')]\n if prefix != module:\n removed.append(name)\n for name in removed:\n del names[name]\n\n\ndef make_any_non_explicit(t: Type) -> Type:\n \"\"\"Replace all Any types within in with Any that has attribute 'explicit' set to False\"\"\"\n return t.accept(MakeAnyNonExplicit())\n\n\nclass MakeAnyNonExplicit(TypeTranslator):\n def visit_any(self, t: AnyType) -> Type:\n if t.type_of_any == TypeOfAny.explicit:\n return t.copy_modified(TypeOfAny.special_form)\n return t\n\n def visit_type_alias_type(self, t: TypeAliasType) -> Type:\n return t.copy_modified(args=[a.accept(self) for a in t.args])\n\n\ndef apply_semantic_analyzer_patches(patches: List[Tuple[int, Callable[[], None]]]) -> None:\n \"\"\"Call patch callbacks in the right order.\n\n This should happen after semantic analyzer pass 3.\n \"\"\"\n patches_by_priority = sorted(patches, key=lambda x: x[0])\n for priority, patch_func in patches_by_priority:\n patch_func()\n\n\ndef names_modified_by_assignment(s: AssignmentStmt) -> List[NameExpr]:\n \"\"\"Return all unqualified (short) names assigned to in an assignment statement.\"\"\"\n result = [] # type: List[NameExpr]\n for lvalue in s.lvalues:\n result += names_modified_in_lvalue(lvalue)\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_names_modified_in_lvalue_names_modified_in_lvalue.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_names_modified_in_lvalue_names_modified_in_lvalue.return._", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 5093, "end_line": 5104, "span_ids": ["names_modified_in_lvalue"], "tokens": 117}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def names_modified_in_lvalue(lvalue: Lvalue) -> List[NameExpr]:\n \"\"\"Return all NameExpr assignment targets in an Lvalue.\"\"\"\n if isinstance(lvalue, NameExpr):\n return [lvalue]\n elif isinstance(lvalue, StarExpr):\n return names_modified_in_lvalue(lvalue.expr)\n elif isinstance(lvalue, (ListExpr, TupleExpr)):\n result = [] # type: List[NameExpr]\n for item in lvalue.items:\n result += names_modified_in_lvalue(item)\n return result\n return []", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_is_same_var_from_getattr_dummy_context.return.TempNode_AnyType_TypeOfAn": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_is_same_var_from_getattr_dummy_context.return.TempNode_AnyType_TypeOfAn", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 5107, "end_line": 5117, "span_ids": ["is_same_var_from_getattr", "dummy_context"], "tokens": 116}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_same_var_from_getattr(n1: Optional[SymbolNode], n2: Optional[SymbolNode]) -> bool:\n \"\"\"Do n1 and n2 refer to the same Var derived from module-level __getattr__?\"\"\"\n return (isinstance(n1, Var)\n and n1.from_module_getattr\n and isinstance(n2, Var)\n and n2.from_module_getattr\n and n1.fullname == n2.fullname)\n\n\ndef dummy_context() -> Context:\n return TempNode(AnyType(TypeOfAny.special_form))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_is_valid_replacement_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_is_valid_replacement_", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 5120, "end_line": 5142, "span_ids": ["is_valid_replacement", "is_same_symbol"], "tokens": 183}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_valid_replacement(old: SymbolTableNode, new: SymbolTableNode) -> bool:\n \"\"\"Can symbol table node replace an existing one?\n\n These are the only valid cases:\n\n 1. Placeholder gets replaced with a non-placeholder\n 2. Placeholder that isn't known to become type replaced with a\n placeholder that can become a type\n \"\"\"\n if isinstance(old.node, PlaceholderNode):\n if isinstance(new.node, PlaceholderNode):\n return not old.node.becomes_typeinfo and new.node.becomes_typeinfo\n else:\n return True\n return False\n\n\ndef is_same_symbol(a: Optional[SymbolNode], b: Optional[SymbolNode]) -> bool:\n return (a == b\n or (isinstance(a, PlaceholderNode)\n and isinstance(b, PlaceholderNode))\n or is_same_var_from_getattr(a, b))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_classprop.py__Calculate_some_propert_TYPE_PROMOTIONS_PYTHON2_u": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_classprop.py__Calculate_some_propert_TYPE_PROMOTIONS_PYTHON2_u", "embedding": null, "metadata": {"file_path": "mypy/semanal_classprop.py", "file_name": "semanal_classprop.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 46, "span_ids": ["docstring"], "tokens": 359}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Calculate some properties of classes.\n\nThese happen after semantic analysis and before type checking.\n\"\"\"\n\nfrom typing import List, Set, Optional\nfrom typing_extensions import Final\n\nfrom mypy.nodes import (\n Node, TypeInfo, Var, Decorator, OverloadedFuncDef, SymbolTable, CallExpr, PromoteExpr,\n)\nfrom mypy.types import Instance, Type\nfrom mypy.errors import Errors\nfrom mypy.options import Options\n\n# Hard coded type promotions (shared between all Python versions).\n# These add extra ad-hoc edges to the subtyping relation. For example,\n# int is considered a subtype of float, even though there is no\n# subclass relationship.\nTYPE_PROMOTIONS = {\n 'builtins.int': 'float',\n 'builtins.float': 'complex',\n} # type: Final\n\n# Hard coded type promotions for Python 3.\n#\n# Note that the bytearray -> bytes promotion is a little unsafe\n# as some functions only accept bytes objects. Here convenience\n# trumps safety.\nTYPE_PROMOTIONS_PYTHON3 = TYPE_PROMOTIONS.copy() # type: Final\nTYPE_PROMOTIONS_PYTHON3.update({\n 'builtins.bytearray': 'bytes',\n 'builtins.memoryview': 'bytes',\n})\n\n# Hard coded type promotions for Python 2.\n#\n# These promotions are unsafe, but we are doing them anyway\n# for convenience and also for Python 3 compatibility\n# (bytearray -> str).\nTYPE_PROMOTIONS_PYTHON2 = TYPE_PROMOTIONS.copy() # type: Final\nTYPE_PROMOTIONS_PYTHON2.update({\n 'builtins.str': 'unicode',\n 'builtins.bytearray': 'str',\n 'builtins.memoryview': 'str',\n})", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_classprop.py_calculate_class_abstract_status_calculate_class_abstract_status.if_typ_is_final_and_abstr.errors_report_typ_line_t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_classprop.py_calculate_class_abstract_status_calculate_class_abstract_status.if_typ_is_final_and_abstr.errors_report_typ_line_t", "embedding": null, "metadata": {"file_path": "mypy/semanal_classprop.py", "file_name": "semanal_classprop.py", "file_type": "text/x-python", "category": "implementation", "start_line": 49, "end_line": 115, "span_ids": ["calculate_class_abstract_status"], "tokens": 679}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def calculate_class_abstract_status(typ: TypeInfo, is_stub_file: bool, errors: Errors) -> None:\n \"\"\"Calculate abstract status of a class.\n\n Set is_abstract of the type to True if the type has an unimplemented\n abstract attribute. Also compute a list of abstract attributes.\n Report error is required ABCMeta metaclass is missing.\n \"\"\"\n if typ.typeddict_type:\n return # TypedDict can't be abstract\n concrete = set() # type: Set[str]\n abstract = [] # type: List[str]\n abstract_in_this_class = [] # type: List[str]\n if typ.is_newtype:\n # Special case: NewTypes are considered as always non-abstract, so they can be used as:\n # Config = NewType('Config', Mapping[str, str])\n # default = Config({'cannot': 'modify'}) # OK\n typ.abstract_attributes = []\n return\n for base in typ.mro:\n for name, symnode in base.names.items():\n node = symnode.node\n if isinstance(node, OverloadedFuncDef):\n # Unwrap an overloaded function definition. We can just\n # check arbitrarily the first overload item. If the\n # different items have a different abstract status, there\n # should be an error reported elsewhere.\n if node.items: # can be empty for invalid overloads\n func = node.items[0] # type: Optional[Node]\n else:\n func = None\n else:\n func = node\n if isinstance(func, Decorator):\n fdef = func.func\n if fdef.is_abstract and name not in concrete:\n typ.is_abstract = True\n abstract.append(name)\n if base is typ:\n abstract_in_this_class.append(name)\n elif isinstance(node, Var):\n if node.is_abstract_var and name not in concrete:\n typ.is_abstract = True\n abstract.append(name)\n if base is typ:\n abstract_in_this_class.append(name)\n concrete.add(name)\n # In stubs, abstract classes need to be explicitly marked because it is too\n # easy to accidentally leave a concrete class abstract by forgetting to\n # implement some methods.\n typ.abstract_attributes = sorted(abstract)\n if is_stub_file:\n if typ.declared_metaclass and typ.declared_metaclass.type.fullname == 'abc.ABCMeta':\n return\n if typ.is_protocol:\n return\n if abstract and not abstract_in_this_class:\n def report(message: str, severity: str) -> None:\n errors.report(typ.line, typ.column, message, severity=severity)\n\n attrs = \", \".join('\"{}\"'.format(attr) for attr in sorted(abstract))\n report(\"Class {} has abstract attributes {}\".format(typ.fullname, attrs), 'error')\n report(\"If it is meant to be abstract, add 'abc.ABCMeta' as an explicit metaclass\",\n 'note')\n if typ.is_final and abstract:\n attrs = \", \".join('\"{}\"'.format(attr) for attr in sorted(abstract))\n errors.report(typ.line, typ.column,\n \"Final class {} has abstract attributes {}\".format(typ.fullname, attrs))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_classprop.py_check_protocol_status_calculate_class_vars.for_name_sym_in_info_nam.if_isinstance_node_Var_.for_base_in_info_mro_1_.if_member_is_not_None.node.is_classvar.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_classprop.py_check_protocol_status_calculate_class_vars.for_name_sym_in_info_nam.if_isinstance_node_Var_.for_base_in_info_mro_1_.if_member_is_not_None.node.is_classvar.True", "embedding": null, "metadata": {"file_path": "mypy/semanal_classprop.py", "file_name": "semanal_classprop.py", "file_type": "text/x-python", "category": "implementation", "start_line": 118, "end_line": 146, "span_ids": ["calculate_class_vars", "check_protocol_status"], "tokens": 270}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def check_protocol_status(info: TypeInfo, errors: Errors) -> None:\n \"\"\"Check that all classes in MRO of a protocol are protocols\"\"\"\n if info.is_protocol:\n for type in info.bases:\n if not type.type.is_protocol and type.type.fullname != 'builtins.object':\n def report(message: str, severity: str) -> None:\n errors.report(info.line, info.column, message, severity=severity)\n report('All bases of a protocol must be protocols', 'error')\n\n\ndef calculate_class_vars(info: TypeInfo) -> None:\n \"\"\"Try to infer additional class variables.\n\n Subclass attribute assignments with no type annotation are assumed\n to be classvar if overriding a declared classvar from the base\n class.\n\n This must happen after the main semantic analysis pass, since\n this depends on base class bodies having been fully analyzed.\n \"\"\"\n for name, sym in info.names.items():\n node = sym.node\n if isinstance(node, Var) and node.info and node.is_inferred and not node.is_classvar:\n for base in info.mro[1:]:\n member = base.names.get(name)\n if (member is not None\n and isinstance(member.node, Var)\n and member.node.is_classvar):\n node.is_classvar = True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_classprop.py_add_type_promotion_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_classprop.py_add_type_promotion_", "embedding": null, "metadata": {"file_path": "mypy/semanal_classprop.py", "file_name": "semanal_classprop.py", "file_type": "text/x-python", "category": "implementation", "start_line": 149, "end_line": 173, "span_ids": ["add_type_promotion"], "tokens": 244}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_type_promotion(info: TypeInfo, module_names: SymbolTable, options: Options) -> None:\n \"\"\"Setup extra, ad-hoc subtyping relationships between classes (promotion).\n\n This includes things like 'int' being compatible with 'float'.\n \"\"\"\n defn = info.defn\n promote_target = None # type: Optional[Type]\n for decorator in defn.decorators:\n if isinstance(decorator, CallExpr):\n analyzed = decorator.analyzed\n if isinstance(analyzed, PromoteExpr):\n # _promote class decorator (undocumented feature).\n promote_target = analyzed.type\n if not promote_target:\n promotions = (TYPE_PROMOTIONS_PYTHON3 if options.python_version[0] >= 3\n else TYPE_PROMOTIONS_PYTHON2)\n if defn.fullname in promotions:\n target_sym = module_names.get(promotions[defn.fullname])\n # With test stubs, the target may not exist.\n if target_sym:\n target_info = target_sym.node\n assert isinstance(target_info, TypeInfo)\n promote_target = Instance(target_info, [])\n defn.info._promote = promote_target", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_enum.py__Semantic_analysis_of_c_from_mypy_options_import_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_enum.py__Semantic_analysis_of_c_from_mypy_options_import_", "embedding": null, "metadata": {"file_path": "mypy/semanal_enum.py", "file_name": "semanal_enum.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 14, "span_ids": ["docstring"], "tokens": 125}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Semantic analysis of call-based Enum definitions.\n\nThis is conceptually part of mypy.semanal (semantic analyzer pass 2).\n\"\"\"\n\nfrom typing import List, Tuple, Optional, Union, cast\n\nfrom mypy.nodes import (\n Expression, Context, TypeInfo, AssignmentStmt, NameExpr, CallExpr, RefExpr, StrExpr,\n UnicodeExpr, TupleExpr, ListExpr, DictExpr, Var, SymbolTableNode, MDEF, ARG_POS,\n ARG_NAMED, EnumCallExpr, MemberExpr\n)\nfrom mypy.semanal_shared import SemanticAnalyzerInterface\nfrom mypy.options import Options", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_enum.py_EnumCallAnalyzer_EnumCallAnalyzer.process_enum_call.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_enum.py_EnumCallAnalyzer_EnumCallAnalyzer.process_enum_call.return.True", "embedding": null, "metadata": {"file_path": "mypy/semanal_enum.py", "file_name": "semanal_enum.py", "file_type": "text/x-python", "category": "implementation", "start_line": 17, "end_line": 40, "span_ids": ["EnumCallAnalyzer", "EnumCallAnalyzer.__init__", "EnumCallAnalyzer.process_enum_call"], "tokens": 237}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class EnumCallAnalyzer:\n def __init__(self, options: Options, api: SemanticAnalyzerInterface) -> None:\n self.options = options\n self.api = api\n\n def process_enum_call(self, s: AssignmentStmt, is_func_scope: bool) -> bool:\n \"\"\"Check if s defines an Enum; if yes, store the definition in symbol table.\n\n Return True if this looks like an Enum definition (but maybe with errors),\n otherwise return False.\n \"\"\"\n if len(s.lvalues) != 1 or not isinstance(s.lvalues[0], (NameExpr, MemberExpr)):\n return False\n lvalue = s.lvalues[0]\n name = lvalue.name\n enum_call = self.check_enum_call(s.rvalue, name, is_func_scope)\n if enum_call is None:\n return False\n if isinstance(lvalue, MemberExpr):\n self.fail(\"Enum type as attribute is not supported\", lvalue)\n return False\n # Yes, it's a valid Enum definition. Add it to the symbol table.\n self.api.add_symbol(name, enum_call, s)\n return True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_enum.py_EnumCallAnalyzer.check_enum_call_EnumCallAnalyzer.check_enum_call.return.info": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_enum.py_EnumCallAnalyzer.check_enum_call_EnumCallAnalyzer.check_enum_call.return.info", "embedding": null, "metadata": {"file_path": "mypy/semanal_enum.py", "file_name": "semanal_enum.py", "file_type": "text/x-python", "category": "implementation", "start_line": 42, "end_line": 83, "span_ids": ["EnumCallAnalyzer.check_enum_call"], "tokens": 355}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class EnumCallAnalyzer:\n\n def check_enum_call(self,\n node: Expression,\n var_name: str,\n is_func_scope: bool) -> Optional[TypeInfo]:\n \"\"\"Check if a call defines an Enum.\n\n Example:\n\n A = enum.Enum('A', 'foo bar')\n\n is equivalent to:\n\n class A(enum.Enum):\n foo = 1\n bar = 2\n \"\"\"\n if not isinstance(node, CallExpr):\n return None\n call = node\n callee = call.callee\n if not isinstance(callee, RefExpr):\n return None\n fullname = callee.fullname\n if fullname not in ('enum.Enum', 'enum.IntEnum', 'enum.Flag', 'enum.IntFlag'):\n return None\n items, values, ok = self.parse_enum_call_args(call, fullname.split('.')[-1])\n if not ok:\n # Error. Construct dummy return value.\n info = self.build_enum_call_typeinfo(var_name, [], fullname)\n else:\n name = cast(Union[StrExpr, UnicodeExpr], call.args[0]).value\n if name != var_name or is_func_scope:\n # Give it a unique name derived from the line number.\n name += '@' + str(call.line)\n info = self.build_enum_call_typeinfo(name, items, fullname)\n # Store generated TypeInfo under both names, see semanal_namedtuple for more details.\n if name != var_name or is_func_scope:\n self.api.add_symbol_skip_local(name, info)\n call.analyzed = EnumCallExpr(info, items, values)\n call.analyzed.set_line(call.line, call.column)\n info.line = node.line\n return info", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_enum.py_EnumCallAnalyzer.build_enum_call_typeinfo_EnumCallAnalyzer.build_enum_call_typeinfo.return.info": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_enum.py_EnumCallAnalyzer.build_enum_call_typeinfo_EnumCallAnalyzer.build_enum_call_typeinfo.return.info", "embedding": null, "metadata": {"file_path": "mypy/semanal_enum.py", "file_name": "semanal_enum.py", "file_type": "text/x-python", "category": "implementation", "start_line": 85, "end_line": 97, "span_ids": ["EnumCallAnalyzer.build_enum_call_typeinfo"], "tokens": 138}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class EnumCallAnalyzer:\n\n def build_enum_call_typeinfo(self, name: str, items: List[str], fullname: str) -> TypeInfo:\n base = self.api.named_type_or_none(fullname)\n assert base is not None\n info = self.api.basic_new_typeinfo(name, base)\n info.metaclass_type = info.calculate_metaclass_type()\n info.is_enum = True\n for item in items:\n var = Var(item)\n var.info = info\n var.is_property = True\n var._fullname = '{}.{}'.format(info.fullname, item)\n info.names[item] = SymbolTableNode(MDEF, var)\n return info", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_enum.py_EnumCallAnalyzer.parse_enum_call_args_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_enum.py_EnumCallAnalyzer.parse_enum_call_args_", "embedding": null, "metadata": {"file_path": "mypy/semanal_enum.py", "file_name": "semanal_enum.py", "file_type": "text/x-python", "category": "implementation", "start_line": 99, "end_line": 186, "span_ids": ["EnumCallAnalyzer.fail", "EnumCallAnalyzer.parse_enum_call_args", "EnumCallAnalyzer.fail_enum_call_arg"], "tokens": 879}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class EnumCallAnalyzer:\n\n def parse_enum_call_args(self, call: CallExpr,\n class_name: str) -> Tuple[List[str],\n List[Optional[Expression]], bool]:\n \"\"\"Parse arguments of an Enum call.\n\n Return a tuple of fields, values, was there an error.\n \"\"\"\n args = call.args\n if not all([arg_kind in [ARG_POS, ARG_NAMED] for arg_kind in call.arg_kinds]):\n return self.fail_enum_call_arg(\"Unexpected arguments to %s()\" % class_name, call)\n if len(args) < 2:\n return self.fail_enum_call_arg(\"Too few arguments for %s()\" % class_name, call)\n if len(args) > 6:\n return self.fail_enum_call_arg(\"Too many arguments for %s()\" % class_name, call)\n valid_name = [None, 'value', 'names', 'module', 'qualname', 'type', 'start']\n for arg_name in call.arg_names:\n if arg_name not in valid_name:\n self.fail_enum_call_arg(\"Unexpected keyword argument '{}'\".format(arg_name), call)\n value, names = None, None\n for arg_name, arg in zip(call.arg_names, args):\n if arg_name == 'value':\n value = arg\n if arg_name == 'names':\n names = arg\n if value is None:\n value = args[0]\n if names is None:\n names = args[1]\n if not isinstance(value, (StrExpr, UnicodeExpr)):\n return self.fail_enum_call_arg(\n \"%s() expects a string literal as the first argument\" % class_name, call)\n items = []\n values = [] # type: List[Optional[Expression]]\n if isinstance(names, (StrExpr, UnicodeExpr)):\n fields = names.value\n for field in fields.replace(',', ' ').split():\n items.append(field)\n elif isinstance(names, (TupleExpr, ListExpr)):\n seq_items = names.items\n if all(isinstance(seq_item, (StrExpr, UnicodeExpr)) for seq_item in seq_items):\n items = [cast(Union[StrExpr, UnicodeExpr], seq_item).value\n for seq_item in seq_items]\n elif all(isinstance(seq_item, (TupleExpr, ListExpr))\n and len(seq_item.items) == 2\n and isinstance(seq_item.items[0], (StrExpr, UnicodeExpr))\n for seq_item in seq_items):\n for seq_item in seq_items:\n assert isinstance(seq_item, (TupleExpr, ListExpr))\n name, value = seq_item.items\n assert isinstance(name, (StrExpr, UnicodeExpr))\n items.append(name.value)\n values.append(value)\n else:\n return self.fail_enum_call_arg(\n \"%s() with tuple or list expects strings or (name, value) pairs\" %\n class_name,\n call)\n elif isinstance(names, DictExpr):\n for key, value in names.items:\n if not isinstance(key, (StrExpr, UnicodeExpr)):\n return self.fail_enum_call_arg(\n \"%s() with dict literal requires string literals\" % class_name, call)\n items.append(key.value)\n values.append(value)\n else:\n # TODO: Allow dict(x=1, y=2) as a substitute for {'x': 1, 'y': 2}?\n return self.fail_enum_call_arg(\n \"%s() expects a string, tuple, list or dict literal as the second argument\" %\n class_name,\n call)\n if len(items) == 0:\n return self.fail_enum_call_arg(\"%s() needs at least one item\" % class_name, call)\n if not values:\n values = [None] * len(items)\n assert len(items) == len(values)\n return items, values, True\n\n def fail_enum_call_arg(self, message: str,\n context: Context) -> Tuple[List[str],\n List[Optional[Expression]], bool]:\n self.fail(message, context)\n return [], [], False\n\n # Helpers\n\n def fail(self, msg: str, ctx: Context) -> None:\n self.api.fail(msg, ctx)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_infer.py__Simple_type_inference__infer_decorator_signature_if_simple.if_dec_decorators_.if_sig_.dec.var.type.sig": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_infer.py__Simple_type_inference__infer_decorator_signature_if_simple.if_dec_decorators_.if_sig_.dec.var.type.sig", "embedding": null, "metadata": {"file_path": "mypy/semanal_infer.py", "file_name": "semanal_infer.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 63, "span_ids": ["infer_decorator_signature_if_simple", "docstring"], "tokens": 579}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Simple type inference for decorated functions during semantic analysis.\"\"\"\n\nfrom typing import Optional\n\nfrom mypy.nodes import Expression, Decorator, CallExpr, FuncDef, RefExpr, Var, ARG_POS\nfrom mypy.types import (\n Type, CallableType, AnyType, TypeOfAny, TypeVarType, ProperType, get_proper_type\n)\nfrom mypy.typeops import function_type\nfrom mypy.typevars import has_no_typevars\nfrom mypy.semanal_shared import SemanticAnalyzerInterface\n\n\ndef infer_decorator_signature_if_simple(dec: Decorator,\n analyzer: SemanticAnalyzerInterface) -> None:\n \"\"\"Try to infer the type of the decorated function.\n\n This lets us resolve additional references to decorated functions\n during type checking. Otherwise the type might not be available\n when we need it, since module top levels can't be deferred.\n\n This basically uses a simple special-purpose type inference\n engine just for decorators.\n \"\"\"\n if dec.var.is_property:\n # Decorators are expected to have a callable type (it's a little odd).\n if dec.func.type is None:\n dec.var.type = CallableType(\n [AnyType(TypeOfAny.special_form)],\n [ARG_POS],\n [None],\n AnyType(TypeOfAny.special_form),\n analyzer.named_type('__builtins__.function'),\n name=dec.var.name)\n elif isinstance(dec.func.type, CallableType):\n dec.var.type = dec.func.type\n return\n decorator_preserves_type = True\n for expr in dec.decorators:\n preserve_type = False\n if isinstance(expr, RefExpr) and isinstance(expr.node, FuncDef):\n if expr.node.type and is_identity_signature(expr.node.type):\n preserve_type = True\n if not preserve_type:\n decorator_preserves_type = False\n break\n if decorator_preserves_type:\n # No non-identity decorators left. We can trivially infer the type\n # of the function here.\n dec.var.type = function_type(dec.func, analyzer.named_type('__builtins__.function'))\n if dec.decorators:\n return_type = calculate_return_type(dec.decorators[0])\n if return_type and isinstance(return_type, AnyType):\n # The outermost decorator will return Any so we know the type of the\n # decorated function.\n dec.var.type = AnyType(TypeOfAny.from_another_any, source_any=return_type)\n sig = find_fixed_callable_return(dec.decorators[0])\n if sig:\n # The outermost decorator always returns the same kind of function,\n # so we know that this is the type of the decorated function.\n orig_sig = function_type(dec.func, analyzer.named_type('__builtins__.function'))\n sig.name = orig_sig.items()[0].name\n dec.var.type = sig", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_infer.py_is_identity_signature_calculate_return_type.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_infer.py_is_identity_signature_calculate_return_type.return.None", "embedding": null, "metadata": {"file_path": "mypy/semanal_infer.py", "file_name": "semanal_infer.py", "file_type": "text/x-python", "category": "implementation", "start_line": 66, "end_line": 96, "span_ids": ["calculate_return_type", "is_identity_signature"], "tokens": 277}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_identity_signature(sig: Type) -> bool:\n \"\"\"Is type a callable of form T -> T (where T is a type variable)?\"\"\"\n sig = get_proper_type(sig)\n if isinstance(sig, CallableType) and sig.arg_kinds == [ARG_POS]:\n if isinstance(sig.arg_types[0], TypeVarType) and isinstance(sig.ret_type, TypeVarType):\n return sig.arg_types[0].id == sig.ret_type.id\n return False\n\n\ndef calculate_return_type(expr: Expression) -> Optional[ProperType]:\n \"\"\"Return the return type if we can calculate it.\n\n This only uses information available during semantic analysis so this\n will sometimes return None because of insufficient information (as\n type inference hasn't run yet).\n \"\"\"\n if isinstance(expr, RefExpr):\n if isinstance(expr.node, FuncDef):\n typ = expr.node.type\n if typ is None:\n # No signature -> default to Any.\n return AnyType(TypeOfAny.unannotated)\n # Explicit Any return?\n if isinstance(typ, CallableType):\n return get_proper_type(typ.ret_type)\n return None\n elif isinstance(expr.node, Var):\n return get_proper_type(expr.node.type)\n elif isinstance(expr, CallExpr):\n return calculate_return_type(expr.callee)\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_infer.py_find_fixed_callable_return_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_infer.py_find_fixed_callable_return_", "embedding": null, "metadata": {"file_path": "mypy/semanal_infer.py", "file_name": "semanal_infer.py", "file_type": "text/x-python", "category": "implementation", "start_line": 99, "end_line": 121, "span_ids": ["find_fixed_callable_return"], "tokens": 204}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def find_fixed_callable_return(expr: Expression) -> Optional[CallableType]:\n \"\"\"Return the return type, if expression refers to a callable that returns a callable.\n\n But only do this if the return type has no type variables. Return None otherwise.\n This approximates things a lot as this is supposed to be called before type checking\n when full type information is not available yet.\n \"\"\"\n if isinstance(expr, RefExpr):\n if isinstance(expr.node, FuncDef):\n typ = expr.node.type\n if typ:\n if isinstance(typ, CallableType) and has_no_typevars(typ.ret_type):\n ret_type = get_proper_type(typ.ret_type)\n if isinstance(ret_type, CallableType):\n return ret_type\n elif isinstance(expr, CallExpr):\n t = find_fixed_callable_return(expr.callee)\n if t:\n ret_type = get_proper_type(t.ret_type)\n if isinstance(ret_type, CallableType):\n return ret_type\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_main.py__Top_level_logic_for_th_core_modules._typing_builtins_a": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_main.py__Top_level_logic_for_th_core_modules._typing_builtins_a", "embedding": null, "metadata": {"file_path": "mypy/semanal_main.py", "file_name": "semanal_main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 63, "span_ids": ["docstring:3", "docstring"], "tokens": 552}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Top-level logic for the semantic analyzer.\n\nThe semantic analyzer binds names, resolves imports, detects various\nspecial constructs that don't have dedicated AST nodes after parse\n(such as 'cast' which looks like a call), populates symbol tables, and\nperforms various simple consistency checks.\n\nSemantic analysis of each SCC (strongly connected component; import\ncycle) is performed in one unit. Each module is analyzed as multiple\nseparate *targets*; the module top level is one target and each function\nis a target. Nested functions are not separate targets, however. This is\nmostly identical to targets used by mypy daemon (but classes aren't\ntargets in semantic analysis).\n\nWe first analyze each module top level in an SCC. If we encounter some\nnames that we can't bind because the target of the name may not have\nbeen processed yet, we *defer* the current target for further\nprocessing. Deferred targets will be analyzed additional times until\neverything can be bound, or we reach a maximum number of iterations.\n\nWe keep track of a set of incomplete namespaces, i.e. namespaces that we\nhaven't finished populating yet. References to these namespaces cause a\ndeferral if they can't be satisfied. Initially every module in the SCC\nwill be incomplete.\n\"\"\"\n\nimport contextlib\nfrom typing import List, Tuple, Optional, Union, Callable, Iterator\nfrom typing_extensions import TYPE_CHECKING\n\nfrom mypy.nodes import (\n MypyFile, TypeInfo, FuncDef, Decorator, OverloadedFuncDef, Var\n)\nfrom mypy.semanal_typeargs import TypeArgumentAnalyzer\nfrom mypy.state import strict_optional_set\nfrom mypy.semanal import (\n SemanticAnalyzer, apply_semantic_analyzer_patches, remove_imported_names_from_symtable\n)\nfrom mypy.semanal_classprop import (\n calculate_class_abstract_status, calculate_class_vars, check_protocol_status,\n add_type_promotion\n)\nfrom mypy.errors import Errors\nfrom mypy.semanal_infer import infer_decorator_signature_if_simple\nfrom mypy.checker import FineGrainedDeferredNode\nfrom mypy.server.aststrip import SavedAttributes\nfrom mypy.util import is_typeshed_file\nimport mypy.build\n\nif TYPE_CHECKING:\n from mypy.build import Graph, State\n\n\nPatches = List[Tuple[int, Callable[[], None]]]\n\n\n# If we perform this many iterations, raise an exception since we are likely stuck.\nMAX_ITERATIONS = 20\n\n\n# Number of passes over core modules before going on to the rest of the builtin SCC.\nCORE_WARMUP = 2\ncore_modules = ['typing', 'builtins', 'abc', 'collections']", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_main.py_semantic_analysis_for_scc_semantic_analysis_for_scc.if_builtins_in_scc_.cleanup_builtin_scc_graph": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_main.py_semantic_analysis_for_scc_semantic_analysis_for_scc.if_builtins_in_scc_.cleanup_builtin_scc_graph", "embedding": null, "metadata": {"file_path": "mypy/semanal_main.py", "file_name": "semanal_main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 66, "end_line": 89, "span_ids": ["semantic_analysis_for_scc"], "tokens": 261}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def semantic_analysis_for_scc(graph: 'Graph', scc: List[str], errors: Errors) -> None:\n \"\"\"Perform semantic analysis for all modules in a SCC (import cycle).\n\n Assume that reachability analysis has already been performed.\n\n The scc will be processed roughly in the order the modules are included\n in the list.\n \"\"\"\n patches = [] # type: Patches\n # Note that functions can't define new module-level attributes\n # using 'global x', since module top levels are fully processed\n # before functions. This limitation is unlikely to go away soon.\n process_top_levels(graph, scc, patches)\n process_functions(graph, scc, patches)\n # We use patch callbacks to fix up things when we expect relatively few\n # callbacks to be required.\n apply_semantic_analyzer_patches(patches)\n # This pass might need fallbacks calculated above.\n check_type_arguments(graph, scc, errors)\n calculate_class_properties(graph, scc, errors)\n check_blockers(graph, scc)\n # Clean-up builtins, so that TypeVar etc. are not accessible without importing.\n if 'builtins' in scc:\n cleanup_builtin_scc(graph['builtins'])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_main.py_cleanup_builtin_scc_cleanup_builtin_scc.remove_imported_names_fro": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_main.py_cleanup_builtin_scc_cleanup_builtin_scc.remove_imported_names_fro", "embedding": null, "metadata": {"file_path": "mypy/semanal_main.py", "file_name": "semanal_main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 92, "end_line": 101, "span_ids": ["cleanup_builtin_scc"], "tokens": 105}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def cleanup_builtin_scc(state: 'State') -> None:\n \"\"\"Remove imported names from builtins namespace.\n\n This way names imported from typing in builtins.pyi aren't available\n by default (without importing them). We can only do this after processing\n the whole SCC is finished, when the imported names aren't needed for\n processing builtins.pyi itself.\n \"\"\"\n assert state.tree is not None\n remove_imported_names_from_symtable(state.tree.names, 'builtins')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_main.py_semantic_analysis_for_targets_semantic_analysis_for_targets.calculate_class_propertie": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_main.py_semantic_analysis_for_targets_semantic_analysis_for_targets.calculate_class_propertie", "embedding": null, "metadata": {"file_path": "mypy/semanal_main.py", "file_name": "semanal_main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 104, "end_line": 134, "span_ids": ["semantic_analysis_for_targets"], "tokens": 295}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def semantic_analysis_for_targets(\n state: 'State',\n nodes: List[FineGrainedDeferredNode],\n graph: 'Graph',\n saved_attrs: SavedAttributes) -> None:\n \"\"\"Semantically analyze only selected nodes in a given module.\n\n This essentially mirrors the logic of semantic_analysis_for_scc()\n except that we process only some targets. This is used in fine grained\n incremental mode, when propagating an update.\n\n The saved_attrs are implicitly declared instance attributes (attributes\n defined on self) removed by AST stripper that may need to be reintroduced\n here. They must be added before any methods are analyzed.\n \"\"\"\n patches = [] # type: Patches\n if any(isinstance(n.node, MypyFile) for n in nodes):\n # Process module top level first (if needed).\n process_top_levels(graph, [state.id], patches)\n restore_saved_attrs(saved_attrs)\n analyzer = state.manager.semantic_analyzer\n for n in nodes:\n if isinstance(n.node, MypyFile):\n # Already done above.\n continue\n process_top_level_function(analyzer, state, state.id,\n n.node.fullname, n.node, n.active_typeinfo, patches)\n apply_semantic_analyzer_patches(patches)\n\n check_type_arguments_in_targets(nodes, state, state.manager.errors)\n calculate_class_properties(graph, [state.id], state.manager.errors)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_main.py_restore_saved_attrs_restore_saved_attrs.for_cdef_name_sym_in_.if_existing_is_None_or.info_names_name_sym": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_main.py_restore_saved_attrs_restore_saved_attrs.for_cdef_name_sym_in_.if_existing_is_None_or.info_names_name_sym", "embedding": null, "metadata": {"file_path": "mypy/semanal_main.py", "file_name": "semanal_main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 137, "end_line": 153, "span_ids": ["restore_saved_attrs"], "tokens": 211}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def restore_saved_attrs(saved_attrs: SavedAttributes) -> None:\n \"\"\"Restore instance variables removed during AST strip that haven't been added yet.\"\"\"\n for (cdef, name), sym in saved_attrs.items():\n info = cdef.info\n existing = info.get(name)\n defined_in_this_class = name in info.names\n assert isinstance(sym.node, Var)\n # This needs to mimic the logic in SemanticAnalyzer.analyze_member_lvalue()\n # regarding the existing variable in class body or in a superclass:\n # If the attribute of self is not defined in superclasses, create a new Var.\n if (existing is None or\n # (An abstract Var is considered as not defined.)\n (isinstance(existing.node, Var) and existing.node.is_abstract_var) or\n # Also an explicit declaration on self creates a new Var unless\n # there is already one defined in the class body.\n sym.node.explicit_self_type and not defined_in_this_class):\n info.names[name] = sym", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_main.py_process_top_levels_process_top_levels.while_worklist_.final_iteration.not_any_progress": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_main.py_process_top_levels_process_top_levels.while_worklist_.final_iteration.not_any_progress", "embedding": null, "metadata": {"file_path": "mypy/semanal_main.py", "file_name": "semanal_main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 156, "end_line": 213, "span_ids": ["process_top_levels"], "tokens": 505}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def process_top_levels(graph: 'Graph', scc: List[str], patches: Patches) -> None:\n # Process top levels until everything has been bound.\n\n # Reverse order of the scc so the first modules in the original list will be\n # be processed first. This helps with performance.\n scc = list(reversed(scc))\n\n # Initialize ASTs and symbol tables.\n for id in scc:\n state = graph[id]\n assert state.tree is not None\n state.manager.semantic_analyzer.prepare_file(state.tree)\n\n # Initially all namespaces in the SCC are incomplete (well they are empty).\n state.manager.incomplete_namespaces.update(scc)\n\n worklist = scc[:]\n # HACK: process core stuff first. This is mostly needed to support defining\n # named tuples in builtin SCC.\n if all(m in worklist for m in core_modules):\n worklist += list(reversed(core_modules)) * CORE_WARMUP\n final_iteration = False\n iteration = 0\n analyzer = state.manager.semantic_analyzer\n analyzer.deferral_debug_context.clear()\n\n while worklist:\n iteration += 1\n if iteration > MAX_ITERATIONS:\n # Just pick some module inside the current SCC for error context.\n assert state.tree is not None\n with analyzer.file_context(state.tree, state.options):\n analyzer.report_hang()\n break\n if final_iteration:\n # Give up. It's impossible to bind all names.\n state.manager.incomplete_namespaces.clear()\n all_deferred = [] # type: List[str]\n any_progress = False\n while worklist:\n next_id = worklist.pop()\n state = graph[next_id]\n assert state.tree is not None\n deferred, incomplete, progress = semantic_analyze_target(next_id, state,\n state.tree,\n None,\n final_iteration,\n patches)\n all_deferred += deferred\n any_progress = any_progress or progress\n if not incomplete:\n state.manager.incomplete_namespaces.discard(next_id)\n if final_iteration:\n assert not all_deferred, 'Must not defer during final iteration'\n # Reverse to process the targets in the same order on every iteration. This avoids\n # processing the same target twice in a row, which is inefficient.\n worklist = list(reversed(all_deferred))\n final_iteration = not any_progress", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_main.py_process_functions_process_functions.for_module_in_scc_.for_target_node_active_.process_top_level_functio": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_main.py_process_functions_process_functions.for_module_in_scc_.for_target_node_active_.process_top_level_functio", "embedding": null, "metadata": {"file_path": "mypy/semanal_main.py", "file_name": "semanal_main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 216, "end_line": 239, "span_ids": ["process_functions"], "tokens": 243}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def process_functions(graph: 'Graph', scc: List[str], patches: Patches) -> None:\n # Process functions.\n for module in scc:\n tree = graph[module].tree\n assert tree is not None\n analyzer = graph[module].manager.semantic_analyzer\n # In principle, functions can be processed in arbitrary order,\n # but _methods_ must be processed in the order they are defined,\n # because some features (most notably partial types) depend on\n # order of definitions on self.\n #\n # There can be multiple generated methods per line. Use target\n # name as the second sort key to get a repeatable sort order on\n # Python 3.5, which doesn't preserve dictionary order.\n targets = sorted(get_all_leaf_targets(tree), key=lambda x: (x[1].line, x[0]))\n for target, node, active_type in targets:\n assert isinstance(node, (FuncDef, OverloadedFuncDef, Decorator))\n process_top_level_function(analyzer,\n graph[module],\n module,\n target,\n node,\n active_type,\n patches)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_main.py_process_top_level_function_process_top_level_function.analyzer_saved_locals_cle": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_main.py_process_top_level_function_process_top_level_function.analyzer_saved_locals_cle", "embedding": null, "metadata": {"file_path": "mypy/semanal_main.py", "file_name": "semanal_main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 242, "end_line": 284, "span_ids": ["process_top_level_function"], "tokens": 391}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def process_top_level_function(analyzer: 'SemanticAnalyzer',\n state: 'State',\n module: str,\n target: str,\n node: Union[FuncDef, OverloadedFuncDef, Decorator],\n active_type: Optional[TypeInfo],\n patches: Patches) -> None:\n \"\"\"Analyze single top-level function or method.\n\n Process the body of the function (including nested functions) again and again,\n until all names have been resolved (ot iteration limit reached).\n \"\"\"\n # We need one more iteration after incomplete is False (e.g. to report errors, if any).\n final_iteration = False\n incomplete = True\n # Start in the incomplete state (no missing names will be reported on first pass).\n # Note that we use module name, since functions don't create qualified names.\n deferred = [module]\n analyzer.deferral_debug_context.clear()\n analyzer.incomplete_namespaces.add(module)\n iteration = 0\n while deferred:\n iteration += 1\n if iteration == MAX_ITERATIONS:\n # Just pick some module inside the current SCC for error context.\n assert state.tree is not None\n with analyzer.file_context(state.tree, state.options):\n analyzer.report_hang()\n break\n if not (deferred or incomplete) or final_iteration:\n # OK, this is one last pass, now missing names will be reported.\n analyzer.incomplete_namespaces.discard(module)\n deferred, incomplete, progress = semantic_analyze_target(target, state, node, active_type,\n final_iteration, patches)\n if final_iteration:\n assert not deferred, 'Must not defer during final iteration'\n if not progress:\n final_iteration = True\n\n analyzer.incomplete_namespaces.discard(module)\n # After semantic analysis is done, discard local namespaces\n # to avoid memory hoarding.\n analyzer.saved_locals.clear()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_main.py_TargetInfo_get_all_leaf_targets.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_main.py_TargetInfo_get_all_leaf_targets.return.result", "embedding": null, "metadata": {"file_path": "mypy/semanal_main.py", "file_name": "semanal_main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 287, "end_line": 296, "span_ids": ["impl:10", "get_all_leaf_targets"], "tokens": 120}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "TargetInfo = Tuple[str, Union[MypyFile, FuncDef, OverloadedFuncDef, Decorator], Optional[TypeInfo]]\n\n\ndef get_all_leaf_targets(file: MypyFile) -> List[TargetInfo]:\n \"\"\"Return all leaf targets in a symbol table (module-level and methods).\"\"\"\n result = [] # type: List[TargetInfo]\n for fullname, node, active_type in file.local_definitions():\n if isinstance(node.node, (FuncDef, OverloadedFuncDef, Decorator)):\n result.append((fullname, node.node, active_type))\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_main.py_semantic_analyze_target_semantic_analyze_target.if_analyzer_deferred_.else_.return._analyzer_incomplete_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_main.py_semantic_analyze_target_semantic_analyze_target.if_analyzer_deferred_.else_.return._analyzer_incomplete_", "embedding": null, "metadata": {"file_path": "mypy/semanal_main.py", "file_name": "semanal_main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 299, "end_line": 348, "span_ids": ["semantic_analyze_target"], "tokens": 397}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def semantic_analyze_target(target: str,\n state: 'State',\n node: Union[MypyFile, FuncDef, OverloadedFuncDef, Decorator],\n active_type: Optional[TypeInfo],\n final_iteration: bool,\n patches: Patches) -> Tuple[List[str], bool, bool]:\n \"\"\"Semantically analyze a single target.\n\n Return tuple with these items:\n - list of deferred targets\n - was some definition incomplete\n - were any new names were defined (or placeholders replaced)\n \"\"\"\n state.manager.processed_targets.append(target)\n tree = state.tree\n assert tree is not None\n analyzer = state.manager.semantic_analyzer\n # TODO: Move initialization to somewhere else\n analyzer.global_decls = [set()]\n analyzer.nonlocal_decls = [set()]\n analyzer.globals = tree.names\n analyzer.progress = False\n with state.wrap_context(check_blockers=False):\n refresh_node = node\n if isinstance(refresh_node, Decorator):\n # Decorator expressions will be processed as part of the module top level.\n refresh_node = refresh_node.func\n analyzer.refresh_partial(refresh_node,\n patches,\n final_iteration,\n file_node=tree,\n options=state.options,\n active_type=active_type)\n if isinstance(node, Decorator):\n infer_decorator_signature_if_simple(node, analyzer)\n for dep in analyzer.imports:\n state.add_dependency(dep)\n priority = mypy.build.PRI_LOW\n if priority <= state.priorities.get(dep, priority):\n state.priorities[dep] = priority\n\n # Clear out some stale data to avoid memory leaks and astmerge\n # validity check confusion\n analyzer.statement = None\n del analyzer.cur_mod_node\n\n if analyzer.deferred:\n return [target], analyzer.incomplete, analyzer.progress\n else:\n return [], analyzer.incomplete, analyzer.progress", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_main.py_check_type_arguments_check_type_arguments_in_targets.with_state_wrap_context_.with_strict_optional_set_.for_target_in_targets_.with_errors_scope_saved_s.target_node_accept_analyz": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_main.py_check_type_arguments_check_type_arguments_in_targets.with_state_wrap_context_.with_strict_optional_set_.for_target_in_targets_.with_errors_scope_saved_s.target_node_accept_analyz", "embedding": null, "metadata": {"file_path": "mypy/semanal_main.py", "file_name": "semanal_main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 351, "end_line": 382, "span_ids": ["check_type_arguments_in_targets", "check_type_arguments"], "tokens": 300}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def check_type_arguments(graph: 'Graph', scc: List[str], errors: Errors) -> None:\n for module in scc:\n state = graph[module]\n assert state.tree\n analyzer = TypeArgumentAnalyzer(errors,\n state.options,\n is_typeshed_file(state.path or ''))\n with state.wrap_context():\n with strict_optional_set(state.options.strict_optional):\n state.tree.accept(analyzer)\n\n\ndef check_type_arguments_in_targets(targets: List[FineGrainedDeferredNode], state: 'State',\n errors: Errors) -> None:\n \"\"\"Check type arguments against type variable bounds and restrictions.\n\n This mirrors the logic in check_type_arguments() except that we process only\n some targets. This is used in fine grained incremental mode.\n \"\"\"\n analyzer = TypeArgumentAnalyzer(errors,\n state.options,\n is_typeshed_file(state.path or ''))\n with state.wrap_context():\n with strict_optional_set(state.options.strict_optional):\n for target in targets:\n func = None # type: Optional[Union[FuncDef, OverloadedFuncDef]]\n if isinstance(target.node, (FuncDef, OverloadedFuncDef)):\n func = target.node\n saved = (state.id, target.active_typeinfo, func) # module, class, function\n with errors.scope.saved_scope(saved) if errors.scope else nothing():\n analyzer.recurse_into_functions = func is not None\n target.node.accept(analyzer)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_main.py_calculate_class_properties_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_main.py_calculate_class_properties_", "embedding": null, "metadata": {"file_path": "mypy/semanal_main.py", "file_name": "semanal_main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 385, "end_line": 407, "span_ids": ["nothing", "calculate_class_properties", "check_blockers"], "tokens": 191}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def calculate_class_properties(graph: 'Graph', scc: List[str], errors: Errors) -> None:\n for module in scc:\n tree = graph[module].tree\n assert tree\n for _, node, _ in tree.local_definitions():\n if isinstance(node.node, TypeInfo):\n saved = (module, node.node, None) # module, class, function\n with errors.scope.saved_scope(saved) if errors.scope else nothing():\n calculate_class_abstract_status(node.node, tree.is_stub, errors)\n check_protocol_status(node.node, errors)\n calculate_class_vars(node.node)\n add_type_promotion(node.node, tree.names, graph[module].options)\n\n\ndef check_blockers(graph: 'Graph', scc: List[str]) -> None:\n for module in scc:\n graph[module].check_blockers()\n\n\n@contextlib.contextmanager\ndef nothing() -> Iterator[None]:\n yield", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_namedtuple.py__Semantic_analysis_of_n_SELF_TVAR_NAME.__NT_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_namedtuple.py__Semantic_analysis_of_n_SELF_TVAR_NAME.__NT_", "embedding": null, "metadata": {"file_path": "mypy/semanal_namedtuple.py", "file_name": "semanal_namedtuple.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 37, "span_ids": ["docstring"], "tokens": 400}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Semantic analysis of named tuple definitions.\n\nThis is conceptually part of mypy.semanal.\n\"\"\"\n\nfrom contextlib import contextmanager\nfrom typing import Tuple, List, Dict, Mapping, Optional, Union, cast, Iterator\nfrom typing_extensions import Final\n\nfrom mypy.types import (\n Type, TupleType, AnyType, TypeOfAny, TypeVarDef, CallableType, TypeType, TypeVarType,\n UnboundType,\n)\nfrom mypy.semanal_shared import (\n SemanticAnalyzerInterface, set_callable_name, calculate_tuple_fallback, PRIORITY_FALLBACKS\n)\nfrom mypy.nodes import (\n Var, EllipsisExpr, Argument, StrExpr, BytesExpr, UnicodeExpr, ExpressionStmt, NameExpr,\n AssignmentStmt, PassStmt, Decorator, FuncBase, ClassDef, Expression, RefExpr, TypeInfo,\n NamedTupleExpr, CallExpr, Context, TupleExpr, ListExpr, SymbolTableNode, FuncDef, Block,\n TempNode, SymbolTable, TypeVarExpr, ARG_POS, ARG_NAMED_OPT, ARG_OPT, MDEF\n)\nfrom mypy.options import Options\nfrom mypy.exprtotype import expr_to_unanalyzed_type, TypeTranslationError\nfrom mypy.util import get_unique_redefinition_name\n\n# Matches \"_prohibited\" in typing.py, but adds __annotations__, which works at runtime but can't\n# easily be supported in a static checker.\nNAMEDTUPLE_PROHIBITED_NAMES = ('__new__', '__init__', '__slots__', '__getnewargs__',\n '_fields', '_field_defaults', '_field_types',\n '_make', '_replace', '_asdict', '_source',\n '__annotations__') # type: Final\n\nNAMEDTUP_CLASS_ERROR = ('Invalid statement in NamedTuple definition; '\n 'expected \"field_name: field_type [= default]\"') # type: Final\n\nSELF_TVAR_NAME = '_NT'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_namedtuple.py_None_5_NamedTupleAnalyzer.analyze_namedtuple_classdef.return.False_None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_namedtuple.py_None_5_NamedTupleAnalyzer.analyze_namedtuple_classdef.return.False_None", "embedding": null, "metadata": {"file_path": "mypy/semanal_namedtuple.py", "file_name": "semanal_namedtuple.py", "file_type": "text/x-python", "category": "implementation", "start_line": 37, "end_line": 71, "span_ids": ["NamedTupleAnalyzer.analyze_namedtuple_classdef", "NamedTupleAnalyzer", "NamedTupleAnalyzer.__init__", "docstring"], "tokens": 334}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": " # type: Final\n\n\nclass NamedTupleAnalyzer:\n def __init__(self, options: Options, api: SemanticAnalyzerInterface) -> None:\n self.options = options\n self.api = api\n\n def analyze_namedtuple_classdef(self, defn: ClassDef, is_stub_file: bool\n ) -> Tuple[bool, Optional[TypeInfo]]:\n \"\"\"Analyze if given class definition can be a named tuple definition.\n\n Return a tuple where first item indicates whether this can possibly be a named tuple,\n and the second item is the corresponding TypeInfo (may be None if not ready and should be\n deferred).\n \"\"\"\n for base_expr in defn.base_type_exprs:\n if isinstance(base_expr, RefExpr):\n self.api.accept(base_expr)\n if base_expr.fullname == 'typing.NamedTuple':\n result = self.check_namedtuple_classdef(defn, is_stub_file)\n if result is None:\n # This is a valid named tuple, but some types are incomplete.\n return True, None\n items, types, default_items = result\n info = self.build_namedtuple_typeinfo(\n defn.name, items, types, default_items, defn.line)\n defn.info = info\n defn.analyzed = NamedTupleExpr(info, is_typed=True)\n defn.analyzed.line = defn.line\n defn.analyzed.column = defn.column\n # All done: this is a valid named tuple with all types known.\n return True, info\n # This can't be a valid named tuple.\n return False, None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_namedtuple.py_NamedTupleAnalyzer.check_namedtuple_classdef_NamedTupleAnalyzer.check_namedtuple_classdef.return.items_types_default_ite": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_namedtuple.py_NamedTupleAnalyzer.check_namedtuple_classdef_NamedTupleAnalyzer.check_namedtuple_classdef.return.items_types_default_ite", "embedding": null, "metadata": {"file_path": "mypy/semanal_namedtuple.py", "file_name": "semanal_namedtuple.py", "file_type": "text/x-python", "category": "implementation", "start_line": 73, "end_line": 136, "span_ids": ["NamedTupleAnalyzer.check_namedtuple_classdef"], "tokens": 621}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class NamedTupleAnalyzer:\n\n def check_namedtuple_classdef(self, defn: ClassDef, is_stub_file: bool\n ) -> Optional[Tuple[List[str],\n List[Type],\n Dict[str, Expression]]]:\n \"\"\"Parse and validate fields in named tuple class definition.\n\n Return a three tuple:\n * field names\n * field types\n * field default values\n or None, if any of the types are not ready.\n \"\"\"\n if self.options.python_version < (3, 6) and not is_stub_file:\n self.fail('NamedTuple class syntax is only supported in Python 3.6', defn)\n return [], [], {}\n if len(defn.base_type_exprs) > 1:\n self.fail('NamedTuple should be a single base', defn)\n items = [] # type: List[str]\n types = [] # type: List[Type]\n default_items = {} # type: Dict[str, Expression]\n for stmt in defn.defs.body:\n if not isinstance(stmt, AssignmentStmt):\n # Still allow pass or ... (for empty namedtuples).\n if (isinstance(stmt, PassStmt) or\n (isinstance(stmt, ExpressionStmt) and\n isinstance(stmt.expr, EllipsisExpr))):\n continue\n # Also allow methods, including decorated ones.\n if isinstance(stmt, (Decorator, FuncBase)):\n continue\n # And docstrings.\n if (isinstance(stmt, ExpressionStmt) and\n isinstance(stmt.expr, StrExpr)):\n continue\n self.fail(NAMEDTUP_CLASS_ERROR, stmt)\n elif len(stmt.lvalues) > 1 or not isinstance(stmt.lvalues[0], NameExpr):\n # An assignment, but an invalid one.\n self.fail(NAMEDTUP_CLASS_ERROR, stmt)\n else:\n # Append name and type in this case...\n name = stmt.lvalues[0].name\n items.append(name)\n if stmt.type is None:\n types.append(AnyType(TypeOfAny.unannotated))\n else:\n analyzed = self.api.anal_type(stmt.type)\n if analyzed is None:\n # Something is incomplete. We need to defer this named tuple.\n return None\n types.append(analyzed)\n # ...despite possible minor failures that allow further analyzis.\n if name.startswith('_'):\n self.fail('NamedTuple field name cannot start with an underscore: {}'\n .format(name), stmt)\n if stmt.type is None or hasattr(stmt, 'new_syntax') and not stmt.new_syntax:\n self.fail(NAMEDTUP_CLASS_ERROR, stmt)\n elif isinstance(stmt.rvalue, TempNode):\n # x: int assigns rvalue to TempNode(AnyType())\n if default_items:\n self.fail('Non-default NamedTuple fields cannot follow default fields',\n stmt)\n else:\n default_items[name] = stmt.rvalue\n return items, types, default_items", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_namedtuple.py_NamedTupleAnalyzer.check_namedtuple_NamedTupleAnalyzer.check_namedtuple._because_classes_are": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_namedtuple.py_NamedTupleAnalyzer.check_namedtuple_NamedTupleAnalyzer.check_namedtuple._because_classes_are", "embedding": null, "metadata": {"file_path": "mypy/semanal_namedtuple.py", "file_name": "semanal_namedtuple.py", "file_type": "text/x-python", "category": "implementation", "start_line": 138, "end_line": 221, "span_ids": ["NamedTupleAnalyzer.check_namedtuple"], "tokens": 826}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class NamedTupleAnalyzer:\n\n def check_namedtuple(self,\n node: Expression,\n var_name: Optional[str],\n is_func_scope: bool) -> Tuple[Optional[str], Optional[TypeInfo]]:\n \"\"\"Check if a call defines a namedtuple.\n\n The optional var_name argument is the name of the variable to\n which this is assigned, if any.\n\n Return a tuple of two items:\n * Internal name of the named tuple (e.g. the name passed as an argument to namedtuple)\n or None if it is not a valid named tuple\n * Corresponding TypeInfo, or None if not ready.\n\n If the definition is invalid but looks like a namedtuple,\n report errors but return (some) TypeInfo.\n \"\"\"\n if not isinstance(node, CallExpr):\n return None, None\n call = node\n callee = call.callee\n if not isinstance(callee, RefExpr):\n return None, None\n fullname = callee.fullname\n if fullname == 'collections.namedtuple':\n is_typed = False\n elif fullname == 'typing.NamedTuple':\n is_typed = True\n else:\n return None, None\n result = self.parse_namedtuple_args(call, fullname)\n if result:\n items, types, defaults, typename, ok = result\n else:\n # Error. Construct dummy return value.\n if var_name:\n name = var_name\n else:\n name = 'namedtuple@' + str(call.line)\n info = self.build_namedtuple_typeinfo(name, [], [], {}, node.line)\n self.store_namedtuple_info(info, name, call, is_typed)\n return name, info\n if not ok:\n # This is a valid named tuple but some types are not ready.\n return typename, None\n\n # We use the variable name as the class name if it exists. If\n # it doesn't, we use the name passed as an argument. We prefer\n # the variable name because it should be unique inside a\n # module, and so we don't need to disambiguate it with a line\n # number.\n if var_name:\n name = var_name\n else:\n name = typename\n\n if var_name is None or is_func_scope:\n # There are two special cases where need to give it a unique name derived\n # from the line number:\n # * This is a base class expression, since it often matches the class name:\n # class NT(NamedTuple('NT', [...])):\n # ...\n # * This is a local (function or method level) named tuple, since\n # two methods of a class can define a named tuple with the same name,\n # and they will be stored in the same namespace (see below).\n name += '@' + str(call.line)\n if len(defaults) > 0:\n default_items = {\n arg_name: default\n for arg_name, default in zip(items[-len(defaults):], defaults)\n }\n else:\n default_items = {}\n info = self.build_namedtuple_typeinfo(name, items, types, default_items, node.line)\n # If var_name is not None (i.e. this is not a base class expression), we always\n # store the generated TypeInfo under var_name in the current scope, so that\n # other definitions can use it.\n if var_name:\n self.store_namedtuple_info(info, var_name, call, is_typed)\n # There are three cases where we need to store the generated TypeInfo\n # second time (for the purpose of serialization):\n # * If there is a name mismatch like One = NamedTuple('Other', [...])\n # we also store the info under name 'Other@lineno', this is needed\n # because classes are (de)serialized using their actual fullname, not\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_namedtuple.py_NamedTupleAnalyzer.check_namedtuple._the_name_of_l_h_s__NamedTupleAnalyzer.store_namedtuple_info.call_analyzed_set_line_ca": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_namedtuple.py_NamedTupleAnalyzer.check_namedtuple._the_name_of_l_h_s__NamedTupleAnalyzer.store_namedtuple_info.call_analyzed_set_line_ca", "embedding": null, "metadata": {"file_path": "mypy/semanal_namedtuple.py", "file_name": "semanal_namedtuple.py", "file_type": "text/x-python", "category": "implementation", "start_line": 222, "end_line": 238, "span_ids": ["NamedTupleAnalyzer.store_namedtuple_info", "NamedTupleAnalyzer.check_namedtuple"], "tokens": 259}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class NamedTupleAnalyzer:\n\n def check_namedtuple(self,\n node: Expression,\n var_name: Optional[str],\n is_func_scope: bool) -> Tuple[Optional[str], Optional[TypeInfo]]:\n # the name of l.h.s.\n # * If this is a method level named tuple. It can leak from the method\n # via assignment to self attribute and therefore needs to be serialized\n # (local namespaces are not serialized).\n # * If it is a base class expression. It was not stored above, since\n # there is no var_name (but it still needs to be serialized\n # since it is in MRO of some class).\n if name != var_name or is_func_scope:\n # NOTE: we skip local namespaces since they are not serialized.\n self.api.add_symbol_skip_local(name, info)\n return typename, info\n\n def store_namedtuple_info(self, info: TypeInfo, name: str,\n call: CallExpr, is_typed: bool) -> None:\n self.api.add_symbol(name, info, call)\n call.analyzed = NamedTupleExpr(info, is_typed=is_typed)\n call.analyzed.set_line(call.line, call.column)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_namedtuple.py_NamedTupleAnalyzer.parse_namedtuple_args_NamedTupleAnalyzer.parse_namedtuple_args.return.items_types_defaults_t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_namedtuple.py_NamedTupleAnalyzer.parse_namedtuple_args_NamedTupleAnalyzer.parse_namedtuple_args.return.items_types_defaults_t", "embedding": null, "metadata": {"file_path": "mypy/semanal_namedtuple.py", "file_name": "semanal_namedtuple.py", "file_type": "text/x-python", "category": "implementation", "start_line": 240, "end_line": 325, "span_ids": ["NamedTupleAnalyzer.parse_namedtuple_args"], "tokens": 828}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class NamedTupleAnalyzer:\n\n def parse_namedtuple_args(self, call: CallExpr, fullname: str\n ) -> Optional[Tuple[List[str], List[Type], List[Expression],\n str, bool]]:\n \"\"\"Parse a namedtuple() call into data needed to construct a type.\n\n Returns a 5-tuple:\n - List of argument names\n - List of argument types\n - List of default values\n - First argument of namedtuple\n - Whether all types are ready.\n\n Return None if the definition didn't typecheck.\n \"\"\"\n # TODO: Share code with check_argument_count in checkexpr.py?\n args = call.args\n if len(args) < 2:\n self.fail(\"Too few arguments for namedtuple()\", call)\n return None\n defaults = [] # type: List[Expression]\n if len(args) > 2:\n # Typed namedtuple doesn't support additional arguments.\n if fullname == 'typing.NamedTuple':\n self.fail(\"Too many arguments for NamedTuple()\", call)\n return None\n for i, arg_name in enumerate(call.arg_names[2:], 2):\n if arg_name == 'defaults':\n arg = args[i]\n # We don't care what the values are, as long as the argument is an iterable\n # and we can count how many defaults there are.\n if isinstance(arg, (ListExpr, TupleExpr)):\n defaults = list(arg.items)\n else:\n self.fail(\n \"List or tuple literal expected as the defaults argument to \"\n \"namedtuple()\",\n arg\n )\n break\n if call.arg_kinds[:2] != [ARG_POS, ARG_POS]:\n self.fail(\"Unexpected arguments to namedtuple()\", call)\n return None\n if not isinstance(args[0], (StrExpr, BytesExpr, UnicodeExpr)):\n self.fail(\n \"namedtuple() expects a string literal as the first argument\", call)\n return None\n typename = cast(Union[StrExpr, BytesExpr, UnicodeExpr], call.args[0]).value\n types = [] # type: List[Type]\n if not isinstance(args[1], (ListExpr, TupleExpr)):\n if (fullname == 'collections.namedtuple'\n and isinstance(args[1], (StrExpr, BytesExpr, UnicodeExpr))):\n str_expr = args[1]\n items = str_expr.value.replace(',', ' ').split()\n else:\n self.fail(\n \"List or tuple literal expected as the second argument to namedtuple()\", call)\n return None\n else:\n listexpr = args[1]\n if fullname == 'collections.namedtuple':\n # The fields argument contains just names, with implicit Any types.\n if any(not isinstance(item, (StrExpr, BytesExpr, UnicodeExpr))\n for item in listexpr.items):\n self.fail(\"String literal expected as namedtuple() item\", call)\n return None\n items = [cast(Union[StrExpr, BytesExpr, UnicodeExpr], item).value\n for item in listexpr.items]\n else:\n # The fields argument contains (name, type) tuples.\n result = self.parse_namedtuple_fields_with_types(listexpr.items, call)\n if result is None:\n # One of the types is not ready, defer.\n return None\n items, types, _, ok = result\n if not ok:\n return [], [], [], typename, False\n if not types:\n types = [AnyType(TypeOfAny.unannotated) for _ in items]\n underscore = [item for item in items if item.startswith('_')]\n if underscore:\n self.fail(\"namedtuple() field names cannot start with an underscore: \"\n + ', '.join(underscore), call)\n if len(defaults) > len(items):\n self.fail(\"Too many defaults given in call to namedtuple()\", call)\n defaults = defaults[:len(items)]\n return items, types, defaults, typename, True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_namedtuple.py_NamedTupleAnalyzer.parse_namedtuple_fields_with_types_NamedTupleAnalyzer.parse_namedtuple_fields_with_types.return.items_types_True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_namedtuple.py_NamedTupleAnalyzer.parse_namedtuple_fields_with_types_NamedTupleAnalyzer.parse_namedtuple_fields_with_types.return.items_types_True", "embedding": null, "metadata": {"file_path": "mypy/semanal_namedtuple.py", "file_name": "semanal_namedtuple.py", "file_type": "text/x-python", "category": "implementation", "start_line": 327, "end_line": 363, "span_ids": ["NamedTupleAnalyzer.parse_namedtuple_fields_with_types"], "tokens": 337}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class NamedTupleAnalyzer:\n\n def parse_namedtuple_fields_with_types(self, nodes: List[Expression], context: Context\n ) -> Optional[Tuple[List[str], List[Type],\n List[Expression], bool]]:\n \"\"\"Parse typed named tuple fields.\n\n Return (names, types, defaults, whether types are all ready), or None if error occurred.\n \"\"\"\n items = [] # type: List[str]\n types = [] # type: List[Type]\n for item in nodes:\n if isinstance(item, TupleExpr):\n if len(item.items) != 2:\n self.fail(\"Invalid NamedTuple field definition\", item)\n return None\n name, type_node = item.items\n if isinstance(name, (StrExpr, BytesExpr, UnicodeExpr)):\n items.append(name.value)\n else:\n self.fail(\"Invalid NamedTuple() field name\", item)\n return None\n try:\n type = expr_to_unanalyzed_type(type_node)\n except TypeTranslationError:\n self.fail('Invalid field type', type_node)\n return None\n analyzed = self.api.anal_type(type)\n # Workaround #4987 and avoid introducing a bogus UnboundType\n if isinstance(analyzed, UnboundType):\n analyzed = AnyType(TypeOfAny.from_error)\n # These should be all known, otherwise we would defer in visit_assignment_stmt().\n if analyzed is None:\n return [], [], [], False\n types.append(analyzed)\n else:\n self.fail(\"Tuple expected as NamedTuple() field\", item)\n return None\n return items, types, [], True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_namedtuple.py_NamedTupleAnalyzer.build_namedtuple_typeinfo_NamedTupleAnalyzer.build_namedtuple_typeinfo.selftype.TypeVarType_tvd_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_namedtuple.py_NamedTupleAnalyzer.build_namedtuple_typeinfo_NamedTupleAnalyzer.build_namedtuple_typeinfo.selftype.TypeVarType_tvd_", "embedding": null, "metadata": {"file_path": "mypy/semanal_namedtuple.py", "file_name": "semanal_namedtuple.py", "file_type": "text/x-python", "category": "implementation", "start_line": 365, "end_line": 426, "span_ids": ["NamedTupleAnalyzer.build_namedtuple_typeinfo"], "tokens": 772}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class NamedTupleAnalyzer:\n\n def build_namedtuple_typeinfo(self,\n name: str,\n items: List[str],\n types: List[Type],\n default_items: Mapping[str, Expression],\n line: int) -> TypeInfo:\n strtype = self.api.named_type('__builtins__.str')\n implicit_any = AnyType(TypeOfAny.special_form)\n basetuple_type = self.api.named_type('__builtins__.tuple', [implicit_any])\n dictype = (self.api.named_type_or_none('builtins.dict', [strtype, implicit_any])\n or self.api.named_type('__builtins__.object'))\n # Actual signature should return OrderedDict[str, Union[types]]\n ordereddictype = (self.api.named_type_or_none('builtins.dict', [strtype, implicit_any])\n or self.api.named_type('__builtins__.object'))\n fallback = self.api.named_type('__builtins__.tuple', [implicit_any])\n # Note: actual signature should accept an invariant version of Iterable[UnionType[types]].\n # but it can't be expressed. 'new' and 'len' should be callable types.\n iterable_type = self.api.named_type_or_none('typing.Iterable', [implicit_any])\n function_type = self.api.named_type('__builtins__.function')\n\n info = self.api.basic_new_typeinfo(name, fallback)\n info.is_named_tuple = True\n tuple_base = TupleType(types, fallback)\n info.tuple_type = tuple_base\n info.line = line\n # For use by mypyc.\n info.metadata['namedtuple'] = {'fields': items.copy()}\n\n # We can't calculate the complete fallback type until after semantic\n # analysis, since otherwise base classes might be incomplete. Postpone a\n # callback function that patches the fallback.\n self.api.schedule_patch(PRIORITY_FALLBACKS,\n lambda: calculate_tuple_fallback(tuple_base))\n\n def add_field(var: Var, is_initialized_in_class: bool = False,\n is_property: bool = False) -> None:\n var.info = info\n var.is_initialized_in_class = is_initialized_in_class\n var.is_property = is_property\n var._fullname = '%s.%s' % (info.fullname, var.name)\n info.names[var.name] = SymbolTableNode(MDEF, var)\n\n fields = [Var(item, typ) for item, typ in zip(items, types)]\n for var in fields:\n add_field(var, is_property=True)\n # We can't share Vars between fields and method arguments, since they\n # have different full names (the latter are normally used as local variables\n # in functions, so their full names are set to short names when generated methods\n # are analyzed).\n vars = [Var(item, typ) for item, typ in zip(items, types)]\n\n tuple_of_strings = TupleType([strtype for _ in items], basetuple_type)\n add_field(Var('_fields', tuple_of_strings), is_initialized_in_class=True)\n add_field(Var('_field_types', dictype), is_initialized_in_class=True)\n add_field(Var('_field_defaults', dictype), is_initialized_in_class=True)\n add_field(Var('_source', strtype), is_initialized_in_class=True)\n add_field(Var('__annotations__', ordereddictype), is_initialized_in_class=True)\n add_field(Var('__doc__', strtype), is_initialized_in_class=True)\n\n tvd = TypeVarDef(SELF_TVAR_NAME, info.fullname + '.' + SELF_TVAR_NAME,\n -1, [], info.tuple_type)\n selftype = TypeVarType(tvd)\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_namedtuple.py_NamedTupleAnalyzer.build_namedtuple_typeinfo.add_method_NamedTupleAnalyzer.build_namedtuple_typeinfo.add_method.info_names_funcname_sy": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_namedtuple.py_NamedTupleAnalyzer.build_namedtuple_typeinfo.add_method_NamedTupleAnalyzer.build_namedtuple_typeinfo.add_method.info_names_funcname_sy", "embedding": null, "metadata": {"file_path": "mypy/semanal_namedtuple.py", "file_name": "semanal_namedtuple.py", "file_type": "text/x-python", "category": "implementation", "start_line": 428, "end_line": 465, "span_ids": ["NamedTupleAnalyzer.build_namedtuple_typeinfo"], "tokens": 409}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class NamedTupleAnalyzer:\n\n def build_namedtuple_typeinfo(self,\n name: str,\n items: List[str],\n types: List[Type],\n default_items: Mapping[str, Expression],\n line: int) -> TypeInfo:\n # ... other code\n\n def add_method(funcname: str,\n ret: Type,\n args: List[Argument],\n is_classmethod: bool = False,\n is_new: bool = False,\n ) -> None:\n if is_classmethod or is_new:\n first = [Argument(Var('_cls'), TypeType.make_normalized(selftype), None, ARG_POS)]\n else:\n first = [Argument(Var('_self'), selftype, None, ARG_POS)]\n args = first + args\n\n types = [arg.type_annotation for arg in args]\n items = [arg.variable.name for arg in args]\n arg_kinds = [arg.kind for arg in args]\n assert None not in types\n signature = CallableType(cast(List[Type], types), arg_kinds, items, ret,\n function_type)\n signature.variables = [tvd]\n func = FuncDef(funcname, args, Block([]))\n func.info = info\n func.is_class = is_classmethod\n func.type = set_callable_name(signature, func)\n func._fullname = info.fullname + '.' + funcname\n func.line = line\n if is_classmethod:\n v = Var(funcname, func.type)\n v.is_classmethod = True\n v.info = info\n v._fullname = func._fullname\n func.is_decorated = True\n dec = Decorator(func, [NameExpr('classmethod')], v)\n dec.line = line\n sym = SymbolTableNode(MDEF, dec)\n else:\n sym = SymbolTableNode(MDEF, func)\n sym.plugin_generated = True\n info.names[funcname] = sym\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_namedtuple.py_NamedTupleAnalyzer.build_namedtuple_typeinfo.add_method__replace_re_NamedTupleAnalyzer.build_namedtuple_typeinfo.return.info": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_namedtuple.py_NamedTupleAnalyzer.build_namedtuple_typeinfo.add_method__replace_re_NamedTupleAnalyzer.build_namedtuple_typeinfo.return.info", "embedding": null, "metadata": {"file_path": "mypy/semanal_namedtuple.py", "file_name": "semanal_namedtuple.py", "file_type": "text/x-python", "category": "implementation", "start_line": 467, "end_line": 488, "span_ids": ["NamedTupleAnalyzer.build_namedtuple_typeinfo"], "tokens": 325}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class NamedTupleAnalyzer:\n\n def build_namedtuple_typeinfo(self,\n name: str,\n items: List[str],\n types: List[Type],\n default_items: Mapping[str, Expression],\n line: int) -> TypeInfo:\n # ... other code\n\n add_method('_replace', ret=selftype,\n args=[Argument(var, var.type, EllipsisExpr(), ARG_NAMED_OPT) for var in vars])\n\n def make_init_arg(var: Var) -> Argument:\n default = default_items.get(var.name, None)\n kind = ARG_POS if default is None else ARG_OPT\n return Argument(var, var.type, default, kind)\n\n add_method('__new__', ret=selftype,\n args=[make_init_arg(var) for var in vars],\n is_new=True)\n add_method('_asdict', args=[], ret=ordereddictype)\n special_form_any = AnyType(TypeOfAny.special_form)\n add_method('_make', ret=selftype, is_classmethod=True,\n args=[Argument(Var('iterable', iterable_type), iterable_type, None, ARG_POS),\n Argument(Var('new'), special_form_any, EllipsisExpr(), ARG_NAMED_OPT),\n Argument(Var('len'), special_form_any, EllipsisExpr(), ARG_NAMED_OPT)])\n\n self_tvar_expr = TypeVarExpr(SELF_TVAR_NAME, info.fullname + '.' + SELF_TVAR_NAME,\n [], info.tuple_type)\n info.names[SELF_TVAR_NAME] = SymbolTableNode(MDEF, self_tvar_expr)\n return info", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_namedtuple.py_NamedTupleAnalyzer.save_namedtuple_body_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_namedtuple.py_NamedTupleAnalyzer.save_namedtuple_body_", "embedding": null, "metadata": {"file_path": "mypy/semanal_namedtuple.py", "file_name": "semanal_namedtuple.py", "file_type": "text/x-python", "category": "implementation", "start_line": 490, "end_line": 535, "span_ids": ["NamedTupleAnalyzer.save_namedtuple_body", "NamedTupleAnalyzer.fail"], "tokens": 430}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class NamedTupleAnalyzer:\n\n @contextmanager\n def save_namedtuple_body(self, named_tuple_info: TypeInfo) -> Iterator[None]:\n \"\"\"Preserve the generated body of class-based named tuple and then restore it.\n\n Temporarily clear the names dict so we don't get errors about duplicate names\n that were already set in build_namedtuple_typeinfo (we already added the tuple\n field names while generating the TypeInfo, and actual duplicates are\n already reported).\n \"\"\"\n nt_names = named_tuple_info.names\n named_tuple_info.names = SymbolTable()\n\n yield\n\n # Make sure we didn't use illegal names, then reset the names in the typeinfo.\n for prohibited in NAMEDTUPLE_PROHIBITED_NAMES:\n if prohibited in named_tuple_info.names:\n if nt_names.get(prohibited) is named_tuple_info.names[prohibited]:\n continue\n ctx = named_tuple_info.names[prohibited].node\n assert ctx is not None\n self.fail('Cannot overwrite NamedTuple attribute \"{}\"'.format(prohibited),\n ctx)\n\n # Restore the names in the original symbol table. This ensures that the symbol\n # table contains the field objects created by build_namedtuple_typeinfo. Exclude\n # __doc__, which can legally be overwritten by the class.\n for key, value in nt_names.items():\n if key in named_tuple_info.names:\n if key == '__doc__':\n continue\n sym = named_tuple_info.names[key]\n if isinstance(sym.node, (FuncBase, Decorator)) and not sym.plugin_generated:\n # Keep user-defined methods as is.\n continue\n # Keep existing (user-provided) definitions under mangled names, so they\n # get semantically analyzed.\n r_key = get_unique_redefinition_name(key, named_tuple_info.names)\n named_tuple_info.names[r_key] = sym\n named_tuple_info.names[key] = value\n\n # Helpers\n\n def fail(self, msg: str, ctx: Context) -> None:\n self.api.fail(msg, ctx)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_newtype.py__Semantic_analysis_of_N_from_mypy_import_errorcod": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_newtype.py__Semantic_analysis_of_N_from_mypy_import_errorcod", "embedding": null, "metadata": {"file_path": "mypy/semanal_newtype.py", "file_name": "semanal_newtype.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 23, "span_ids": ["docstring"], "tokens": 216}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Semantic analysis of NewType definitions.\n\nThis is conceptually part of mypy.semanal (semantic analyzer pass 2).\n\"\"\"\n\nfrom typing import Tuple, Optional\n\nfrom mypy.types import (\n Type, Instance, CallableType, NoneType, TupleType, AnyType, PlaceholderType,\n TypeOfAny, get_proper_type\n)\nfrom mypy.nodes import (\n AssignmentStmt, NewTypeExpr, CallExpr, NameExpr, RefExpr, Context, StrExpr, BytesExpr,\n UnicodeExpr, Block, FuncDef, Argument, TypeInfo, Var, SymbolTableNode, MDEF, ARG_POS,\n PlaceholderNode\n)\nfrom mypy.semanal_shared import SemanticAnalyzerInterface\nfrom mypy.options import Options\nfrom mypy.exprtotype import expr_to_unanalyzed_type, TypeTranslationError\nfrom mypy.typeanal import check_for_explicit_any, has_any_from_unimported_type\nfrom mypy.messages import MessageBuilder, format_type\nfrom mypy.errorcodes import ErrorCode\nfrom mypy import errorcodes as codes", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_newtype.py_NewTypeAnalyzer_NewTypeAnalyzer.process_newtype_declaration.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_newtype.py_NewTypeAnalyzer_NewTypeAnalyzer.process_newtype_declaration.return.True", "embedding": null, "metadata": {"file_path": "mypy/semanal_newtype.py", "file_name": "semanal_newtype.py", "file_type": "text/x-python", "category": "implementation", "start_line": 26, "end_line": 109, "span_ids": ["NewTypeAnalyzer.process_newtype_declaration", "NewTypeAnalyzer.__init__", "NewTypeAnalyzer"], "tokens": 870}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class NewTypeAnalyzer:\n def __init__(self,\n options: Options,\n api: SemanticAnalyzerInterface,\n msg: MessageBuilder) -> None:\n self.options = options\n self.api = api\n self.msg = msg\n\n def process_newtype_declaration(self, s: AssignmentStmt) -> bool:\n \"\"\"Check if s declares a NewType; if yes, store it in symbol table.\n\n Return True if it's a NewType declaration. The current target may be\n deferred as a side effect if the base type is not ready, even if\n the return value is True.\n\n The logic in this function mostly copies the logic for visit_class_def()\n with a single (non-Generic) base.\n \"\"\"\n var_name, call = self.analyze_newtype_declaration(s)\n if var_name is None or call is None:\n return False\n name = var_name\n # OK, now we know this is a NewType. But the base type may be not ready yet,\n # add placeholder as we do for ClassDef.\n\n if self.api.is_func_scope():\n name += '@' + str(s.line)\n fullname = self.api.qualified_name(name)\n\n if (not call.analyzed or\n isinstance(call.analyzed, NewTypeExpr) and not call.analyzed.info):\n # Start from labeling this as a future class, as we do for normal ClassDefs.\n placeholder = PlaceholderNode(fullname, s, s.line, becomes_typeinfo=True)\n self.api.add_symbol(var_name, placeholder, s, can_defer=False)\n\n old_type, should_defer = self.check_newtype_args(var_name, call, s)\n old_type = get_proper_type(old_type)\n if not call.analyzed:\n call.analyzed = NewTypeExpr(var_name, old_type, line=call.line, column=call.column)\n if old_type is None:\n if should_defer:\n # Base type is not ready.\n self.api.defer()\n return True\n\n # Create the corresponding class definition if the aliased type is subtypeable\n if isinstance(old_type, TupleType):\n newtype_class_info = self.build_newtype_typeinfo(name, old_type,\n old_type.partial_fallback)\n newtype_class_info.tuple_type = old_type\n elif isinstance(old_type, Instance):\n if old_type.type.is_protocol:\n self.fail(\"NewType cannot be used with protocol classes\", s)\n newtype_class_info = self.build_newtype_typeinfo(name, old_type, old_type)\n else:\n if old_type is not None:\n message = \"Argument 2 to NewType(...) must be subclassable (got {})\"\n self.fail(message.format(format_type(old_type)), s, code=codes.VALID_NEWTYPE)\n # Otherwise the error was already reported.\n old_type = AnyType(TypeOfAny.from_error)\n object_type = self.api.named_type('__builtins__.object')\n newtype_class_info = self.build_newtype_typeinfo(name, old_type, object_type)\n newtype_class_info.fallback_to_any = True\n\n check_for_explicit_any(old_type, self.options, self.api.is_typeshed_stub_file, self.msg,\n context=s)\n\n if self.options.disallow_any_unimported and has_any_from_unimported_type(old_type):\n self.msg.unimported_type_becomes_any(\"Argument 2 to NewType(...)\", old_type, s)\n\n # If so, add it to the symbol table.\n assert isinstance(call.analyzed, NewTypeExpr)\n # As we do for normal classes, create the TypeInfo only once, then just\n # update base classes on next iterations (to get rid of placeholders there).\n if not call.analyzed.info:\n call.analyzed.info = newtype_class_info\n else:\n call.analyzed.info.bases = newtype_class_info.bases\n self.api.add_symbol(var_name, call.analyzed.info, s)\n if self.api.is_func_scope():\n self.api.add_symbol_skip_local(name, call.analyzed.info)\n newtype_class_info.line = s.line\n return True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_newtype.py_NewTypeAnalyzer.analyze_newtype_declaration_NewTypeAnalyzer.analyze_newtype_declaration.return.name_call": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_newtype.py_NewTypeAnalyzer.analyze_newtype_declaration_NewTypeAnalyzer.analyze_newtype_declaration.return.name_call", "embedding": null, "metadata": {"file_path": "mypy/semanal_newtype.py", "file_name": "semanal_newtype.py", "file_type": "text/x-python", "category": "implementation", "start_line": 111, "end_line": 137, "span_ids": ["NewTypeAnalyzer.analyze_newtype_declaration"], "tokens": 282}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class NewTypeAnalyzer:\n\n def analyze_newtype_declaration(self,\n s: AssignmentStmt) -> Tuple[Optional[str], Optional[CallExpr]]:\n \"\"\"Return the NewType call expression if `s` is a newtype declaration or None otherwise.\"\"\"\n name, call = None, None\n if (len(s.lvalues) == 1\n and isinstance(s.lvalues[0], NameExpr)\n and isinstance(s.rvalue, CallExpr)\n and isinstance(s.rvalue.callee, RefExpr)\n and s.rvalue.callee.fullname == 'typing.NewType'):\n name = s.lvalues[0].name\n\n if s.type:\n self.fail(\"Cannot declare the type of a NewType declaration\", s)\n\n names = self.api.current_symbol_table()\n existing = names.get(name)\n # Give a better error message than generic \"Name already defined\".\n if (existing and\n not isinstance(existing.node, PlaceholderNode) and not s.rvalue.analyzed):\n self.fail('Cannot redefine \"%s\" as a NewType' % name, s)\n\n # This dummy NewTypeExpr marks the call as sufficiently analyzed; it will be\n # overwritten later with a fully complete NewTypeExpr if there are no other\n # errors with the NewType() call.\n call = s.rvalue\n\n return name, call", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_newtype.py_NewTypeAnalyzer.check_newtype_args_NewTypeAnalyzer.check_newtype_args.return.None_if_has_failed_else_o": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_newtype.py_NewTypeAnalyzer.check_newtype_args_NewTypeAnalyzer.check_newtype_args.return.None_if_has_failed_else_o", "embedding": null, "metadata": {"file_path": "mypy/semanal_newtype.py", "file_name": "semanal_newtype.py", "file_type": "text/x-python", "category": "implementation", "start_line": 139, "end_line": 182, "span_ids": ["NewTypeAnalyzer.check_newtype_args"], "tokens": 454}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class NewTypeAnalyzer:\n\n def check_newtype_args(self, name: str, call: CallExpr,\n context: Context) -> Tuple[Optional[Type], bool]:\n \"\"\"Ananlyze base type in NewType call.\n\n Return a tuple (type, should defer).\n \"\"\"\n has_failed = False\n args, arg_kinds = call.args, call.arg_kinds\n if len(args) != 2 or arg_kinds[0] != ARG_POS or arg_kinds[1] != ARG_POS:\n self.fail(\"NewType(...) expects exactly two positional arguments\", context)\n return None, False\n\n # Check first argument\n if not isinstance(args[0], (StrExpr, BytesExpr, UnicodeExpr)):\n self.fail(\"Argument 1 to NewType(...) must be a string literal\", context)\n has_failed = True\n elif args[0].value != name:\n msg = 'String argument 1 \"{}\" to NewType(...) does not match variable name \"{}\"'\n self.fail(msg.format(args[0].value, name), context)\n has_failed = True\n\n # Check second argument\n msg = \"Argument 2 to NewType(...) must be a valid type\"\n try:\n unanalyzed_type = expr_to_unanalyzed_type(args[1])\n except TypeTranslationError:\n self.fail(msg, context)\n return None, False\n\n # We want to use our custom error message (see above), so we suppress\n # the default error message for invalid types here.\n old_type = get_proper_type(self.api.anal_type(unanalyzed_type,\n report_invalid_types=False))\n should_defer = False\n if old_type is None or isinstance(old_type, PlaceholderType):\n should_defer = True\n\n # The caller of this function assumes that if we return a Type, it's always\n # a valid one. So, we translate AnyTypes created from errors into None.\n if isinstance(old_type, AnyType) and old_type.is_from_error:\n self.fail(msg, context)\n return None, False\n\n return None if has_failed else old_type, should_defer", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_newtype.py_NewTypeAnalyzer.build_newtype_typeinfo_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_newtype.py_NewTypeAnalyzer.build_newtype_typeinfo_", "embedding": null, "metadata": {"file_path": "mypy/semanal_newtype.py", "file_name": "semanal_newtype.py", "file_type": "text/x-python", "category": "implementation", "start_line": 184, "end_line": 212, "span_ids": ["NewTypeAnalyzer.fail", "NewTypeAnalyzer.build_newtype_typeinfo", "NewTypeAnalyzer.make_argument"], "tokens": 284}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class NewTypeAnalyzer:\n\n def build_newtype_typeinfo(self, name: str, old_type: Type, base_type: Instance) -> TypeInfo:\n info = self.api.basic_new_typeinfo(name, base_type)\n info.is_newtype = True\n\n # Add __init__ method\n args = [Argument(Var('self'), NoneType(), None, ARG_POS),\n self.make_argument('item', old_type)]\n signature = CallableType(\n arg_types=[Instance(info, []), old_type],\n arg_kinds=[arg.kind for arg in args],\n arg_names=['self', 'item'],\n ret_type=NoneType(),\n fallback=self.api.named_type('__builtins__.function'),\n name=name)\n init_func = FuncDef('__init__', args, Block([]), typ=signature)\n init_func.info = info\n init_func._fullname = info.fullname + '.__init__'\n info.names['__init__'] = SymbolTableNode(MDEF, init_func)\n\n return info\n\n # Helpers\n\n def make_argument(self, name: str, type: Type) -> Argument:\n return Argument(Var(name), type, None, ARG_POS)\n\n def fail(self, msg: str, ctx: Context, *, code: Optional[ErrorCode] = None) -> None:\n self.api.fail(msg, ctx, code=code)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_pass1.py__Block_import_reachabil_SemanticAnalyzerPreAnalysis._Analyze_reachability_o": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_pass1.py__Block_import_reachabil_SemanticAnalyzerPreAnalysis._Analyze_reachability_o", "embedding": null, "metadata": {"file_path": "mypy/semanal_pass1.py", "file_name": "semanal_pass1.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 39, "span_ids": ["SemanticAnalyzerPreAnalysis", "docstring"], "tokens": 302}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Block/import reachability analysis.\"\"\"\n\nfrom mypy.nodes import (\n MypyFile, AssertStmt, IfStmt, Block, AssignmentStmt, ExpressionStmt, ReturnStmt, ForStmt,\n Import, ImportAll, ImportFrom, ClassDef, FuncDef\n)\nfrom mypy.traverser import TraverserVisitor\nfrom mypy.options import Options\nfrom mypy.reachability import infer_reachability_of_if_statement, assert_will_always_fail\n\n\nclass SemanticAnalyzerPreAnalysis(TraverserVisitor):\n \"\"\"Analyze reachability of blocks and imports and other local things.\n\n This runs before semantic analysis, so names have not been bound. Imports are\n also not resolved yet, so we can only access the current module.\n\n This determines static reachability of blocks and imports due to version and\n platform checks, among others.\n\n The main entry point is 'visit_file'.\n\n Reachability of imports needs to be determined very early in the build since\n this affects which modules will ultimately be processed.\n\n Consider this example:\n\n import sys\n\n def do_stuff():\n # type: () -> None:\n if sys.python_version < (3,):\n import xyz # Only available in Python 2\n xyz.whatever()\n ...\n\n The block containing 'import xyz' is unreachable in Python 3 mode. The import\n shouldn't be processed in Python 3 mode, even if the module happens to exist.\n \"\"\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_pass1.py_SemanticAnalyzerPreAnalysis.visit_file_SemanticAnalyzerPreAnalysis.visit_file.for_i_defn_in_enumerate_.if_isinstance_defn_Asser.break": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_pass1.py_SemanticAnalyzerPreAnalysis.visit_file_SemanticAnalyzerPreAnalysis.visit_file.for_i_defn_in_enumerate_.if_isinstance_defn_Asser.break", "embedding": null, "metadata": {"file_path": "mypy/semanal_pass1.py", "file_name": "semanal_pass1.py", "file_type": "text/x-python", "category": "implementation", "start_line": 41, "end_line": 56, "span_ids": ["SemanticAnalyzerPreAnalysis.visit_file"], "tokens": 182}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzerPreAnalysis(TraverserVisitor):\n\n def visit_file(self, file: MypyFile, fnam: str, mod_id: str, options: Options) -> None:\n self.pyversion = options.python_version\n self.platform = options.platform\n self.cur_mod_id = mod_id\n self.cur_mod_node = file\n self.options = options\n self.is_global_scope = True\n\n for i, defn in enumerate(file.defs):\n defn.accept(self)\n if isinstance(defn, AssertStmt) and assert_will_always_fail(defn, options):\n # We've encountered an assert that's always false,\n # e.g. assert sys.platform == 'lol'. Truncate the\n # list of statements. This mutates file.defs too.\n del file.defs[i + 1:]\n break", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_pass1.py_SemanticAnalyzerPreAnalysis.visit_func_def_SemanticAnalyzerPreAnalysis.visit_func_def.if_self_is_global_scope.file_node.is_partial_stub_package.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_pass1.py_SemanticAnalyzerPreAnalysis.visit_func_def_SemanticAnalyzerPreAnalysis.visit_func_def.if_self_is_global_scope.file_node.is_partial_stub_package.True", "embedding": null, "metadata": {"file_path": "mypy/semanal_pass1.py", "file_name": "semanal_pass1.py", "file_type": "text/x-python", "category": "implementation", "start_line": 58, "end_line": 71, "span_ids": ["SemanticAnalyzerPreAnalysis.visit_func_def"], "tokens": 168}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzerPreAnalysis(TraverserVisitor):\n\n def visit_func_def(self, node: FuncDef) -> None:\n old_global_scope = self.is_global_scope\n self.is_global_scope = False\n super().visit_func_def(node)\n self.is_global_scope = old_global_scope\n file_node = self.cur_mod_node\n if (self.is_global_scope\n and file_node.is_stub\n and node.name == '__getattr__'\n and file_node.is_package_init_file()):\n # __init__.pyi with __getattr__ means that any submodules are assumed\n # to exist, even if there is no stub. Note that we can't verify that the\n # return type is compatible, since we haven't bound types yet.\n file_node.is_partial_stub_package = True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_pass1.py_SemanticAnalyzerPreAnalysis.visit_class_def_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_pass1.py_SemanticAnalyzerPreAnalysis.visit_class_def_", "embedding": null, "metadata": {"file_path": "mypy/semanal_pass1.py", "file_name": "semanal_pass1.py", "file_type": "text/x-python", "category": "implementation", "start_line": 73, "end_line": 121, "span_ids": ["SemanticAnalyzerPreAnalysis.visit_assignment_stmt", "SemanticAnalyzerPreAnalysis.visit_import", "SemanticAnalyzerPreAnalysis.visit_for_stmt", "SemanticAnalyzerPreAnalysis.visit_class_def", "SemanticAnalyzerPreAnalysis.visit_if_stmt", "SemanticAnalyzerPreAnalysis.visit_block", "SemanticAnalyzerPreAnalysis.visit_expression_stmt", "SemanticAnalyzerPreAnalysis.visit_import_from", "SemanticAnalyzerPreAnalysis.visit_return_stmt", "SemanticAnalyzerPreAnalysis.visit_import_all"], "tokens": 379}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzerPreAnalysis(TraverserVisitor):\n\n def visit_class_def(self, node: ClassDef) -> None:\n old_global_scope = self.is_global_scope\n self.is_global_scope = False\n super().visit_class_def(node)\n self.is_global_scope = old_global_scope\n\n def visit_import_from(self, node: ImportFrom) -> None:\n node.is_top_level = self.is_global_scope\n super().visit_import_from(node)\n\n def visit_import_all(self, node: ImportAll) -> None:\n node.is_top_level = self.is_global_scope\n super().visit_import_all(node)\n\n def visit_import(self, node: Import) -> None:\n node.is_top_level = self.is_global_scope\n super().visit_import(node)\n\n def visit_if_stmt(self, s: IfStmt) -> None:\n infer_reachability_of_if_statement(s, self.options)\n for expr in s.expr:\n expr.accept(self)\n for node in s.body:\n node.accept(self)\n if s.else_body:\n s.else_body.accept(self)\n\n def visit_block(self, b: Block) -> None:\n if b.is_unreachable:\n return\n super().visit_block(b)\n\n # The remaining methods are an optimization: don't visit nested expressions\n # of common statements, since they can have no effect.\n\n def visit_assignment_stmt(self, s: AssignmentStmt) -> None:\n pass\n\n def visit_expression_stmt(self, s: ExpressionStmt) -> None:\n pass\n\n def visit_return_stmt(self, s: ReturnStmt) -> None:\n pass\n\n def visit_for_stmt(self, s: ForStmt) -> None:\n s.body.accept(self)\n if s.else_body is not None:\n s.else_body.accept(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_shared.py__Shared_definitions_use_PRIORITY_FALLBACKS.1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_shared.py__Shared_definitions_use_PRIORITY_FALLBACKS.1", "embedding": null, "metadata": {"file_path": "mypy/semanal_shared.py", "file_name": "semanal_shared.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 25, "span_ids": ["docstring"], "tokens": 186}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Shared definitions used by different parts of semantic analysis.\"\"\"\n\nfrom abc import abstractmethod\n\nfrom typing import Optional, List, Callable\nfrom typing_extensions import Final\nfrom mypy_extensions import trait\n\nfrom mypy.nodes import (\n Context, SymbolTableNode, MypyFile, ImportedName, FuncDef, Node, TypeInfo, Expression, GDEF,\n SymbolNode, SymbolTable\n)\nfrom mypy.util import correct_relative_import\nfrom mypy.types import (\n Type, FunctionLike, Instance, TupleType, TPDICT_FB_NAMES, ProperType, get_proper_type\n)\nfrom mypy.tvar_scope import TypeVarLikeScope\nfrom mypy.errorcodes import ErrorCode\nfrom mypy import join\n\n# Priorities for ordering of patches within the \"patch\" phase of semantic analysis\n# (after the main pass):\n\n# Fix fallbacks (does joins)\nPRIORITY_FALLBACKS = 1", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_shared.py_SemanticAnalyzerInterface_SemanticAnalyzerInterface.is_func_scope.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_shared.py_SemanticAnalyzerInterface_SemanticAnalyzerInterface.is_func_scope.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "mypy/semanal_shared.py", "file_name": "semanal_shared.py", "file_type": "text/x-python", "category": "implementation", "start_line": 82, "end_line": 172, "span_ids": ["SemanticAnalyzerInterface.named_type_or_none", "SemanticAnalyzerInterface.accept", "SemanticAnalyzerInterface.is_func_scope", "SemanticAnalyzerInterface.current_symbol_table", "SemanticAnalyzerInterface.lookup", "SemanticAnalyzerInterface.add_symbol_skip_local", "SemanticAnalyzerInterface.parse_bool", "SemanticAnalyzerInterface.basic_new_typeinfo", "SemanticAnalyzerInterface.add_symbol", "SemanticAnalyzerInterface.named_type", "SemanticAnalyzerInterface.is_typeshed_stub_file", "SemanticAnalyzerInterface", "SemanticAnalyzerInterface.anal_type", "SemanticAnalyzerInterface.qualified_name", "SemanticAnalyzerInterface.schedule_patch", "SemanticAnalyzerInterface.add_symbol_table_node"], "tokens": 623}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@trait\nclass SemanticAnalyzerInterface(SemanticAnalyzerCoreInterface):\n \"\"\"A limited abstract interface to some generic semantic analyzer pass 2 functionality.\n\n We use this interface for various reasons:\n\n * Looser coupling\n * Cleaner import graph\n * Less need to pass around callback functions\n \"\"\"\n\n @abstractmethod\n def lookup(self, name: str, ctx: Context,\n suppress_errors: bool = False) -> Optional[SymbolTableNode]:\n raise NotImplementedError\n\n @abstractmethod\n def named_type(self, qualified_name: str, args: Optional[List[Type]] = None) -> Instance:\n raise NotImplementedError\n\n @abstractmethod\n def named_type_or_none(self, qualified_name: str,\n args: Optional[List[Type]] = None) -> Optional[Instance]:\n raise NotImplementedError\n\n @abstractmethod\n def accept(self, node: Node) -> None:\n raise NotImplementedError\n\n @abstractmethod\n def anal_type(self, t: Type, *,\n tvar_scope: Optional[TypeVarLikeScope] = None,\n allow_tuple_literal: bool = False,\n allow_unbound_tvars: bool = False,\n report_invalid_types: bool = True) -> Optional[Type]:\n raise NotImplementedError\n\n @abstractmethod\n def basic_new_typeinfo(self, name: str, basetype_or_fallback: Instance) -> TypeInfo:\n raise NotImplementedError\n\n @abstractmethod\n def schedule_patch(self, priority: int, fn: Callable[[], None]) -> None:\n raise NotImplementedError\n\n @abstractmethod\n def add_symbol_table_node(self, name: str, stnode: SymbolTableNode) -> bool:\n \"\"\"Add node to the current symbol table.\"\"\"\n raise NotImplementedError\n\n @abstractmethod\n def current_symbol_table(self) -> SymbolTable:\n \"\"\"Get currently active symbol table.\n\n May be module, class, or local namespace.\n \"\"\"\n raise NotImplementedError\n\n @abstractmethod\n def add_symbol(self, name: str, node: SymbolNode, context: Context,\n module_public: bool = True, module_hidden: bool = False,\n can_defer: bool = True) -> bool:\n \"\"\"Add symbol to the current symbol table.\"\"\"\n raise NotImplementedError\n\n @abstractmethod\n def add_symbol_skip_local(self, name: str, node: SymbolNode) -> None:\n \"\"\"Add symbol to the current symbol table, skipping locals.\n\n This is used to store symbol nodes in a symbol table that\n is going to be serialized (local namespaces are not serialized).\n See implementation docstring for more details.\n \"\"\"\n raise NotImplementedError\n\n @abstractmethod\n def parse_bool(self, expr: Expression) -> Optional[bool]:\n raise NotImplementedError\n\n @abstractmethod\n def qualified_name(self, n: str) -> str:\n raise NotImplementedError\n\n @property\n @abstractmethod\n def is_typeshed_stub_file(self) -> bool:\n raise NotImplementedError\n\n @abstractmethod\n def is_func_scope(self) -> bool:\n raise NotImplementedError", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_shared.py_create_indirect_imported_name_create_indirect_imported_name.return.SymbolTableNode_GDEF_lin": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_shared.py_create_indirect_imported_name_create_indirect_imported_name.return.SymbolTableNode_GDEF_lin", "embedding": null, "metadata": {"file_path": "mypy/semanal_shared.py", "file_name": "semanal_shared.py", "file_type": "text/x-python", "category": "implementation", "start_line": 175, "end_line": 193, "span_ids": ["create_indirect_imported_name"], "tokens": 149}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def create_indirect_imported_name(file_node: MypyFile,\n module: str,\n relative: int,\n imported_name: str) -> Optional[SymbolTableNode]:\n \"\"\"Create symbol table entry for a name imported from another module.\n\n These entries act as indirect references.\n \"\"\"\n target_module, ok = correct_relative_import(\n file_node.fullname,\n relative,\n module,\n file_node.is_package_init_file())\n if not ok:\n return None\n target_name = '%s.%s' % (target_module, imported_name)\n link = ImportedName(target_name)\n # Use GDEF since this refers to a module-level definition.\n return SymbolTableNode(GDEF, link)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_shared.py_set_callable_name_set_callable_name.if_isinstance_sig_Functi.else_.return.sig": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_shared.py_set_callable_name_set_callable_name.if_isinstance_sig_Functi.else_.return.sig", "embedding": null, "metadata": {"file_path": "mypy/semanal_shared.py", "file_name": "semanal_shared.py", "file_type": "text/x-python", "category": "implementation", "start_line": 196, "end_line": 210, "span_ids": ["set_callable_name"], "tokens": 122}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def set_callable_name(sig: Type, fdef: FuncDef) -> ProperType:\n sig = get_proper_type(sig)\n if isinstance(sig, FunctionLike):\n if fdef.info:\n if fdef.info.fullname in TPDICT_FB_NAMES:\n # Avoid exposing the internal _TypedDict name.\n class_name = 'TypedDict'\n else:\n class_name = fdef.info.name\n return sig.with_name(\n '{} of {}'.format(fdef.name, class_name))\n else:\n return sig.with_name(fdef.name)\n else:\n return sig", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_shared.py_calculate_tuple_fallback_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_shared.py_calculate_tuple_fallback_", "embedding": null, "metadata": {"file_path": "mypy/semanal_shared.py", "file_name": "semanal_shared.py", "file_type": "text/x-python", "category": "implementation", "start_line": 213, "end_line": 230, "span_ids": ["calculate_tuple_fallback"], "tokens": 192}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def calculate_tuple_fallback(typ: TupleType) -> None:\n \"\"\"Calculate a precise item type for the fallback of a tuple type.\n\n This must be called only after the main semantic analysis pass, since joins\n aren't available before that.\n\n Note that there is an apparent chicken and egg problem with respect\n to verifying type arguments against bounds. Verifying bounds might\n require fallbacks, but we might use the bounds to calculate the\n fallbacks. In practice this is not a problem, since the worst that\n can happen is that we have invalid type argument values, and these\n can happen in later stages as well (they will generate errors, but\n we don't prevent their existence).\n \"\"\"\n fallback = typ.partial_fallback\n assert fallback.type.fullname == 'builtins.tuple'\n fallback.args = (join.join_type_list(list(typ.items)),) + fallback.args[1:]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_typeargs.py__Verify_properties_of_t_from_mypy_import_message_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_typeargs.py__Verify_properties_of_t_from_mypy_import_message_", "embedding": null, "metadata": {"file_path": "mypy/semanal_typeargs.py", "file_name": "semanal_typeargs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 21, "span_ids": ["docstring"], "tokens": 188}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Verify properties of type arguments, like 'int' in C[int] being valid.\n\nThis must happen after semantic analysis since there can be placeholder\ntypes until the end of semantic analysis, and these break various type\noperations, including subtype checks.\n\"\"\"\n\nfrom typing import List, Optional, Set\n\nfrom mypy.nodes import TypeInfo, Context, MypyFile, FuncItem, ClassDef, Block\nfrom mypy.types import (\n Type, Instance, TypeVarType, AnyType, get_proper_types, TypeAliasType, get_proper_type\n)\nfrom mypy.mixedtraverser import MixedTraverserVisitor\nfrom mypy.subtypes import is_subtype\nfrom mypy.sametypes import is_same_type\nfrom mypy.errors import Errors\nfrom mypy.scope import Scope\nfrom mypy.options import Options\nfrom mypy.errorcodes import ErrorCode\nfrom mypy import message_registry, errorcodes as codes", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_typeargs.py_TypeArgumentAnalyzer_TypeArgumentAnalyzer.visit_type_alias_type.get_proper_type_t_accept": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_typeargs.py_TypeArgumentAnalyzer_TypeArgumentAnalyzer.visit_type_alias_type.get_proper_type_t_accept", "embedding": null, "metadata": {"file_path": "mypy/semanal_typeargs.py", "file_name": "semanal_typeargs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 24, "end_line": 64, "span_ids": ["TypeArgumentAnalyzer.__init__", "TypeArgumentAnalyzer.visit_class_def", "TypeArgumentAnalyzer.visit_block", "TypeArgumentAnalyzer.visit_mypy_file", "TypeArgumentAnalyzer", "TypeArgumentAnalyzer.visit_type_alias_type", "TypeArgumentAnalyzer.visit_func"], "tokens": 404}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeArgumentAnalyzer(MixedTraverserVisitor):\n def __init__(self, errors: Errors, options: Options, is_typeshed_file: bool) -> None:\n self.errors = errors\n self.options = options\n self.is_typeshed_file = is_typeshed_file\n self.scope = Scope()\n # Should we also analyze function definitions, or only module top-levels?\n self.recurse_into_functions = True\n # Keep track of the type aliases already visited. This is needed to avoid\n # infinite recursion on types like A = Union[int, List[A]].\n self.seen_aliases = set() # type: Set[TypeAliasType]\n\n def visit_mypy_file(self, o: MypyFile) -> None:\n self.errors.set_file(o.path, o.fullname, scope=self.scope)\n self.scope.enter_file(o.fullname)\n super().visit_mypy_file(o)\n self.scope.leave()\n\n def visit_func(self, defn: FuncItem) -> None:\n if not self.recurse_into_functions:\n return\n with self.scope.function_scope(defn):\n super().visit_func(defn)\n\n def visit_class_def(self, defn: ClassDef) -> None:\n with self.scope.class_scope(defn.info):\n super().visit_class_def(defn)\n\n def visit_block(self, o: Block) -> None:\n if not o.is_unreachable:\n super().visit_block(o)\n\n def visit_type_alias_type(self, t: TypeAliasType) -> None:\n super().visit_type_alias_type(t)\n if t in self.seen_aliases:\n # Avoid infinite recursion on recursive type aliases.\n # Note: it is fine to skip the aliases we have already seen in non-recursive types,\n # since errors there have already already reported.\n return\n self.seen_aliases.add(t)\n get_proper_type(t).accept(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_typeargs.py_TypeArgumentAnalyzer.visit_instance_TypeArgumentAnalyzer.visit_instance.super_visit_instance_t_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_typeargs.py_TypeArgumentAnalyzer.visit_instance_TypeArgumentAnalyzer.visit_instance.super_visit_instance_t_", "embedding": null, "metadata": {"file_path": "mypy/semanal_typeargs.py", "file_name": "semanal_typeargs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 66, "end_line": 86, "span_ids": ["TypeArgumentAnalyzer.visit_instance"], "tokens": 245}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeArgumentAnalyzer(MixedTraverserVisitor):\n\n def visit_instance(self, t: Instance) -> None:\n # Type argument counts were checked in the main semantic analyzer pass. We assume\n # that the counts are correct here.\n info = t.type\n for (i, arg), tvar in zip(enumerate(t.args), info.defn.type_vars):\n if tvar.values:\n if isinstance(arg, TypeVarType):\n arg_values = arg.values\n if not arg_values:\n self.fail('Type variable \"{}\" not valid as type '\n 'argument value for \"{}\"'.format(\n arg.name, info.name), t, code=codes.TYPE_VAR)\n continue\n else:\n arg_values = [arg]\n self.check_type_var_values(info, arg_values, tvar.name, tvar.values, i + 1, t)\n if not is_subtype(arg, tvar.upper_bound):\n self.fail('Type argument \"{}\" of \"{}\" must be '\n 'a subtype of \"{}\"'.format(\n arg, info.name, tvar.upper_bound), t, code=codes.TYPE_VAR)\n super().visit_instance(t)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_typeargs.py_TypeArgumentAnalyzer.check_type_var_values_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_typeargs.py_TypeArgumentAnalyzer.check_type_var_values_", "embedding": null, "metadata": {"file_path": "mypy/semanal_typeargs.py", "file_name": "semanal_typeargs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 88, "end_line": 108, "span_ids": ["TypeArgumentAnalyzer.check_type_var_values", "TypeArgumentAnalyzer.fail"], "tokens": 247}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeArgumentAnalyzer(MixedTraverserVisitor):\n\n def check_type_var_values(self, type: TypeInfo, actuals: List[Type], arg_name: str,\n valids: List[Type], arg_number: int, context: Context) -> None:\n for actual in get_proper_types(actuals):\n if (not isinstance(actual, AnyType) and\n not any(is_same_type(actual, value)\n for value in valids)):\n if len(actuals) > 1 or not isinstance(actual, Instance):\n self.fail('Invalid type argument value for \"{}\"'.format(\n type.name), context, code=codes.TYPE_VAR)\n else:\n class_name = '\"{}\"'.format(type.name)\n actual_type_name = '\"{}\"'.format(actual.type.name)\n self.fail(\n message_registry.INCOMPATIBLE_TYPEVAR_VALUE.format(\n arg_name, class_name, actual_type_name),\n context,\n code=codes.TYPE_VAR)\n\n def fail(self, msg: str, context: Context, *, code: Optional[ErrorCode] = None) -> None:\n self.errors.report(context.get_line(), context.get_column(), msg, code=code)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_typeddict.py__Semantic_analysis_of_T_TPDICT_CLASS_ERROR._Invalid_statement_in_Ty": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_typeddict.py__Semantic_analysis_of_T_TPDICT_CLASS_ERROR._Invalid_statement_in_Ty", "embedding": null, "metadata": {"file_path": "mypy/semanal_typeddict.py", "file_name": "semanal_typeddict.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 22, "span_ids": ["docstring"], "tokens": 232}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Semantic analysis of TypedDict definitions.\"\"\"\n\nfrom mypy.ordered_dict import OrderedDict\nfrom typing import Optional, List, Set, Tuple\nfrom typing_extensions import Final\n\nfrom mypy.types import Type, AnyType, TypeOfAny, TypedDictType, TPDICT_NAMES\nfrom mypy.nodes import (\n CallExpr, TypedDictExpr, Expression, NameExpr, Context, StrExpr, BytesExpr, UnicodeExpr,\n ClassDef, RefExpr, TypeInfo, AssignmentStmt, PassStmt, ExpressionStmt, EllipsisExpr, TempNode,\n DictExpr, ARG_POS, ARG_NAMED\n)\nfrom mypy.semanal_shared import SemanticAnalyzerInterface\nfrom mypy.exprtotype import expr_to_unanalyzed_type, TypeTranslationError\nfrom mypy.options import Options\nfrom mypy.typeanal import check_for_explicit_any, has_any_from_unimported_type\nfrom mypy.messages import MessageBuilder\nfrom mypy.errorcodes import ErrorCode\nfrom mypy import errorcodes as codes\n\nTPDICT_CLASS_ERROR = ('Invalid statement in TypedDict definition; '\n 'expected \"field_name: field_type\"')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_typeddict.py__type_Final_TypedDictAnalyzer.analyze_typeddict_classdef.return.False_None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_typeddict.py__type_Final_TypedDictAnalyzer.analyze_typeddict_classdef.return.False_None", "embedding": null, "metadata": {"file_path": "mypy/semanal_typeddict.py", "file_name": "semanal_typeddict.py", "file_type": "text/x-python", "category": "implementation", "start_line": 20, "end_line": 103, "span_ids": ["TypedDictAnalyzer.analyze_typeddict_classdef", "TypedDictAnalyzer", "TypedDictAnalyzer.__init__", "docstring"], "tokens": 828}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": " # type: Final\n\n\nclass TypedDictAnalyzer:\n def __init__(self,\n options: Options,\n api: SemanticAnalyzerInterface,\n msg: MessageBuilder) -> None:\n self.options = options\n self.api = api\n self.msg = msg\n\n def analyze_typeddict_classdef(self, defn: ClassDef) -> Tuple[bool, Optional[TypeInfo]]:\n \"\"\"Analyze a class that may define a TypedDict.\n\n Assume that base classes have been analyzed already.\n\n Note: Unlike normal classes, we won't create a TypeInfo until\n the whole definition of the TypeDict (including the body and all\n key names and types) is complete. This is mostly because we\n store the corresponding TypedDictType in the TypeInfo.\n\n Return (is this a TypedDict, new TypeInfo). Specifics:\n * If we couldn't finish due to incomplete reference anywhere in\n the definition, return (True, None).\n * If this is not a TypedDict, return (False, None).\n \"\"\"\n possible = False\n for base_expr in defn.base_type_exprs:\n if isinstance(base_expr, RefExpr):\n self.api.accept(base_expr)\n if base_expr.fullname in TPDICT_NAMES or self.is_typeddict(base_expr):\n possible = True\n if possible:\n if (len(defn.base_type_exprs) == 1 and\n isinstance(defn.base_type_exprs[0], RefExpr) and\n defn.base_type_exprs[0].fullname in TPDICT_NAMES):\n # Building a new TypedDict\n fields, types, required_keys = self.analyze_typeddict_classdef_fields(defn)\n if fields is None:\n return True, None # Defer\n info = self.build_typeddict_typeinfo(defn.name, fields, types, required_keys)\n defn.analyzed = TypedDictExpr(info)\n defn.analyzed.line = defn.line\n defn.analyzed.column = defn.column\n return True, info\n # Extending/merging existing TypedDicts\n if any(not isinstance(expr, RefExpr) or\n expr.fullname not in TPDICT_NAMES and\n not self.is_typeddict(expr) for expr in defn.base_type_exprs):\n self.fail(\"All bases of a new TypedDict must be TypedDict types\", defn)\n typeddict_bases = list(filter(self.is_typeddict, defn.base_type_exprs))\n keys = [] # type: List[str]\n types = []\n required_keys = set()\n\n # Iterate over bases in reverse order so that leftmost base class' keys take precedence\n for base in reversed(typeddict_bases):\n assert isinstance(base, RefExpr)\n assert isinstance(base.node, TypeInfo)\n assert isinstance(base.node.typeddict_type, TypedDictType)\n base_typed_dict = base.node.typeddict_type\n base_items = base_typed_dict.items\n valid_items = base_items.copy()\n for key in base_items:\n if key in keys:\n self.fail('Overwriting TypedDict field \"{}\" while merging'\n .format(key), defn)\n keys.extend(valid_items.keys())\n types.extend(valid_items.values())\n required_keys.update(base_typed_dict.required_keys)\n new_keys, new_types, new_required_keys = self.analyze_typeddict_classdef_fields(defn,\n keys)\n if new_keys is None:\n return True, None # Defer\n keys.extend(new_keys)\n types.extend(new_types)\n required_keys.update(new_required_keys)\n info = self.build_typeddict_typeinfo(defn.name, keys, types, required_keys)\n defn.analyzed = TypedDictExpr(info)\n defn.analyzed.line = defn.line\n defn.analyzed.column = defn.column\n return True, info\n return False, None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_typeddict.py_TypedDictAnalyzer.analyze_typeddict_classdef_fields_TypedDictAnalyzer.analyze_typeddict_classdef_fields.return.fields_types_required_k": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_typeddict.py_TypedDictAnalyzer.analyze_typeddict_classdef_fields_TypedDictAnalyzer.analyze_typeddict_classdef_fields.return.fields_types_required_k", "embedding": null, "metadata": {"file_path": "mypy/semanal_typeddict.py", "file_name": "semanal_typeddict.py", "file_type": "text/x-python", "category": "implementation", "start_line": 105, "end_line": 163, "span_ids": ["TypedDictAnalyzer.analyze_typeddict_classdef_fields"], "tokens": 592}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypedDictAnalyzer:\n\n def analyze_typeddict_classdef_fields(\n self,\n defn: ClassDef,\n oldfields: Optional[List[str]] = None) -> Tuple[Optional[List[str]],\n List[Type],\n Set[str]]:\n \"\"\"Analyze fields defined in a TypedDict class definition.\n\n This doesn't consider inherited fields (if any). Also consider totality,\n if given.\n\n Return tuple with these items:\n * List of keys (or None if found an incomplete reference --> deferral)\n * List of types for each key\n * Set of required keys\n \"\"\"\n fields = [] # type: List[str]\n types = [] # type: List[Type]\n for stmt in defn.defs.body:\n if not isinstance(stmt, AssignmentStmt):\n # Still allow pass or ... (for empty TypedDict's).\n if (not isinstance(stmt, PassStmt) and\n not (isinstance(stmt, ExpressionStmt) and\n isinstance(stmt.expr, (EllipsisExpr, StrExpr)))):\n self.fail(TPDICT_CLASS_ERROR, stmt)\n elif len(stmt.lvalues) > 1 or not isinstance(stmt.lvalues[0], NameExpr):\n # An assignment, but an invalid one.\n self.fail(TPDICT_CLASS_ERROR, stmt)\n else:\n name = stmt.lvalues[0].name\n if name in (oldfields or []):\n self.fail('Overwriting TypedDict field \"{}\" while extending'\n .format(name), stmt)\n if name in fields:\n self.fail('Duplicate TypedDict key \"{}\"'.format(name), stmt)\n continue\n # Append name and type in this case...\n fields.append(name)\n if stmt.type is None:\n types.append(AnyType(TypeOfAny.unannotated))\n else:\n analyzed = self.api.anal_type(stmt.type)\n if analyzed is None:\n return None, [], set() # Need to defer\n types.append(analyzed)\n # ...despite possible minor failures that allow further analyzis.\n if stmt.type is None or hasattr(stmt, 'new_syntax') and not stmt.new_syntax:\n self.fail(TPDICT_CLASS_ERROR, stmt)\n elif not isinstance(stmt.rvalue, TempNode):\n # x: int assigns rvalue to TempNode(AnyType())\n self.fail('Right hand side values are not supported in TypedDict', stmt)\n total = True # type: Optional[bool]\n if 'total' in defn.keywords:\n total = self.api.parse_bool(defn.keywords['total'])\n if total is None:\n self.fail('Value of \"total\" must be True or False', defn)\n total = True\n required_keys = set(fields) if total else set()\n return fields, types, required_keys", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_typeddict.py_TypedDictAnalyzer.check_typeddict_TypedDictAnalyzer.check_typeddict.return.True_info": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_typeddict.py_TypedDictAnalyzer.check_typeddict_TypedDictAnalyzer.check_typeddict.return.True_info", "embedding": null, "metadata": {"file_path": "mypy/semanal_typeddict.py", "file_name": "semanal_typeddict.py", "file_type": "text/x-python", "category": "implementation", "start_line": 167, "end_line": 218, "span_ids": ["TypedDictAnalyzer.check_typeddict"], "tokens": 499}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypedDictAnalyzer:\n\n def check_typeddict(self,\n node: Expression,\n var_name: Optional[str],\n is_func_scope: bool) -> Tuple[bool, Optional[TypeInfo]]:\n \"\"\"Check if a call defines a TypedDict.\n\n The optional var_name argument is the name of the variable to\n which this is assigned, if any.\n\n Return a pair (is it a typed dict, corresponding TypeInfo).\n\n If the definition is invalid but looks like a TypedDict,\n report errors but return (some) TypeInfo. If some type is not ready,\n return (True, None).\n \"\"\"\n if not isinstance(node, CallExpr):\n return False, None\n call = node\n callee = call.callee\n if not isinstance(callee, RefExpr):\n return False, None\n fullname = callee.fullname\n if fullname not in TPDICT_NAMES:\n return False, None\n res = self.parse_typeddict_args(call)\n if res is None:\n # This is a valid typed dict, but some type is not ready.\n # The caller should defer this until next iteration.\n return True, None\n name, items, types, total, ok = res\n if not ok:\n # Error. Construct dummy return value.\n info = self.build_typeddict_typeinfo('TypedDict', [], [], set())\n else:\n if var_name is not None and name != var_name:\n self.fail(\n 'First argument \"{}\" to TypedDict() does not match variable name \"{}\"'.format(\n name, var_name), node, code=codes.NAME_MATCH)\n if name != var_name or is_func_scope:\n # Give it a unique name derived from the line number.\n name += '@' + str(call.line)\n required_keys = set(items) if total else set()\n info = self.build_typeddict_typeinfo(name, items, types, required_keys)\n info.line = node.line\n # Store generated TypeInfo under both names, see semanal_namedtuple for more details.\n if name != var_name or is_func_scope:\n self.api.add_symbol_skip_local(name, info)\n if var_name:\n self.api.add_symbol(var_name, info, node)\n call.analyzed = TypedDictExpr(info)\n call.analyzed.set_line(call.line, call.column)\n return True, info", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_typeddict.py_TypedDictAnalyzer.parse_typeddict_args_TypedDictAnalyzer.parse_typeddict_args.return.args_0_value_items_typ": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_typeddict.py_TypedDictAnalyzer.parse_typeddict_args_TypedDictAnalyzer.parse_typeddict_args.return.args_0_value_items_typ", "embedding": null, "metadata": {"file_path": "mypy/semanal_typeddict.py", "file_name": "semanal_typeddict.py", "file_type": "text/x-python", "category": "implementation", "start_line": 218, "end_line": 264, "span_ids": ["TypedDictAnalyzer.parse_typeddict_args"], "tokens": 558}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypedDictAnalyzer:\n\n def parse_typeddict_args(\n self, call: CallExpr) -> Optional[Tuple[str, List[str], List[Type], bool, bool]]:\n \"\"\"Parse typed dict call expression.\n\n Return names, types, totality, was there an error during parsing.\n If some type is not ready, return None.\n \"\"\"\n # TODO: Share code with check_argument_count in checkexpr.py?\n args = call.args\n if len(args) < 2:\n return self.fail_typeddict_arg(\"Too few arguments for TypedDict()\", call)\n if len(args) > 3:\n return self.fail_typeddict_arg(\"Too many arguments for TypedDict()\", call)\n # TODO: Support keyword arguments\n if call.arg_kinds not in ([ARG_POS, ARG_POS], [ARG_POS, ARG_POS, ARG_NAMED]):\n return self.fail_typeddict_arg(\"Unexpected arguments to TypedDict()\", call)\n if len(args) == 3 and call.arg_names[2] != 'total':\n return self.fail_typeddict_arg(\n 'Unexpected keyword argument \"{}\" for \"TypedDict\"'.format(call.arg_names[2]), call)\n if not isinstance(args[0], (StrExpr, BytesExpr, UnicodeExpr)):\n return self.fail_typeddict_arg(\n \"TypedDict() expects a string literal as the first argument\", call)\n if not isinstance(args[1], DictExpr):\n return self.fail_typeddict_arg(\n \"TypedDict() expects a dictionary literal as the second argument\", call)\n total = True # type: Optional[bool]\n if len(args) == 3:\n total = self.api.parse_bool(call.args[2])\n if total is None:\n return self.fail_typeddict_arg(\n 'TypedDict() \"total\" argument must be True or False', call)\n dictexpr = args[1]\n res = self.parse_typeddict_fields_with_types(dictexpr.items, call)\n if res is None:\n # One of the types is not ready, defer.\n return None\n items, types, ok = res\n for t in types:\n check_for_explicit_any(t, self.options, self.api.is_typeshed_stub_file, self.msg,\n context=call)\n\n if self.options.disallow_any_unimported:\n for t in types:\n if has_any_from_unimported_type(t):\n self.msg.unimported_type_becomes_any(\"Type of a TypedDict key\", t, dictexpr)\n assert total is not None\n return args[0].value, items, types, total, ok", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_typeddict.py_TypedDictAnalyzer.parse_typeddict_fields_with_types_TypedDictAnalyzer.parse_typeddict_fields_with_types.return.items_types_True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_typeddict.py_TypedDictAnalyzer.parse_typeddict_fields_with_types_TypedDictAnalyzer.parse_typeddict_fields_with_types.return.items_types_True", "embedding": null, "metadata": {"file_path": "mypy/semanal_typeddict.py", "file_name": "semanal_typeddict.py", "file_type": "text/x-python", "category": "implementation", "start_line": 266, "end_line": 297, "span_ids": ["TypedDictAnalyzer.parse_typeddict_fields_with_types"], "tokens": 310}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypedDictAnalyzer:\n\n def parse_typeddict_fields_with_types(\n self,\n dict_items: List[Tuple[Optional[Expression], Expression]],\n context: Context) -> Optional[Tuple[List[str], List[Type], bool]]:\n \"\"\"Parse typed dict items passed as pairs (name expression, type expression).\n\n Return names, types, was there an error. If some type is not ready, return None.\n \"\"\"\n seen_keys = set()\n items = [] # type: List[str]\n types = [] # type: List[Type]\n for (field_name_expr, field_type_expr) in dict_items:\n if isinstance(field_name_expr, (StrExpr, BytesExpr, UnicodeExpr)):\n key = field_name_expr.value\n items.append(key)\n if key in seen_keys:\n self.fail('Duplicate TypedDict key \"{}\"'.format(key), field_name_expr)\n seen_keys.add(key)\n else:\n name_context = field_name_expr or field_type_expr\n self.fail_typeddict_arg(\"Invalid TypedDict() field name\", name_context)\n return [], [], False\n try:\n type = expr_to_unanalyzed_type(field_type_expr)\n except TypeTranslationError:\n self.fail_typeddict_arg('Invalid field type', field_type_expr)\n return [], [], False\n analyzed = self.api.anal_type(type)\n if analyzed is None:\n return None\n types.append(analyzed)\n return items, types, True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_typeddict.py_TypedDictAnalyzer.fail_typeddict_arg_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_typeddict.py_TypedDictAnalyzer.fail_typeddict_arg_", "embedding": null, "metadata": {"file_path": "mypy/semanal_typeddict.py", "file_name": "semanal_typeddict.py", "file_type": "text/x-python", "category": "implementation", "start_line": 301, "end_line": 327, "span_ids": ["TypedDictAnalyzer.fail_typeddict_arg", "TypedDictAnalyzer.is_typeddict", "TypedDictAnalyzer.build_typeddict_typeinfo", "TypedDictAnalyzer.fail"], "tokens": 288}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypedDictAnalyzer:\n\n def fail_typeddict_arg(self, message: str,\n context: Context) -> Tuple[str, List[str], List[Type], bool, bool]:\n self.fail(message, context)\n return '', [], [], True, False\n\n def build_typeddict_typeinfo(self, name: str, items: List[str],\n types: List[Type],\n required_keys: Set[str]) -> TypeInfo:\n # Prefer typing then typing_extensions if available.\n fallback = (self.api.named_type_or_none('typing._TypedDict', []) or\n self.api.named_type_or_none('typing_extensions._TypedDict', []) or\n self.api.named_type_or_none('mypy_extensions._TypedDict', []))\n assert fallback is not None\n info = self.api.basic_new_typeinfo(name, fallback)\n info.typeddict_type = TypedDictType(OrderedDict(zip(items, types)), required_keys,\n fallback)\n return info\n\n # Helpers\n\n def is_typeddict(self, expr: Expression) -> bool:\n return (isinstance(expr, RefExpr) and isinstance(expr.node, TypeInfo) and\n expr.node.typeddict_type is not None)\n\n def fail(self, msg: str, ctx: Context, *, code: Optional[ErrorCode] = None) -> None:\n self.api.fail(msg, ctx, code=code)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astdiff.py__Utilities_for_comparin_SnapshotItem.Tuple_object_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astdiff.py__Utilities_for_comparin_SnapshotItem.Tuple_object_", "embedding": null, "metadata": {"file_path": "mypy/server/astdiff.py", "file_name": "astdiff.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 74, "span_ids": ["imports", "docstring"], "tokens": 770}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Utilities for comparing two versions of a module symbol table.\n\nThe goal is to find which AST nodes have externally visible changes, so\nthat we can fire triggers and re-process other parts of the program\nthat are stale because of the changes.\n\nOnly look at detail at definitions at the current module -- don't\nrecurse into other modules.\n\nA summary of the module contents:\n\n* snapshot_symbol_table(...) creates an opaque snapshot description of a\n module/class symbol table (recursing into nested class symbol tables).\n\n* compare_symbol_table_snapshots(...) compares two snapshots for the same\n module id and returns fully qualified names of differences (which act as\n triggers).\n\nTo compare two versions of a module symbol table, take snapshots of both\nversions and compare the snapshots. The use of snapshots makes it easy to\ncompare two versions of the *same* symbol table that is being mutated.\n\nSummary of how this works for certain kinds of differences:\n\n* If a symbol table node is deleted or added (only present in old/new version\n of the symbol table), it is considered different, of course.\n\n* If a symbol table node refers to a different sort of thing in the new version,\n it is considered different (for example, if a class is replaced with a\n function).\n\n* If the signature of a function has changed, it is considered different.\n\n* If the type of a variable changes, it is considered different.\n\n* If the MRO of a class changes, or a non-generic class is turned into a\n generic class, the class is considered different (there are other such \"big\"\n differences that cause a class to be considered changed). However, just changes\n to attributes or methods don't generally constitute a difference at the\n class level -- these are handled at attribute level (say, 'mod.Cls.method'\n is different rather than 'mod.Cls' being different).\n\n* If an imported name targets a different name (say, 'from x import y' is\n replaced with 'from z import y'), the name in the module is considered\n different. If the target of an import continues to have the same name,\n but it's specifics change, this doesn't mean that the imported name is\n treated as changed. Say, there is 'from x import y' in 'm', and the\n type of 'x.y' has changed. This doesn't mean that that 'm.y' is considered\n changed. Instead, processing the difference in 'm' will be handled through\n fine-grained dependencies.\n\"\"\"\n\nfrom typing import Set, Dict, Tuple, Optional, Sequence, Union\n\nfrom mypy.nodes import (\n SymbolTable, TypeInfo, Var, SymbolNode, Decorator, TypeVarExpr, TypeAlias,\n FuncBase, OverloadedFuncDef, FuncItem, MypyFile, UNBOUND_IMPORTED\n)\nfrom mypy.types import (\n Type, TypeVisitor, UnboundType, AnyType, NoneType, UninhabitedType,\n ErasedType, DeletedType, Instance, TypeVarType, CallableType, TupleType, TypedDictType,\n UnionType, Overloaded, PartialType, TypeType, LiteralType, TypeAliasType\n)\nfrom mypy.util import get_prefix\n\n\n# Snapshot representation of a symbol table node or type. The representation is\n# opaque -- the only supported operations are comparing for equality and\n# hashing (latter for type snapshots only). Snapshots can contain primitive\n# objects, nested tuples, lists and dictionaries and primitive objects (type\n# snapshots are immutable).\n#\n# For example, the snapshot of the 'int' type is ('Instance', 'builtins.int', ()).\nSnapshotItem = Tuple[object, ...]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astdiff.py_compare_symbol_table_snapshots_compare_symbol_table_snapshots.return.triggers": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astdiff.py_compare_symbol_table_snapshots_compare_symbol_table_snapshots.return.triggers", "embedding": null, "metadata": {"file_path": "mypy/server/astdiff.py", "file_name": "astdiff.py", "file_type": "text/x-python", "category": "implementation", "start_line": 77, "end_line": 118, "span_ids": ["compare_symbol_table_snapshots"], "tokens": 428}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def compare_symbol_table_snapshots(\n name_prefix: str,\n snapshot1: Dict[str, SnapshotItem],\n snapshot2: Dict[str, SnapshotItem]) -> Set[str]:\n \"\"\"Return names that are different in two snapshots of a symbol table.\n\n Only shallow (intra-module) differences are considered. References to things defined\n outside the module are compared based on the name of the target only.\n\n Recurse into class symbol tables (if the class is defined in the target module).\n\n Return a set of fully-qualified names (e.g., 'mod.func' or 'mod.Class.method').\n \"\"\"\n # Find names only defined only in one version.\n names1 = {'%s.%s' % (name_prefix, name) for name in snapshot1}\n names2 = {'%s.%s' % (name_prefix, name) for name in snapshot2}\n triggers = names1 ^ names2\n\n # Look for names defined in both versions that are different.\n for name in set(snapshot1.keys()) & set(snapshot2.keys()):\n item1 = snapshot1[name]\n item2 = snapshot2[name]\n kind1 = item1[0]\n kind2 = item2[0]\n item_name = '%s.%s' % (name_prefix, name)\n if kind1 != kind2:\n # Different kind of node in two snapshots -> trivially different.\n triggers.add(item_name)\n elif kind1 == 'TypeInfo':\n if item1[:-1] != item2[:-1]:\n # Record major difference (outside class symbol tables).\n triggers.add(item_name)\n # Look for differences in nested class symbol table entries.\n assert isinstance(item1[-1], dict)\n assert isinstance(item2[-1], dict)\n triggers |= compare_symbol_table_snapshots(item_name, item1[-1], item2[-1])\n else:\n # Shallow node (no interesting internal structure). Just use equality.\n if snapshot1[name] != snapshot2[name]:\n triggers.add(item_name)\n\n return triggers", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astdiff.py_snapshot_symbol_table_snapshot_symbol_table.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astdiff.py_snapshot_symbol_table_snapshot_symbol_table.return.result", "embedding": null, "metadata": {"file_path": "mypy/server/astdiff.py", "file_name": "astdiff.py", "file_type": "text/x-python", "category": "implementation", "start_line": 121, "end_line": 161, "span_ids": ["snapshot_symbol_table"], "tokens": 382}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def snapshot_symbol_table(name_prefix: str, table: SymbolTable) -> Dict[str, SnapshotItem]:\n \"\"\"Create a snapshot description that represents the state of a symbol table.\n\n The snapshot has a representation based on nested tuples and dicts\n that makes it easy and fast to find differences.\n\n Only \"shallow\" state is included in the snapshot -- references to\n things defined in other modules are represented just by the names of\n the targets.\n \"\"\"\n result = {} # type: Dict[str, SnapshotItem]\n for name, symbol in table.items():\n node = symbol.node\n # TODO: cross_ref?\n fullname = node.fullname if node else None\n common = (fullname, symbol.kind, symbol.module_public)\n if isinstance(node, MypyFile):\n # This is a cross-reference to another module.\n # If the reference is busted because the other module is missing,\n # the node will be a \"stale_info\" TypeInfo produced by fixup,\n # but that doesn't really matter to us here.\n result[name] = ('Moduleref', common)\n elif isinstance(node, TypeVarExpr):\n result[name] = ('TypeVar',\n node.variance,\n [snapshot_type(value) for value in node.values],\n snapshot_type(node.upper_bound))\n elif isinstance(node, TypeAlias):\n result[name] = ('TypeAlias',\n node.alias_tvars,\n node.normalized,\n node.no_args,\n snapshot_optional_type(node.target))\n else:\n assert symbol.kind != UNBOUND_IMPORTED\n if node and get_prefix(node.fullname) != name_prefix:\n # This is a cross-reference to a node defined in another module.\n result[name] = ('CrossRef', common)\n else:\n result[name] = snapshot_definition(node, common)\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astdiff.py_snapshot_definition_snapshot_definition.if_isinstance_node_FuncB.else_.assert_False_type_node_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astdiff.py_snapshot_definition_snapshot_definition.if_isinstance_node_FuncB.else_.assert_False_type_node_", "embedding": null, "metadata": {"file_path": "mypy/server/astdiff.py", "file_name": "astdiff.py", "file_type": "text/x-python", "category": "implementation", "start_line": 164, "end_line": 226, "span_ids": ["snapshot_definition"], "tokens": 595}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def snapshot_definition(node: Optional[SymbolNode],\n common: Tuple[object, ...]) -> Tuple[object, ...]:\n \"\"\"Create a snapshot description of a symbol table node.\n\n The representation is nested tuples and dicts. Only externally\n visible attributes are included.\n \"\"\"\n if isinstance(node, FuncBase):\n # TODO: info\n if node.type:\n signature = snapshot_type(node.type)\n else:\n signature = snapshot_untyped_signature(node)\n return ('Func', common,\n node.is_property, node.is_final,\n node.is_class, node.is_static,\n signature)\n elif isinstance(node, Var):\n return ('Var', common,\n snapshot_optional_type(node.type),\n node.is_final)\n elif isinstance(node, Decorator):\n # Note that decorated methods are represented by Decorator instances in\n # a symbol table since we need to preserve information about the\n # decorated function (whether it's a class function, for\n # example). Top-level decorated functions, however, are represented by\n # the corresponding Var node, since that happens to provide enough\n # context.\n return ('Decorator',\n node.is_overload,\n snapshot_optional_type(node.var.type),\n snapshot_definition(node.func, common))\n elif isinstance(node, TypeInfo):\n attrs = (node.is_abstract,\n node.is_enum,\n node.is_protocol,\n node.fallback_to_any,\n node.is_named_tuple,\n node.is_newtype,\n # We need this to e.g. trigger metaclass calculation in subclasses.\n snapshot_optional_type(node.metaclass_type),\n snapshot_optional_type(node.tuple_type),\n snapshot_optional_type(node.typeddict_type),\n [base.fullname for base in node.mro],\n # Note that the structure of type variables is a part of the external interface,\n # since creating instances might fail, for example:\n # T = TypeVar('T', bound=int)\n # class C(Generic[T]):\n # ...\n # x: C[str] <- this is invalid, and needs to be re-checked if `T` changes.\n # An alternative would be to create both deps: <...> -> C, and <...> -> ,\n # but this currently seems a bit ad hoc.\n tuple(snapshot_type(TypeVarType(tdef)) for tdef in node.defn.type_vars),\n [snapshot_type(base) for base in node.bases],\n snapshot_optional_type(node._promote))\n prefix = node.fullname\n symbol_table = snapshot_symbol_table(prefix, node.names)\n # Special dependency for abstract attribute handling.\n symbol_table['(abstract)'] = ('Abstract', tuple(sorted(node.abstract_attributes)))\n return ('TypeInfo', common, attrs, symbol_table)\n else:\n # Other node types are handled elsewhere.\n assert False, type(node)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astdiff.py_snapshot_type_encode_optional_str.if_s_is_None_.else_.return.s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astdiff.py_snapshot_type_encode_optional_str.if_s_is_None_.else_.return.s", "embedding": null, "metadata": {"file_path": "mypy/server/astdiff.py", "file_name": "astdiff.py", "file_type": "text/x-python", "category": "implementation", "start_line": 229, "end_line": 253, "span_ids": ["snapshot_simple_type", "encode_optional_str", "snapshot_types", "snapshot_type", "snapshot_optional_type"], "tokens": 141}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def snapshot_type(typ: Type) -> SnapshotItem:\n \"\"\"Create a snapshot representation of a type using nested tuples.\"\"\"\n return typ.accept(SnapshotTypeVisitor())\n\n\ndef snapshot_optional_type(typ: Optional[Type]) -> Optional[SnapshotItem]:\n if typ:\n return snapshot_type(typ)\n else:\n return None\n\n\ndef snapshot_types(types: Sequence[Type]) -> SnapshotItem:\n return tuple(snapshot_type(item) for item in types)\n\n\ndef snapshot_simple_type(typ: Type) -> SnapshotItem:\n return (type(typ).__name__,)\n\n\ndef encode_optional_str(s: Optional[str]) -> str:\n if s is None:\n return ''\n else:\n return s", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astdiff.py_SnapshotTypeVisitor_SnapshotTypeVisitor.visit_type_alias_type.return._TypeAliasType_typ_ali": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astdiff.py_SnapshotTypeVisitor_SnapshotTypeVisitor.visit_type_alias_type.return._TypeAliasType_typ_ali", "embedding": null, "metadata": {"file_path": "mypy/server/astdiff.py", "file_name": "astdiff.py", "file_type": "text/x-python", "category": "implementation", "start_line": 256, "end_line": 351, "span_ids": ["SnapshotTypeVisitor.visit_deleted_type", "SnapshotTypeVisitor.visit_tuple_type", "SnapshotTypeVisitor.visit_partial_type", "SnapshotTypeVisitor.visit_literal_type", "SnapshotTypeVisitor.visit_type_var", "SnapshotTypeVisitor.visit_unbound_type", "SnapshotTypeVisitor.visit_type_type", "SnapshotTypeVisitor.visit_instance", "SnapshotTypeVisitor.visit_typeddict_type", "SnapshotTypeVisitor", "SnapshotTypeVisitor.visit_none_type", "SnapshotTypeVisitor.visit_overloaded", "SnapshotTypeVisitor.visit_callable_type", "SnapshotTypeVisitor.visit_any", "SnapshotTypeVisitor.visit_union_type", "SnapshotTypeVisitor.visit_type_alias_type", "SnapshotTypeVisitor.visit_uninhabited_type", "SnapshotTypeVisitor.visit_erased_type"], "tokens": 820}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SnapshotTypeVisitor(TypeVisitor[SnapshotItem]):\n \"\"\"Creates a read-only, self-contained snapshot of a type object.\n\n Properties of a snapshot:\n\n - Contains (nested) tuples and other immutable primitive objects only.\n - References to AST nodes are replaced with full names of targets.\n - Has no references to mutable or non-primitive objects.\n - Two snapshots represent the same object if and only if they are\n equal.\n - Results must be sortable. It's important that tuples have\n consistent types and can't arbitrarily mix str and None values,\n for example, since they can't be compared.\n \"\"\"\n\n def visit_unbound_type(self, typ: UnboundType) -> SnapshotItem:\n return ('UnboundType',\n typ.name,\n typ.optional,\n typ.empty_tuple_index,\n snapshot_types(typ.args))\n\n def visit_any(self, typ: AnyType) -> SnapshotItem:\n return snapshot_simple_type(typ)\n\n def visit_none_type(self, typ: NoneType) -> SnapshotItem:\n return snapshot_simple_type(typ)\n\n def visit_uninhabited_type(self, typ: UninhabitedType) -> SnapshotItem:\n return snapshot_simple_type(typ)\n\n def visit_erased_type(self, typ: ErasedType) -> SnapshotItem:\n return snapshot_simple_type(typ)\n\n def visit_deleted_type(self, typ: DeletedType) -> SnapshotItem:\n return snapshot_simple_type(typ)\n\n def visit_instance(self, typ: Instance) -> SnapshotItem:\n return ('Instance',\n encode_optional_str(typ.type.fullname),\n snapshot_types(typ.args),\n ('None',) if typ.last_known_value is None else snapshot_type(typ.last_known_value))\n\n def visit_type_var(self, typ: TypeVarType) -> SnapshotItem:\n return ('TypeVar',\n typ.name,\n typ.fullname,\n typ.id.raw_id,\n typ.id.meta_level,\n snapshot_types(typ.values),\n snapshot_type(typ.upper_bound),\n typ.variance)\n\n def visit_callable_type(self, typ: CallableType) -> SnapshotItem:\n # FIX generics\n return ('CallableType',\n snapshot_types(typ.arg_types),\n snapshot_type(typ.ret_type),\n tuple([encode_optional_str(name) for name in typ.arg_names]),\n tuple(typ.arg_kinds),\n typ.is_type_obj(),\n typ.is_ellipsis_args)\n\n def visit_tuple_type(self, typ: TupleType) -> SnapshotItem:\n return ('TupleType', snapshot_types(typ.items))\n\n def visit_typeddict_type(self, typ: TypedDictType) -> SnapshotItem:\n items = tuple((key, snapshot_type(item_type))\n for key, item_type in typ.items.items())\n required = tuple(sorted(typ.required_keys))\n return ('TypedDictType', items, required)\n\n def visit_literal_type(self, typ: LiteralType) -> SnapshotItem:\n return ('LiteralType', snapshot_type(typ.fallback), typ.value)\n\n def visit_union_type(self, typ: UnionType) -> SnapshotItem:\n # Sort and remove duplicates so that we can use equality to test for\n # equivalent union type snapshots.\n items = {snapshot_type(item) for item in typ.items}\n normalized = tuple(sorted(items))\n return ('UnionType', normalized)\n\n def visit_overloaded(self, typ: Overloaded) -> SnapshotItem:\n return ('Overloaded', snapshot_types(typ.items()))\n\n def visit_partial_type(self, typ: PartialType) -> SnapshotItem:\n # A partial type is not fully defined, so the result is indeterminate. We shouldn't\n # get here.\n raise RuntimeError\n\n def visit_type_type(self, typ: TypeType) -> SnapshotItem:\n return ('TypeType', snapshot_type(typ.item))\n\n def visit_type_alias_type(self, typ: TypeAliasType) -> SnapshotItem:\n assert typ.alias is not None\n return ('TypeAliasType', typ.alias.fullname, snapshot_types(typ.args))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astdiff.py_snapshot_untyped_signature_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astdiff.py_snapshot_untyped_signature_", "embedding": null, "metadata": {"file_path": "mypy/server/astdiff.py", "file_name": "astdiff.py", "file_type": "text/x-python", "category": "implementation", "start_line": 354, "end_line": 376, "span_ids": ["snapshot_untyped_signature"], "tokens": 197}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def snapshot_untyped_signature(func: Union[OverloadedFuncDef, FuncItem]) -> Tuple[object, ...]:\n \"\"\"Create a snapshot of the signature of a function that has no explicit signature.\n\n If the arguments to a function without signature change, it must be\n considered as different. We have this special casing since we don't store\n the implicit signature anywhere, and we'd rather not construct new\n Callable objects in this module (the idea is to only read properties of\n the AST here).\n \"\"\"\n if isinstance(func, FuncItem):\n return (tuple(func.arg_names), tuple(func.arg_kinds))\n else:\n result = []\n for item in func.items:\n if isinstance(item, Decorator):\n if item.var.type:\n result.append(snapshot_type(item.var.type))\n else:\n result.append(('DecoratorWithoutType',))\n else:\n result.append(snapshot_untyped_signature(item))\n return tuple(result)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astmerge.py__Merge_a_new_version_of_from_mypy_types_import_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astmerge.py__Merge_a_new_version_of_from_mypy_types_import_", "embedding": null, "metadata": {"file_path": "mypy/server/astmerge.py", "file_name": "astmerge.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 63, "span_ids": ["imports", "docstring"], "tokens": 750}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Merge a new version of a module AST and symbol table to older versions of those.\n\nWhen the source code of a module has a change in fine-grained incremental mode,\nwe build a new AST from the updated source. However, other parts of the program\nmay have direct references to parts of the old AST (namely, those nodes exposed\nin the module symbol table). The merge operation changes the identities of new\nAST nodes that have a correspondence in the old AST to the old ones so that\nexisting cross-references in other modules will continue to point to the correct\nnodes. Also internal cross-references within the new AST are replaced. AST nodes\nthat aren't externally visible will get new, distinct object identities. This\napplies to most expression and statement nodes, for example.\n\nWe perform this merge operation so that we don't have to update all\nexternal references (which would be slow and fragile) or always perform\ntranslation when looking up references (which would be hard to retrofit).\n\nThe AST merge operation is performed after semantic analysis. Semantic\nanalysis has to deal with potentially multiple aliases to certain AST\nnodes (in particular, MypyFile nodes). Type checking assumes that we\ndon't have multiple variants of a single AST node visible to the type\nchecker.\n\nDiscussion of some notable special cases:\n\n* If a node is replaced with a different kind of node (say, a function is\n replaced with a class), we don't perform the merge. Fine-grained dependencies\n will be used to rebind all references to the node.\n\n* If a function is replaced with another function with an identical signature,\n call sites continue to point to the same object (by identity) and don't need\n to be reprocessed. Similarly, if a class is replaced with a class that is\n sufficiently similar (MRO preserved, etc.), class references don't need any\n processing. A typical incremental update to a file only changes a few\n externally visible things in a module, and this means that often only few\n external references need any processing, even if the modified module is large.\n\n* A no-op update of a module should not require any processing outside the\n module, since all relevant object identities are preserved.\n\n* The AST diff operation (mypy.server.astdiff) and the top-level fine-grained\n incremental logic (mypy.server.update) handle the cases where the new AST has\n differences from the old one that may need to be propagated to elsewhere in the\n program.\n\nSee the main entry point merge_asts for more details.\n\"\"\"\n\nfrom typing import Dict, List, cast, TypeVar, Optional\n\nfrom mypy.nodes import (\n MypyFile, SymbolTable, Block, AssignmentStmt, NameExpr, MemberExpr, RefExpr, TypeInfo,\n FuncDef, ClassDef, NamedTupleExpr, SymbolNode, Var, Statement, SuperExpr, NewTypeExpr,\n OverloadedFuncDef, LambdaExpr, TypedDictExpr, EnumCallExpr, FuncBase, TypeAliasExpr, CallExpr,\n CastExpr, TypeAlias,\n MDEF\n)\nfrom mypy.traverser import TraverserVisitor\nfrom mypy.types import (\n Type, SyntheticTypeVisitor, Instance, AnyType, NoneType, CallableType, ErasedType, DeletedType,\n TupleType, TypeType, TypeVarType, TypedDictType, UnboundType, UninhabitedType, UnionType,\n Overloaded, TypeVarDef, TypeList, CallableArgument, EllipsisType, StarType, LiteralType,\n RawExpressionType, PartialType, PlaceholderType, TypeAliasType\n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astmerge.py_from_mypy_util_import_get_merge_asts.replace_nodes_in_symbol_t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astmerge.py_from_mypy_util_import_get_merge_asts.replace_nodes_in_symbol_t", "embedding": null, "metadata": {"file_path": "mypy/server/astmerge.py", "file_name": "astmerge.py", "file_type": "text/x-python", "category": "implementation", "start_line": 64, "end_line": 94, "span_ids": ["imports", "merge_asts"], "tokens": 332}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from mypy.util import get_prefix, replace_object_state\nfrom mypy.typestate import TypeState\n\n\ndef merge_asts(old: MypyFile, old_symbols: SymbolTable,\n new: MypyFile, new_symbols: SymbolTable) -> None:\n \"\"\"Merge a new version of a module AST to a previous version.\n\n The main idea is to preserve the identities of externally visible\n nodes in the old AST (that have a corresponding node in the new AST).\n All old node state (outside identity) will come from the new AST.\n\n When this returns, 'old' will refer to the merged AST, but 'new_symbols'\n will be the new symbol table. 'new' and 'old_symbols' will no longer be\n valid.\n \"\"\"\n assert new.fullname == old.fullname\n # Find the mapping from new to old node identities for all nodes\n # whose identities should be preserved.\n replacement_map = replacement_map_from_symbol_table(\n old_symbols, new_symbols, prefix=old.fullname)\n # Also replace references to the new MypyFile node.\n replacement_map[new] = old\n # Perform replacements to everywhere within the new AST (not including symbol\n # tables).\n node = replace_nodes_in_ast(new, replacement_map)\n assert node is old\n # Also replace AST node references in the *new* symbol table (we'll\n # continue to use the new symbol table since it has all the new definitions\n # that have no correspondence in the old AST).\n replace_nodes_in_symbol_table(new_symbols, replacement_map)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astmerge.py_replacement_map_from_symbol_table_replacement_map_from_symbol_table.return.replacements": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astmerge.py_replacement_map_from_symbol_table_replacement_map_from_symbol_table.return.replacements", "embedding": null, "metadata": {"file_path": "mypy/server/astmerge.py", "file_name": "astmerge.py", "file_type": "text/x-python", "category": "implementation", "start_line": 97, "end_line": 122, "span_ids": ["replacement_map_from_symbol_table"], "tokens": 276}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def replacement_map_from_symbol_table(\n old: SymbolTable, new: SymbolTable, prefix: str) -> Dict[SymbolNode, SymbolNode]:\n \"\"\"Create a new-to-old object identity map by comparing two symbol table revisions.\n\n Both symbol tables must refer to revisions of the same module id. The symbol tables\n are compared recursively (recursing into nested class symbol tables), but only within\n the given module prefix. Don't recurse into other modules accessible through the symbol\n table.\n \"\"\"\n replacements = {} # type: Dict[SymbolNode, SymbolNode]\n for name, node in old.items():\n if (name in new and (node.kind == MDEF\n or node.node and get_prefix(node.node.fullname) == prefix)):\n new_node = new[name]\n if (type(new_node.node) == type(node.node) # noqa\n and new_node.node and node.node and\n new_node.node.fullname == node.node.fullname and\n new_node.kind == node.kind):\n replacements[new_node.node] = node.node\n if isinstance(node.node, TypeInfo) and isinstance(new_node.node, TypeInfo):\n type_repl = replacement_map_from_symbol_table(\n node.node.names,\n new_node.node.names,\n prefix)\n replacements.update(type_repl)\n return replacements", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astmerge.py_replace_nodes_in_ast_SN.TypeVar_SN_bound_Symbo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astmerge.py_replace_nodes_in_ast_SN.TypeVar_SN_bound_Symbo", "embedding": null, "metadata": {"file_path": "mypy/server/astmerge.py", "file_name": "astmerge.py", "file_type": "text/x-python", "category": "implementation", "start_line": 125, "end_line": 138, "span_ids": ["replace_nodes_in_ast", "impl"], "tokens": 123}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def replace_nodes_in_ast(node: SymbolNode,\n replacements: Dict[SymbolNode, SymbolNode]) -> SymbolNode:\n \"\"\"Replace all references to replacement map keys within an AST node, recursively.\n\n Also replace the *identity* of any nodes that have replacements. Return the\n *replaced* version of the argument node (which may have a different identity, if\n it's included in the replacement map).\n \"\"\"\n visitor = NodeReplaceVisitor(replacements)\n node.accept(visitor)\n return replacements.get(node, node)\n\n\nSN = TypeVar('SN', bound=SymbolNode)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astmerge.py_NodeReplaceVisitor_NodeReplaceVisitor.visit_call_expr.if_isinstance_node_analyz.node.analyzed.self_fixup_node_analyzed_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astmerge.py_NodeReplaceVisitor_NodeReplaceVisitor.visit_call_expr.if_isinstance_node_analyz.node.analyzed.self_fixup_node_analyzed_", "embedding": null, "metadata": {"file_path": "mypy/server/astmerge.py", "file_name": "astmerge.py", "file_type": "text/x-python", "category": "implementation", "start_line": 141, "end_line": 235, "span_ids": ["NodeReplaceVisitor.visit_ref_expr", "NodeReplaceVisitor.visit_super_expr", "NodeReplaceVisitor.process_type_var_def", "NodeReplaceVisitor.visit_block", "NodeReplaceVisitor.visit_member_expr", "NodeReplaceVisitor.visit_call_expr", "NodeReplaceVisitor.visit_class_def", "NodeReplaceVisitor.visit_assignment_stmt", "NodeReplaceVisitor.visit_func_def", "NodeReplaceVisitor.visit_cast_expr", "NodeReplaceVisitor.visit_namedtuple_expr", "NodeReplaceVisitor.visit_name_expr", "NodeReplaceVisitor.__init__", "NodeReplaceVisitor", "NodeReplaceVisitor.visit_overloaded_func_def", "NodeReplaceVisitor.visit_mypy_file", "NodeReplaceVisitor.process_base_func"], "tokens": 786}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class NodeReplaceVisitor(TraverserVisitor):\n \"\"\"Transform some nodes to new identities in an AST.\n\n Only nodes that live in the symbol table may be\n replaced, which simplifies the implementation some. Also\n replace all references to the old identities.\n \"\"\"\n\n def __init__(self, replacements: Dict[SymbolNode, SymbolNode]) -> None:\n self.replacements = replacements\n\n def visit_mypy_file(self, node: MypyFile) -> None:\n node = self.fixup(node)\n node.defs = self.replace_statements(node.defs)\n super().visit_mypy_file(node)\n\n def visit_block(self, node: Block) -> None:\n super().visit_block(node)\n node.body = self.replace_statements(node.body)\n\n def visit_func_def(self, node: FuncDef) -> None:\n node = self.fixup(node)\n self.process_base_func(node)\n super().visit_func_def(node)\n\n def visit_overloaded_func_def(self, node: OverloadedFuncDef) -> None:\n self.process_base_func(node)\n super().visit_overloaded_func_def(node)\n\n def visit_class_def(self, node: ClassDef) -> None:\n # TODO additional things?\n node.info = self.fixup_and_reset_typeinfo(node.info)\n node.defs.body = self.replace_statements(node.defs.body)\n info = node.info\n for tv in node.type_vars:\n self.process_type_var_def(tv)\n if info:\n if info.is_named_tuple:\n self.process_synthetic_type_info(info)\n else:\n self.process_type_info(info)\n super().visit_class_def(node)\n\n def process_base_func(self, node: FuncBase) -> None:\n self.fixup_type(node.type)\n node.info = self.fixup(node.info)\n if node.unanalyzed_type:\n # Unanalyzed types can have AST node references\n self.fixup_type(node.unanalyzed_type)\n\n def process_type_var_def(self, tv: TypeVarDef) -> None:\n for value in tv.values:\n self.fixup_type(value)\n self.fixup_type(tv.upper_bound)\n\n def visit_assignment_stmt(self, node: AssignmentStmt) -> None:\n self.fixup_type(node.type)\n super().visit_assignment_stmt(node)\n\n # Expressions\n\n def visit_name_expr(self, node: NameExpr) -> None:\n self.visit_ref_expr(node)\n\n def visit_member_expr(self, node: MemberExpr) -> None:\n if node.def_var:\n node.def_var = self.fixup(node.def_var)\n self.visit_ref_expr(node)\n super().visit_member_expr(node)\n\n def visit_ref_expr(self, node: RefExpr) -> None:\n if node.node is not None:\n node.node = self.fixup(node.node)\n if isinstance(node.node, Var):\n # The Var node may be an orphan and won't otherwise be processed.\n node.node.accept(self)\n\n def visit_namedtuple_expr(self, node: NamedTupleExpr) -> None:\n super().visit_namedtuple_expr(node)\n node.info = self.fixup_and_reset_typeinfo(node.info)\n self.process_synthetic_type_info(node.info)\n\n def visit_cast_expr(self, node: CastExpr) -> None:\n super().visit_cast_expr(node)\n self.fixup_type(node.type)\n\n def visit_super_expr(self, node: SuperExpr) -> None:\n super().visit_super_expr(node)\n if node.info is not None:\n node.info = self.fixup(node.info)\n\n def visit_call_expr(self, node: CallExpr) -> None:\n super().visit_call_expr(node)\n if isinstance(node.analyzed, SymbolNode):\n node.analyzed = self.fixup(node.analyzed)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astmerge.py_NodeReplaceVisitor.visit_newtype_expr_NodeReplaceVisitor.fixup.return.node": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astmerge.py_NodeReplaceVisitor.visit_newtype_expr_NodeReplaceVisitor.fixup.return.node", "embedding": null, "metadata": {"file_path": "mypy/server/astmerge.py", "file_name": "astmerge.py", "file_type": "text/x-python", "category": "implementation", "start_line": 237, "end_line": 280, "span_ids": ["NodeReplaceVisitor.visit_var", "NodeReplaceVisitor.visit_type_alias", "NodeReplaceVisitor.visit_newtype_expr", "NodeReplaceVisitor.visit_typeddict_expr", "NodeReplaceVisitor.visit_enum_call_expr", "NodeReplaceVisitor.fixup", "NodeReplaceVisitor.visit_lambda_expr", "NodeReplaceVisitor.visit_type_alias_expr"], "tokens": 368}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class NodeReplaceVisitor(TraverserVisitor):\n\n def visit_newtype_expr(self, node: NewTypeExpr) -> None:\n if node.info:\n node.info = self.fixup_and_reset_typeinfo(node.info)\n self.process_synthetic_type_info(node.info)\n self.fixup_type(node.old_type)\n super().visit_newtype_expr(node)\n\n def visit_lambda_expr(self, node: LambdaExpr) -> None:\n node.info = self.fixup(node.info)\n super().visit_lambda_expr(node)\n\n def visit_typeddict_expr(self, node: TypedDictExpr) -> None:\n super().visit_typeddict_expr(node)\n node.info = self.fixup_and_reset_typeinfo(node.info)\n self.process_synthetic_type_info(node.info)\n\n def visit_enum_call_expr(self, node: EnumCallExpr) -> None:\n node.info = self.fixup_and_reset_typeinfo(node.info)\n self.process_synthetic_type_info(node.info)\n super().visit_enum_call_expr(node)\n\n def visit_type_alias_expr(self, node: TypeAliasExpr) -> None:\n self.fixup_type(node.type)\n super().visit_type_alias_expr(node)\n\n # Others\n\n def visit_var(self, node: Var) -> None:\n node.info = self.fixup(node.info)\n self.fixup_type(node.type)\n super().visit_var(node)\n\n def visit_type_alias(self, node: TypeAlias) -> None:\n self.fixup_type(node.target)\n super().visit_type_alias(node)\n\n # Helpers\n\n def fixup(self, node: SN) -> SN:\n if node in self.replacements:\n new = self.replacements[node]\n replace_object_state(new, node)\n return cast(SN, new)\n return node", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astmerge.py_NodeReplaceVisitor.fixup_and_reset_typeinfo_NodeReplaceVisitor.fixup_type.if_typ_is_not_None_.typ_accept_TypeReplaceVis": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astmerge.py_NodeReplaceVisitor.fixup_and_reset_typeinfo_NodeReplaceVisitor.fixup_type.if_typ_is_not_None_.typ_accept_TypeReplaceVis", "embedding": null, "metadata": {"file_path": "mypy/server/astmerge.py", "file_name": "astmerge.py", "file_type": "text/x-python", "category": "implementation", "start_line": 282, "end_line": 297, "span_ids": ["NodeReplaceVisitor.fixup_and_reset_typeinfo", "NodeReplaceVisitor.fixup_type"], "tokens": 157}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class NodeReplaceVisitor(TraverserVisitor):\n\n def fixup_and_reset_typeinfo(self, node: TypeInfo) -> TypeInfo:\n \"\"\"Fix-up type info and reset subtype caches.\n\n This needs to be called at least once per each merged TypeInfo, as otherwise we\n may leak stale caches.\n \"\"\"\n if node in self.replacements:\n # The subclass relationships may change, so reset all caches relevant to the\n # old MRO.\n new = cast(TypeInfo, self.replacements[node])\n TypeState.reset_all_subtype_caches_for(new)\n return self.fixup(node)\n\n def fixup_type(self, typ: Optional[Type]) -> None:\n if typ is not None:\n typ.accept(TypeReplaceVisitor(self.replacements))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astmerge.py_NodeReplaceVisitor.process_type_info_NodeReplaceVisitor.process_type_info.for_i_base_in_enumerate_.self_fixup_type_info_base": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astmerge.py_NodeReplaceVisitor.process_type_info_NodeReplaceVisitor.process_type_info.for_i_base_in_enumerate_.self_fixup_type_info_base", "embedding": null, "metadata": {"file_path": "mypy/server/astmerge.py", "file_name": "astmerge.py", "file_type": "text/x-python", "category": "implementation", "start_line": 299, "end_line": 312, "span_ids": ["NodeReplaceVisitor.process_type_info"], "tokens": 158}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class NodeReplaceVisitor(TraverserVisitor):\n\n def process_type_info(self, info: Optional[TypeInfo]) -> None:\n if info is None:\n return\n self.fixup_type(info.declared_metaclass)\n self.fixup_type(info.metaclass_type)\n self.fixup_type(info._promote)\n self.fixup_type(info.tuple_type)\n self.fixup_type(info.typeddict_type)\n info.defn.info = self.fixup(info)\n replace_nodes_in_symbol_table(info.names, self.replacements)\n for i, item in enumerate(info.mro):\n info.mro[i] = self.fixup(info.mro[i])\n for i, base in enumerate(info.bases):\n self.fixup_type(info.bases[i])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astmerge.py_NodeReplaceVisitor.process_synthetic_type_info_NodeReplaceVisitor.replace_statements.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astmerge.py_NodeReplaceVisitor.process_synthetic_type_info_NodeReplaceVisitor.replace_statements.return.result", "embedding": null, "metadata": {"file_path": "mypy/server/astmerge.py", "file_name": "astmerge.py", "file_type": "text/x-python", "category": "implementation", "start_line": 314, "end_line": 329, "span_ids": ["NodeReplaceVisitor.replace_statements", "NodeReplaceVisitor.process_synthetic_type_info"], "tokens": 147}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class NodeReplaceVisitor(TraverserVisitor):\n\n def process_synthetic_type_info(self, info: TypeInfo) -> None:\n # Synthetic types (types not created using a class statement) don't\n # have bodies in the AST so we need to iterate over their symbol\n # tables separately, unlike normal classes.\n self.process_type_info(info)\n for name, node in info.names.items():\n if node.node:\n node.node.accept(self)\n\n def replace_statements(self, nodes: List[Statement]) -> List[Statement]:\n result = []\n for node in nodes:\n if isinstance(node, SymbolNode):\n node = self.fixup(node)\n result.append(node)\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astmerge.py_TypeReplaceVisitor_TypeReplaceVisitor.visit_none_type.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astmerge.py_TypeReplaceVisitor_TypeReplaceVisitor.visit_none_type.pass", "embedding": null, "metadata": {"file_path": "mypy/server/astmerge.py", "file_name": "astmerge.py", "file_type": "text/x-python", "category": "implementation", "start_line": 332, "end_line": 360, "span_ids": ["TypeReplaceVisitor.visit_any", "TypeReplaceVisitor.__init__", "TypeReplaceVisitor.visit_instance", "TypeReplaceVisitor.visit_none_type", "TypeReplaceVisitor", "TypeReplaceVisitor.visit_type_alias_type"], "tokens": 225}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeReplaceVisitor(SyntheticTypeVisitor[None]):\n \"\"\"Similar to NodeReplaceVisitor, but for type objects.\n\n Note: this visitor may sometimes visit unanalyzed types\n such as 'UnboundType' and 'RawExpressionType' For example, see\n NodeReplaceVisitor.process_base_func.\n \"\"\"\n\n def __init__(self, replacements: Dict[SymbolNode, SymbolNode]) -> None:\n self.replacements = replacements\n\n def visit_instance(self, typ: Instance) -> None:\n typ.type = self.fixup(typ.type)\n for arg in typ.args:\n arg.accept(self)\n if typ.last_known_value:\n typ.last_known_value.accept(self)\n\n def visit_type_alias_type(self, typ: TypeAliasType) -> None:\n assert typ.alias is not None\n typ.alias = self.fixup(typ.alias)\n for arg in typ.args:\n arg.accept(self)\n\n def visit_any(self, typ: AnyType) -> None:\n pass\n\n def visit_none_type(self, typ: NoneType) -> None:\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astmerge.py_TypeReplaceVisitor.visit_callable_type_TypeReplaceVisitor.visit_callable_type.for_tv_in_typ_variables_.if_isinstance_tv_TypeVar.for_value_in_tv_values_.value_accept_self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astmerge.py_TypeReplaceVisitor.visit_callable_type_TypeReplaceVisitor.visit_callable_type.for_tv_in_typ_variables_.if_isinstance_tv_TypeVar.for_value_in_tv_values_.value_accept_self_", "embedding": null, "metadata": {"file_path": "mypy/server/astmerge.py", "file_name": "astmerge.py", "file_type": "text/x-python", "category": "implementation", "start_line": 362, "end_line": 376, "span_ids": ["TypeReplaceVisitor.visit_callable_type"], "tokens": 151}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeReplaceVisitor(SyntheticTypeVisitor[None]):\n\n def visit_callable_type(self, typ: CallableType) -> None:\n for arg in typ.arg_types:\n arg.accept(self)\n typ.ret_type.accept(self)\n if typ.definition:\n # No need to fixup since this is just a cross-reference.\n typ.definition = self.replacements.get(typ.definition, typ.definition)\n # Fallback can be None for callable types that haven't been semantically analyzed.\n if typ.fallback is not None:\n typ.fallback.accept(self)\n for tv in typ.variables:\n if isinstance(tv, TypeVarDef):\n tv.upper_bound.accept(self)\n for value in tv.values:\n value.accept(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astmerge.py_TypeReplaceVisitor.visit_overloaded_TypeReplaceVisitor.fixup.return.node": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astmerge.py_TypeReplaceVisitor.visit_overloaded_TypeReplaceVisitor.fixup.return.node", "embedding": null, "metadata": {"file_path": "mypy/server/astmerge.py", "file_name": "astmerge.py", "file_type": "text/x-python", "category": "implementation", "start_line": 378, "end_line": 455, "span_ids": ["TypeReplaceVisitor.visit_type_list", "TypeReplaceVisitor.visit_unbound_type", "TypeReplaceVisitor.visit_tuple_type", "TypeReplaceVisitor.visit_union_type", "TypeReplaceVisitor.visit_uninhabited_type", "TypeReplaceVisitor.visit_type_type", "TypeReplaceVisitor.visit_raw_expression_type", "TypeReplaceVisitor.visit_erased_type", "TypeReplaceVisitor.visit_type_var", "TypeReplaceVisitor.visit_ellipsis_type", "TypeReplaceVisitor.visit_overloaded", "TypeReplaceVisitor.visit_callable_argument", "TypeReplaceVisitor.visit_placeholder_type", "TypeReplaceVisitor.visit_deleted_type", "TypeReplaceVisitor.fixup", "TypeReplaceVisitor.visit_partial_type", "TypeReplaceVisitor.visit_star_type", "TypeReplaceVisitor.visit_typeddict_type", "TypeReplaceVisitor.visit_literal_type"], "tokens": 586}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeReplaceVisitor(SyntheticTypeVisitor[None]):\n\n def visit_overloaded(self, t: Overloaded) -> None:\n for item in t.items():\n item.accept(self)\n # Fallback can be None for overloaded types that haven't been semantically analyzed.\n if t.fallback is not None:\n t.fallback.accept(self)\n\n def visit_erased_type(self, t: ErasedType) -> None:\n # This type should exist only temporarily during type inference\n raise RuntimeError\n\n def visit_deleted_type(self, typ: DeletedType) -> None:\n pass\n\n def visit_partial_type(self, typ: PartialType) -> None:\n raise RuntimeError\n\n def visit_tuple_type(self, typ: TupleType) -> None:\n for item in typ.items:\n item.accept(self)\n # Fallback can be None for implicit tuple types that haven't been semantically analyzed.\n if typ.partial_fallback is not None:\n typ.partial_fallback.accept(self)\n\n def visit_type_type(self, typ: TypeType) -> None:\n typ.item.accept(self)\n\n def visit_type_var(self, typ: TypeVarType) -> None:\n typ.upper_bound.accept(self)\n for value in typ.values:\n value.accept(self)\n\n def visit_typeddict_type(self, typ: TypedDictType) -> None:\n for value_type in typ.items.values():\n value_type.accept(self)\n typ.fallback.accept(self)\n\n def visit_raw_expression_type(self, t: RawExpressionType) -> None:\n pass\n\n def visit_literal_type(self, typ: LiteralType) -> None:\n typ.fallback.accept(self)\n\n def visit_unbound_type(self, typ: UnboundType) -> None:\n for arg in typ.args:\n arg.accept(self)\n\n def visit_type_list(self, typ: TypeList) -> None:\n for item in typ.items:\n item.accept(self)\n\n def visit_callable_argument(self, typ: CallableArgument) -> None:\n typ.typ.accept(self)\n\n def visit_ellipsis_type(self, typ: EllipsisType) -> None:\n pass\n\n def visit_star_type(self, typ: StarType) -> None:\n typ.type.accept(self)\n\n def visit_uninhabited_type(self, typ: UninhabitedType) -> None:\n pass\n\n def visit_union_type(self, typ: UnionType) -> None:\n for item in typ.items:\n item.accept(self)\n\n def visit_placeholder_type(self, t: PlaceholderType) -> None:\n for item in t.args:\n item.accept(self)\n\n # Helpers\n\n def fixup(self, node: SN) -> SN:\n if node in self.replacements:\n new = self.replacements[node]\n return cast(SN, new)\n return node", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astmerge.py_replace_nodes_in_symbol_table_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/astmerge.py_replace_nodes_in_symbol_table_", "embedding": null, "metadata": {"file_path": "mypy/server/astmerge.py", "file_name": "astmerge.py", "file_type": "text/x-python", "category": "implementation", "start_line": 458, "end_line": 470, "span_ids": ["replace_nodes_in_symbol_table"], "tokens": 112}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def replace_nodes_in_symbol_table(symbols: SymbolTable,\n replacements: Dict[SymbolNode, SymbolNode]) -> None:\n for name, node in symbols.items():\n if node.node:\n if node.node in replacements:\n new = replacements[node.node]\n old = node.node\n replace_object_state(new, old)\n node.node = new\n if isinstance(node.node, (Var, TypeAlias)):\n # Handle them here just in case these aren't exposed through the AST.\n node.node.accept(NodeReplaceVisitor(replacements))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/aststrip.py__Strip_reset_AST_in_pla_SavedAttributes.Dict_Tuple_ClassDef_str_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/aststrip.py__Strip_reset_AST_in_pla_SavedAttributes.Dict_Tuple_ClassDef_str_", "embedding": null, "metadata": {"file_path": "mypy/server/aststrip.py", "file_name": "aststrip.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 48, "span_ids": ["imports:5", "docstring"], "tokens": 532}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Strip/reset AST in-place to match state after semantic analyzer pre-analysis.\n\nFine-grained incremental mode reruns semantic analysis main pass\nand type checking for *existing* AST nodes (targets) when changes are\npropagated using fine-grained dependencies. AST nodes attributes are\nsometimes changed during semantic analysis main pass, and running\nsemantic analysis again on those nodes would produce incorrect\nresults, since this pass isn't idempotent. This pass resets AST\nnodes to reflect the state after semantic pre-analysis, so that we\ncan rerun semantic analysis.\n(The above is in contrast to behavior with modules that have source code\nchanges, for which we re-parse the entire module and reconstruct a fresh\nAST. No stripping is required in this case. Both modes of operation should\nhave the same outcome.)\nNotes:\n* This is currently pretty fragile, as we must carefully undo whatever\n changes can be made in semantic analysis main pass, including changes\n to symbol tables.\n* We reuse existing AST nodes because it makes it relatively straightforward\n to reprocess only a single target within a module efficiently. If there\n was a way to parse a single target within a file, in time proportional to\n the size of the target, we'd rather create fresh AST nodes than strip them.\n (This is possible only in Python 3.8+)\n* Currently we don't actually reset all changes, but only those known to affect\n non-idempotent semantic analysis behavior.\n TODO: It would be more principled and less fragile to reset everything\n changed in semantic analysis main pass and later.\n* Reprocessing may recreate AST nodes (such as Var nodes, and TypeInfo nodes\n created with assignment statements) that will get different identities from\n the original AST. Thus running an AST merge is necessary after stripping,\n even though some identities are preserved.\n\"\"\"\n\nimport contextlib\nfrom typing import Union, Iterator, Optional, Dict, Tuple\n\nfrom mypy.nodes import (\n FuncDef, NameExpr, MemberExpr, RefExpr, MypyFile, ClassDef, AssignmentStmt,\n ImportFrom, CallExpr, Decorator, OverloadedFuncDef, Node, TupleExpr, ListExpr,\n SuperExpr, IndexExpr, ImportAll, ForStmt, Block, CLASSDEF_NO_INFO, TypeInfo,\n StarExpr, Var, SymbolTableNode\n)\nfrom mypy.traverser import TraverserVisitor\nfrom mypy.types import CallableType\nfrom mypy.typestate import TypeState\n\n\nSavedAttributes = Dict[Tuple[ClassDef, str], SymbolTableNode]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/aststrip.py_strip_target_strip_target.if_isinstance_node_MypyF.else_.node_accept_visitor_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/aststrip.py_strip_target_strip_target.if_isinstance_node_MypyF.else_.node_accept_visitor_", "embedding": null, "metadata": {"file_path": "mypy/server/aststrip.py", "file_name": "aststrip.py", "file_type": "text/x-python", "category": "implementation", "start_line": 51, "end_line": 68, "span_ids": ["strip_target"], "tokens": 162}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def strip_target(node: Union[MypyFile, FuncDef, OverloadedFuncDef],\n saved_attrs: SavedAttributes) -> None:\n \"\"\"Reset a fine-grained incremental target to state before semantic analysis.\n\n All TypeInfos are killed. Therefore we need to preserve the variables\n defined as attributes on self. This is done by patches (callbacks)\n returned from this function that re-add these variables when called.\n\n Args:\n node: node to strip\n saved_attrs: collect attributes here that may need to be re-added to\n classes afterwards if stripping a class body (this dict is mutated)\n \"\"\"\n visitor = NodeStripVisitor(saved_attrs)\n if isinstance(node, MypyFile):\n visitor.strip_file_top_level(node)\n else:\n node.accept(visitor)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/aststrip.py_NodeStripVisitor_NodeStripVisitor.__init__.self.saved_class_attrs.saved_class_attrs": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/aststrip.py_NodeStripVisitor_NodeStripVisitor.__init__.self.saved_class_attrs.saved_class_attrs", "embedding": null, "metadata": {"file_path": "mypy/server/aststrip.py", "file_name": "aststrip.py", "file_type": "text/x-python", "category": "implementation", "start_line": 71, "end_line": 83, "span_ids": ["NodeStripVisitor.__init__", "NodeStripVisitor"], "tokens": 158}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class NodeStripVisitor(TraverserVisitor):\n def __init__(self, saved_class_attrs: SavedAttributes) -> None:\n # The current active class.\n self.type = None # type: Optional[TypeInfo]\n # This is True at class scope, but not in methods.\n self.is_class_body = False\n # By default, process function definitions. If False, don't -- this is used for\n # processing module top levels.\n self.recurse_into_functions = True\n # These attributes were removed from top-level classes during strip and\n # will be added afterwards (if no existing definition is found). These\n # must be added back before semantically analyzing any methods.\n self.saved_class_attrs = saved_class_attrs", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/aststrip.py_NodeStripVisitor.strip_file_top_level_NodeStripVisitor.visit_block.super_visit_block_b_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/aststrip.py_NodeStripVisitor.strip_file_top_level_NodeStripVisitor.visit_block.super_visit_block_b_", "embedding": null, "metadata": {"file_path": "mypy/server/aststrip.py", "file_name": "aststrip.py", "file_type": "text/x-python", "category": "implementation", "start_line": 85, "end_line": 99, "span_ids": ["NodeStripVisitor.strip_file_top_level", "NodeStripVisitor.visit_block"], "tokens": 151}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class NodeStripVisitor(TraverserVisitor):\n\n def strip_file_top_level(self, file_node: MypyFile) -> None:\n \"\"\"Strip a module top-level (don't recursive into functions).\"\"\"\n self.recurse_into_functions = False\n file_node.plugin_deps.clear()\n file_node.accept(self)\n for name in file_node.names.copy():\n # TODO: this is a hot fix, we should delete all names,\n # see https://github.com/python/mypy/issues/6422.\n if '@' not in name:\n del file_node.names[name]\n\n def visit_block(self, b: Block) -> None:\n if b.is_unreachable:\n return\n super().visit_block(b)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/aststrip.py_NodeStripVisitor.visit_class_def_NodeStripVisitor.visit_class_def.node.info.CLASSDEF_NO_INFO": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/aststrip.py_NodeStripVisitor.visit_class_def_NodeStripVisitor.visit_class_def.node.info.CLASSDEF_NO_INFO", "embedding": null, "metadata": {"file_path": "mypy/server/aststrip.py", "file_name": "aststrip.py", "file_type": "text/x-python", "category": "implementation", "start_line": 101, "end_line": 121, "span_ids": ["NodeStripVisitor.visit_class_def"], "tokens": 272}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class NodeStripVisitor(TraverserVisitor):\n\n def visit_class_def(self, node: ClassDef) -> None:\n \"\"\"Strip class body and type info, but don't strip methods.\"\"\"\n # We need to save the implicitly defined instance variables,\n # i.e. those defined as attributes on self. Otherwise, they would\n # be lost if we only reprocess top-levels (this kills TypeInfos)\n # but not the methods that defined those variables.\n if not self.recurse_into_functions:\n self.save_implicit_attributes(node)\n # We need to delete any entries that were generated by plugins,\n # since they will get regenerated.\n to_delete = {v.node for v in node.info.names.values() if v.plugin_generated}\n node.type_vars = []\n node.base_type_exprs.extend(node.removed_base_type_exprs)\n node.removed_base_type_exprs = []\n node.defs.body = [s for s in node.defs.body\n if s not in to_delete] # type: ignore[comparison-overlap]\n with self.enter_class(node.info):\n super().visit_class_def(node)\n TypeState.reset_subtype_caches_for(node.info)\n # Kill the TypeInfo, since there is none before semantic analysis.\n node.info = CLASSDEF_NO_INFO", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/aststrip.py_NodeStripVisitor.save_implicit_attributes_NodeStripVisitor.visit_func_def.with_self_enter_method_no.super_visit_func_def_no": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/aststrip.py_NodeStripVisitor.save_implicit_attributes_NodeStripVisitor.visit_func_def.with_self_enter_method_no.super_visit_func_def_no", "embedding": null, "metadata": {"file_path": "mypy/server/aststrip.py", "file_name": "aststrip.py", "file_type": "text/x-python", "category": "implementation", "start_line": 123, "end_line": 142, "span_ids": ["NodeStripVisitor.save_implicit_attributes", "NodeStripVisitor.visit_func_def"], "tokens": 219}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class NodeStripVisitor(TraverserVisitor):\n\n def save_implicit_attributes(self, node: ClassDef) -> None:\n \"\"\"Produce callbacks that re-add attributes defined on self.\"\"\"\n for name, sym in node.info.names.items():\n if isinstance(sym.node, Var) and sym.implicit:\n self.saved_class_attrs[node, name] = sym\n\n def visit_func_def(self, node: FuncDef) -> None:\n if not self.recurse_into_functions:\n return\n node.expanded = []\n node.type = node.unanalyzed_type\n if node.type:\n # Type variable binder binds type variables before the type is analyzed,\n # this causes unanalyzed_type to be modified in place. We needed to revert this\n # in order to get the state exactly as it was before semantic analysis.\n # See also #4814.\n assert isinstance(node.type, CallableType)\n node.type.variables = []\n with self.enter_method(node.info) if node.info else nothing():\n super().visit_func_def(node)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/aststrip.py_NodeStripVisitor.visit_decorator_NodeStripVisitor.visit_super_expr.super_visit_super_expr_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/aststrip.py_NodeStripVisitor.visit_decorator_NodeStripVisitor.visit_super_expr.super_visit_super_expr_", "embedding": null, "metadata": {"file_path": "mypy/server/aststrip.py", "file_name": "aststrip.py", "file_type": "text/x-python", "category": "implementation", "start_line": 144, "end_line": 211, "span_ids": ["NodeStripVisitor.visit_import_all", "NodeStripVisitor.strip_ref_expr", "NodeStripVisitor.visit_import_from", "NodeStripVisitor.visit_for_stmt", "NodeStripVisitor.visit_decorator", "NodeStripVisitor.visit_name_expr", "NodeStripVisitor.visit_call_expr", "NodeStripVisitor.visit_super_expr", "NodeStripVisitor.visit_member_expr", "NodeStripVisitor.visit_overloaded_func_def", "NodeStripVisitor.visit_index_expr", "NodeStripVisitor.visit_assignment_stmt"], "tokens": 565}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class NodeStripVisitor(TraverserVisitor):\n\n def visit_decorator(self, node: Decorator) -> None:\n node.var.type = None\n for expr in node.decorators:\n expr.accept(self)\n if self.recurse_into_functions:\n node.func.accept(self)\n else:\n # Only touch the final status if we re-process\n # the top level, since decorators are processed there.\n node.var.is_final = False\n node.func.is_final = False\n\n def visit_overloaded_func_def(self, node: OverloadedFuncDef) -> None:\n if not self.recurse_into_functions:\n return\n # Revert change made during semantic analysis main pass.\n node.items = node.unanalyzed_items.copy()\n node.impl = None\n node.is_final = False\n super().visit_overloaded_func_def(node)\n\n def visit_assignment_stmt(self, node: AssignmentStmt) -> None:\n node.type = node.unanalyzed_type\n node.is_final_def = False\n node.is_alias_def = False\n if self.type and not self.is_class_body:\n for lvalue in node.lvalues:\n # Revert assignments made via self attributes.\n self.process_lvalue_in_method(lvalue)\n super().visit_assignment_stmt(node)\n\n def visit_import_from(self, node: ImportFrom) -> None:\n node.assignments = []\n\n def visit_import_all(self, node: ImportAll) -> None:\n node.assignments = []\n\n def visit_for_stmt(self, node: ForStmt) -> None:\n node.index_type = node.unanalyzed_index_type\n node.inferred_item_type = None\n node.inferred_iterator_type = None\n super().visit_for_stmt(node)\n\n def visit_name_expr(self, node: NameExpr) -> None:\n self.strip_ref_expr(node)\n\n def visit_member_expr(self, node: MemberExpr) -> None:\n self.strip_ref_expr(node)\n super().visit_member_expr(node)\n\n def visit_index_expr(self, node: IndexExpr) -> None:\n node.analyzed = None # May have been an alias or type application.\n super().visit_index_expr(node)\n\n def strip_ref_expr(self, node: RefExpr) -> None:\n node.kind = None\n node.node = None\n node.fullname = None\n node.is_new_def = False\n node.is_inferred_def = False\n\n def visit_call_expr(self, node: CallExpr) -> None:\n node.analyzed = None\n super().visit_call_expr(node)\n\n def visit_super_expr(self, node: SuperExpr) -> None:\n node.info = None\n super().visit_super_expr(node)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/aststrip.py_NodeStripVisitor.process_lvalue_in_method_NodeStripVisitor.process_lvalue_in_method.if_isinstance_lvalue_Mem.elif_isinstance_lvalue_S.self_process_lvalue_in_me": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/aststrip.py_NodeStripVisitor.process_lvalue_in_method_NodeStripVisitor.process_lvalue_in_method.if_isinstance_lvalue_Mem.elif_isinstance_lvalue_S.self_process_lvalue_in_me", "embedding": null, "metadata": {"file_path": "mypy/server/aststrip.py", "file_name": "aststrip.py", "file_type": "text/x-python", "category": "implementation", "start_line": 213, "end_line": 229, "span_ids": ["NodeStripVisitor.process_lvalue_in_method"], "tokens": 198}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class NodeStripVisitor(TraverserVisitor):\n\n def process_lvalue_in_method(self, lvalue: Node) -> None:\n if isinstance(lvalue, MemberExpr):\n if lvalue.is_new_def:\n # Remove defined attribute from the class symbol table. If is_new_def is\n # true for a MemberExpr, we know that it must be an assignment through\n # self, since only those can define new attributes.\n assert self.type is not None\n if lvalue.name in self.type.names:\n del self.type.names[lvalue.name]\n key = (self.type.defn, lvalue.name)\n if key in self.saved_class_attrs:\n del self.saved_class_attrs[key]\n elif isinstance(lvalue, (TupleExpr, ListExpr)):\n for item in lvalue.items:\n self.process_lvalue_in_method(item)\n elif isinstance(lvalue, StarExpr):\n self.process_lvalue_in_method(lvalue.expr)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/aststrip.py_NodeStripVisitor.enter_class_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/aststrip.py_NodeStripVisitor.enter_class_", "embedding": null, "metadata": {"file_path": "mypy/server/aststrip.py", "file_name": "aststrip.py", "file_type": "text/x-python", "category": "implementation", "start_line": 231, "end_line": 255, "span_ids": ["NodeStripVisitor.enter_method", "NodeStripVisitor.enter_class", "nothing"], "tokens": 176}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class NodeStripVisitor(TraverserVisitor):\n\n @contextlib.contextmanager\n def enter_class(self, info: TypeInfo) -> Iterator[None]:\n old_type = self.type\n old_is_class_body = self.is_class_body\n self.type = info\n self.is_class_body = True\n yield\n self.type = old_type\n self.is_class_body = old_is_class_body\n\n @contextlib.contextmanager\n def enter_method(self, info: TypeInfo) -> Iterator[None]:\n old_type = self.type\n old_is_class_body = self.is_class_body\n self.type = info\n self.is_class_body = False\n yield\n self.type = old_type\n self.is_class_body = old_is_class_body\n\n\n@contextlib.contextmanager\ndef nothing() -> Iterator[None]:\n yield", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py__Generate_fine_grained__from_typing_import_Dict_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py__Generate_fine_grained__from_typing_import_Dict_", "embedding": null, "metadata": {"file_path": "mypy/server/deps.py", "file_name": "deps.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 82, "span_ids": ["imports", "docstring"], "tokens": 894}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Generate fine-grained dependencies for AST nodes, for use in the daemon mode.\n\nDependencies are stored in a map from *triggers* to *sets of affected locations*.\n\nA trigger is a string that represents a program property that has changed, such\nas the signature of a specific function. Triggers are written as '<...>' (angle\nbrackets). When a program property changes, we determine the relevant trigger(s)\nand all affected locations. The latter are stale and will have to be reprocessed.\n\nAn affected location is a string than can refer to a *target* (a non-nested\nfunction or method, or a module top level), a class, or a trigger (for\nrecursively triggering other triggers).\n\nHere's an example representation of a simple dependency map (in format\n\" -> locations\"):\n\n -> m.f\n -> , m.A, m.f\n\nAssuming 'A' is a class, this means that\n\n1) if a property of 'm.A.g', such as the signature, is changed, we need\n to process target (function) 'm.f'\n\n2) if the MRO or other significant property of class 'm.A' changes, we\n need to process target 'm.f', the entire class 'm.A', and locations\n triggered by trigger '' (this explanation is a bit simplified;\n see below for more details).\n\nThe triggers to fire are determined using mypy.server.astdiff.\n\nExamples of triggers:\n\n* '' represents a module attribute/function/class. If any externally\n visible property of 'x' changes, this gets fired. For changes within\n classes, only \"big\" changes cause the class to be triggered (such as a\n change in MRO). Smaller changes, such as changes to some attributes, don't\n trigger the entire class.\n* '' represents the type and kind of attribute/method 'x' of\n class 'mod.Cls'. This can also refer to an attribute inherited from a\n base class (relevant if it's accessed through a value of type 'Cls'\n instead of the base class type).\n* '' represents the existence of module 'package.mod'. This\n gets triggered if 'package.mod' is created or deleted, or if it gets\n changed into something other than a module.\n\nExamples of locations:\n\n* 'mod' is the top level of module 'mod' (doesn't include any function bodies,\n but includes class bodies not nested within a function).\n* 'mod.f' is function 'f' in module 'mod' (module-level variables aren't separate\n locations but are included in the module top level). Functions also include\n any nested functions and classes -- such nested definitions aren't separate\n locations, for simplicity of implementation.\n* 'mod.Cls.f' is method 'f' of 'mod.Cls'. Non-method attributes aren't locations.\n* 'mod.Cls' represents each method in class 'mod.Cls' + the top-level of the\n module 'mod'. (To simplify the implementation, there is no location that only\n includes the body of a class without the entire surrounding module top level.)\n* Trigger '<...>' as a location is an indirect way of referring to to all\n locations triggered by the trigger. These indirect locations keep the\n dependency map smaller and easier to manage.\n\nTriggers can be triggered by program changes such as these:\n\n* Addition or deletion of an attribute (or module).\n* Change of the kind of thing a name represents (such as a change from a function\n to a class).\n* Change of the static type of a name.\n\nChanges in the body of a function that aren't reflected in the signature don't\ncause the function to be triggered. More generally, we trigger only on changes\nthat may affect type checking results outside the module that contains the\nchange.\n\nWe don't generate dependencies from builtins and certain other stdlib modules,\nsince these change very rarely, and they would just increase the size of the\ndependency map significantly without significant benefit.\n\nTest cases for this module live in 'test-data/unit/deps*.test'.\n\"\"\"\n\nfrom typing import Dict, List, Set, Optional, Tuple", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_from_typing_extensions_im_get_dependencies.return.visitor_map": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_from_typing_extensions_im_get_dependencies.return.visitor_map", "embedding": null, "metadata": {"file_path": "mypy/server/deps.py", "file_name": "deps.py", "file_type": "text/x-python", "category": "implementation", "start_line": 83, "end_line": 115, "span_ids": ["imports", "get_dependencies"], "tokens": 416}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from typing_extensions import DefaultDict\n\nfrom mypy.checkmember import bind_self\nfrom mypy.nodes import (\n Node, Expression, MypyFile, FuncDef, ClassDef, AssignmentStmt, NameExpr, MemberExpr, Import,\n ImportFrom, CallExpr, CastExpr, TypeVarExpr, TypeApplication, IndexExpr, UnaryExpr, OpExpr,\n ComparisonExpr, GeneratorExpr, DictionaryComprehension, StarExpr, PrintStmt, ForStmt, WithStmt,\n TupleExpr, OperatorAssignmentStmt, DelStmt, YieldFromExpr, Decorator, Block,\n TypeInfo, FuncBase, OverloadedFuncDef, RefExpr, SuperExpr, Var, NamedTupleExpr, TypedDictExpr,\n LDEF, MDEF, GDEF, TypeAliasExpr, NewTypeExpr, ImportAll, EnumCallExpr, AwaitExpr,\n op_methods, reverse_op_methods, ops_with_inplace_method, unary_op_methods\n)\nfrom mypy.traverser import TraverserVisitor\nfrom mypy.types import (\n Type, Instance, AnyType, NoneType, TypeVisitor, CallableType, DeletedType, PartialType,\n TupleType, TypeType, TypeVarType, TypedDictType, UnboundType, UninhabitedType, UnionType,\n FunctionLike, Overloaded, TypeOfAny, LiteralType, ErasedType, get_proper_type, ProperType,\n TypeAliasType)\nfrom mypy.server.trigger import make_trigger, make_wildcard_trigger\nfrom mypy.util import correct_relative_import\nfrom mypy.scope import Scope\nfrom mypy.typestate import TypeState\nfrom mypy.options import Options\n\n\ndef get_dependencies(target: MypyFile,\n type_map: Dict[Expression, Type],\n python_version: Tuple[int, int],\n options: Options) -> Dict[str, Set[str]]:\n \"\"\"Get all dependencies of a node, recursively.\"\"\"\n visitor = DependencyVisitor(type_map, python_version, target.alias_deps, options)\n target.accept(visitor)\n return visitor.map", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_get_dependencies_of_target_get_dependencies_of_target.return.visitor_map": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_get_dependencies_of_target_get_dependencies_of_target.return.visitor_map", "embedding": null, "metadata": {"file_path": "mypy/server/deps.py", "file_name": "deps.py", "file_type": "text/x-python", "category": "implementation", "start_line": 118, "end_line": 143, "span_ids": ["get_dependencies_of_target"], "tokens": 246}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_dependencies_of_target(module_id: str,\n module_tree: MypyFile,\n target: Node,\n type_map: Dict[Expression, Type],\n python_version: Tuple[int, int]) -> Dict[str, Set[str]]:\n \"\"\"Get dependencies of a target -- don't recursive into nested targets.\"\"\"\n # TODO: Add tests for this function.\n visitor = DependencyVisitor(type_map, python_version, module_tree.alias_deps)\n visitor.scope.enter_file(module_id)\n if isinstance(target, MypyFile):\n # Only get dependencies of the top-level of the module. Don't recurse into\n # functions.\n for defn in target.defs:\n # TODO: Recurse into top-level statements and class bodies but skip functions.\n if not isinstance(defn, (ClassDef, Decorator, FuncDef, OverloadedFuncDef)):\n defn.accept(visitor)\n elif isinstance(target, FuncBase) and target.info:\n # It's a method.\n # TODO: Methods in nested classes.\n visitor.scope.enter_class(target.info)\n target.accept(visitor)\n visitor.scope.leave()\n else:\n target.accept(visitor)\n visitor.scope.leave()\n return visitor.map", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor_DependencyVisitor.visit_mypy_file.self_scope_leave_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor_DependencyVisitor.visit_mypy_file.self_scope_leave_", "embedding": null, "metadata": {"file_path": "mypy/server/deps.py", "file_name": "deps.py", "file_type": "text/x-python", "category": "implementation", "start_line": 146, "end_line": 177, "span_ids": ["DependencyVisitor", "DependencyVisitor.visit_mypy_file", "DependencyVisitor.__init__"], "tokens": 357}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DependencyVisitor(TraverserVisitor):\n def __init__(self,\n type_map: Dict[Expression, Type],\n python_version: Tuple[int, int],\n alias_deps: 'DefaultDict[str, Set[str]]',\n options: Optional[Options] = None) -> None:\n self.scope = Scope()\n self.type_map = type_map\n self.python2 = python_version[0] == 2\n # This attribute holds a mapping from target to names of type aliases\n # it depends on. These need to be processed specially, since they are\n # only present in expanded form in symbol tables. For example, after:\n # A = List[int]\n # x: A\n # The module symbol table will just have a Var `x` with type `List[int]`,\n # and the dependency of `x` on `A` is lost. Therefore the alias dependencies\n # are preserved at alias expansion points in `semanal.py`, stored as an attribute\n # on MypyFile, and then passed here.\n self.alias_deps = alias_deps\n self.map = {} # type: Dict[str, Set[str]]\n self.is_class = False\n self.is_package_init_file = False\n self.options = options\n\n def visit_mypy_file(self, o: MypyFile) -> None:\n self.scope.enter_file(o.fullname)\n self.is_package_init_file = o.is_package_init_file()\n self.add_type_alias_deps(self.scope.current_target())\n for trigger, targets in o.plugin_deps.items():\n self.map.setdefault(trigger, set()).update(targets)\n super().visit_mypy_file(o)\n self.scope.leave()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.visit_func_def_DependencyVisitor.visit_func_def.self_scope_leave_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.visit_func_def_DependencyVisitor.visit_func_def.self_scope_leave_", "embedding": null, "metadata": {"file_path": "mypy/server/deps.py", "file_name": "deps.py", "file_type": "text/x-python", "category": "implementation", "start_line": 179, "end_line": 202, "span_ids": ["DependencyVisitor.visit_func_def"], "tokens": 245}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DependencyVisitor(TraverserVisitor):\n\n def visit_func_def(self, o: FuncDef) -> None:\n self.scope.enter_function(o)\n target = self.scope.current_target()\n if o.type:\n if self.is_class and isinstance(o.type, FunctionLike):\n signature = bind_self(o.type) # type: Type\n else:\n signature = o.type\n for trigger in self.get_type_triggers(signature):\n self.add_dependency(trigger)\n self.add_dependency(trigger, target=make_trigger(target))\n if o.info:\n for base in non_trivial_bases(o.info):\n # Base class __init__/__new__ doesn't generate a logical\n # dependency since the override can be incompatible.\n if not self.use_logical_deps() or o.name not in ('__init__', '__new__'):\n self.add_dependency(make_trigger(base.fullname + '.' + o.name))\n self.add_type_alias_deps(self.scope.current_target())\n super().visit_func_def(o)\n variants = set(o.expanded) - {o}\n for ex in variants:\n if isinstance(ex, FuncDef):\n super().visit_func_def(ex)\n self.scope.leave()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.visit_decorator_DependencyVisitor.visit_decorator.super_visit_decorator_o": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.visit_decorator_DependencyVisitor.visit_decorator.super_visit_decorator_o", "embedding": null, "metadata": {"file_path": "mypy/server/deps.py", "file_name": "deps.py", "file_type": "text/x-python", "category": "implementation", "start_line": 204, "end_line": 227, "span_ids": ["DependencyVisitor.visit_decorator"], "tokens": 294}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DependencyVisitor(TraverserVisitor):\n\n def visit_decorator(self, o: Decorator) -> None:\n if not self.use_logical_deps():\n # We don't need to recheck outer scope for an overload, only overload itself.\n # Also if any decorator is nested, it is not externally visible, so we don't need to\n # generate dependency.\n if not o.func.is_overload and self.scope.current_function_name() is None:\n self.add_dependency(make_trigger(o.func.fullname))\n else:\n # Add logical dependencies from decorators to the function. For example,\n # if we have\n # @dec\n # def func(): ...\n # then if `dec` is unannotated, then it will \"spoil\" `func` and consequently\n # all call sites, making them all `Any`.\n for d in o.decorators:\n tname = None # type: Optional[str]\n if isinstance(d, RefExpr) and d.fullname is not None:\n tname = d.fullname\n if (isinstance(d, CallExpr) and isinstance(d.callee, RefExpr) and\n d.callee.fullname is not None):\n tname = d.callee.fullname\n if tname is not None:\n self.add_dependency(make_trigger(tname), make_trigger(o.func.fullname))\n super().visit_decorator(o)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.visit_class_def_DependencyVisitor.visit_newtype_expr.if_o_info_.self_scope_leave_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.visit_class_def_DependencyVisitor.visit_newtype_expr.if_o_info_.self_scope_leave_", "embedding": null, "metadata": {"file_path": "mypy/server/deps.py", "file_name": "deps.py", "file_type": "text/x-python", "category": "implementation", "start_line": 229, "end_line": 247, "span_ids": ["DependencyVisitor.visit_newtype_expr", "DependencyVisitor.visit_class_def"], "tokens": 172}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DependencyVisitor(TraverserVisitor):\n\n def visit_class_def(self, o: ClassDef) -> None:\n self.scope.enter_class(o.info)\n target = self.scope.current_full_target()\n self.add_dependency(make_trigger(target), target)\n old_is_class = self.is_class\n self.is_class = True\n # Add dependencies to type variables of a generic class.\n for tv in o.type_vars:\n self.add_dependency(make_trigger(tv.fullname), target)\n self.process_type_info(o.info)\n super().visit_class_def(o)\n self.is_class = old_is_class\n self.scope.leave()\n\n def visit_newtype_expr(self, o: NewTypeExpr) -> None:\n if o.info:\n self.scope.enter_class(o.info)\n self.process_type_info(o.info)\n self.scope.leave()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.process_type_info_DependencyVisitor.process_type_info.for_name_node_in_info_na.if_isinstance_node_node_.for_base_info_in_non_triv.self_add_dependency_make_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.process_type_info_DependencyVisitor.process_type_info.for_name_node_in_info_na.if_isinstance_node_node_.for_base_info_in_non_triv.self_add_dependency_make_", "embedding": null, "metadata": {"file_path": "mypy/server/deps.py", "file_name": "deps.py", "file_type": "text/x-python", "category": "implementation", "start_line": 249, "end_line": 286, "span_ids": ["DependencyVisitor.process_type_info"], "tokens": 423}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DependencyVisitor(TraverserVisitor):\n\n def process_type_info(self, info: TypeInfo) -> None:\n target = self.scope.current_full_target()\n for base in info.bases:\n self.add_type_dependencies(base, target=target)\n if info.tuple_type:\n self.add_type_dependencies(info.tuple_type, target=make_trigger(target))\n if info.typeddict_type:\n self.add_type_dependencies(info.typeddict_type, target=make_trigger(target))\n if info.declared_metaclass:\n self.add_type_dependencies(info.declared_metaclass, target=make_trigger(target))\n if info.is_protocol:\n for base_info in info.mro[:-1]:\n # We add dependencies from whole MRO to cover explicit subprotocols.\n # For example:\n #\n # class Super(Protocol):\n # x: int\n # class Sub(Super, Protocol):\n # y: int\n #\n # In this example we add -> , to invalidate Sub if\n # a new member is added to Super.\n self.add_dependency(make_wildcard_trigger(base_info.fullname),\n target=make_trigger(target))\n # More protocol dependencies are collected in TypeState._snapshot_protocol_deps\n # after a full run or update is finished.\n\n self.add_type_alias_deps(self.scope.current_target())\n for name, node in info.names.items():\n if isinstance(node.node, Var):\n # Recheck Liskov if needed, self definitions are checked in the defining method\n if node.node.is_initialized_in_class and has_user_bases(info):\n self.add_dependency(make_trigger(info.fullname + '.' + name))\n for base_info in non_trivial_bases(info):\n # If the type of an attribute changes in a base class, we make references\n # to the attribute in the subclass stale.\n self.add_dependency(make_trigger(base_info.fullname + '.' + name),\n target=make_trigger(info.fullname + '.' + name))\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.process_type_info.for_base_info_in_non_triv_DependencyVisitor.process_type_info.for_base_info_in_non_triv.if_not_self_use_logical_d.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.process_type_info.for_base_info_in_non_triv_DependencyVisitor.process_type_info.for_base_info_in_non_triv.if_not_self_use_logical_d.None_3", "embedding": null, "metadata": {"file_path": "mypy/server/deps.py", "file_name": "deps.py", "file_type": "text/x-python", "category": "implementation", "start_line": 287, "end_line": 322, "span_ids": ["DependencyVisitor.process_type_info"], "tokens": 444}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DependencyVisitor(TraverserVisitor):\n\n def process_type_info(self, info: TypeInfo) -> None:\n # ... other code\n for base_info in non_trivial_bases(info):\n for name, node in base_info.names.items():\n if self.use_logical_deps():\n # Skip logical dependency if an attribute is not overridden. For example,\n # in case of:\n # class Base:\n # x = 1\n # y = 2\n # class Sub(Base):\n # x = 3\n # we skip -> , because even if `y` is unannotated it\n # doesn't affect precision of Liskov checking.\n if name not in info.names:\n continue\n # __init__ and __new__ can be overridden with different signatures, so no\n # logical dependency.\n if name in ('__init__', '__new__'):\n continue\n self.add_dependency(make_trigger(base_info.fullname + '.' + name),\n target=make_trigger(info.fullname + '.' + name))\n if not self.use_logical_deps():\n # These dependencies are only useful for propagating changes --\n # they aren't logical dependencies since __init__ and __new__ can be\n # overridden with a different signature.\n self.add_dependency(make_trigger(base_info.fullname + '.__init__'),\n target=make_trigger(info.fullname + '.__init__'))\n self.add_dependency(make_trigger(base_info.fullname + '.__new__'),\n target=make_trigger(info.fullname + '.__new__'))\n # If the set of abstract attributes change, this may invalidate class\n # instantiation, or change the generated error message, since Python checks\n # class abstract status when creating an instance.\n self.add_dependency(make_trigger(base_info.fullname + '.(abstract)'),\n target=make_trigger(info.fullname + '.__init__'))\n # If the base class abstract attributes change, subclass abstract\n # attributes need to be recalculated.\n self.add_dependency(make_trigger(base_info.fullname + '.(abstract)'))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.visit_import_DependencyVisitor.visit_block.if_not_o_is_unreachable_.super_visit_block_o_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.visit_import_DependencyVisitor.visit_block.if_not_o_is_unreachable_.super_visit_block_o_", "embedding": null, "metadata": {"file_path": "mypy/server/deps.py", "file_name": "deps.py", "file_type": "text/x-python", "category": "implementation", "start_line": 324, "end_line": 351, "span_ids": ["DependencyVisitor.visit_import", "DependencyVisitor.visit_import_all", "DependencyVisitor.visit_import_from", "DependencyVisitor.visit_block"], "tokens": 275}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DependencyVisitor(TraverserVisitor):\n\n def visit_import(self, o: Import) -> None:\n for id, as_id in o.ids:\n self.add_dependency(make_trigger(id), self.scope.current_target())\n\n def visit_import_from(self, o: ImportFrom) -> None:\n if self.use_logical_deps():\n # Just importing a name doesn't create a logical dependency.\n return\n module_id, _ = correct_relative_import(self.scope.current_module_id(),\n o.relative,\n o.id,\n self.is_package_init_file)\n self.add_dependency(make_trigger(module_id)) # needed if module is added/removed\n for name, as_name in o.names:\n self.add_dependency(make_trigger(module_id + '.' + name))\n\n def visit_import_all(self, o: ImportAll) -> None:\n module_id, _ = correct_relative_import(self.scope.current_module_id(),\n o.relative,\n o.id,\n self.is_package_init_file)\n # The current target needs to be rechecked if anything \"significant\" changes in the\n # target module namespace (as the imported definitions will need to be updated).\n self.add_dependency(make_wildcard_trigger(module_id))\n\n def visit_block(self, o: Block) -> None:\n if not o.is_unreachable:\n super().visit_block(o)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.visit_assignment_stmt_DependencyVisitor.visit_assignment_stmt.if_isinstance_rvalue_Cal.else_.if_o_type_.self_add_type_dependencie": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.visit_assignment_stmt_DependencyVisitor.visit_assignment_stmt.if_isinstance_rvalue_Cal.else_.if_o_type_.self_add_type_dependencie", "embedding": null, "metadata": {"file_path": "mypy/server/deps.py", "file_name": "deps.py", "file_type": "text/x-python", "category": "implementation", "start_line": 353, "end_line": 411, "span_ids": ["DependencyVisitor.visit_assignment_stmt"], "tokens": 698}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DependencyVisitor(TraverserVisitor):\n\n def visit_assignment_stmt(self, o: AssignmentStmt) -> None:\n rvalue = o.rvalue\n if isinstance(rvalue, CallExpr) and isinstance(rvalue.analyzed, TypeVarExpr):\n analyzed = rvalue.analyzed\n self.add_type_dependencies(analyzed.upper_bound,\n target=make_trigger(analyzed.fullname))\n for val in analyzed.values:\n self.add_type_dependencies(val, target=make_trigger(analyzed.fullname))\n # We need to re-analyze the definition if bound or value is deleted.\n super().visit_call_expr(rvalue)\n elif isinstance(rvalue, CallExpr) and isinstance(rvalue.analyzed, NamedTupleExpr):\n # Depend on types of named tuple items.\n info = rvalue.analyzed.info\n prefix = '%s.%s' % (self.scope.current_full_target(), info.name)\n for name, symnode in info.names.items():\n if not name.startswith('_') and isinstance(symnode.node, Var):\n typ = symnode.node.type\n if typ:\n self.add_type_dependencies(typ)\n self.add_type_dependencies(typ, target=make_trigger(prefix))\n attr_target = make_trigger('%s.%s' % (prefix, name))\n self.add_type_dependencies(typ, target=attr_target)\n elif isinstance(rvalue, CallExpr) and isinstance(rvalue.analyzed, TypedDictExpr):\n # Depend on the underlying typeddict type\n info = rvalue.analyzed.info\n assert info.typeddict_type is not None\n prefix = '%s.%s' % (self.scope.current_full_target(), info.name)\n self.add_type_dependencies(info.typeddict_type, target=make_trigger(prefix))\n elif isinstance(rvalue, CallExpr) and isinstance(rvalue.analyzed, EnumCallExpr):\n # Enum values are currently not checked, but for future we add the deps on them\n for name, symnode in rvalue.analyzed.info.names.items():\n if isinstance(symnode.node, Var) and symnode.node.type:\n self.add_type_dependencies(symnode.node.type)\n elif o.is_alias_def:\n assert len(o.lvalues) == 1\n lvalue = o.lvalues[0]\n assert isinstance(lvalue, NameExpr)\n typ = get_proper_type(self.type_map.get(lvalue))\n if isinstance(typ, FunctionLike) and typ.is_type_obj():\n class_name = typ.type_object().fullname\n self.add_dependency(make_trigger(class_name + '.__init__'))\n self.add_dependency(make_trigger(class_name + '.__new__'))\n if isinstance(rvalue, IndexExpr) and isinstance(rvalue.analyzed, TypeAliasExpr):\n self.add_type_dependencies(rvalue.analyzed.type)\n elif typ:\n self.add_type_dependencies(typ)\n else:\n # Normal assignment\n super().visit_assignment_stmt(o)\n for lvalue in o.lvalues:\n self.process_lvalue(lvalue)\n items = o.lvalues + [rvalue]\n for i in range(len(items) - 1):\n lvalue = items[i]\n rvalue = items[i + 1]\n if isinstance(lvalue, TupleExpr):\n self.add_attribute_dependency_for_expr(rvalue, '__iter__')\n if o.type:\n self.add_type_dependencies(o.type)\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.visit_assignment_stmt.if_self_use_logical_deps__DependencyVisitor.visit_assignment_stmt.if_self_use_logical_deps_.if_isinstance_rvalue_Ca.for_lv_in_o_lvalues_.if_isinstance_lv_RefExpr.self_add_dependency_make_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.visit_assignment_stmt.if_self_use_logical_deps__DependencyVisitor.visit_assignment_stmt.if_self_use_logical_deps_.if_isinstance_rvalue_Ca.for_lv_in_o_lvalues_.if_isinstance_lv_RefExpr.self_add_dependency_make_", "embedding": null, "metadata": {"file_path": "mypy/server/deps.py", "file_name": "deps.py", "file_type": "text/x-python", "category": "implementation", "start_line": 412, "end_line": 433, "span_ids": ["DependencyVisitor.visit_assignment_stmt"], "tokens": 289}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DependencyVisitor(TraverserVisitor):\n\n def visit_assignment_stmt(self, o: AssignmentStmt) -> None:\n # ... other code\n if self.use_logical_deps() and o.unanalyzed_type is None:\n # Special case: for definitions without an explicit type like this:\n # x = func(...)\n # we add a logical dependency -> , because if `func` is not annotated,\n # then it will make all points of use of `x` unchecked.\n if (isinstance(rvalue, CallExpr) and isinstance(rvalue.callee, RefExpr)\n and rvalue.callee.fullname is not None):\n fname = None # type: Optional[str]\n if isinstance(rvalue.callee.node, TypeInfo):\n # use actual __init__ as a dependency source\n init = rvalue.callee.node.get('__init__')\n if init and isinstance(init.node, FuncBase):\n fname = init.node.fullname\n else:\n fname = rvalue.callee.fullname\n if fname is None:\n return\n for lv in o.lvalues:\n if isinstance(lv, RefExpr) and lv.fullname and lv.is_new_def:\n if lv.kind == LDEF:\n return # local definitions don't generate logical deps\n self.add_dependency(make_trigger(fname), make_trigger(lv.fullname))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.process_lvalue_DependencyVisitor.process_lvalue.if_isinstance_lvalue_Ind.elif_isinstance_lvalue_S.self_process_lvalue_lvalu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.process_lvalue_DependencyVisitor.process_lvalue.if_isinstance_lvalue_Ind.elif_isinstance_lvalue_S.self_process_lvalue_lvalu", "embedding": null, "metadata": {"file_path": "mypy/server/deps.py", "file_name": "deps.py", "file_type": "text/x-python", "category": "implementation", "start_line": 435, "end_line": 472, "span_ids": ["DependencyVisitor.process_lvalue"], "tokens": 418}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DependencyVisitor(TraverserVisitor):\n\n def process_lvalue(self, lvalue: Expression) -> None:\n \"\"\"Generate additional dependencies for an lvalue.\"\"\"\n if isinstance(lvalue, IndexExpr):\n self.add_operator_method_dependency(lvalue.base, '__setitem__')\n elif isinstance(lvalue, NameExpr):\n if lvalue.kind in (MDEF, GDEF):\n # Assignment to an attribute in the class body, or direct assignment to a\n # global variable.\n lvalue_type = self.get_non_partial_lvalue_type(lvalue)\n type_triggers = self.get_type_triggers(lvalue_type)\n attr_trigger = make_trigger('%s.%s' % (self.scope.current_full_target(),\n lvalue.name))\n for type_trigger in type_triggers:\n self.add_dependency(type_trigger, attr_trigger)\n elif isinstance(lvalue, MemberExpr):\n if self.is_self_member_ref(lvalue) and lvalue.is_new_def:\n node = lvalue.node\n if isinstance(node, Var):\n info = node.info\n if info and has_user_bases(info):\n # Recheck Liskov for self definitions\n self.add_dependency(make_trigger(info.fullname + '.' + lvalue.name))\n if lvalue.kind is None:\n # Reference to a non-module attribute\n if lvalue.expr not in self.type_map:\n # Unreachable assignment -> not checked so no dependencies to generate.\n return\n object_type = self.type_map[lvalue.expr]\n lvalue_type = self.get_non_partial_lvalue_type(lvalue)\n type_triggers = self.get_type_triggers(lvalue_type)\n for attr_trigger in self.attribute_triggers(object_type, lvalue.name):\n for type_trigger in type_triggers:\n self.add_dependency(type_trigger, attr_trigger)\n elif isinstance(lvalue, TupleExpr):\n for item in lvalue.items:\n self.process_lvalue(item)\n elif isinstance(lvalue, StarExpr):\n self.process_lvalue(lvalue.expr)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.is_self_member_ref_DependencyVisitor.get_non_partial_lvalue_type.return.lvalue_type": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.is_self_member_ref_DependencyVisitor.get_non_partial_lvalue_type.return.lvalue_type", "embedding": null, "metadata": {"file_path": "mypy/server/deps.py", "file_name": "deps.py", "file_type": "text/x-python", "category": "implementation", "start_line": 474, "end_line": 497, "span_ids": ["DependencyVisitor.is_self_member_ref", "DependencyVisitor.get_non_partial_lvalue_type"], "tokens": 268}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DependencyVisitor(TraverserVisitor):\n\n def is_self_member_ref(self, memberexpr: MemberExpr) -> bool:\n \"\"\"Does memberexpr to refer to an attribute of self?\"\"\"\n if not isinstance(memberexpr.expr, NameExpr):\n return False\n node = memberexpr.expr.node\n return isinstance(node, Var) and node.is_self\n\n def get_non_partial_lvalue_type(self, lvalue: RefExpr) -> Type:\n if lvalue not in self.type_map:\n # Likely a block considered unreachable during type checking.\n return UninhabitedType()\n lvalue_type = get_proper_type(self.type_map[lvalue])\n if isinstance(lvalue_type, PartialType):\n if isinstance(lvalue.node, Var) and lvalue.node.type:\n lvalue_type = get_proper_type(lvalue.node.type)\n else:\n # Probably a secondary, non-definition assignment that doesn't\n # result in a non-partial type. We won't be able to infer any\n # dependencies from this so just return something. (The first,\n # definition assignment with a partial type is handled\n # differently, in the semantic analyzer.)\n assert not lvalue.is_new_def\n return UninhabitedType()\n return lvalue_type", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.visit_operator_assignment_stmt_DependencyVisitor.visit_for_stmt.if_o_index_type_.self_add_type_dependencie": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.visit_operator_assignment_stmt_DependencyVisitor.visit_for_stmt.if_o_index_type_.self_add_type_dependencie", "embedding": null, "metadata": {"file_path": "mypy/server/deps.py", "file_name": "deps.py", "file_type": "text/x-python", "category": "implementation", "start_line": 499, "end_line": 535, "span_ids": ["DependencyVisitor.visit_for_stmt", "DependencyVisitor.visit_operator_assignment_stmt"], "tokens": 360}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DependencyVisitor(TraverserVisitor):\n\n def visit_operator_assignment_stmt(self, o: OperatorAssignmentStmt) -> None:\n super().visit_operator_assignment_stmt(o)\n self.process_lvalue(o.lvalue)\n method = op_methods[o.op]\n self.add_attribute_dependency_for_expr(o.lvalue, method)\n if o.op in ops_with_inplace_method:\n inplace_method = '__i' + method[2:]\n self.add_attribute_dependency_for_expr(o.lvalue, inplace_method)\n\n def visit_for_stmt(self, o: ForStmt) -> None:\n super().visit_for_stmt(o)\n if not o.is_async:\n # __getitem__ is only used if __iter__ is missing but for simplicity we\n # just always depend on both.\n self.add_attribute_dependency_for_expr(o.expr, '__iter__')\n self.add_attribute_dependency_for_expr(o.expr, '__getitem__')\n if o.inferred_iterator_type:\n if self.python2:\n method = 'next'\n else:\n method = '__next__'\n self.add_attribute_dependency(o.inferred_iterator_type, method)\n else:\n self.add_attribute_dependency_for_expr(o.expr, '__aiter__')\n if o.inferred_iterator_type:\n self.add_attribute_dependency(o.inferred_iterator_type, '__anext__')\n\n self.process_lvalue(o.index)\n if isinstance(o.index, TupleExpr):\n # Process multiple assignment to index variables.\n item_type = o.inferred_item_type\n if item_type:\n # This is similar to above.\n self.add_attribute_dependency(item_type, '__iter__')\n self.add_attribute_dependency(item_type, '__getitem__')\n if o.index_type:\n self.add_type_dependencies(o.index_type)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.visit_with_stmt_DependencyVisitor._Expressions": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.visit_with_stmt_DependencyVisitor._Expressions", "embedding": null, "metadata": {"file_path": "mypy/server/deps.py", "file_name": "deps.py", "file_type": "text/x-python", "category": "implementation", "start_line": 537, "end_line": 559, "span_ids": ["DependencyVisitor.visit_del_stmt", "DependencyVisitor.visit_print_stmt", "DependencyVisitor.visit_with_stmt"], "tokens": 212}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DependencyVisitor(TraverserVisitor):\n\n def visit_with_stmt(self, o: WithStmt) -> None:\n super().visit_with_stmt(o)\n for e in o.expr:\n if not o.is_async:\n self.add_attribute_dependency_for_expr(e, '__enter__')\n self.add_attribute_dependency_for_expr(e, '__exit__')\n else:\n self.add_attribute_dependency_for_expr(e, '__aenter__')\n self.add_attribute_dependency_for_expr(e, '__aexit__')\n for typ in o.analyzed_types:\n self.add_type_dependencies(typ)\n\n def visit_print_stmt(self, o: PrintStmt) -> None:\n super().visit_print_stmt(o)\n if o.target:\n self.add_attribute_dependency_for_expr(o.target, 'write')\n\n def visit_del_stmt(self, o: DelStmt) -> None:\n super().visit_del_stmt(o)\n if isinstance(o.expr, IndexExpr):\n self.add_attribute_dependency_for_expr(o.expr.base, '__delitem__')\n\n # Expressions", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.process_global_ref_expr_DependencyVisitor.visit_name_expr.self_process_global_ref_e": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.process_global_ref_expr_DependencyVisitor.visit_name_expr.self_process_global_ref_e", "embedding": null, "metadata": {"file_path": "mypy/server/deps.py", "file_name": "deps.py", "file_type": "text/x-python", "category": "implementation", "start_line": 561, "end_line": 584, "span_ids": ["DependencyVisitor.visit_name_expr", "DependencyVisitor.process_global_ref_expr"], "tokens": 250}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DependencyVisitor(TraverserVisitor):\n\n def process_global_ref_expr(self, o: RefExpr) -> None:\n if o.fullname is not None:\n self.add_dependency(make_trigger(o.fullname))\n\n # If this is a reference to a type, generate a dependency to its\n # constructor.\n # IDEA: Avoid generating spurious dependencies for except statements,\n # class attribute references, etc., if performance is a problem.\n typ = get_proper_type(self.type_map.get(o))\n if isinstance(typ, FunctionLike) and typ.is_type_obj():\n class_name = typ.type_object().fullname\n self.add_dependency(make_trigger(class_name + '.__init__'))\n self.add_dependency(make_trigger(class_name + '.__new__'))\n\n def visit_name_expr(self, o: NameExpr) -> None:\n if o.kind == LDEF:\n # We don't track dependencies to local variables, since they\n # aren't externally visible.\n return\n if o.kind == MDEF:\n # Direct reference to member is only possible in the scope that\n # defined the name, so no dependency is required.\n return\n self.process_global_ref_expr(o)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.visit_member_expr_DependencyVisitor.visit_member_expr.if_e_kind_is_not_None_.else_.if_self_use_logical_deps_.if_name_is_not_None_.self_add_dependency_make_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.visit_member_expr_DependencyVisitor.visit_member_expr.if_e_kind_is_not_None_.else_.if_self_use_logical_deps_.if_name_is_not_None_.self_add_dependency_make_", "embedding": null, "metadata": {"file_path": "mypy/server/deps.py", "file_name": "deps.py", "file_type": "text/x-python", "category": "implementation", "start_line": 586, "end_line": 617, "span_ids": ["DependencyVisitor.visit_member_expr"], "tokens": 351}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DependencyVisitor(TraverserVisitor):\n\n def visit_member_expr(self, e: MemberExpr) -> None:\n if isinstance(e.expr, RefExpr) and isinstance(e.expr.node, TypeInfo):\n # Special case class attribute so that we don't depend on \"__init__\".\n self.add_dependency(make_trigger(e.expr.node.fullname))\n else:\n super().visit_member_expr(e)\n if e.kind is not None:\n # Reference to a module attribute\n self.process_global_ref_expr(e)\n else:\n # Reference to a non-module (or missing) attribute\n if e.expr not in self.type_map:\n # No type available -- this happens for unreachable code. Since it's unreachable,\n # it wasn't type checked and we don't need to generate dependencies.\n return\n if isinstance(e.expr, RefExpr) and isinstance(e.expr.node, MypyFile):\n # Special case: reference to a missing module attribute.\n self.add_dependency(make_trigger(e.expr.node.fullname + '.' + e.name))\n return\n typ = get_proper_type(self.type_map[e.expr])\n self.add_attribute_dependency(typ, e.name)\n if self.use_logical_deps() and isinstance(typ, AnyType):\n name = self.get_unimported_fullname(e, typ)\n if name is not None:\n # Generate a logical dependency from an unimported\n # definition (which comes from a missing module).\n # Example:\n # import missing # \"missing\" not in build\n #\n # def g() -> None:\n # missing.f() # Generate dependency from \"missing.f\"\n self.add_dependency(make_trigger(name))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.get_unimported_fullname_DependencyVisitor.get_unimported_fullname.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.get_unimported_fullname_DependencyVisitor.get_unimported_fullname.return.None", "embedding": null, "metadata": {"file_path": "mypy/server/deps.py", "file_name": "deps.py", "file_type": "text/x-python", "category": "implementation", "start_line": 619, "end_line": 643, "span_ids": ["DependencyVisitor.get_unimported_fullname"], "tokens": 313}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DependencyVisitor(TraverserVisitor):\n\n def get_unimported_fullname(self, e: MemberExpr, typ: AnyType) -> Optional[str]:\n \"\"\"If e refers to an unimported definition, infer the fullname of this.\n\n Return None if e doesn't refer to an unimported definition or if we can't\n determine the name.\n \"\"\"\n suffix = ''\n # Unwrap nested member expression to handle cases like \"a.b.c.d\" where\n # \"a.b\" is a known reference to an unimported module. Find the base\n # reference to an unimported module (such as \"a.b\") and the name suffix\n # (such as \"c.d\") needed to build a full name.\n while typ.type_of_any == TypeOfAny.from_another_any and isinstance(e.expr, MemberExpr):\n suffix = '.' + e.name + suffix\n e = e.expr\n if e.expr not in self.type_map:\n return None\n obj_type = get_proper_type(self.type_map[e.expr])\n if not isinstance(obj_type, AnyType):\n # Can't find the base reference to the unimported module.\n return None\n typ = obj_type\n if typ.type_of_any == TypeOfAny.from_unimported_type and typ.missing_import_name:\n # Infer the full name of the unimported definition.\n return typ.missing_import_name + '.' + e.name + suffix\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.visit_super_expr_DependencyVisitor.visit_call_expr.if_isinstance_e_callee_R.else_.if_typ_is_not_None_.if_not_isinstance_typ_Fu.self_add_attribute_depend": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.visit_super_expr_DependencyVisitor.visit_call_expr.if_isinstance_e_callee_R.else_.if_typ_is_not_None_.if_not_isinstance_typ_Fu.self_add_attribute_depend", "embedding": null, "metadata": {"file_path": "mypy/server/deps.py", "file_name": "deps.py", "file_type": "text/x-python", "category": "implementation", "start_line": 645, "end_line": 668, "span_ids": ["DependencyVisitor.visit_super_expr", "DependencyVisitor.visit_call_expr"], "tokens": 251}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DependencyVisitor(TraverserVisitor):\n\n def visit_super_expr(self, e: SuperExpr) -> None:\n # Arguments in \"super(C, self)\" won't generate useful logical deps.\n if not self.use_logical_deps():\n super().visit_super_expr(e)\n if e.info is not None:\n name = e.name\n for base in non_trivial_bases(e.info):\n self.add_dependency(make_trigger(base.fullname + '.' + name))\n if name in base.names:\n # No need to depend on further base classes, since we found\n # the target. This is safe since if the target gets\n # deleted or modified, we'll trigger it.\n break\n\n def visit_call_expr(self, e: CallExpr) -> None:\n if isinstance(e.callee, RefExpr) and e.callee.fullname == 'builtins.isinstance':\n self.process_isinstance_call(e)\n else:\n super().visit_call_expr(e)\n typ = self.type_map.get(e.callee)\n if typ is not None:\n typ = get_proper_type(typ)\n if not isinstance(typ, FunctionLike):\n self.add_attribute_dependency(typ, '__call__')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.process_isinstance_call_DependencyVisitor.process_isinstance_call.super_visit_call_expr_e": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.process_isinstance_call_DependencyVisitor.process_isinstance_call.super_visit_call_expr_e", "embedding": null, "metadata": {"file_path": "mypy/server/deps.py", "file_name": "deps.py", "file_type": "text/x-python", "category": "implementation", "start_line": 670, "end_line": 683, "span_ids": ["DependencyVisitor.process_isinstance_call"], "tokens": 152}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DependencyVisitor(TraverserVisitor):\n\n def process_isinstance_call(self, e: CallExpr) -> None:\n \"\"\"Process \"isinstance(...)\" in a way to avoid some extra dependencies.\"\"\"\n if len(e.args) == 2:\n arg = e.args[1]\n if (isinstance(arg, RefExpr)\n and arg.kind == GDEF\n and isinstance(arg.node, TypeInfo)\n and arg.fullname):\n # Special case to avoid redundant dependencies from \"__init__\".\n self.add_dependency(make_trigger(arg.fullname))\n return\n # In uncommon cases generate normal dependencies. These will include\n # spurious dependencies, but the performance impact is small.\n super().visit_call_expr(e)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.visit_cast_expr_DependencyVisitor.visit_op_expr.self_process_binary_op_e_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.visit_cast_expr_DependencyVisitor.visit_op_expr.self_process_binary_op_e_", "embedding": null, "metadata": {"file_path": "mypy/server/deps.py", "file_name": "deps.py", "file_type": "text/x-python", "category": "implementation", "start_line": 685, "end_line": 707, "span_ids": ["DependencyVisitor.visit_op_expr", "DependencyVisitor.visit_type_application", "DependencyVisitor.visit_cast_expr", "DependencyVisitor.visit_unary_expr", "DependencyVisitor.visit_index_expr"], "tokens": 208}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DependencyVisitor(TraverserVisitor):\n\n def visit_cast_expr(self, e: CastExpr) -> None:\n super().visit_cast_expr(e)\n self.add_type_dependencies(e.type)\n\n def visit_type_application(self, e: TypeApplication) -> None:\n super().visit_type_application(e)\n for typ in e.types:\n self.add_type_dependencies(typ)\n\n def visit_index_expr(self, e: IndexExpr) -> None:\n super().visit_index_expr(e)\n self.add_operator_method_dependency(e.base, '__getitem__')\n\n def visit_unary_expr(self, e: UnaryExpr) -> None:\n super().visit_unary_expr(e)\n if e.op not in unary_op_methods:\n return\n method = unary_op_methods[e.op]\n self.add_operator_method_dependency(e.expr, method)\n\n def visit_op_expr(self, e: OpExpr) -> None:\n super().visit_op_expr(e)\n self.process_binary_op(e.op, e.left, e.right)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.visit_comparison_expr_DependencyVisitor.visit_comparison_expr.for_i_op_in_enumerate_e_.if_self_python2_and_op_in.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.visit_comparison_expr_DependencyVisitor.visit_comparison_expr.for_i_op_in_enumerate_e_.if_self_python2_and_op_in.None_1", "embedding": null, "metadata": {"file_path": "mypy/server/deps.py", "file_name": "deps.py", "file_type": "text/x-python", "category": "implementation", "start_line": 709, "end_line": 717, "span_ids": ["DependencyVisitor.visit_comparison_expr"], "tokens": 120}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DependencyVisitor(TraverserVisitor):\n\n def visit_comparison_expr(self, e: ComparisonExpr) -> None:\n super().visit_comparison_expr(e)\n for i, op in enumerate(e.operators):\n left = e.operands[i]\n right = e.operands[i + 1]\n self.process_binary_op(op, left, right)\n if self.python2 and op in ('==', '!=', '<', '<=', '>', '>='):\n self.add_operator_method_dependency(left, '__cmp__')\n self.add_operator_method_dependency(right, '__cmp__')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.process_binary_op_DependencyVisitor.add_operator_method_dependency.if_typ_is_not_None_.self_add_operator_method_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.process_binary_op_DependencyVisitor.add_operator_method_dependency.if_typ_is_not_None_.self_add_operator_method_", "embedding": null, "metadata": {"file_path": "mypy/server/deps.py", "file_name": "deps.py", "file_type": "text/x-python", "category": "implementation", "start_line": 719, "end_line": 733, "span_ids": ["DependencyVisitor.add_operator_method_dependency", "DependencyVisitor.process_binary_op"], "tokens": 150}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DependencyVisitor(TraverserVisitor):\n\n def process_binary_op(self, op: str, left: Expression, right: Expression) -> None:\n method = op_methods.get(op)\n if method:\n if op == 'in':\n self.add_operator_method_dependency(right, method)\n else:\n self.add_operator_method_dependency(left, method)\n rev_method = reverse_op_methods.get(method)\n if rev_method:\n self.add_operator_method_dependency(right, rev_method)\n\n def add_operator_method_dependency(self, e: Expression, method: str) -> None:\n typ = get_proper_type(self.type_map.get(e))\n if typ is not None:\n self.add_operator_method_dependency_for_type(typ, method)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.add_operator_method_dependency_for_type_DependencyVisitor.add_operator_method_dependency_for_type.if_isinstance_typ_Instan.elif_isinstance_typ_Type.if_isinstance_typ_item_I.self_add_operator_method_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.add_operator_method_dependency_for_type_DependencyVisitor.add_operator_method_dependency_for_type.if_isinstance_typ_Instan.elif_isinstance_typ_Type.if_isinstance_typ_item_I.self_add_operator_method_", "embedding": null, "metadata": {"file_path": "mypy/server/deps.py", "file_name": "deps.py", "file_type": "text/x-python", "category": "implementation", "start_line": 735, "end_line": 752, "span_ids": ["DependencyVisitor.add_operator_method_dependency_for_type"], "tokens": 233}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DependencyVisitor(TraverserVisitor):\n\n def add_operator_method_dependency_for_type(self, typ: ProperType, method: str) -> None:\n # Note that operator methods can't be (non-metaclass) methods of type objects\n # (that is, TypeType objects or Callables representing a type).\n if isinstance(typ, TypeVarType):\n typ = get_proper_type(typ.upper_bound)\n if isinstance(typ, TupleType):\n typ = typ.partial_fallback\n if isinstance(typ, Instance):\n trigger = make_trigger(typ.type.fullname + '.' + method)\n self.add_dependency(trigger)\n elif isinstance(typ, UnionType):\n for item in typ.items:\n self.add_operator_method_dependency_for_type(get_proper_type(item), method)\n elif isinstance(typ, FunctionLike) and typ.is_type_obj():\n self.add_operator_method_dependency_for_type(typ.fallback, method)\n elif isinstance(typ, TypeType):\n if isinstance(typ.item, Instance) and typ.item.type.metaclass_type is not None:\n self.add_operator_method_dependency_for_type(typ.item.type.metaclass_type, method)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.visit_generator_expr_DependencyVisitor.add_type_alias_deps.if_target_in_self_alias_d.for_alias_in_self_alias_d.self_add_dependency_make_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.visit_generator_expr_DependencyVisitor.add_type_alias_deps.if_target_in_self_alias_d.for_alias_in_self_alias_d.self_add_dependency_make_", "embedding": null, "metadata": {"file_path": "mypy/server/deps.py", "file_name": "deps.py", "file_type": "text/x-python", "category": "implementation", "start_line": 754, "end_line": 783, "span_ids": ["DependencyVisitor.visit_yield_from_expr", "DependencyVisitor.visit_generator_expr", "DependencyVisitor.add_type_alias_deps", "DependencyVisitor.visit_dictionary_comprehension", "DependencyVisitor.visit_await_expr", "DependencyVisitor.visit_star_expr"], "tokens": 266}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DependencyVisitor(TraverserVisitor):\n\n def visit_generator_expr(self, e: GeneratorExpr) -> None:\n super().visit_generator_expr(e)\n for seq in e.sequences:\n self.add_iter_dependency(seq)\n\n def visit_dictionary_comprehension(self, e: DictionaryComprehension) -> None:\n super().visit_dictionary_comprehension(e)\n for seq in e.sequences:\n self.add_iter_dependency(seq)\n\n def visit_star_expr(self, e: StarExpr) -> None:\n super().visit_star_expr(e)\n self.add_iter_dependency(e.expr)\n\n def visit_yield_from_expr(self, e: YieldFromExpr) -> None:\n super().visit_yield_from_expr(e)\n self.add_iter_dependency(e.expr)\n\n def visit_await_expr(self, e: AwaitExpr) -> None:\n super().visit_await_expr(e)\n self.add_attribute_dependency_for_expr(e.expr, '__await__')\n\n # Helpers\n\n def add_type_alias_deps(self, target: str) -> None:\n # Type aliases are special, because some of the dependencies are calculated\n # in semanal.py, before they are expanded.\n if target in self.alias_deps:\n for alias in self.alias_deps[target]:\n self.add_dependency(make_trigger(alias))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.add_dependency_DependencyVisitor.add_dependency.self_map_setdefault_trigg": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.add_dependency_DependencyVisitor.add_dependency.self_map_setdefault_trigg", "embedding": null, "metadata": {"file_path": "mypy/server/deps.py", "file_name": "deps.py", "file_type": "text/x-python", "category": "implementation", "start_line": 785, "end_line": 799, "span_ids": ["DependencyVisitor.add_dependency"], "tokens": 154}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DependencyVisitor(TraverserVisitor):\n\n def add_dependency(self, trigger: str, target: Optional[str] = None) -> None:\n \"\"\"Add dependency from trigger to a target.\n\n If the target is not given explicitly, use the current target.\n \"\"\"\n if trigger.startswith((' None:\n \"\"\"Add dependencies to all components of a type.\n\n Args:\n target: If not None, override the default (current) target of the\n generated dependency.\n \"\"\"\n for trigger in self.get_type_triggers(typ):\n self.add_dependency(trigger, target)\n\n def add_attribute_dependency(self, typ: Type, name: str) -> None:\n \"\"\"Add dependencies for accessing a named attribute of a type.\"\"\"\n targets = self.attribute_triggers(typ, name)\n for target in targets:\n self.add_dependency(target)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.attribute_triggers_DependencyVisitor.attribute_triggers.if_isinstance_typ_Instan.else_.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.attribute_triggers_DependencyVisitor.attribute_triggers.if_isinstance_typ_Instan.else_.return._", "embedding": null, "metadata": {"file_path": "mypy/server/deps.py", "file_name": "deps.py", "file_type": "text/x-python", "category": "implementation", "start_line": 817, "end_line": 845, "span_ids": ["DependencyVisitor.attribute_triggers"], "tokens": 283}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DependencyVisitor(TraverserVisitor):\n\n def attribute_triggers(self, typ: Type, name: str) -> List[str]:\n \"\"\"Return all triggers associated with the attribute of a type.\"\"\"\n typ = get_proper_type(typ)\n if isinstance(typ, TypeVarType):\n typ = get_proper_type(typ.upper_bound)\n if isinstance(typ, TupleType):\n typ = typ.partial_fallback\n if isinstance(typ, Instance):\n member = '%s.%s' % (typ.type.fullname, name)\n return [make_trigger(member)]\n elif isinstance(typ, FunctionLike) and typ.is_type_obj():\n member = '%s.%s' % (typ.type_object().fullname, name)\n triggers = [make_trigger(member)]\n triggers.extend(self.attribute_triggers(typ.fallback, name))\n return triggers\n elif isinstance(typ, UnionType):\n targets = []\n for item in typ.items:\n targets.extend(self.attribute_triggers(item, name))\n return targets\n elif isinstance(typ, TypeType):\n triggers = self.attribute_triggers(typ.item, name)\n if isinstance(typ.item, Instance) and typ.item.type.metaclass_type is not None:\n triggers.append(make_trigger('%s.%s' %\n (typ.item.type.metaclass_type.type.fullname,\n name)))\n return triggers\n else:\n return []", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.add_attribute_dependency_for_expr_get_type_triggers.return.typ_accept_TypeTriggersVi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_DependencyVisitor.add_attribute_dependency_for_expr_get_type_triggers.return.typ_accept_TypeTriggersVi", "embedding": null, "metadata": {"file_path": "mypy/server/deps.py", "file_name": "deps.py", "file_type": "text/x-python", "category": "implementation", "start_line": 847, "end_line": 866, "span_ids": ["get_type_triggers", "DependencyVisitor.get_type_triggers", "DependencyVisitor.add_attribute_dependency_for_expr", "DependencyVisitor.use_logical_deps", "DependencyVisitor.add_iter_dependency"], "tokens": 188}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DependencyVisitor(TraverserVisitor):\n\n def add_attribute_dependency_for_expr(self, e: Expression, name: str) -> None:\n typ = self.type_map.get(e)\n if typ is not None:\n self.add_attribute_dependency(typ, name)\n\n def add_iter_dependency(self, node: Expression) -> None:\n typ = self.type_map.get(node)\n if typ:\n self.add_attribute_dependency(typ, '__iter__')\n\n def use_logical_deps(self) -> bool:\n return self.options is not None and self.options.logical_deps\n\n def get_type_triggers(self, typ: Type) -> List[str]:\n return get_type_triggers(typ, self.use_logical_deps())\n\n\ndef get_type_triggers(typ: Type, use_logical_deps: bool) -> List[str]:\n \"\"\"Return all triggers that correspond to a type becoming stale.\"\"\"\n return typ.accept(TypeTriggersVisitor(use_logical_deps))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_TypeTriggersVisitor_TypeTriggersVisitor.visit_instance.return.triggers": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_TypeTriggersVisitor_TypeTriggersVisitor.visit_instance.return.triggers", "embedding": null, "metadata": {"file_path": "mypy/server/deps.py", "file_name": "deps.py", "file_type": "text/x-python", "category": "implementation", "start_line": 869, "end_line": 884, "span_ids": ["TypeTriggersVisitor", "TypeTriggersVisitor.__init__", "TypeTriggersVisitor.get_type_triggers", "TypeTriggersVisitor.visit_instance"], "tokens": 149}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeTriggersVisitor(TypeVisitor[List[str]]):\n def __init__(self, use_logical_deps: bool) -> None:\n self.deps = [] # type: List[str]\n self.use_logical_deps = use_logical_deps\n\n def get_type_triggers(self, typ: Type) -> List[str]:\n return get_type_triggers(typ, self.use_logical_deps)\n\n def visit_instance(self, typ: Instance) -> List[str]:\n trigger = make_trigger(typ.type.fullname)\n triggers = [trigger]\n for arg in typ.args:\n triggers.extend(self.get_type_triggers(arg))\n if typ.last_known_value:\n triggers.extend(self.get_type_triggers(typ.last_known_value))\n return triggers", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_TypeTriggersVisitor.visit_type_alias_type_TypeTriggersVisitor.visit_type_alias_type.return.triggers": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_TypeTriggersVisitor.visit_type_alias_type_TypeTriggersVisitor.visit_type_alias_type.return.triggers", "embedding": null, "metadata": {"file_path": "mypy/server/deps.py", "file_name": "deps.py", "file_type": "text/x-python", "category": "implementation", "start_line": 886, "end_line": 896, "span_ids": ["TypeTriggersVisitor.visit_type_alias_type"], "tokens": 130}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeTriggersVisitor(TypeVisitor[List[str]]):\n\n def visit_type_alias_type(self, typ: TypeAliasType) -> List[str]:\n assert typ.alias is not None\n trigger = make_trigger(typ.alias.fullname)\n triggers = [trigger]\n for arg in typ.args:\n triggers.extend(self.get_type_triggers(arg))\n # TODO: Add guard for infinite recursion here. Moreover, now that type aliases\n # are its own kind of types we can simplify the logic to rely on intermediate\n # dependencies (like for instance types).\n triggers.extend(self.get_type_triggers(typ.alias.target))\n return triggers", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_TypeTriggersVisitor.visit_any_TypeTriggersVisitor.visit_union_type.return.triggers": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_TypeTriggersVisitor.visit_any_TypeTriggersVisitor.visit_union_type.return.triggers", "embedding": null, "metadata": {"file_path": "mypy/server/deps.py", "file_name": "deps.py", "file_type": "text/x-python", "category": "implementation", "start_line": 898, "end_line": 977, "span_ids": ["TypeTriggersVisitor.visit_typeddict_type", "TypeTriggersVisitor.visit_uninhabited_type", "TypeTriggersVisitor.visit_unbound_type", "TypeTriggersVisitor.visit_partial_type", "TypeTriggersVisitor.visit_deleted_type", "TypeTriggersVisitor.visit_none_type", "TypeTriggersVisitor.visit_any", "TypeTriggersVisitor.visit_tuple_type", "TypeTriggersVisitor.visit_literal_type", "TypeTriggersVisitor.visit_callable_type", "TypeTriggersVisitor.visit_overloaded", "TypeTriggersVisitor.visit_type_var", "TypeTriggersVisitor.visit_erased_type", "TypeTriggersVisitor.visit_union_type", "TypeTriggersVisitor.visit_type_type"], "tokens": 655}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeTriggersVisitor(TypeVisitor[List[str]]):\n\n def visit_any(self, typ: AnyType) -> List[str]:\n if typ.missing_import_name is not None:\n return [make_trigger(typ.missing_import_name)]\n return []\n\n def visit_none_type(self, typ: NoneType) -> List[str]:\n return []\n\n def visit_callable_type(self, typ: CallableType) -> List[str]:\n triggers = []\n for arg in typ.arg_types:\n triggers.extend(self.get_type_triggers(arg))\n triggers.extend(self.get_type_triggers(typ.ret_type))\n # fallback is a metaclass type for class objects, and is\n # processed separately.\n return triggers\n\n def visit_overloaded(self, typ: Overloaded) -> List[str]:\n triggers = []\n for item in typ.items():\n triggers.extend(self.get_type_triggers(item))\n return triggers\n\n def visit_erased_type(self, t: ErasedType) -> List[str]:\n # This type should exist only temporarily during type inference\n assert False, \"Should not see an erased type here\"\n\n def visit_deleted_type(self, typ: DeletedType) -> List[str]:\n return []\n\n def visit_partial_type(self, typ: PartialType) -> List[str]:\n assert False, \"Should not see a partial type here\"\n\n def visit_tuple_type(self, typ: TupleType) -> List[str]:\n triggers = []\n for item in typ.items:\n triggers.extend(self.get_type_triggers(item))\n triggers.extend(self.get_type_triggers(typ.partial_fallback))\n return triggers\n\n def visit_type_type(self, typ: TypeType) -> List[str]:\n triggers = self.get_type_triggers(typ.item)\n if not self.use_logical_deps:\n old_triggers = triggers[:]\n for trigger in old_triggers:\n triggers.append(trigger.rstrip('>') + '.__init__>')\n triggers.append(trigger.rstrip('>') + '.__new__>')\n return triggers\n\n def visit_type_var(self, typ: TypeVarType) -> List[str]:\n triggers = []\n if typ.fullname:\n triggers.append(make_trigger(typ.fullname))\n if typ.upper_bound:\n triggers.extend(self.get_type_triggers(typ.upper_bound))\n for val in typ.values:\n triggers.extend(self.get_type_triggers(val))\n return triggers\n\n def visit_typeddict_type(self, typ: TypedDictType) -> List[str]:\n triggers = []\n for item in typ.items.values():\n triggers.extend(self.get_type_triggers(item))\n triggers.extend(self.get_type_triggers(typ.fallback))\n return triggers\n\n def visit_literal_type(self, typ: LiteralType) -> List[str]:\n return self.get_type_triggers(typ.fallback)\n\n def visit_unbound_type(self, typ: UnboundType) -> List[str]:\n return []\n\n def visit_uninhabited_type(self, typ: UninhabitedType) -> List[str]:\n return []\n\n def visit_union_type(self, typ: UnionType) -> List[str]:\n triggers = []\n for item in typ.items:\n triggers.extend(self.get_type_triggers(item))\n return triggers", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_merge_dependencies_has_user_bases.return.any_base_module_name_not_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_merge_dependencies_has_user_bases.return.any_base_module_name_not_", "embedding": null, "metadata": {"file_path": "mypy/server/deps.py", "file_name": "deps.py", "file_type": "text/x-python", "category": "implementation", "start_line": 980, "end_line": 992, "span_ids": ["non_trivial_bases", "has_user_bases", "merge_dependencies"], "tokens": 120}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def merge_dependencies(new_deps: Dict[str, Set[str]],\n deps: Dict[str, Set[str]]) -> None:\n for trigger, targets in new_deps.items():\n deps.setdefault(trigger, set()).update(targets)\n\n\ndef non_trivial_bases(info: TypeInfo) -> List[TypeInfo]:\n return [base for base in info.mro[1:]\n if base.fullname != 'builtins.object']\n\n\ndef has_user_bases(info: TypeInfo) -> bool:\n return any(base.module_name not in ('builtins', 'typing', 'enum') for base in info.mro[1:])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_dump_all_dependencies_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/deps.py_dump_all_dependencies_", "embedding": null, "metadata": {"file_path": "mypy/server/deps.py", "file_name": "deps.py", "file_type": "text/x-python", "category": "implementation", "start_line": 995, "end_line": 1016, "span_ids": ["dump_all_dependencies"], "tokens": 209}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def dump_all_dependencies(modules: Dict[str, MypyFile],\n type_map: Dict[Expression, Type],\n python_version: Tuple[int, int],\n options: Options) -> None:\n \"\"\"Generate dependencies for all interesting modules and print them to stdout.\"\"\"\n all_deps = {} # type: Dict[str, Set[str]]\n for id, node in modules.items():\n # Uncomment for debugging:\n # print('processing', id)\n if id in ('builtins', 'typing') or '/typeshed/' in node.path:\n continue\n assert id == node.fullname\n deps = get_dependencies(node, type_map, python_version, options)\n for trigger, targets in deps.items():\n all_deps.setdefault(trigger, set()).update(targets)\n TypeState.add_all_protocol_deps(all_deps)\n\n for trigger, targets in sorted(all_deps.items(), key=lambda x: x[0]):\n print(trigger)\n for target in sorted(targets):\n print(' %s' % target)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/mergecheck.py__Check_for_duplicate_AS_check_consistency.for_sym_in_syms_.assert_sym_fullname_not_i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/mergecheck.py__Check_for_duplicate_AS_check_consistency.for_sym_in_syms_.assert_sym_fullname_not_i", "embedding": null, "metadata": {"file_path": "mypy/server/mergecheck.py", "file_name": "mergecheck.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 64, "span_ids": ["check_consistency", "docstring"], "tokens": 513}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Check for duplicate AST nodes after merge.\"\"\"\n\nfrom typing import Dict, List, Tuple\nfrom typing_extensions import Final\n\nfrom mypy.nodes import FakeInfo, SymbolNode, Var, Decorator, FuncDef\nfrom mypy.server.objgraph import get_reachable_graph, get_path\n\n# If True, print more verbose output on failure.\nDUMP_MISMATCH_NODES = False # type: Final\n\n\ndef check_consistency(o: object) -> None:\n \"\"\"Fail if there are two AST nodes with the same fullname reachable from 'o'.\n\n Raise AssertionError on failure and print some debugging output.\n \"\"\"\n seen, parents = get_reachable_graph(o)\n reachable = list(seen.values())\n syms = [x for x in reachable if isinstance(x, SymbolNode)]\n\n m = {} # type: Dict[str, SymbolNode]\n for sym in syms:\n if isinstance(sym, FakeInfo):\n continue\n\n fn = sym.fullname\n # Skip None names, since they are ambiguous.\n # TODO: Everything should have a proper full name?\n if fn is None:\n continue\n # Skip stuff that should be expected to have duplicate names\n if isinstance(sym, (Var, Decorator)):\n continue\n if isinstance(sym, FuncDef) and sym.is_overload:\n continue\n\n if fn not in m:\n m[sym.fullname] = sym\n continue\n\n # We have trouble and need to decide what to do about it.\n sym1, sym2 = sym, m[fn]\n\n # If the type changed, then it shouldn't have been merged.\n if type(sym1) is not type(sym2):\n continue\n\n path1 = get_path(sym1, seen, parents)\n path2 = get_path(sym2, seen, parents)\n\n if fn in m:\n print('\\nDuplicate %r nodes with fullname %r found:' % (type(sym).__name__, fn))\n print('[1] %d: %s' % (id(sym1), path_to_str(path1)))\n print('[2] %d: %s' % (id(sym2), path_to_str(path2)))\n\n if DUMP_MISMATCH_NODES and fn in m:\n # Add verbose output with full AST node contents.\n print('---')\n print(id(sym1), sym1)\n print('---')\n print(id(sym2), sym2)\n\n assert sym.fullname not in m", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/mergecheck.py_path_to_str_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/mergecheck.py_path_to_str_", "embedding": null, "metadata": {"file_path": "mypy/server/mergecheck.py", "file_name": "mergecheck.py", "file_type": "text/x-python", "category": "implementation", "start_line": 67, "end_line": 83, "span_ids": ["path_to_str"], "tokens": 170}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def path_to_str(path: List[Tuple[object, object]]) -> str:\n result = ''\n for attr, obj in path:\n t = type(obj).__name__\n if t in ('dict', 'tuple', 'SymbolTable', 'list'):\n result += '[%s]' % repr(attr)\n else:\n if isinstance(obj, Var):\n result += '.%s(%s:%s)' % (attr, t, obj.name)\n elif t in ('BuildManager', 'FineGrainedBuildManager'):\n # Omit class name for some classes that aren't part of a class\n # hierarchy since there isn't much ambiguity.\n result += '.%s' % attr\n else:\n result += '.%s(%s)' % (attr, t)\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/objgraph.py__Find_all_objects_reach_isproperty.return.isinstance_getattr_type_o": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/objgraph.py__Find_all_objects_reach_isproperty.return.isinstance_getattr_type_o", "embedding": null, "metadata": {"file_path": "mypy/server/objgraph.py", "file_name": "objgraph.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 53, "span_ids": ["isproperty", "docstring"], "tokens": 297}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Find all objects reachable from a root object.\"\"\"\n\nfrom collections.abc import Iterable\nimport weakref\nimport types\n\nfrom typing import List, Dict, Iterator, Tuple, Mapping\nfrom typing_extensions import Final\n\nmethod_descriptor_type = type(object.__dir__) # type: Final\nmethod_wrapper_type = type(object().__ne__) # type: Final\nwrapper_descriptor_type = type(object.__ne__) # type: Final\n\nFUNCTION_TYPES = (types.BuiltinFunctionType,\n types.FunctionType,\n types.MethodType,\n method_descriptor_type,\n wrapper_descriptor_type,\n method_wrapper_type) # type: Final\n\nATTR_BLACKLIST = {\n '__doc__',\n '__name__',\n '__class__',\n '__dict__',\n} # type: Final\n\n# Instances of these types can't have references to other objects\nATOMIC_TYPE_BLACKLIST = {\n bool,\n int,\n float,\n str,\n type(None),\n object,\n} # type: Final\n\n# Don't look at most attributes of these types\nCOLLECTION_TYPE_BLACKLIST = {\n list,\n set,\n dict,\n tuple,\n} # type: Final\n\n# Don't return these objects\nTYPE_BLACKLIST = {\n weakref.ReferenceType,\n} # type: Final\n\n\ndef isproperty(o: object, attr: str) -> bool:\n return isinstance(getattr(type(o), attr, None), property)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/objgraph.py_get_edge_candidates_get_edge_candidates.if_isinstance_o_Mapping_.elif_isinstance_o_Iterab.for_i_e_in_enumerate_o_.yield_i_e": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/objgraph.py_get_edge_candidates_get_edge_candidates.if_isinstance_o_Mapping_.elif_isinstance_o_Iterab.for_i_e_in_enumerate_o_.yield_i_e", "embedding": null, "metadata": {"file_path": "mypy/server/objgraph.py", "file_name": "objgraph.py", "file_type": "text/x-python", "category": "implementation", "start_line": 56, "end_line": 74, "span_ids": ["get_edge_candidates"], "tokens": 183}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_edge_candidates(o: object) -> Iterator[Tuple[object, object]]:\n # use getattr because mypyc expects dict, not mappingproxy\n if '__getattribute__' in getattr(type(o), '__dict__'): # noqa\n return\n if type(o) not in COLLECTION_TYPE_BLACKLIST:\n for attr in dir(o):\n try:\n if attr not in ATTR_BLACKLIST and hasattr(o, attr) and not isproperty(o, attr):\n e = getattr(o, attr)\n if not type(e) in ATOMIC_TYPE_BLACKLIST:\n yield attr, e\n except AssertionError:\n pass\n if isinstance(o, Mapping):\n for k, v in o.items():\n yield k, v\n elif isinstance(o, Iterable) and not isinstance(o, str):\n for i, e in enumerate(o):\n yield i, e", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/objgraph.py_get_edges_get_edges.for_s_e_in_get_edge_cand.if_isinstance_e_FUNCTIO.else_.if_not_type_e_in_TYPE_BL.yield_s_e": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/objgraph.py_get_edges_get_edges.for_s_e_in_get_edge_cand.if_isinstance_e_FUNCTIO.else_.if_not_type_e_in_TYPE_BL.yield_s_e", "embedding": null, "metadata": {"file_path": "mypy/server/objgraph.py", "file_name": "objgraph.py", "file_type": "text/x-python", "category": "implementation", "start_line": 77, "end_line": 91, "span_ids": ["get_edges"], "tokens": 168}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_edges(o: object) -> Iterator[Tuple[object, object]]:\n for s, e in get_edge_candidates(o):\n if (isinstance(e, FUNCTION_TYPES)):\n # We don't want to collect methods, but do want to collect values\n # in closures and self pointers to other objects\n\n if hasattr(e, '__closure__'):\n yield (s, '__closure__'), e.__closure__ # type: ignore\n if hasattr(e, '__self__'):\n se = e.__self__ # type: ignore\n if se is not o and se is not type(o) and hasattr(s, '__self__'):\n yield s.__self__, se # type: ignore\n else:\n if not type(e) in TYPE_BLACKLIST:\n yield s, e", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/objgraph.py_get_reachable_graph_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/objgraph.py_get_reachable_graph_", "embedding": null, "metadata": {"file_path": "mypy/server/objgraph.py", "file_name": "objgraph.py", "file_type": "text/x-python", "category": "implementation", "start_line": 94, "end_line": 121, "span_ids": ["get_path", "get_reachable_graph"], "tokens": 190}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_reachable_graph(root: object) -> Tuple[Dict[int, object],\n Dict[int, Tuple[int, object]]]:\n parents = {}\n seen = {id(root): root}\n worklist = [root]\n while worklist:\n o = worklist.pop()\n for s, e in get_edges(o):\n if id(e) in seen:\n continue\n parents[id(e)] = (id(o), s)\n seen[id(e)] = e\n worklist.append(e)\n\n return seen, parents\n\n\ndef get_path(o: object,\n seen: Dict[int, object],\n parents: Dict[int, Tuple[int, object]]) -> List[Tuple[object, object]]:\n path = []\n while id(o) in parents:\n pid, attr = parents[id(o)]\n o = seen[pid]\n path.append((attr, o))\n path.reverse()\n return path", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/subexpr.py__Find_all_subexpression_get_subexpressions.return.visitor_expressions": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/subexpr.py__Find_all_subexpression_get_subexpressions.return.visitor_expressions", "embedding": null, "metadata": {"file_path": "mypy/server/subexpr.py", "file_name": "subexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 18, "span_ids": ["get_subexpressions", "docstring"], "tokens": 162}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Find all subexpressions of an AST node.\"\"\"\n\nfrom typing import List\n\nfrom mypy.nodes import (\n Expression, Node, MemberExpr, YieldFromExpr, YieldExpr, CallExpr, OpExpr, ComparisonExpr,\n SliceExpr, CastExpr, RevealExpr, UnaryExpr, ListExpr, TupleExpr, DictExpr, SetExpr,\n IndexExpr, GeneratorExpr, ListComprehension, SetComprehension, DictionaryComprehension,\n ConditionalExpr, TypeApplication, LambdaExpr, StarExpr, BackquoteExpr, AwaitExpr,\n AssignmentExpr,\n)\nfrom mypy.traverser import TraverserVisitor\n\n\ndef get_subexpressions(node: Node) -> List[Expression]:\n visitor = SubexpressionFinder()\n node.accept(visitor)\n return visitor.expressions", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/subexpr.py_SubexpressionFinder_SubexpressionFinder.visit_generator_expr.super_visit_generator_e": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/subexpr.py_SubexpressionFinder_SubexpressionFinder.visit_generator_expr.super_visit_generator_e", "embedding": null, "metadata": {"file_path": "mypy/server/subexpr.py", "file_name": "subexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 21, "end_line": 136, "span_ids": ["SubexpressionFinder.visit__promote_expr", "SubexpressionFinder.visit_call_expr", "SubexpressionFinder.visit_assignment_expr", "SubexpressionFinder.visit_namedtuple_expr", "SubexpressionFinder.visit_complex_expr", "SubexpressionFinder.visit_tuple_expr", "SubexpressionFinder.visit_super_expr", "SubexpressionFinder.visit_unicode_expr", "SubexpressionFinder.visit_name_expr", "SubexpressionFinder.visit_list_expr", "SubexpressionFinder.visit_cast_expr", "SubexpressionFinder.visit_reveal_expr", "SubexpressionFinder.visit_int_expr", "SubexpressionFinder.visit_str_expr", "SubexpressionFinder.visit_typeddict_expr", "SubexpressionFinder.visit_type_alias_expr", "SubexpressionFinder.visit_ellipsis", "SubexpressionFinder.visit_yield_from_expr", "SubexpressionFinder", "SubexpressionFinder.visit_member_expr", "SubexpressionFinder.visit_slice_expr", "SubexpressionFinder.visit_dict_expr", "SubexpressionFinder.visit_generator_expr", "SubexpressionFinder.visit_type_var_expr", "SubexpressionFinder.visit_bytes_expr", "SubexpressionFinder.visit_yield_expr", "SubexpressionFinder.visit_index_expr", "SubexpressionFinder.visit_op_expr", "SubexpressionFinder.visit_set_expr", "SubexpressionFinder.__init__", "SubexpressionFinder.visit_float_expr", "SubexpressionFinder.visit_newtype_expr", "SubexpressionFinder.visit_comparison_expr", "SubexpressionFinder.visit_unary_expr"], "tokens": 811}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SubexpressionFinder(TraverserVisitor):\n def __init__(self) -> None:\n self.expressions = [] # type: List[Expression]\n\n def visit_int_expr(self, o: Expression) -> None:\n self.add(o)\n\n def visit_name_expr(self, o: Expression) -> None:\n self.add(o)\n\n def visit_float_expr(self, o: Expression) -> None:\n self.add(o)\n\n def visit_str_expr(self, o: Expression) -> None:\n self.add(o)\n\n def visit_bytes_expr(self, o: Expression) -> None:\n self.add(o)\n\n def visit_unicode_expr(self, o: Expression) -> None:\n self.add(o)\n\n def visit_complex_expr(self, o: Expression) -> None:\n self.add(o)\n\n def visit_ellipsis(self, o: Expression) -> None:\n self.add(o)\n\n def visit_super_expr(self, o: Expression) -> None:\n self.add(o)\n\n def visit_type_var_expr(self, o: Expression) -> None:\n self.add(o)\n\n def visit_type_alias_expr(self, o: Expression) -> None:\n self.add(o)\n\n def visit_namedtuple_expr(self, o: Expression) -> None:\n self.add(o)\n\n def visit_typeddict_expr(self, o: Expression) -> None:\n self.add(o)\n\n def visit__promote_expr(self, o: Expression) -> None:\n self.add(o)\n\n def visit_newtype_expr(self, o: Expression) -> None:\n self.add(o)\n\n def visit_member_expr(self, e: MemberExpr) -> None:\n self.add(e)\n super().visit_member_expr(e)\n\n def visit_yield_from_expr(self, e: YieldFromExpr) -> None:\n self.add(e)\n super().visit_yield_from_expr(e)\n\n def visit_yield_expr(self, e: YieldExpr) -> None:\n self.add(e)\n super().visit_yield_expr(e)\n\n def visit_call_expr(self, e: CallExpr) -> None:\n self.add(e)\n super().visit_call_expr(e)\n\n def visit_op_expr(self, e: OpExpr) -> None:\n self.add(e)\n super().visit_op_expr(e)\n\n def visit_comparison_expr(self, e: ComparisonExpr) -> None:\n self.add(e)\n super().visit_comparison_expr(e)\n\n def visit_slice_expr(self, e: SliceExpr) -> None:\n self.add(e)\n super().visit_slice_expr(e)\n\n def visit_cast_expr(self, e: CastExpr) -> None:\n self.add(e)\n super().visit_cast_expr(e)\n\n def visit_reveal_expr(self, e: RevealExpr) -> None:\n self.add(e)\n super().visit_reveal_expr(e)\n\n def visit_assignment_expr(self, e: AssignmentExpr) -> None:\n self.add(e)\n super().visit_assignment_expr(e)\n\n def visit_unary_expr(self, e: UnaryExpr) -> None:\n self.add(e)\n super().visit_unary_expr(e)\n\n def visit_list_expr(self, e: ListExpr) -> None:\n self.add(e)\n super().visit_list_expr(e)\n\n def visit_tuple_expr(self, e: TupleExpr) -> None:\n self.add(e)\n super().visit_tuple_expr(e)\n\n def visit_dict_expr(self, e: DictExpr) -> None:\n self.add(e)\n super().visit_dict_expr(e)\n\n def visit_set_expr(self, e: SetExpr) -> None:\n self.add(e)\n super().visit_set_expr(e)\n\n def visit_index_expr(self, e: IndexExpr) -> None:\n self.add(e)\n super().visit_index_expr(e)\n\n def visit_generator_expr(self, e: GeneratorExpr) -> None:\n self.add(e)\n super().visit_generator_expr(e)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/subexpr.py_SubexpressionFinder.visit_dictionary_comprehension_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/subexpr.py_SubexpressionFinder.visit_dictionary_comprehension_", "embedding": null, "metadata": {"file_path": "mypy/server/subexpr.py", "file_name": "subexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 138, "end_line": 176, "span_ids": ["SubexpressionFinder.visit_star_expr", "SubexpressionFinder.visit_backquote_expr", "SubexpressionFinder.visit_type_application", "SubexpressionFinder.add", "SubexpressionFinder.visit_conditional_expr", "SubexpressionFinder.visit_dictionary_comprehension", "SubexpressionFinder.visit_lambda_expr", "SubexpressionFinder.visit_list_comprehension", "SubexpressionFinder.visit_await_expr", "SubexpressionFinder.visit_set_comprehension"], "tokens": 306}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SubexpressionFinder(TraverserVisitor):\n\n def visit_dictionary_comprehension(self, e: DictionaryComprehension) -> None:\n self.add(e)\n super().visit_dictionary_comprehension(e)\n\n def visit_list_comprehension(self, e: ListComprehension) -> None:\n self.add(e)\n super().visit_list_comprehension(e)\n\n def visit_set_comprehension(self, e: SetComprehension) -> None:\n self.add(e)\n super().visit_set_comprehension(e)\n\n def visit_conditional_expr(self, e: ConditionalExpr) -> None:\n self.add(e)\n super().visit_conditional_expr(e)\n\n def visit_type_application(self, e: TypeApplication) -> None:\n self.add(e)\n super().visit_type_application(e)\n\n def visit_lambda_expr(self, e: LambdaExpr) -> None:\n self.add(e)\n super().visit_lambda_expr(e)\n\n def visit_star_expr(self, e: StarExpr) -> None:\n self.add(e)\n super().visit_star_expr(e)\n\n def visit_backquote_expr(self, e: BackquoteExpr) -> None:\n self.add(e)\n super().visit_backquote_expr(e)\n\n def visit_await_expr(self, e: AwaitExpr) -> None:\n self.add(e)\n super().visit_await_expr(e)\n\n def add(self, e: Expression) -> None:\n self.expressions.append(e)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/target.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/target.py__", "embedding": null, "metadata": {"file_path": "mypy/server/target.py", "file_name": "target.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 9, "span_ids": ["trigger_to_target"], "tokens": 77}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def trigger_to_target(s: str) -> str:\n assert s[0] == '<'\n # Strip off the angle brackets\n s = s[1:-1]\n # If there is a [wildcard] or similar, strip that off too\n if s[-1] == ']':\n s = s.split('[')[0]\n return s", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/trigger.py__AST_triggers_that_are__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/trigger.py__AST_triggers_that_are__", "embedding": null, "metadata": {"file_path": "mypy/server/trigger.py", "file_name": "trigger.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 25, "span_ids": ["make_wildcard_trigger", "make_trigger", "docstring"], "tokens": 186}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"AST triggers that are used for fine-grained dependency handling.\"\"\"\n\nfrom typing_extensions import Final\n\n# Used as a suffix for triggers to handle \"from m import *\" dependencies (see also\n# make_wildcard_trigger)\n\nWILDCARD_TAG = '[wildcard]' # type: Final\n\n\ndef make_trigger(name: str) -> str:\n return '<%s>' % name\n\n\ndef make_wildcard_trigger(module: str) -> str:\n \"\"\"Special trigger fired when any top-level name is changed in a module.\n\n Note that this is different from a module trigger, as module triggers are only\n fired if the module is created, deleted, or replaced with a non-module, whereas\n a wildcard trigger is triggered for namespace changes.\n\n This is used for \"from m import *\" dependencies.\n \"\"\"\n return '<%s%s>' % (module, WILDCARD_TAG)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py__Update_build_by_proces_os": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py__Update_build_by_proces_os", "embedding": null, "metadata": {"file_path": "mypy/server/update.py", "file_name": "update.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 115, "span_ids": ["imports", "docstring"], "tokens": 1116}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Update build by processing changes using fine-grained dependencies.\n\nUse fine-grained dependencies to update targets in other modules that\nmay be affected by externally-visible changes in the changed modules.\n\nThis forms the core of the fine-grained incremental daemon mode. This\nmodule is not used at all by the 'classic' (non-daemon) incremental\nmode.\n\nHere is some motivation for this mode:\n\n* By keeping program state in memory between incremental runs, we\n only have to process changed modules, not their dependencies. The\n classic incremental mode has to deserialize the symbol tables of\n all dependencies of changed modules, which can be slow for large\n programs.\n\n* Fine-grained dependencies allow processing only the relevant parts\n of modules indirectly affected by a change. Say, if only one function\n in a large module is affected by a change in another module, only this\n function is processed. The classic incremental mode always processes\n an entire file as a unit, which is typically much slower.\n\n* It's possible to independently process individual modules within an\n import cycle (SCC). Small incremental changes can be fast independent\n of the size of the related SCC. In classic incremental mode, any change\n within a SCC requires the entire SCC to be processed, which can slow\n things down considerably.\n\nSome terms:\n\n* A *target* is a function/method definition or the top level of a module.\n We refer to targets using their fully qualified name (e.g.\n 'mod.Cls.method'). Targets are the smallest units of processing during\n fine-grained incremental checking.\n\n* A *trigger* represents the properties of a part of a program, and it\n gets triggered/fired when these properties change. For example,\n '' refers to a module-level function. It gets triggered if\n the signature of the function changes, or if the function is removed,\n for example.\n\nSome program state is maintained across multiple build increments in\nmemory:\n\n* The full ASTs of all modules are stored in memory all the time (this\n includes the type map).\n\n* A fine-grained dependency map is maintained, which maps triggers to\n affected program locations (these can be targets, triggers, or\n classes). The latter determine what other parts of a program need to\n be processed again due to a fired trigger.\n\nHere's a summary of how a fine-grained incremental program update happens:\n\n* Determine which modules have changes in their source code since the\n previous update.\n\n* Process changed modules one at a time. Perform a separate full update\n for each changed module, but only report the errors after all modules\n have been processed, since the intermediate states can generate bogus\n errors due to only seeing a partial set of changes.\n\n* Each changed module is processed in full. We parse the module, and\n run semantic analysis to create a new AST and symbol table for the\n module. Reuse the existing ASTs and symbol tables of modules that\n have no changes in their source code. At the end of this stage, we have\n two ASTs and symbol tables for the changed module (the old and the new\n versions). The latter AST has not yet been type checked.\n\n* Take a snapshot of the old symbol table. This is used later to determine\n which properties of the module have changed and which triggers to fire.\n\n* Merge the old AST with the new AST, preserving the identities of\n externally visible AST nodes for which we can find a corresponding node\n in the new AST. (Look at mypy.server.astmerge for the details.) This\n way all external references to AST nodes in the changed module will\n continue to point to the right nodes (assuming they still have a valid\n target).\n\n* Type check the new module.\n\n* Take another snapshot of the symbol table of the changed module.\n Look at the differences between the old and new snapshots to determine\n which parts of the changed modules have changed. The result is a set of\n fired triggers.\n\n* Using the dependency map and the fired triggers, decide which other\n targets have become stale and need to be reprocessed.\n\n* Create new fine-grained dependencies for the changed module. We don't\n garbage collect old dependencies, since extra dependencies are relatively\n harmless (they take some memory and can theoretically slow things down\n a bit by causing redundant work). This is implemented in\n mypy.server.deps.\n\n* Strip the stale AST nodes that we found above. This returns them to a\n state resembling the end of semantic analysis pass 1. We'll run semantic\n analysis again on the existing AST nodes, and since semantic analysis\n is not idempotent, we need to revert some changes made during semantic\n analysis. This is implemented in mypy.server.aststrip.\n\n* Run semantic analyzer passes 2 and 3 on the stale AST nodes, and type\n check them. We also need to do the symbol table snapshot comparison\n dance to find any changes, and we need to merge ASTs to preserve AST node\n identities.\n\n* If some triggers haven been fired, continue processing and repeat the\n previous steps until no triggers are fired.\n\nThis is module is tested using end-to-end fine-grained incremental mode\ntest cases (test-data/unit/fine-grained*.test).\n\"\"\"\n\nimport os", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_sys_SENSITIVE_INTERNAL_MODULES.tuple_core_modules_m": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_sys_SENSITIVE_INTERNAL_MODULES.tuple_core_modules_m", "embedding": null, "metadata": {"file_path": "mypy/server/update.py", "file_name": "update.py", "file_type": "text/x-python", "category": "implementation", "start_line": 116, "end_line": 153, "span_ids": ["imports"], "tokens": 319}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import sys\nimport time\nfrom typing import (\n Dict, List, Set, Tuple, Union, Optional, NamedTuple, Sequence, Callable\n)\nfrom typing_extensions import Final\n\nfrom mypy.build import (\n BuildManager, State, BuildResult, Graph, load_graph,\n process_fresh_modules, DEBUG_FINE_GRAINED,\n FAKE_ROOT_MODULE,\n)\nfrom mypy.modulefinder import BuildSource\nfrom mypy.checker import FineGrainedDeferredNode\nfrom mypy.errors import CompileError\nfrom mypy.nodes import (\n MypyFile, FuncDef, TypeInfo, SymbolNode, Decorator,\n OverloadedFuncDef, SymbolTable, ImportFrom\n)\nfrom mypy.options import Options\nfrom mypy.fscache import FileSystemCache\nfrom mypy.server.astdiff import (\n snapshot_symbol_table, compare_symbol_table_snapshots, SnapshotItem\n)\nfrom mypy.semanal_main import (\n semantic_analysis_for_scc, semantic_analysis_for_targets, core_modules\n)\nfrom mypy.server.astmerge import merge_asts\nfrom mypy.server.aststrip import strip_target, SavedAttributes\nfrom mypy.server.deps import get_dependencies_of_target, merge_dependencies\nfrom mypy.server.target import trigger_to_target\nfrom mypy.server.trigger import make_trigger, WILDCARD_TAG\nfrom mypy.util import module_prefix, split_target\nfrom mypy.typestate import TypeState\n\nMAX_ITER = 1000 # type: Final\n\nSENSITIVE_INTERNAL_MODULES = tuple(core_modules) + (\"mypy_extensions\", \"typing_extensions\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_FineGrainedBuildManager_FineGrainedBuildManager.__init__.None_16": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_FineGrainedBuildManager_FineGrainedBuildManager.__init__.None_16", "embedding": null, "metadata": {"file_path": "mypy/server/update.py", "file_name": "update.py", "file_type": "text/x-python", "category": "implementation", "start_line": 156, "end_line": 191, "span_ids": ["FineGrainedBuildManager.__init__", "FineGrainedBuildManager"], "tokens": 404}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FineGrainedBuildManager:\n def __init__(self, result: BuildResult) -> None:\n \"\"\"Initialize fine-grained build based on a batch build.\n\n Args:\n result: Result from the initialized build.\n The manager and graph will be taken over by this class.\n manager: State of the build (mutated by this class)\n graph: Additional state of the build (mutated by this class)\n \"\"\"\n manager = result.manager\n self.manager = manager\n self.graph = result.graph\n self.previous_modules = get_module_to_path_map(self.graph)\n self.deps = manager.fg_deps\n # Merge in any root dependencies that may not have been loaded\n merge_dependencies(manager.load_fine_grained_deps(FAKE_ROOT_MODULE), self.deps)\n self.previous_targets_with_errors = manager.errors.targets()\n self.previous_messages = result.errors[:]\n # Module, if any, that had blocking errors in the last run as (id, path) tuple.\n self.blocking_error = None # type: Optional[Tuple[str, str]]\n # Module that we haven't processed yet but that are known to be stale.\n self.stale = [] # type: List[Tuple[str, str]]\n # Disable the cache so that load_graph doesn't try going back to disk\n # for the cache.\n self.manager.cache_enabled = False\n\n # Some hints to the test suite about what is going on:\n # Active triggers during the last update\n self.triggered = [] # type: List[str]\n # Modules passed to update during the last update\n self.changed_modules = [] # type: List[Tuple[str, str]]\n # Modules processed during the last update\n self.updated_modules = [] # type: List[str]\n # Targets processed during last update (for testing only).\n self.processed_targets = [] # type: List[str]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_FineGrainedBuildManager.update_FineGrainedBuildManager.update.return.messages": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_FineGrainedBuildManager.update_FineGrainedBuildManager.update.return.messages", "embedding": null, "metadata": {"file_path": "mypy/server/update.py", "file_name": "update.py", "file_type": "text/x-python", "category": "implementation", "start_line": 193, "end_line": 275, "span_ids": ["FineGrainedBuildManager.update"], "tokens": 761}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FineGrainedBuildManager:\n\n def update(self,\n changed_modules: List[Tuple[str, str]],\n removed_modules: List[Tuple[str, str]]) -> List[str]:\n \"\"\"Update previous build result by processing changed modules.\n\n Also propagate changes to other modules as needed, but only process\n those parts of other modules that are affected by the changes. Retain\n the existing ASTs and symbol tables of unaffected modules.\n\n Reuses original BuildManager and Graph.\n\n Args:\n changed_modules: Modules changed since the previous update/build; each is\n a (module id, path) tuple. Includes modified and added modules.\n Assume this is correct; it's not validated here.\n removed_modules: Modules that have been deleted since the previous update\n or removed from the build.\n\n Returns:\n A list of errors.\n \"\"\"\n self.processed_targets.clear()\n changed_modules = changed_modules + removed_modules\n removed_set = {module for module, _ in removed_modules}\n self.changed_modules = changed_modules\n\n if not changed_modules:\n return self.previous_messages\n\n # Reset find_module's caches for the new build.\n self.manager.find_module_cache.clear()\n\n self.triggered = []\n self.updated_modules = []\n changed_modules = dedupe_modules(changed_modules + self.stale)\n initial_set = {id for id, _ in changed_modules}\n self.manager.log_fine_grained('==== update %s ====' % ', '.join(\n repr(id) for id, _ in changed_modules))\n if self.previous_targets_with_errors and is_verbose(self.manager):\n self.manager.log_fine_grained('previous targets with errors: %s' %\n sorted(self.previous_targets_with_errors))\n\n blocking_error = None\n if self.blocking_error:\n # Handle blocking errors first. We'll exit as soon as we find a\n # module that still has blocking errors.\n self.manager.log_fine_grained('existing blocker: %s' % self.blocking_error[0])\n changed_modules = dedupe_modules([self.blocking_error] + changed_modules)\n blocking_error = self.blocking_error[0]\n self.blocking_error = None\n\n while True:\n result = self.update_one(changed_modules, initial_set, removed_set, blocking_error)\n changed_modules, (next_id, next_path), blocker_messages = result\n\n if blocker_messages is not None:\n self.blocking_error = (next_id, next_path)\n self.stale = changed_modules\n messages = blocker_messages\n break\n\n # It looks like we are done processing everything, so now\n # reprocess all targets with errors. We are careful to\n # support the possibility that reprocessing an errored module\n # might trigger loading of a module, but I am not sure\n # if this can really happen.\n if not changed_modules:\n # N.B: We just checked next_id, so manager.errors contains\n # the errors from it. Thus we consider next_id up to date\n # when propagating changes from the errored targets,\n # which prevents us from reprocessing errors in it.\n changed_modules = propagate_changes_using_dependencies(\n self.manager, self.graph, self.deps, set(), {next_id},\n self.previous_targets_with_errors, self.processed_targets)\n changed_modules = dedupe_modules(changed_modules)\n if not changed_modules:\n # Preserve state needed for the next update.\n self.previous_targets_with_errors = self.manager.errors.targets()\n messages = self.manager.errors.new_messages()\n break\n\n self.previous_messages = messages[:]\n return messages", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_FineGrainedBuildManager.update_one_FineGrainedBuildManager.update_one.return.changed_modules_next_id": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_FineGrainedBuildManager.update_one_FineGrainedBuildManager.update_one.return.changed_modules_next_id", "embedding": null, "metadata": {"file_path": "mypy/server/update.py", "file_name": "update.py", "file_type": "text/x-python", "category": "implementation", "start_line": 299, "end_line": 339, "span_ids": ["FineGrainedBuildManager.update_one"], "tokens": 399}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FineGrainedBuildManager:\n\n def update_one(self,\n changed_modules: List[Tuple[str, str]],\n initial_set: Set[str],\n removed_set: Set[str],\n blocking_error: Optional[str]) -> Tuple[List[Tuple[str, str]],\n Tuple[str, str],\n Optional[List[str]]]:\n \"\"\"Process a module from the list of changed modules.\n\n Returns:\n Tuple with these items:\n\n - Updated list of pending changed modules as (module id, path) tuples\n - Module which was actually processed as (id, path) tuple\n - If there was a blocking error, the error messages from it\n \"\"\"\n t0 = time.time()\n next_id, next_path = changed_modules.pop(0)\n\n # If we have a module with a blocking error that is no longer\n # in the import graph, we must skip it as otherwise we'll be\n # stuck with the blocking error.\n if (next_id == blocking_error\n and next_id not in self.previous_modules\n and next_id not in initial_set):\n self.manager.log_fine_grained(\n 'skip %r (module with blocking error not in import graph)' % next_id)\n return changed_modules, (next_id, next_path), None\n\n result = self.update_module(next_id, next_path, next_id in removed_set)\n remaining, (next_id, next_path), blocker_messages = result\n changed_modules = [(id, path) for id, path in changed_modules\n if id != next_id]\n changed_modules = dedupe_modules(remaining + changed_modules)\n t1 = time.time()\n\n self.manager.log_fine_grained(\n \"update once: {} in {:.3f}s - {} left\".format(\n next_id, t1 - t0, len(changed_modules)))\n\n return changed_modules, (next_id, next_path), blocker_messages", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_FineGrainedBuildManager.update_module_FineGrainedBuildManager.update_module.return.remaining_module_path_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_FineGrainedBuildManager.update_module_FineGrainedBuildManager.update_module.return.remaining_module_path_", "embedding": null, "metadata": {"file_path": "mypy/server/update.py", "file_name": "update.py", "file_type": "text/x-python", "category": "implementation", "start_line": 322, "end_line": 408, "span_ids": ["FineGrainedBuildManager.update_module"], "tokens": 763}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FineGrainedBuildManager:\n\n def update_module(self,\n module: str,\n path: str,\n force_removed: bool) -> Tuple[List[Tuple[str, str]],\n Tuple[str, str],\n Optional[List[str]]]:\n \"\"\"Update a single modified module.\n\n If the module contains imports of previously unseen modules, only process one of\n the new modules and return the remaining work to be done.\n\n Args:\n module: Id of the module\n path: File system path of the module\n force_removed: If True, consider module removed from the build even if path\n exists (used for removing an existing file from the build)\n\n Returns:\n Tuple with these items:\n\n - Remaining modules to process as (module id, path) tuples\n - Module which was actually processed as (id, path) tuple\n - If there was a blocking error, the error messages from it\n \"\"\"\n self.manager.log_fine_grained('--- update single %r ---' % module)\n self.updated_modules.append(module)\n\n # builtins and friends could potentially get triggered because\n # of protocol stuff, but nothing good could possibly come from\n # actually updating them.\n if module in SENSITIVE_INTERNAL_MODULES:\n return [], (module, path), None\n\n manager = self.manager\n previous_modules = self.previous_modules\n graph = self.graph\n\n ensure_deps_loaded(module, self.deps, graph)\n\n # If this is an already existing module, make sure that we have\n # its tree loaded so that we can snapshot it for comparison.\n ensure_trees_loaded(manager, graph, [module])\n\n t0 = time.time()\n # Record symbol table snapshot of old version the changed module.\n old_snapshots = {} # type: Dict[str, Dict[str, SnapshotItem]]\n if module in manager.modules:\n snapshot = snapshot_symbol_table(module, manager.modules[module].names)\n old_snapshots[module] = snapshot\n\n manager.errors.reset()\n self.processed_targets.append(module)\n result = update_module_isolated(module, path, manager, previous_modules, graph,\n force_removed)\n if isinstance(result, BlockedUpdate):\n # Blocking error -- just give up\n module, path, remaining, errors = result\n self.previous_modules = get_module_to_path_map(graph)\n return remaining, (module, path), errors\n assert isinstance(result, NormalUpdate) # Work around #4124\n module, path, remaining, tree = result\n\n # TODO: What to do with stale dependencies?\n t1 = time.time()\n triggered = calculate_active_triggers(manager, old_snapshots, {module: tree})\n if is_verbose(self.manager):\n filtered = [trigger for trigger in triggered\n if not trigger.endswith('__>')]\n self.manager.log_fine_grained('triggered: %r' % sorted(filtered))\n self.triggered.extend(triggered | self.previous_targets_with_errors)\n if module in graph:\n graph[module].update_fine_grained_deps(self.deps)\n graph[module].free_state()\n remaining += propagate_changes_using_dependencies(\n manager, graph, self.deps, triggered,\n {module},\n targets_with_errors=set(), processed_targets=self.processed_targets)\n t2 = time.time()\n manager.add_stats(\n update_isolated_time=t1 - t0,\n propagate_time=t2 - t1)\n\n # Preserve state needed for the next update.\n self.previous_targets_with_errors.update(manager.errors.targets())\n self.previous_modules = get_module_to_path_map(graph)\n\n return remaining, (module, path), None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_find_unloaded_deps_find_unloaded_deps.return.unloaded": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_find_unloaded_deps_find_unloaded_deps.return.unloaded", "embedding": null, "metadata": {"file_path": "mypy/server/update.py", "file_name": "update.py", "file_type": "text/x-python", "category": "implementation", "start_line": 411, "end_line": 435, "span_ids": ["find_unloaded_deps"], "tokens": 217}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def find_unloaded_deps(manager: BuildManager, graph: Dict[str, State],\n initial: Sequence[str]) -> List[str]:\n \"\"\"Find all the deps of the nodes in initial that haven't had their tree loaded.\n\n The key invariant here is that if a module is loaded, so are all\n of their dependencies. This means that when we encounter a loaded\n module, we don't need to explore its dependencies. (This\n invariant is slightly violated when dependencies are added, which\n can be handled by calling find_unloaded_deps directly on the new\n dependencies.)\n \"\"\"\n worklist = list(initial)\n seen = set() # type: Set[str]\n unloaded = []\n while worklist:\n node = worklist.pop()\n if node in seen or node not in graph:\n continue\n seen.add(node)\n if node not in manager.modules:\n ancestors = graph[node].ancestors or []\n worklist.extend(graph[node].dependencies + ancestors)\n unloaded.append(node)\n\n return unloaded", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_ensure_deps_loaded_ensure_deps_loaded.for_i_in_range_len_parts_.if_base_in_graph_and_not_.graph[base].fine_grained_deps_loaded.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_ensure_deps_loaded_ensure_deps_loaded.for_i_in_range_len_parts_.if_base_in_graph_and_not_.graph[base].fine_grained_deps_loaded.True", "embedding": null, "metadata": {"file_path": "mypy/server/update.py", "file_name": "update.py", "file_type": "text/x-python", "category": "implementation", "start_line": 438, "end_line": 455, "span_ids": ["ensure_deps_loaded"], "tokens": 172}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def ensure_deps_loaded(module: str,\n deps: Dict[str, Set[str]], graph: Dict[str, State]) -> None:\n \"\"\"Ensure that the dependencies on a module are loaded.\n\n Dependencies are loaded into the 'deps' dictionary.\n\n This also requires loading dependencies from any parent modules,\n since dependencies will get stored with parent modules when a module\n doesn't exist.\n \"\"\"\n if module in graph and graph[module].fine_grained_deps_loaded:\n return\n parts = module.split('.')\n for i in range(len(parts)):\n base = '.'.join(parts[:i + 1])\n if base in graph and not graph[base].fine_grained_deps_loaded:\n merge_dependencies(graph[base].load_fine_grained_deps(), deps)\n graph[base].fine_grained_deps_loaded = True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_ensure_trees_loaded_ensure_trees_loaded.if_to_process_.process_fresh_modules_gra": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_ensure_trees_loaded_ensure_trees_loaded.if_to_process_.process_fresh_modules_gra", "embedding": null, "metadata": {"file_path": "mypy/server/update.py", "file_name": "update.py", "file_type": "text/x-python", "category": "implementation", "start_line": 458, "end_line": 466, "span_ids": ["ensure_trees_loaded"], "tokens": 109}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def ensure_trees_loaded(manager: BuildManager, graph: Dict[str, State],\n initial: Sequence[str]) -> None:\n \"\"\"Ensure that the modules in initial and their deps have loaded trees.\"\"\"\n to_process = find_unloaded_deps(manager, graph, initial)\n if to_process:\n if is_verbose(manager):\n manager.log_fine_grained(\"Calling process_fresh_modules on set of size {} ({})\".format(\n len(to_process), sorted(to_process)))\n process_fresh_modules(graph, to_process, manager)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_fix_fg_dependencies_UpdateResult.Union_NormalUpdate_Block": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_fix_fg_dependencies_UpdateResult.Union_NormalUpdate_Block", "embedding": null, "metadata": {"file_path": "mypy/server/update.py", "file_name": "update.py", "file_type": "text/x-python", "category": "implementation", "start_line": 469, "end_line": 496, "span_ids": ["fix_fg_dependencies", "impl:5"], "tokens": 288}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def fix_fg_dependencies(manager: BuildManager, deps: Dict[str, Set[str]]) -> None:\n \"\"\"Populate the dependencies with stuff that build may have missed\"\"\"\n # This means the root module and typestate\n merge_dependencies(manager.load_fine_grained_deps(FAKE_ROOT_MODULE), deps)\n # TypeState.add_all_protocol_deps(deps)\n\n\n# The result of update_module_isolated when no blockers, with these items:\n#\n# - Id of the changed module (can be different from the module argument)\n# - Path of the changed module\n# - New AST for the changed module (None if module was deleted)\n# - Remaining changed modules that are not processed yet as (module id, path)\n# tuples (non-empty if the original changed module imported other new\n# modules)\nNormalUpdate = NamedTuple('NormalUpdate', [('module', str),\n ('path', str),\n ('remaining', List[Tuple[str, str]]),\n ('tree', Optional[MypyFile])])\n\n# The result of update_module_isolated when there is a blocking error. Items\n# are similar to NormalUpdate (but there are fewer).\nBlockedUpdate = NamedTuple('BlockedUpdate', [('module', str),\n ('path', str),\n ('remaining', List[Tuple[str, str]]),\n ('messages', List[str])])\n\nUpdateResult = Union[NormalUpdate, BlockedUpdate]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_update_module_isolated_update_module_isolated.None_1.except_CompileError_as_er.return.BlockedUpdate_module_pat": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_update_module_isolated_update_module_isolated.None_1.except_CompileError_as_er.return.BlockedUpdate_module_pat", "embedding": null, "metadata": {"file_path": "mypy/server/update.py", "file_name": "update.py", "file_type": "text/x-python", "category": "implementation", "start_line": 499, "end_line": 594, "span_ids": ["update_module_isolated"], "tokens": 827}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def update_module_isolated(module: str,\n path: str,\n manager: BuildManager,\n previous_modules: Dict[str, str],\n graph: Graph,\n force_removed: bool) -> UpdateResult:\n \"\"\"Build a new version of one changed module only.\n\n Don't propagate changes to elsewhere in the program. Raise CompileError on\n encountering a blocking error.\n\n Args:\n module: Changed module (modified, created or deleted)\n path: Path of the changed module\n manager: Build manager\n graph: Build graph\n force_removed: If True, consider the module removed from the build even it the\n file exists\n\n Returns a named tuple describing the result (see above for details).\n \"\"\"\n if module not in graph:\n manager.log_fine_grained('new module %r' % module)\n\n if not manager.fscache.isfile(path) or force_removed:\n delete_module(module, path, graph, manager)\n return NormalUpdate(module, path, [], None)\n\n sources = get_sources(manager.fscache, previous_modules, [(module, path)])\n\n if module in manager.missing_modules:\n manager.missing_modules.remove(module)\n\n orig_module = module\n orig_state = graph.get(module)\n orig_tree = manager.modules.get(module)\n\n def restore(ids: List[str]) -> None:\n # For each of the modules in ids, restore that id's old\n # manager.modules and graphs entries. (Except for the original\n # module, this means deleting them.)\n for id in ids:\n if id == orig_module and orig_tree:\n manager.modules[id] = orig_tree\n elif id in manager.modules:\n del manager.modules[id]\n if id == orig_module and orig_state:\n graph[id] = orig_state\n elif id in graph:\n del graph[id]\n\n new_modules = [] # type: List[State]\n try:\n if module in graph:\n del graph[module]\n load_graph(sources, manager, graph, new_modules)\n except CompileError as err:\n # Parse error somewhere in the program -- a blocker\n assert err.module_with_blocker\n restore([module] + [st.id for st in new_modules])\n return BlockedUpdate(err.module_with_blocker, path, [], err.messages)\n\n # Reparsing the file may have brought in dependencies that we\n # didn't have before. Make sure that they are loaded to restore\n # the invariant that a module having a loaded tree implies that\n # its dependencies do as well.\n ensure_trees_loaded(manager, graph, graph[module].dependencies)\n\n # Find any other modules brought in by imports.\n changed_modules = [(st.id, st.xpath) for st in new_modules]\n\n # If there are multiple modules to process, only process one of them and return\n # the remaining ones to the caller.\n if len(changed_modules) > 1:\n # As an optimization, look for a module that imports no other changed modules.\n module, path = find_relative_leaf_module(changed_modules, graph)\n changed_modules.remove((module, path))\n remaining_modules = changed_modules\n # The remaining modules haven't been processed yet so drop them.\n restore([id for id, _ in remaining_modules])\n manager.log_fine_grained('--> %r (newly imported)' % module)\n else:\n remaining_modules = []\n\n state = graph[module]\n\n # Process the changed file.\n state.parse_file()\n assert state.tree is not None, \"file must be at least parsed\"\n t0 = time.time()\n try:\n semantic_analysis_for_scc(graph, [state.id], manager.errors)\n except CompileError as err:\n # There was a blocking error, so module AST is incomplete. Restore old modules.\n restore([module])\n return BlockedUpdate(module, path, remaining_modules, err.messages)\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_update_module_isolated._Merge_old_and_new_ASTs__update_module_isolated.return.NormalUpdate_module_path": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_update_module_isolated._Merge_old_and_new_ASTs__update_module_isolated.return.NormalUpdate_module_path", "embedding": null, "metadata": {"file_path": "mypy/server/update.py", "file_name": "update.py", "file_type": "text/x-python", "category": "implementation", "start_line": 596, "end_line": 615, "span_ids": ["update_module_isolated"], "tokens": 210}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def update_module_isolated(module: str,\n path: str,\n manager: BuildManager,\n previous_modules: Dict[str, str],\n graph: Graph,\n force_removed: bool) -> UpdateResult:\n\n # Merge old and new ASTs.\n new_modules_dict = {module: state.tree} # type: Dict[str, Optional[MypyFile]]\n replace_modules_with_new_variants(manager, graph, {orig_module: orig_tree}, new_modules_dict)\n\n t1 = time.time()\n # Perform type checking.\n state.type_checker().reset()\n state.type_check_first_pass()\n state.type_check_second_pass()\n t2 = time.time()\n state.finish_passes()\n t3 = time.time()\n manager.add_stats(\n semanal_time=t1 - t0,\n typecheck_time=t2 - t1,\n finish_passes_time=t3 - t2)\n\n graph[module] = state\n\n return NormalUpdate(module, path, remaining_modules, state.tree)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_find_relative_leaf_module_find_relative_leaf_module.return.modules_0_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_find_relative_leaf_module_find_relative_leaf_module.return.modules_0_", "embedding": null, "metadata": {"file_path": "mypy/server/update.py", "file_name": "update.py", "file_type": "text/x-python", "category": "implementation", "start_line": 618, "end_line": 642, "span_ids": ["find_relative_leaf_module"], "tokens": 262}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def find_relative_leaf_module(modules: List[Tuple[str, str]], graph: Graph) -> Tuple[str, str]:\n \"\"\"Find a module in a list that directly imports no other module in the list.\n\n If no such module exists, return the lexicographically first module from the list.\n Always return one of the items in the modules list.\n\n NOTE: If both 'abc' and 'typing' have changed, an effect of the above rule is that\n we prefer 'abc', even if both are in the same SCC. This works around a false\n positive in 'typing', at least in tests.\n\n Args:\n modules: List of (module, path) tuples (non-empty)\n graph: Program import graph that contains all modules in the module list\n \"\"\"\n assert modules\n # Sort for repeatable results.\n modules = sorted(modules)\n module_set = {module for module, _ in modules}\n for module, path in modules:\n state = graph[module]\n if len(set(state.dependencies) & module_set) == 0:\n # Found it!\n return module, path\n # Could not find any. Just return the first module (by lexicographic order).\n return modules[0]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_delete_module_delete_module.if_manager_fscache_isfile.manager_missing_modules_a": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_delete_module_delete_module.if_manager_fscache_isfile.manager_missing_modules_a", "embedding": null, "metadata": {"file_path": "mypy/server/update.py", "file_name": "update.py", "file_type": "text/x-python", "category": "implementation", "start_line": 645, "end_line": 667, "span_ids": ["delete_module"], "tokens": 236}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def delete_module(module_id: str,\n path: str,\n graph: Graph,\n manager: BuildManager) -> None:\n manager.log_fine_grained('delete module %r' % module_id)\n # TODO: Remove deps for the module (this only affects memory use, not correctness)\n if module_id in graph:\n del graph[module_id]\n if module_id in manager.modules:\n del manager.modules[module_id]\n components = module_id.split('.')\n if len(components) > 1:\n # Delete reference to module in parent module.\n parent_id = '.'.join(components[:-1])\n # If parent module is ignored, it won't be included in the modules dictionary.\n if parent_id in manager.modules:\n parent = manager.modules[parent_id]\n if components[-1] in parent.names:\n del parent.names[components[-1]]\n # If the module is removed from the build but still exists, then\n # we mark it as missing so that it will get picked up by import from still.\n if manager.fscache.isfile(path):\n manager.missing_modules.add(module_id)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_dedupe_modules_get_sources.return.sources": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_dedupe_modules_get_sources.return.sources", "embedding": null, "metadata": {"file_path": "mypy/server/update.py", "file_name": "update.py", "file_type": "text/x-python", "category": "implementation", "start_line": 670, "end_line": 692, "span_ids": ["dedupe_modules", "get_sources", "get_module_to_path_map"], "tokens": 174}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def dedupe_modules(modules: List[Tuple[str, str]]) -> List[Tuple[str, str]]:\n seen = set() # type: Set[str]\n result = []\n for id, path in modules:\n if id not in seen:\n seen.add(id)\n result.append((id, path))\n return result\n\n\ndef get_module_to_path_map(graph: Graph) -> Dict[str, str]:\n return {module: node.xpath\n for module, node in graph.items()}\n\n\ndef get_sources(fscache: FileSystemCache,\n modules: Dict[str, str],\n changed_modules: List[Tuple[str, str]]) -> List[BuildSource]:\n sources = []\n for id, path in changed_modules:\n if fscache.isfile(path):\n sources.append(BuildSource(path, id, None))\n return sources", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_calculate_active_triggers_calculate_active_triggers.return._make_trigger_name_for_n": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_calculate_active_triggers_calculate_active_triggers.return._make_trigger_name_for_n", "embedding": null, "metadata": {"file_path": "mypy/server/update.py", "file_name": "update.py", "file_type": "text/x-python", "category": "implementation", "start_line": 695, "end_line": 737, "span_ids": ["calculate_active_triggers"], "tokens": 420}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def calculate_active_triggers(manager: BuildManager,\n old_snapshots: Dict[str, Dict[str, SnapshotItem]],\n new_modules: Dict[str, Optional[MypyFile]]) -> Set[str]:\n \"\"\"Determine activated triggers by comparing old and new symbol tables.\n\n For example, if only the signature of function m.f is different in the new\n symbol table, return {''}.\n \"\"\"\n names = set() # type: Set[str]\n for id in new_modules:\n snapshot1 = old_snapshots.get(id)\n if snapshot1 is None:\n names.add(id)\n snapshot1 = {}\n new = new_modules[id]\n if new is None:\n snapshot2 = snapshot_symbol_table(id, SymbolTable())\n names.add(id)\n else:\n snapshot2 = snapshot_symbol_table(id, new.names)\n diff = compare_symbol_table_snapshots(id, snapshot1, snapshot2)\n package_nesting_level = id.count('.')\n for item in diff.copy():\n if (item.count('.') <= package_nesting_level + 1\n and item.split('.')[-1] not in ('__builtins__',\n '__file__',\n '__name__',\n '__package__',\n '__doc__')):\n # Activate catch-all wildcard trigger for top-level module changes (used for\n # \"from m import *\"). This also gets triggered by changes to module-private\n # entries, but as these unneeded dependencies only result in extra processing,\n # it's a minor problem.\n #\n # TODO: Some __* names cause mistriggers. Fix the underlying issue instead of\n # special casing them here.\n diff.add(id + WILDCARD_TAG)\n if item.count('.') > package_nesting_level + 1:\n # These are for changes within classes, used by protocols.\n diff.add(item.rsplit('.', 1)[0] + WILDCARD_TAG)\n\n names |= diff\n return {make_trigger(name) for name in names}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_replace_modules_with_new_variants_replace_modules_with_new_variants.for_id_in_new_modules_.if_preserved_module_and_n.graph[id].tree.preserved_module": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_replace_modules_with_new_variants_replace_modules_with_new_variants.for_id_in_new_modules_.if_preserved_module_and_n.graph[id].tree.preserved_module", "embedding": null, "metadata": {"file_path": "mypy/server/update.py", "file_name": "update.py", "file_type": "text/x-python", "category": "implementation", "start_line": 740, "end_line": 761, "span_ids": ["replace_modules_with_new_variants"], "tokens": 201}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def replace_modules_with_new_variants(\n manager: BuildManager,\n graph: Dict[str, State],\n old_modules: Dict[str, Optional[MypyFile]],\n new_modules: Dict[str, Optional[MypyFile]]) -> None:\n \"\"\"Replace modules with newly builds versions.\n\n Retain the identities of externally visible AST nodes in the\n old ASTs so that references to the affected modules from other\n modules will still be valid (unless something was deleted or\n replaced with an incompatible definition, in which case there\n will be dangling references that will be handled by\n propagate_changes_using_dependencies).\n \"\"\"\n for id in new_modules:\n preserved_module = old_modules.get(id)\n new_module = new_modules[id]\n if preserved_module and new_module is not None:\n merge_asts(preserved_module, preserved_module.names,\n new_module, new_module.names)\n manager.modules[id] = preserved_module\n graph[id].tree = preserved_module", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_propagate_changes_using_dependencies_propagate_changes_using_dependencies.return.remaining_modules": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_propagate_changes_using_dependencies_propagate_changes_using_dependencies.return.remaining_modules", "embedding": null, "metadata": {"file_path": "mypy/server/update.py", "file_name": "update.py", "file_type": "text/x-python", "category": "implementation", "start_line": 764, "end_line": 824, "span_ids": ["propagate_changes_using_dependencies"], "tokens": 629}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def propagate_changes_using_dependencies(\n manager: BuildManager,\n graph: Dict[str, State],\n deps: Dict[str, Set[str]],\n triggered: Set[str],\n up_to_date_modules: Set[str],\n targets_with_errors: Set[str],\n processed_targets: List[str]) -> List[Tuple[str, str]]:\n \"\"\"Transitively rechecks targets based on triggers and the dependency map.\n\n Returns a list (module id, path) tuples representing modules that contain\n a target that needs to be reprocessed but that has not been parsed yet.\n\n Processed targets should be appended to processed_targets (used in tests only,\n to test the order of processing targets).\n \"\"\"\n\n num_iter = 0\n remaining_modules = [] # type: List[Tuple[str, str]]\n\n # Propagate changes until nothing visible has changed during the last\n # iteration.\n while triggered or targets_with_errors:\n num_iter += 1\n if num_iter > MAX_ITER:\n raise RuntimeError('Max number of iterations (%d) reached (endless loop?)' % MAX_ITER)\n\n todo, unloaded, stale_protos = find_targets_recursive(manager, graph,\n triggered, deps, up_to_date_modules)\n # TODO: we sort to make it deterministic, but this is *incredibly* ad hoc\n remaining_modules.extend((id, graph[id].xpath) for id in sorted(unloaded))\n # Also process targets that used to have errors, as otherwise some\n # errors might be lost.\n for target in targets_with_errors:\n id = module_prefix(graph, target)\n if id is not None and id not in up_to_date_modules:\n if id not in todo:\n todo[id] = set()\n manager.log_fine_grained('process target with error: %s' % target)\n more_nodes, _ = lookup_target(manager, target)\n todo[id].update(more_nodes)\n triggered = set()\n # First invalidate subtype caches in all stale protocols.\n # We need to do this to avoid false negatives if the protocol itself is\n # unchanged, but was marked stale because its sub- (or super-) type changed.\n for info in stale_protos:\n TypeState.reset_subtype_caches_for(info)\n # Then fully reprocess all targets.\n # TODO: Preserve order (set is not optimal)\n for id, nodes in sorted(todo.items(), key=lambda x: x[0]):\n assert id not in up_to_date_modules\n triggered |= reprocess_nodes(manager, graph, id, nodes, deps, processed_targets)\n # Changes elsewhere may require us to reprocess modules that were\n # previously considered up to date. For example, there may be a\n # dependency loop that loops back to an originally processed module.\n up_to_date_modules = set()\n targets_with_errors = set()\n if is_verbose(manager):\n manager.log_fine_grained('triggered: %r' % list(triggered))\n\n return remaining_modules", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_find_targets_recursive_find_targets_recursive.return.result_unloaded_files_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_find_targets_recursive_find_targets_recursive.return.result_unloaded_files_s", "embedding": null, "metadata": {"file_path": "mypy/server/update.py", "file_name": "update.py", "file_type": "text/x-python", "category": "implementation", "start_line": 827, "end_line": 884, "span_ids": ["find_targets_recursive"], "tokens": 492}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def find_targets_recursive(\n manager: BuildManager,\n graph: Graph,\n triggers: Set[str],\n deps: Dict[str, Set[str]],\n up_to_date_modules: Set[str]) -> Tuple[Dict[str, Set[FineGrainedDeferredNode]],\n Set[str], Set[TypeInfo]]:\n \"\"\"Find names of all targets that need to reprocessed, given some triggers.\n\n Returns: A tuple containing a:\n * Dictionary from module id to a set of stale targets.\n * A set of module ids for unparsed modules with stale targets.\n \"\"\"\n result = {} # type: Dict[str, Set[FineGrainedDeferredNode]]\n worklist = triggers\n processed = set() # type: Set[str]\n stale_protos = set() # type: Set[TypeInfo]\n unloaded_files = set() # type: Set[str]\n\n # Find AST nodes corresponding to each target.\n #\n # TODO: Don't rely on a set, since the items are in an unpredictable order.\n while worklist:\n processed |= worklist\n current = worklist\n worklist = set()\n for target in current:\n if target.startswith('<'):\n module_id = module_prefix(graph, trigger_to_target(target))\n if module_id:\n ensure_deps_loaded(module_id, deps, graph)\n\n worklist |= deps.get(target, set()) - processed\n else:\n module_id = module_prefix(graph, target)\n if module_id is None:\n # Deleted module.\n continue\n if module_id in up_to_date_modules:\n # Already processed.\n continue\n if (module_id not in manager.modules\n or manager.modules[module_id].is_cache_skeleton):\n # We haven't actually parsed and checked the module, so we don't have\n # access to the actual nodes.\n # Add it to the queue of files that need to be processed fully.\n unloaded_files.add(module_id)\n continue\n\n if module_id not in result:\n result[module_id] = set()\n manager.log_fine_grained('process: %s' % target)\n deferred, stale_proto = lookup_target(manager, target)\n if stale_proto:\n stale_protos.add(stale_proto)\n result[module_id].update(deferred)\n\n return result, unloaded_files, stale_protos", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_reprocess_nodes_reprocess_nodes.return.new_triggered": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_reprocess_nodes_reprocess_nodes.return.new_triggered", "embedding": null, "metadata": {"file_path": "mypy/server/update.py", "file_name": "update.py", "file_type": "text/x-python", "category": "implementation", "start_line": 887, "end_line": 977, "span_ids": ["reprocess_nodes"], "tokens": 769}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def reprocess_nodes(manager: BuildManager,\n graph: Dict[str, State],\n module_id: str,\n nodeset: Set[FineGrainedDeferredNode],\n deps: Dict[str, Set[str]],\n processed_targets: List[str]) -> Set[str]:\n \"\"\"Reprocess a set of nodes within a single module.\n\n Return fired triggers.\n \"\"\"\n if module_id not in graph:\n manager.log_fine_grained('%s not in graph (blocking errors or deleted?)' %\n module_id)\n return set()\n\n file_node = manager.modules[module_id]\n old_symbols = find_symbol_tables_recursive(file_node.fullname, file_node.names)\n old_symbols = {name: names.copy() for name, names in old_symbols.items()}\n old_symbols_snapshot = snapshot_symbol_table(file_node.fullname, file_node.names)\n\n def key(node: FineGrainedDeferredNode) -> int:\n # Unlike modules which are sorted by name within SCC,\n # nodes within the same module are sorted by line number, because\n # this is how they are processed in normal mode.\n return node.node.line\n\n nodes = sorted(nodeset, key=key)\n\n options = graph[module_id].options\n manager.errors.set_file_ignored_lines(\n file_node.path, file_node.ignored_lines, options.ignore_errors)\n\n targets = set()\n for node in nodes:\n target = target_from_node(module_id, node.node)\n if target is not None:\n targets.add(target)\n manager.errors.clear_errors_in_targets(file_node.path, targets)\n\n # If one of the nodes is the module itself, emit any errors that\n # happened before semantic analysis.\n for target in targets:\n if target == module_id:\n for info in graph[module_id].early_errors:\n manager.errors.add_error_info(info)\n\n # Strip semantic analysis information.\n saved_attrs = {} # type: SavedAttributes\n for deferred in nodes:\n processed_targets.append(deferred.node.fullname)\n strip_target(deferred.node, saved_attrs)\n semantic_analysis_for_targets(graph[module_id], nodes, graph, saved_attrs)\n # Merge symbol tables to preserve identities of AST nodes. The file node will remain\n # the same, but other nodes may have been recreated with different identities, such as\n # NamedTuples defined using assignment statements.\n new_symbols = find_symbol_tables_recursive(file_node.fullname, file_node.names)\n for name in old_symbols:\n if name in new_symbols:\n merge_asts(file_node, old_symbols[name], file_node, new_symbols[name])\n\n # Type check.\n checker = graph[module_id].type_checker()\n checker.reset()\n # We seem to need additional passes in fine-grained incremental mode.\n checker.pass_num = 0\n checker.last_pass = 3\n more = checker.check_second_pass(nodes)\n while more:\n more = False\n if graph[module_id].type_checker().check_second_pass():\n more = True\n\n if manager.options.export_types:\n manager.all_types.update(graph[module_id].type_map())\n\n new_symbols_snapshot = snapshot_symbol_table(file_node.fullname, file_node.names)\n # Check if any attribute types were changed and need to be propagated further.\n changed = compare_symbol_table_snapshots(file_node.fullname,\n old_symbols_snapshot,\n new_symbols_snapshot)\n new_triggered = {make_trigger(name) for name in changed}\n\n # Dependencies may have changed.\n update_deps(module_id, nodes, graph, deps, options)\n\n # Report missing imports.\n graph[module_id].verify_dependencies()\n\n graph[module_id].free_state()\n\n return new_triggered", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_find_symbol_tables_recursive_find_symbol_tables_recursive.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_find_symbol_tables_recursive_find_symbol_tables_recursive.return.result", "embedding": null, "metadata": {"file_path": "mypy/server/update.py", "file_name": "update.py", "file_type": "text/x-python", "category": "implementation", "start_line": 980, "end_line": 996, "span_ids": ["find_symbol_tables_recursive"], "tokens": 147}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def find_symbol_tables_recursive(prefix: str, symbols: SymbolTable) -> Dict[str, SymbolTable]:\n \"\"\"Find all nested symbol tables.\n\n Args:\n prefix: Full name prefix (used for return value keys and to filter result so that\n cross references to other modules aren't included)\n symbols: Root symbol table\n\n Returns a dictionary from full name to corresponding symbol table.\n \"\"\"\n result = {}\n result[prefix] = symbols\n for name, node in symbols.items():\n if isinstance(node.node, TypeInfo) and node.node.fullname.startswith(prefix + '.'):\n more = find_symbol_tables_recursive(prefix + '.' + name, node.node.names)\n result.update(more)\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_update_deps_update_deps.TypeState_update_protocol": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_update_deps_update_deps.TypeState_update_protocol", "embedding": null, "metadata": {"file_path": "mypy/server/update.py", "file_name": "update.py", "file_type": "text/x-python", "category": "implementation", "start_line": 999, "end_line": 1014, "span_ids": ["update_deps"], "tokens": 159}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def update_deps(module_id: str,\n nodes: List[FineGrainedDeferredNode],\n graph: Dict[str, State],\n deps: Dict[str, Set[str]],\n options: Options) -> None:\n for deferred in nodes:\n node = deferred.node\n type_map = graph[module_id].type_map()\n tree = graph[module_id].tree\n assert tree is not None, \"Tree must be processed at this stage\"\n new_deps = get_dependencies_of_target(module_id, tree, node, type_map,\n options.python_version)\n for trigger, targets in new_deps.items():\n deps.setdefault(trigger, set()).update(targets)\n # Merge also the newly added protocol deps (if any).\n TypeState.update_protocol_deps(deps)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_lookup_target_lookup_target.return._FineGrainedDeferredNode_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_lookup_target_lookup_target.return._FineGrainedDeferredNode_", "embedding": null, "metadata": {"file_path": "mypy/server/update.py", "file_name": "update.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1017, "end_line": 1094, "span_ids": ["lookup_target"], "tokens": 726}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def lookup_target(manager: BuildManager,\n target: str) -> Tuple[List[FineGrainedDeferredNode], Optional[TypeInfo]]:\n \"\"\"Look up a target by fully-qualified name.\n\n The first item in the return tuple is a list of deferred nodes that\n needs to be reprocessed. If the target represents a TypeInfo corresponding\n to a protocol, return it as a second item in the return tuple, otherwise None.\n \"\"\"\n def not_found() -> None:\n manager.log_fine_grained(\n \"Can't find matching target for %s (stale dependency?)\" % target)\n\n modules = manager.modules\n items = split_target(modules, target)\n if items is None:\n not_found() # Stale dependency\n return [], None\n module, rest = items\n if rest:\n components = rest.split('.')\n else:\n components = []\n node = modules[module] # type: Optional[SymbolNode]\n file = None # type: Optional[MypyFile]\n active_class = None\n for c in components:\n if isinstance(node, TypeInfo):\n active_class = node\n if isinstance(node, MypyFile):\n file = node\n if (not isinstance(node, (MypyFile, TypeInfo))\n or c not in node.names):\n not_found() # Stale dependency\n return [], None\n # Don't reprocess plugin generated targets. They should get\n # stripped and regenerated when the containing target is\n # reprocessed.\n if node.names[c].plugin_generated:\n return [], None\n node = node.names[c].node\n if isinstance(node, TypeInfo):\n # A ClassDef target covers the body of the class and everything defined\n # within it. To get the body we include the entire surrounding target,\n # typically a module top-level, since we don't support processing class\n # bodies as separate entitites for simplicity.\n assert file is not None\n if node.fullname != target:\n # This is a reference to a different TypeInfo, likely due to a stale dependency.\n # Processing them would spell trouble -- for example, we could be refreshing\n # a deserialized TypeInfo with missing attributes.\n not_found()\n return [], None\n result = [FineGrainedDeferredNode(file, None)]\n stale_info = None # type: Optional[TypeInfo]\n if node.is_protocol:\n stale_info = node\n for name, symnode in node.names.items():\n node = symnode.node\n if isinstance(node, FuncDef):\n method, _ = lookup_target(manager, target + '.' + name)\n result.extend(method)\n return result, stale_info\n if isinstance(node, Decorator):\n # Decorator targets actually refer to the function definition only.\n node = node.func\n if not isinstance(node, (FuncDef,\n MypyFile,\n OverloadedFuncDef)):\n # The target can't be refreshed. It's possible that the target was\n # changed to another type and we have a stale dependency pointing to it.\n not_found()\n return [], None\n if node.fullname != target:\n # Stale reference points to something unexpected. We shouldn't process since the\n # context will be wrong and it could be a partially initialized deserialized node.\n not_found()\n return [], None\n return [FineGrainedDeferredNode(node, active_class)], None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_is_verbose_if_sys_platform_win32.else_._type_Final": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_is_verbose_if_sys_platform_win32.else_._type_Final", "embedding": null, "metadata": {"file_path": "mypy/server/update.py", "file_name": "update.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1097, "end_line": 1132, "span_ids": ["impl:11", "target_from_node", "is_verbose"], "tokens": 302}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_verbose(manager: BuildManager) -> bool:\n return manager.options.verbosity >= 1 or DEBUG_FINE_GRAINED\n\n\ndef target_from_node(module: str,\n node: Union[FuncDef, MypyFile, OverloadedFuncDef]\n ) -> Optional[str]:\n \"\"\"Return the target name corresponding to a deferred node.\n\n Args:\n module: Must be module id of the module that defines 'node'\n\n Returns the target name, or None if the node is not a valid target in the given\n module (for example, if it's actually defined in another module).\n \"\"\"\n if isinstance(node, MypyFile):\n if module != node.fullname:\n # Actually a reference to another module -- likely a stale dependency.\n return None\n return module\n else: # OverloadedFuncDef or FuncDef\n if node.info:\n return '%s.%s' % (node.info.fullname, node.name)\n else:\n return '%s.%s' % (module, node.name)\n\n\nif sys.platform != 'win32':\n INIT_SUFFIXES = ('/__init__.py', '/__init__.pyi') # type: Final\nelse:\n INIT_SUFFIXES = (\n os.sep + '__init__.py',\n os.sep + '__init__.pyi',\n os.altsep + '__init__.py',\n os.altsep + '__init__.pyi',\n ) # type: Final", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_refresh_suppressed_submodules_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_refresh_suppressed_submodules_", "embedding": null, "metadata": {"file_path": "mypy/server/update.py", "file_name": "update.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1154, "end_line": 1225, "span_ids": ["refresh_suppressed_submodules"], "tokens": 619}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def refresh_suppressed_submodules(\n module: str,\n path: Optional[str],\n deps: Dict[str, Set[str]],\n graph: Graph,\n fscache: FileSystemCache,\n refresh_file: Callable[[str, str], List[str]]) -> Optional[List[str]]:\n \"\"\"Look for submodules that are now suppressed in target package.\n\n If a submodule a.b gets added, we need to mark it as suppressed\n in modules that contain \"from a import b\". Previously we assumed\n that 'a.b' is not a module but a regular name.\n\n This is only relevant when following imports normally.\n\n Args:\n module: target package in which to look for submodules\n path: path of the module\n refresh_file: function that reads the AST of a module (returns error messages)\n\n Return a list of errors from refresh_file() if it was called. If the\n return value is None, we didn't call refresh_file().\n \"\"\"\n messages = None\n if path is None or not path.endswith(INIT_SUFFIXES):\n # Only packages have submodules.\n return None\n # Find any submodules present in the directory.\n pkgdir = os.path.dirname(path)\n try:\n entries = fscache.listdir(pkgdir)\n except FileNotFoundError:\n entries = []\n for fnam in entries:\n if (not fnam.endswith(('.py', '.pyi'))\n or fnam.startswith(\"__init__.\")\n or fnam.count('.') != 1):\n continue\n shortname = fnam.split('.')[0]\n submodule = module + '.' + shortname\n trigger = make_trigger(submodule)\n\n # We may be missing the required fine-grained deps.\n ensure_deps_loaded(module, deps, graph)\n\n if trigger in deps:\n for dep in deps[trigger]:\n # We can ignore <...> deps since a submodule can't trigger any.\n state = graph.get(dep)\n if not state:\n # Maybe it's a non-top-level target. We only care about the module.\n dep_module = module_prefix(graph, dep)\n if dep_module is not None:\n state = graph.get(dep_module)\n if state:\n # Is the file may missing an AST in case it's read from cache?\n if state.tree is None:\n # Create AST for the file. This may produce some new errors\n # that we need to propagate.\n assert state.path is not None\n messages = refresh_file(state.id, state.path)\n tree = state.tree\n assert tree # Will be fine, due to refresh_file() above\n for imp in tree.imports:\n if isinstance(imp, ImportFrom):\n if (imp.id == module\n and any(name == shortname for name, _ in imp.names)\n and submodule not in state.suppressed_set):\n state.suppressed.append(submodule)\n state.suppressed_set.add(submodule)\n return messages", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/sharedparse.py_from_typing_import_Option_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/sharedparse.py_from_typing_import_Option_", "embedding": null, "metadata": {"file_path": "mypy/sharedparse.py", "file_name": "sharedparse.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 115, "span_ids": ["imports", "argument_elide_name", "special_function_elide_names", "impl:7"], "tokens": 669}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from typing import Optional\nfrom typing_extensions import Final\n\n\"\"\"Shared logic between our three mypy parser files.\"\"\"\n\n\n_NON_BINARY_MAGIC_METHODS = {\n \"__abs__\",\n \"__call__\",\n \"__complex__\",\n \"__contains__\",\n \"__del__\",\n \"__delattr__\",\n \"__delitem__\",\n \"__enter__\",\n \"__exit__\",\n \"__float__\",\n \"__getattr__\",\n \"__getattribute__\",\n \"__getitem__\",\n \"__hex__\",\n \"__init__\",\n \"__init_subclass__\",\n \"__int__\",\n \"__invert__\",\n \"__iter__\",\n \"__len__\",\n \"__long__\",\n \"__neg__\",\n \"__new__\",\n \"__nonzero__\",\n \"__oct__\",\n \"__pos__\",\n \"__repr__\",\n \"__reversed__\",\n \"__setattr__\",\n \"__setitem__\",\n \"__str__\",\n \"__unicode__\",\n} # type: Final\n\nMAGIC_METHODS_ALLOWING_KWARGS = {\n \"__init__\",\n \"__init_subclass__\",\n \"__new__\",\n \"__call__\",\n} # type: Final\n\nBINARY_MAGIC_METHODS = {\n \"__add__\",\n \"__and__\",\n \"__cmp__\",\n \"__divmod__\",\n \"__div__\",\n \"__eq__\",\n \"__floordiv__\",\n \"__ge__\",\n \"__gt__\",\n \"__iadd__\",\n \"__iand__\",\n \"__idiv__\",\n \"__ifloordiv__\",\n \"__ilshift__\",\n \"__imatmul__\",\n \"__imod__\",\n \"__imul__\",\n \"__ior__\",\n \"__ipow__\",\n \"__irshift__\",\n \"__isub__\",\n \"__itruediv__\",\n \"__ixor__\",\n \"__le__\",\n \"__lshift__\",\n \"__lt__\",\n \"__matmul__\",\n \"__mod__\",\n \"__mul__\",\n \"__ne__\",\n \"__or__\",\n \"__pow__\",\n \"__radd__\",\n \"__rand__\",\n \"__rdiv__\",\n \"__rfloordiv__\",\n \"__rlshift__\",\n \"__rmatmul__\",\n \"__rmod__\",\n \"__rmul__\",\n \"__ror__\",\n \"__rpow__\",\n \"__rrshift__\",\n \"__rshift__\",\n \"__rsub__\",\n \"__rtruediv__\",\n \"__rxor__\",\n \"__sub__\",\n \"__truediv__\",\n \"__xor__\",\n} # type: Final\n\nassert not (_NON_BINARY_MAGIC_METHODS & BINARY_MAGIC_METHODS)\n\nMAGIC_METHODS = _NON_BINARY_MAGIC_METHODS | BINARY_MAGIC_METHODS # type: Final\n\nMAGIC_METHODS_POS_ARGS_ONLY = MAGIC_METHODS - MAGIC_METHODS_ALLOWING_KWARGS # type: Final\n\n\ndef special_function_elide_names(name: str) -> bool:\n return name in MAGIC_METHODS_POS_ARGS_ONLY\n\n\ndef argument_elide_name(name: Optional[str]) -> bool:\n return name is not None and name.startswith(\"__\") and not name.endswith(\"__\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/sitepkgs.py_from___future___import_pr_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/sitepkgs.py_from___future___import_pr_", "embedding": null, "metadata": {"file_path": "mypy/sitepkgs.py", "file_name": "sitepkgs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 33, "span_ids": ["imports", "getsitepackages", "impl:7"], "tokens": 243}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from __future__ import print_function\n\"\"\"This file is used to find the site packages of a Python executable, which may be Python 2.\n\nThis file MUST remain compatible with Python 2. Since we cannot make any assumptions about the\nPython being executed, this module should not use *any* dependencies outside of the standard\nlibrary found in Python 2. This file is run each mypy run, so it should be kept as fast as\npossible.\n\"\"\"\n\nif __name__ == '__main__':\n import sys\n sys.path = sys.path[1:] # we don't want to pick up mypy.types\n\nimport site\n\nMYPY = False\nif MYPY:\n from typing import List\n\n\ndef getsitepackages():\n # type: () -> List[str]\n if hasattr(site, 'getusersitepackages') and hasattr(site, 'getsitepackages'):\n user_dir = site.getusersitepackages()\n return site.getsitepackages() + [user_dir]\n else:\n from distutils.sysconfig import get_python_lib\n return [get_python_lib()]\n\n\nif __name__ == '__main__':\n print(repr(getsitepackages()))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/solve.py__Type_inference_constra_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/solve.py__Type_inference_constra_", "embedding": null, "metadata": {"file_path": "mypy/solve.py", "file_name": "solve.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 78, "span_ids": ["solve_constraints", "docstring"], "tokens": 610}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Type inference constraint solving\"\"\"\n\nfrom typing import List, Dict, Optional\nfrom collections import defaultdict\n\nfrom mypy.types import Type, AnyType, UninhabitedType, TypeVarId, TypeOfAny, get_proper_type\nfrom mypy.constraints import Constraint, SUPERTYPE_OF\nfrom mypy.join import join_types\nfrom mypy.meet import meet_types\nfrom mypy.subtypes import is_subtype\n\n\ndef solve_constraints(vars: List[TypeVarId], constraints: List[Constraint],\n strict: bool = True) -> List[Optional[Type]]:\n \"\"\"Solve type constraints.\n\n Return the best type(s) for type variables; each type can be None if the value of the variable\n could not be solved.\n\n If a variable has no constraints, if strict=True then arbitrarily\n pick NoneType as the value of the type variable. If strict=False,\n pick AnyType.\n \"\"\"\n # Collect a list of constraints for each type variable.\n cmap = defaultdict(list) # type: Dict[TypeVarId, List[Constraint]]\n for con in constraints:\n cmap[con.type_var].append(con)\n\n res = [] # type: List[Optional[Type]]\n\n # Solve each type variable separately.\n for tvar in vars:\n bottom = None # type: Optional[Type]\n top = None # type: Optional[Type]\n candidate = None # type: Optional[Type]\n\n # Process each constraint separately, and calculate the lower and upper\n # bounds based on constraints. Note that we assume that the constraint\n # targets do not have constraint references.\n for c in cmap.get(tvar, []):\n if c.op == SUPERTYPE_OF:\n if bottom is None:\n bottom = c.target\n else:\n bottom = join_types(bottom, c.target)\n else:\n if top is None:\n top = c.target\n else:\n top = meet_types(top, c.target)\n\n top = get_proper_type(top)\n bottom = get_proper_type(bottom)\n if isinstance(top, AnyType) or isinstance(bottom, AnyType):\n source_any = top if isinstance(top, AnyType) else bottom\n assert isinstance(source_any, AnyType)\n res.append(AnyType(TypeOfAny.from_another_any, source_any=source_any))\n continue\n elif bottom is None:\n if top:\n candidate = top\n else:\n # No constraints for type variable -- 'UninhabitedType' is the most specific type.\n if strict:\n candidate = UninhabitedType()\n candidate.ambiguous = True\n else:\n candidate = AnyType(TypeOfAny.special_form)\n elif top is None:\n candidate = bottom\n elif is_subtype(bottom, top):\n candidate = bottom\n else:\n candidate = None\n res.append(candidate)\n\n return res", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/split_namespace.py__Split_namespace_for_ar_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/split_namespace.py__Split_namespace_for_ar_", "embedding": null, "metadata": {"file_path": "mypy/split_namespace.py", "file_name": "split_namespace.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 35, "span_ids": ["SplitNamespace.__setattr__", "SplitNamespace.__init__", "docstring", "SplitNamespace", "SplitNamespace._get", "SplitNamespace.__getattr__"], "tokens": 280}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Split namespace for argparse to allow separating options by prefix.\n\nWe use this to direct some options to an Options object and some to a\nregular namespace.\n\"\"\"\n\n# In its own file largely because mypyc doesn't support its use of\n# __getattr__/__setattr__ and has some issues with __dict__\n\nimport argparse\n\nfrom typing import Tuple, Any\n\n\nclass SplitNamespace(argparse.Namespace):\n def __init__(self, standard_namespace: object, alt_namespace: object, alt_prefix: str) -> None:\n self.__dict__['_standard_namespace'] = standard_namespace\n self.__dict__['_alt_namespace'] = alt_namespace\n self.__dict__['_alt_prefix'] = alt_prefix\n\n def _get(self) -> Tuple[Any, Any]:\n return (self._standard_namespace, self._alt_namespace)\n\n def __setattr__(self, name: str, value: Any) -> None:\n if name.startswith(self._alt_prefix):\n setattr(self._alt_namespace, name[len(self._alt_prefix):], value)\n else:\n setattr(self._standard_namespace, name, value)\n\n def __getattr__(self, name: str) -> Any:\n if name.startswith(self._alt_prefix):\n return getattr(self._alt_namespace, name[len(self._alt_prefix):])\n else:\n return getattr(self._standard_namespace, name)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/state.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/state.py__", "embedding": null, "metadata": {"file_path": "mypy/state.py", "file_name": "state.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 19, "span_ids": ["imports", "strict_optional_set"], "tokens": 110}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from contextlib import contextmanager\nfrom typing import Optional, Tuple, Iterator\n\n# These are global mutable state. Don't add anything here unless there's a very\n# good reason.\n\n# Value varies by file being processed\nstrict_optional = False\nfind_occurrences = None # type: Optional[Tuple[str, str]]\n\n\n@contextmanager\ndef strict_optional_set(value: bool) -> Iterator[None]:\n global strict_optional\n saved = strict_optional\n strict_optional = value\n yield\n strict_optional = saved", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stats.py__Utilities_for_calculat_precision_names._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stats.py__Utilities_for_calculat_precision_names._", "embedding": null, "metadata": {"file_path": "mypy/stats.py", "file_name": "stats.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 39, "span_ids": ["docstring"], "tokens": 351}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Utilities for calculating and reporting statistics about types.\"\"\"\n\nimport os\nfrom collections import Counter\nfrom contextlib import contextmanager\n\nimport typing\nfrom typing import Dict, List, cast, Optional, Union, Iterator\nfrom typing_extensions import Final\n\nfrom mypy.traverser import TraverserVisitor\nfrom mypy.typeanal import collect_all_inner_types\nfrom mypy.types import (\n Type, AnyType, Instance, FunctionLike, TupleType, TypeVarType, TypeQuery, CallableType,\n TypeOfAny, get_proper_type, get_proper_types\n)\nfrom mypy import nodes\nfrom mypy.nodes import (\n Expression, FuncDef, TypeApplication, AssignmentStmt, NameExpr, CallExpr, MypyFile,\n MemberExpr, OpExpr, ComparisonExpr, IndexExpr, UnaryExpr, YieldFromExpr, RefExpr, ClassDef,\n AssignmentExpr, ImportFrom, Import, ImportAll, PassStmt, BreakStmt, ContinueStmt, StrExpr,\n BytesExpr, UnicodeExpr, IntExpr, FloatExpr, ComplexExpr, EllipsisExpr, ExpressionStmt, Node\n)\nfrom mypy.util import correct_relative_import\nfrom mypy.argmap import map_formals_to_actuals\n\nTYPE_EMPTY = 0 # type: Final\nTYPE_UNANALYZED = 1 # type: Final # type of non-typechecked code\nTYPE_PRECISE = 2 # type: Final\nTYPE_IMPRECISE = 3 # type: Final\nTYPE_ANY = 4 # type: Final\n\nprecision_names = [\n 'empty',\n 'unanalyzed',\n 'precise',\n 'imprecise',\n 'any',\n]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stats.py_None_6_StatisticsVisitor.visit_import.self_record_line_imp_line": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stats.py_None_6_StatisticsVisitor.visit_import.self_record_line_imp_line", "embedding": null, "metadata": {"file_path": "mypy/stats.py", "file_name": "stats.py", "file_type": "text/x-python", "category": "implementation", "start_line": 39, "end_line": 113, "span_ids": ["StatisticsVisitor.visit_mypy_file", "StatisticsVisitor.__init__", "StatisticsVisitor.visit_import", "StatisticsVisitor.visit_import_from", "docstring", "StatisticsVisitor.visit_import_all", "StatisticsVisitor.process_import", "StatisticsVisitor"], "tokens": 579}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": " # type: Final\n\n\nclass StatisticsVisitor(TraverserVisitor):\n def __init__(self,\n inferred: bool,\n filename: str,\n modules: Dict[str, MypyFile],\n typemap: Optional[Dict[Expression, Type]] = None,\n all_nodes: bool = False,\n visit_untyped_defs: bool = True) -> None:\n self.inferred = inferred\n self.filename = filename\n self.modules = modules\n self.typemap = typemap\n self.all_nodes = all_nodes\n self.visit_untyped_defs = visit_untyped_defs\n\n self.num_precise_exprs = 0\n self.num_imprecise_exprs = 0\n self.num_any_exprs = 0\n\n self.num_simple_types = 0\n self.num_generic_types = 0\n self.num_tuple_types = 0\n self.num_function_types = 0\n self.num_typevar_types = 0\n self.num_complex_types = 0\n self.num_any_types = 0\n\n self.line = -1\n\n self.line_map = {} # type: Dict[int, int]\n\n self.type_of_any_counter = Counter() # type: typing.Counter[int]\n self.any_line_map = {} # type: Dict[int, List[AnyType]]\n\n # For each scope (top level/function), whether the scope was type checked\n # (annotated function).\n #\n # TODO: Handle --check-untyped-defs\n self.checked_scopes = [True]\n\n self.output = [] # type: List[str]\n\n TraverserVisitor.__init__(self)\n\n def visit_mypy_file(self, o: MypyFile) -> None:\n self.cur_mod_node = o\n self.cur_mod_id = o.fullname\n super().visit_mypy_file(o)\n\n def visit_import_from(self, imp: ImportFrom) -> None:\n self.process_import(imp)\n\n def visit_import_all(self, imp: ImportAll) -> None:\n self.process_import(imp)\n\n def process_import(self, imp: Union[ImportFrom, ImportAll]) -> None:\n import_id, ok = correct_relative_import(self.cur_mod_id,\n imp.relative,\n imp.id,\n self.cur_mod_node.is_package_init_file())\n if ok and import_id in self.modules:\n kind = TYPE_PRECISE\n else:\n kind = TYPE_ANY\n self.record_line(imp.line, kind)\n\n def visit_import(self, imp: Import) -> None:\n if all(id in self.modules for id, _ in imp.ids):\n kind = TYPE_PRECISE\n else:\n kind = TYPE_ANY\n self.record_line(imp.line, kind)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stats.py_StatisticsVisitor.visit_func_def_StatisticsVisitor.visit_func_def.with_self_enter_scope_o_.if_len_o_expanded_1_an.else_.if_not_o_is_dynamic_or_.super_visit_func_def_o_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stats.py_StatisticsVisitor.visit_func_def_StatisticsVisitor.visit_func_def.with_self_enter_scope_o_.if_len_o_expanded_1_an.else_.if_not_o_is_dynamic_or_.super_visit_func_def_o_", "embedding": null, "metadata": {"file_path": "mypy/stats.py", "file_name": "stats.py", "file_type": "text/x-python", "category": "implementation", "start_line": 115, "end_line": 139, "span_ids": ["StatisticsVisitor.visit_func_def"], "tokens": 238}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StatisticsVisitor(TraverserVisitor):\n\n def visit_func_def(self, o: FuncDef) -> None:\n with self.enter_scope(o):\n self.line = o.line\n if len(o.expanded) > 1 and o.expanded != [o] * len(o.expanded):\n if o in o.expanded:\n print('{}:{}: ERROR: cycle in function expansion; skipping'.format(\n self.filename,\n o.get_line()))\n return\n for defn in o.expanded:\n self.visit_func_def(cast(FuncDef, defn))\n else:\n if o.type:\n sig = cast(CallableType, o.type)\n arg_types = sig.arg_types\n if (sig.arg_names and sig.arg_names[0] == 'self' and\n not self.inferred):\n arg_types = arg_types[1:]\n for arg in arg_types:\n self.type(arg)\n self.type(sig.ret_type)\n elif self.all_nodes:\n self.record_line(self.line, TYPE_ANY)\n if not o.is_dynamic() or self.visit_untyped_defs:\n super().visit_func_def(o)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stats.py_StatisticsVisitor.enter_scope_StatisticsVisitor.visit_class_def.o_defs_accept_self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stats.py_StatisticsVisitor.enter_scope_StatisticsVisitor.visit_class_def.o_defs_accept_self_", "embedding": null, "metadata": {"file_path": "mypy/stats.py", "file_name": "stats.py", "file_type": "text/x-python", "category": "implementation", "start_line": 141, "end_line": 158, "span_ids": ["StatisticsVisitor.enter_scope", "StatisticsVisitor.is_checked_scope", "StatisticsVisitor.visit_class_def"], "tokens": 195}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StatisticsVisitor(TraverserVisitor):\n\n @contextmanager\n def enter_scope(self, o: FuncDef) -> Iterator[None]:\n self.checked_scopes.append(o.type is not None and self.checked_scopes[-1])\n yield None\n self.checked_scopes.pop()\n\n def is_checked_scope(self) -> bool:\n return self.checked_scopes[-1]\n\n def visit_class_def(self, o: ClassDef) -> None:\n self.record_line(o.line, TYPE_PRECISE) # TODO: Look at base classes\n # Override this method because we don't want to analyze base_type_exprs (base_type_exprs\n # are base classes in a class declaration).\n # While base_type_exprs are technically expressions, type analyzer does not visit them and\n # they are not in the typemap.\n for d in o.decorators:\n d.accept(self)\n o.defs.accept(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stats.py_StatisticsVisitor.visit_type_application_StatisticsVisitor.visit_assignment_stmt.super_visit_assignment_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stats.py_StatisticsVisitor.visit_type_application_StatisticsVisitor.visit_assignment_stmt.super_visit_assignment_", "embedding": null, "metadata": {"file_path": "mypy/stats.py", "file_name": "stats.py", "file_type": "text/x-python", "category": "implementation", "start_line": 160, "end_line": 185, "span_ids": ["StatisticsVisitor.visit_type_application", "StatisticsVisitor.visit_assignment_stmt"], "tokens": 237}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StatisticsVisitor(TraverserVisitor):\n\n def visit_type_application(self, o: TypeApplication) -> None:\n self.line = o.line\n for t in o.types:\n self.type(t)\n super().visit_type_application(o)\n\n def visit_assignment_stmt(self, o: AssignmentStmt) -> None:\n self.line = o.line\n if (isinstance(o.rvalue, nodes.CallExpr) and\n isinstance(o.rvalue.analyzed, nodes.TypeVarExpr)):\n # Type variable definition -- not a real assignment.\n return\n if o.type:\n self.type(o.type)\n elif self.inferred and not self.all_nodes:\n # if self.all_nodes is set, lvalues will be visited later\n for lvalue in o.lvalues:\n if isinstance(lvalue, nodes.TupleExpr):\n items = lvalue.items\n else:\n items = [lvalue]\n for item in items:\n if isinstance(item, RefExpr) and item.is_inferred_def:\n if self.typemap is not None:\n self.type(self.typemap.get(item))\n super().visit_assignment_stmt(o)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stats.py_StatisticsVisitor.visit_expression_stmt_StatisticsVisitor.record_call_target_precision.if_isinstance_callee_type.else_._TODO_Handle_overloaded": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stats.py_StatisticsVisitor.visit_expression_stmt_StatisticsVisitor.record_call_target_precision.if_isinstance_callee_type.else_._TODO_Handle_overloaded", "embedding": null, "metadata": {"file_path": "mypy/stats.py", "file_name": "stats.py", "file_type": "text/x-python", "category": "implementation", "start_line": 187, "end_line": 236, "span_ids": ["StatisticsVisitor.visit_continue_stmt", "StatisticsVisitor.visit_name_expr", "StatisticsVisitor.record_call_target_precision", "StatisticsVisitor.visit_expression_stmt", "StatisticsVisitor.visit_yield_from_expr", "StatisticsVisitor.visit_break_stmt", "StatisticsVisitor.visit_call_expr", "StatisticsVisitor.visit_pass_stmt"], "tokens": 411}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StatisticsVisitor(TraverserVisitor):\n\n def visit_expression_stmt(self, o: ExpressionStmt) -> None:\n if isinstance(o.expr, (StrExpr, UnicodeExpr, BytesExpr)):\n # Docstring\n self.record_line(o.line, TYPE_EMPTY)\n else:\n super().visit_expression_stmt(o)\n\n def visit_pass_stmt(self, o: PassStmt) -> None:\n self.record_precise_if_checked_scope(o)\n\n def visit_break_stmt(self, o: BreakStmt) -> None:\n self.record_precise_if_checked_scope(o)\n\n def visit_continue_stmt(self, o: ContinueStmt) -> None:\n self.record_precise_if_checked_scope(o)\n\n def visit_name_expr(self, o: NameExpr) -> None:\n if o.fullname in ('builtins.None',\n 'builtins.True',\n 'builtins.False',\n 'builtins.Ellipsis'):\n self.record_precise_if_checked_scope(o)\n else:\n self.process_node(o)\n super().visit_name_expr(o)\n\n def visit_yield_from_expr(self, o: YieldFromExpr) -> None:\n if o.expr:\n o.expr.accept(self)\n\n def visit_call_expr(self, o: CallExpr) -> None:\n self.process_node(o)\n if o.analyzed:\n o.analyzed.accept(self)\n else:\n o.callee.accept(self)\n for a in o.args:\n a.accept(self)\n self.record_call_target_precision(o)\n\n def record_call_target_precision(self, o: CallExpr) -> None:\n \"\"\"Record precision of formal argument types used in a call.\"\"\"\n if not self.typemap or o.callee not in self.typemap:\n # Type not available.\n return\n callee_type = get_proper_type(self.typemap[o.callee])\n if isinstance(callee_type, CallableType):\n self.record_callable_target_precision(o, callee_type)\n else:\n pass # TODO: Handle overloaded functions, etc.", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stats.py_StatisticsVisitor.record_callable_target_precision_StatisticsVisitor.record_callable_target_precision.for_formals_in_actual_to_.for_n_in_formals_.if_isinstance_formal_Any.elif_is_imprecise_formal_.self_record_line_o_line_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stats.py_StatisticsVisitor.record_callable_target_precision_StatisticsVisitor.record_callable_target_precision.for_formals_in_actual_to_.for_n_in_formals_.if_isinstance_formal_Any.elif_is_imprecise_formal_.self_record_line_o_line_", "embedding": null, "metadata": {"file_path": "mypy/stats.py", "file_name": "stats.py", "file_type": "text/x-python", "category": "implementation", "start_line": 238, "end_line": 260, "span_ids": ["StatisticsVisitor.record_callable_target_precision"], "tokens": 223}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StatisticsVisitor(TraverserVisitor):\n\n def record_callable_target_precision(self, o: CallExpr, callee: CallableType) -> None:\n \"\"\"Record imprecision caused by callee argument types.\n\n This only considers arguments passed in a call expression. Arguments\n with default values that aren't provided in a call arguably don't\n contribute to typing imprecision at the *call site* (but they\n contribute at the function definition).\n \"\"\"\n assert self.typemap\n typemap = self.typemap\n actual_to_formal = map_formals_to_actuals(\n o.arg_kinds,\n o.arg_names,\n callee.arg_kinds,\n callee.arg_names,\n lambda n: typemap[o.args[n]])\n for formals in actual_to_formal:\n for n in formals:\n formal = get_proper_type(callee.arg_types[n])\n if isinstance(formal, AnyType):\n self.record_line(o.line, TYPE_ANY)\n elif is_imprecise(formal):\n self.record_line(o.line, TYPE_IMPRECISE)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stats.py_StatisticsVisitor.visit_member_expr_StatisticsVisitor.record_precise_if_checked_scope.self_record_line_node_lin": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stats.py_StatisticsVisitor.visit_member_expr_StatisticsVisitor.record_precise_if_checked_scope.self_record_line_node_lin", "embedding": null, "metadata": {"file_path": "mypy/stats.py", "file_name": "stats.py", "file_type": "text/x-python", "category": "implementation", "start_line": 262, "end_line": 322, "span_ids": ["StatisticsVisitor.visit_unicode_expr", "StatisticsVisitor.visit_comparison_expr", "StatisticsVisitor.visit_assignment_expr", "StatisticsVisitor.visit_bytes_expr", "StatisticsVisitor.visit_index_expr", "StatisticsVisitor.visit_complex_expr", "StatisticsVisitor.visit_op_expr", "StatisticsVisitor.visit_float_expr", "StatisticsVisitor.visit_ellipsis", "StatisticsVisitor.visit_str_expr", "StatisticsVisitor.visit_unary_expr", "StatisticsVisitor.visit_member_expr", "StatisticsVisitor.process_node", "StatisticsVisitor.record_precise_if_checked_scope", "StatisticsVisitor.visit_int_expr"], "tokens": 488}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StatisticsVisitor(TraverserVisitor):\n\n def visit_member_expr(self, o: MemberExpr) -> None:\n self.process_node(o)\n super().visit_member_expr(o)\n\n def visit_op_expr(self, o: OpExpr) -> None:\n self.process_node(o)\n super().visit_op_expr(o)\n\n def visit_comparison_expr(self, o: ComparisonExpr) -> None:\n self.process_node(o)\n super().visit_comparison_expr(o)\n\n def visit_index_expr(self, o: IndexExpr) -> None:\n self.process_node(o)\n super().visit_index_expr(o)\n\n def visit_assignment_expr(self, o: AssignmentExpr) -> None:\n self.process_node(o)\n super().visit_assignment_expr(o)\n\n def visit_unary_expr(self, o: UnaryExpr) -> None:\n self.process_node(o)\n super().visit_unary_expr(o)\n\n def visit_str_expr(self, o: StrExpr) -> None:\n self.record_precise_if_checked_scope(o)\n\n def visit_unicode_expr(self, o: UnicodeExpr) -> None:\n self.record_precise_if_checked_scope(o)\n\n def visit_bytes_expr(self, o: BytesExpr) -> None:\n self.record_precise_if_checked_scope(o)\n\n def visit_int_expr(self, o: IntExpr) -> None:\n self.record_precise_if_checked_scope(o)\n\n def visit_float_expr(self, o: FloatExpr) -> None:\n self.record_precise_if_checked_scope(o)\n\n def visit_complex_expr(self, o: ComplexExpr) -> None:\n self.record_precise_if_checked_scope(o)\n\n def visit_ellipsis(self, o: EllipsisExpr) -> None:\n self.record_precise_if_checked_scope(o)\n\n # Helpers\n\n def process_node(self, node: Expression) -> None:\n if self.all_nodes:\n if self.typemap is not None:\n self.line = node.line\n self.type(self.typemap.get(node))\n\n def record_precise_if_checked_scope(self, node: Node) -> None:\n if isinstance(node, Expression) and self.typemap and node not in self.typemap:\n kind = TYPE_UNANALYZED\n elif self.is_checked_scope():\n kind = TYPE_PRECISE\n else:\n kind = TYPE_ANY\n self.record_line(node.line, kind)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stats.py_StatisticsVisitor.type_StatisticsVisitor.record_line.self_line_map_line_max": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stats.py_StatisticsVisitor.type_StatisticsVisitor.record_line.self_line_map_line_max", "embedding": null, "metadata": {"file_path": "mypy/stats.py", "file_name": "stats.py", "file_type": "text/x-python", "category": "implementation", "start_line": 324, "end_line": 386, "span_ids": ["StatisticsVisitor.log", "StatisticsVisitor.type", "StatisticsVisitor.record_line"], "tokens": 596}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StatisticsVisitor(TraverserVisitor):\n\n def type(self, t: Optional[Type]) -> None:\n t = get_proper_type(t)\n\n if not t:\n # If an expression does not have a type, it is often due to dead code.\n # Don't count these because there can be an unanalyzed value on a line with other\n # analyzed expressions, which overwrite the TYPE_UNANALYZED.\n self.record_line(self.line, TYPE_UNANALYZED)\n return\n\n if isinstance(t, AnyType) and is_special_form_any(t):\n # TODO: What if there is an error in special form definition?\n self.record_line(self.line, TYPE_PRECISE)\n return\n\n if isinstance(t, AnyType):\n self.log(' !! Any type around line %d' % self.line)\n self.num_any_exprs += 1\n self.record_line(self.line, TYPE_ANY)\n elif ((not self.all_nodes and is_imprecise(t)) or\n (self.all_nodes and is_imprecise2(t))):\n self.log(' !! Imprecise type around line %d' % self.line)\n self.num_imprecise_exprs += 1\n self.record_line(self.line, TYPE_IMPRECISE)\n else:\n self.num_precise_exprs += 1\n self.record_line(self.line, TYPE_PRECISE)\n\n for typ in get_proper_types(collect_all_inner_types(t)) + [t]:\n if isinstance(typ, AnyType):\n typ = get_original_any(typ)\n if is_special_form_any(typ):\n continue\n self.type_of_any_counter[typ.type_of_any] += 1\n self.num_any_types += 1\n if self.line in self.any_line_map:\n self.any_line_map[self.line].append(typ)\n else:\n self.any_line_map[self.line] = [typ]\n elif isinstance(typ, Instance):\n if typ.args:\n if any(is_complex(arg) for arg in typ.args):\n self.num_complex_types += 1\n else:\n self.num_generic_types += 1\n else:\n self.num_simple_types += 1\n elif isinstance(typ, FunctionLike):\n self.num_function_types += 1\n elif isinstance(typ, TupleType):\n if any(is_complex(item) for item in typ.items):\n self.num_complex_types += 1\n else:\n self.num_tuple_types += 1\n elif isinstance(typ, TypeVarType):\n self.num_typevar_types += 1\n\n def log(self, string: str) -> None:\n self.output.append(string)\n\n def record_line(self, line: int, precision: int) -> None:\n self.line_map[line] = max(precision,\n self.line_map.get(line, TYPE_EMPTY))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stats.py_dump_type_stats_dump_type_stats.None_13": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stats.py_dump_type_stats_dump_type_stats.None_13", "embedding": null, "metadata": {"file_path": "mypy/stats.py", "file_name": "stats.py", "file_type": "text/x-python", "category": "implementation", "start_line": 389, "end_line": 415, "span_ids": ["dump_type_stats"], "tokens": 251}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def dump_type_stats(tree: MypyFile,\n path: str,\n modules: Dict[str, MypyFile],\n inferred: bool = False,\n typemap: Optional[Dict[Expression, Type]] = None) -> None:\n if is_special_module(path):\n return\n print(path)\n visitor = StatisticsVisitor(inferred,\n filename=tree.fullname,\n modules=modules,\n typemap=typemap)\n tree.accept(visitor)\n for line in visitor.output:\n print(line)\n print(' ** precision **')\n print(' precise ', visitor.num_precise_exprs)\n print(' imprecise', visitor.num_imprecise_exprs)\n print(' any ', visitor.num_any_exprs)\n print(' ** kinds **')\n print(' simple ', visitor.num_simple_types)\n print(' generic ', visitor.num_generic_types)\n print(' function ', visitor.num_function_types)\n print(' tuple ', visitor.num_tuple_types)\n print(' TypeVar ', visitor.num_typevar_types)\n print(' complex ', visitor.num_complex_types)\n print(' any ', visitor.num_any_types)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stats.py_is_special_module_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stats.py_is_special_module_", "embedding": null, "metadata": {"file_path": "mypy/stats.py", "file_name": "stats.py", "file_type": "text/x-python", "category": "implementation", "start_line": 418, "end_line": 471, "span_ids": ["HasAnyQuery", "is_imprecise", "is_special_form_any", "HasAnyQuery2.visit_callable_type", "is_complex", "is_imprecise2", "is_generic", "HasAnyQuery2", "ensure_dir_exists", "get_original_any", "HasAnyQuery.__init__", "HasAnyQuery.visit_any", "is_special_module"], "tokens": 374}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_special_module(path: str) -> bool:\n return os.path.basename(path) in ('abc.pyi', 'typing.pyi', 'builtins.pyi')\n\n\ndef is_imprecise(t: Type) -> bool:\n return t.accept(HasAnyQuery())\n\n\nclass HasAnyQuery(TypeQuery[bool]):\n def __init__(self) -> None:\n super().__init__(any)\n\n def visit_any(self, t: AnyType) -> bool:\n return not is_special_form_any(t)\n\n\ndef is_imprecise2(t: Type) -> bool:\n return t.accept(HasAnyQuery2())\n\n\nclass HasAnyQuery2(HasAnyQuery):\n def visit_callable_type(self, t: CallableType) -> bool:\n # We don't want to flag references to functions with some Any\n # argument types (etc.) since they generally don't mean trouble.\n return False\n\n\ndef is_generic(t: Type) -> bool:\n t = get_proper_type(t)\n return isinstance(t, Instance) and bool(t.args)\n\n\ndef is_complex(t: Type) -> bool:\n t = get_proper_type(t)\n return is_generic(t) or isinstance(t, (FunctionLike, TupleType,\n TypeVarType))\n\n\ndef ensure_dir_exists(dir: str) -> None:\n if not os.path.exists(dir):\n os.makedirs(dir)\n\n\ndef is_special_form_any(t: AnyType) -> bool:\n return get_original_any(t).type_of_any == TypeOfAny.special_form\n\n\ndef get_original_any(t: AnyType) -> AnyType:\n if t.type_of_any == TypeOfAny.from_another_any:\n assert t.source_any\n assert t.source_any.type_of_any != TypeOfAny.from_another_any\n t = t.source_any\n return t", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py__Conversion_of_parse_tr_StrConv.format_id.if_self_id_mapper_.else_.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py__Conversion_of_parse_tr_StrConv.format_id.if_self_id_mapper_.else_.return._", "embedding": null, "metadata": {"file_path": "mypy/strconv.py", "file_name": "strconv.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 40, "span_ids": ["StrConv.get_id", "StrConv.format_id", "StrConv", "StrConv.__init__", "docstring"], "tokens": 244}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Conversion of parse tree nodes to strings.\"\"\"\n\nimport re\nimport os\n\nfrom typing import Any, List, Tuple, Optional, Union, Sequence\n\nfrom mypy.util import short_type, IdMapper\nimport mypy.nodes\nfrom mypy.visitor import NodeVisitor\n\n\nclass StrConv(NodeVisitor[str]):\n \"\"\"Visitor for converting a node to a human-readable string.\n\n For example, an MypyFile node from program '1' is converted into\n something like this:\n\n MypyFile:1(\n fnam\n ExpressionStmt:1(\n IntExpr(1)))\n \"\"\"\n\n def __init__(self, show_ids: bool = False) -> None:\n self.show_ids = show_ids\n self.id_mapper = None # type: Optional[IdMapper]\n if show_ids:\n self.id_mapper = IdMapper()\n\n def get_id(self, o: object) -> Optional[int]:\n if self.id_mapper:\n return self.id_mapper.id(o)\n return None\n\n def format_id(self, o: object) -> str:\n if self.id_mapper:\n return '<{}>'.format(self.get_id(o))\n else:\n return ''", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv.dump_StrConv.dump.return.dump_tagged_nodes_tag_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv.dump_StrConv.dump.return.dump_tagged_nodes_tag_s", "embedding": null, "metadata": {"file_path": "mypy/strconv.py", "file_name": "strconv.py", "file_type": "text/x-python", "category": "implementation", "start_line": 42, "end_line": 53, "span_ids": ["StrConv.dump"], "tokens": 135}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StrConv(NodeVisitor[str]):\n\n def dump(self, nodes: Sequence[object], obj: 'mypy.nodes.Context') -> str:\n \"\"\"Convert a list of items to a multiline pretty-printed string.\n\n The tag is produced from the type name of obj and its line\n number. See mypy.util.dump_tagged for a description of the nodes\n argument.\n \"\"\"\n tag = short_type(obj) + ':' + str(obj.get_line())\n if self.show_ids:\n assert self.id_mapper is not None\n tag += '<{}>'.format(self.get_id(obj))\n return dump_tagged(nodes, tag, self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv.func_helper_StrConv.func_helper.return.a": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv.func_helper_StrConv.func_helper.return.a", "embedding": null, "metadata": {"file_path": "mypy/strconv.py", "file_name": "strconv.py", "file_type": "text/x-python", "category": "implementation", "start_line": 55, "end_line": 83, "span_ids": ["StrConv.func_helper"], "tokens": 318}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StrConv(NodeVisitor[str]):\n\n def func_helper(self, o: 'mypy.nodes.FuncItem') -> List[object]:\n \"\"\"Return a list in a format suitable for dump() that represents the\n arguments and the body of a function. The caller can then decorate the\n array with information specific to methods, global functions or\n anonymous functions.\n \"\"\"\n args = [] # type: List[Union[mypy.nodes.Var, Tuple[str, List[mypy.nodes.Node]]]]\n extra = [] # type: List[Tuple[str, List[mypy.nodes.Var]]]\n for arg in o.arguments:\n kind = arg.kind # type: int\n if kind in (mypy.nodes.ARG_POS, mypy.nodes.ARG_NAMED):\n args.append(arg.variable)\n elif kind in (mypy.nodes.ARG_OPT, mypy.nodes.ARG_NAMED_OPT):\n assert arg.initializer is not None\n args.append(('default', [arg.variable, arg.initializer]))\n elif kind == mypy.nodes.ARG_STAR:\n extra.append(('VarArg', [arg.variable]))\n elif kind == mypy.nodes.ARG_STAR2:\n extra.append(('DictVarArg', [arg.variable]))\n a = [] # type: List[Any]\n if args:\n a.append(('Args', args))\n if o.type:\n a.append(o.type)\n if o.is_generator:\n a.append('Generator')\n a.extend(extra)\n a.append(o.body)\n return a", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv._Top_level_structures_StrConv.visit_mypy_file.return.self_dump_a_o_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv._Top_level_structures_StrConv.visit_mypy_file.return.self_dump_a_o_", "embedding": null, "metadata": {"file_path": "mypy/strconv.py", "file_name": "strconv.py", "file_type": "text/x-python", "category": "implementation", "start_line": 85, "end_line": 102, "span_ids": ["StrConv.func_helper", "StrConv.visit_mypy_file"], "tokens": 202}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StrConv(NodeVisitor[str]):\n\n # Top-level structures\n\n def visit_mypy_file(self, o: 'mypy.nodes.MypyFile') -> str:\n # Skip implicit definitions.\n a = [o.defs] # type: List[Any]\n if o.is_bom:\n a.insert(0, 'BOM')\n # Omit path to special file with name \"main\". This is used to simplify\n # test case descriptions; the file \"main\" is used by default in many\n # test cases.\n if o.path != 'main':\n # Insert path. Normalize directory separators to / to unify test\n # case# output in all platforms.\n a.insert(0, o.path.replace(os.sep, '/'))\n if o.ignored_lines:\n a.append('IgnoredLines(%s)' % ', '.join(str(line)\n for line in sorted(o.ignored_lines)))\n return self.dump(a, o)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv.visit_import_StrConv._Definitions": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv.visit_import_StrConv._Definitions", "embedding": null, "metadata": {"file_path": "mypy/strconv.py", "file_name": "strconv.py", "file_type": "text/x-python", "category": "implementation", "start_line": 104, "end_line": 125, "span_ids": ["StrConv.visit_import_all", "StrConv.visit_import_from", "StrConv.visit_import"], "tokens": 216}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StrConv(NodeVisitor[str]):\n\n def visit_import(self, o: 'mypy.nodes.Import') -> str:\n a = []\n for id, as_id in o.ids:\n if as_id is not None:\n a.append('{} : {}'.format(id, as_id))\n else:\n a.append(id)\n return 'Import:{}({})'.format(o.line, ', '.join(a))\n\n def visit_import_from(self, o: 'mypy.nodes.ImportFrom') -> str:\n a = []\n for name, as_name in o.names:\n if as_name is not None:\n a.append('{} : {}'.format(name, as_name))\n else:\n a.append(name)\n return 'ImportFrom:{}({}, [{}])'.format(o.line, \".\" * o.relative + o.id, ', '.join(a))\n\n def visit_import_all(self, o: 'mypy.nodes.ImportAll') -> str:\n return 'ImportAll:{}({})'.format(o.line, \".\" * o.relative + o.id)\n\n # Definitions", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv.visit_func_def_StrConv.visit_overloaded_func_def.return.self_dump_a_o_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv.visit_func_def_StrConv.visit_overloaded_func_def.return.self_dump_a_o_", "embedding": null, "metadata": {"file_path": "mypy/strconv.py", "file_name": "strconv.py", "file_type": "text/x-python", "category": "implementation", "start_line": 127, "end_line": 153, "span_ids": ["StrConv.visit_func_def", "StrConv.visit_overloaded_func_def"], "tokens": 274}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StrConv(NodeVisitor[str]):\n\n def visit_func_def(self, o: 'mypy.nodes.FuncDef') -> str:\n a = self.func_helper(o)\n a.insert(0, o.name)\n arg_kinds = {arg.kind for arg in o.arguments}\n if len(arg_kinds & {mypy.nodes.ARG_NAMED, mypy.nodes.ARG_NAMED_OPT}) > 0:\n a.insert(1, 'MaxPos({})'.format(o.max_pos))\n if o.is_abstract:\n a.insert(-1, 'Abstract')\n if o.is_static:\n a.insert(-1, 'Static')\n if o.is_class:\n a.insert(-1, 'Class')\n if o.is_property:\n a.insert(-1, 'Property')\n return self.dump(a, o)\n\n def visit_overloaded_func_def(self, o: 'mypy.nodes.OverloadedFuncDef') -> str:\n a = o.items[:] # type: Any\n if o.type:\n a.insert(0, o.type)\n if o.impl:\n a.insert(0, o.impl)\n if o.is_static:\n a.insert(-1, 'Static')\n if o.is_class:\n a.insert(-1, 'Class')\n return self.dump(a, o)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv.visit_class_def_StrConv.visit_class_def.return.self_dump_a_o_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv.visit_class_def_StrConv.visit_class_def.return.self_dump_a_o_", "embedding": null, "metadata": {"file_path": "mypy/strconv.py", "file_name": "strconv.py", "file_type": "text/x-python", "category": "implementation", "start_line": 155, "end_line": 178, "span_ids": ["StrConv.visit_class_def"], "tokens": 300}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StrConv(NodeVisitor[str]):\n\n def visit_class_def(self, o: 'mypy.nodes.ClassDef') -> str:\n a = [o.name, o.defs.body]\n # Display base types unless they are implicitly just builtins.object\n # (in this case base_type_exprs is empty).\n if o.base_type_exprs:\n if o.info and o.info.bases:\n if (len(o.info.bases) != 1\n or o.info.bases[0].type.fullname != 'builtins.object'):\n a.insert(1, ('BaseType', o.info.bases))\n else:\n a.insert(1, ('BaseTypeExpr', o.base_type_exprs))\n if o.type_vars:\n a.insert(1, ('TypeVars', o.type_vars))\n if o.metaclass:\n a.insert(1, 'Metaclass({})'.format(o.metaclass))\n if o.decorators:\n a.insert(1, ('Decorators', o.decorators))\n if o.info and o.info._promote:\n a.insert(1, 'Promote({})'.format(o.info._promote))\n if o.info and o.info.tuple_type:\n a.insert(1, ('TupleType', [o.info.tuple_type]))\n if o.info and o.info.fallback_to_any:\n a.insert(1, 'FallbackToAny')\n return self.dump(a, o)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv.visit_var_StrConv.visit_raise_stmt.return.self_dump_o_expr_o_from": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv.visit_var_StrConv.visit_raise_stmt.return.self_dump_o_expr_o_from", "embedding": null, "metadata": {"file_path": "mypy/strconv.py", "file_name": "strconv.py", "file_type": "text/x-python", "category": "implementation", "start_line": 180, "end_line": 261, "span_ids": ["StrConv.visit_pass_stmt", "StrConv.visit_decorator", "StrConv.visit_global_decl", "StrConv.visit_assignment_stmt", "StrConv.visit_if_stmt", "StrConv.visit_nonlocal_decl", "StrConv.visit_expression_stmt", "StrConv.visit_continue_stmt", "StrConv.visit_operator_assignment_stmt", "StrConv.visit_return_stmt", "StrConv.visit_while_stmt", "StrConv.visit_block", "StrConv.visit_for_stmt", "StrConv.visit_raise_stmt", "StrConv.visit_break_stmt", "StrConv.visit_var"], "tokens": 777}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StrConv(NodeVisitor[str]):\n\n def visit_var(self, o: 'mypy.nodes.Var') -> str:\n lst = ''\n # Add :nil line number tag if no line number is specified to remain\n # compatible with old test case descriptions that assume this.\n if o.line < 0:\n lst = ':nil'\n return 'Var' + lst + '(' + o.name + ')'\n\n def visit_global_decl(self, o: 'mypy.nodes.GlobalDecl') -> str:\n return self.dump([o.names], o)\n\n def visit_nonlocal_decl(self, o: 'mypy.nodes.NonlocalDecl') -> str:\n return self.dump([o.names], o)\n\n def visit_decorator(self, o: 'mypy.nodes.Decorator') -> str:\n return self.dump([o.var, o.decorators, o.func], o)\n\n # Statements\n\n def visit_block(self, o: 'mypy.nodes.Block') -> str:\n return self.dump(o.body, o)\n\n def visit_expression_stmt(self, o: 'mypy.nodes.ExpressionStmt') -> str:\n return self.dump([o.expr], o)\n\n def visit_assignment_stmt(self, o: 'mypy.nodes.AssignmentStmt') -> str:\n a = [] # type: List[Any]\n if len(o.lvalues) > 1:\n a = [('Lvalues', o.lvalues)]\n else:\n a = [o.lvalues[0]]\n a.append(o.rvalue)\n if o.type:\n a.append(o.type)\n return self.dump(a, o)\n\n def visit_operator_assignment_stmt(self, o: 'mypy.nodes.OperatorAssignmentStmt') -> str:\n return self.dump([o.op, o.lvalue, o.rvalue], o)\n\n def visit_while_stmt(self, o: 'mypy.nodes.WhileStmt') -> str:\n a = [o.expr, o.body] # type: List[Any]\n if o.else_body:\n a.append(('Else', o.else_body.body))\n return self.dump(a, o)\n\n def visit_for_stmt(self, o: 'mypy.nodes.ForStmt') -> str:\n a = [] # type: List[Any]\n if o.is_async:\n a.append(('Async', ''))\n a.append(o.index)\n if o.index_type:\n a.append(o.index_type)\n a.extend([o.expr, o.body])\n if o.else_body:\n a.append(('Else', o.else_body.body))\n return self.dump(a, o)\n\n def visit_return_stmt(self, o: 'mypy.nodes.ReturnStmt') -> str:\n return self.dump([o.expr], o)\n\n def visit_if_stmt(self, o: 'mypy.nodes.IfStmt') -> str:\n a = [] # type: List[Any]\n for i in range(len(o.expr)):\n a.append(('If', [o.expr[i]]))\n a.append(('Then', o.body[i].body))\n\n if not o.else_body:\n return self.dump(a, o)\n else:\n return self.dump([a, ('Else', o.else_body.body)], o)\n\n def visit_break_stmt(self, o: 'mypy.nodes.BreakStmt') -> str:\n return self.dump([], o)\n\n def visit_continue_stmt(self, o: 'mypy.nodes.ContinueStmt') -> str:\n return self.dump([], o)\n\n def visit_pass_stmt(self, o: 'mypy.nodes.PassStmt') -> str:\n return self.dump([], o)\n\n def visit_raise_stmt(self, o: 'mypy.nodes.RaiseStmt') -> str:\n return self.dump([o.expr, o.from_expr], o)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv.visit_assert_stmt_StrConv.visit_del_stmt.return.self_dump_o_expr_o_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv.visit_assert_stmt_StrConv.visit_del_stmt.return.self_dump_o_expr_o_", "embedding": null, "metadata": {"file_path": "mypy/strconv.py", "file_name": "strconv.py", "file_type": "text/x-python", "category": "implementation", "start_line": 263, "end_line": 273, "span_ids": ["StrConv.visit_await_expr", "StrConv.visit_assert_stmt", "StrConv.visit_del_stmt"], "tokens": 122}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StrConv(NodeVisitor[str]):\n\n def visit_assert_stmt(self, o: 'mypy.nodes.AssertStmt') -> str:\n if o.msg is not None:\n return self.dump([o.expr, o.msg], o)\n else:\n return self.dump([o.expr], o)\n\n def visit_await_expr(self, o: 'mypy.nodes.AwaitExpr') -> str:\n return self.dump([o.expr], o)\n\n def visit_del_stmt(self, o: 'mypy.nodes.DelStmt') -> str:\n return self.dump([o.expr], o)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv.visit_try_stmt_StrConv.visit_try_stmt.return.self_dump_a_o_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv.visit_try_stmt_StrConv.visit_try_stmt.return.self_dump_a_o_", "embedding": null, "metadata": {"file_path": "mypy/strconv.py", "file_name": "strconv.py", "file_type": "text/x-python", "category": "implementation", "start_line": 275, "end_line": 289, "span_ids": ["StrConv.visit_try_stmt"], "tokens": 123}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StrConv(NodeVisitor[str]):\n\n def visit_try_stmt(self, o: 'mypy.nodes.TryStmt') -> str:\n a = [o.body] # type: List[Any]\n\n for i in range(len(o.vars)):\n a.append(o.types[i])\n if o.vars[i]:\n a.append(o.vars[i])\n a.append(o.handlers[i])\n\n if o.else_body:\n a.append(('Else', o.else_body.body))\n if o.finally_body:\n a.append(('Finally', o.finally_body.body))\n\n return self.dump(a, o)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv.visit_with_stmt_StrConv.visit_name_expr.return.short_type_o_pre": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv.visit_with_stmt_StrConv.visit_name_expr.return.short_type_o_pre", "embedding": null, "metadata": {"file_path": "mypy/strconv.py", "file_name": "strconv.py", "file_type": "text/x-python", "category": "implementation", "start_line": 291, "end_line": 353, "span_ids": ["StrConv.str_repr", "StrConv.visit_star_expr", "StrConv.visit_str_expr", "StrConv.visit_unicode_expr", "StrConv.visit_name_expr", "StrConv.visit_float_expr", "StrConv.visit_ellipsis", "StrConv.visit_bytes_expr", "StrConv.visit_with_stmt", "StrConv.visit_exec_stmt", "StrConv.visit_int_expr", "StrConv.visit_complex_expr", "StrConv.visit_print_stmt"], "tokens": 659}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StrConv(NodeVisitor[str]):\n\n def visit_with_stmt(self, o: 'mypy.nodes.WithStmt') -> str:\n a = [] # type: List[Any]\n if o.is_async:\n a.append(('Async', ''))\n for i in range(len(o.expr)):\n a.append(('Expr', [o.expr[i]]))\n if o.target[i]:\n a.append(('Target', [o.target[i]]))\n if o.unanalyzed_type:\n a.append(o.unanalyzed_type)\n return self.dump(a + [o.body], o)\n\n def visit_print_stmt(self, o: 'mypy.nodes.PrintStmt') -> str:\n a = o.args[:] # type: List[Any]\n if o.target:\n a.append(('Target', [o.target]))\n if o.newline:\n a.append('Newline')\n return self.dump(a, o)\n\n def visit_exec_stmt(self, o: 'mypy.nodes.ExecStmt') -> str:\n return self.dump([o.expr, o.globals, o.locals], o)\n\n # Expressions\n\n # Simple expressions\n\n def visit_int_expr(self, o: 'mypy.nodes.IntExpr') -> str:\n return 'IntExpr({})'.format(o.value)\n\n def visit_str_expr(self, o: 'mypy.nodes.StrExpr') -> str:\n return 'StrExpr({})'.format(self.str_repr(o.value))\n\n def visit_bytes_expr(self, o: 'mypy.nodes.BytesExpr') -> str:\n return 'BytesExpr({})'.format(self.str_repr(o.value))\n\n def visit_unicode_expr(self, o: 'mypy.nodes.UnicodeExpr') -> str:\n return 'UnicodeExpr({})'.format(self.str_repr(o.value))\n\n def str_repr(self, s: str) -> str:\n s = re.sub(r'\\\\u[0-9a-fA-F]{4}', lambda m: '\\\\' + m.group(0), s)\n return re.sub('[^\\\\x20-\\\\x7e]',\n lambda m: r'\\u%.4x' % ord(m.group(0)), s)\n\n def visit_float_expr(self, o: 'mypy.nodes.FloatExpr') -> str:\n return 'FloatExpr({})'.format(o.value)\n\n def visit_complex_expr(self, o: 'mypy.nodes.ComplexExpr') -> str:\n return 'ComplexExpr({})'.format(o.value)\n\n def visit_ellipsis(self, o: 'mypy.nodes.EllipsisExpr') -> str:\n return 'Ellipsis'\n\n def visit_star_expr(self, o: 'mypy.nodes.StarExpr') -> str:\n return self.dump([o.expr], o)\n\n def visit_name_expr(self, o: 'mypy.nodes.NameExpr') -> str:\n pretty = self.pretty_name(o.name, o.kind, o.fullname,\n o.is_inferred_def or o.is_special_form,\n o.node)\n if isinstance(o.node, mypy.nodes.Var) and o.node.is_final:\n pretty += ' = {}'.format(o.node.final_value)\n return short_type(o) + '(' + pretty + ')'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv.pretty_name_StrConv.pretty_name.return.n": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv.pretty_name_StrConv.pretty_name.return.n", "embedding": null, "metadata": {"file_path": "mypy/strconv.py", "file_name": "strconv.py", "file_type": "text/x-python", "category": "implementation", "start_line": 355, "end_line": 378, "span_ids": ["StrConv.pretty_name"], "tokens": 232}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StrConv(NodeVisitor[str]):\n\n def pretty_name(self, name: str, kind: Optional[int], fullname: Optional[str],\n is_inferred_def: bool, target_node: 'Optional[mypy.nodes.Node]' = None) -> str:\n n = name\n if is_inferred_def:\n n += '*'\n if target_node:\n id = self.format_id(target_node)\n else:\n id = ''\n if isinstance(target_node, mypy.nodes.MypyFile) and name == fullname:\n n += id\n elif kind == mypy.nodes.GDEF or (fullname != name and\n fullname is not None):\n # Append fully qualified name for global references.\n n += ' [{}{}]'.format(fullname, id)\n elif kind == mypy.nodes.LDEF:\n # Add tag to signify a local reference.\n n += ' [l{}]'.format(id)\n elif kind == mypy.nodes.MDEF:\n # Add tag to signify a member reference.\n n += ' [m{}]'.format(id)\n else:\n n += id\n return n", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv.visit_member_expr_StrConv.visit_yield_from_expr.if_o_expr_.else_.return.self_dump_o_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv.visit_member_expr_StrConv.visit_yield_from_expr.if_o_expr_.else_.return.self_dump_o_", "embedding": null, "metadata": {"file_path": "mypy/strconv.py", "file_name": "strconv.py", "file_type": "text/x-python", "category": "implementation", "start_line": 380, "end_line": 391, "span_ids": ["StrConv.visit_yield_from_expr", "StrConv.visit_yield_expr", "StrConv.visit_member_expr"], "tokens": 143}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StrConv(NodeVisitor[str]):\n\n def visit_member_expr(self, o: 'mypy.nodes.MemberExpr') -> str:\n pretty = self.pretty_name(o.name, o.kind, o.fullname, o.is_inferred_def, o.node)\n return self.dump([o.expr, pretty], o)\n\n def visit_yield_expr(self, o: 'mypy.nodes.YieldExpr') -> str:\n return self.dump([o.expr], o)\n\n def visit_yield_from_expr(self, o: 'mypy.nodes.YieldFromExpr') -> str:\n if o.expr:\n return self.dump([o.expr.accept(self)], o)\n else:\n return self.dump([], o)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv.visit_call_expr_StrConv.visit_call_expr.return.self_dump_a_extra_o_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv.visit_call_expr_StrConv.visit_call_expr.return.self_dump_a_extra_o_", "embedding": null, "metadata": {"file_path": "mypy/strconv.py", "file_name": "strconv.py", "file_type": "text/x-python", "category": "implementation", "start_line": 393, "end_line": 410, "span_ids": ["StrConv.visit_call_expr"], "tokens": 233}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StrConv(NodeVisitor[str]):\n\n def visit_call_expr(self, o: 'mypy.nodes.CallExpr') -> str:\n if o.analyzed:\n return o.analyzed.accept(self)\n args = [] # type: List[mypy.nodes.Expression]\n extra = [] # type: List[Union[str, Tuple[str, List[Any]]]]\n for i, kind in enumerate(o.arg_kinds):\n if kind in [mypy.nodes.ARG_POS, mypy.nodes.ARG_STAR]:\n args.append(o.args[i])\n if kind == mypy.nodes.ARG_STAR:\n extra.append('VarArg')\n elif kind == mypy.nodes.ARG_NAMED:\n extra.append(('KwArgs', [o.arg_names[i], o.args[i]]))\n elif kind == mypy.nodes.ARG_STAR2:\n extra.append(('DictVarArg', [o.args[i]]))\n else:\n raise RuntimeError('unknown kind %d' % kind)\n a = [o.callee, ('Args', args)] # type: List[Any]\n return self.dump(a + extra, o)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv.visit_op_expr_StrConv.visit_type_application.return.self_dump_o_expr_Type": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv.visit_op_expr_StrConv.visit_type_application.return.self_dump_o_expr_Type", "embedding": null, "metadata": {"file_path": "mypy/strconv.py", "file_name": "strconv.py", "file_type": "text/x-python", "category": "implementation", "start_line": 412, "end_line": 455, "span_ids": ["StrConv.visit_unary_expr", "StrConv.visit_op_expr", "StrConv.visit_dict_expr", "StrConv.visit_cast_expr", "StrConv.visit_tuple_expr", "StrConv.visit_index_expr", "StrConv.visit_list_expr", "StrConv.visit_set_expr", "StrConv.visit_reveal_expr", "StrConv.visit_comparison_expr", "StrConv.visit_type_application", "StrConv.visit_assignment_expr", "StrConv.visit_super_expr"], "tokens": 480}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StrConv(NodeVisitor[str]):\n\n def visit_op_expr(self, o: 'mypy.nodes.OpExpr') -> str:\n return self.dump([o.op, o.left, o.right], o)\n\n def visit_comparison_expr(self, o: 'mypy.nodes.ComparisonExpr') -> str:\n return self.dump([o.operators, o.operands], o)\n\n def visit_cast_expr(self, o: 'mypy.nodes.CastExpr') -> str:\n return self.dump([o.expr, o.type], o)\n\n def visit_reveal_expr(self, o: 'mypy.nodes.RevealExpr') -> str:\n if o.kind == mypy.nodes.REVEAL_TYPE:\n return self.dump([o.expr], o)\n else:\n # REVEAL_LOCALS\n return self.dump([o.local_nodes], o)\n\n def visit_assignment_expr(self, o: 'mypy.nodes.AssignmentExpr') -> str:\n return self.dump([o.target, o.value], o)\n\n def visit_unary_expr(self, o: 'mypy.nodes.UnaryExpr') -> str:\n return self.dump([o.op, o.expr], o)\n\n def visit_list_expr(self, o: 'mypy.nodes.ListExpr') -> str:\n return self.dump(o.items, o)\n\n def visit_dict_expr(self, o: 'mypy.nodes.DictExpr') -> str:\n return self.dump([[k, v] for k, v in o.items], o)\n\n def visit_set_expr(self, o: 'mypy.nodes.SetExpr') -> str:\n return self.dump(o.items, o)\n\n def visit_tuple_expr(self, o: 'mypy.nodes.TupleExpr') -> str:\n return self.dump(o.items, o)\n\n def visit_index_expr(self, o: 'mypy.nodes.IndexExpr') -> str:\n if o.analyzed:\n return o.analyzed.accept(self)\n return self.dump([o.base, o.index], o)\n\n def visit_super_expr(self, o: 'mypy.nodes.SuperExpr') -> str:\n return self.dump([o.name, o.call], o)\n\n def visit_type_application(self, o: 'mypy.nodes.TypeApplication') -> str:\n return self.dump([o.expr, ('Types', o.types)], o)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv.visit_type_var_expr_StrConv.visit_type_var_expr.return.self_dump_a_o_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv.visit_type_var_expr_StrConv.visit_type_var_expr.return.self_dump_a_o_", "embedding": null, "metadata": {"file_path": "mypy/strconv.py", "file_name": "strconv.py", "file_type": "text/x-python", "category": "implementation", "start_line": 457, "end_line": 468, "span_ids": ["StrConv.visit_type_var_expr"], "tokens": 150}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StrConv(NodeVisitor[str]):\n\n def visit_type_var_expr(self, o: 'mypy.nodes.TypeVarExpr') -> str:\n import mypy.types\n a = [] # type: List[Any]\n if o.variance == mypy.nodes.COVARIANT:\n a += ['Variance(COVARIANT)']\n if o.variance == mypy.nodes.CONTRAVARIANT:\n a += ['Variance(CONTRAVARIANT)']\n if o.values:\n a += [('Values', o.values)]\n if not mypy.types.is_named_instance(o.upper_bound, 'builtins.object'):\n a += ['UpperBound({})'.format(o.upper_bound)]\n return self.dump(a, o)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv.visit_paramspec_expr_StrConv.visit_paramspec_expr.return.self_dump_a_o_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv.visit_paramspec_expr_StrConv.visit_paramspec_expr.return.self_dump_a_o_", "embedding": null, "metadata": {"file_path": "mypy/strconv.py", "file_name": "strconv.py", "file_type": "text/x-python", "category": "implementation", "start_line": 470, "end_line": 479, "span_ids": ["StrConv.visit_paramspec_expr"], "tokens": 136}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StrConv(NodeVisitor[str]):\n\n def visit_paramspec_expr(self, o: 'mypy.nodes.ParamSpecExpr') -> str:\n import mypy.types\n a = [] # type: List[Any]\n if o.variance == mypy.nodes.COVARIANT:\n a += ['Variance(COVARIANT)']\n if o.variance == mypy.nodes.CONTRAVARIANT:\n a += ['Variance(CONTRAVARIANT)']\n if not mypy.types.is_named_instance(o.upper_bound, 'builtins.object'):\n a += ['UpperBound({})'.format(o.upper_bound)]\n return self.dump(a, o)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv.visit_type_alias_expr_StrConv.visit_temp_node.return.self_dump_o_type_o_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_StrConv.visit_type_alias_expr_StrConv.visit_temp_node.return.self_dump_o_type_o_", "embedding": null, "metadata": {"file_path": "mypy/strconv.py", "file_name": "strconv.py", "file_type": "text/x-python", "category": "implementation", "start_line": 481, "end_line": 536, "span_ids": ["StrConv.visit_newtype_expr", "StrConv.visit_lambda_expr", "StrConv.visit__promote_expr", "StrConv.visit_conditional_expr", "StrConv.visit_slice_expr", "StrConv.visit_temp_node", "StrConv.visit_enum_call_expr", "StrConv.visit_typeddict_expr", "StrConv.visit_list_comprehension", "StrConv.visit_type_alias_expr", "StrConv.visit_generator_expr", "StrConv.visit_dictionary_comprehension", "StrConv.visit_namedtuple_expr", "StrConv.visit_backquote_expr", "StrConv.visit_set_comprehension"], "tokens": 665}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StrConv(NodeVisitor[str]):\n\n def visit_type_alias_expr(self, o: 'mypy.nodes.TypeAliasExpr') -> str:\n return 'TypeAliasExpr({})'.format(o.type)\n\n def visit_namedtuple_expr(self, o: 'mypy.nodes.NamedTupleExpr') -> str:\n return 'NamedTupleExpr:{}({}, {})'.format(o.line,\n o.info.name,\n o.info.tuple_type)\n\n def visit_enum_call_expr(self, o: 'mypy.nodes.EnumCallExpr') -> str:\n return 'EnumCallExpr:{}({}, {})'.format(o.line, o.info.name, o.items)\n\n def visit_typeddict_expr(self, o: 'mypy.nodes.TypedDictExpr') -> str:\n return 'TypedDictExpr:{}({})'.format(o.line,\n o.info.name)\n\n def visit__promote_expr(self, o: 'mypy.nodes.PromoteExpr') -> str:\n return 'PromoteExpr:{}({})'.format(o.line, o.type)\n\n def visit_newtype_expr(self, o: 'mypy.nodes.NewTypeExpr') -> str:\n return 'NewTypeExpr:{}({}, {})'.format(o.line, o.name,\n self.dump([o.old_type], o))\n\n def visit_lambda_expr(self, o: 'mypy.nodes.LambdaExpr') -> str:\n a = self.func_helper(o)\n return self.dump(a, o)\n\n def visit_generator_expr(self, o: 'mypy.nodes.GeneratorExpr') -> str:\n condlists = o.condlists if any(o.condlists) else None\n return self.dump([o.left_expr, o.indices, o.sequences, condlists], o)\n\n def visit_list_comprehension(self, o: 'mypy.nodes.ListComprehension') -> str:\n return self.dump([o.generator], o)\n\n def visit_set_comprehension(self, o: 'mypy.nodes.SetComprehension') -> str:\n return self.dump([o.generator], o)\n\n def visit_dictionary_comprehension(self, o: 'mypy.nodes.DictionaryComprehension') -> str:\n condlists = o.condlists if any(o.condlists) else None\n return self.dump([o.key, o.value, o.indices, o.sequences, condlists], o)\n\n def visit_conditional_expr(self, o: 'mypy.nodes.ConditionalExpr') -> str:\n return self.dump([('Condition', [o.cond]), o.if_expr, o.else_expr], o)\n\n def visit_slice_expr(self, o: 'mypy.nodes.SliceExpr') -> str:\n a = [o.begin_index, o.end_index, o.stride] # type: List[Any]\n if not a[0]:\n a[0] = ''\n if not a[1]:\n a[1] = ''\n return self.dump(a, o)\n\n def visit_backquote_expr(self, o: 'mypy.nodes.BackquoteExpr') -> str:\n return self.dump([o.expr], o)\n\n def visit_temp_node(self, o: 'mypy.nodes.TempNode') -> str:\n return self.dump([o.type], o)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_dump_tagged_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/strconv.py_dump_tagged_", "embedding": null, "metadata": {"file_path": "mypy/strconv.py", "file_name": "strconv.py", "file_type": "text/x-python", "category": "implementation", "start_line": 539, "end_line": 579, "span_ids": ["dump_tagged", "indent"], "tokens": 345}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def dump_tagged(nodes: Sequence[object], tag: Optional[str], str_conv: 'StrConv') -> str:\n \"\"\"Convert an array into a pretty-printed multiline string representation.\n\n The format is\n tag(\n item1..\n itemN)\n Individual items are formatted like this:\n - arrays are flattened\n - pairs (str, array) are converted recursively, so that str is the tag\n - other items are converted to strings and indented\n \"\"\"\n from mypy.types import Type, TypeStrVisitor\n\n a = [] # type: List[str]\n if tag:\n a.append(tag + '(')\n for n in nodes:\n if isinstance(n, list):\n if n:\n a.append(dump_tagged(n, None, str_conv))\n elif isinstance(n, tuple):\n s = dump_tagged(n[1], n[0], str_conv)\n a.append(indent(s, 2))\n elif isinstance(n, mypy.nodes.Node):\n a.append(indent(n.accept(str_conv), 2))\n elif isinstance(n, Type):\n a.append(indent(n.accept(TypeStrVisitor(str_conv.id_mapper)), 2))\n elif n is not None:\n a.append(indent(str(n), 2))\n if tag:\n a[-1] += ')'\n return '\\n'.join(a)\n\n\ndef indent(s: str, n: int) -> str:\n \"\"\"Indent all the lines in s (separated by newlines) by n spaces.\"\"\"\n s = ' ' * n + s\n s = s.replace('\\n', '\\n' + ' ' * n)\n return s", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubdoc.py__Parsing_inferring_sign_is_valid_type.return._TYPE_RE_match_s_is_not_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubdoc.py__Parsing_inferring_sign_is_valid_type.return._TYPE_RE_match_s_is_not_", "embedding": null, "metadata": {"file_path": "mypy/stubdoc.py", "file_name": "stubdoc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 30, "span_ids": ["is_valid_type", "docstring"], "tokens": 244}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Parsing/inferring signatures from documentation.\n\nThis module provides several functions to generate better stubs using\ndocstrings and Sphinx docs (.rst files).\n\"\"\"\nimport re\nimport io\nimport contextlib\nimport tokenize\n\nfrom typing import (\n Optional, MutableMapping, MutableSequence, List, Sequence, Tuple, NamedTuple, Any\n)\nfrom typing_extensions import Final\n\n# Type alias for signatures strings in format ('func_name', '(arg, opt_arg=False)').\nSig = Tuple[str, str]\n\n\n_TYPE_RE = re.compile(r'^[a-zA-Z_][\\w\\[\\], ]*(\\.[a-zA-Z_][\\w\\[\\], ]*)*$') # type: Final\n_ARG_NAME_RE = re.compile(r'\\**[A-Za-z_][A-Za-z0-9_]*$') # type: Final\n\n\ndef is_valid_type(s: str) -> bool:\n \"\"\"Try to determine whether a string might be a valid type annotation.\"\"\"\n if s in ('True', 'False', 'retval'):\n return False\n if ',' in s and '[' not in s:\n return False\n return _TYPE_RE.match(s) is not None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubdoc.py_ArgSig_ArgSig.__eq__.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubdoc.py_ArgSig_ArgSig.__eq__.return.False", "embedding": null, "metadata": {"file_path": "mypy/stubdoc.py", "file_name": "stubdoc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 33, "end_line": 52, "span_ids": ["ArgSig", "ArgSig.__init__", "ArgSig.__repr__", "ArgSig.__eq__"], "tokens": 173}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ArgSig:\n \"\"\"Signature info for a single argument.\"\"\"\n\n def __init__(self, name: str, type: Optional[str] = None, default: bool = False):\n self.name = name\n if type and not is_valid_type(type):\n raise ValueError(\"Invalid type: \" + type)\n self.type = type\n # Does this argument have a default value?\n self.default = default\n\n def __repr__(self) -> str:\n return \"ArgSig(name={}, type={}, default={})\".format(repr(self.name), repr(self.type),\n repr(self.default))\n\n def __eq__(self, other: Any) -> bool:\n if isinstance(other, ArgSig):\n return (self.name == other.name and self.type == other.type and\n self.default == other.default)\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubdoc.py_FunctionSig_STATE_OPEN_BRACKET.7": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubdoc.py_FunctionSig_STATE_OPEN_BRACKET.7", "embedding": null, "metadata": {"file_path": "mypy/stubdoc.py", "file_name": "stubdoc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 55, "end_line": 69, "span_ids": ["impl:7"], "tokens": 119}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "FunctionSig = NamedTuple('FunctionSig', [\n ('name', str),\n ('args', List[ArgSig]),\n ('ret_type', str)\n])\n\n\n# States of the docstring parser.\nSTATE_INIT = 1 # type: Final\nSTATE_FUNCTION_NAME = 2 # type: Final\nSTATE_ARGUMENT_LIST = 3 # type: Final\nSTATE_ARGUMENT_TYPE = 4 # type: Final\nSTATE_ARGUMENT_DEFAULT = 5 # type: Final\nSTATE_RETURN_VALUE = 6 # type: Final\nSTATE_OPEN_BRACKET = 7", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubdoc.py__type_Final_For_gene_DocStringParser.__init__._type_List_FunctionSig_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubdoc.py__type_Final_For_gene_DocStringParser.__init__._type_List_FunctionSig_", "embedding": null, "metadata": {"file_path": "mypy/stubdoc.py", "file_name": "stubdoc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 69, "end_line": 87, "span_ids": ["DocStringParser", "DocStringParser.__init__", "impl:7"], "tokens": 157}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": " # type: Final # For generic types.\n\n\nclass DocStringParser:\n \"\"\"Parse function signatures in documentation.\"\"\"\n\n def __init__(self, function_name: str) -> None:\n # Only search for signatures of function with this name.\n self.function_name = function_name\n self.state = [STATE_INIT]\n self.accumulator = \"\"\n self.arg_type = None # type: Optional[str]\n self.arg_name = \"\"\n self.arg_default = None # type: Optional[str]\n self.ret_type = \"Any\"\n self.found = False\n self.args = [] # type: List[ArgSig]\n # Valid signatures found so far.\n self.signatures = [] # type: List[FunctionSig]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubdoc.py_DocStringParser.add_token_DocStringParser.add_token.if_token_type_tokeniz.else_.self_accumulator_token": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubdoc.py_DocStringParser.add_token_DocStringParser.add_token.if_token_type_tokeniz.else_.self_accumulator_token", "embedding": null, "metadata": {"file_path": "mypy/stubdoc.py", "file_name": "stubdoc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 89, "end_line": 186, "span_ids": ["DocStringParser.add_token"], "tokens": 836}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DocStringParser:\n\n def add_token(self, token: tokenize.TokenInfo) -> None:\n \"\"\"Process next token from the token stream.\"\"\"\n if (token.type == tokenize.NAME and token.string == self.function_name and\n self.state[-1] == STATE_INIT):\n self.state.append(STATE_FUNCTION_NAME)\n\n elif (token.type == tokenize.OP and token.string == '(' and\n self.state[-1] == STATE_FUNCTION_NAME):\n self.state.pop()\n self.accumulator = \"\"\n self.found = True\n self.state.append(STATE_ARGUMENT_LIST)\n\n elif self.state[-1] == STATE_FUNCTION_NAME:\n # Reset state, function name not followed by '('.\n self.state.pop()\n\n elif (token.type == tokenize.OP and token.string in ('[', '(', '{') and\n self.state[-1] != STATE_INIT):\n self.accumulator += token.string\n self.state.append(STATE_OPEN_BRACKET)\n\n elif (token.type == tokenize.OP and token.string in (']', ')', '}') and\n self.state[-1] == STATE_OPEN_BRACKET):\n self.accumulator += token.string\n self.state.pop()\n\n elif (token.type == tokenize.OP and token.string == ':' and\n self.state[-1] == STATE_ARGUMENT_LIST):\n self.arg_name = self.accumulator\n self.accumulator = \"\"\n self.state.append(STATE_ARGUMENT_TYPE)\n\n elif (token.type == tokenize.OP and token.string == '=' and\n self.state[-1] in (STATE_ARGUMENT_LIST, STATE_ARGUMENT_TYPE)):\n if self.state[-1] == STATE_ARGUMENT_TYPE:\n self.arg_type = self.accumulator\n self.state.pop()\n else:\n self.arg_name = self.accumulator\n self.accumulator = \"\"\n self.state.append(STATE_ARGUMENT_DEFAULT)\n\n elif (token.type == tokenize.OP and token.string in (',', ')') and\n self.state[-1] in (STATE_ARGUMENT_LIST, STATE_ARGUMENT_DEFAULT,\n STATE_ARGUMENT_TYPE)):\n if self.state[-1] == STATE_ARGUMENT_DEFAULT:\n self.arg_default = self.accumulator\n self.state.pop()\n elif self.state[-1] == STATE_ARGUMENT_TYPE:\n self.arg_type = self.accumulator\n self.state.pop()\n elif self.state[-1] == STATE_ARGUMENT_LIST:\n self.arg_name = self.accumulator\n if not (token.string == ')' and self.accumulator.strip() == '') \\\n and not _ARG_NAME_RE.match(self.arg_name):\n # Invalid argument name.\n self.reset()\n return\n\n if token.string == ')':\n self.state.pop()\n try:\n self.args.append(ArgSig(name=self.arg_name, type=self.arg_type,\n default=bool(self.arg_default)))\n except ValueError:\n # wrong type, use Any\n self.args.append(ArgSig(name=self.arg_name, type=None,\n default=bool(self.arg_default)))\n self.arg_name = \"\"\n self.arg_type = None\n self.arg_default = None\n self.accumulator = \"\"\n\n elif token.type == tokenize.OP and token.string == '->' and self.state[-1] == STATE_INIT:\n self.accumulator = \"\"\n self.state.append(STATE_RETURN_VALUE)\n\n # ENDMAKER is necessary for python 3.4 and 3.5.\n elif (token.type in (tokenize.NEWLINE, tokenize.ENDMARKER) and\n self.state[-1] in (STATE_INIT, STATE_RETURN_VALUE)):\n if self.state[-1] == STATE_RETURN_VALUE:\n if not is_valid_type(self.accumulator):\n self.reset()\n return\n self.ret_type = self.accumulator\n self.accumulator = \"\"\n self.state.pop()\n\n if self.found:\n self.signatures.append(FunctionSig(name=self.function_name, args=self.args,\n ret_type=self.ret_type))\n self.found = False\n self.args = []\n self.ret_type = 'Any'\n # Leave state as INIT.\n else:\n self.accumulator += token.string", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubdoc.py_DocStringParser.reset_DocStringParser.get_signatures.return.list_sorted_self_signatur": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubdoc.py_DocStringParser.reset_DocStringParser.get_signatures.return.list_sorted_self_signatur", "embedding": null, "metadata": {"file_path": "mypy/stubdoc.py", "file_name": "stubdoc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 187, "end_line": 202, "span_ids": ["DocStringParser.reset", "DocStringParser.get_signatures"], "tokens": 166}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DocStringParser:\n\n def reset(self) -> None:\n self.state = [STATE_INIT]\n self.args = []\n self.found = False\n self.accumulator = \"\"\n\n def get_signatures(self) -> List[FunctionSig]:\n \"\"\"Return sorted copy of the list of signatures found so far.\"\"\"\n def has_arg(name: str, signature: FunctionSig) -> bool:\n return any(x.name == name for x in signature.args)\n\n def args_kwargs(signature: FunctionSig) -> bool:\n return has_arg('*args', signature) and has_arg('**kwargs', signature)\n\n # Move functions with (*args, **kwargs) in their signature to last place.\n return list(sorted(self.signatures, key=lambda x: 1 if args_kwargs(x) else 0))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubdoc.py_infer_sig_from_docstring_infer_sig_from_docstring.return._sig_for_sig_in_sigs_if_i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubdoc.py_infer_sig_from_docstring_infer_sig_from_docstring.return._sig_for_sig_in_sigs_if_i", "embedding": null, "metadata": {"file_path": "mypy/stubdoc.py", "file_name": "stubdoc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 206, "end_line": 240, "span_ids": ["infer_sig_from_docstring"], "tokens": 325}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def infer_sig_from_docstring(docstr: Optional[str], name: str) -> Optional[List[FunctionSig]]:\n \"\"\"Convert function signature to list of TypedFunctionSig\n\n Look for function signatures of function in docstring. Signature is a string of\n the format () -> or perhaps without\n the return type.\n\n Returns empty list, when no signature is found, one signature in typical case,\n multiple signatures, if docstring specifies multiple signatures for overload functions.\n Return None if the docstring is empty.\n\n Arguments:\n * docstr: docstring\n * name: name of function for which signatures are to be found\n \"\"\"\n if not docstr:\n return None\n\n state = DocStringParser(name)\n # Return all found signatures, even if there is a parse error after some are found.\n with contextlib.suppress(tokenize.TokenError):\n try:\n tokens = tokenize.tokenize(io.BytesIO(docstr.encode('utf-8')).readline)\n for token in tokens:\n state.add_token(token)\n except IndentationError:\n return None\n sigs = state.get_signatures()\n\n def is_unique_args(sig: FunctionSig) -> bool:\n \"\"\"return true if function argument names are unique\"\"\"\n return len(sig.args) == len(set((arg.name for arg in sig.args)))\n\n # Return only signatures that have unique argument names. Mypy fails on non-unique arg names.\n return [sig for sig in sigs if is_unique_args(sig)]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubdoc.py_parse_signature_parse_signature.return.name_positional_optiona": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubdoc.py_parse_signature_parse_signature.return.name_positional_optiona", "embedding": null, "metadata": {"file_path": "mypy/stubdoc.py", "file_name": "stubdoc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 258, "end_line": 294, "span_ids": ["parse_signature"], "tokens": 300}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def parse_signature(sig: str) -> Optional[Tuple[str,\n List[str],\n List[str]]]:\n \"\"\"Split function signature into its name, positional an optional arguments.\n\n The expected format is \"func_name(arg, opt_arg=False)\". Return the name of function\n and lists of positional and optional argument names.\n \"\"\"\n m = re.match(r'([.a-zA-Z0-9_]+)\\(([^)]*)\\)', sig)\n if not m:\n return None\n name = m.group(1)\n name = name.split('.')[-1]\n arg_string = m.group(2)\n if not arg_string.strip():\n # Simple case -- no arguments.\n return name, [], []\n\n args = [arg.strip() for arg in arg_string.split(',')]\n positional = []\n optional = []\n i = 0\n while i < len(args):\n # Accept optional arguments as in both formats: x=None and [x].\n if args[i].startswith('[') or '=' in args[i]:\n break\n positional.append(args[i].rstrip('['))\n i += 1\n if args[i - 1].endswith('['):\n break\n while i < len(args):\n arg = args[i]\n arg = arg.strip('[]')\n arg = arg.split('=')[0]\n optional.append(arg)\n i += 1\n return name, positional, optional", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubdoc.py_build_signature_parse_all_signatures.return.sorted_sigs_sorted_clas": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubdoc.py_build_signature_parse_all_signatures.return.sorted_sigs_sorted_clas", "embedding": null, "metadata": {"file_path": "mypy/stubdoc.py", "file_name": "stubdoc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 297, "end_line": 334, "span_ids": ["build_signature", "parse_all_signatures"], "tokens": 298}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def build_signature(positional: Sequence[str],\n optional: Sequence[str]) -> str:\n \"\"\"Build function signature from lists of positional and optional argument names.\"\"\"\n args = [] # type: MutableSequence[str]\n args.extend(positional)\n for arg in optional:\n if arg.startswith('*'):\n args.append(arg)\n else:\n args.append('%s=...' % arg)\n sig = '(%s)' % ', '.join(args)\n # Ad-hoc fixes.\n sig = sig.replace('(self)', '')\n return sig\n\n\ndef parse_all_signatures(lines: Sequence[str]) -> Tuple[List[Sig],\n List[Sig]]:\n \"\"\"Parse all signatures in a given reST document.\n\n Return lists of found signatures for functions and classes.\n \"\"\"\n sigs = []\n class_sigs = []\n for line in lines:\n line = line.strip()\n m = re.match(r'\\.\\. *(function|method|class) *:: *[a-zA-Z_]', line)\n if m:\n sig = line.split('::')[1].strip()\n parsed = parse_signature(sig)\n if parsed:\n name, fixed, optional = parsed\n if m.group(1) != 'class':\n sigs.append((name, build_signature(fixed, optional)))\n else:\n class_sigs.append((name, build_signature(fixed, optional)))\n\n return sorted(sigs), sorted(class_sigs)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubdoc.py_find_unique_signatures_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubdoc.py_find_unique_signatures_", "embedding": null, "metadata": {"file_path": "mypy/stubdoc.py", "file_name": "stubdoc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 337, "end_line": 364, "span_ids": ["find_unique_signatures", "infer_prop_type_from_docstring"], "tokens": 259}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def find_unique_signatures(sigs: Sequence[Sig]) -> List[Sig]:\n \"\"\"Remove names with duplicate found signatures.\"\"\"\n sig_map = {} # type: MutableMapping[str, List[str]]\n for name, sig in sigs:\n sig_map.setdefault(name, []).append(sig)\n\n result = []\n for name, name_sigs in sig_map.items():\n if len(set(name_sigs)) == 1:\n result.append((name, name_sigs[0]))\n return sorted(result)\n\n\ndef infer_prop_type_from_docstring(docstr: Optional[str]) -> Optional[str]:\n \"\"\"Check for Google/Numpy style docstring type annotation for a property.\n\n The docstring has the format \": \".\n In the type string, we allow the following characters:\n * dot: because sometimes classes are annotated using full path\n * brackets: to allow type hints like List[int]\n * comma/space: things like Tuple[int, int]\n \"\"\"\n if not docstr:\n return None\n test_str = r'^([a-zA-Z0-9_, \\.\\[\\]]*): '\n m = re.match(test_str, docstr)\n return m.group(1) if m else None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py__usr_bin_env_python3_from_mypy_stubutil_import": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py__usr_bin_env_python3_from_mypy_stubutil_import", "embedding": null, "metadata": {"file_path": "mypy/stubgen.py", "file_name": "stubgen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 83, "span_ids": ["imports:11", "docstring"], "tokens": 762}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "#!/usr/bin/env python3\n\"\"\"Generator of dynamically typed draft stubs for arbitrary modules.\n\nThe logic of this script can be split in three steps:\n* parsing options and finding sources:\n - use runtime imports be default (to find also C modules)\n - or use mypy's mechanisms, if importing is prohibited\n* (optionally) semantically analysing the sources using mypy (as a single set)\n* emitting the stubs text:\n - for Python modules: from ASTs using StubGenerator\n - for C modules using runtime introspection and (optionally) Sphinx docs\n\nDuring first and third steps some problematic files can be skipped, but any\nblocking error during second step will cause the whole program to stop.\n\nBasic usage:\n\n $ stubgen foo.py bar.py some_directory\n => Generate out/foo.pyi, out/bar.pyi, and stubs for some_directory (recursively).\n\n $ stubgen -m urllib.parse\n => Generate out/urllib/parse.pyi.\n\n $ stubgen -p urllib\n => Generate stubs for whole urlib package (recursively).\n\nFor Python 2 mode, use --py2:\n\n $ stubgen --py2 -m textwrap\n\nFor C modules, you can get more precise function signatures by parsing .rst (Sphinx)\ndocumentation for extra information. For this, use the --doc-dir option:\n\n $ stubgen --doc-dir /Python-3.4.2/Doc/library -m curses\n\nNote: The generated stubs should be verified manually.\n\nTODO:\n - support stubs for C modules in Python 2 mode\n - detect 'if PY2 / is_py2' etc. and either preserve those or only include Python 2 or 3 case\n - maybe use .rst docs also for Python modules\n - maybe export more imported names if there is no __all__ (this affects ssl.SSLError, for example)\n - a quick and dirty heuristic would be to turn this on if a module has something like\n 'from x import y as _y'\n - we don't seem to always detect properties ('closed' in 'io', for example)\n\"\"\"\n\nimport glob\nimport os\nimport os.path\nimport sys\nimport traceback\nimport argparse\nfrom collections import defaultdict\n\nfrom typing import (\n List, Dict, Tuple, Iterable, Mapping, Optional, Set, cast,\n)\nfrom typing_extensions import Final\n\nimport mypy.build\nimport mypy.parse\nimport mypy.errors\nimport mypy.traverser\nimport mypy.mixedtraverser\nimport mypy.util\nfrom mypy import defaults\nfrom mypy.modulefinder import (\n ModuleNotFoundReason, FindModuleCache, SearchPaths, BuildSource, default_lib_path\n)\nfrom mypy.nodes import (\n Expression, IntExpr, UnaryExpr, StrExpr, BytesExpr, NameExpr, FloatExpr, MemberExpr,\n TupleExpr, ListExpr, ComparisonExpr, CallExpr, IndexExpr, EllipsisExpr,\n ClassDef, MypyFile, Decorator, AssignmentStmt, TypeInfo,\n IfStmt, ImportAll, ImportFrom, Import, FuncDef, FuncBase, TempNode, Block,\n Statement, OverloadedFuncDef, ARG_POS, ARG_STAR, ARG_STAR2, ARG_NAMED, ARG_NAMED_OPT\n)\nfrom mypy.stubgenc import generate_stub_for_c_module\nfrom mypy.stubutil import (\n default_py2_interpreter, CantImport, generate_guarded,\n walk_packages, find_module_path_and_all_py2, find_module_path_and_all_py3,\n report_missing, fail_missing, remove_misplaced_type_comments, common_dir_prefix\n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_from_mypy_stubdoc_import__METHODS_WITH_RETURN_VALUE._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_from_mypy_stubdoc_import__METHODS_WITH_RETURN_VALUE._", "embedding": null, "metadata": {"file_path": "mypy/stubgen.py", "file_name": "stubgen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 84, "end_line": 152, "span_ids": ["imports:11", "impl:5"], "tokens": 495}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from mypy.stubdoc import parse_all_signatures, find_unique_signatures, Sig\nfrom mypy.options import Options as MypyOptions\nfrom mypy.types import (\n Type, TypeStrVisitor, CallableType, UnboundType, NoneType, TupleType, TypeList, Instance,\n AnyType\n)\nfrom mypy.visitor import NodeVisitor\nfrom mypy.find_sources import create_source_list, InvalidSourceList\nfrom mypy.build import build\nfrom mypy.errors import CompileError, Errors\nfrom mypy.traverser import has_return_statement\nfrom mypy.moduleinspect import ModuleInspect\n\n\n# Common ways of naming package containing vendored modules.\nVENDOR_PACKAGES = [\n 'packages',\n 'vendor',\n 'vendored',\n '_vendor',\n '_vendored_packages',\n] # type: Final\n\n# Avoid some file names that are unnecessary or likely to cause trouble (\\n for end of path).\nBLACKLIST = [\n '/six.py\\n', # Likely vendored six; too dynamic for us to handle\n '/vendored/', # Vendored packages\n '/vendor/', # Vendored packages\n '/_vendor/',\n '/_vendored_packages/',\n] # type: Final\n\n# Special-cased names that are implicitly exported from the stub (from m import y as y).\nEXTRA_EXPORTED = {\n 'pyasn1_modules.rfc2437.univ',\n 'pyasn1_modules.rfc2459.char',\n 'pyasn1_modules.rfc2459.univ',\n} # type: Final\n\n# These names should be omitted from generated stubs.\nIGNORED_DUNDERS = {\n '__all__',\n '__author__',\n '__version__',\n '__about__',\n '__copyright__',\n '__email__',\n '__license__',\n '__summary__',\n '__title__',\n '__uri__',\n '__str__',\n '__repr__',\n '__getstate__',\n '__setstate__',\n '__slots__',\n} # type: Final\n\n# These methods are expected to always return a non-trivial value.\nMETHODS_WITH_RETURN_VALUE = {\n '__ne__',\n '__eq__',\n '__lt__',\n '__le__',\n '__gt__',\n '__ge__',\n '__hash__',\n '__iter__',\n}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_None_11_Options.__init__.self.export_less.export_less": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_None_11_Options.__init__.self.export_less.export_less", "embedding": null, "metadata": {"file_path": "mypy/stubgen.py", "file_name": "stubgen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 152, "end_line": 192, "span_ids": ["Options.__init__", "Options", "impl:5"], "tokens": 259}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": " # type: Final\n\n\nclass Options:\n \"\"\"Represents stubgen options.\n\n This class is mutable to simplify testing.\n \"\"\"\n def __init__(self,\n pyversion: Tuple[int, int],\n no_import: bool,\n doc_dir: str,\n search_path: List[str],\n interpreter: str,\n parse_only: bool,\n ignore_errors: bool,\n include_private: bool,\n output_dir: str,\n modules: List[str],\n packages: List[str],\n files: List[str],\n verbose: bool,\n quiet: bool,\n export_less: bool) -> None:\n # See parse_options for descriptions of the flags.\n self.pyversion = pyversion\n self.no_import = no_import\n self.doc_dir = doc_dir\n self.search_path = search_path\n self.interpreter = interpreter\n self.decointerpreter = interpreter\n self.parse_only = parse_only\n self.ignore_errors = ignore_errors\n self.include_private = include_private\n self.output_dir = output_dir\n self.modules = modules\n self.packages = packages\n self.files = files\n self.verbose = verbose\n self.quiet = quiet\n self.export_less = export_less", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py__What_was_generated_prev_ERROR_MARKER._ERROR_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py__What_was_generated_prev_ERROR_MARKER._ERROR_", "embedding": null, "metadata": {"file_path": "mypy/stubgen.py", "file_name": "stubgen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 216, "end_line": 228, "span_ids": ["impl:11", "StubSource.path"], "tokens": 138}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# What was generated previously in the stub file. We keep track of these to generate\n# nicely formatted output (add empty line between non-empty classes, for example).\nEMPTY = 'EMPTY' # type: Final\nFUNC = 'FUNC' # type: Final\nCLASS = 'CLASS' # type: Final\nEMPTY_CLASS = 'EMPTY_CLASS' # type: Final\nVAR = 'VAR' # type: Final\nNOT_IN_ALL = 'NOT_IN_ALL' # type: Final\n\n# Indicates that we failed to generate a reasonable output\n# for a given node. These should be manually replaced by a user.\n\nERROR_MARKER = ''", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_None_22_AnnotationPrinter.visit_type_list.return._format_self_list_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_None_22_AnnotationPrinter.visit_type_list.return._format_self_list_s", "embedding": null, "metadata": {"file_path": "mypy/stubgen.py", "file_name": "stubgen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 220, "end_line": 258, "span_ids": ["AnnotationPrinter.visit_none_type", "AnnotationPrinter.visit_type_list", "impl:11", "AnnotationPrinter.visit_unbound_type", "AnnotationPrinter.visit_any", "AnnotationPrinter", "AnnotationPrinter.__init__"], "tokens": 312}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": " # type: Final\n\n\nclass AnnotationPrinter(TypeStrVisitor):\n \"\"\"Visitor used to print existing annotations in a file.\n\n The main difference from TypeStrVisitor is a better treatment of\n unbound types.\n\n Notes:\n * This visitor doesn't add imports necessary for annotations, this is done separately\n by ImportTracker.\n * It can print all kinds of types, but the generated strings may not be valid (notably\n callable types) since it prints the same string that reveal_type() does.\n * For Instance types it prints the fully qualified names.\n \"\"\"\n # TODO: Generate valid string representation for callable types.\n # TODO: Use short names for Instances.\n def __init__(self, stubgen: 'StubGenerator') -> None:\n super().__init__()\n self.stubgen = stubgen\n\n def visit_any(self, t: AnyType) -> str:\n s = super().visit_any(t)\n self.stubgen.import_tracker.require_name(s)\n return s\n\n def visit_unbound_type(self, t: UnboundType) -> str:\n s = t.name\n self.stubgen.import_tracker.require_name(s)\n if t.args:\n s += '[{}]'.format(self.list_str(t.args))\n return s\n\n def visit_none_type(self, t: NoneType) -> str:\n return \"None\"\n\n def visit_type_list(self, t: TypeList) -> str:\n return '[{}]'.format(self.list_str(t.items))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_AliasPrinter_AliasPrinter.visit_call_expr.return._format_callee_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_AliasPrinter_AliasPrinter.visit_call_expr.return._format_callee_", "embedding": null, "metadata": {"file_path": "mypy/stubgen.py", "file_name": "stubgen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 261, "end_line": 286, "span_ids": ["AliasPrinter.__init__", "AliasPrinter.visit_call_expr", "AliasPrinter"], "tokens": 269}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class AliasPrinter(NodeVisitor[str]):\n \"\"\"Visitor used to collect type aliases _and_ type variable definitions.\n\n Visit r.h.s of the definition to get the string representation of type alias.\n \"\"\"\n def __init__(self, stubgen: 'StubGenerator') -> None:\n self.stubgen = stubgen\n super().__init__()\n\n def visit_call_expr(self, node: CallExpr) -> str:\n # Call expressions are not usually types, but we also treat `X = TypeVar(...)` as a\n # type alias that has to be preserved (even if TypeVar is not the same as an alias)\n callee = node.callee.accept(self)\n args = []\n for name, arg, kind in zip(node.arg_names, node.args, node.arg_kinds):\n if kind == ARG_POS:\n args.append(arg.accept(self))\n elif kind == ARG_STAR:\n args.append('*' + arg.accept(self))\n elif kind == ARG_STAR2:\n args.append('**' + arg.accept(self))\n elif kind == ARG_NAMED:\n args.append('{}={}'.format(name, arg.accept(self)))\n else:\n raise ValueError(\"Unknown argument kind %d in call\" % kind)\n return \"{}({})\".format(callee, \", \".join(args))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_AliasPrinter.visit_name_expr_AliasPrinter.visit_ellipsis.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_AliasPrinter.visit_name_expr_AliasPrinter.visit_ellipsis.return._", "embedding": null, "metadata": {"file_path": "mypy/stubgen.py", "file_name": "stubgen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 288, "end_line": 318, "span_ids": ["AliasPrinter.visit_ellipsis", "AliasPrinter.visit_str_expr", "AliasPrinter.visit_index_expr", "AliasPrinter.visit_member_expr", "AliasPrinter.visit_name_expr", "AliasPrinter.visit_tuple_expr", "AliasPrinter.visit_list_expr"], "tokens": 271}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class AliasPrinter(NodeVisitor[str]):\n\n def visit_name_expr(self, node: NameExpr) -> str:\n self.stubgen.import_tracker.require_name(node.name)\n return node.name\n\n def visit_member_expr(self, o: MemberExpr) -> str:\n node = o # type: Expression\n trailer = ''\n while isinstance(node, MemberExpr):\n trailer = '.' + node.name + trailer\n node = node.expr\n if not isinstance(node, NameExpr):\n return ERROR_MARKER\n self.stubgen.import_tracker.require_name(node.name)\n return node.name + trailer\n\n def visit_str_expr(self, node: StrExpr) -> str:\n return repr(node.value)\n\n def visit_index_expr(self, node: IndexExpr) -> str:\n base = node.base.accept(self)\n index = node.index.accept(self)\n return \"{}[{}]\".format(base, index)\n\n def visit_tuple_expr(self, node: TupleExpr) -> str:\n return \", \".join(n.accept(self) for n in node.items)\n\n def visit_list_expr(self, node: ListExpr) -> str:\n return \"[{}]\".format(\", \".join(n.accept(self) for n in node.items))\n\n def visit_ellipsis(self, node: EllipsisExpr) -> str:\n return \"...\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_ImportTracker_ImportTracker.__init__.None_23": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_ImportTracker_ImportTracker.__init__.None_23", "embedding": null, "metadata": {"file_path": "mypy/stubgen.py", "file_name": "stubgen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 321, "end_line": 352, "span_ids": ["ImportTracker.__init__", "ImportTracker"], "tokens": 433}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ImportTracker:\n \"\"\"Record necessary imports during stub generation.\"\"\"\n\n def __init__(self) -> None:\n # module_for['foo'] has the module name where 'foo' was imported from, or None if\n # 'foo' is a module imported directly; examples\n # 'from pkg.m import f as foo' ==> module_for['foo'] == 'pkg.m'\n # 'from m import f' ==> module_for['f'] == 'm'\n # 'import m' ==> module_for['m'] == None\n # 'import pkg.m' ==> module_for['pkg.m'] == None\n # ==> module_for['pkg'] == None\n self.module_for = {} # type: Dict[str, Optional[str]]\n\n # direct_imports['foo'] is the module path used when the name 'foo' was added to the\n # namespace.\n # import foo.bar.baz ==> direct_imports['foo'] == 'foo.bar.baz'\n # ==> direct_imports['foo.bar'] == 'foo.bar.baz'\n # ==> direct_imports['foo.bar.baz'] == 'foo.bar.baz'\n self.direct_imports = {} # type: Dict[str, str]\n\n # reverse_alias['foo'] is the name that 'foo' had originally when imported with an\n # alias; examples\n # 'import numpy as np' ==> reverse_alias['np'] == 'numpy'\n # 'import foo.bar as bar' ==> reverse_alias['bar'] == 'foo.bar'\n # 'from decimal import Decimal as D' ==> reverse_alias['D'] == 'Decimal'\n self.reverse_alias = {} # type: Dict[str, str]\n\n # required_names is the set of names that are actually used in a type annotation\n self.required_names = set() # type: Set[str]\n\n # Names that should be reexported if they come from another module\n self.reexports = set() # type: Set[str]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_ImportTracker.add_import_from_ImportTracker.add_import_from.for_name_alias_in_names_.self_direct_imports_pop_a": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_ImportTracker.add_import_from_ImportTracker.add_import_from.for_name_alias_in_names_.self_direct_imports_pop_a", "embedding": null, "metadata": {"file_path": "mypy/stubgen.py", "file_name": "stubgen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 354, "end_line": 364, "span_ids": ["ImportTracker.add_import_from"], "tokens": 120}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ImportTracker:\n\n def add_import_from(self, module: str, names: List[Tuple[str, Optional[str]]]) -> None:\n for name, alias in names:\n if alias:\n # 'from {module} import {name} as {alias}'\n self.module_for[alias] = module\n self.reverse_alias[alias] = name\n else:\n # 'from {module} import {name}'\n self.module_for[name] = module\n self.reverse_alias.pop(name, None)\n self.direct_imports.pop(alias or name, None)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_ImportTracker.add_import_ImportTracker.reexport.self_reexports_add_name_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_ImportTracker.add_import_ImportTracker.reexport.self_reexports_add_name_", "embedding": null, "metadata": {"file_path": "mypy/stubgen.py", "file_name": "stubgen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 366, "end_line": 391, "span_ids": ["ImportTracker.add_import", "ImportTracker.reexport", "ImportTracker.require_name"], "tokens": 223}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ImportTracker:\n\n def add_import(self, module: str, alias: Optional[str] = None) -> None:\n if alias:\n # 'import {module} as {alias}'\n self.module_for[alias] = None\n self.reverse_alias[alias] = module\n else:\n # 'import {module}'\n name = module\n # add module and its parent packages\n while name:\n self.module_for[name] = None\n self.direct_imports[name] = module\n self.reverse_alias.pop(name, None)\n name = name.rpartition('.')[0]\n\n def require_name(self, name: str) -> None:\n self.required_names.add(name.split('.')[0])\n\n def reexport(self, name: str) -> None:\n \"\"\"Mark a given non qualified name as needed in __all__.\n\n This means that in case it comes from a module, it should be\n imported with an alias even is the alias is the same as the name.\n \"\"\"\n self.require_name(name)\n self.reexports.add(name)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_ImportTracker.import_lines_ImportTracker.import_lines.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_ImportTracker.import_lines_ImportTracker.import_lines.return.result", "embedding": null, "metadata": {"file_path": "mypy/stubgen.py", "file_name": "stubgen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 393, "end_line": 431, "span_ids": ["ImportTracker.import_lines"], "tokens": 395}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ImportTracker:\n\n def import_lines(self) -> List[str]:\n \"\"\"The list of required import lines (as strings with python code).\"\"\"\n result = []\n\n # To summarize multiple names imported from a same module, we collect those\n # in the `module_map` dictionary, mapping a module path to the list of names that should\n # be imported from it. the names can also be alias in the form 'original as alias'\n module_map = defaultdict(list) # type: Mapping[str, List[str]]\n\n for name in sorted(self.required_names):\n # If we haven't seen this name in an import statement, ignore it\n if name not in self.module_for:\n continue\n\n m = self.module_for[name]\n if m is not None:\n # This name was found in a from ... import ...\n # Collect the name in the module_map\n if name in self.reverse_alias:\n name = '{} as {}'.format(self.reverse_alias[name], name)\n elif name in self.reexports:\n name = '{} as {}'.format(name, name)\n module_map[m].append(name)\n else:\n # This name was found in an import ...\n # We can already generate the import line\n if name in self.reverse_alias:\n source = self.reverse_alias[name]\n result.append(\"import {} as {}\\n\".format(source, name))\n elif name in self.reexports:\n assert '.' not in name # Because reexports only has nonqualified names\n result.append(\"import {} as {}\\n\".format(name, name))\n else:\n result.append(\"import {}\\n\".format(self.direct_imports[name]))\n\n # Now generate all the from ... import ... lines collected in module_map\n for module, names in sorted(module_map.items()):\n result.append(\"from {} import {}\\n\".format(module, ', '.join(sorted(names))))\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_find_defined_names_find_referenced_names.return.finder_refs": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_find_defined_names_find_referenced_names.return.finder_refs", "embedding": null, "metadata": {"file_path": "mypy/stubgen.py", "file_name": "stubgen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 434, "end_line": 461, "span_ids": ["DefinitionFinder.visit_func_def", "find_referenced_names", "DefinitionFinder.visit_class_def", "DefinitionFinder", "DefinitionFinder.__init__", "find_defined_names"], "tokens": 211}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def find_defined_names(file: MypyFile) -> Set[str]:\n finder = DefinitionFinder()\n file.accept(finder)\n return finder.names\n\n\nclass DefinitionFinder(mypy.traverser.TraverserVisitor):\n \"\"\"Find names of things defined at the top level of a module.\"\"\"\n\n # TODO: Assignment statements etc.\n\n def __init__(self) -> None:\n # Short names of things defined at the top level.\n self.names = set() # type: Set[str]\n\n def visit_class_def(self, o: ClassDef) -> None:\n # Don't recurse into classes, as we only keep track of top-level definitions.\n self.names.add(o.name)\n\n def visit_func_def(self, o: FuncDef) -> None:\n # Don't recurse, as we only keep track of top-level definitions.\n self.names.add(o.name)\n\n\ndef find_referenced_names(file: MypyFile) -> Set[str]:\n finder = ReferenceFinder()\n file.accept(finder)\n return finder.refs", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_ReferenceFinder_ReferenceFinder.add_ref.self_refs_add_fullname_sp": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_ReferenceFinder_ReferenceFinder.add_ref.self_refs_add_fullname_sp", "embedding": null, "metadata": {"file_path": "mypy/stubgen.py", "file_name": "stubgen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 464, "end_line": 500, "span_ids": ["ReferenceFinder.add_ref", "ReferenceFinder.visit_block", "ReferenceFinder.visit_tuple_type", "ReferenceFinder.visit_instance", "ReferenceFinder.__init__", "ReferenceFinder.visit_unbound_type", "ReferenceFinder", "ReferenceFinder.visit_name_expr", "ReferenceFinder.visit_callable_type"], "tokens": 282}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ReferenceFinder(mypy.mixedtraverser.MixedTraverserVisitor):\n \"\"\"Find all name references (both local and global).\"\"\"\n\n # TODO: Filter out local variable and class attribute references\n\n def __init__(self) -> None:\n # Short names of things defined at the top level.\n self.refs = set() # type: Set[str]\n\n def visit_block(self, block: Block) -> None:\n if not block.is_unreachable:\n super().visit_block(block)\n\n def visit_name_expr(self, e: NameExpr) -> None:\n self.refs.add(e.name)\n\n def visit_instance(self, t: Instance) -> None:\n self.add_ref(t.type.fullname)\n super().visit_instance(t)\n\n def visit_unbound_type(self, t: UnboundType) -> None:\n if t.name:\n self.add_ref(t.name)\n\n def visit_tuple_type(self, t: TupleType) -> None:\n # Ignore fallback\n for item in t.items:\n item.accept(self)\n\n def visit_callable_type(self, t: CallableType) -> None:\n # Ignore fallback\n for arg in t.arg_types:\n arg.accept(self)\n t.ret_type.accept(self)\n\n def add_ref(self, fullname: str) -> None:\n self.refs.add(fullname.split('.')[-1])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator_StubGenerator.__init__.None_15": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator_StubGenerator.__init__.None_15", "embedding": null, "metadata": {"file_path": "mypy/stubgen.py", "file_name": "stubgen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 503, "end_line": 538, "span_ids": ["StubGenerator.__init__", "StubGenerator"], "tokens": 381}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubGenerator(mypy.traverser.TraverserVisitor):\n \"\"\"Generate stub text from a mypy AST.\"\"\"\n\n def __init__(self,\n _all_: Optional[List[str]], pyversion: Tuple[int, int],\n include_private: bool = False,\n analyzed: bool = False,\n export_less: bool = False) -> None:\n # Best known value of __all__.\n self._all_ = _all_\n self._output = [] # type: List[str]\n self._decorators = [] # type: List[str]\n self._import_lines = [] # type: List[str]\n # Current indent level (indent is hardcoded to 4 spaces).\n self._indent = ''\n # Stack of defined variables (per scope).\n self._vars = [[]] # type: List[List[str]]\n # What was generated previously in the stub file.\n self._state = EMPTY\n self._toplevel_names = [] # type: List[str]\n self._pyversion = pyversion\n self._include_private = include_private\n self.import_tracker = ImportTracker()\n # Was the tree semantically analysed before?\n self.analyzed = analyzed\n # Disable implicit exports of package-internal imports?\n self.export_less = export_less\n # Add imports that could be implicitly generated\n self.import_tracker.add_import_from(\"collections\", [(\"namedtuple\", None)])\n # Names in __all__ are required\n for name in _all_ or ():\n if name not in IGNORED_DUNDERS:\n self.import_tracker.reexport(name)\n self.defined_names = set() # type: Set[str]\n # Short names of methods defined in the body of the current class\n self.method_names = set() # type: Set[str]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.visit_mypy_file_StubGenerator.visit_mypy_file.if_undefined_names_.for_name_in_sorted_undefi.self_add_s_n_nam": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.visit_mypy_file_StubGenerator.visit_mypy_file.if_undefined_names_.for_name_in_sorted_undefi.self_add_s_n_nam", "embedding": null, "metadata": {"file_path": "mypy/stubgen.py", "file_name": "stubgen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 540, "end_line": 560, "span_ids": ["StubGenerator.visit_mypy_file"], "tokens": 227}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubGenerator(mypy.traverser.TraverserVisitor):\n\n def visit_mypy_file(self, o: MypyFile) -> None:\n self.module = o.fullname # Current module being processed\n self.path = o.path\n self.defined_names = find_defined_names(o)\n self.referenced_names = find_referenced_names(o)\n typing_imports = [\"Any\", \"Optional\", \"TypeVar\"]\n for t in typing_imports:\n if t not in self.defined_names:\n alias = None\n else:\n alias = '_' + t\n self.import_tracker.add_import_from(\"typing\", [(t, alias)])\n super().visit_mypy_file(o)\n undefined_names = [name for name in self._all_ or []\n if name not in self._toplevel_names]\n if undefined_names:\n if self._state != EMPTY:\n self.add('\\n')\n self.add('# Names in __all__ with no definition:\\n')\n for name in sorted(undefined_names):\n self.add('# %s\\n' % name)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.visit_func_def_StubGenerator.visit_func_def.self._state.FUNC": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.visit_func_def_StubGenerator.visit_func_def.self._state.FUNC", "embedding": null, "metadata": {"file_path": "mypy/stubgen.py", "file_name": "stubgen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 592, "end_line": 671, "span_ids": ["StubGenerator.visit_func_def"], "tokens": 825}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubGenerator(mypy.traverser.TraverserVisitor):\n\n def visit_func_def(self, o: FuncDef, is_abstract: bool = False,\n is_overload: bool = False) -> None:\n if (self.is_private_name(o.name, o.fullname)\n or self.is_not_in_all(o.name)\n or (self.is_recorded_name(o.name) and not is_overload)):\n self.clear_decorators()\n return\n if not self._indent and self._state not in (EMPTY, FUNC) and not o.is_awaitable_coroutine:\n self.add('\\n')\n if not self.is_top_level():\n self_inits = find_self_initializers(o)\n for init, value in self_inits:\n if init in self.method_names:\n # Can't have both an attribute and a method/property with the same name.\n continue\n init_code = self.get_init(init, value)\n if init_code:\n self.add(init_code)\n # dump decorators, just before \"def ...\"\n for s in self._decorators:\n self.add(s)\n self.clear_decorators()\n self.add(\"%s%sdef %s(\" % (self._indent, 'async ' if o.is_coroutine else '', o.name))\n self.record_name(o.name)\n args = [] # type: List[str]\n for i, arg_ in enumerate(o.arguments):\n var = arg_.variable\n kind = arg_.kind\n name = var.name\n annotated_type = (o.unanalyzed_type.arg_types[i]\n if isinstance(o.unanalyzed_type, CallableType) else None)\n # I think the name check is incorrect: there are libraries which\n # name their 0th argument other than self/cls\n is_self_arg = i == 0 and name == 'self'\n is_cls_arg = i == 0 and name == 'cls'\n if (annotated_type is None\n and not arg_.initializer\n and not is_self_arg\n and not is_cls_arg):\n self.add_typing_import(\"Any\")\n annotation = \": {}\".format(self.typing_name(\"Any\"))\n elif annotated_type and not is_self_arg and not is_cls_arg:\n annotation = \": {}\".format(self.print_annotation(annotated_type))\n else:\n annotation = \"\"\n if arg_.initializer:\n initializer = '...'\n if kind in (ARG_NAMED, ARG_NAMED_OPT) and not any(arg.startswith('*')\n for arg in args):\n args.append('*')\n if not annotation:\n typename = self.get_str_type_of_node(arg_.initializer, True)\n annotation = ': {} = ...'.format(typename)\n else:\n annotation += '={}'.format(initializer)\n arg = name + annotation\n elif kind == ARG_STAR:\n arg = '*%s%s' % (name, annotation)\n elif kind == ARG_STAR2:\n arg = '**%s%s' % (name, annotation)\n else:\n arg = name + annotation\n args.append(arg)\n retname = None\n if o.name != '__init__' and isinstance(o.unanalyzed_type, CallableType):\n retname = self.print_annotation(o.unanalyzed_type.ret_type)\n elif isinstance(o, FuncDef) and (o.is_abstract or o.name in METHODS_WITH_RETURN_VALUE):\n # Always assume abstract methods return Any unless explicitly annotated. Also\n # some dunder methods should not have a None return type.\n retname = self.typing_name('Any')\n self.add_typing_import(\"Any\")\n elif not has_return_statement(o) and not is_abstract:\n retname = 'None'\n retfield = ''\n if retname is not None:\n retfield = ' -> ' + retname\n\n self.add(', '.join(args))\n self.add(\"){}: ...\\n\".format(retfield))\n self._state = FUNC", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.process_name_expr_decorator_StubGenerator.refers_to_fullname.return._self_import_tracker_modu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.process_name_expr_decorator_StubGenerator.refers_to_fullname.return._self_import_tracker_modu", "embedding": null, "metadata": {"file_path": "mypy/stubgen.py", "file_name": "stubgen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 702, "end_line": 738, "span_ids": ["StubGenerator.process_name_expr_decorator", "StubGenerator.refers_to_fullname"], "tokens": 352}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubGenerator(mypy.traverser.TraverserVisitor):\n\n def process_name_expr_decorator(self, expr: NameExpr, context: Decorator) -> Tuple[bool, bool]:\n \"\"\"Process a function decorator of form @foo.\n\n Only preserve certain special decorators such as @abstractmethod.\n\n Return a pair of booleans:\n - True if the decorator makes a method abstract.\n - True if the decorator is typing.overload.\n \"\"\"\n is_abstract = False\n is_overload = False\n name = expr.name\n if name in ('property', 'staticmethod', 'classmethod'):\n self.add_decorator(name)\n elif self.import_tracker.module_for.get(name) in ('asyncio',\n 'asyncio.coroutines',\n 'types'):\n self.add_coroutine_decorator(context.func, name, name)\n elif self.refers_to_fullname(name, 'abc.abstractmethod'):\n self.add_decorator(name)\n self.import_tracker.require_name(name)\n is_abstract = True\n elif self.refers_to_fullname(name, 'abc.abstractproperty'):\n self.add_decorator('property')\n self.add_decorator('abc.abstractmethod')\n is_abstract = True\n elif self.refers_to_fullname(name, 'typing.overload'):\n self.add_decorator(name)\n self.add_typing_import('overload')\n is_overload = True\n return is_abstract, is_overload\n\n def refers_to_fullname(self, name: str, fullname: str) -> bool:\n module, short = fullname.rsplit('.', 1)\n return (self.import_tracker.module_for.get(name) == module and\n (name == short or\n self.import_tracker.reverse_alias.get(name) == short))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.visit_class_def_StubGenerator.visit_class_def.self.method_names_5.set_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.visit_class_def_StubGenerator.visit_class_def.self.method_names_5.set_", "embedding": null, "metadata": {"file_path": "mypy/stubgen.py", "file_name": "stubgen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 728, "end_line": 764, "span_ids": ["StubGenerator.visit_class_def"], "tokens": 377}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubGenerator(mypy.traverser.TraverserVisitor):\n\n def visit_class_def(self, o: ClassDef) -> None:\n self.method_names = find_method_names(o.defs.body)\n sep = None # type: Optional[int]\n if not self._indent and self._state != EMPTY:\n sep = len(self._output)\n self.add('\\n')\n self.add('%sclass %s' % (self._indent, o.name))\n self.record_name(o.name)\n base_types = self.get_base_types(o)\n if base_types:\n for base in base_types:\n self.import_tracker.require_name(base)\n if isinstance(o.metaclass, (NameExpr, MemberExpr)):\n meta = o.metaclass.accept(AliasPrinter(self))\n base_types.append('metaclass=' + meta)\n elif self.analyzed and o.info.is_abstract:\n base_types.append('metaclass=abc.ABCMeta')\n self.import_tracker.add_import('abc')\n self.import_tracker.require_name('abc')\n if base_types:\n self.add('(%s)' % ', '.join(base_types))\n self.add(':\\n')\n n = len(self._output)\n self._indent += ' '\n self._vars.append([])\n super().visit_class_def(o)\n self._indent = self._indent[:-4]\n self._vars.pop()\n self._vars[-1].append(o.name)\n if len(self._output) == n:\n if self._state == EMPTY_CLASS and sep is not None:\n self._output[sep] = ''\n self._output[-1] = self._output[-1][:-1] + ' ...\\n'\n self._state = EMPTY_CLASS\n else:\n self._state = CLASS\n self.method_names = set()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.get_base_types_StubGenerator.visit_block.if_not_o_is_unreachable_.super_visit_block_o_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.get_base_types_StubGenerator.visit_block.if_not_o_is_unreachable_.super_visit_block_o_", "embedding": null, "metadata": {"file_path": "mypy/stubgen.py", "file_name": "stubgen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 766, "end_line": 785, "span_ids": ["StubGenerator.visit_block", "StubGenerator.get_base_types"], "tokens": 197}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubGenerator(mypy.traverser.TraverserVisitor):\n\n def get_base_types(self, cdef: ClassDef) -> List[str]:\n \"\"\"Get list of base classes for a class.\"\"\"\n base_types = [] # type: List[str]\n for base in cdef.base_type_exprs:\n if isinstance(base, NameExpr):\n if base.name != 'object':\n base_types.append(base.name)\n elif isinstance(base, MemberExpr):\n modname = get_qualified_name(base.expr)\n base_types.append('%s.%s' % (modname, base.name))\n elif isinstance(base, IndexExpr):\n p = AliasPrinter(self)\n base_types.append(base.accept(p))\n return base_types\n\n def visit_block(self, o: Block) -> None:\n # Unreachable statements may be partially uninitialized and that may\n # cause trouble.\n if not o.is_unreachable:\n super().visit_block(o)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.visit_assignment_stmt_StubGenerator.visit_assignment_stmt.if_all_foundl_.self._state.VAR": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.visit_assignment_stmt_StubGenerator.visit_assignment_stmt.if_all_foundl_.self._state.VAR", "embedding": null, "metadata": {"file_path": "mypy/stubgen.py", "file_name": "stubgen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 787, "end_line": 826, "span_ids": ["StubGenerator.visit_assignment_stmt"], "tokens": 370}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubGenerator(mypy.traverser.TraverserVisitor):\n\n def visit_assignment_stmt(self, o: AssignmentStmt) -> None:\n foundl = []\n\n for lvalue in o.lvalues:\n if isinstance(lvalue, NameExpr) and self.is_namedtuple(o.rvalue):\n assert isinstance(o.rvalue, CallExpr)\n self.process_namedtuple(lvalue, o.rvalue)\n continue\n if (self.is_top_level() and\n isinstance(lvalue, NameExpr) and not self.is_private_name(lvalue.name) and\n # it is never an alias with explicit annotation\n not o.unanalyzed_type and self.is_alias_expression(o.rvalue)):\n self.process_typealias(lvalue, o.rvalue)\n continue\n if isinstance(lvalue, TupleExpr) or isinstance(lvalue, ListExpr):\n items = lvalue.items\n if isinstance(o.unanalyzed_type, TupleType): # type: ignore\n annotations = o.unanalyzed_type.items # type: Iterable[Optional[Type]]\n else:\n annotations = [None] * len(items)\n else:\n items = [lvalue]\n annotations = [o.unanalyzed_type]\n sep = False\n found = False\n for item, annotation in zip(items, annotations):\n if isinstance(item, NameExpr):\n init = self.get_init(item.name, o.rvalue, annotation)\n if init:\n found = True\n if not sep and not self._indent and \\\n self._state not in (EMPTY, VAR):\n init = '\\n' + init\n sep = True\n self.add(init)\n self.record_name(item.name)\n foundl.append(found)\n\n if all(foundl):\n self._state = VAR", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.is_namedtuple_StubGenerator.process_namedtuple.self._state.CLASS": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.is_namedtuple_StubGenerator.process_namedtuple.self._state.CLASS", "embedding": null, "metadata": {"file_path": "mypy/stubgen.py", "file_name": "stubgen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 828, "end_line": 850, "span_ids": ["StubGenerator.process_namedtuple", "StubGenerator.is_namedtuple"], "tokens": 300}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubGenerator(mypy.traverser.TraverserVisitor):\n\n def is_namedtuple(self, expr: Expression) -> bool:\n if not isinstance(expr, CallExpr):\n return False\n callee = expr.callee\n return ((isinstance(callee, NameExpr) and callee.name.endswith('namedtuple')) or\n (isinstance(callee, MemberExpr) and callee.name == 'namedtuple'))\n\n def process_namedtuple(self, lvalue: NameExpr, rvalue: CallExpr) -> None:\n if self._state != EMPTY:\n self.add('\\n')\n name = repr(getattr(rvalue.args[0], 'value', ERROR_MARKER))\n if isinstance(rvalue.args[1], StrExpr):\n items = repr(rvalue.args[1].value)\n elif isinstance(rvalue.args[1], (ListExpr, TupleExpr)):\n list_items = cast(List[StrExpr], rvalue.args[1].items)\n items = '[%s]' % ', '.join(repr(item.value) for item in list_items)\n else:\n self.add('%s%s: Any' % (self._indent, lvalue.name))\n self.import_tracker.require_name('Any')\n return\n self.import_tracker.require_name('namedtuple')\n self.add('%s%s = namedtuple(%s, %s)\\n' % (self._indent, lvalue.name, name, items))\n self._state = CLASS", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.is_alias_expression_StubGenerator.is_alias_expression.if_isinstance_expr_Call.else_.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.is_alias_expression_StubGenerator.is_alias_expression.if_isinstance_expr_Call.else_.return.False", "embedding": null, "metadata": {"file_path": "mypy/stubgen.py", "file_name": "stubgen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 852, "end_line": 893, "span_ids": ["StubGenerator.is_alias_expression"], "tokens": 389}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubGenerator(mypy.traverser.TraverserVisitor):\n\n def is_alias_expression(self, expr: Expression, top_level: bool = True) -> bool:\n \"\"\"Return True for things that look like target for an alias.\n\n Used to know if assignments look like type aliases, function alias,\n or module alias.\n \"\"\"\n # Assignment of TypeVar(...) are passed through\n if (isinstance(expr, CallExpr) and\n isinstance(expr.callee, NameExpr) and\n expr.callee.name == 'TypeVar'):\n return True\n elif isinstance(expr, EllipsisExpr):\n return not top_level\n elif isinstance(expr, NameExpr):\n if expr.name in ('True', 'False'):\n return False\n elif expr.name == 'None':\n return not top_level\n else:\n return not self.is_private_name(expr.name)\n elif isinstance(expr, MemberExpr) and self.analyzed:\n # Also add function and module aliases.\n return ((top_level and isinstance(expr.node, (FuncDef, Decorator, MypyFile))\n or isinstance(expr.node, TypeInfo)) and\n not self.is_private_member(expr.node.fullname))\n elif (isinstance(expr, IndexExpr) and isinstance(expr.base, NameExpr) and\n not self.is_private_name(expr.base.name)):\n if isinstance(expr.index, TupleExpr):\n indices = expr.index.items\n else:\n indices = [expr.index]\n if expr.base.name == 'Callable' and len(indices) == 2:\n args, ret = indices\n if isinstance(args, EllipsisExpr):\n indices = [ret]\n elif isinstance(args, ListExpr):\n indices = args.items + [ret]\n else:\n return False\n return all(self.is_alias_expression(i, top_level=False) for i in indices)\n else:\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.process_typealias_StubGenerator.visit_import_all.self_add_import_line_fro": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.process_typealias_StubGenerator.visit_import_all.self_add_import_line_fro", "embedding": null, "metadata": {"file_path": "mypy/stubgen.py", "file_name": "stubgen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 895, "end_line": 913, "span_ids": ["StubGenerator.process_typealias", "StubGenerator.visit_if_stmt", "StubGenerator.visit_import_all"], "tokens": 231}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubGenerator(mypy.traverser.TraverserVisitor):\n\n def process_typealias(self, lvalue: NameExpr, rvalue: Expression) -> None:\n p = AliasPrinter(self)\n self.add(\"{} = {}\\n\".format(lvalue.name, rvalue.accept(p)))\n self.record_name(lvalue.name)\n self._vars[-1].append(lvalue.name)\n\n def visit_if_stmt(self, o: IfStmt) -> None:\n # Ignore if __name__ == '__main__'.\n expr = o.expr[0]\n if (isinstance(expr, ComparisonExpr) and\n isinstance(expr.operands[0], NameExpr) and\n isinstance(expr.operands[1], StrExpr) and\n expr.operands[0].name == '__name__' and\n '__main__' in expr.operands[1].value):\n return\n super().visit_if_stmt(o)\n\n def visit_import_all(self, o: ImportAll) -> None:\n self.add_import_line('from %s%s import *\\n' % ('.' * o.relative, o.id))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.visit_import_from_StubGenerator.visit_import_from.if_self__all__.exported_names_update_nam": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.visit_import_from_StubGenerator.visit_import_from.if_self__all__.exported_names_update_nam", "embedding": null, "metadata": {"file_path": "mypy/stubgen.py", "file_name": "stubgen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 915, "end_line": 972, "span_ids": ["StubGenerator.visit_import_from"], "tokens": 604}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubGenerator(mypy.traverser.TraverserVisitor):\n\n def visit_import_from(self, o: ImportFrom) -> None:\n exported_names = set() # type: Set[str]\n import_names = []\n module, relative = translate_module_name(o.id, o.relative)\n if self.module:\n full_module, ok = mypy.util.correct_relative_import(\n self.module, relative, module, self.path.endswith('.__init__.py')\n )\n if not ok:\n full_module = module\n else:\n full_module = module\n if module == '__future__':\n return # Not preserved\n for name, as_name in o.names:\n if name == 'six':\n # Vendored six -- translate into plain 'import six'.\n self.visit_import(Import([('six', None)]))\n continue\n exported = False\n if as_name is None and self.module and (self.module + '.' + name) in EXTRA_EXPORTED:\n # Special case certain names that should be exported, against our general rules.\n exported = True\n is_private = self.is_private_name(name, full_module + '.' + name)\n if (as_name is None\n and name not in self.referenced_names\n and (not self._all_ or name in IGNORED_DUNDERS)\n and not is_private\n and module not in ('abc', 'typing', 'asyncio')):\n # An imported name that is never referenced in the module is assumed to be\n # exported, unless there is an explicit __all__. Note that we need to special\n # case 'abc' since some references are deleted during semantic analysis.\n exported = True\n top_level = full_module.split('.')[0]\n if (as_name is None\n and not self.export_less\n and (not self._all_ or name in IGNORED_DUNDERS)\n and self.module\n and not is_private\n and top_level in (self.module.split('.')[0],\n '_' + self.module.split('.')[0])):\n # Export imports from the same package, since we can't reliably tell whether they\n # are part of the public API.\n exported = True\n if exported:\n self.import_tracker.reexport(name)\n as_name = name\n import_names.append((name, as_name))\n self.import_tracker.add_import_from('.' * relative + module, import_names)\n self._vars[-1].extend(alias or name for name, alias in import_names)\n for name, alias in import_names:\n self.record_name(alias or name)\n\n if self._all_:\n # Include import froms that import names defined in __all__.\n names = [name for name, alias in o.names\n if name in self._all_ and alias is None and name not in IGNORED_DUNDERS]\n exported_names.update(names)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.visit_import_StubGenerator.get_init.return._s_s_s_s_n_self__i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.visit_import_StubGenerator.get_init.return._s_s_s_s_n_self__i", "embedding": null, "metadata": {"file_path": "mypy/stubgen.py", "file_name": "stubgen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 974, "end_line": 1010, "span_ids": ["StubGenerator.visit_import", "StubGenerator.get_init"], "tokens": 391}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubGenerator(mypy.traverser.TraverserVisitor):\n\n def visit_import(self, o: Import) -> None:\n for id, as_id in o.ids:\n self.import_tracker.add_import(id, as_id)\n if as_id is None:\n target_name = id.split('.')[0]\n else:\n target_name = as_id\n self._vars[-1].append(target_name)\n self.record_name(target_name)\n\n def get_init(self, lvalue: str, rvalue: Expression,\n annotation: Optional[Type] = None) -> Optional[str]:\n \"\"\"Return initializer for a variable.\n\n Return None if we've generated one already or if the variable is internal.\n \"\"\"\n if lvalue in self._vars[-1]:\n # We've generated an initializer already for this variable.\n return None\n # TODO: Only do this at module top level.\n if self.is_private_name(lvalue) or self.is_not_in_all(lvalue):\n return None\n self._vars[-1].append(lvalue)\n if annotation is not None:\n typename = self.print_annotation(annotation)\n if (isinstance(annotation, UnboundType) and not annotation.args and\n annotation.name == 'Final' and\n self.import_tracker.module_for.get('Final') in ('typing',\n 'typing_extensions')):\n # Final without type argument is invalid in stubs.\n final_arg = self.get_str_type_of_node(rvalue)\n typename += '[{}]'.format(final_arg)\n else:\n typename = self.get_str_type_of_node(rvalue)\n has_rhs = not (isinstance(rvalue, TempNode) and rvalue.no_rhs)\n initializer = \" = ...\" if has_rhs and not self.is_top_level() else \"\"\n return '%s%s: %s%s\\n' % (self._indent, lvalue, typename, initializer)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.add_StubGenerator.is_private_member.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.add_StubGenerator.is_private_member.return.False", "embedding": null, "metadata": {"file_path": "mypy/stubgen.py", "file_name": "stubgen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1012, "end_line": 1079, "span_ids": ["StubGenerator.typing_name", "StubGenerator.add_coroutine_decorator", "StubGenerator.output", "StubGenerator.add_import_line", "StubGenerator.clear_decorators", "StubGenerator.add_decorator", "StubGenerator.add", "StubGenerator.is_private_member", "StubGenerator.is_not_in_all", "StubGenerator.is_private_name", "StubGenerator.add_typing_import"], "tokens": 562}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubGenerator(mypy.traverser.TraverserVisitor):\n\n def add(self, string: str) -> None:\n \"\"\"Add text to generated stub.\"\"\"\n self._output.append(string)\n\n def add_decorator(self, name: str) -> None:\n if not self._indent and self._state not in (EMPTY, FUNC):\n self._decorators.append('\\n')\n self._decorators.append('%s@%s\\n' % (self._indent, name))\n\n def clear_decorators(self) -> None:\n self._decorators.clear()\n\n def typing_name(self, name: str) -> str:\n if name in self.defined_names:\n # Avoid name clash between name from typing and a name defined in stub.\n return '_' + name\n else:\n return name\n\n def add_typing_import(self, name: str) -> None:\n \"\"\"Add a name to be imported from typing, unless it's imported already.\n\n The import will be internal to the stub.\n \"\"\"\n name = self.typing_name(name)\n self.import_tracker.require_name(name)\n\n def add_import_line(self, line: str) -> None:\n \"\"\"Add a line of text to the import section, unless it's already there.\"\"\"\n if line not in self._import_lines:\n self._import_lines.append(line)\n\n def add_coroutine_decorator(self, func: FuncDef, name: str, require_name: str) -> None:\n func.is_awaitable_coroutine = True\n self.add_decorator(name)\n self.import_tracker.require_name(require_name)\n\n def output(self) -> str:\n \"\"\"Return the text for the stub.\"\"\"\n imports = ''\n if self._import_lines:\n imports += ''.join(self._import_lines)\n imports += ''.join(self.import_tracker.import_lines())\n if imports and self._output:\n imports += '\\n'\n return imports + ''.join(self._output)\n\n def is_not_in_all(self, name: str) -> bool:\n if self.is_private_name(name):\n return False\n if self._all_:\n return self.is_top_level() and name not in self._all_\n return False\n\n def is_private_name(self, name: str, fullname: Optional[str] = None) -> bool:\n if self._include_private:\n return False\n if fullname in EXTRA_EXPORTED:\n return False\n return name.startswith('_') and (not name.endswith('__')\n or name in IGNORED_DUNDERS)\n\n def is_private_member(self, fullname: str) -> bool:\n parts = fullname.split('.')\n for part in parts:\n if self.is_private_name(part):\n return True\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.get_str_type_of_node_StubGenerator.get_str_type_of_node.return.self_typing_name_Any_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.get_str_type_of_node_StubGenerator.get_str_type_of_node.return.self_typing_name_Any_", "embedding": null, "metadata": {"file_path": "mypy/stubgen.py", "file_name": "stubgen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1081, "end_line": 1102, "span_ids": ["StubGenerator.get_str_type_of_node"], "tokens": 226}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubGenerator(mypy.traverser.TraverserVisitor):\n\n def get_str_type_of_node(self, rvalue: Expression,\n can_infer_optional: bool = False) -> str:\n if isinstance(rvalue, IntExpr):\n return 'int'\n if isinstance(rvalue, StrExpr):\n return 'str'\n if isinstance(rvalue, BytesExpr):\n return 'bytes'\n if isinstance(rvalue, FloatExpr):\n return 'float'\n if isinstance(rvalue, UnaryExpr) and isinstance(rvalue.expr, IntExpr):\n return 'int'\n if isinstance(rvalue, NameExpr) and rvalue.name in ('True', 'False'):\n return 'bool'\n if can_infer_optional and \\\n isinstance(rvalue, NameExpr) and rvalue.name == 'None':\n self.add_typing_import('Optional')\n self.add_typing_import('Any')\n return '{}[{}]'.format(self.typing_name('Optional'),\n self.typing_name('Any'))\n self.add_typing_import('Any')\n return self.typing_name('Any')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.print_annotation_StubGenerator.is_recorded_name.return.self_is_top_level_and_n": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.print_annotation_StubGenerator.is_recorded_name.return.self_is_top_level_and_n", "embedding": null, "metadata": {"file_path": "mypy/stubgen.py", "file_name": "stubgen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1104, "end_line": 1122, "span_ids": ["StubGenerator.print_annotation", "StubGenerator.is_recorded_name", "StubGenerator.is_top_level", "StubGenerator.record_name"], "tokens": 163}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubGenerator(mypy.traverser.TraverserVisitor):\n\n def print_annotation(self, t: Type) -> str:\n printer = AnnotationPrinter(self)\n return t.accept(printer)\n\n def is_top_level(self) -> bool:\n \"\"\"Are we processing the top level of a file?\"\"\"\n return self._indent == ''\n\n def record_name(self, name: str) -> None:\n \"\"\"Mark a name as defined.\n\n This only does anything if at the top level of a module.\n \"\"\"\n if self.is_top_level():\n self._toplevel_names.append(name)\n\n def is_recorded_name(self, name: str) -> bool:\n \"\"\"Has this name been recorded previously?\"\"\"\n return self.is_top_level() and name in self._toplevel_names", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_find_method_names_SelfTraverser.visit_assignment_stmt.if_isinstance_lvalue_Me.self_results_append_lval": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_find_method_names_SelfTraverser.visit_assignment_stmt.if_isinstance_lvalue_Me.self_results_append_lval", "embedding": null, "metadata": {"file_path": "mypy/stubgen.py", "file_name": "stubgen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1125, "end_line": 1148, "span_ids": ["SelfTraverser", "SelfTraverser.__init__", "find_method_names", "SelfTraverser.visit_assignment_stmt"], "tokens": 213}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def find_method_names(defs: List[Statement]) -> Set[str]:\n # TODO: Traverse into nested definitions\n result = set()\n for defn in defs:\n if isinstance(defn, FuncDef):\n result.add(defn.name)\n elif isinstance(defn, Decorator):\n result.add(defn.func.name)\n elif isinstance(defn, OverloadedFuncDef):\n for item in defn.items:\n result.update(find_method_names([item]))\n return result\n\n\nclass SelfTraverser(mypy.traverser.TraverserVisitor):\n def __init__(self) -> None:\n self.results = [] # type: List[Tuple[str, Expression]]\n\n def visit_assignment_stmt(self, o: AssignmentStmt) -> None:\n lvalue = o.lvalues[0]\n if (isinstance(lvalue, MemberExpr) and\n isinstance(lvalue.expr, NameExpr) and\n lvalue.expr.name == 'self'):\n self.results.append((lvalue.name, o.rvalue))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_find_self_initializers_normalize_path_separators.return.path": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_find_self_initializers_normalize_path_separators.return.path", "embedding": null, "metadata": {"file_path": "mypy/stubgen.py", "file_name": "stubgen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1151, "end_line": 1183, "span_ids": ["is_blacklisted_path", "get_qualified_name", "find_self_initializers", "remove_blacklisted_modules", "normalize_path_separators"], "tokens": 242}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def find_self_initializers(fdef: FuncBase) -> List[Tuple[str, Expression]]:\n \"\"\"Find attribute initializers in a method.\n\n Return a list of pairs (attribute name, r.h.s. expression).\n \"\"\"\n traverser = SelfTraverser()\n fdef.accept(traverser)\n return traverser.results\n\n\ndef get_qualified_name(o: Expression) -> str:\n if isinstance(o, NameExpr):\n return o.name\n elif isinstance(o, MemberExpr):\n return '%s.%s' % (get_qualified_name(o.expr), o.name)\n else:\n return ERROR_MARKER\n\n\ndef remove_blacklisted_modules(modules: List[StubSource]) -> List[StubSource]:\n return [module for module in modules\n if module.path is None or not is_blacklisted_path(module.path)]\n\n\ndef is_blacklisted_path(path: str) -> bool:\n return any(substr in (normalize_path_separators(path) + '\\n')\n for substr in BLACKLIST)\n\n\ndef normalize_path_separators(path: str) -> str:\n if sys.platform == 'win32':\n return path.replace('\\\\', '/')\n return path", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_collect_build_targets_collect_build_targets.return.py_modules_c_modules": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_collect_build_targets_collect_build_targets.return.py_modules_c_modules", "embedding": null, "metadata": {"file_path": "mypy/stubgen.py", "file_name": "stubgen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1186, "end_line": 1218, "span_ids": ["collect_build_targets"], "tokens": 262}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def collect_build_targets(options: Options, mypy_opts: MypyOptions) -> Tuple[List[StubSource],\n List[StubSource]]:\n \"\"\"Collect files for which we need to generate stubs.\n\n Return list of Python modules and C modules.\n \"\"\"\n if options.packages or options.modules:\n if options.no_import:\n py_modules = find_module_paths_using_search(options.modules,\n options.packages,\n options.search_path,\n options.pyversion)\n c_modules = [] # type: List[StubSource]\n else:\n # Using imports is the default, since we can also find C modules.\n py_modules, c_modules = find_module_paths_using_imports(options.modules,\n options.packages,\n options.interpreter,\n options.pyversion,\n options.verbose,\n options.quiet)\n else:\n # Use mypy native source collection for files and directories.\n try:\n source_list = create_source_list(options.files, mypy_opts)\n except InvalidSourceList as e:\n raise SystemExit(str(e)) from e\n py_modules = [StubSource(m.module, m.path) for m in source_list]\n c_modules = []\n\n py_modules = remove_blacklisted_modules(py_modules)\n\n return py_modules, c_modules", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_find_module_paths_using_imports_find_module_paths_using_imports.with_ModuleInspect_as_i.return.py_modules_c_modules": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_find_module_paths_using_imports_find_module_paths_using_imports.with_ModuleInspect_as_i.return.py_modules_c_modules", "embedding": null, "metadata": {"file_path": "mypy/stubgen.py", "file_name": "stubgen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1221, "end_line": 1258, "span_ids": ["find_module_paths_using_imports"], "tokens": 323}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def find_module_paths_using_imports(modules: List[str],\n packages: List[str],\n interpreter: str,\n pyversion: Tuple[int, int],\n verbose: bool,\n quiet: bool) -> Tuple[List[StubSource],\n List[StubSource]]:\n \"\"\"Find path and runtime value of __all__ (if possible) for modules and packages.\n\n This function uses runtime Python imports to get the information.\n \"\"\"\n with ModuleInspect() as inspect:\n py_modules = [] # type: List[StubSource]\n c_modules = [] # type: List[StubSource]\n found = list(walk_packages(inspect, packages, verbose))\n modules = modules + found\n modules = [mod\n for mod in modules\n if not is_non_library_module(mod)] # We don't want to run any tests or scripts\n for mod in modules:\n try:\n if pyversion[0] == 2:\n result = find_module_path_and_all_py2(mod, interpreter)\n else:\n result = find_module_path_and_all_py3(inspect, mod, verbose)\n except CantImport as e:\n tb = traceback.format_exc()\n if verbose:\n sys.stdout.write(tb)\n if not quiet:\n report_missing(mod, e.message, tb)\n continue\n if not result:\n c_modules.append(StubSource(mod))\n else:\n path, runtime_all = result\n py_modules.append(StubSource(mod, path, runtime_all))\n return py_modules, c_modules", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_is_non_library_module_translate_module_name.return.module_relative": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_is_non_library_module_translate_module_name.return.module_relative", "embedding": null, "metadata": {"file_path": "mypy/stubgen.py", "file_name": "stubgen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1261, "end_line": 1296, "span_ids": ["translate_module_name", "is_non_library_module"], "tokens": 270}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_non_library_module(module: str) -> bool:\n \"\"\"Does module look like a test module or a script?\"\"\"\n if module.endswith((\n '.tests',\n '.test',\n '.testing',\n '_tests',\n '_test_suite',\n 'test_util',\n 'test_utils',\n 'test_base',\n '.__main__',\n '.conftest', # Used by pytest\n '.setup', # Typically an install script\n )):\n return True\n if module.split('.')[-1].startswith('test_'):\n return True\n if ('.tests.' in module\n or '.test.' in module\n or '.testing.' in module\n or '.SelfTest.' in module):\n return True\n return False\n\n\ndef translate_module_name(module: str, relative: int) -> Tuple[str, int]:\n for pkg in VENDOR_PACKAGES:\n for alt in 'six.moves', 'six':\n substr = '{}.{}'.format(pkg, alt)\n if (module.endswith('.' + substr)\n or (module == substr and relative)):\n return alt, 0\n if '.' + substr + '.' in module:\n return alt + '.' + module.partition('.' + substr + '.')[2], 0\n return module, relative", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_find_module_paths_using_search_find_module_paths_using_search.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_find_module_paths_using_search_find_module_paths_using_search.return.result", "embedding": null, "metadata": {"file_path": "mypy/stubgen.py", "file_name": "stubgen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1299, "end_line": 1329, "span_ids": ["find_module_paths_using_search"], "tokens": 305}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def find_module_paths_using_search(modules: List[str], packages: List[str],\n search_path: List[str],\n pyversion: Tuple[int, int]) -> List[StubSource]:\n \"\"\"Find sources for modules and packages requested.\n\n This function just looks for source files at the file system level.\n This is used if user passes --no-import, and will not find C modules.\n Exit if some of the modules or packages can't be found.\n \"\"\"\n result = [] # type: List[StubSource]\n typeshed_path = default_lib_path(mypy.build.default_data_dir(), pyversion, None)\n search_paths = SearchPaths(('.',) + tuple(search_path), (), (), tuple(typeshed_path))\n cache = FindModuleCache(search_paths, fscache=None, options=None)\n for module in modules:\n m_result = cache.find_module(module)\n if isinstance(m_result, ModuleNotFoundReason):\n fail_missing(module, m_result)\n module_path = None\n else:\n module_path = m_result\n result.append(StubSource(module, module_path))\n for package in packages:\n p_result = cache.find_modules_recursive(package)\n if p_result:\n fail_missing(package, ModuleNotFoundReason.NOT_FOUND)\n sources = [StubSource(m.module, m.path) for m in p_result]\n result.extend(sources)\n\n result = [m for m in result if not is_non_library_module(m.module)]\n\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_mypy_options_parse_source_file.if_errors_is_blockers_.sys_exit_1_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_mypy_options_parse_source_file.if_errors_is_blockers_.sys_exit_1_", "embedding": null, "metadata": {"file_path": "mypy/stubgen.py", "file_name": "stubgen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1332, "end_line": 1363, "span_ids": ["parse_source_file", "mypy_options"], "tokens": 291}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def mypy_options(stubgen_options: Options) -> MypyOptions:\n \"\"\"Generate mypy options using the flag passed by user.\"\"\"\n options = MypyOptions()\n options.follow_imports = 'skip'\n options.incremental = False\n options.ignore_errors = True\n options.semantic_analysis_only = True\n options.python_version = stubgen_options.pyversion\n options.show_traceback = True\n options.transform_source = remove_misplaced_type_comments\n return options\n\n\ndef parse_source_file(mod: StubSource, mypy_options: MypyOptions) -> None:\n \"\"\"Parse a source file.\n\n On success, store AST in the corresponding attribute of the stub source.\n If there are syntax errors, print them and exit.\n \"\"\"\n assert mod.path is not None, \"Not found module was not skipped\"\n with open(mod.path, 'rb') as f:\n data = f.read()\n source = mypy.util.decode_python_encoding(data, mypy_options.python_version)\n errors = Errors()\n mod.ast = mypy.parse.parse(source, fnam=mod.path, module=mod.module,\n errors=errors, options=mypy_options)\n mod.ast._fullname = mod.module\n if errors.is_blockers():\n # Syntax error!\n for m in errors.new_messages():\n sys.stderr.write('%s\\n' % m)\n sys.exit(1)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_generate_asts_for_modules_generate_asts_for_modules.for_mod_in_py_modules_.if_mod_runtime_all_is_Non.mod.runtime_all.res_manager_semantic_anal": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_generate_asts_for_modules_generate_asts_for_modules.for_mod_in_py_modules_.if_mod_runtime_all_is_Non.mod.runtime_all.res_manager_semantic_anal", "embedding": null, "metadata": {"file_path": "mypy/stubgen.py", "file_name": "stubgen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1431, "end_line": 1454, "span_ids": ["generate_asts_for_modules"], "tokens": 230}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_asts_for_modules(py_modules: List[StubSource],\n parse_only: bool,\n mypy_options: MypyOptions,\n verbose: bool) -> None:\n \"\"\"Use mypy to parse (and optionally analyze) source files.\"\"\"\n if not py_modules:\n return # Nothing to do here, but there may be C modules\n if verbose:\n print('Processing %d files...' % len(py_modules))\n if parse_only:\n for mod in py_modules:\n parse_source_file(mod, mypy_options)\n return\n # Perform full semantic analysis of the source set.\n try:\n res = build([module.source for module in py_modules], mypy_options)\n except CompileError as e:\n raise SystemExit(\"Critical error during semantic analysis: {}\".format(e)) from e\n\n for mod in py_modules:\n mod.ast = res.graph[mod.module].tree\n # Use statically inferred __all__ if there is no runtime one.\n if mod.runtime_all is None:\n mod.runtime_all = res.manager.semantic_analyzer.export_map[mod.module]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_generate_stub_from_ast_generate_stub_from_ast.with_open_target_w_as.file_write_join_gen_ou": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_generate_stub_from_ast_generate_stub_from_ast.with_open_target_w_as.file_write_join_gen_ou", "embedding": null, "metadata": {"file_path": "mypy/stubgen.py", "file_name": "stubgen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1392, "end_line": 1416, "span_ids": ["generate_stub_from_ast"], "tokens": 213}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_stub_from_ast(mod: StubSource,\n target: str,\n parse_only: bool = False,\n pyversion: Tuple[int, int] = defaults.PYTHON3_VERSION,\n include_private: bool = False,\n export_less: bool = False) -> None:\n \"\"\"Use analysed (or just parsed) AST to generate type stub for single file.\n\n If directory for target doesn't exist it will created. Existing stub\n will be overwritten.\n \"\"\"\n gen = StubGenerator(mod.runtime_all,\n pyversion=pyversion,\n include_private=include_private,\n analyzed=not parse_only,\n export_less=export_less)\n assert mod.ast is not None, \"This function must be used only with analyzed modules\"\n mod.ast.accept(gen)\n\n # Write output to file.\n subdir = os.path.dirname(target)\n if subdir and not os.path.isdir(subdir):\n os.makedirs(subdir)\n with open(target, 'w') as file:\n file.write(''.join(gen.output()))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_collect_docs_signatures_collect_docs_signatures.return.sigs_class_sigs": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_collect_docs_signatures_collect_docs_signatures.return.sigs_class_sigs", "embedding": null, "metadata": {"file_path": "mypy/stubgen.py", "file_name": "stubgen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1419, "end_line": 1434, "span_ids": ["collect_docs_signatures"], "tokens": 182}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def collect_docs_signatures(doc_dir: str) -> Tuple[Dict[str, str], Dict[str, str]]:\n \"\"\"Gather all function and class signatures in the docs.\n\n Return a tuple (function signatures, class signatures).\n Currently only used for C modules.\n \"\"\"\n all_sigs = [] # type: List[Sig]\n all_class_sigs = [] # type: List[Sig]\n for path in glob.glob('%s/*.rst' % doc_dir):\n with open(path) as f:\n loc_sigs, loc_class_sigs = parse_all_signatures(f.readlines())\n all_sigs += loc_sigs\n all_class_sigs += loc_class_sigs\n sigs = dict(find_unique_signatures(all_sigs))\n class_sigs = dict(find_unique_signatures(all_class_sigs))\n return sigs, class_sigs", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_generate_stubs_DESCRIPTION._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_generate_stubs_DESCRIPTION._", "embedding": null, "metadata": {"file_path": "mypy/stubgen.py", "file_name": "stubgen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1437, "end_line": 1493, "span_ids": ["generate_stubs", "impl:25"], "tokens": 546}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_stubs(options: Options) -> None:\n \"\"\"Main entry point for the program.\"\"\"\n mypy_opts = mypy_options(options)\n py_modules, c_modules = collect_build_targets(options, mypy_opts)\n\n # Collect info from docs (if given):\n sigs = class_sigs = None # type: Optional[Dict[str, str]]\n if options.doc_dir:\n sigs, class_sigs = collect_docs_signatures(options.doc_dir)\n\n # Use parsed sources to generate stubs for Python modules.\n generate_asts_for_modules(py_modules, options.parse_only, mypy_opts, options.verbose)\n files = []\n for mod in py_modules:\n assert mod.path is not None, \"Not found module was not skipped\"\n target = mod.module.replace('.', '/')\n if os.path.basename(mod.path) == '__init__.py':\n target += '/__init__.pyi'\n else:\n target += '.pyi'\n target = os.path.join(options.output_dir, target)\n files.append(target)\n with generate_guarded(mod.module, target, options.ignore_errors, options.verbose):\n generate_stub_from_ast(mod, target,\n options.parse_only, options.pyversion,\n options.include_private,\n options.export_less)\n\n # Separately analyse C modules using different logic.\n for mod in c_modules:\n if any(py_mod.module.startswith(mod.module + '.')\n for py_mod in py_modules + c_modules):\n target = mod.module.replace('.', '/') + '/__init__.pyi'\n else:\n target = mod.module.replace('.', '/') + '.pyi'\n target = os.path.join(options.output_dir, target)\n files.append(target)\n with generate_guarded(mod.module, target, options.ignore_errors, options.verbose):\n generate_stub_for_c_module(mod.module, target, sigs=sigs, class_sigs=class_sigs)\n num_modules = len(py_modules) + len(c_modules)\n if not options.quiet and num_modules > 0:\n print('Processed %d modules' % num_modules)\n if len(files) == 1:\n print('Generated %s' % files[0])\n else:\n print('Generated files under %s' % common_dir_prefix(files) + os.sep)\n\n\nHEADER = \"\"\"%(prog)s [-h] [--py2] [more options, see -h]\n [-m MODULE] [-p PACKAGE] [files ...]\"\"\"\n\nDESCRIPTION = \"\"\"\nGenerate draft stubs for modules.\n\nStubs are generated in directory ./out, to avoid overriding files with\nmanual changes. This directory is assumed to exist.\n\"\"\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_parse_options_parse_options.if_not_os_path_exists_ns_.os_makedirs_ns_output_dir": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_parse_options_parse_options.if_not_os_path_exists_ns_.os_makedirs_ns_output_dir", "embedding": null, "metadata": {"file_path": "mypy/stubgen.py", "file_name": "stubgen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1496, "end_line": 1555, "span_ids": ["parse_options"], "tokens": 718}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def parse_options(args: List[str]) -> Options:\n parser = argparse.ArgumentParser(prog='stubgen',\n usage=HEADER,\n description=DESCRIPTION)\n\n parser.add_argument('--py2', action='store_true',\n help=\"run in Python 2 mode (default: Python 3 mode)\")\n parser.add_argument('--ignore-errors', action='store_true',\n help=\"ignore errors when trying to generate stubs for modules\")\n parser.add_argument('--no-import', action='store_true',\n help=\"don't import the modules, just parse and analyze them \"\n \"(doesn't work with C extension modules and might not \"\n \"respect __all__)\")\n parser.add_argument('--parse-only', action='store_true',\n help=\"don't perform semantic analysis of sources, just parse them \"\n \"(only applies to Python modules, might affect quality of stubs)\")\n parser.add_argument('--include-private', action='store_true',\n help=\"generate stubs for objects and members considered private \"\n \"(single leading underscore and no trailing underscores)\")\n parser.add_argument('--export-less', action='store_true',\n help=(\"don't implicitly export all names imported from other modules \"\n \"in the same package\"))\n parser.add_argument('-v', '--verbose', action='store_true',\n help=\"show more verbose messages\")\n parser.add_argument('-q', '--quiet', action='store_true',\n help=\"show fewer messages\")\n parser.add_argument('--doc-dir', metavar='PATH', default='',\n help=\"use .rst documentation in PATH (this may result in \"\n \"better stubs in some cases; consider setting this to \"\n \"DIR/Python-X.Y.Z/Doc/library)\")\n parser.add_argument('--search-path', metavar='PATH', default='',\n help=\"specify module search directories, separated by ':' \"\n \"(currently only used if --no-import is given)\")\n parser.add_argument('--python-executable', metavar='PATH', dest='interpreter', default='',\n help=\"use Python interpreter at PATH (only works for \"\n \"Python 2 right now)\")\n parser.add_argument('-o', '--output', metavar='PATH', dest='output_dir', default='out',\n help=\"change the output directory [default: %(default)s]\")\n parser.add_argument('-m', '--module', action='append', metavar='MODULE',\n dest='modules', default=[],\n help=\"generate stub for module; can repeat for more modules\")\n parser.add_argument('-p', '--package', action='append', metavar='PACKAGE',\n dest='packages', default=[],\n help=\"generate stubs for package recursively; can be repeated\")\n parser.add_argument(metavar='files', nargs='*', dest='files',\n help=\"generate stubs for given files or directories\")\n\n ns = parser.parse_args(args)\n\n pyversion = defaults.PYTHON2_VERSION if ns.py2 else defaults.PYTHON3_VERSION\n if not ns.interpreter:\n ns.interpreter = sys.executable if pyversion[0] == 3 else default_py2_interpreter()\n if ns.modules + ns.packages and ns.files:\n parser.error(\"May only specify one of: modules/packages or files.\")\n if ns.quiet and ns.verbose:\n parser.error('Cannot specify both quiet and verbose messages')\n\n # Create the output folder if it doesn't already exist.\n if not os.path.exists(ns.output_dir):\n os.makedirs(ns.output_dir)\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_parse_options.return_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_parse_options.return_", "embedding": null, "metadata": {"file_path": "mypy/stubgen.py", "file_name": "stubgen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1557, "end_line": 1587, "span_ids": ["parse_options", "impl:29", "main"], "tokens": 226}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def parse_options(args: List[str]) -> Options:\n # ... other code\n\n return Options(pyversion=pyversion,\n no_import=ns.no_import,\n doc_dir=ns.doc_dir,\n search_path=ns.search_path.split(':'),\n interpreter=ns.interpreter,\n ignore_errors=ns.ignore_errors,\n parse_only=ns.parse_only,\n include_private=ns.include_private,\n output_dir=ns.output_dir,\n modules=ns.modules,\n packages=ns.packages,\n files=ns.files,\n verbose=ns.verbose,\n quiet=ns.quiet,\n export_less=ns.export_less)\n\n\ndef main() -> None:\n mypy.util.check_python_version('stubgen')\n # Make sure that the current directory is in sys.path so that\n # stubgen can be run on packages in the current directory.\n if not ('' in sys.path or '.' in sys.path):\n sys.path.insert(0, '')\n\n options = parse_options(sys.argv[1:])\n generate_stubs(options)\n\n\nif __name__ == '__main__':\n main()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgenc.py__usr_bin_env_python3__DEFAULT_TYPING_IMPORTS._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgenc.py__usr_bin_env_python3__DEFAULT_TYPING_IMPORTS._", "embedding": null, "metadata": {"file_path": "mypy/stubgenc.py", "file_name": "stubgenc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 33, "span_ids": ["docstring"], "tokens": 193}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "#!/usr/bin/env python3\n\"\"\"Stub generator for C modules.\n\nThe public interface is via the mypy.stubgen module.\n\"\"\"\n\nimport importlib\nimport inspect\nimport os.path\nimport re\nfrom typing import List, Dict, Tuple, Optional, Mapping, Any, Set\nfrom types import ModuleType\n\nfrom mypy.moduleinspect import is_c_module\nfrom mypy.stubdoc import (\n infer_sig_from_docstring, infer_prop_type_from_docstring, ArgSig,\n infer_arg_sig_from_anon_docstring, infer_ret_type_sig_from_anon_docstring,\n infer_ret_type_sig_from_docstring, FunctionSig\n)\n\n# Members of the typing module to consider for importing by default.\n_DEFAULT_TYPING_IMPORTS = (\n 'Any',\n 'Callable',\n 'ClassVar',\n 'Dict',\n 'Iterable',\n 'Iterator',\n 'List',\n 'Optional',\n 'Tuple',\n 'Union',\n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgenc.py_generate_stub_for_c_module_generate_stub_for_c_module.with_open_target_w_as.for_line_in_output_.file_write_s_n_line_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgenc.py_generate_stub_for_c_module_generate_stub_for_c_module.with_open_target_w_as.for_line_in_output_.file_write_s_n_line_", "embedding": null, "metadata": {"file_path": "mypy/stubgenc.py", "file_name": "stubgenc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 36, "end_line": 92, "span_ids": ["generate_stub_for_c_module"], "tokens": 516}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_stub_for_c_module(module_name: str,\n target: str,\n sigs: Optional[Dict[str, str]] = None,\n class_sigs: Optional[Dict[str, str]] = None) -> None:\n \"\"\"Generate stub for C module.\n\n This combines simple runtime introspection (looking for docstrings and attributes\n with simple builtin types) and signatures inferred from .rst documentation (if given).\n\n If directory for target doesn't exist it will be created. Existing stub\n will be overwritten.\n \"\"\"\n module = importlib.import_module(module_name)\n assert is_c_module(module), '%s is not a C module' % module_name\n subdir = os.path.dirname(target)\n if subdir and not os.path.isdir(subdir):\n os.makedirs(subdir)\n imports = [] # type: List[str]\n functions = [] # type: List[str]\n done = set()\n items = sorted(module.__dict__.items(), key=lambda x: x[0])\n for name, obj in items:\n if is_c_function(obj):\n generate_c_function_stub(module, name, obj, functions, imports=imports, sigs=sigs)\n done.add(name)\n types = [] # type: List[str]\n for name, obj in items:\n if name.startswith('__') and name.endswith('__'):\n continue\n if is_c_type(obj):\n generate_c_type_stub(module, name, obj, types, imports=imports, sigs=sigs,\n class_sigs=class_sigs)\n done.add(name)\n variables = []\n for name, obj in items:\n if name.startswith('__') and name.endswith('__'):\n continue\n if name not in done and not inspect.ismodule(obj):\n type_str = strip_or_import(get_type_fullname(type(obj)), module, imports)\n variables.append('%s: %s' % (name, type_str))\n output = []\n for line in sorted(set(imports)):\n output.append(line)\n for line in variables:\n output.append(line)\n for line in types:\n if line.startswith('class') and output and output[-1]:\n output.append('')\n output.append(line)\n if output and functions:\n output.append('')\n for line in functions:\n output.append(line)\n output = add_typing_import(output)\n with open(target, 'w') as file:\n for line in output:\n file.write('%s\\n' % line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgenc.py_generate_c_function_stub_generate_c_function_stub.if_inferred_.for_signature_in_inferred.output_append_def_funct": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgenc.py_generate_c_function_stub_generate_c_function_stub.if_inferred_.for_signature_in_inferred.output_append_def_funct", "embedding": null, "metadata": {"file_path": "mypy/stubgenc.py", "file_name": "stubgenc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 139, "end_line": 210, "span_ids": ["generate_c_function_stub"], "tokens": 629}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_c_function_stub(module: ModuleType,\n name: str,\n obj: object,\n output: List[str],\n imports: List[str],\n self_var: Optional[str] = None,\n sigs: Optional[Dict[str, str]] = None,\n class_name: Optional[str] = None,\n class_sigs: Optional[Dict[str, str]] = None) -> None:\n \"\"\"Generate stub for a single function or method.\n\n The result (always a single line) will be appended to 'output'.\n If necessary, any required names will be added to 'imports'.\n The 'class_name' is used to find signature of __init__ or __new__ in\n 'class_sigs'.\n \"\"\"\n if sigs is None:\n sigs = {}\n if class_sigs is None:\n class_sigs = {}\n\n ret_type = 'None' if name == '__init__' and class_name else 'Any'\n\n if (name in ('__new__', '__init__') and name not in sigs and class_name and\n class_name in class_sigs):\n inferred = [FunctionSig(name=name,\n args=infer_arg_sig_from_anon_docstring(class_sigs[class_name]),\n ret_type=ret_type)] # type: Optional[List[FunctionSig]]\n else:\n docstr = getattr(obj, '__doc__', None)\n inferred = infer_sig_from_docstring(docstr, name)\n if inferred and is_pybind11_overloaded_function_docstring(docstr, name):\n # Remove pybind11 umbrella (*args, **kwargs) for overloaded functions\n del inferred[-1]\n if not inferred:\n if class_name and name not in sigs:\n inferred = [FunctionSig(name, args=infer_method_sig(name), ret_type=ret_type)]\n else:\n inferred = [FunctionSig(name=name,\n args=infer_arg_sig_from_anon_docstring(\n sigs.get(name, '(*args, **kwargs)')),\n ret_type=ret_type)]\n\n is_overloaded = len(inferred) > 1 if inferred else False\n if is_overloaded:\n imports.append('from typing import overload')\n if inferred:\n for signature in inferred:\n sig = []\n for arg in signature.args:\n if arg.name == self_var:\n arg_def = self_var\n else:\n arg_def = arg.name\n if arg_def == 'None':\n arg_def = '_none' # None is not a valid argument name\n\n if arg.type:\n arg_def += \": \" + strip_or_import(arg.type, module, imports)\n\n if arg.default:\n arg_def += \" = ...\"\n\n sig.append(arg_def)\n\n if is_overloaded:\n output.append('@overload')\n output.append('def {function}({args}) -> {ret}: ...'.format(\n function=name,\n args=\", \".join(sig),\n ret=strip_or_import(signature.ret_type, module, imports)\n ))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgenc.py_infer_method_sig_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgenc.py_infer_method_sig_", "embedding": null, "metadata": {"file_path": "mypy/stubgenc.py", "file_name": "stubgenc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 378, "end_line": 428, "span_ids": ["infer_method_sig"], "tokens": 593}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def infer_method_sig(name: str) -> List[ArgSig]:\n args = None # type: Optional[List[ArgSig]]\n if name.startswith('__') and name.endswith('__'):\n name = name[2:-2]\n if name in ('hash', 'iter', 'next', 'sizeof', 'copy', 'deepcopy', 'reduce', 'getinitargs',\n 'int', 'float', 'trunc', 'complex', 'bool', 'abs', 'bytes', 'dir', 'len',\n 'reversed', 'round', 'index', 'enter'):\n args = []\n elif name == 'getitem':\n args = [ArgSig(name='index')]\n elif name == 'setitem':\n args = [ArgSig(name='index'),\n ArgSig(name='object')]\n elif name in ('delattr', 'getattr'):\n args = [ArgSig(name='name')]\n elif name == 'setattr':\n args = [ArgSig(name='name'),\n ArgSig(name='value')]\n elif name == 'getstate':\n args = []\n elif name == 'setstate':\n args = [ArgSig(name='state')]\n elif name in ('eq', 'ne', 'lt', 'le', 'gt', 'ge',\n 'add', 'radd', 'sub', 'rsub', 'mul', 'rmul',\n 'mod', 'rmod', 'floordiv', 'rfloordiv', 'truediv', 'rtruediv',\n 'divmod', 'rdivmod', 'pow', 'rpow',\n 'xor', 'rxor', 'or', 'ror', 'and', 'rand', 'lshift', 'rlshift',\n 'rshift', 'rrshift',\n 'contains', 'delitem',\n 'iadd', 'iand', 'ifloordiv', 'ilshift', 'imod', 'imul', 'ior',\n 'ipow', 'irshift', 'isub', 'itruediv', 'ixor'):\n args = [ArgSig(name='other')]\n elif name in ('neg', 'pos', 'invert'):\n args = []\n elif name == 'get':\n args = [ArgSig(name='instance'),\n ArgSig(name='owner')]\n elif name == 'set':\n args = [ArgSig(name='instance'),\n ArgSig(name='value')]\n elif name == 'reduce_ex':\n args = [ArgSig(name='protocol')]\n elif name == 'exit':\n args = [ArgSig(name='type'),\n ArgSig(name='value'),\n ArgSig(name='traceback')]\n if args is None:\n args = [ArgSig(name='*args'),\n ArgSig(name='**kwargs')]\n return [ArgSig(name='self')] + args", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py__Tests_for_stubs___style.return._formatter_style_message_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py__Tests_for_stubs___style.return._formatter_style_message_", "embedding": null, "metadata": {"file_path": "mypy/stubtest.py", "file_name": "stubtest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 59, "span_ids": ["impl", "_style", "Missing.__repr__", "docstring", "Missing"], "tokens": 339}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Tests for stubs.\n\nVerify that various things in stubs are consistent with how things behave at runtime.\n\n\"\"\"\n\nimport argparse\nimport copy\nimport enum\nimport importlib\nimport inspect\nimport re\nimport sys\nimport types\nimport warnings\nfrom functools import singledispatch\nfrom pathlib import Path\nfrom typing import Any, Dict, Generic, Iterator, List, Optional, Tuple, TypeVar, Union, cast\n\nfrom typing_extensions import Type\n\nimport mypy.build\nimport mypy.modulefinder\nimport mypy.types\nfrom mypy import nodes\nfrom mypy.config_parser import parse_config_file\nfrom mypy.options import Options\nfrom mypy.util import FancyFormatter\n\n\nclass Missing:\n \"\"\"Marker object for things that are missing (from a stub or the runtime).\"\"\"\n\n def __repr__(self) -> str:\n return \"MISSING\"\n\n\nMISSING = Missing()\n\nT = TypeVar(\"T\")\nif sys.version_info >= (3, 5, 3):\n MaybeMissing = Union[T, Missing]\nelse:\n # work around a bug in 3.5.2 and earlier's typing.py\n class MaybeMissingMeta(type):\n def __getitem__(self, arg: Any) -> Any:\n return Union[arg, Missing]\n\n class MaybeMissing(metaclass=MaybeMissingMeta): # type: ignore\n pass\n\n\n_formatter = FancyFormatter(sys.stdout, sys.stderr, False)\n\n\ndef _style(message: str, **kwargs: Any) -> str:\n \"\"\"Wrapper around mypy.util for fancy formatting.\"\"\"\n kwargs.setdefault(\"color\", \"none\")\n return _formatter.style(message, **kwargs)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_Error_Error.is_positional_only_related.return._leading_double_underscor": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_Error_Error.is_positional_only_related.return._leading_double_underscor", "embedding": null, "metadata": {"file_path": "mypy/stubtest.py", "file_name": "stubtest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 62, "end_line": 98, "span_ids": ["Error.is_positional_only_related", "Error.__init__", "Error", "Error.is_missing_stub"], "tokens": 339}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Error:\n def __init__(\n self,\n object_path: List[str],\n message: str,\n stub_object: MaybeMissing[nodes.Node],\n runtime_object: MaybeMissing[Any],\n *,\n stub_desc: Optional[str] = None,\n runtime_desc: Optional[str] = None\n ) -> None:\n \"\"\"Represents an error found by stubtest.\n\n :param object_path: Location of the object with the error,\n e.g. ``[\"module\", \"Class\", \"method\"]``\n :param message: Error message\n :param stub_object: The mypy node representing the stub\n :param runtime_object: Actual object obtained from the runtime\n :param stub_desc: Specialised description for the stub object, should you wish\n :param runtime_desc: Specialised description for the runtime object, should you wish\n\n \"\"\"\n self.object_desc = \".\".join(object_path)\n self.message = message\n self.stub_object = stub_object\n self.runtime_object = runtime_object\n self.stub_desc = stub_desc or str(getattr(stub_object, \"type\", stub_object))\n self.runtime_desc = runtime_desc or str(runtime_object)\n\n def is_missing_stub(self) -> bool:\n \"\"\"Whether or not the error is for something missing from the stub.\"\"\"\n return isinstance(self.stub_object, Missing)\n\n def is_positional_only_related(self) -> bool:\n \"\"\"Whether or not the error is for something being (or not being) positional-only.\"\"\"\n # TODO: This is hacky, use error codes or something more resilient\n return \"leading double underscore\" in self.message", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_Error.get_description_Error.get_description.return._join_output_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_Error.get_description_Error.get_description.return._join_output_", "embedding": null, "metadata": {"file_path": "mypy/stubtest.py", "file_name": "stubtest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 100, "end_line": 154, "span_ids": ["Error.get_description"], "tokens": 395}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Error:\n\n def get_description(self, concise: bool = False) -> str:\n \"\"\"Returns a description of the error.\n\n :param concise: Whether to return a concise, one-line description\n\n \"\"\"\n if concise:\n return _style(self.object_desc, bold=True) + \" \" + self.message\n\n stub_line = None\n stub_file = None # type: None\n if not isinstance(self.stub_object, Missing):\n stub_line = self.stub_object.line\n # TODO: Find a way of getting the stub file\n\n stub_loc_str = \"\"\n if stub_line:\n stub_loc_str += \" at line {}\".format(stub_line)\n if stub_file:\n stub_loc_str += \" in file {}\".format(Path(stub_file))\n\n runtime_line = None\n runtime_file = None\n if not isinstance(self.runtime_object, Missing):\n try:\n runtime_line = inspect.getsourcelines(self.runtime_object)[1]\n except (OSError, TypeError):\n pass\n try:\n runtime_file = inspect.getsourcefile(self.runtime_object)\n except TypeError:\n pass\n\n runtime_loc_str = \"\"\n if runtime_line:\n runtime_loc_str += \" at line {}\".format(runtime_line)\n if runtime_file:\n runtime_loc_str += \" in file {}\".format(Path(runtime_file))\n\n output = [\n _style(\"error: \", color=\"red\", bold=True),\n _style(self.object_desc, bold=True),\n \" \",\n self.message,\n \"\\n\",\n \"Stub:\",\n _style(stub_loc_str, dim=True),\n \"\\n\",\n _style(self.stub_desc + \"\\n\", color=\"blue\", dim=True),\n \"Runtime:\",\n _style(runtime_loc_str, dim=True),\n \"\\n\",\n _style(self.runtime_desc + \"\\n\", color=\"blue\", dim=True),\n ]\n return \"\".join(output)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_test_module_test_module.with_warnings_catch_warni.yield_from_verify_stub_r": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_test_module_test_module.with_warnings_catch_warni.yield_from_verify_stub_r", "embedding": null, "metadata": {"file_path": "mypy/stubtest.py", "file_name": "stubtest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 157, "end_line": 180, "span_ids": ["test_module"], "tokens": 178}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_module(module_name: str) -> Iterator[Error]:\n \"\"\"Tests a given module's stub against introspecting it at runtime.\n\n Requires the stub to have been built already, accomplished by a call to ``build_stubs``.\n\n :param module_name: The module to test\n\n \"\"\"\n stub = get_stub(module_name)\n if stub is None:\n yield Error([module_name], \"failed to find stubs\", MISSING, None)\n return\n\n try:\n with warnings.catch_warnings():\n warnings.simplefilter(\"ignore\")\n runtime = importlib.import_module(module_name)\n except Exception as e:\n yield Error([module_name], \"failed to import: {}\".format(e), stub, MISSING)\n return\n\n with warnings.catch_warnings():\n warnings.simplefilter(\"ignore\")\n yield from verify(stub, runtime, [module_name])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_verify_verify.yield_Error_object_path_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_verify_verify.yield_Error_object_path_", "embedding": null, "metadata": {"file_path": "mypy/stubtest.py", "file_name": "stubtest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 183, "end_line": 195, "span_ids": ["verify"], "tokens": 110}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@singledispatch\ndef verify(\n stub: nodes.Node, runtime: MaybeMissing[Any], object_path: List[str]\n) -> Iterator[Error]:\n \"\"\"Entry point for comparing a stub to a runtime object.\n\n We use single dispatch based on the type of ``stub``.\n\n :param stub: The mypy node representing a part of the stub\n :param runtime: The runtime object corresponding to ``stub``\n\n \"\"\"\n yield Error(object_path, \"is an unknown mypy node\", stub, runtime)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_verify_mypyfile_verify_mypyfile.for_entry_in_sorted_to_ch.yield_from_verify_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_verify_mypyfile_verify_mypyfile.for_entry_in_sorted_to_ch.yield_from_verify_", "embedding": null, "metadata": {"file_path": "mypy/stubtest.py", "file_name": "stubtest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 198, "end_line": 233, "span_ids": ["verify_mypyfile"], "tokens": 365}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@verify.register(nodes.MypyFile)\ndef verify_mypyfile(\n stub: nodes.MypyFile, runtime: MaybeMissing[types.ModuleType], object_path: List[str]\n) -> Iterator[Error]:\n if isinstance(runtime, Missing):\n yield Error(object_path, \"is not present at runtime\", stub, runtime)\n return\n if not isinstance(runtime, types.ModuleType):\n yield Error(object_path, \"is not a module\", stub, runtime)\n return\n\n # Check things in the stub that are public\n to_check = set(\n m\n for m, o in stub.names.items()\n if o.module_public and (not m.startswith(\"_\") or hasattr(runtime, m))\n )\n runtime_public_contents = [\n m\n for m in dir(runtime)\n if not m.startswith(\"_\")\n # Ensure that the object's module is `runtime`, e.g. so that we don't pick up reexported\n # modules and infinitely recurse. Unfortunately, there's no way to detect an explicit\n # reexport missing from the stubs (that isn't specified in __all__)\n and getattr(getattr(runtime, m), \"__module__\", None) == runtime.__name__\n ]\n # Check all things declared in module's __all__, falling back to runtime_public_contents\n to_check.update(getattr(runtime, \"__all__\", runtime_public_contents))\n to_check.difference_update({\"__file__\", \"__doc__\", \"__name__\", \"__builtins__\", \"__package__\"})\n\n for entry in sorted(to_check):\n yield from verify(\n stub.names[entry].node if entry in stub.names else MISSING,\n getattr(runtime, entry, MISSING),\n object_path + [entry],\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_verify_typeinfo_verify_typeinfo.for_entry_in_sorted_to_ch.yield_from_verify_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_verify_typeinfo_verify_typeinfo.for_entry_in_sorted_to_ch.yield_from_verify_", "embedding": null, "metadata": {"file_path": "mypy/stubtest.py", "file_name": "stubtest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 236, "end_line": 264, "span_ids": ["verify_typeinfo"], "tokens": 302}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@verify.register(nodes.TypeInfo)\ndef verify_typeinfo(\n stub: nodes.TypeInfo, runtime: MaybeMissing[Type[Any]], object_path: List[str]\n) -> Iterator[Error]:\n if isinstance(runtime, Missing):\n yield Error(object_path, \"is not present at runtime\", stub, runtime, stub_desc=repr(stub))\n return\n if not isinstance(runtime, type):\n yield Error(object_path, \"is not a type\", stub, runtime, stub_desc=repr(stub))\n return\n\n # Check everything already defined in the stub\n to_check = set(stub.names)\n # There's a reasonable case to be made that we should always check all dunders, but it's\n # currently quite noisy. We could turn this into a denylist instead of an allowlist.\n to_check.update(\n # cast to workaround mypyc complaints\n m for m in cast(Any, vars)(runtime) if not m.startswith(\"_\") or m in SPECIAL_DUNDERS\n )\n\n for entry in sorted(to_check):\n mangled_entry = entry\n if entry.startswith(\"__\") and not entry.endswith(\"__\"):\n mangled_entry = \"_{}{}\".format(stub.name, entry)\n yield from verify(\n next((t.names[entry].node for t in stub.mro if entry in t.names), MISSING),\n getattr(runtime, mangled_entry, MISSING),\n object_path + [entry],\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py__verify_static_class_methods__verify_static_class_methods.None_6.yield_stub_is_a_staticme": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py__verify_static_class_methods__verify_static_class_methods.None_6.yield_stub_is_a_staticme", "embedding": null, "metadata": {"file_path": "mypy/stubtest.py", "file_name": "stubtest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 267, "end_line": 301, "span_ids": ["_verify_static_class_methods"], "tokens": 408}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _verify_static_class_methods(\n stub: nodes.FuncBase, runtime: Any, object_path: List[str]\n) -> Iterator[str]:\n if stub.name in (\"__new__\", \"__init_subclass__\", \"__class_getitem__\"):\n # Special cased by Python, so don't bother checking\n return\n if inspect.isbuiltin(runtime):\n # The isinstance checks don't work reliably for builtins, e.g. datetime.datetime.now, so do\n # something a little hacky that seems to work well\n probably_class_method = isinstance(getattr(runtime, \"__self__\", None), type)\n if probably_class_method and not stub.is_class:\n yield \"runtime is a classmethod but stub is not\"\n if not probably_class_method and stub.is_class:\n yield \"stub is a classmethod but runtime is not\"\n return\n\n # Look the object up statically, to avoid binding by the descriptor protocol\n static_runtime = importlib.import_module(object_path[0])\n for entry in object_path[1:]:\n try:\n static_runtime = inspect.getattr_static(static_runtime, entry)\n except AttributeError:\n # This can happen with mangled names, ignore for now.\n # TODO: pass more information about ancestors of nodes/objects to verify, so we don't\n # have to do this hacky lookup. Would be useful in a couple other places too.\n return\n\n if isinstance(static_runtime, classmethod) and not stub.is_class:\n yield \"runtime is a classmethod but stub is not\"\n if not isinstance(static_runtime, classmethod) and stub.is_class:\n yield \"stub is a classmethod but runtime is not\"\n if isinstance(static_runtime, staticmethod) and not stub.is_static:\n yield \"runtime is a staticmethod but stub is not\"\n if not isinstance(static_runtime, staticmethod) and stub.is_static:\n yield \"stub is a staticmethod but runtime is not\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py__verify_arg_name__verify_arg_name.yield_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py__verify_arg_name__verify_arg_name.yield_", "embedding": null, "metadata": {"file_path": "mypy/stubtest.py", "file_name": "stubtest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 304, "end_line": 335, "span_ids": ["_verify_arg_name"], "tokens": 272}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _verify_arg_name(\n stub_arg: nodes.Argument, runtime_arg: inspect.Parameter, function_name: str\n) -> Iterator[str]:\n \"\"\"Checks whether argument names match.\"\"\"\n # Ignore exact names for most dunder methods\n if is_dunder(function_name, exclude_special=True):\n return\n\n def strip_prefix(s: str, prefix: str) -> str:\n return s[len(prefix):] if s.startswith(prefix) else s\n\n if strip_prefix(stub_arg.variable.name, \"__\") == runtime_arg.name:\n return\n\n def names_approx_match(a: str, b: str) -> bool:\n a = a.strip(\"_\")\n b = b.strip(\"_\")\n return a.startswith(b) or b.startswith(a) or len(a) == 1 or len(b) == 1\n\n # Be more permissive about names matching for positional-only arguments\n if runtime_arg.kind == inspect.Parameter.POSITIONAL_ONLY and names_approx_match(\n stub_arg.variable.name, runtime_arg.name\n ):\n return\n # This comes up with namedtuples, so ignore\n if stub_arg.variable.name == \"_self\":\n return\n yield (\n 'stub argument \"{}\" differs from runtime argument \"{}\"'.format(\n stub_arg.variable.name, runtime_arg.name\n )\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_Signature_Signature.__str__.return.ret": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_Signature_Signature.__str__.return.ret", "embedding": null, "metadata": {"file_path": "mypy/stubtest.py", "file_name": "stubtest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 378, "end_line": 424, "span_ids": ["Signature.__init__", "Signature.__str__", "Signature"], "tokens": 405}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Signature(Generic[T]):\n def __init__(self) -> None:\n self.pos = [] # type: List[T]\n self.kwonly = {} # type: Dict[str, T]\n self.varpos = None # type: Optional[T]\n self.varkw = None # type: Optional[T]\n\n def __str__(self) -> str:\n def get_name(arg: Any) -> str:\n if isinstance(arg, inspect.Parameter):\n return arg.name\n if isinstance(arg, nodes.Argument):\n return arg.variable.name\n raise AssertionError\n\n def get_type(arg: Any) -> Optional[str]:\n if isinstance(arg, inspect.Parameter):\n return None\n if isinstance(arg, nodes.Argument):\n return str(arg.variable.type or arg.type_annotation)\n raise AssertionError\n\n def has_default(arg: Any) -> bool:\n if isinstance(arg, inspect.Parameter):\n return arg.default != inspect.Parameter.empty\n if isinstance(arg, nodes.Argument):\n return arg.kind in (nodes.ARG_OPT, nodes.ARG_NAMED_OPT)\n raise AssertionError\n\n def get_desc(arg: Any) -> str:\n arg_type = get_type(arg)\n return (\n get_name(arg)\n + (\": {}\".format(arg_type) if arg_type else \"\")\n + (\" = ...\" if has_default(arg) else \"\")\n )\n\n kw_only = sorted(self.kwonly.values(), key=lambda a: (has_default(a), get_name(a)))\n ret = \"def (\"\n ret += \", \".join(\n [get_desc(arg) for arg in self.pos]\n + ([\"*\" + get_name(self.varpos)] if self.varpos else ([\"*\"] if self.kwonly else []))\n + [get_desc(arg) for arg in kw_only]\n + ([\"**\" + get_name(self.varkw)] if self.varkw else [])\n )\n ret += \")\"\n return ret", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_Signature.from_funcitem_Signature.from_funcitem.return.stub_sig": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_Signature.from_funcitem_Signature.from_funcitem.return.stub_sig", "embedding": null, "metadata": {"file_path": "mypy/stubtest.py", "file_name": "stubtest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 437, "end_line": 452, "span_ids": ["Signature.from_funcitem"], "tokens": 183}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Signature(Generic[T]):\n\n @staticmethod\n def from_funcitem(stub: nodes.FuncItem) -> \"Signature[nodes.Argument]\":\n stub_sig = Signature() # type: Signature[nodes.Argument]\n stub_args = maybe_strip_cls(stub.name, stub.arguments)\n for stub_arg in stub_args:\n if stub_arg.kind in (nodes.ARG_POS, nodes.ARG_OPT):\n stub_sig.pos.append(stub_arg)\n elif stub_arg.kind in (nodes.ARG_NAMED, nodes.ARG_NAMED_OPT):\n stub_sig.kwonly[stub_arg.variable.name] = stub_arg\n elif stub_arg.kind == nodes.ARG_STAR:\n stub_sig.varpos = stub_arg\n elif stub_arg.kind == nodes.ARG_STAR2:\n stub_sig.varkw = stub_arg\n else:\n raise AssertionError\n return stub_sig", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_Signature.from_inspect_signature_Signature.from_inspect_signature.return.runtime_sig": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_Signature.from_inspect_signature_Signature.from_inspect_signature.return.runtime_sig", "embedding": null, "metadata": {"file_path": "mypy/stubtest.py", "file_name": "stubtest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 442, "end_line": 459, "span_ids": ["Signature.from_inspect_signature"], "tokens": 169}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Signature(Generic[T]):\n\n @staticmethod\n def from_inspect_signature(signature: inspect.Signature) -> \"Signature[inspect.Parameter]\":\n runtime_sig = Signature() # type: Signature[inspect.Parameter]\n for runtime_arg in signature.parameters.values():\n if runtime_arg.kind in (\n inspect.Parameter.POSITIONAL_ONLY,\n inspect.Parameter.POSITIONAL_OR_KEYWORD,\n ):\n runtime_sig.pos.append(runtime_arg)\n elif runtime_arg.kind == inspect.Parameter.KEYWORD_ONLY:\n runtime_sig.kwonly[runtime_arg.name] = runtime_arg\n elif runtime_arg.kind == inspect.Parameter.VAR_POSITIONAL:\n runtime_sig.varpos = runtime_arg\n elif runtime_arg.kind == inspect.Parameter.VAR_KEYWORD:\n runtime_sig.varkw = runtime_arg\n else:\n raise AssertionError\n return runtime_sig", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_Signature.from_overloadedfuncdef_Signature.from_overloadedfuncdef.get_type.with_mypy_state_strict_op.return.mypy_typeops_make_simplif": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_Signature.from_overloadedfuncdef_Signature.from_overloadedfuncdef.get_type.with_mypy_state_strict_op.return.mypy_typeops_make_simplif", "embedding": null, "metadata": {"file_path": "mypy/stubtest.py", "file_name": "stubtest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 473, "end_line": 509, "span_ids": ["Signature.from_overloadedfuncdef"], "tokens": 421}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Signature(Generic[T]):\n\n @staticmethod\n def from_overloadedfuncdef(stub: nodes.OverloadedFuncDef) -> \"Signature[nodes.Argument]\":\n \"\"\"Returns a Signature from an OverloadedFuncDef.\n\n If life were simple, to verify_overloadedfuncdef, we'd just verify_funcitem for each of its\n items. Unfortunately, life isn't simple and overloads are pretty deceitful. So instead, we\n try and combine the overload's items into a single signature that is compatible with any\n lies it might try to tell.\n\n \"\"\"\n # For most dunder methods, just assume all args are positional-only\n assume_positional_only = is_dunder(stub.name, exclude_special=True)\n\n all_args = {} # type: Dict[str, List[Tuple[nodes.Argument, int]]]\n for func in map(_resolve_funcitem_from_decorator, stub.items):\n assert func is not None\n args = maybe_strip_cls(stub.name, func.arguments)\n for index, arg in enumerate(args):\n # For positional-only args, we allow overloads to have different names for the same\n # argument. To accomplish this, we just make up a fake index-based name.\n name = (\n \"__{}\".format(index)\n if arg.variable.name.startswith(\"__\") or assume_positional_only\n else arg.variable.name\n )\n all_args.setdefault(name, []).append((arg, index))\n\n def get_position(arg_name: str) -> int:\n # We just need this to return the positional args in the correct order.\n return max(index for _, index in all_args[arg_name])\n\n def get_type(arg_name: str) -> mypy.types.ProperType:\n with mypy.state.strict_optional_set(True):\n all_types = [\n arg.variable.type or arg.type_annotation for arg, _ in all_args[arg_name]\n ]\n return mypy.typeops.make_simplified_union([t for t in all_types if t])\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_Signature.from_overloadedfuncdef.get_kind_Signature.from_overloadedfuncdef.get_kind.return.nodes_ARG_POS_if_is_pos_e": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_Signature.from_overloadedfuncdef.get_kind_Signature.from_overloadedfuncdef.get_kind.return.nodes_ARG_POS_if_is_pos_e", "embedding": null, "metadata": {"file_path": "mypy/stubtest.py", "file_name": "stubtest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 498, "end_line": 515, "span_ids": ["Signature.from_overloadedfuncdef"], "tokens": 252}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Signature(Generic[T]):\n\n @staticmethod\n def from_overloadedfuncdef(stub: nodes.OverloadedFuncDef) -> \"Signature[nodes.Argument]\":\n # ... other code\n\n def get_kind(arg_name: str) -> int:\n kinds = {arg.kind for arg, _ in all_args[arg_name]}\n if nodes.ARG_STAR in kinds:\n return nodes.ARG_STAR\n if nodes.ARG_STAR2 in kinds:\n return nodes.ARG_STAR2\n # The logic here is based on two tenets:\n # 1) If an arg is ever optional (or unspecified), it is optional\n # 2) If an arg is ever positional, it is positional\n is_opt = (\n len(all_args[arg_name]) < len(stub.items)\n or nodes.ARG_OPT in kinds\n or nodes.ARG_NAMED_OPT in kinds\n )\n is_pos = nodes.ARG_OPT in kinds or nodes.ARG_POS in kinds\n if is_opt:\n return nodes.ARG_OPT if is_pos else nodes.ARG_NAMED_OPT\n return nodes.ARG_POS if is_pos else nodes.ARG_NAMED\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_Signature.from_overloadedfuncdef.sig_Signature.from_overloadedfuncdef.return.sig": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_Signature.from_overloadedfuncdef.sig_Signature.from_overloadedfuncdef.return.sig", "embedding": null, "metadata": {"file_path": "mypy/stubtest.py", "file_name": "stubtest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 517, "end_line": 537, "span_ids": ["Signature.from_overloadedfuncdef"], "tokens": 242}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Signature(Generic[T]):\n\n @staticmethod\n def from_overloadedfuncdef(stub: nodes.OverloadedFuncDef) -> \"Signature[nodes.Argument]\":\n # ... other code\n\n sig = Signature() # type: Signature[nodes.Argument]\n for arg_name in sorted(all_args, key=get_position):\n # example_arg_name gives us a real name (in case we had a fake index-based name)\n example_arg_name = all_args[arg_name][0][0].variable.name\n arg = nodes.Argument(\n nodes.Var(example_arg_name, get_type(arg_name)),\n type_annotation=None,\n initializer=None,\n kind=get_kind(arg_name),\n )\n if arg.kind in (nodes.ARG_POS, nodes.ARG_OPT):\n sig.pos.append(arg)\n elif arg.kind in (nodes.ARG_NAMED, nodes.ARG_NAMED_OPT):\n sig.kwonly[arg.variable.name] = arg\n elif arg.kind == nodes.ARG_STAR:\n sig.varpos = arg\n elif arg.kind == nodes.ARG_STAR2:\n sig.varkw = arg\n else:\n raise AssertionError\n return sig", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py__verify_signature__verify_signature._Check_unmatched_keyword": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py__verify_signature__verify_signature._Check_unmatched_keyword", "embedding": null, "metadata": {"file_path": "mypy/stubtest.py", "file_name": "stubtest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 542, "end_line": 606, "span_ids": ["_verify_signature"], "tokens": 733}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _verify_signature(\n stub: Signature[nodes.Argument], runtime: Signature[inspect.Parameter], function_name: str\n) -> Iterator[str]:\n # Check positional arguments match up\n for stub_arg, runtime_arg in zip(stub.pos, runtime.pos):\n yield from _verify_arg_name(stub_arg, runtime_arg, function_name)\n yield from _verify_arg_default_value(stub_arg, runtime_arg)\n if (\n runtime_arg.kind == inspect.Parameter.POSITIONAL_ONLY\n and not stub_arg.variable.name.startswith(\"__\")\n and not stub_arg.variable.name.strip(\"_\") == \"self\"\n and not is_dunder(function_name, exclude_special=True) # noisy for dunder methods\n ):\n yield (\n 'stub argument \"{}\" should be positional-only '\n '(rename with a leading double underscore, i.e. \"__{}\")'.format(\n stub_arg.variable.name, runtime_arg.name\n )\n )\n if (\n runtime_arg.kind != inspect.Parameter.POSITIONAL_ONLY\n and stub_arg.variable.name.startswith(\"__\")\n ):\n yield (\n 'stub argument \"{}\" should be positional or keyword '\n \"(remove leading double underscore)\".format(stub_arg.variable.name)\n )\n\n # Check unmatched positional args\n if len(stub.pos) > len(runtime.pos):\n # There are cases where the stub exhaustively lists out the extra parameters the function\n # would take through *args. Hence, a) we can't check that the runtime actually takes those\n # parameters and b) below, we don't enforce that the stub takes *args, since runtime logic\n # may prevent those arguments from actually being accepted.\n if runtime.varpos is None:\n for stub_arg in stub.pos[len(runtime.pos):]:\n # If the variable is in runtime.kwonly, it's just mislabelled as not a\n # keyword-only argument\n if stub_arg.variable.name not in runtime.kwonly:\n yield 'runtime does not have argument \"{}\"'.format(stub_arg.variable.name)\n else:\n yield 'stub argument \"{}\" is not keyword-only'.format(stub_arg.variable.name)\n if stub.varpos is not None:\n yield 'runtime does not have *args argument \"{}\"'.format(stub.varpos.variable.name)\n elif len(stub.pos) < len(runtime.pos):\n for runtime_arg in runtime.pos[len(stub.pos):]:\n if runtime_arg.name not in stub.kwonly:\n yield 'stub does not have argument \"{}\"'.format(runtime_arg.name)\n else:\n yield 'runtime argument \"{}\" is not keyword-only'.format(runtime_arg.name)\n\n # Checks involving *args\n if len(stub.pos) <= len(runtime.pos) or runtime.varpos is None:\n if stub.varpos is None and runtime.varpos is not None:\n yield 'stub does not have *args argument \"{}\"'.format(runtime.varpos.name)\n if stub.varpos is not None and runtime.varpos is None:\n yield 'runtime does not have *args argument \"{}\"'.format(stub.varpos.variable.name)\n\n # Check keyword-only args\n for arg in sorted(set(stub.kwonly) & set(runtime.kwonly)):\n stub_arg, runtime_arg = stub.kwonly[arg], runtime.kwonly[arg]\n yield from _verify_arg_name(stub_arg, runtime_arg, function_name)\n yield from _verify_arg_default_value(stub_arg, runtime_arg)\n\n # Check unmatched keyword-only args\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py__verify_signature.if_runtime_varkw_is_None___verify_signature.if_stub_varkw_is_not_None.yield_runtime_does_not_h": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py__verify_signature.if_runtime_varkw_is_None___verify_signature.if_stub_varkw_is_not_None.yield_runtime_does_not_h", "embedding": null, "metadata": {"file_path": "mypy/stubtest.py", "file_name": "stubtest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 605, "end_line": 631, "span_ids": ["_verify_signature"], "tokens": 469}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _verify_signature(\n stub: Signature[nodes.Argument], runtime: Signature[inspect.Parameter], function_name: str\n) -> Iterator[str]:\n # ... other code\n if runtime.varkw is None or not set(runtime.kwonly).issubset(set(stub.kwonly)):\n # There are cases where the stub exhaustively lists out the extra parameters the function\n # would take through *kwargs. Hence, a) we only check if the runtime actually takes those\n # parameters when the above condition holds and b) below, we don't enforce that the stub\n # takes *kwargs, since runtime logic may prevent additional arguments from actually being\n # accepted.\n for arg in sorted(set(stub.kwonly) - set(runtime.kwonly)):\n yield 'runtime does not have argument \"{}\"'.format(arg)\n for arg in sorted(set(runtime.kwonly) - set(stub.kwonly)):\n if arg in set(stub_arg.variable.name for stub_arg in stub.pos):\n # Don't report this if we've reported it before\n if len(stub.pos) > len(runtime.pos) and runtime.varpos is not None:\n yield 'stub argument \"{}\" is not keyword-only'.format(arg)\n else:\n yield 'stub does not have argument \"{}\"'.format(arg)\n\n # Checks involving **kwargs\n if stub.varkw is None and runtime.varkw is not None:\n # As mentioned above, don't enforce that the stub takes **kwargs.\n # Also check against positional parameters, to avoid a nitpicky message when an argument\n # isn't marked as keyword-only\n stub_pos_names = set(stub_arg.variable.name for stub_arg in stub.pos)\n # Ideally we'd do a strict subset check, but in practice the errors from that aren't useful\n if not set(runtime.kwonly).issubset(set(stub.kwonly) | stub_pos_names):\n yield 'stub does not have **kwargs argument \"{}\"'.format(runtime.varkw.name)\n if stub.varkw is not None and runtime.varkw is None:\n yield 'runtime does not have **kwargs argument \"{}\"'.format(stub.varkw.variable.name)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_verify_funcitem_verify_funcitem.for_message_in__verify_si.yield_Error_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_verify_funcitem_verify_funcitem.for_message_in__verify_si.yield_Error_", "embedding": null, "metadata": {"file_path": "mypy/stubtest.py", "file_name": "stubtest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 647, "end_line": 684, "span_ids": ["verify_funcitem"], "tokens": 292}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@verify.register(nodes.FuncItem)\ndef verify_funcitem(\n stub: nodes.FuncItem, runtime: MaybeMissing[Any], object_path: List[str]\n) -> Iterator[Error]:\n if isinstance(runtime, Missing):\n yield Error(object_path, \"is not present at runtime\", stub, runtime)\n return\n\n if (\n not isinstance(runtime, (types.FunctionType, types.BuiltinFunctionType))\n and not isinstance(runtime, (types.MethodType, types.BuiltinMethodType))\n and not inspect.ismethoddescriptor(runtime)\n ):\n yield Error(object_path, \"is not a function\", stub, runtime)\n if not callable(runtime):\n return\n\n for message in _verify_static_class_methods(stub, runtime, object_path):\n yield Error(object_path, \"is inconsistent, \" + message, stub, runtime)\n\n try:\n signature = inspect.signature(runtime)\n except (ValueError, RuntimeError):\n # inspect.signature throws sometimes\n # catch RuntimeError because of https://bugs.python.org/issue39504\n return\n\n stub_sig = Signature.from_funcitem(stub)\n runtime_sig = Signature.from_inspect_signature(signature)\n\n for message in _verify_signature(stub_sig, runtime_sig, function_name=stub.name):\n yield Error(\n object_path,\n \"is inconsistent, \" + message,\n stub,\n runtime,\n runtime_desc=\"def \" + str(signature),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_verify_none_verify_var.if_.if_should_error_.yield_Error_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_verify_none_verify_var.if_.if_should_error_.yield_Error_", "embedding": null, "metadata": {"file_path": "mypy/stubtest.py", "file_name": "stubtest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 672, "end_line": 709, "span_ids": ["verify_none", "verify_var"], "tokens": 300}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@verify.register(Missing)\ndef verify_none(\n stub: Missing, runtime: MaybeMissing[Any], object_path: List[str]\n) -> Iterator[Error]:\n yield Error(object_path, \"is not present in stub\", stub, runtime)\n\n\n@verify.register(nodes.Var)\ndef verify_var(\n stub: nodes.Var, runtime: MaybeMissing[Any], object_path: List[str]\n) -> Iterator[Error]:\n if isinstance(runtime, Missing):\n # Don't always yield an error here, because we often can't find instance variables\n if len(object_path) <= 2:\n yield Error(object_path, \"is not present at runtime\", stub, runtime)\n return\n\n runtime_type = get_mypy_type_of_runtime_value(runtime)\n if (\n runtime_type is not None\n and stub.type is not None\n and not is_subtype_helper(runtime_type, stub.type)\n ):\n should_error = True\n # Avoid errors when defining enums, since runtime_type is the enum itself, but we'd\n # annotate it with the type of runtime.value\n if isinstance(runtime, enum.Enum):\n runtime_type = get_mypy_type_of_runtime_value(runtime.value)\n if runtime_type is not None and is_subtype_helper(runtime_type, stub.type):\n should_error = False\n\n if should_error:\n yield Error(\n object_path,\n \"variable differs from runtime type {}\".format(runtime_type),\n stub,\n runtime,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_verify_overloadedfuncdef_verify_overloadedfuncdef.for_message_in__verify_si.yield_Error_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_verify_overloadedfuncdef_verify_overloadedfuncdef.for_message_in__verify_si.yield_Error_", "embedding": null, "metadata": {"file_path": "mypy/stubtest.py", "file_name": "stubtest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 727, "end_line": 773, "span_ids": ["verify_overloadedfuncdef"], "tokens": 380}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@verify.register(nodes.OverloadedFuncDef)\ndef verify_overloadedfuncdef(\n stub: nodes.OverloadedFuncDef, runtime: MaybeMissing[Any], object_path: List[str]\n) -> Iterator[Error]:\n if isinstance(runtime, Missing):\n yield Error(object_path, \"is not present at runtime\", stub, runtime)\n return\n\n if stub.is_property:\n # We get here in cases of overloads from property.setter\n return\n\n if (\n not isinstance(runtime, (types.FunctionType, types.BuiltinFunctionType))\n and not isinstance(runtime, (types.MethodType, types.BuiltinMethodType))\n and not inspect.ismethoddescriptor(runtime)\n ):\n yield Error(object_path, \"is not a function\", stub, runtime)\n if not callable(runtime):\n return\n\n for message in _verify_static_class_methods(stub, runtime, object_path):\n yield Error(object_path, \"is inconsistent, \" + message, stub, runtime)\n\n try:\n signature = inspect.signature(runtime)\n except ValueError:\n return\n\n stub_sig = Signature.from_overloadedfuncdef(stub)\n runtime_sig = Signature.from_inspect_signature(signature)\n\n for message in _verify_signature(stub_sig, runtime_sig, function_name=stub.name):\n # TODO: This is a little hacky, but the addition here is super useful\n if \"has a default value of type\" in message:\n message += (\n \". This is often caused by overloads failing to account for explicitly passing \"\n \"in the default value.\"\n )\n yield Error(\n object_path,\n \"is inconsistent, \" + message,\n stub,\n runtime,\n stub_desc=str(stub.type) + \"\\nInferred signature: {}\".format(stub_sig),\n runtime_desc=\"def \" + str(signature),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_verify_typevarexpr__verify_property.yield_is_inconsistent_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_verify_typevarexpr__verify_property.yield_is_inconsistent_c", "embedding": null, "metadata": {"file_path": "mypy/stubtest.py", "file_name": "stubtest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 749, "end_line": 776, "span_ids": ["_verify_property", "verify_typevarexpr"], "tokens": 237}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@verify.register(nodes.TypeVarExpr)\ndef verify_typevarexpr(\n stub: nodes.TypeVarExpr, runtime: MaybeMissing[Any], object_path: List[str]\n) -> Iterator[Error]:\n if False:\n yield None\n\n\ndef _verify_property(stub: nodes.Decorator, runtime: Any) -> Iterator[str]:\n assert stub.func.is_property\n if isinstance(runtime, property):\n return\n if inspect.isdatadescriptor(runtime):\n # It's enough like a property...\n return\n # Sometimes attributes pretend to be properties, for instance, to express that they\n # are read only. So allowlist if runtime_type matches the return type of stub.\n runtime_type = get_mypy_type_of_runtime_value(runtime)\n func_type = (\n stub.func.type.ret_type if isinstance(stub.func.type, mypy.types.CallableType) else None\n )\n if (\n runtime_type is not None\n and func_type is not None\n and is_subtype_helper(runtime_type, func_type)\n ):\n return\n yield \"is inconsistent, cannot reconcile @property on stub with runtime object\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py__resolve_funcitem_from_decorator__resolve_funcitem_from_decorator.return.func": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py__resolve_funcitem_from_decorator__resolve_funcitem_from_decorator.return.func", "embedding": null, "metadata": {"file_path": "mypy/stubtest.py", "file_name": "stubtest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 779, "end_line": 821, "span_ids": ["_resolve_funcitem_from_decorator"], "tokens": 347}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _resolve_funcitem_from_decorator(dec: nodes.OverloadPart) -> Optional[nodes.FuncItem]:\n \"\"\"Returns a FuncItem that corresponds to the output of the decorator.\n\n Returns None if we can't figure out what that would be. For convenience, this function also\n accepts FuncItems.\n\n \"\"\"\n if isinstance(dec, nodes.FuncItem):\n return dec\n if dec.func.is_property:\n return None\n\n def apply_decorator_to_funcitem(\n decorator: nodes.Expression, func: nodes.FuncItem\n ) -> Optional[nodes.FuncItem]:\n if not isinstance(decorator, nodes.RefExpr):\n return None\n if decorator.fullname is None:\n # Happens with namedtuple\n return None\n if decorator.fullname in (\n \"builtins.staticmethod\",\n \"typing.overload\",\n \"abc.abstractmethod\",\n ):\n return func\n if decorator.fullname == \"builtins.classmethod\":\n assert func.arguments[0].variable.name in (\"cls\", \"metacls\")\n ret = copy.copy(func)\n # Remove the cls argument, since it's not present in inspect.signature of classmethods\n ret.arguments = ret.arguments[1:]\n return ret\n # Just give up on any other decorators. After excluding properties, we don't run into\n # anything else when running on typeshed's stdlib.\n return None\n\n func = dec.func # type: nodes.FuncItem\n for decorator in dec.original_decorators:\n resulting_func = apply_decorator_to_funcitem(decorator, func)\n if resulting_func is None:\n return None\n func = resulting_func\n return func", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_verify_decorator_verify_decorator.if_func_is_not_None_.yield_from_verify_func_r": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_verify_decorator_verify_decorator.if_func_is_not_None_.yield_from_verify_func_r", "embedding": null, "metadata": {"file_path": "mypy/stubtest.py", "file_name": "stubtest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 824, "end_line": 838, "span_ids": ["verify_decorator"], "tokens": 129}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@verify.register(nodes.Decorator)\ndef verify_decorator(\n stub: nodes.Decorator, runtime: MaybeMissing[Any], object_path: List[str]\n) -> Iterator[Error]:\n if isinstance(runtime, Missing):\n yield Error(object_path, \"is not present at runtime\", stub, runtime)\n return\n if stub.func.is_property:\n for message in _verify_property(stub, runtime):\n yield Error(object_path, message, stub, runtime)\n return\n\n func = _resolve_funcitem_from_decorator(stub)\n if func is not None:\n yield from verify(func, runtime, object_path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_verify_typealias_is_dunder.return.name_startswith____and": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_verify_typealias_is_dunder.return.name_startswith____and", "embedding": null, "metadata": {"file_path": "mypy/stubtest.py", "file_name": "stubtest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 850, "end_line": 869, "span_ids": ["impl:11", "verify_typealias", "is_dunder"], "tokens": 152}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@verify.register(nodes.TypeAlias)\ndef verify_typealias(\n stub: nodes.TypeAlias, runtime: MaybeMissing[Any], object_path: List[str]\n) -> Iterator[Error]:\n if False:\n yield None\n\n\nSPECIAL_DUNDERS = (\"__init__\", \"__new__\", \"__call__\", \"__init_subclass__\", \"__class_getitem__\")\n\n\ndef is_dunder(name: str, exclude_special: bool = False) -> bool:\n \"\"\"Returns whether name is a dunder name.\n\n :param exclude_special: Whether to return False for a couple special dunder methods.\n\n \"\"\"\n if exclude_special and name in SPECIAL_DUNDERS:\n return False\n return name.startswith(\"__\") and name.endswith(\"__\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_is_subtype_helper_is_subtype_helper.with_mypy_state_strict_op.return.mypy_subtypes_is_subtype_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_is_subtype_helper_is_subtype_helper.with_mypy_state_strict_op.return.mypy_subtypes_is_subtype_", "embedding": null, "metadata": {"file_path": "mypy/stubtest.py", "file_name": "stubtest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 860, "end_line": 874, "span_ids": ["is_subtype_helper"], "tokens": 166}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_subtype_helper(left: mypy.types.Type, right: mypy.types.Type) -> bool:\n \"\"\"Checks whether ``left`` is a subtype of ``right``.\"\"\"\n left = mypy.types.get_proper_type(left)\n right = mypy.types.get_proper_type(right)\n if (\n isinstance(left, mypy.types.LiteralType)\n and isinstance(left.value, int)\n and left.value in (0, 1)\n and isinstance(right, mypy.types.Instance)\n and right.type.fullname == \"builtins.bool\"\n ):\n # Pretend Literal[0, 1] is a subtype of bool to avoid unhelpful errors.\n return True\n with mypy.state.strict_optional_set(True):\n return mypy.subtypes.is_subtype(left, right)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_get_stub_get_allowlist_entries.with_open_allowlist_file_.for_line_in_f_readlines_.if_entry_.yield_entry": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_get_stub_get_allowlist_entries.with_open_allowlist_file_.for_line_in_f_readlines_.if_entry_.yield_entry", "embedding": null, "metadata": {"file_path": "mypy/stubtest.py", "file_name": "stubtest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1063, "end_line": 1109, "span_ids": ["get_allowlist_entries", "get_stub", "get_typeshed_stdlib_modules"], "tokens": 409}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_stub(module: str) -> Optional[nodes.MypyFile]:\n \"\"\"Returns a stub object for the given module, if we've built one.\"\"\"\n return _all_stubs.get(module)\n\n\ndef get_typeshed_stdlib_modules(custom_typeshed_dir: Optional[str]) -> List[str]:\n \"\"\"Returns a list of stdlib modules in typeshed (for current Python version).\"\"\"\n stdlib_py_versions = mypy.modulefinder.load_stdlib_py_versions(custom_typeshed_dir)\n packages = set()\n # Typeshed doesn't cover Python 3.5.\n if sys.version_info < (3, 6):\n version_info = (3, 6)\n else:\n version_info = sys.version_info[0:2]\n for module, versions in stdlib_py_versions.items():\n minver, maxver = versions\n if version_info >= minver and (maxver is None or version_info <= maxver):\n packages.add(module)\n\n if custom_typeshed_dir:\n typeshed_dir = Path(custom_typeshed_dir)\n else:\n typeshed_dir = Path(mypy.build.default_data_dir()) / \"typeshed\"\n stdlib_dir = typeshed_dir / \"stdlib\"\n\n modules = []\n for path in stdlib_dir.rglob(\"*.pyi\"):\n if path.stem == \"__init__\":\n path = path.parent\n module = \".\".join(path.relative_to(stdlib_dir).parts[:-1] + (path.stem,))\n if module.split(\".\")[0] in packages:\n modules.append(module)\n return sorted(modules)\n\n\ndef get_allowlist_entries(allowlist_file: str) -> Iterator[str]:\n def strip_comments(s: str) -> str:\n try:\n return s[: s.index(\"#\")].strip()\n except ValueError:\n return s.strip()\n\n with open(allowlist_file) as f:\n for line in f.readlines():\n entry = strip_comments(line)\n if entry:\n yield entry", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_test_stubs_test_stubs.return.exit_code": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_test_stubs_test_stubs.return.exit_code", "embedding": null, "metadata": {"file_path": "mypy/stubtest.py", "file_name": "stubtest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1025, "end_line": 1106, "span_ids": ["test_stubs"], "tokens": 706}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_stubs(args: argparse.Namespace, use_builtins_fixtures: bool = False) -> int:\n \"\"\"This is stubtest! It's time to test the stubs!\"\"\"\n # Load the allowlist. This is a series of strings corresponding to Error.object_desc\n # Values in the dict will store whether we used the allowlist entry or not.\n allowlist = {\n entry: False\n for allowlist_file in args.allowlist\n for entry in get_allowlist_entries(allowlist_file)\n }\n allowlist_regexes = {entry: re.compile(entry) for entry in allowlist}\n\n # If we need to generate an allowlist, we store Error.object_desc for each error here.\n generated_allowlist = set()\n\n modules = args.modules\n if args.check_typeshed:\n assert not args.modules, \"Cannot pass both --check-typeshed and a list of modules\"\n modules = get_typeshed_stdlib_modules(args.custom_typeshed_dir)\n annoying_modules = {\"antigravity\", \"this\"}\n modules = [m for m in modules if m not in annoying_modules]\n\n assert modules, \"No modules to check\"\n\n options = Options()\n options.incremental = False\n options.custom_typeshed_dir = args.custom_typeshed_dir\n options.config_file = args.mypy_config_file\n options.use_builtins_fixtures = use_builtins_fixtures\n\n if options.config_file:\n def set_strict_flags() -> None: # not needed yet\n return\n parse_config_file(options, set_strict_flags, options.config_file, sys.stdout, sys.stderr)\n\n try:\n modules = build_stubs(modules, options, find_submodules=not args.check_typeshed)\n except RuntimeError:\n return 1\n\n exit_code = 0\n for module in modules:\n for error in test_module(module):\n # Filter errors\n if args.ignore_missing_stub and error.is_missing_stub():\n continue\n if args.ignore_positional_only and error.is_positional_only_related():\n continue\n if error.object_desc in allowlist:\n allowlist[error.object_desc] = True\n continue\n is_allowlisted = False\n for w in allowlist:\n if allowlist_regexes[w].fullmatch(error.object_desc):\n allowlist[w] = True\n is_allowlisted = True\n break\n if is_allowlisted:\n continue\n\n # We have errors, so change exit code, and output whatever necessary\n exit_code = 1\n if args.generate_allowlist:\n generated_allowlist.add(error.object_desc)\n continue\n print(error.get_description(concise=args.concise))\n\n # Print unused allowlist entries\n if not args.ignore_unused_allowlist:\n for w in allowlist:\n # Don't consider an entry unused if it regex-matches the empty string\n # This lets us allowlist errors that don't manifest at all on some systems\n if not allowlist[w] and not allowlist_regexes[w].fullmatch(\"\"):\n exit_code = 1\n print(\"note: unused allowlist entry {}\".format(w))\n\n # Print the generated allowlist\n if args.generate_allowlist:\n for e in sorted(generated_allowlist):\n print(e)\n exit_code = 0\n\n return exit_code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_parse_options_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_parse_options_", "embedding": null, "metadata": {"file_path": "mypy/stubtest.py", "file_name": "stubtest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1121, "end_line": 1190, "span_ids": ["parse_options", "impl:15", "main"], "tokens": 501}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def parse_options(args: List[str]) -> argparse.Namespace:\n parser = argparse.ArgumentParser(\n description=\"Compares stubs to objects introspected from the runtime.\"\n )\n parser.add_argument(\"modules\", nargs=\"*\", help=\"Modules to test\")\n parser.add_argument(\"--concise\", action=\"store_true\", help=\"Make output concise\")\n parser.add_argument(\n \"--ignore-missing-stub\",\n action=\"store_true\",\n help=\"Ignore errors for stub missing things that are present at runtime\",\n )\n parser.add_argument(\n \"--ignore-positional-only\",\n action=\"store_true\",\n help=\"Ignore errors for whether an argument should or shouldn't be positional-only\",\n )\n parser.add_argument(\n \"--custom-typeshed-dir\", metavar=\"DIR\", help=\"Use the custom typeshed in DIR\"\n )\n parser.add_argument(\n \"--check-typeshed\", action=\"store_true\", help=\"Check all stdlib modules in typeshed\"\n )\n parser.add_argument(\n \"--allowlist\",\n \"--whitelist\",\n action=\"append\",\n metavar=\"FILE\",\n default=[],\n help=(\n \"Use file as an allowlist. Can be passed multiple times to combine multiple \"\n \"allowlists. Allowlists can be created with --generate-allowlist\"\n ),\n )\n parser.add_argument(\n \"--generate-allowlist\",\n \"--generate-whitelist\",\n action=\"store_true\",\n help=\"Print an allowlist (to stdout) to be used with --allowlist\",\n )\n parser.add_argument(\n \"--ignore-unused-allowlist\",\n \"--ignore-unused-whitelist\",\n action=\"store_true\",\n help=\"Ignore unused allowlist entries\",\n )\n config_group = parser.add_argument_group(\n title='mypy config file',\n description=\"Use a config file instead of command line arguments. \"\n \"Plugins and mypy path are the only supported \"\n \"configurations.\",\n )\n config_group.add_argument(\n '--mypy-config-file',\n help=(\n \"An existing mypy configuration file, currently used by stubtest to help \"\n \"determine mypy path and plugins\"\n ),\n )\n\n return parser.parse_args(args)\n\n\ndef main() -> int:\n mypy.util.check_python_version(\"stubtest\")\n return test_stubs(parse_options(sys.argv[1:]))\n\n\nif __name__ == \"__main__\":\n sys.exit(main())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubutil.py__Utilities_for_mypy_stu_CantImport.__init__.self.message.message": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubutil.py__Utilities_for_mypy_stu_CantImport.__init__.self.message.message", "embedding": null, "metadata": {"file_path": "mypy/stubutil.py", "file_name": "stubutil.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 24, "span_ids": ["CantImport", "CantImport.__init__", "docstring"], "tokens": 142}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Utilities for mypy.stubgen, mypy.stubgenc, and mypy.stubdoc modules.\"\"\"\n\nimport sys\nimport os.path\nimport json\nimport subprocess\nimport re\nfrom contextlib import contextmanager\n\nfrom typing import Optional, Tuple, List, Iterator, Union\nfrom typing_extensions import overload\n\nfrom mypy.moduleinspect import ModuleInspect, InspectError\nfrom mypy.modulefinder import ModuleNotFoundReason\n\n\n# Modules that may fail when imported, or that may have side effects (fully qualified).\nNOT_IMPORTABLE_MODULES = ()\n\n\nclass CantImport(Exception):\n def __init__(self, module: str, message: str):\n self.module = module\n self.message = message", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubutil.py_default_py2_interpreter_default_py2_interpreter.raise_SystemExit_Can_t_f": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubutil.py_default_py2_interpreter_default_py2_interpreter.raise_SystemExit_Can_t_f", "embedding": null, "metadata": {"file_path": "mypy/stubutil.py", "file_name": "stubutil.py", "file_type": "text/x-python", "category": "implementation", "start_line": 27, "end_line": 41, "span_ids": ["default_py2_interpreter"], "tokens": 132}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def default_py2_interpreter() -> str:\n \"\"\"Find a system Python 2 interpreter.\n\n Return full path or exit if failed.\n \"\"\"\n # TODO: Make this do something reasonable in Windows.\n for candidate in ('/usr/bin/python2', '/usr/bin/python'):\n if not os.path.exists(candidate):\n continue\n output = subprocess.check_output([candidate, '--version'],\n stderr=subprocess.STDOUT).strip()\n if b'Python 2' in output:\n return candidate\n raise SystemExit(\"Can't find a Python 2 interpreter -- \"\n \"please use the --python-executable option\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubutil.py_walk_packages_walk_packages.for_package_name_in_packa.if_prop_is_c_module_.else_.for_submodule_in_prop_sub.yield_submodule": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubutil.py_walk_packages_walk_packages.for_package_name_in_packa.if_prop_is_c_module_.else_.for_submodule_in_prop_sub.yield_submodule", "embedding": null, "metadata": {"file_path": "mypy/stubutil.py", "file_name": "stubutil.py", "file_type": "text/x-python", "category": "implementation", "start_line": 44, "end_line": 73, "span_ids": ["walk_packages"], "tokens": 274}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def walk_packages(inspect: ModuleInspect,\n packages: List[str],\n verbose: bool = False) -> Iterator[str]:\n \"\"\"Iterates through all packages and sub-packages in the given list.\n\n This uses runtime imports (in another process) to find both Python and C modules.\n For Python packages we simply pass the __path__ attribute to pkgutil.walk_packages() to\n get the content of the package (all subpackages and modules). However, packages in C\n extensions do not have this attribute, so we have to roll out our own logic: recursively\n find all modules imported in the package that have matching names.\n \"\"\"\n for package_name in packages:\n if package_name in NOT_IMPORTABLE_MODULES:\n print('%s: Skipped (blacklisted)' % package_name)\n continue\n if verbose:\n print('Trying to import %r for runtime introspection' % package_name)\n try:\n prop = inspect.get_package_properties(package_name)\n except InspectError:\n report_missing(package_name)\n continue\n yield prop.name\n if prop.is_c_module:\n # Recursively iterate through the subpackages\n for submodule in walk_packages(inspect, prop.subpackages, verbose):\n yield submodule\n else:\n for submodule in prop.subpackages:\n yield submodule", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubutil.py_find_module_path_and_all_py2_find_module_path_and_all_py2.return.module_path_module_all": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubutil.py_find_module_path_and_all_py2_find_module_path_and_all_py2.return.module_path_module_all", "embedding": null, "metadata": {"file_path": "mypy/stubutil.py", "file_name": "stubutil.py", "file_type": "text/x-python", "category": "implementation", "start_line": 76, "end_line": 104, "span_ids": ["find_module_path_and_all_py2"], "tokens": 341}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def find_module_path_and_all_py2(module: str,\n interpreter: str) -> Optional[Tuple[Optional[str],\n Optional[List[str]]]]:\n \"\"\"Return tuple (module path, module __all__) for a Python 2 module.\n\n The path refers to the .py/.py[co] file. The second tuple item is\n None if the module doesn't define __all__.\n\n Raise CantImport if the module can't be imported, or exit if it's a C extension module.\n \"\"\"\n cmd_template = '{interpreter} -c \"%s\"'.format(interpreter=interpreter)\n code = (\"import importlib, json; mod = importlib.import_module('%s'); \"\n \"print(mod.__file__); print(json.dumps(getattr(mod, '__all__', None)))\") % module\n try:\n output_bytes = subprocess.check_output(cmd_template % code, shell=True)\n except subprocess.CalledProcessError as e:\n path = find_module_path_using_py2_sys_path(module, interpreter)\n if path is None:\n raise CantImport(module, str(e)) from e\n return path, None\n output = output_bytes.decode('ascii').strip().splitlines()\n module_path = output[0]\n if not module_path.endswith(('.py', '.pyc', '.pyo')):\n raise SystemExit('%s looks like a C module; they are not supported for Python 2' %\n module)\n if module_path.endswith(('.pyc', '.pyo')):\n module_path = module_path[:-1]\n module_all = json.loads(output[1])\n return module_path, module_all", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubutil.py_find_module_path_using_py2_sys_path_find_module_path_using_sys_path.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubutil.py_find_module_path_using_py2_sys_path_find_module_path_using_sys_path.return.None", "embedding": null, "metadata": {"file_path": "mypy/stubutil.py", "file_name": "stubutil.py", "file_type": "text/x-python", "category": "implementation", "start_line": 107, "end_line": 132, "span_ids": ["find_module_path_using_py2_sys_path", "find_module_path_using_sys_path"], "tokens": 212}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def find_module_path_using_py2_sys_path(module: str,\n interpreter: str) -> Optional[str]:\n \"\"\"Try to find the path of a .py file for a module using Python 2 sys.path.\n\n Return None if no match was found.\n \"\"\"\n out = subprocess.run(\n [interpreter, '-c', 'import sys; import json; print(json.dumps(sys.path))'],\n check=True,\n stdout=subprocess.PIPE\n ).stdout\n sys_path = json.loads(out.decode('utf-8'))\n return find_module_path_using_sys_path(module, sys_path)\n\n\ndef find_module_path_using_sys_path(module: str, sys_path: List[str]) -> Optional[str]:\n relative_candidates = (\n module.replace('.', '/') + '.py',\n os.path.join(module.replace('.', '/'), '__init__.py')\n )\n for base in sys_path:\n for relative_path in relative_candidates:\n path = os.path.join(base, relative_path)\n if os.path.isfile(path):\n return path\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubutil.py_find_module_path_and_all_py3_find_module_path_and_all_py3.return.mod_file_mod_all": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubutil.py_find_module_path_and_all_py3_find_module_path_and_all_py3.return.mod_file_mod_all", "embedding": null, "metadata": {"file_path": "mypy/stubutil.py", "file_name": "stubutil.py", "file_type": "text/x-python", "category": "implementation", "start_line": 135, "end_line": 160, "span_ids": ["find_module_path_and_all_py3"], "tokens": 224}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def find_module_path_and_all_py3(inspect: ModuleInspect,\n module: str,\n verbose: bool) -> Optional[Tuple[Optional[str],\n Optional[List[str]]]]:\n \"\"\"Find module and determine __all__ for a Python 3 module.\n\n Return None if the module is a C module. Return (module_path, __all__) if\n it is a Python module. Raise CantImport if import failed.\n \"\"\"\n if module in NOT_IMPORTABLE_MODULES:\n raise CantImport(module, '')\n\n # TODO: Support custom interpreters.\n if verbose:\n print('Trying to import %r for runtime introspection' % module)\n try:\n mod = inspect.get_package_properties(module)\n except InspectError as e:\n # Fall back to finding the module using sys.path.\n path = find_module_path_using_sys_path(module, sys.path)\n if path is None:\n raise CantImport(module, str(e)) from e\n return path, None\n if mod.is_c_module:\n return None\n return mod.file, mod.all", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubutil.py_generate_guarded_generate_guarded.try_.else_.if_verbose_.print_Created_s_targ": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubutil.py_generate_guarded_generate_guarded.try_.else_.if_verbose_.print_Created_s_targ", "embedding": null, "metadata": {"file_path": "mypy/stubutil.py", "file_name": "stubutil.py", "file_type": "text/x-python", "category": "implementation", "start_line": 163, "end_line": 182, "span_ids": ["generate_guarded"], "tokens": 130}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@contextmanager\ndef generate_guarded(mod: str, target: str,\n ignore_errors: bool = True, verbose: bool = False) -> Iterator[None]:\n \"\"\"Ignore or report errors during stub generation.\n\n Optionally report success.\n \"\"\"\n if verbose:\n print('Processing %s' % mod)\n try:\n yield\n except Exception as e:\n if not ignore_errors:\n raise e\n else:\n # --ignore-errors was passed\n print(\"Stub generation failed for\", mod, file=sys.stderr)\n else:\n if verbose:\n print('Created %s' % target)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubutil.py_PY2_MODULES_remove_misplaced_type_comments_10._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubutil.py_PY2_MODULES_remove_misplaced_type_comments_10._", "embedding": null, "metadata": {"file_path": "mypy/stubutil.py", "file_name": "stubutil.py", "file_type": "text/x-python", "category": "implementation", "start_line": 185, "end_line": 214, "span_ids": ["impl:3", "remove_misplaced_type_comments_10", "fail_missing", "remove_misplaced_type_comments", "report_missing"], "tokens": 266}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "PY2_MODULES = {'cStringIO', 'urlparse', 'collections.UserDict'}\n\n\ndef report_missing(mod: str, message: Optional[str] = '', traceback: str = '') -> None:\n if message:\n message = ' with error: ' + message\n print('{}: Failed to import, skipping{}'.format(mod, message))\n m = re.search(r\"ModuleNotFoundError: No module named '([^']*)'\", traceback)\n if m:\n missing_module = m.group(1)\n if missing_module in PY2_MODULES:\n print('note: Try --py2 for Python 2 mode')\n\n\ndef fail_missing(mod: str, reason: ModuleNotFoundReason) -> None:\n if reason is ModuleNotFoundReason.NOT_FOUND:\n clarification = \"(consider using --search-path)\"\n elif reason is ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS:\n clarification = \"(module likely exists, but is not PEP 561 compatible)\"\n else:\n clarification = \"(unknown reason '{}')\".format(reason)\n raise SystemExit(\"Can't find module '{}' {}\".format(mod, clarification))\n\n\n@overload\ndef remove_misplaced_type_comments(source: bytes) -> bytes: ...\n\n\n@overload\ndef remove_misplaced_type_comments(source: str) -> str: ...", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubutil.py_remove_misplaced_type_comments_11_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubutil.py_remove_misplaced_type_comments_11_", "embedding": null, "metadata": {"file_path": "mypy/stubutil.py", "file_name": "stubutil.py", "file_type": "text/x-python", "category": "implementation", "start_line": 217, "end_line": 258, "span_ids": ["common_dir_prefix", "remove_misplaced_type_comments_11"], "tokens": 434}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def remove_misplaced_type_comments(source: Union[str, bytes]) -> Union[str, bytes]:\n \"\"\"Remove comments from source that could be understood as misplaced type comments.\n\n Normal comments may look like misplaced type comments, and since they cause blocking\n parse errors, we want to avoid them.\n \"\"\"\n if isinstance(source, bytes):\n # This gives us a 1-1 character code mapping, so it's roundtrippable.\n text = source.decode('latin1')\n else:\n text = source\n\n # Remove something that looks like a variable type comment but that's by itself\n # on a line, as it will often generate a parse error (unless it's # type: ignore).\n text = re.sub(r'^[ \\t]*# +type: +[\"\\'a-zA-Z_].*$', '', text, flags=re.MULTILINE)\n\n # Remove something that looks like a function type comment after docstring,\n # which will result in a parse error.\n text = re.sub(r'\"\"\" *\\n[ \\t\\n]*# +type: +\\(.*$', '\"\"\"\\n', text, flags=re.MULTILINE)\n text = re.sub(r\"''' *\\n[ \\t\\n]*# +type: +\\(.*$\", \"'''\\n\", text, flags=re.MULTILINE)\n\n # Remove something that looks like a badly formed function type comment.\n text = re.sub(r'^[ \\t]*# +type: +\\([^()]+(\\)[ \\t]*)?$', '', text, flags=re.MULTILINE)\n\n if isinstance(source, bytes):\n return text.encode('latin1')\n else:\n return text\n\n\ndef common_dir_prefix(paths: List[str]) -> str:\n if not paths:\n return '.'\n cur = os.path.dirname(os.path.normpath(paths[0]))\n for path in paths[1:]:\n while True:\n path = os.path.dirname(os.path.normpath(path))\n if (cur + os.sep).startswith(path + os.sep):\n cur = path\n break\n return cur or '.'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_from_contextlib_import_co_ignore_type_parameter.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_from_contextlib_import_co_ignore_type_parameter.return.True", "embedding": null, "metadata": {"file_path": "mypy/subtypes.py", "file_name": "subtypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 46, "span_ids": ["imports", "check_type_parameter", "ignore_type_parameter"], "tokens": 417}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from contextlib import contextmanager\n\nfrom typing import Any, List, Optional, Callable, Tuple, Iterator, Set, Union, cast, TypeVar\nfrom typing_extensions import Final\n\nfrom mypy.types import (\n Type, AnyType, UnboundType, TypeVisitor, FormalArgument, NoneType,\n Instance, TypeVarType, CallableType, TupleType, TypedDictType, UnionType, Overloaded,\n ErasedType, PartialType, DeletedType, UninhabitedType, TypeType, is_named_instance,\n FunctionLike, TypeOfAny, LiteralType, get_proper_type, TypeAliasType\n)\nimport mypy.applytype\nimport mypy.constraints\nimport mypy.typeops\nimport mypy.sametypes\nfrom mypy.erasetype import erase_type\n# Circular import; done in the function instead.\n# import mypy.solve\nfrom mypy.nodes import (\n FuncBase, Var, Decorator, OverloadedFuncDef, TypeInfo, CONTRAVARIANT, COVARIANT,\n ARG_POS, ARG_OPT, ARG_STAR, ARG_STAR2\n)\nfrom mypy.maptype import map_instance_to_supertype\nfrom mypy.expandtype import expand_type_by_instance\nfrom mypy.typestate import TypeState, SubtypeKind\nfrom mypy import state\n\n# Flags for detected protocol members\nIS_SETTABLE = 1 # type: Final\nIS_CLASSVAR = 2 # type: Final\nIS_CLASS_OR_STATIC = 3 # type: Final\n\nTypeParameterChecker = Callable[[Type, Type, int], bool]\n\n\ndef check_type_parameter(lefta: Type, righta: Type, variance: int) -> bool:\n if variance == COVARIANT:\n return is_subtype(lefta, righta)\n elif variance == CONTRAVARIANT:\n return is_subtype(righta, lefta)\n else:\n return is_equivalent(lefta, righta)\n\n\ndef ignore_type_parameter(s: Type, t: Type, v: int) -> bool:\n return True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_is_subtype_is_subtype.return._is_subtype_left_right_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_is_subtype_is_subtype.return._is_subtype_left_right_", "embedding": null, "metadata": {"file_path": "mypy/subtypes.py", "file_name": "subtypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 49, "end_line": 97, "span_ids": ["is_subtype"], "tokens": 590}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_subtype(left: Type, right: Type,\n *,\n ignore_type_params: bool = False,\n ignore_pos_arg_names: bool = False,\n ignore_declared_variance: bool = False,\n ignore_promotions: bool = False) -> bool:\n \"\"\"Is 'left' subtype of 'right'?\n\n Also consider Any to be a subtype of any type, and vice versa. This\n recursively applies to components of composite types (List[int] is subtype\n of List[Any], for example).\n\n type_parameter_checker is used to check the type parameters (for example,\n A with B in is_subtype(C[A], C[B]). The default checks for subtype relation\n between the type arguments (e.g., A and B), taking the variance of the\n type var into account.\n \"\"\"\n if TypeState.is_assumed_subtype(left, right):\n return True\n if (isinstance(left, TypeAliasType) and isinstance(right, TypeAliasType) and\n left.is_recursive and right.is_recursive):\n # This case requires special care because it may cause infinite recursion.\n # Our view on recursive types is known under a fancy name of equirecursive mu-types.\n # Roughly this means that a recursive type is defined as an alias where right hand side\n # can refer to the type as a whole, for example:\n # A = Union[int, Tuple[A, ...]]\n # and an alias unrolled once represents the *same type*, in our case all these represent\n # the same type:\n # A\n # Union[int, Tuple[A, ...]]\n # Union[int, Tuple[Union[int, Tuple[A, ...]], ...]]\n # The algorithm for subtyping is then essentially under the assumption that left <: right,\n # check that get_proper_type(left) <: get_proper_type(right). On the example above,\n # If we start with:\n # A = Union[int, Tuple[A, ...]]\n # B = Union[int, Tuple[B, ...]]\n # When checking if A <: B we push pair (A, B) onto 'assuming' stack, then when after few\n # steps we come back to initial call is_subtype(A, B) and immediately return True.\n with pop_on_exit(TypeState._assuming, left, right):\n return _is_subtype(left, right,\n ignore_type_params=ignore_type_params,\n ignore_pos_arg_names=ignore_pos_arg_names,\n ignore_declared_variance=ignore_declared_variance,\n ignore_promotions=ignore_promotions)\n return _is_subtype(left, right,\n ignore_type_params=ignore_type_params,\n ignore_pos_arg_names=ignore_pos_arg_names,\n ignore_declared_variance=ignore_declared_variance,\n ignore_promotions=ignore_promotions)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py__is_subtype__is_subtype.return.left_accept_SubtypeVisito": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py__is_subtype__is_subtype.return.left_accept_SubtypeVisito", "embedding": null, "metadata": {"file_path": "mypy/subtypes.py", "file_name": "subtypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 100, "end_line": 151, "span_ids": ["_is_subtype"], "tokens": 579}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _is_subtype(left: Type, right: Type,\n *,\n ignore_type_params: bool = False,\n ignore_pos_arg_names: bool = False,\n ignore_declared_variance: bool = False,\n ignore_promotions: bool = False) -> bool:\n orig_right = right\n orig_left = left\n left = get_proper_type(left)\n right = get_proper_type(right)\n\n if (isinstance(right, AnyType) or isinstance(right, UnboundType)\n or isinstance(right, ErasedType)):\n return True\n elif isinstance(right, UnionType) and not isinstance(left, UnionType):\n # Normally, when 'left' is not itself a union, the only way\n # 'left' can be a subtype of the union 'right' is if it is a\n # subtype of one of the items making up the union.\n is_subtype_of_item = any(is_subtype(orig_left, item,\n ignore_type_params=ignore_type_params,\n ignore_pos_arg_names=ignore_pos_arg_names,\n ignore_declared_variance=ignore_declared_variance,\n ignore_promotions=ignore_promotions)\n for item in right.items)\n # Recombine rhs literal types, to make an enum type a subtype\n # of a union of all enum items as literal types. Only do it if\n # the previous check didn't succeed, since recombining can be\n # expensive.\n if not is_subtype_of_item and isinstance(left, Instance) and left.type.is_enum:\n right = UnionType(mypy.typeops.try_contracting_literals_in_union(right.items))\n is_subtype_of_item = any(is_subtype(orig_left, item,\n ignore_type_params=ignore_type_params,\n ignore_pos_arg_names=ignore_pos_arg_names,\n ignore_declared_variance=ignore_declared_variance,\n ignore_promotions=ignore_promotions)\n for item in right.items)\n # However, if 'left' is a type variable T, T might also have\n # an upper bound which is itself a union. This case will be\n # handled below by the SubtypeVisitor. We have to check both\n # possibilities, to handle both cases like T <: Union[T, U]\n # and cases like T <: B where B is the upper bound of T and is\n # a union. (See #2314.)\n if not isinstance(left, TypeVarType):\n return is_subtype_of_item\n elif is_subtype_of_item:\n return True\n # otherwise, fall through\n return left.accept(SubtypeVisitor(orig_right,\n ignore_type_params=ignore_type_params,\n ignore_pos_arg_names=ignore_pos_arg_names,\n ignore_declared_variance=ignore_declared_variance,\n ignore_promotions=ignore_promotions))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_is_subtype_ignoring_tvars_is_equivalent.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_is_subtype_ignoring_tvars_is_equivalent.return._", "embedding": null, "metadata": {"file_path": "mypy/subtypes.py", "file_name": "subtypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 142, "end_line": 155, "span_ids": ["is_equivalent", "is_subtype_ignoring_tvars"], "tokens": 126}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_subtype_ignoring_tvars(left: Type, right: Type) -> bool:\n return is_subtype(left, right, ignore_type_params=True)\n\n\ndef is_equivalent(a: Type, b: Type,\n *,\n ignore_type_params: bool = False,\n ignore_pos_arg_names: bool = False\n ) -> bool:\n return (\n is_subtype(a, b, ignore_type_params=ignore_type_params,\n ignore_pos_arg_names=ignore_pos_arg_names)\n and is_subtype(b, a, ignore_type_params=ignore_type_params,\n ignore_pos_arg_names=ignore_pos_arg_names))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_SubtypeVisitor_SubtypeVisitor.visit_any.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_SubtypeVisitor_SubtypeVisitor.visit_any.return.True", "embedding": null, "metadata": {"file_path": "mypy/subtypes.py", "file_name": "subtypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 158, "end_line": 206, "span_ids": ["SubtypeVisitor._is_subtype", "SubtypeVisitor.visit_any", "SubtypeVisitor", "SubtypeVisitor.build_subtype_kind", "SubtypeVisitor.__init__", "SubtypeVisitor.visit_unbound_type"], "tokens": 414}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SubtypeVisitor(TypeVisitor[bool]):\n\n def __init__(self, right: Type,\n *,\n ignore_type_params: bool,\n ignore_pos_arg_names: bool = False,\n ignore_declared_variance: bool = False,\n ignore_promotions: bool = False) -> None:\n self.right = get_proper_type(right)\n self.orig_right = right\n self.ignore_type_params = ignore_type_params\n self.ignore_pos_arg_names = ignore_pos_arg_names\n self.ignore_declared_variance = ignore_declared_variance\n self.ignore_promotions = ignore_promotions\n self.check_type_parameter = (ignore_type_parameter if ignore_type_params else\n check_type_parameter)\n self._subtype_kind = SubtypeVisitor.build_subtype_kind(\n ignore_type_params=ignore_type_params,\n ignore_pos_arg_names=ignore_pos_arg_names,\n ignore_declared_variance=ignore_declared_variance,\n ignore_promotions=ignore_promotions)\n\n @staticmethod\n def build_subtype_kind(*,\n ignore_type_params: bool = False,\n ignore_pos_arg_names: bool = False,\n ignore_declared_variance: bool = False,\n ignore_promotions: bool = False) -> SubtypeKind:\n return (False, # is proper subtype?\n ignore_type_params,\n ignore_pos_arg_names,\n ignore_declared_variance,\n ignore_promotions)\n\n def _is_subtype(self, left: Type, right: Type) -> bool:\n return is_subtype(left, right,\n ignore_type_params=self.ignore_type_params,\n ignore_pos_arg_names=self.ignore_pos_arg_names,\n ignore_declared_variance=self.ignore_declared_variance,\n ignore_promotions=self.ignore_promotions)\n\n # visit_x(left) means: is left (which is an instance of X) a subtype of\n # right?\n\n def visit_unbound_type(self, left: UnboundType) -> bool:\n return True\n\n def visit_any(self, left: AnyType) -> bool:\n return True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_SubtypeVisitor.visit_none_type_SubtypeVisitor.visit_deleted_type.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_SubtypeVisitor.visit_none_type_SubtypeVisitor.visit_deleted_type.return.True", "embedding": null, "metadata": {"file_path": "mypy/subtypes.py", "file_name": "subtypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 208, "end_line": 229, "span_ids": ["SubtypeVisitor.visit_none_type", "SubtypeVisitor.visit_uninhabited_type", "SubtypeVisitor.visit_deleted_type", "SubtypeVisitor.visit_erased_type"], "tokens": 201}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SubtypeVisitor(TypeVisitor[bool]):\n\n def visit_none_type(self, left: NoneType) -> bool:\n if state.strict_optional:\n if isinstance(self.right, NoneType) or is_named_instance(self.right,\n 'builtins.object'):\n return True\n if isinstance(self.right, Instance) and self.right.type.is_protocol:\n members = self.right.type.protocol_members\n # None is compatible with Hashable (and other similar protocols). This is\n # slightly sloppy since we don't check the signature of \"__hash__\".\n return not members or members == [\"__hash__\"]\n return False\n else:\n return True\n\n def visit_uninhabited_type(self, left: UninhabitedType) -> bool:\n return True\n\n def visit_erased_type(self, left: ErasedType) -> bool:\n return True\n\n def visit_deleted_type(self, left: DeletedType) -> bool:\n return True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_SubtypeVisitor.visit_instance_SubtypeVisitor.visit_instance.if_isinstance_right_Call.else_.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_SubtypeVisitor.visit_instance_SubtypeVisitor.visit_instance.if_isinstance_right_Call.else_.return.False", "embedding": null, "metadata": {"file_path": "mypy/subtypes.py", "file_name": "subtypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 231, "end_line": 285, "span_ids": ["SubtypeVisitor.visit_instance"], "tokens": 590}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SubtypeVisitor(TypeVisitor[bool]):\n\n def visit_instance(self, left: Instance) -> bool:\n if left.type.fallback_to_any:\n if isinstance(self.right, NoneType):\n # NOTE: `None` is a *non-subclassable* singleton, therefore no class\n # can by a subtype of it, even with an `Any` fallback.\n # This special case is needed to treat descriptors in classes with\n # dynamic base classes correctly, see #5456.\n return False\n return True\n right = self.right\n if isinstance(right, TupleType) and mypy.typeops.tuple_fallback(right).type.is_enum:\n return self._is_subtype(left, mypy.typeops.tuple_fallback(right))\n if isinstance(right, Instance):\n if TypeState.is_cached_subtype_check(self._subtype_kind, left, right):\n return True\n if not self.ignore_promotions:\n for base in left.type.mro:\n if base._promote and self._is_subtype(base._promote, self.right):\n TypeState.record_subtype_cache_entry(self._subtype_kind, left, right)\n return True\n rname = right.type.fullname\n # Always try a nominal check if possible,\n # there might be errors that a user wants to silence *once*.\n if ((left.type.has_base(rname) or rname == 'builtins.object') and\n not self.ignore_declared_variance):\n # Map left type to corresponding right instances.\n t = map_instance_to_supertype(left, right.type)\n nominal = all(self.check_type_parameter(lefta, righta, tvar.variance)\n for lefta, righta, tvar in\n zip(t.args, right.args, right.type.defn.type_vars))\n if nominal:\n TypeState.record_subtype_cache_entry(self._subtype_kind, left, right)\n return nominal\n if right.type.is_protocol and is_protocol_implementation(left, right):\n return True\n return False\n if isinstance(right, TypeType):\n item = right.item\n if isinstance(item, TupleType):\n item = mypy.typeops.tuple_fallback(item)\n if is_named_instance(left, 'builtins.type'):\n return self._is_subtype(TypeType(AnyType(TypeOfAny.special_form)), right)\n if left.type.is_metaclass():\n if isinstance(item, AnyType):\n return True\n if isinstance(item, Instance):\n return is_named_instance(item, 'builtins.object')\n if isinstance(right, CallableType):\n # Special case: Instance can be a subtype of Callable.\n call = find_member('__call__', left, left, is_operator=True)\n if call:\n return self._is_subtype(call, right)\n return False\n else:\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_SubtypeVisitor.visit_type_var_SubtypeVisitor.visit_callable_type.if_isinstance_right_Call.else_.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_SubtypeVisitor.visit_type_var_SubtypeVisitor.visit_callable_type.if_isinstance_right_Call.else_.return.False", "embedding": null, "metadata": {"file_path": "mypy/subtypes.py", "file_name": "subtypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 287, "end_line": 318, "span_ids": ["SubtypeVisitor.visit_type_var", "SubtypeVisitor.visit_callable_type"], "tokens": 336}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SubtypeVisitor(TypeVisitor[bool]):\n\n def visit_type_var(self, left: TypeVarType) -> bool:\n right = self.right\n if isinstance(right, TypeVarType) and left.id == right.id:\n return True\n if left.values and self._is_subtype(\n mypy.typeops.make_simplified_union(left.values), right):\n return True\n return self._is_subtype(left.upper_bound, self.right)\n\n def visit_callable_type(self, left: CallableType) -> bool:\n right = self.right\n if isinstance(right, CallableType):\n return is_callable_compatible(\n left, right,\n is_compat=self._is_subtype,\n ignore_pos_arg_names=self.ignore_pos_arg_names)\n elif isinstance(right, Overloaded):\n return all(self._is_subtype(left, item) for item in right.items())\n elif isinstance(right, Instance):\n if right.type.is_protocol and right.type.protocol_members == ['__call__']:\n # OK, a callable can implement a protocol with a single `__call__` member.\n # TODO: we should probably explicitly exclude self-types in this case.\n call = find_member('__call__', right, left, is_operator=True)\n assert call is not None\n if self._is_subtype(left, call):\n return True\n return self._is_subtype(left.fallback, right)\n elif isinstance(right, TypeType):\n # This is unsound, we don't check the __init__ signature.\n return left.is_type_obj() and self._is_subtype(left.ret_type, right.item)\n else:\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_SubtypeVisitor.visit_tuple_type_SubtypeVisitor.visit_tuple_type.if_isinstance_right_Inst.else_.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_SubtypeVisitor.visit_tuple_type_SubtypeVisitor.visit_tuple_type.if_isinstance_right_Inst.else_.return.False", "embedding": null, "metadata": {"file_path": "mypy/subtypes.py", "file_name": "subtypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 320, "end_line": 356, "span_ids": ["SubtypeVisitor.visit_tuple_type"], "tokens": 387}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SubtypeVisitor(TypeVisitor[bool]):\n\n def visit_tuple_type(self, left: TupleType) -> bool:\n right = self.right\n if isinstance(right, Instance):\n if is_named_instance(right, 'typing.Sized'):\n return True\n elif (is_named_instance(right, 'builtins.tuple') or\n is_named_instance(right, 'typing.Iterable') or\n is_named_instance(right, 'typing.Container') or\n is_named_instance(right, 'typing.Sequence') or\n is_named_instance(right, 'typing.Reversible')):\n if right.args:\n iter_type = right.args[0]\n else:\n iter_type = AnyType(TypeOfAny.special_form)\n return all(self._is_subtype(li, iter_type) for li in left.items)\n elif self._is_subtype(mypy.typeops.tuple_fallback(left), right):\n return True\n return False\n elif isinstance(right, TupleType):\n if len(left.items) != len(right.items):\n return False\n for l, r in zip(left.items, right.items):\n if not self._is_subtype(l, r):\n return False\n rfallback = mypy.typeops.tuple_fallback(right)\n if is_named_instance(rfallback, 'builtins.tuple'):\n # No need to verify fallback. This is useful since the calculated fallback\n # may be inconsistent due to how we calculate joins between unions vs.\n # non-unions. For example, join(int, str) == object, whereas\n # join(Union[int, C], Union[str, C]) == Union[int, str, C].\n return True\n lfallback = mypy.typeops.tuple_fallback(left)\n if not self._is_subtype(lfallback, rfallback):\n return False\n return True\n else:\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_SubtypeVisitor.visit_typeddict_type_SubtypeVisitor.visit_literal_type.if_isinstance_self_right_.else_.return.self__is_subtype_left_fal": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_SubtypeVisitor.visit_typeddict_type_SubtypeVisitor.visit_literal_type.if_isinstance_self_right_.else_.return.self__is_subtype_left_fal", "embedding": null, "metadata": {"file_path": "mypy/subtypes.py", "file_name": "subtypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 358, "end_line": 389, "span_ids": ["SubtypeVisitor.visit_literal_type", "SubtypeVisitor.visit_typeddict_type"], "tokens": 314}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SubtypeVisitor(TypeVisitor[bool]):\n\n def visit_typeddict_type(self, left: TypedDictType) -> bool:\n right = self.right\n if isinstance(right, Instance):\n return self._is_subtype(left.fallback, right)\n elif isinstance(right, TypedDictType):\n if not left.names_are_wider_than(right):\n return False\n for name, l, r in left.zip(right):\n if not is_equivalent(l, r,\n ignore_type_params=self.ignore_type_params):\n return False\n # Non-required key is not compatible with a required key since\n # indexing may fail unexpectedly if a required key is missing.\n # Required key is not compatible with a non-required key since\n # the prior doesn't support 'del' but the latter should support\n # it.\n #\n # NOTE: 'del' support is currently not implemented (#3550). We\n # don't want to have to change subtyping after 'del' support\n # lands so here we are anticipating that change.\n if (name in left.required_keys) != (name in right.required_keys):\n return False\n # (NOTE: Fallbacks don't matter.)\n return True\n else:\n return False\n\n def visit_literal_type(self, left: LiteralType) -> bool:\n if isinstance(self.right, LiteralType):\n return left == self.right\n else:\n return self._is_subtype(left.fallback, self.right)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_SubtypeVisitor.visit_overloaded_SubtypeVisitor.visit_overloaded.if_isinstance_right_Inst.else_.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_SubtypeVisitor.visit_overloaded_SubtypeVisitor.visit_overloaded.if_isinstance_right_Inst.else_.return.False", "embedding": null, "metadata": {"file_path": "mypy/subtypes.py", "file_name": "subtypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 391, "end_line": 461, "span_ids": ["SubtypeVisitor.visit_overloaded"], "tokens": 642}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SubtypeVisitor(TypeVisitor[bool]):\n\n def visit_overloaded(self, left: Overloaded) -> bool:\n right = self.right\n if isinstance(right, Instance):\n if right.type.is_protocol and right.type.protocol_members == ['__call__']:\n # same as for CallableType\n call = find_member('__call__', right, left, is_operator=True)\n assert call is not None\n if self._is_subtype(left, call):\n return True\n return self._is_subtype(left.fallback, right)\n elif isinstance(right, CallableType):\n for item in left.items():\n if self._is_subtype(item, right):\n return True\n return False\n elif isinstance(right, Overloaded):\n if left == self.right:\n # When it is the same overload, then the types are equal.\n return True\n\n # Ensure each overload in the right side (the supertype) is accounted for.\n previous_match_left_index = -1\n matched_overloads = set()\n possible_invalid_overloads = set()\n\n for right_index, right_item in enumerate(right.items()):\n found_match = False\n\n for left_index, left_item in enumerate(left.items()):\n subtype_match = self._is_subtype(left_item, right_item)\n\n # Order matters: we need to make sure that the index of\n # this item is at least the index of the previous one.\n if subtype_match and previous_match_left_index <= left_index:\n if not found_match:\n # Update the index of the previous match.\n previous_match_left_index = left_index\n found_match = True\n matched_overloads.add(left_item)\n possible_invalid_overloads.discard(left_item)\n else:\n # If this one overlaps with the supertype in any way, but it wasn't\n # an exact match, then it's a potential error.\n if (is_callable_compatible(left_item, right_item,\n is_compat=self._is_subtype, ignore_return=True,\n ignore_pos_arg_names=self.ignore_pos_arg_names) or\n is_callable_compatible(right_item, left_item,\n is_compat=self._is_subtype, ignore_return=True,\n ignore_pos_arg_names=self.ignore_pos_arg_names)):\n # If this is an overload that's already been matched, there's no\n # problem.\n if left_item not in matched_overloads:\n possible_invalid_overloads.add(left_item)\n\n if not found_match:\n return False\n\n if possible_invalid_overloads:\n # There were potentially invalid overloads that were never matched to the\n # supertype.\n return False\n return True\n elif isinstance(right, UnboundType):\n return True\n elif isinstance(right, TypeType):\n # All the items must have the same type object status, so\n # it's sufficient to query only (any) one of them.\n # This is unsound, we don't check all the __init__ signatures.\n return left.is_type_obj() and self._is_subtype(left.items()[0], right)\n else:\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_SubtypeVisitor.visit_union_type_pop_on_exit.stack_pop_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_SubtypeVisitor.visit_union_type_pop_on_exit.stack_pop_", "embedding": null, "metadata": {"file_path": "mypy/subtypes.py", "file_name": "subtypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 463, "end_line": 500, "span_ids": ["SubtypeVisitor.visit_type_type", "pop_on_exit", "SubtypeVisitor.visit_type_alias_type", "impl:9", "SubtypeVisitor.visit_partial_type", "SubtypeVisitor.visit_union_type"], "tokens": 344}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SubtypeVisitor(TypeVisitor[bool]):\n\n def visit_union_type(self, left: UnionType) -> bool:\n return all(self._is_subtype(item, self.orig_right) for item in left.items)\n\n def visit_partial_type(self, left: PartialType) -> bool:\n # This is indeterminate as we don't really know the complete type yet.\n raise RuntimeError\n\n def visit_type_type(self, left: TypeType) -> bool:\n right = self.right\n if isinstance(right, TypeType):\n return self._is_subtype(left.item, right.item)\n if isinstance(right, CallableType):\n # This is unsound, we don't check the __init__ signature.\n return self._is_subtype(left.item, right.ret_type)\n if isinstance(right, Instance):\n if right.type.fullname in ['builtins.object', 'builtins.type']:\n return True\n item = left.item\n if isinstance(item, TypeVarType):\n item = get_proper_type(item.upper_bound)\n if isinstance(item, Instance):\n metaclass = item.type.metaclass_type\n return metaclass is not None and self._is_subtype(metaclass, right)\n return False\n\n def visit_type_alias_type(self, left: TypeAliasType) -> bool:\n assert False, \"This should be never called, got {}\".format(left)\n\n\nT = TypeVar('T', Instance, TypeAliasType)\n\n\n@contextmanager\ndef pop_on_exit(stack: List[Tuple[T, T]],\n left: T, right: T) -> Iterator[None]:\n stack.append((left, right))\n yield\n stack.pop()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_find_member_find_member.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_find_member_find_member.return.None", "embedding": null, "metadata": {"file_path": "mypy/subtypes.py", "file_name": "subtypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 593, "end_line": 638, "span_ids": ["find_member"], "tokens": 431}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def find_member(name: str,\n itype: Instance,\n subtype: Type,\n is_operator: bool = False) -> Optional[Type]:\n \"\"\"Find the type of member by 'name' in 'itype's TypeInfo.\n\n Find the member type after applying type arguments from 'itype', and binding\n 'self' to 'subtype'. Return None if member was not found.\n \"\"\"\n # TODO: this code shares some logic with checkmember.analyze_member_access,\n # consider refactoring.\n info = itype.type\n method = info.get_method(name)\n if method:\n if method.is_property:\n assert isinstance(method, OverloadedFuncDef)\n dec = method.items[0]\n assert isinstance(dec, Decorator)\n return find_node_type(dec.var, itype, subtype)\n return find_node_type(method, itype, subtype)\n else:\n # don't have such method, maybe variable or decorator?\n node = info.get(name)\n if not node:\n v = None\n else:\n v = node.node\n if isinstance(v, Decorator):\n v = v.var\n if isinstance(v, Var):\n return find_node_type(v, itype, subtype)\n if (not v and name not in ['__getattr__', '__setattr__', '__getattribute__'] and\n not is_operator):\n for method_name in ('__getattribute__', '__getattr__'):\n # Normally, mypy assumes that instances that define __getattr__ have all\n # attributes with the corresponding return type. If this will produce\n # many false negatives, then this could be prohibited for\n # structural subtyping.\n method = info.get_method(method_name)\n if method and method.info.fullname != 'builtins.object':\n getattr_type = get_proper_type(find_node_type(method, itype, subtype))\n if isinstance(getattr_type, CallableType):\n return getattr_type.ret_type\n if itype.type.fallback_to_any:\n return AnyType(TypeOfAny.special_form)\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_get_member_flags_get_member_flags.return.set_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_get_member_flags_get_member_flags.return.set_", "embedding": null, "metadata": {"file_path": "mypy/subtypes.py", "file_name": "subtypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 634, "end_line": 671, "span_ids": ["get_member_flags"], "tokens": 328}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_member_flags(name: str, info: TypeInfo) -> Set[int]:\n \"\"\"Detect whether a member 'name' is settable, whether it is an\n instance or class variable, and whether it is class or static method.\n\n The flags are defined as following:\n * IS_SETTABLE: whether this attribute can be set, not set for methods and\n non-settable properties;\n * IS_CLASSVAR: set if the variable is annotated as 'x: ClassVar[t]';\n * IS_CLASS_OR_STATIC: set for methods decorated with @classmethod or\n with @staticmethod.\n \"\"\"\n method = info.get_method(name)\n setattr_meth = info.get_method('__setattr__')\n if method:\n # this could be settable property\n if method.is_property:\n assert isinstance(method, OverloadedFuncDef)\n dec = method.items[0]\n assert isinstance(dec, Decorator)\n if dec.var.is_settable_property or setattr_meth:\n return {IS_SETTABLE}\n return set()\n node = info.get(name)\n if not node:\n if setattr_meth:\n return {IS_SETTABLE}\n return set()\n v = node.node\n if isinstance(v, Decorator):\n if v.var.is_staticmethod or v.var.is_classmethod:\n return {IS_CLASS_OR_STATIC}\n # just a variable\n if isinstance(v, Var) and not v.is_property:\n flags = {IS_SETTABLE}\n if v.is_classvar:\n flags.add(IS_CLASSVAR)\n return flags\n return set()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_find_node_type_find_node_type.return.typ": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_find_node_type_find_node_type.return.typ", "embedding": null, "metadata": {"file_path": "mypy/subtypes.py", "file_name": "subtypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 674, "end_line": 702, "span_ids": ["find_node_type"], "tokens": 286}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def find_node_type(node: Union[Var, FuncBase], itype: Instance, subtype: Type) -> Type:\n \"\"\"Find type of a variable or method 'node' (maybe also a decorated method).\n Apply type arguments from 'itype', and bind 'self' to 'subtype'.\n \"\"\"\n from mypy.typeops import bind_self\n\n if isinstance(node, FuncBase):\n typ = mypy.typeops.function_type(\n node, fallback=Instance(itype.type.mro[-1], [])) # type: Optional[Type]\n else:\n typ = node.type\n typ = get_proper_type(typ)\n if typ is None:\n return AnyType(TypeOfAny.from_error)\n # We don't need to bind 'self' for static methods, since there is no 'self'.\n if (isinstance(node, FuncBase)\n or (isinstance(typ, FunctionLike)\n and node.is_initialized_in_class\n and not node.is_staticmethod)):\n assert isinstance(typ, FunctionLike)\n signature = bind_self(typ, subtype)\n if node.is_property:\n assert isinstance(signature, CallableType)\n typ = signature.ret_type\n else:\n typ = signature\n itype = map_instance_to_supertype(itype, node.info)\n typ = expand_type_by_instance(typ, itype)\n return typ", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_non_method_protocol_members_non_method_protocol_members.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_non_method_protocol_members_non_method_protocol_members.return.result", "embedding": null, "metadata": {"file_path": "mypy/subtypes.py", "file_name": "subtypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 705, "end_line": 717, "span_ids": ["non_method_protocol_members"], "tokens": 112}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def non_method_protocol_members(tp: TypeInfo) -> List[str]:\n \"\"\"Find all non-callable members of a protocol.\"\"\"\n\n assert tp.is_protocol\n result = [] # type: List[str]\n anytype = AnyType(TypeOfAny.special_form)\n instance = Instance(tp, [anytype] * len(tp.defn.type_vars))\n\n for member in tp.protocol_members:\n typ = get_proper_type(find_member(member, instance, instance))\n if not isinstance(typ, CallableType):\n result.append(member)\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_is_callable_compatible_is_callable_compatible._Is_the_left_compatible": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_is_callable_compatible_is_callable_compatible._Is_the_left_compatible", "embedding": null, "metadata": {"file_path": "mypy/subtypes.py", "file_name": "subtypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 720, "end_line": 815, "span_ids": ["is_callable_compatible"], "tokens": 931}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_callable_compatible(left: CallableType, right: CallableType,\n *,\n is_compat: Callable[[Type, Type], bool],\n is_compat_return: Optional[Callable[[Type, Type], bool]] = None,\n ignore_return: bool = False,\n ignore_pos_arg_names: bool = False,\n check_args_covariantly: bool = False,\n allow_partial_overlap: bool = False) -> bool:\n \"\"\"Is the left compatible with the right, using the provided compatibility check?\n\n is_compat:\n The check we want to run against the parameters.\n\n is_compat_return:\n The check we want to run against the return type.\n If None, use the 'is_compat' check.\n\n check_args_covariantly:\n If true, check if the left's args is compatible with the right's\n instead of the other way around (contravariantly).\n\n This function is mostly used to check if the left is a subtype of the right which\n is why the default is to check the args contravariantly. However, it's occasionally\n useful to check the args using some other check, so we leave the variance\n configurable.\n\n For example, when checking the validity of overloads, it's useful to see if\n the first overload alternative has more precise arguments then the second.\n We would want to check the arguments covariantly in that case.\n\n Note! The following two function calls are NOT equivalent:\n\n is_callable_compatible(f, g, is_compat=is_subtype, check_args_covariantly=False)\n is_callable_compatible(g, f, is_compat=is_subtype, check_args_covariantly=True)\n\n The two calls are similar in that they both check the function arguments in\n the same direction: they both run `is_subtype(argument_from_g, argument_from_f)`.\n\n However, the two calls differ in which direction they check things like\n keyword arguments. For example, suppose f and g are defined like so:\n\n def f(x: int, *y: int) -> int: ...\n def g(x: int) -> int: ...\n\n In this case, the first call will succeed and the second will fail: f is a\n valid stand-in for g but not vice-versa.\n\n allow_partial_overlap:\n By default this function returns True if and only if *all* calls to left are\n also calls to right (with respect to the provided 'is_compat' function).\n\n If this parameter is set to 'True', we return True if *there exists at least one*\n call to left that's also a call to right.\n\n In other words, we perform an existential check instead of a universal one;\n we require left to only overlap with right instead of being a subset.\n\n For example, suppose we set 'is_compat' to some subtype check and compare following:\n\n f(x: float, y: str = \"...\", *args: bool) -> str\n g(*args: int) -> str\n\n This function would normally return 'False': f is not a subtype of g.\n However, we would return True if this parameter is set to 'True': the two\n calls are compatible if the user runs \"f_or_g(3)\". In the context of that\n specific call, the two functions effectively have signatures of:\n\n f2(float) -> str\n g2(int) -> str\n\n Here, f2 is a valid subtype of g2 so we return True.\n\n Specifically, if this parameter is set this function will:\n\n - Ignore optional arguments on either the left or right that have no\n corresponding match.\n - No longer mandate optional arguments on either side are also optional\n on the other.\n - No longer mandate that if right has a *arg or **kwarg that left must also\n have the same.\n\n Note: when this argument is set to True, this function becomes \"symmetric\" --\n the following calls are equivalent:\n\n is_callable_compatible(f, g,\n is_compat=some_check,\n check_args_covariantly=False,\n allow_partial_overlap=True)\n is_callable_compatible(g, f,\n is_compat=some_check,\n check_args_covariantly=True,\n allow_partial_overlap=True)\n\n If the 'some_check' function is also symmetric, the two calls would be equivalent\n whether or not we check the args covariantly.\n \"\"\"\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_is_callable_compatible.if_is_compat_return_is_No_is_callable_compatible._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_is_callable_compatible.if_is_compat_return_is_No_is_callable_compatible._", "embedding": null, "metadata": {"file_path": "mypy/subtypes.py", "file_name": "subtypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 816, "end_line": 892, "span_ids": ["is_callable_compatible"], "tokens": 829}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_callable_compatible(left: CallableType, right: CallableType,\n *,\n is_compat: Callable[[Type, Type], bool],\n is_compat_return: Optional[Callable[[Type, Type], bool]] = None,\n ignore_return: bool = False,\n ignore_pos_arg_names: bool = False,\n check_args_covariantly: bool = False,\n allow_partial_overlap: bool = False) -> bool:\n if is_compat_return is None:\n is_compat_return = is_compat\n\n # If either function is implicitly typed, ignore positional arg names too\n if left.implicit or right.implicit:\n ignore_pos_arg_names = True\n\n # Non-type cannot be a subtype of type.\n if right.is_type_obj() and not left.is_type_obj():\n return False\n\n # A callable L is a subtype of a generic callable R if L is a\n # subtype of every type obtained from R by substituting types for\n # the variables of R. We can check this by simply leaving the\n # generic variables of R as type variables, effectively varying\n # over all possible values.\n\n # It's okay even if these variables share ids with generic\n # type variables of L, because generating and solving\n # constraints for the variables of L to make L a subtype of R\n # (below) treats type variables on the two sides as independent.\n if left.variables:\n # Apply generic type variables away in left via type inference.\n unified = unify_generic_callable(left, right, ignore_return=ignore_return)\n if unified is None:\n return False\n else:\n left = unified\n\n # If we allow partial overlaps, we don't need to leave R generic:\n # if we can find even just a single typevar assignment which\n # would make these callables compatible, we should return True.\n\n # So, we repeat the above checks in the opposite direction. This also\n # lets us preserve the 'symmetry' property of allow_partial_overlap.\n if allow_partial_overlap and right.variables:\n unified = unify_generic_callable(right, left, ignore_return=ignore_return)\n if unified is not None:\n right = unified\n\n # Check return types.\n if not ignore_return and not is_compat_return(left.ret_type, right.ret_type):\n return False\n\n if check_args_covariantly:\n is_compat = flip_compat_check(is_compat)\n\n if right.is_ellipsis_args:\n return True\n\n left_star = left.var_arg()\n left_star2 = left.kw_arg()\n right_star = right.var_arg()\n right_star2 = right.kw_arg()\n\n # Match up corresponding arguments and check them for compatibility. In\n # every pair (argL, argR) of corresponding arguments from L and R, argL must\n # be \"more general\" than argR if L is to be a subtype of R.\n\n # Arguments are corresponding if they either share a name, share a position,\n # or both. If L's corresponding argument is ambiguous, L is not a subtype of R.\n\n # If left has one corresponding argument by name and another by position,\n # consider them to be one \"merged\" argument (and not ambiguous) if they're\n # both optional, they're name-only and position-only respectively, and they\n # have the same type. This rule allows functions with (*args, **kwargs) to\n # properly stand in for the full domain of formal arguments that they're\n # used for in practice.\n\n # Every argument in R must have a corresponding argument in L, and every\n # required argument in L must have a corresponding argument in R.\n\n # Phase 1: Confirm every argument in R has a corresponding argument in L.\n\n # Phase 1a: If left and right can both accept an infinite number of args,\n # their types must be compatible.\n #\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_is_callable_compatible._Furthermore__is_callable_compatible._Phase_2_Left_must_not_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_is_callable_compatible._Furthermore__is_callable_compatible._Phase_2_Left_must_not_", "embedding": null, "metadata": {"file_path": "mypy/subtypes.py", "file_name": "subtypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 893, "end_line": 969, "span_ids": ["is_callable_compatible"], "tokens": 835}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_callable_compatible(left: CallableType, right: CallableType,\n *,\n is_compat: Callable[[Type, Type], bool],\n is_compat_return: Optional[Callable[[Type, Type], bool]] = None,\n ignore_return: bool = False,\n ignore_pos_arg_names: bool = False,\n check_args_covariantly: bool = False,\n allow_partial_overlap: bool = False) -> bool:\n # Furthermore, if we're checking for compatibility in all cases,\n # we confirm that if R accepts an infinite number of arguments,\n # L must accept the same.\n def _incompatible(left_arg: Optional[FormalArgument],\n right_arg: Optional[FormalArgument]) -> bool:\n if right_arg is None:\n return False\n if left_arg is None:\n return not allow_partial_overlap\n return not is_compat(right_arg.typ, left_arg.typ)\n\n if _incompatible(left_star, right_star) or _incompatible(left_star2, right_star2):\n return False\n\n # Phase 1b: Check non-star args: for every arg right can accept, left must\n # also accept. The only exception is if we are allowing partial\n # partial overlaps: in that case, we ignore optional args on the right.\n for right_arg in right.formal_arguments():\n left_arg = mypy.typeops.callable_corresponding_argument(left, right_arg)\n if left_arg is None:\n if allow_partial_overlap and not right_arg.required:\n continue\n return False\n if not are_args_compatible(left_arg, right_arg, ignore_pos_arg_names,\n allow_partial_overlap, is_compat):\n return False\n\n # Phase 1c: Check var args. Right has an infinite series of optional positional\n # arguments. Get all further positional args of left, and make sure\n # they're more general then the corresponding member in right.\n if right_star is not None:\n # Synthesize an anonymous formal argument for the right\n right_by_position = right.try_synthesizing_arg_from_vararg(None)\n assert right_by_position is not None\n\n i = right_star.pos\n assert i is not None\n while i < len(left.arg_kinds) and left.arg_kinds[i] in (ARG_POS, ARG_OPT):\n if allow_partial_overlap and left.arg_kinds[i] == ARG_OPT:\n break\n\n left_by_position = left.argument_by_position(i)\n assert left_by_position is not None\n\n if not are_args_compatible(left_by_position, right_by_position,\n ignore_pos_arg_names, allow_partial_overlap,\n is_compat):\n return False\n i += 1\n\n # Phase 1d: Check kw args. Right has an infinite series of optional named\n # arguments. Get all further named args of left, and make sure\n # they're more general then the corresponding member in right.\n if right_star2 is not None:\n right_names = {name for name in right.arg_names if name is not None}\n left_only_names = set()\n for name, kind in zip(left.arg_names, left.arg_kinds):\n if name is None or kind in (ARG_STAR, ARG_STAR2) or name in right_names:\n continue\n left_only_names.add(name)\n\n # Synthesize an anonymous formal argument for the right\n right_by_name = right.try_synthesizing_arg_from_kwarg(None)\n assert right_by_name is not None\n\n for name in left_only_names:\n left_by_name = left.argument_by_name(name)\n assert left_by_name is not None\n\n if allow_partial_overlap and not left_by_name.required:\n continue\n\n if not are_args_compatible(left_by_name, right_by_name, ignore_pos_arg_names,\n allow_partial_overlap, is_compat):\n return False\n\n # Phase 2: Left must not impose additional restrictions.\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_is_callable_compatible._Every_require_is_callable_compatible.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_is_callable_compatible._Every_require_is_callable_compatible.return.True", "embedding": null, "metadata": {"file_path": "mypy/subtypes.py", "file_name": "subtypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 970, "end_line": 994, "span_ids": ["is_callable_compatible"], "tokens": 312}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_callable_compatible(left: CallableType, right: CallableType,\n *,\n is_compat: Callable[[Type, Type], bool],\n is_compat_return: Optional[Callable[[Type, Type], bool]] = None,\n ignore_return: bool = False,\n ignore_pos_arg_names: bool = False,\n check_args_covariantly: bool = False,\n allow_partial_overlap: bool = False) -> bool:\n # (Every required argument in L must have a corresponding argument in R)\n # Note: we already checked the *arg and **kwarg arguments in phase 1a.\n for left_arg in left.formal_arguments():\n right_by_name = (right.argument_by_name(left_arg.name)\n if left_arg.name is not None\n else None)\n\n right_by_pos = (right.argument_by_position(left_arg.pos)\n if left_arg.pos is not None\n else None)\n\n # If the left hand argument corresponds to two right-hand arguments,\n # neither of them can be required.\n if (right_by_name is not None\n and right_by_pos is not None\n and right_by_name != right_by_pos\n and (right_by_pos.required or right_by_name.required)):\n return False\n\n # All *required* left-hand arguments must have a corresponding\n # right-hand argument. Optional args do not matter.\n if left_arg.required and right_by_pos is None and right_by_name is None:\n return False\n\n return True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_are_args_compatible_are_args_compatible.is_different.return.left_item_right_item": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_are_args_compatible_are_args_compatible.is_different.return.left_item_right_item", "embedding": null, "metadata": {"file_path": "mypy/subtypes.py", "file_name": "subtypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 997, "end_line": 1015, "span_ids": ["are_args_compatible"], "tokens": 180}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def are_args_compatible(\n left: FormalArgument,\n right: FormalArgument,\n ignore_pos_arg_names: bool,\n allow_partial_overlap: bool,\n is_compat: Callable[[Type, Type], bool]) -> bool:\n def is_different(left_item: Optional[object], right_item: Optional[object]) -> bool:\n \"\"\"Checks if the left and right items are different.\n\n If the right item is unspecified (e.g. if the right callable doesn't care\n about what name or position its arg has), we default to returning False.\n\n If we're allowing partial overlap, we also default to returning False\n if the left callable also doesn't care.\"\"\"\n if right_item is None:\n return False\n if allow_partial_overlap and left_item is None:\n return False\n return left_item != right_item\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_are_args_compatible._If_right_has_a_specific_flip_compat_check.return.new_is_compat": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_are_args_compatible._If_right_has_a_specific_flip_compat_check.return.new_is_compat", "embedding": null, "metadata": {"file_path": "mypy/subtypes.py", "file_name": "subtypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1017, "end_line": 1046, "span_ids": ["are_args_compatible", "flip_compat_check"], "tokens": 314}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def are_args_compatible(\n left: FormalArgument,\n right: FormalArgument,\n ignore_pos_arg_names: bool,\n allow_partial_overlap: bool,\n is_compat: Callable[[Type, Type], bool]) -> bool:\n\n # If right has a specific name it wants this argument to be, left must\n # have the same.\n if is_different(left.name, right.name):\n # But pay attention to whether we're ignoring positional arg names\n if not ignore_pos_arg_names or right.pos is None:\n return False\n\n # If right is at a specific position, left must have the same:\n if is_different(left.pos, right.pos):\n return False\n\n # If right's argument is optional, left's must also be\n # (unless we're relaxing the checks to allow potential\n # rather then definite compatibility).\n if not allow_partial_overlap and not right.required and left.required:\n return False\n\n # If we're allowing partial overlaps and neither arg is required,\n # the types don't actually need to be the same\n if allow_partial_overlap and not left.required and not right.required:\n return True\n\n # Left must have a more general type\n return is_compat(right.typ, left.typ)\n\n\ndef flip_compat_check(is_compat: Callable[[Type, Type], bool]) -> Callable[[Type, Type], bool]:\n def new_is_compat(left: Type, right: Type) -> bool:\n return is_compat(right, left)\n return new_is_compat", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_unify_generic_callable_unify_generic_callable.return.applied": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_unify_generic_callable_unify_generic_callable.return.applied", "embedding": null, "metadata": {"file_path": "mypy/subtypes.py", "file_name": "subtypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1049, "end_line": 1086, "span_ids": ["unify_generic_callable"], "tokens": 314}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def unify_generic_callable(type: CallableType, target: CallableType,\n ignore_return: bool,\n return_constraint_direction: Optional[int] = None,\n ) -> Optional[CallableType]:\n \"\"\"Try to unify a generic callable type with another callable type.\n\n Return unified CallableType if successful; otherwise, return None.\n \"\"\"\n import mypy.solve\n\n if return_constraint_direction is None:\n return_constraint_direction = mypy.constraints.SUBTYPE_OF\n\n constraints = [] # type: List[mypy.constraints.Constraint]\n for arg_type, target_arg_type in zip(type.arg_types, target.arg_types):\n c = mypy.constraints.infer_constraints(\n arg_type, target_arg_type, mypy.constraints.SUPERTYPE_OF)\n constraints.extend(c)\n if not ignore_return:\n c = mypy.constraints.infer_constraints(\n type.ret_type, target.ret_type, return_constraint_direction)\n constraints.extend(c)\n type_var_ids = [tvar.id for tvar in type.variables]\n inferred_vars = mypy.solve.solve_constraints(type_var_ids, constraints)\n if None in inferred_vars:\n return None\n non_none_inferred_vars = cast(List[Type], inferred_vars)\n had_errors = False\n\n def report(*args: Any) -> None:\n nonlocal had_errors\n had_errors = True\n\n applied = mypy.applytype.apply_generic_arguments(type, non_none_inferred_vars, report,\n context=target)\n if had_errors:\n return None\n return applied", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_restrict_subtype_away_restrict_subtype_away.if_isinstance_t_UnionTyp.else_.return.t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_restrict_subtype_away_restrict_subtype_away.if_isinstance_t_UnionTyp.else_.return.t", "embedding": null, "metadata": {"file_path": "mypy/subtypes.py", "file_name": "subtypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1089, "end_line": 1108, "span_ids": ["restrict_subtype_away"], "tokens": 193}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def restrict_subtype_away(t: Type, s: Type, *, ignore_promotions: bool = False) -> Type:\n \"\"\"Return t minus s for runtime type assertions.\n\n If we can't determine a precise result, return a supertype of the\n ideal result (just t is a valid result).\n\n This is used for type inference of runtime type checks such as\n isinstance(). Currently this just removes elements of a union type.\n \"\"\"\n t = get_proper_type(t)\n s = get_proper_type(s)\n\n if isinstance(t, UnionType):\n new_items = [restrict_subtype_away(item, s, ignore_promotions=ignore_promotions)\n for item in t.relevant_items()\n if (isinstance(get_proper_type(item), AnyType) or\n not covers_at_runtime(item, s, ignore_promotions))]\n return UnionType.make_union(new_items)\n else:\n return t", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_covers_at_runtime_covers_at_runtime.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_covers_at_runtime_covers_at_runtime.return.False", "embedding": null, "metadata": {"file_path": "mypy/subtypes.py", "file_name": "subtypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1111, "end_line": 1129, "span_ids": ["covers_at_runtime"], "tokens": 226}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def covers_at_runtime(item: Type, supertype: Type, ignore_promotions: bool) -> bool:\n \"\"\"Will isinstance(item, supertype) always return True at runtime?\"\"\"\n item = get_proper_type(item)\n\n # Since runtime type checks will ignore type arguments, erase the types.\n supertype = erase_type(supertype)\n if is_proper_subtype(erase_type(item), supertype, ignore_promotions=ignore_promotions,\n erase_instances=True):\n return True\n if isinstance(supertype, Instance) and supertype.type.is_protocol:\n # TODO: Implement more robust support for runtime isinstance() checks, see issue #3827.\n if is_proper_subtype(item, supertype, ignore_promotions=ignore_promotions):\n return True\n if isinstance(item, TypedDictType) and isinstance(supertype, Instance):\n # Special case useful for selecting TypedDicts from unions using isinstance(x, dict).\n if supertype.type.fullname == 'builtins.dict':\n return True\n # TODO: Add more special cases.\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_is_proper_subtype_is_proper_subtype.return._is_proper_subtype_left_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_is_proper_subtype_is_proper_subtype.return._is_proper_subtype_left_", "embedding": null, "metadata": {"file_path": "mypy/subtypes.py", "file_name": "subtypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1132, "end_line": 1159, "span_ids": ["is_proper_subtype"], "tokens": 309}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_proper_subtype(left: Type, right: Type, *,\n ignore_promotions: bool = False,\n erase_instances: bool = False,\n keep_erased_types: bool = False) -> bool:\n \"\"\"Is left a proper subtype of right?\n\n For proper subtypes, there's no need to rely on compatibility due to\n Any types. Every usable type is a proper subtype of itself.\n\n If erase_instances is True, erase left instance *after* mapping it to supertype\n (this is useful for runtime isinstance() checks). If keep_erased_types is True,\n do not consider ErasedType a subtype of all types (used by type inference against unions).\n \"\"\"\n if TypeState.is_assumed_proper_subtype(left, right):\n return True\n if (isinstance(left, TypeAliasType) and isinstance(right, TypeAliasType) and\n left.is_recursive and right.is_recursive):\n # This case requires special care because it may cause infinite recursion.\n # See is_subtype() for more info.\n with pop_on_exit(TypeState._assuming_proper, left, right):\n return _is_proper_subtype(left, right,\n ignore_promotions=ignore_promotions,\n erase_instances=erase_instances,\n keep_erased_types=keep_erased_types)\n return _is_proper_subtype(left, right,\n ignore_promotions=ignore_promotions,\n erase_instances=erase_instances,\n keep_erased_types=keep_erased_types)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py__is_proper_subtype__is_proper_subtype.return.left_accept_ProperSubtype": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py__is_proper_subtype__is_proper_subtype.return.left_accept_ProperSubtype", "embedding": null, "metadata": {"file_path": "mypy/subtypes.py", "file_name": "subtypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1162, "end_line": 1180, "span_ids": ["_is_proper_subtype"], "tokens": 178}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _is_proper_subtype(left: Type, right: Type, *,\n ignore_promotions: bool = False,\n erase_instances: bool = False,\n keep_erased_types: bool = False) -> bool:\n orig_left = left\n orig_right = right\n left = get_proper_type(left)\n right = get_proper_type(right)\n\n if isinstance(right, UnionType) and not isinstance(left, UnionType):\n return any([is_proper_subtype(orig_left, item,\n ignore_promotions=ignore_promotions,\n erase_instances=erase_instances,\n keep_erased_types=keep_erased_types)\n for item in right.items])\n return left.accept(ProperSubtypeVisitor(orig_right,\n ignore_promotions=ignore_promotions,\n erase_instances=erase_instances,\n keep_erased_types=keep_erased_types))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_ProperSubtypeVisitor_ProperSubtypeVisitor.visit_deleted_type.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_ProperSubtypeVisitor_ProperSubtypeVisitor.visit_deleted_type.return.True", "embedding": null, "metadata": {"file_path": "mypy/subtypes.py", "file_name": "subtypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1183, "end_line": 1239, "span_ids": ["ProperSubtypeVisitor.visit_erased_type", "ProperSubtypeVisitor.visit_uninhabited_type", "ProperSubtypeVisitor", "ProperSubtypeVisitor.visit_any", "ProperSubtypeVisitor.visit_none_type", "ProperSubtypeVisitor.build_subtype_kind", "ProperSubtypeVisitor.visit_unbound_type", "ProperSubtypeVisitor._is_proper_subtype", "ProperSubtypeVisitor.visit_deleted_type", "ProperSubtypeVisitor.__init__"], "tokens": 515}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ProperSubtypeVisitor(TypeVisitor[bool]):\n def __init__(self, right: Type, *,\n ignore_promotions: bool = False,\n erase_instances: bool = False,\n keep_erased_types: bool = False) -> None:\n self.right = get_proper_type(right)\n self.orig_right = right\n self.ignore_promotions = ignore_promotions\n self.erase_instances = erase_instances\n self.keep_erased_types = keep_erased_types\n self._subtype_kind = ProperSubtypeVisitor.build_subtype_kind(\n ignore_promotions=ignore_promotions,\n erase_instances=erase_instances,\n keep_erased_types=keep_erased_types\n )\n\n @staticmethod\n def build_subtype_kind(*,\n ignore_promotions: bool = False,\n erase_instances: bool = False,\n keep_erased_types: bool = False) -> SubtypeKind:\n return True, ignore_promotions, erase_instances, keep_erased_types\n\n def _is_proper_subtype(self, left: Type, right: Type) -> bool:\n return is_proper_subtype(left, right,\n ignore_promotions=self.ignore_promotions,\n erase_instances=self.erase_instances,\n keep_erased_types=self.keep_erased_types)\n\n def visit_unbound_type(self, left: UnboundType) -> bool:\n # This can be called if there is a bad type annotation. The result probably\n # doesn't matter much but by returning True we simplify these bad types away\n # from unions, which could filter out some bogus messages.\n return True\n\n def visit_any(self, left: AnyType) -> bool:\n return isinstance(self.right, AnyType)\n\n def visit_none_type(self, left: NoneType) -> bool:\n if state.strict_optional:\n return (isinstance(self.right, NoneType) or\n is_named_instance(self.right, 'builtins.object'))\n return True\n\n def visit_uninhabited_type(self, left: UninhabitedType) -> bool:\n return True\n\n def visit_erased_type(self, left: ErasedType) -> bool:\n # This may be encountered during type inference. The result probably doesn't\n # matter much.\n # TODO: it actually does matter, figure out more principled logic about this.\n if self.keep_erased_types:\n return False\n return True\n\n def visit_deleted_type(self, left: DeletedType) -> bool:\n return True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_ProperSubtypeVisitor.visit_instance_ProperSubtypeVisitor.visit_instance.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_ProperSubtypeVisitor.visit_instance_ProperSubtypeVisitor.visit_instance.return.False", "embedding": null, "metadata": {"file_path": "mypy/subtypes.py", "file_name": "subtypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1241, "end_line": 1281, "span_ids": ["ProperSubtypeVisitor.visit_instance"], "tokens": 399}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ProperSubtypeVisitor(TypeVisitor[bool]):\n\n def visit_instance(self, left: Instance) -> bool:\n right = self.right\n if isinstance(right, Instance):\n if TypeState.is_cached_subtype_check(self._subtype_kind, left, right):\n return True\n if not self.ignore_promotions:\n for base in left.type.mro:\n if base._promote and self._is_proper_subtype(base._promote, right):\n TypeState.record_subtype_cache_entry(self._subtype_kind, left, right)\n return True\n\n if left.type.has_base(right.type.fullname):\n def check_argument(leftarg: Type, rightarg: Type, variance: int) -> bool:\n if variance == COVARIANT:\n return self._is_proper_subtype(leftarg, rightarg)\n elif variance == CONTRAVARIANT:\n return self._is_proper_subtype(rightarg, leftarg)\n else:\n return mypy.sametypes.is_same_type(leftarg, rightarg)\n # Map left type to corresponding right instances.\n left = map_instance_to_supertype(left, right.type)\n if self.erase_instances:\n erased = erase_type(left)\n assert isinstance(erased, Instance)\n left = erased\n\n nominal = all(check_argument(ta, ra, tvar.variance) for ta, ra, tvar in\n zip(left.args, right.args, right.type.defn.type_vars))\n if nominal:\n TypeState.record_subtype_cache_entry(self._subtype_kind, left, right)\n return nominal\n if (right.type.is_protocol and\n is_protocol_implementation(left, right, proper_subtype=True)):\n return True\n return False\n if isinstance(right, CallableType):\n call = find_member('__call__', left, left, is_operator=True)\n if call:\n return self._is_proper_subtype(call, right)\n return False\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_ProperSubtypeVisitor.visit_type_var_ProperSubtypeVisitor.visit_callable_type.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_ProperSubtypeVisitor.visit_type_var_ProperSubtypeVisitor.visit_callable_type.return.False", "embedding": null, "metadata": {"file_path": "mypy/subtypes.py", "file_name": "subtypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1283, "end_line": 1303, "span_ids": ["ProperSubtypeVisitor.visit_callable_type", "ProperSubtypeVisitor.visit_type_var"], "tokens": 241}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ProperSubtypeVisitor(TypeVisitor[bool]):\n\n def visit_type_var(self, left: TypeVarType) -> bool:\n if isinstance(self.right, TypeVarType) and left.id == self.right.id:\n return True\n if left.values and self._is_proper_subtype(\n mypy.typeops.make_simplified_union(left.values), self.right):\n return True\n return self._is_proper_subtype(left.upper_bound, self.right)\n\n def visit_callable_type(self, left: CallableType) -> bool:\n right = self.right\n if isinstance(right, CallableType):\n return is_callable_compatible(left, right, is_compat=self._is_proper_subtype)\n elif isinstance(right, Overloaded):\n return all(self._is_proper_subtype(left, item)\n for item in right.items())\n elif isinstance(right, Instance):\n return self._is_proper_subtype(left.fallback, right)\n elif isinstance(right, TypeType):\n # This is unsound, we don't check the __init__ signature.\n return left.is_type_obj() and self._is_proper_subtype(left.ret_type, right.item)\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_ProperSubtypeVisitor.visit_tuple_type_ProperSubtypeVisitor.visit_tuple_type.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_ProperSubtypeVisitor.visit_tuple_type_ProperSubtypeVisitor.visit_tuple_type.return.False", "embedding": null, "metadata": {"file_path": "mypy/subtypes.py", "file_name": "subtypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1305, "end_line": 1330, "span_ids": ["ProperSubtypeVisitor.visit_tuple_type"], "tokens": 308}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ProperSubtypeVisitor(TypeVisitor[bool]):\n\n def visit_tuple_type(self, left: TupleType) -> bool:\n right = self.right\n if isinstance(right, Instance):\n if (is_named_instance(right, 'builtins.tuple') or\n is_named_instance(right, 'typing.Iterable') or\n is_named_instance(right, 'typing.Container') or\n is_named_instance(right, 'typing.Sequence') or\n is_named_instance(right, 'typing.Reversible')):\n if not right.args:\n return False\n iter_type = get_proper_type(right.args[0])\n if is_named_instance(right, 'builtins.tuple') and isinstance(iter_type, AnyType):\n # TODO: We shouldn't need this special case. This is currently needed\n # for isinstance(x, tuple), though it's unclear why.\n return True\n return all(self._is_proper_subtype(li, iter_type) for li in left.items)\n return self._is_proper_subtype(mypy.typeops.tuple_fallback(left), right)\n elif isinstance(right, TupleType):\n if len(left.items) != len(right.items):\n return False\n for l, r in zip(left.items, right.items):\n if not self._is_proper_subtype(l, r):\n return False\n return self._is_proper_subtype(mypy.typeops.tuple_fallback(left),\n mypy.typeops.tuple_fallback(right))\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_ProperSubtypeVisitor.visit_typeddict_type_ProperSubtypeVisitor.visit_partial_type.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_ProperSubtypeVisitor.visit_typeddict_type_ProperSubtypeVisitor.visit_partial_type.return.False", "embedding": null, "metadata": {"file_path": "mypy/subtypes.py", "file_name": "subtypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1332, "end_line": 1360, "span_ids": ["ProperSubtypeVisitor.visit_typeddict_type", "ProperSubtypeVisitor.visit_partial_type", "ProperSubtypeVisitor.visit_union_type", "ProperSubtypeVisitor.visit_literal_type", "ProperSubtypeVisitor.visit_overloaded"], "tokens": 271}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ProperSubtypeVisitor(TypeVisitor[bool]):\n\n def visit_typeddict_type(self, left: TypedDictType) -> bool:\n right = self.right\n if isinstance(right, TypedDictType):\n for name, typ in left.items.items():\n if (name in right.items\n and not mypy.sametypes.is_same_type(typ, right.items[name])):\n return False\n for name, typ in right.items.items():\n if name not in left.items:\n return False\n return True\n return self._is_proper_subtype(left.fallback, right)\n\n def visit_literal_type(self, left: LiteralType) -> bool:\n if isinstance(self.right, LiteralType):\n return left == self.right\n else:\n return self._is_proper_subtype(left.fallback, self.right)\n\n def visit_overloaded(self, left: Overloaded) -> bool:\n # TODO: What's the right thing to do here?\n return False\n\n def visit_union_type(self, left: UnionType) -> bool:\n return all([self._is_proper_subtype(item, self.orig_right) for item in left.items])\n\n def visit_partial_type(self, left: PartialType) -> bool:\n # TODO: What's the right thing to do here?\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_ProperSubtypeVisitor.visit_type_type_ProperSubtypeVisitor.visit_type_alias_type.assert_False_This_shoul": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_ProperSubtypeVisitor.visit_type_type_ProperSubtypeVisitor.visit_type_alias_type.assert_False_This_shoul", "embedding": null, "metadata": {"file_path": "mypy/subtypes.py", "file_name": "subtypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1362, "end_line": 1388, "span_ids": ["ProperSubtypeVisitor.visit_type_alias_type", "ProperSubtypeVisitor.visit_type_type"], "tokens": 328}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ProperSubtypeVisitor(TypeVisitor[bool]):\n\n def visit_type_type(self, left: TypeType) -> bool:\n right = self.right\n if isinstance(right, TypeType):\n # This is unsound, we don't check the __init__ signature.\n return self._is_proper_subtype(left.item, right.item)\n if isinstance(right, CallableType):\n # This is also unsound because of __init__.\n return right.is_type_obj() and self._is_proper_subtype(left.item, right.ret_type)\n if isinstance(right, Instance):\n if right.type.fullname == 'builtins.type':\n # TODO: Strictly speaking, the type builtins.type is considered equivalent to\n # Type[Any]. However, this would break the is_proper_subtype check in\n # conditional_type_map for cases like isinstance(x, type) when the type\n # of x is Type[int]. It's unclear what's the right way to address this.\n return True\n if right.type.fullname == 'builtins.object':\n return True\n item = left.item\n if isinstance(item, TypeVarType):\n item = get_proper_type(item.upper_bound)\n if isinstance(item, Instance):\n metaclass = item.type.metaclass_type\n return metaclass is not None and self._is_proper_subtype(metaclass, right)\n return False\n\n def visit_type_alias_type(self, left: TypeAliasType) -> bool:\n assert False, \"This should be never called, got {}\".format(left)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_is_more_precise_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_is_more_precise_", "embedding": null, "metadata": {"file_path": "mypy/subtypes.py", "file_name": "subtypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1391, "end_line": 1403, "span_ids": ["is_more_precise"], "tokens": 134}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_more_precise(left: Type, right: Type, *, ignore_promotions: bool = False) -> bool:\n \"\"\"Check if left is a more precise type than right.\n\n A left is a proper subtype of right, left is also more precise than\n right. Also, if right is Any, left is more precise than right, for\n any left.\n \"\"\"\n # TODO Should List[int] be more precise than List[Any]?\n right = get_proper_type(right)\n if isinstance(right, AnyType):\n return True\n return is_proper_subtype(left, right, ignore_promotions=ignore_promotions)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py__Mechanisms_for_inferri_Callsite.NamedTuple_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py__Mechanisms_for_inferri_Callsite.NamedTuple_", "embedding": null, "metadata": {"file_path": "mypy/suggestions.py", "file_name": "suggestions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 76, "span_ids": ["imports:18", "docstring"], "tokens": 628}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Mechanisms for inferring function types based on callsites.\n\nCurrently works by collecting all argument types at callsites,\nsynthesizing a list of possible function types from that, trying them\nall, and picking the one with the fewest errors that we think is the\n\"best\".\n\nCan return JSON that pyannotate can use to apply the annotations to code.\n\nThere are a bunch of TODOs here:\n * Maybe want a way to surface the choices not selected??\n * We can generate an exponential number of type suggestions, and probably want\n a way to not always need to check them all.\n * Our heuristics for what types to try are primitive and not yet\n supported by real practice.\n * More!\n\nOther things:\n * This is super brute force. Could we integrate with the typechecker\n more to understand more about what is going on?\n * Like something with tracking constraints/unification variables?\n * No understanding of type variables at *all*\n\"\"\"\n\nfrom typing import (\n List, Optional, Tuple, Dict, Callable, Union, NamedTuple, TypeVar, Iterator, cast,\n)\nfrom typing_extensions import TypedDict\n\nfrom mypy.state import strict_optional_set\nfrom mypy.types import (\n Type, AnyType, TypeOfAny, CallableType, UnionType, NoneType, Instance, TupleType,\n TypeVarType, FunctionLike, UninhabitedType,\n TypeStrVisitor, TypeTranslator,\n is_optional, remove_optional, ProperType, get_proper_type,\n TypedDictType, TypeAliasType\n)\nfrom mypy.build import State, Graph\nfrom mypy.nodes import (\n ARG_STAR, ARG_NAMED, ARG_STAR2, ARG_NAMED_OPT, FuncDef, MypyFile, SymbolTable,\n Decorator, RefExpr,\n SymbolNode, TypeInfo, Expression, ReturnStmt, CallExpr,\n reverse_builtin_aliases,\n)\nfrom mypy.server.update import FineGrainedBuildManager\nfrom mypy.util import split_target\nfrom mypy.find_sources import SourceFinder, InvalidSourceList\nfrom mypy.modulefinder import PYTHON_EXTENSIONS\nfrom mypy.plugin import Plugin, FunctionContext, MethodContext\nfrom mypy.traverser import TraverserVisitor\nfrom mypy.checkexpr import has_any_type, map_actuals_to_formals\n\nfrom mypy.join import join_type_list\nfrom mypy.meet import meet_type_list\nfrom mypy.sametypes import is_same_type\nfrom mypy.typeops import make_simplified_union\n\nfrom contextlib import contextmanager\n\nimport itertools\nimport json\nimport os\n\n\nPyAnnotateSignature = TypedDict('PyAnnotateSignature',\n {'return_type': str, 'arg_types': List[str]})\n\n\nCallsite = NamedTuple(\n 'Callsite',\n [('path', str),\n ('line', int),\n ('arg_kinds', List[List[int]]),\n ('callee_arg_names', List[Optional[str]]),\n ('arg_names', List[List[Optional[str]]]),\n ('arg_types', List[List[Type]])])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionPlugin_SuggestionPlugin.log.return.ctx_default_return_type": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionPlugin_SuggestionPlugin.log.return.ctx_default_return_type", "embedding": null, "metadata": {"file_path": "mypy/suggestions.py", "file_name": "suggestions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 79, "end_line": 113, "span_ids": ["SuggestionPlugin.get_function_hook", "SuggestionPlugin.__init__", "SuggestionPlugin.log", "SuggestionPlugin", "SuggestionPlugin.get_method_hook"], "tokens": 263}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SuggestionPlugin(Plugin):\n \"\"\"Plugin that records all calls to a given target.\"\"\"\n\n def __init__(self, target: str) -> None:\n if target.endswith(('.__new__', '.__init__')):\n target = target.rsplit('.', 1)[0]\n\n self.target = target\n # List of call sites found by dmypy suggest:\n # (path, line, , , )\n self.mystery_hits = [] # type: List[Callsite]\n\n def get_function_hook(self, fullname: str\n ) -> Optional[Callable[[FunctionContext], Type]]:\n if fullname == self.target:\n return self.log\n else:\n return None\n\n def get_method_hook(self, fullname: str\n ) -> Optional[Callable[[MethodContext], Type]]:\n if fullname == self.target:\n return self.log\n else:\n return None\n\n def log(self, ctx: Union[FunctionContext, MethodContext]) -> Type:\n self.mystery_hits.append(Callsite(\n ctx.api.path,\n ctx.context.line,\n ctx.arg_kinds,\n ctx.callee_arg_names,\n ctx.arg_names,\n ctx.arg_types))\n return ctx.default_return_type", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py__NOTE_We_could_make_thi_get_return_types.return.finder_return_types": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py__NOTE_We_could_make_thi_get_return_types.return.finder_return_types", "embedding": null, "metadata": {"file_path": "mypy/suggestions.py", "file_name": "suggestions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 116, "end_line": 137, "span_ids": ["ReturnFinder.visit_return_stmt", "SuggestionPlugin.log", "ReturnFinder.visit_func_def", "ReturnFinder", "ReturnFinder.__init__", "get_return_types"], "tokens": 207}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# NOTE: We could make this a bunch faster by implementing a StatementVisitor that skips\n# traversing into expressions\nclass ReturnFinder(TraverserVisitor):\n \"\"\"Visitor for finding all types returned from a function.\"\"\"\n def __init__(self, typemap: Dict[Expression, Type]) -> None:\n self.typemap = typemap\n self.return_types = [] # type: List[Type]\n\n def visit_return_stmt(self, o: ReturnStmt) -> None:\n if o.expr is not None and o.expr in self.typemap:\n self.return_types.append(self.typemap[o.expr])\n\n def visit_func_def(self, o: FuncDef) -> None:\n # Skip nested functions\n pass\n\n\ndef get_return_types(typemap: Dict[Expression, Type], func: FuncDef) -> List[Type]:\n \"\"\"Find all the types returned by return statements in func.\"\"\"\n finder = ReturnFinder(typemap)\n func.body.accept(finder)\n return finder.return_types", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_ArgUseFinder_ArgUseFinder.visit_call_expr.for_i_args_in_enumerate_.for_arg_idx_in_args_.if_isinstance_arg_RefExp.self_arg_types_arg_node_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_ArgUseFinder_ArgUseFinder.visit_call_expr.for_i_args_in_enumerate_.for_arg_idx_in_args_.if_isinstance_arg_RefExp.self_arg_types_arg_node_", "embedding": null, "metadata": {"file_path": "mypy/suggestions.py", "file_name": "suggestions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 140, "end_line": 167, "span_ids": ["ArgUseFinder.visit_call_expr", "ArgUseFinder.__init__", "ArgUseFinder"], "tokens": 272}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ArgUseFinder(TraverserVisitor):\n \"\"\"Visitor for finding all the types of arguments that each arg is passed to.\n\n This is extremely simple minded but might be effective anyways.\n \"\"\"\n def __init__(self, func: FuncDef, typemap: Dict[Expression, Type]) -> None:\n self.typemap = typemap\n self.arg_types = {\n arg.variable: [] for arg in func.arguments\n } # type: Dict[SymbolNode, List[Type]]\n\n def visit_call_expr(self, o: CallExpr) -> None:\n if not any(isinstance(e, RefExpr) and e.node in self.arg_types for e in o.args):\n return\n\n typ = get_proper_type(self.typemap.get(o.callee))\n if not isinstance(typ, CallableType):\n return\n\n formal_to_actual = map_actuals_to_formals(\n o.arg_kinds, o.arg_names, typ.arg_kinds, typ.arg_names,\n lambda n: AnyType(TypeOfAny.special_form))\n\n for i, args in enumerate(formal_to_actual):\n for arg_idx in args:\n arg = o.args[arg_idx]\n if isinstance(arg, RefExpr) and arg.node in self.arg_types:\n self.arg_types[arg.node].append(typ.arg_types[i])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_get_arg_uses_get_arg_uses.return._finder_arg_types_arg_var": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_get_arg_uses_get_arg_uses.return._finder_arg_types_arg_var", "embedding": null, "metadata": {"file_path": "mypy/suggestions.py", "file_name": "suggestions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 170, "end_line": 184, "span_ids": ["get_arg_uses"], "tokens": 129}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_arg_uses(typemap: Dict[Expression, Type], func: FuncDef) -> List[List[Type]]:\n \"\"\"Find all the types of arguments that each arg is passed to.\n\n For example, given\n def foo(x: int) -> None: ...\n def bar(x: str) -> None: ...\n def test(x, y):\n foo(x)\n bar(y)\n\n this will return [[int], [str]].\n \"\"\"\n finder = ArgUseFinder(func, typemap)\n func.body.accept(finder)\n return [finder.arg_types[arg.variable] for arg in func.arguments]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionFailure_is_implicit_any.return.isinstance_typ_AnyType_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionFailure_is_implicit_any.return.isinstance_typ_AnyType_", "embedding": null, "metadata": {"file_path": "mypy/suggestions.py", "file_name": "suggestions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 187, "end_line": 203, "span_ids": ["is_explicit_any", "SuggestionFailure", "is_implicit_any"], "tokens": 173}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SuggestionFailure(Exception):\n pass\n\n\ndef is_explicit_any(typ: AnyType) -> bool:\n # Originally I wanted to count as explicit anything derived from an explicit any, but that\n # seemed too strict in some testing.\n # return (typ.type_of_any == TypeOfAny.explicit\n # or (typ.source_any is not None and typ.source_any.type_of_any == TypeOfAny.explicit))\n # Important question: what should we do with source_any stuff? Does that count?\n # And actually should explicit anys count at all?? Maybe not!\n return typ.type_of_any == TypeOfAny.explicit\n\n\ndef is_implicit_any(typ: Type) -> bool:\n typ = get_proper_type(typ)\n return isinstance(typ, AnyType) and not is_explicit_any(typ)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine_SuggestionEngine.suggest.if_self_give_json_.else_.return.self_format_signature_sug": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine_SuggestionEngine.suggest.if_self_give_json_.else_.return.self_format_signature_sug", "embedding": null, "metadata": {"file_path": "mypy/suggestions.py", "file_name": "suggestions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 206, "end_line": 246, "span_ids": ["SuggestionEngine.suggest", "SuggestionEngine.__init__", "SuggestionEngine"], "tokens": 313}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SuggestionEngine:\n \"\"\"Engine for finding call sites and suggesting signatures.\"\"\"\n\n def __init__(self, fgmanager: FineGrainedBuildManager,\n *,\n json: bool,\n no_errors: bool = False,\n no_any: bool = False,\n try_text: bool = False,\n flex_any: Optional[float] = None,\n use_fixme: Optional[str] = None,\n max_guesses: Optional[int] = None\n ) -> None:\n self.fgmanager = fgmanager\n self.manager = fgmanager.manager\n self.plugin = self.manager.plugin\n self.graph = fgmanager.graph\n self.finder = SourceFinder(self.manager.fscache, self.manager.options)\n\n self.give_json = json\n self.no_errors = no_errors\n self.try_text = try_text\n self.flex_any = flex_any\n if no_any:\n self.flex_any = 1.0\n\n self.max_guesses = max_guesses or 64\n self.use_fixme = use_fixme\n\n def suggest(self, function: str) -> str:\n \"\"\"Suggest an inferred type for function.\"\"\"\n mod, func_name, node = self.find_node(function)\n\n with self.restore_after(mod):\n with self.with_export_types():\n suggestion = self.get_suggestion(mod, node)\n\n if self.give_json:\n return self.json_suggestion(mod, func_name, node, suggestion)\n else:\n return self.format_signature(suggestion)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.suggest_callsites_SuggestionEngine.suggest_callsites.return._n_join_dedup_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.suggest_callsites_SuggestionEngine.suggest_callsites.return._n_join_dedup_", "embedding": null, "metadata": {"file_path": "mypy/suggestions.py", "file_name": "suggestions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 248, "end_line": 257, "span_ids": ["SuggestionEngine.suggest_callsites"], "tokens": 121}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SuggestionEngine:\n\n def suggest_callsites(self, function: str) -> str:\n \"\"\"Find a list of call sites of function.\"\"\"\n mod, _, node = self.find_node(function)\n with self.restore_after(mod):\n callsites, _ = self.get_callsites(node)\n\n return '\\n'.join(dedup(\n [\"%s:%s: %s\" % (path, line, self.format_args(arg_kinds, arg_names, arg_types))\n for path, line, arg_kinds, _, arg_names, arg_types in callsites]\n ))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.restore_after_SuggestionEngine.with_export_types.try_.finally_.self.manager.options.export_types.old": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.restore_after_SuggestionEngine.with_export_types.try_.finally_.self.manager.options.export_types.old", "embedding": null, "metadata": {"file_path": "mypy/suggestions.py", "file_name": "suggestions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 259, "end_line": 281, "span_ids": ["SuggestionEngine.restore_after", "SuggestionEngine.with_export_types"], "tokens": 158}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SuggestionEngine:\n\n @contextmanager\n def restore_after(self, module: str) -> Iterator[None]:\n \"\"\"Context manager that reloads a module after executing the body.\n\n This should undo any damage done to the module state while mucking around.\n \"\"\"\n try:\n yield\n finally:\n self.reload(self.graph[module])\n\n @contextmanager\n def with_export_types(self) -> Iterator[None]:\n \"\"\"Context manager that enables the export_types flag in the body.\n\n This causes type information to be exported into the manager's all_types variable.\n \"\"\"\n old = self.manager.options.export_types\n self.manager.options.export_types = True\n try:\n yield\n finally:\n self.manager.options.export_types = old", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.get_trivial_type_SuggestionEngine.get_starting_type.if_isinstance_fdef_type_.else_.return.self_get_trivial_type_fde": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.get_trivial_type_SuggestionEngine.get_starting_type.if_isinstance_fdef_type_.else_.return.self_get_trivial_type_fde", "embedding": null, "metadata": {"file_path": "mypy/suggestions.py", "file_name": "suggestions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 283, "end_line": 299, "span_ids": ["SuggestionEngine.get_starting_type", "SuggestionEngine.get_trivial_type"], "tokens": 183}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SuggestionEngine:\n\n def get_trivial_type(self, fdef: FuncDef) -> CallableType:\n \"\"\"Generate a trivial callable type from a func def, with all Anys\"\"\"\n # The Anys are marked as being from the suggestion engine\n # since they need some special treatment (specifically,\n # constraint generation ignores them.)\n return CallableType(\n [AnyType(TypeOfAny.suggestion_engine) for a in fdef.arg_kinds],\n fdef.arg_kinds,\n fdef.arg_names,\n AnyType(TypeOfAny.suggestion_engine),\n self.builtin_type('builtins.function'))\n\n def get_starting_type(self, fdef: FuncDef) -> CallableType:\n if isinstance(fdef.type, CallableType):\n return make_suggestion_anys(fdef.type)\n else:\n return self.get_trivial_type(fdef)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.get_args_SuggestionEngine.get_args.return.types": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.get_args_SuggestionEngine.get_args.return.types", "embedding": null, "metadata": {"file_path": "mypy/suggestions.py", "file_name": "suggestions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 301, "end_line": 347, "span_ids": ["SuggestionEngine.get_args"], "tokens": 404}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SuggestionEngine:\n\n def get_args(self, is_method: bool,\n base: CallableType, defaults: List[Optional[Type]],\n callsites: List[Callsite],\n uses: List[List[Type]]) -> List[List[Type]]:\n \"\"\"Produce a list of type suggestions for each argument type.\"\"\"\n types = [] # type: List[List[Type]]\n for i in range(len(base.arg_kinds)):\n # Make self args Any but this will get overridden somewhere in the checker\n if i == 0 and is_method:\n types.append([AnyType(TypeOfAny.suggestion_engine)])\n continue\n\n all_arg_types = []\n for call in callsites:\n for typ in call.arg_types[i - is_method]:\n # Collect all the types except for implicit anys\n if not is_implicit_any(typ):\n all_arg_types.append(typ)\n all_use_types = []\n for typ in uses[i]:\n # Collect all the types except for implicit anys\n if not is_implicit_any(typ):\n all_use_types.append(typ)\n # Add in any default argument types\n default = defaults[i]\n if default:\n all_arg_types.append(default)\n if all_use_types:\n all_use_types.append(default)\n\n arg_types = []\n\n if (all_arg_types\n and all(isinstance(get_proper_type(tp), NoneType) for tp in all_arg_types)):\n arg_types.append(\n UnionType.make_union([all_arg_types[0], AnyType(TypeOfAny.explicit)]))\n elif all_arg_types:\n arg_types.extend(generate_type_combinations(all_arg_types))\n else:\n arg_types.append(AnyType(TypeOfAny.explicit))\n\n if all_use_types:\n # This is a meet because the type needs to be compatible with all the uses\n arg_types.append(meet_type_list(all_use_types))\n\n types.append(arg_types)\n return types", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.get_default_arg_types_SuggestionEngine.add_adjustments.return.dedup_typs_tp_accept_t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.get_default_arg_types_SuggestionEngine.add_adjustments.return.dedup_typs_tp_accept_t", "embedding": null, "metadata": {"file_path": "mypy/suggestions.py", "file_name": "suggestions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 349, "end_line": 357, "span_ids": ["SuggestionEngine.add_adjustments", "SuggestionEngine.get_default_arg_types"], "tokens": 129}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SuggestionEngine:\n\n def get_default_arg_types(self, state: State, fdef: FuncDef) -> List[Optional[Type]]:\n return [self.manager.all_types[arg.initializer] if arg.initializer else None\n for arg in fdef.arguments]\n\n def add_adjustments(self, typs: List[Type]) -> List[Type]:\n if not self.try_text or self.manager.options.python_version[0] != 2:\n return typs\n translator = StrToText(self.builtin_type)\n return dedup(typs + [tp.accept(translator) for tp in typs])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.get_guesses_SuggestionEngine.get_guesses.return._refine_callable_base_ba": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.get_guesses_SuggestionEngine.get_guesses.return._refine_callable_base_ba", "embedding": null, "metadata": {"file_path": "mypy/suggestions.py", "file_name": "suggestions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 359, "end_line": 371, "span_ids": ["SuggestionEngine.get_guesses"], "tokens": 174}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SuggestionEngine:\n\n def get_guesses(self, is_method: bool, base: CallableType, defaults: List[Optional[Type]],\n callsites: List[Callsite],\n uses: List[List[Type]]) -> List[CallableType]:\n \"\"\"Compute a list of guesses for a function's type.\n\n This focuses just on the argument types, and doesn't change the provided return type.\n \"\"\"\n options = self.get_args(is_method, base, defaults, callsites, uses)\n options = [self.add_adjustments(tps) for tps in options]\n\n # Take the first `max_guesses` guesses.\n product = itertools.islice(itertools.product(*options), 0, self.max_guesses)\n return [refine_callable(base, base.copy_modified(arg_types=list(x))) for x in product]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.get_callsites_SuggestionEngine.filter_options.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.get_callsites_SuggestionEngine.filter_options.return._", "embedding": null, "metadata": {"file_path": "mypy/suggestions.py", "file_name": "suggestions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 373, "end_line": 397, "span_ids": ["SuggestionEngine.get_callsites", "SuggestionEngine.filter_options"], "tokens": 202}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SuggestionEngine:\n\n def get_callsites(self, func: FuncDef) -> Tuple[List[Callsite], List[str]]:\n \"\"\"Find all call sites of a function.\"\"\"\n new_type = self.get_starting_type(func)\n\n collector_plugin = SuggestionPlugin(func.fullname)\n\n self.plugin._plugins.insert(0, collector_plugin)\n try:\n errors = self.try_type(func, new_type)\n finally:\n self.plugin._plugins.pop(0)\n\n return collector_plugin.mystery_hits, errors\n\n def filter_options(\n self, guesses: List[CallableType], is_method: bool, ignore_return: bool\n ) -> List[CallableType]:\n \"\"\"Apply any configured filters to the possible guesses.\n\n Currently the only option is filtering based on Any prevalance.\"\"\"\n return [\n t for t in guesses\n if self.flex_any is None\n or any_score_callable(t, is_method, ignore_return) >= self.flex_any\n ]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.find_best_SuggestionEngine.find_best.return.best_count_errors_errors": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.find_best_SuggestionEngine.find_best.return.best_count_errors_errors", "embedding": null, "metadata": {"file_path": "mypy/suggestions.py", "file_name": "suggestions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 399, "end_line": 409, "span_ids": ["SuggestionEngine.find_best"], "tokens": 137}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SuggestionEngine:\n\n def find_best(self, func: FuncDef, guesses: List[CallableType]) -> Tuple[CallableType, int]:\n \"\"\"From a list of possible function types, find the best one.\n\n For best, we want the fewest errors, then the best \"score\" from score_callable.\n \"\"\"\n if not guesses:\n raise SuggestionFailure(\"No guesses that match criteria!\")\n errors = {guess: self.try_type(func, guess) for guess in guesses}\n best = min(guesses,\n key=lambda s: (count_errors(errors[s]), self.score_callable(s)))\n return best, count_errors(errors[best])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.get_guesses_from_parent_SuggestionEngine.get_guesses_from_parent.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.get_guesses_from_parent_SuggestionEngine.get_guesses_from_parent.return._", "embedding": null, "metadata": {"file_path": "mypy/suggestions.py", "file_name": "suggestions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 411, "end_line": 426, "span_ids": ["SuggestionEngine.get_guesses_from_parent"], "tokens": 174}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SuggestionEngine:\n\n def get_guesses_from_parent(self, node: FuncDef) -> List[CallableType]:\n \"\"\"Try to get a guess of a method type from a parent class.\"\"\"\n if not node.info:\n return []\n\n for parent in node.info.mro[1:]:\n pnode = parent.names.get(node.name)\n if pnode and isinstance(pnode.node, (FuncDef, Decorator)):\n typ = get_proper_type(pnode.node.type)\n # FIXME: Doesn't work right with generic tyeps\n if isinstance(typ, CallableType) and len(typ.arg_types) == len(node.arguments):\n # Return the first thing we find, since it probably doesn't make sense\n # to grab things further up in the chain if an earlier parent has it.\n return [typ]\n\n return []", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.get_suggestion_SuggestionEngine.get_suggestion.return.self_pyannotate_signature": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.get_suggestion_SuggestionEngine.get_suggestion.return.self_pyannotate_signature", "embedding": null, "metadata": {"file_path": "mypy/suggestions.py", "file_name": "suggestions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 428, "end_line": 470, "span_ids": ["SuggestionEngine.get_suggestion"], "tokens": 368}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SuggestionEngine:\n\n def get_suggestion(self, mod: str, node: FuncDef) -> PyAnnotateSignature:\n \"\"\"Compute a suggestion for a function.\n\n Return the type and whether the first argument should be ignored.\n \"\"\"\n graph = self.graph\n callsites, orig_errors = self.get_callsites(node)\n uses = get_arg_uses(self.manager.all_types, node)\n\n if self.no_errors and orig_errors:\n raise SuggestionFailure(\"Function does not typecheck.\")\n\n is_method = bool(node.info) and not node.is_static\n\n with strict_optional_set(graph[mod].options.strict_optional):\n guesses = self.get_guesses(\n is_method,\n self.get_starting_type(node),\n self.get_default_arg_types(graph[mod], node),\n callsites,\n uses,\n )\n guesses += self.get_guesses_from_parent(node)\n guesses = self.filter_options(guesses, is_method, ignore_return=True)\n best, _ = self.find_best(node, guesses)\n\n # Now try to find the return type!\n self.try_type(node, best)\n returns = get_return_types(self.manager.all_types, node)\n with strict_optional_set(graph[mod].options.strict_optional):\n if returns:\n ret_types = generate_type_combinations(returns)\n else:\n ret_types = [NoneType()]\n\n guesses = [best.copy_modified(ret_type=refine_type(best.ret_type, t)) for t in ret_types]\n guesses = self.filter_options(guesses, is_method, ignore_return=False)\n best, errors = self.find_best(node, guesses)\n\n if self.no_errors and errors:\n raise SuggestionFailure(\"No annotation without errors\")\n\n return self.pyannotate_signature(mod, is_method, best)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.format_args_SuggestionEngine.format_args.return._s_join_args_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.format_args_SuggestionEngine.format_args.return._s_join_args_", "embedding": null, "metadata": {"file_path": "mypy/suggestions.py", "file_name": "suggestions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 472, "end_line": 488, "span_ids": ["SuggestionEngine.format_args"], "tokens": 175}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SuggestionEngine:\n\n def format_args(self,\n arg_kinds: List[List[int]],\n arg_names: List[List[Optional[str]]],\n arg_types: List[List[Type]]) -> str:\n args = [] # type: List[str]\n for i in range(len(arg_types)):\n for kind, name, typ in zip(arg_kinds[i], arg_names[i], arg_types[i]):\n arg = self.format_type(None, typ)\n if kind == ARG_STAR:\n arg = '*' + arg\n elif kind == ARG_STAR2:\n arg = '**' + arg\n elif kind in (ARG_NAMED, ARG_NAMED_OPT):\n if name:\n arg = \"%s=%s\" % (name, arg)\n args.append(arg)\n return \"(%s)\" % (\", \".join(args))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.find_node_SuggestionEngine.find_node.return.modname_tail_node": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.find_node_SuggestionEngine.find_node.return.modname_tail_node", "embedding": null, "metadata": {"file_path": "mypy/suggestions.py", "file_name": "suggestions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 490, "end_line": 526, "span_ids": ["SuggestionEngine.find_node"], "tokens": 397}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SuggestionEngine:\n\n def find_node(self, key: str) -> Tuple[str, str, FuncDef]:\n \"\"\"From a target name, return module/target names and the func def.\n\n The 'key' argument can be in one of two formats:\n * As the function full name, e.g., package.module.Cls.method\n * As the function location as file and line separated by column,\n e.g., path/to/file.py:42\n \"\"\"\n # TODO: Also return OverloadedFuncDef -- currently these are ignored.\n node = None # type: Optional[SymbolNode]\n if ':' in key:\n if key.count(':') > 1:\n raise SuggestionFailure(\n 'Malformed location for function: {}. Must be either'\n ' package.module.Class.method or path/to/file.py:line'.format(key))\n file, line = key.split(':')\n if not line.isdigit():\n raise SuggestionFailure('Line number must be a number. Got {}'.format(line))\n line_number = int(line)\n modname, node = self.find_node_by_file_and_line(file, line_number)\n tail = node.fullname[len(modname) + 1:] # add one to account for '.'\n else:\n target = split_target(self.fgmanager.graph, key)\n if not target:\n raise SuggestionFailure(\"Cannot find module for %s\" % (key,))\n modname, tail = target\n node = self.find_node_by_module_and_name(modname, tail)\n\n if isinstance(node, Decorator):\n node = self.extract_from_decorator(node)\n if not node:\n raise SuggestionFailure(\"Object %s is a decorator we can't handle\" % key)\n\n if not isinstance(node, FuncDef):\n raise SuggestionFailure(\"Object %s is not a function\" % key)\n\n return modname, tail, node", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.find_node_by_module_and_name_SuggestionEngine.find_node_by_module_and_name.return.names_funcname_node": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.find_node_by_module_and_name_SuggestionEngine.find_node_by_module_and_name.return.names_funcname_node", "embedding": null, "metadata": {"file_path": "mypy/suggestions.py", "file_name": "suggestions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 528, "end_line": 558, "span_ids": ["SuggestionEngine.find_node_by_module_and_name"], "tokens": 303}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SuggestionEngine:\n\n def find_node_by_module_and_name(self, modname: str, tail: str) -> Optional[SymbolNode]:\n \"\"\"Find symbol node by module id and qualified name.\n\n Raise SuggestionFailure if can't find one.\n \"\"\"\n tree = self.ensure_loaded(self.fgmanager.graph[modname])\n\n # N.B. This is reimplemented from update's lookup_target\n # basically just to produce better error messages.\n\n names = tree.names # type: SymbolTable\n\n # Look through any classes\n components = tail.split('.')\n for i, component in enumerate(components[:-1]):\n if component not in names:\n raise SuggestionFailure(\"Unknown class %s.%s\" %\n (modname, '.'.join(components[:i + 1])))\n node = names[component].node # type: Optional[SymbolNode]\n if not isinstance(node, TypeInfo):\n raise SuggestionFailure(\"Object %s.%s is not a class\" %\n (modname, '.'.join(components[:i + 1])))\n names = node.names\n\n # Look for the actual function/method\n funcname = components[-1]\n if funcname not in names:\n key = modname + '.' + tail\n raise SuggestionFailure(\"Unknown %s %s\" %\n (\"method\" if len(components) > 1 else \"function\", key))\n return names[funcname].node", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.find_node_by_file_and_line_SuggestionEngine.find_node_by_file_and_line.return.modname_node": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.find_node_by_file_and_line_SuggestionEngine.find_node_by_file_and_line.return.modname_node", "embedding": null, "metadata": {"file_path": "mypy/suggestions.py", "file_name": "suggestions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 560, "end_line": 593, "span_ids": ["SuggestionEngine.find_node_by_file_and_line"], "tokens": 369}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SuggestionEngine:\n\n def find_node_by_file_and_line(self, file: str, line: int) -> Tuple[str, SymbolNode]:\n \"\"\"Find symbol node by path to file and line number.\n\n Find the first function declared *before or on* the line number.\n\n Return module id and the node found. Raise SuggestionFailure if can't find one.\n \"\"\"\n if not any(file.endswith(ext) for ext in PYTHON_EXTENSIONS):\n raise SuggestionFailure('Source file is not a Python file')\n try:\n modname, _ = self.finder.crawl_up(os.path.normpath(file))\n except InvalidSourceList as e:\n raise SuggestionFailure('Invalid source file name: ' + file) from e\n if modname not in self.graph:\n raise SuggestionFailure('Unknown module: ' + modname)\n # We must be sure about any edits in this file as this might affect the line numbers.\n tree = self.ensure_loaded(self.fgmanager.graph[modname], force=True)\n node = None # type: Optional[SymbolNode]\n closest_line = None # type: Optional[int]\n # TODO: Handle nested functions.\n for _, sym, _ in tree.local_definitions():\n if isinstance(sym.node, (FuncDef, Decorator)):\n sym_line = sym.node.line\n # TODO: add support for OverloadedFuncDef.\n else:\n continue\n\n # We want the closest function above the specified line\n if sym_line <= line and (closest_line is None or sym_line > closest_line):\n closest_line = sym_line\n node = sym.node\n if not node:\n raise SuggestionFailure('Cannot find a function at line {}'.format(line))\n return modname, node", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.extract_from_decorator_SuggestionEngine.extract_from_decorator.return.node_func": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.extract_from_decorator_SuggestionEngine.extract_from_decorator.return.node_func", "embedding": null, "metadata": {"file_path": "mypy/suggestions.py", "file_name": "suggestions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 595, "end_line": 615, "span_ids": ["SuggestionEngine.extract_from_decorator"], "tokens": 186}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SuggestionEngine:\n\n def extract_from_decorator(self, node: Decorator) -> Optional[FuncDef]:\n for dec in node.decorators:\n typ = None\n if (isinstance(dec, RefExpr)\n and isinstance(dec.node, FuncDef)):\n typ = dec.node.type\n elif (isinstance(dec, CallExpr)\n and isinstance(dec.callee, RefExpr)\n and isinstance(dec.callee.node, FuncDef)\n and isinstance(dec.callee.node.type, CallableType)):\n typ = get_proper_type(dec.callee.node.type.ret_type)\n\n if not isinstance(typ, FunctionLike):\n return None\n for ct in typ.items():\n if not (len(ct.arg_types) == 1\n and isinstance(ct.arg_types[0], TypeVarType)\n and ct.arg_types[0] == ct.ret_type):\n return None\n\n return node.func", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.try_type_SuggestionEngine.try_type.try_.finally_.func.unanalyzed_type.old": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.try_type_SuggestionEngine.try_type.try_.finally_.func.unanalyzed_type.old", "embedding": null, "metadata": {"file_path": "mypy/suggestions.py", "file_name": "suggestions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 617, "end_line": 635, "span_ids": ["SuggestionEngine.try_type"], "tokens": 164}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SuggestionEngine:\n\n def try_type(self, func: FuncDef, typ: ProperType) -> List[str]:\n \"\"\"Recheck a function while assuming it has type typ.\n\n Return all error messages.\n \"\"\"\n old = func.unanalyzed_type\n # During reprocessing, unanalyzed_type gets copied to type (by aststrip).\n # We set type to None to ensure that the type always changes during\n # reprocessing.\n func.type = None\n func.unanalyzed_type = typ\n try:\n res = self.fgmanager.trigger(func.fullname)\n # if res:\n # print('===', typ)\n # print('\\n'.join(res))\n return res\n finally:\n func.unanalyzed_type = old", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.reload_SuggestionEngine.builtin_type.return.self_manager_semantic_ana": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.reload_SuggestionEngine.builtin_type.return.self_manager_semantic_ana", "embedding": null, "metadata": {"file_path": "mypy/suggestions.py", "file_name": "suggestions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 637, "end_line": 654, "span_ids": ["SuggestionEngine.reload", "SuggestionEngine.builtin_type", "SuggestionEngine.ensure_loaded"], "tokens": 176}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SuggestionEngine:\n\n def reload(self, state: State, check_errors: bool = False) -> List[str]:\n \"\"\"Recheck the module given by state.\n\n If check_errors is true, raise an exception if there are errors.\n \"\"\"\n assert state.path is not None\n self.fgmanager.flush_cache()\n return self.fgmanager.update([(state.id, state.path)], [])\n\n def ensure_loaded(self, state: State, force: bool = False) -> MypyFile:\n \"\"\"Make sure that the module represented by state is fully loaded.\"\"\"\n if not state.tree or state.tree.is_cache_skeleton or force:\n self.reload(state)\n assert state.tree is not None\n return state.tree\n\n def builtin_type(self, s: str) -> Instance:\n return self.manager.semantic_analyzer.builtin_type(s)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.json_suggestion_SuggestionEngine.json_suggestion.return.json_dumps_obj_sort_ke": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.json_suggestion_SuggestionEngine.json_suggestion.return.json_dumps_obj_sort_ke", "embedding": null, "metadata": {"file_path": "mypy/suggestions.py", "file_name": "suggestions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 655, "end_line": 674, "span_ids": ["SuggestionEngine.json_suggestion"], "tokens": 192}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SuggestionEngine:\n\n def json_suggestion(self, mod: str, func_name: str, node: FuncDef,\n suggestion: PyAnnotateSignature) -> str:\n \"\"\"Produce a json blob for a suggestion suitable for application by pyannotate.\"\"\"\n # pyannotate irritatingly drops class names for class and static methods\n if node.is_class or node.is_static:\n func_name = func_name.split('.', 1)[-1]\n\n # pyannotate works with either paths relative to where the\n # module is rooted or with absolute paths. We produce absolute\n # paths because it is simpler.\n path = os.path.abspath(self.graph[mod].xpath)\n\n obj = {\n 'signature': suggestion,\n 'line': node.line,\n 'path': path,\n 'func_name': func_name,\n 'samples': 0\n }\n return json.dumps([obj], sort_keys=True)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.pyannotate_signature_SuggestionEngine.format_type.return.typ_accept_TypeFormatter_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.pyannotate_signature_SuggestionEngine.format_type.return.typ_accept_TypeFormatter_", "embedding": null, "metadata": {"file_path": "mypy/suggestions.py", "file_name": "suggestions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 676, "end_line": 699, "span_ids": ["SuggestionEngine.format_signature", "SuggestionEngine.format_type", "SuggestionEngine.pyannotate_signature"], "tokens": 219}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SuggestionEngine:\n\n def pyannotate_signature(\n self,\n cur_module: Optional[str],\n is_method: bool,\n typ: CallableType\n ) -> PyAnnotateSignature:\n \"\"\"Format a callable type as a pyannotate dict\"\"\"\n start = int(is_method)\n return {\n 'arg_types': [self.format_type(cur_module, t) for t in typ.arg_types[start:]],\n 'return_type': self.format_type(cur_module, typ.ret_type),\n }\n\n def format_signature(self, sig: PyAnnotateSignature) -> str:\n \"\"\"Format a callable type in a way suitable as an annotation... kind of\"\"\"\n return \"({}) -> {}\".format(\n \", \".join(sig['arg_types']),\n sig['return_type']\n )\n\n def format_type(self, cur_module: Optional[str], typ: Type) -> str:\n if self.use_fixme and isinstance(get_proper_type(typ), AnyType):\n return self.use_fixme\n return typ.accept(TypeFormatter(cur_module, self.graph))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.score_type_SuggestionEngine.score_callable.return._sum_self_score_type_x_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_SuggestionEngine.score_type_SuggestionEngine.score_callable.return._sum_self_score_type_x_", "embedding": null, "metadata": {"file_path": "mypy/suggestions.py", "file_name": "suggestions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 701, "end_line": 726, "span_ids": ["SuggestionEngine.score_type", "SuggestionEngine.score_callable"], "tokens": 271}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SuggestionEngine:\n\n def score_type(self, t: Type, arg_pos: bool) -> int:\n \"\"\"Generate a score for a type that we use to pick which type to use.\n\n Lower is better, prefer non-union/non-any types. Don't penalize optionals.\n \"\"\"\n t = get_proper_type(t)\n if isinstance(t, AnyType):\n return 20\n if arg_pos and isinstance(t, NoneType):\n return 20\n if isinstance(t, UnionType):\n if any(isinstance(get_proper_type(x), AnyType) for x in t.items):\n return 20\n if any(has_any_type(x) for x in t.items):\n return 15\n if not is_optional(t):\n return 10\n if isinstance(t, CallableType) and (has_any_type(t) or is_tricky_callable(t)):\n return 10\n if self.try_text and isinstance(t, Instance) and t.type.fullname == 'builtins.str':\n return 1\n return 0\n\n def score_callable(self, t: CallableType) -> int:\n return (sum([self.score_type(x, arg_pos=True) for x in t.arg_types]) +\n self.score_type(t.ret_type, arg_pos=False))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_any_score_type_any_score_type.return.1_0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_any_score_type_any_score_type.return.1_0", "embedding": null, "metadata": {"file_path": "mypy/suggestions.py", "file_name": "suggestions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 729, "end_line": 749, "span_ids": ["any_score_type"], "tokens": 200}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def any_score_type(ut: Type, arg_pos: bool) -> float:\n \"\"\"Generate a very made up number representing the Anyness of a type.\n\n Higher is better, 1.0 is max\n \"\"\"\n t = get_proper_type(ut)\n if isinstance(t, AnyType) and t.type_of_any != TypeOfAny.suggestion_engine:\n return 0\n if isinstance(t, NoneType) and arg_pos:\n return 0.5\n if isinstance(t, UnionType):\n if any(isinstance(get_proper_type(x), AnyType) for x in t.items):\n return 0.5\n if any(has_any_type(x) for x in t.items):\n return 0.25\n if isinstance(t, CallableType) and is_tricky_callable(t):\n return 0.5\n if has_any_type(t):\n return 0.5\n\n return 1.0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_any_score_callable_is_tricky_callable.return.t_is_ellipsis_args_or_any": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_any_score_callable_is_tricky_callable.return.t_is_ellipsis_args_or_any", "embedding": null, "metadata": {"file_path": "mypy/suggestions.py", "file_name": "suggestions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 752, "end_line": 768, "span_ids": ["any_score_callable", "is_tricky_callable"], "tokens": 230}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def any_score_callable(t: CallableType, is_method: bool, ignore_return: bool) -> float:\n # Ignore the first argument of methods\n scores = [any_score_type(x, arg_pos=True) for x in t.arg_types[int(is_method):]]\n # Return type counts twice (since it spreads type information), unless it is\n # None in which case it does not count at all. (Though it *does* still count\n # if there are no arguments.)\n if not isinstance(get_proper_type(t.ret_type), NoneType) or not scores:\n ret = 1.0 if ignore_return else any_score_type(t.ret_type, arg_pos=False)\n scores += [ret, ret]\n\n return sum(scores) / len(scores)\n\n\ndef is_tricky_callable(t: CallableType) -> bool:\n \"\"\"Is t a callable that we need to put a ... in for syntax reasons?\"\"\"\n return t.is_ellipsis_args or any(\n k in (ARG_STAR, ARG_STAR2, ARG_NAMED, ARG_NAMED_OPT) for k in t.arg_kinds)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_TypeFormatter_TypeFormatter.visit_instance.if_mod_obj_builtins_.else_.return.mod_delim_obj": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_TypeFormatter_TypeFormatter.visit_instance.if_mod_obj_builtins_.else_.return.mod_delim_obj", "embedding": null, "metadata": {"file_path": "mypy/suggestions.py", "file_name": "suggestions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 771, "end_line": 817, "span_ids": ["TypeFormatter", "TypeFormatter.__init__", "TypeFormatter.visit_instance", "TypeFormatter.visit_any"], "tokens": 386}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeFormatter(TypeStrVisitor):\n \"\"\"Visitor used to format types\n \"\"\"\n # TODO: Probably a lot\n def __init__(self, module: Optional[str], graph: Graph) -> None:\n super().__init__()\n self.module = module\n self.graph = graph\n\n def visit_any(self, t: AnyType) -> str:\n if t.missing_import_name:\n return t.missing_import_name\n else:\n return \"Any\"\n\n def visit_instance(self, t: Instance) -> str:\n s = t.type.fullname or t.type.name or None\n if s is None:\n return ''\n if s in reverse_builtin_aliases:\n s = reverse_builtin_aliases[s]\n\n mod_obj = split_target(self.graph, s)\n assert mod_obj\n mod, obj = mod_obj\n\n # If a class is imported into the current module, rewrite the reference\n # to point to the current module. This helps the annotation tool avoid\n # inserting redundant imports when a type has been reexported.\n if self.module:\n parts = obj.split('.') # need to split the object part if it is a nested class\n tree = self.graph[self.module].tree\n if tree and parts[0] in tree.names:\n mod = self.module\n\n if (mod, obj) == ('builtins', 'tuple'):\n mod, obj = 'typing', 'Tuple[' + t.args[0].accept(self) + ', ...]'\n elif t.args:\n obj += '[{}]'.format(self.list_str(t.args))\n\n if mod_obj == ('builtins', 'unicode'):\n return 'Text'\n elif mod == 'builtins':\n return obj\n else:\n delim = '.' if '.' not in obj else ':'\n return mod + delim + obj", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_TypeFormatter.visit_tuple_type_TypeFormatter.visit_union_type.if_len_t_items_2_and_.else_.return.super_visit_union_type_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_TypeFormatter.visit_tuple_type_TypeFormatter.visit_union_type.if_len_t_items_2_and_.else_.return.super_visit_union_type_", "embedding": null, "metadata": {"file_path": "mypy/suggestions.py", "file_name": "suggestions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 819, "end_line": 837, "span_ids": ["TypeFormatter.visit_uninhabited_type", "TypeFormatter.visit_typeddict_type", "TypeFormatter.visit_union_type", "TypeFormatter.visit_tuple_type"], "tokens": 194}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeFormatter(TypeStrVisitor):\n\n def visit_tuple_type(self, t: TupleType) -> str:\n if t.partial_fallback and t.partial_fallback.type:\n fallback_name = t.partial_fallback.type.fullname\n if fallback_name != 'builtins.tuple':\n return t.partial_fallback.accept(self)\n s = self.list_str(t.items)\n return 'Tuple[{}]'.format(s)\n\n def visit_uninhabited_type(self, t: UninhabitedType) -> str:\n return \"Any\"\n\n def visit_typeddict_type(self, t: TypedDictType) -> str:\n return t.fallback.accept(self)\n\n def visit_union_type(self, t: UnionType) -> str:\n if len(t.items) == 2 and is_optional(t):\n return \"Optional[{}]\".format(remove_optional(t).accept(self))\n else:\n return super().visit_union_type(t)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_TypeFormatter.visit_callable_type_TypeFormatter.visit_callable_type.return._Callable_format": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_TypeFormatter.visit_callable_type_TypeFormatter.visit_callable_type.return._Callable_format", "embedding": null, "metadata": {"file_path": "mypy/suggestions.py", "file_name": "suggestions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 839, "end_line": 851, "span_ids": ["TypeFormatter.visit_callable_type"], "tokens": 149}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeFormatter(TypeStrVisitor):\n\n def visit_callable_type(self, t: CallableType) -> str:\n # TODO: use extended callables?\n if is_tricky_callable(t):\n arg_str = \"...\"\n else:\n # Note: for default arguments, we just assume that they\n # are required. This isn't right, but neither is the\n # other thing, and I suspect this will produce more better\n # results than falling back to `...`\n args = [typ.accept(self) for typ in t.arg_types]\n arg_str = \"[{}]\".format(\", \".join(args))\n\n return \"Callable[{}, {}]\".format(arg_str, t.ret_type.accept(self))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_StrToText_StrToText.visit_instance.if_t_type_fullname_bu.else_.return.super_visit_instance_t_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_StrToText_StrToText.visit_instance.if_t_type_fullname_bu.else_.return.super_visit_instance_t_", "embedding": null, "metadata": {"file_path": "mypy/suggestions.py", "file_name": "suggestions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 854, "end_line": 868, "span_ids": ["StrToText.visit_instance", "StrToText", "StrToText.visit_type_alias_type", "StrToText.__init__"], "tokens": 151}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StrToText(TypeTranslator):\n def __init__(self, builtin_type: Callable[[str], Instance]) -> None:\n self.text_type = builtin_type('builtins.unicode')\n\n def visit_type_alias_type(self, t: TypeAliasType) -> Type:\n exp_t = get_proper_type(t)\n if isinstance(exp_t, Instance) and exp_t.type.fullname == 'builtins.str':\n return self.text_type\n return t.copy_modified(args=[a.accept(self) for a in t.args])\n\n def visit_instance(self, t: Instance) -> Type:\n if t.type.fullname == 'builtins.str':\n return self.text_type\n else:\n return super().visit_instance(t)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_TType_count_errors.return.len_x_for_x_in_msgs_if_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_TType_count_errors.return.len_x_for_x_in_msgs_if_", "embedding": null, "metadata": {"file_path": "mypy/suggestions.py", "file_name": "suggestions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 871, "end_line": 909, "span_ids": ["MakeSuggestionAny", "MakeSuggestionAny.visit_any", "count_errors", "make_suggestion_anys", "MakeSuggestionAny.visit_type_alias_type", "impl:5", "generate_type_combinations"], "tokens": 305}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "TType = TypeVar('TType', bound=Type)\n\n\ndef make_suggestion_anys(t: TType) -> TType:\n \"\"\"Make all anys in the type as coming from the suggestion engine.\n\n This keeps those Anys from influencing constraint generation,\n which allows us to do better when refining types.\n \"\"\"\n return cast(TType, t.accept(MakeSuggestionAny()))\n\n\nclass MakeSuggestionAny(TypeTranslator):\n def visit_any(self, t: AnyType) -> Type:\n if not t.missing_import_name:\n return t.copy_modified(type_of_any=TypeOfAny.suggestion_engine)\n else:\n return t\n\n def visit_type_alias_type(self, t: TypeAliasType) -> Type:\n return t.copy_modified(args=[a.accept(self) for a in t.args])\n\n\ndef generate_type_combinations(types: List[Type]) -> List[Type]:\n \"\"\"Generate possible combinations of a list of types.\n\n mypy essentially supports two different ways to do this: joining the types\n and unioning the types. We try both.\n \"\"\"\n joined_type = join_type_list(types)\n union_type = make_simplified_union(types)\n if is_same_type(joined_type, union_type):\n return [joined_type]\n else:\n return [joined_type, union_type]\n\n\ndef count_errors(msgs: List[str]) -> int:\n return len([x for x in msgs if ' error: ' in x])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_refine_type_refine_type.return.t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_refine_type_refine_type.return.t", "embedding": null, "metadata": {"file_path": "mypy/suggestions.py", "file_name": "suggestions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 912, "end_line": 962, "span_ids": ["refine_type"], "tokens": 513}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def refine_type(ti: Type, si: Type) -> Type:\n \"\"\"Refine `ti` by replacing Anys in it with information taken from `si`\n\n This basically works by, when the types have the same structure,\n traversing both of them in parallel and replacing Any on the left\n with whatever the type on the right is. If the types don't have the\n same structure (or aren't supported), the left type is chosen.\n\n For example:\n refine(Any, T) = T, for all T\n refine(float, int) = float\n refine(List[Any], List[int]) = List[int]\n refine(Dict[int, Any], Dict[Any, int]) = Dict[int, int]\n refine(Tuple[int, Any], Tuple[Any, int]) = Tuple[int, int]\n\n refine(Callable[[Any], Any], Callable[[int], int]) = Callable[[int], int]\n refine(Callable[..., int], Callable[[int, float], Any]) = Callable[[int, float], int]\n\n refine(Optional[Any], int) = Optional[int]\n refine(Optional[Any], Optional[int]) = Optional[int]\n refine(Optional[Any], Union[int, str]) = Optional[Union[int, str]]\n refine(Optional[List[Any]], List[int]) = List[int]\n\n \"\"\"\n t = get_proper_type(ti)\n s = get_proper_type(si)\n\n if isinstance(t, AnyType):\n # If s is also an Any, we return if it is a missing_import Any\n return t if isinstance(s, AnyType) and t.missing_import_name else s\n\n if isinstance(t, Instance) and isinstance(s, Instance) and t.type == s.type:\n return t.copy_modified(args=[refine_type(ta, sa) for ta, sa in zip(t.args, s.args)])\n\n if (\n isinstance(t, TupleType)\n and isinstance(s, TupleType)\n and t.partial_fallback == s.partial_fallback\n and len(t.items) == len(s.items)\n ):\n return t.copy_modified(items=[refine_type(ta, sa) for ta, sa in zip(t.items, s.items)])\n\n if isinstance(t, CallableType) and isinstance(s, CallableType):\n return refine_callable(t, s)\n\n if isinstance(t, UnionType):\n return refine_union(t, s)\n\n # TODO: Refining of builtins.tuple, Type?\n\n return t", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_refine_union_refine_union.with_strict_optional_set_.return.make_simplified_union_new": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_refine_union_refine_union.with_strict_optional_set_.return.make_simplified_union_new", "embedding": null, "metadata": {"file_path": "mypy/suggestions.py", "file_name": "suggestions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 965, "end_line": 995, "span_ids": ["refine_union"], "tokens": 255}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def refine_union(t: UnionType, s: ProperType) -> Type:\n \"\"\"Refine a union type based on another type.\n\n This is done by refining every component of the union against the\n right hand side type (or every component of its union if it is\n one). If an element of the union is successfully refined, we drop it\n from the union in favor of the refined versions.\n \"\"\"\n # Don't try to do any union refining if the types are already the\n # same. This prevents things like refining Optional[Any] against\n # itself and producing None.\n if t == s:\n return t\n\n rhs_items = s.items if isinstance(s, UnionType) else [s]\n\n new_items = []\n for lhs in t.items:\n refined = False\n for rhs in rhs_items:\n new = refine_type(lhs, rhs)\n if new != lhs:\n new_items.append(new)\n refined = True\n if not refined:\n new_items.append(lhs)\n\n # Turn strict optional on when simplifying the union since we\n # don't want to drop Nones.\n with strict_optional_set(True):\n return make_simplified_union(new_items)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_refine_callable_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/suggestions.py_refine_callable_", "embedding": null, "metadata": {"file_path": "mypy/suggestions.py", "file_name": "suggestions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 998, "end_line": 1027, "span_ids": ["refine_callable", "dedup", "impl:7"], "tokens": 207}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def refine_callable(t: CallableType, s: CallableType) -> CallableType:\n \"\"\"Refine a callable based on another.\n\n See comments for refine_type.\n \"\"\"\n if t.fallback != s.fallback:\n return t\n\n if t.is_ellipsis_args and not is_tricky_callable(s):\n return s.copy_modified(ret_type=refine_type(t.ret_type, s.ret_type))\n\n if is_tricky_callable(t) or t.arg_kinds != s.arg_kinds:\n return t\n\n return t.copy_modified(\n arg_types=[refine_type(ta, sa) for ta, sa in zip(t.arg_types, s.arg_types)],\n ret_type=refine_type(t.ret_type, s.ret_type),\n )\n\n\nT = TypeVar('T')\n\n\ndef dedup(old: List[T]) -> List[T]:\n new = [] # type: List[T]\n for x in old:\n if x not in new:\n new.append(x)\n return new", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/config.py_os.path_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/config.py_os.path_", "embedding": null, "metadata": {"file_path": "mypy/test/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 21, "span_ids": ["imports"], "tokens": 184}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os.path\n\nprovided_prefix = os.getenv('MYPY_TEST_PREFIX', None)\nif provided_prefix:\n PREFIX = provided_prefix\nelse:\n this_file_dir = os.path.dirname(os.path.realpath(__file__))\n PREFIX = os.path.dirname(os.path.dirname(this_file_dir))\n\n# Location of test data files such as test case descriptions.\ntest_data_prefix = os.path.join(PREFIX, 'test-data', 'unit')\npackage_path = os.path.join(PREFIX, 'test-data', 'packages')\n\nassert os.path.isdir(test_data_prefix), \\\n 'Test data prefix ({}) not set correctly'.format(test_data_prefix)\n\n# Temp directory used for the temp files created when running test cases.\n# This is *within* the tempfile.TemporaryDirectory that is chroot'ed per testcase.\n# It is also hard-coded in numerous places, so don't change it.\ntest_temp_dir = 'tmp'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py__Utilities_for_processi_FileOperation.Union_UpdateFile_DeleteF": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py__Utilities_for_processi_FileOperation.Union_UpdateFile_DeleteF", "embedding": null, "metadata": {"file_path": "mypy/test/data.py", "file_name": "data.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 28, "span_ids": ["docstring"], "tokens": 173}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Utilities for processing .test files containing test case descriptions.\"\"\"\n\nimport os.path\nimport os\nimport tempfile\nimport posixpath\nimport re\nimport shutil\nfrom abc import abstractmethod\nimport sys\n\nimport pytest\nfrom typing import List, Tuple, Set, Optional, Iterator, Any, Dict, NamedTuple, Union\n\nfrom mypy.test.config import test_data_prefix, test_temp_dir, PREFIX\n\nroot_dir = os.path.normpath(PREFIX)\n\n# File modify/create operation: copy module contents from source_path.\nUpdateFile = NamedTuple('UpdateFile', [('module', str),\n ('source_path', str),\n ('target_path', str)])\n\n# File delete operation: delete module file.\nDeleteFile = NamedTuple('DeleteFile', [('module', str),\n ('path', str)])\n\nFileOperation = Union[UpdateFile, DeleteFile]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_parse_test_case_parse_test_case.item.first_item.test_items_0_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_parse_test_case_parse_test_case.item.first_item.test_items_0_", "embedding": null, "metadata": {"file_path": "mypy/test/data.py", "file_name": "data.py", "file_type": "text/x-python", "category": "test", "start_line": 31, "end_line": 58, "span_ids": ["parse_test_case"], "tokens": 366}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def parse_test_case(case: 'DataDrivenTestCase') -> None:\n \"\"\"Parse and prepare a single case from suite with test case descriptions.\n\n This method is part of the setup phase, just before the test case is run.\n \"\"\"\n test_items = parse_test_data(case.data, case.name)\n base_path = case.suite.base_path\n if case.suite.native_sep:\n join = os.path.join\n else:\n join = posixpath.join\n\n out_section_missing = case.suite.required_out_section\n normalize_output = True\n\n files = [] # type: List[Tuple[str, str]] # path and contents\n output_files = [] # type: List[Tuple[str, str]] # path and contents for output files\n output = [] # type: List[str] # Regular output errors\n output2 = {} # type: Dict[int, List[str]] # Output errors for incremental, runs 2+\n deleted_paths = {} # type: Dict[int, Set[str]] # from run number of paths\n stale_modules = {} # type: Dict[int, Set[str]] # from run number to module names\n rechecked_modules = {} # type: Dict[ int, Set[str]] # from run number module names\n triggered = [] # type: List[str] # Active triggers (one line per incremental step)\n targets = {} # type: Dict[int, List[str]] # Fine-grained targets (per fine-grained update)\n\n # Process the parsed items. Each item has a header of form [id args],\n # optionally followed by lines of text.\n item = first_item = test_items[0]\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_parse_test_case.for_item_in_test_items_1__parse_test_case.for_item_in_test_items_1_.if_item_id_file_or_i.else_.raise_ValueError_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_parse_test_case.for_item_in_test_items_1__parse_test_case.for_item_in_test_items_1_.if_item_id_file_or_i.else_.raise_ValueError_", "embedding": null, "metadata": {"file_path": "mypy/test/data.py", "file_name": "data.py", "file_type": "text/x-python", "category": "test", "start_line": 59, "end_line": 149, "span_ids": ["parse_test_case"], "tokens": 1004}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def parse_test_case(case: 'DataDrivenTestCase') -> None:\n # ... other code\n for item in test_items[1:]:\n if item.id == 'file' or item.id == 'outfile':\n # Record an extra file needed for the test case.\n assert item.arg is not None\n contents = expand_variables('\\n'.join(item.data))\n file_entry = (join(base_path, item.arg), contents)\n if item.id == 'file':\n files.append(file_entry)\n else:\n output_files.append(file_entry)\n elif item.id in ('builtins', 'builtins_py2'):\n # Use an alternative stub file for the builtins module.\n assert item.arg is not None\n mpath = join(os.path.dirname(case.file), item.arg)\n fnam = 'builtins.pyi' if item.id == 'builtins' else '__builtin__.pyi'\n with open(mpath, encoding='utf8') as f:\n files.append((join(base_path, fnam), f.read()))\n elif item.id == 'typing':\n # Use an alternative stub file for the typing module.\n assert item.arg is not None\n src_path = join(os.path.dirname(case.file), item.arg)\n with open(src_path, encoding='utf8') as f:\n files.append((join(base_path, 'typing.pyi'), f.read()))\n elif re.match(r'stale[0-9]*$', item.id):\n passnum = 1 if item.id == 'stale' else int(item.id[len('stale'):])\n assert passnum > 0\n modules = (set() if item.arg is None else {t.strip() for t in item.arg.split(',')})\n stale_modules[passnum] = modules\n elif re.match(r'rechecked[0-9]*$', item.id):\n passnum = 1 if item.id == 'rechecked' else int(item.id[len('rechecked'):])\n assert passnum > 0\n modules = (set() if item.arg is None else {t.strip() for t in item.arg.split(',')})\n rechecked_modules[passnum] = modules\n elif re.match(r'targets[0-9]*$', item.id):\n passnum = 1 if item.id == 'targets' else int(item.id[len('targets'):])\n assert passnum > 0\n reprocessed = [] if item.arg is None else [t.strip() for t in item.arg.split(',')]\n targets[passnum] = reprocessed\n elif item.id == 'delete':\n # File/directory to delete during a multi-step test case\n assert item.arg is not None\n m = re.match(r'(.*)\\.([0-9]+)$', item.arg)\n assert m, 'Invalid delete section: {}'.format(item.arg)\n num = int(m.group(2))\n assert num >= 2, \"Can't delete during step {}\".format(num)\n full = join(base_path, m.group(1))\n deleted_paths.setdefault(num, set()).add(full)\n elif re.match(r'out[0-9]*$', item.id):\n if item.arg is None:\n args = []\n else:\n args = item.arg.split(\",\")\n\n version_check = True\n for arg in args:\n if arg == 'skip-path-normalization':\n normalize_output = False\n if arg.startswith(\"version\"):\n if arg[7:9] != \">=\":\n raise ValueError(\n \"{}, line {}: Only >= version checks are currently supported\".format(\n case.file, item.line\n )\n )\n version_str = arg[9:]\n try:\n version = tuple(int(x) for x in version_str.split(\".\"))\n except ValueError:\n raise ValueError(\n '{}, line {}: \"{}\" is not a valid python version'.format(\n case.file, item.line, version_str))\n if not sys.version_info >= version:\n version_check = False\n\n if version_check:\n tmp_output = [expand_variables(line) for line in item.data]\n if os.path.sep == '\\\\' and normalize_output:\n tmp_output = [fix_win_path(line) for line in tmp_output]\n if item.id == 'out' or item.id == 'out1':\n output = tmp_output\n else:\n passnum = int(item.id[len('out'):])\n assert passnum > 1\n output2[passnum] = tmp_output\n out_section_missing = False\n elif item.id == 'triggered' and item.arg is None:\n triggered = item.data\n else:\n raise ValueError(\n 'Invalid section header {} in {} at line {}'.format(\n item.id, case.file, item.line))\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_parse_test_case.if_out_section_missing__parse_test_case.case.expected_fine_grained_targets.targets": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_parse_test_case.if_out_section_missing__parse_test_case.case.expected_fine_grained_targets.targets", "embedding": null, "metadata": {"file_path": "mypy/test/data.py", "file_name": "data.py", "file_type": "text/x-python", "category": "test", "start_line": 127, "end_line": 160, "span_ids": ["parse_test_case"], "tokens": 339}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def parse_test_case(case: 'DataDrivenTestCase') -> None:\n # ... other code\n\n if out_section_missing:\n raise ValueError(\n '{}, line {}: Required output section not found'.format(\n case.file, first_item.line))\n\n for passnum in stale_modules.keys():\n if passnum not in rechecked_modules:\n # If the set of rechecked modules isn't specified, make it the same as the set\n # of modules with a stale public interface.\n rechecked_modules[passnum] = stale_modules[passnum]\n if (passnum in stale_modules\n and passnum in rechecked_modules\n and not stale_modules[passnum].issubset(rechecked_modules[passnum])):\n raise ValueError(\n ('Stale modules after pass {} must be a subset of rechecked '\n 'modules ({}:{})').format(passnum, case.file, first_item.line))\n\n input = first_item.data\n expand_errors(input, output, 'main')\n for file_path, contents in files:\n expand_errors(contents.split('\\n'), output, file_path)\n\n case.input = input\n case.output = output\n case.output2 = output2\n case.last_line = case.line + item.line + len(item.data) - 2\n case.files = files\n case.output_files = output_files\n case.expected_stale_modules = stale_modules\n case.expected_rechecked_modules = rechecked_modules\n case.deleted_paths = deleted_paths\n case.triggered = triggered or []\n case.normalize_output = normalize_output\n case.expected_fine_grained_targets = targets", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_DataDrivenTestCase_DataDrivenTestCase.__init__._type_Optional_tempfile": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_DataDrivenTestCase_DataDrivenTestCase.__init__._type_Optional_tempfile", "embedding": null, "metadata": {"file_path": "mypy/test/data.py", "file_name": "data.py", "file_type": "text/x-python", "category": "test", "start_line": 163, "end_line": 216, "span_ids": ["DataDrivenTestCase", "DataDrivenTestCase.__init__"], "tokens": 520}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DataDrivenTestCase(pytest.Item):\n \"\"\"Holds parsed data-driven test cases, and handles directory setup and teardown.\"\"\"\n\n # Override parent member type\n parent = None # type: DataSuiteCollector\n\n input = None # type: List[str]\n output = None # type: List[str] # Output for the first pass\n output2 = None # type: Dict[int, List[str]] # Output for runs 2+, indexed by run number\n\n # full path of test suite\n file = ''\n line = 0\n\n # (file path, file content) tuples\n files = None # type: List[Tuple[str, str]]\n expected_stale_modules = None # type: Dict[int, Set[str]]\n expected_rechecked_modules = None # type: Dict[int, Set[str]]\n expected_fine_grained_targets = None # type: Dict[int, List[str]]\n\n # Whether or not we should normalize the output to standardize things like\n # forward vs backward slashes in file paths for Windows vs Linux.\n normalize_output = True\n\n # Extra attributes used by some tests.\n last_line = None # type: int\n output_files = None # type: List[Tuple[str, str]] # Path and contents for output files\n deleted_paths = None # type: Dict[int, Set[str]] # Mapping run number -> paths\n triggered = None # type: List[str] # Active triggers (one line per incremental step)\n\n def __init__(self,\n parent: 'DataSuiteCollector',\n suite: 'DataSuite',\n file: str,\n name: str,\n writescache: bool,\n only_when: str,\n platform: Optional[str],\n skip: bool,\n data: str,\n line: int) -> None:\n super().__init__(name, parent)\n self.suite = suite\n self.file = file\n self.writescache = writescache\n self.only_when = only_when\n if ((platform == 'windows' and sys.platform != 'win32')\n or (platform == 'posix' and sys.platform == 'win32')):\n skip = True\n self.skip = skip\n self.data = data\n self.line = line\n self.old_cwd = None # type: Optional[str]\n self.tmpdir = None # type: Optional[tempfile.TemporaryDirectory[str]]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_DataDrivenTestCase.runtest_DataDrivenTestCase.runtest.try_.except_Exception_.raise": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_DataDrivenTestCase.runtest_DataDrivenTestCase.runtest.try_.except_Exception_.raise", "embedding": null, "metadata": {"file_path": "mypy/test/data.py", "file_name": "data.py", "file_type": "text/x-python", "category": "test", "start_line": 218, "end_line": 236, "span_ids": ["DataDrivenTestCase.runtest"], "tokens": 186}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DataDrivenTestCase(pytest.Item):\n\n def runtest(self) -> None:\n if self.skip:\n pytest.skip()\n suite = self.parent.obj()\n suite.setup()\n try:\n suite.run_case(self)\n except Exception:\n # As a debugging aid, support copying the contents of the tmp directory somewhere\n save_dir = self.config.getoption('--save-failures-to', None) # type: Optional[str]\n if save_dir:\n assert self.tmpdir is not None\n target_dir = os.path.join(save_dir, os.path.basename(self.tmpdir.name))\n print(\"Copying data from test {} to {}\".format(self.name, target_dir))\n if not os.path.isabs(target_dir):\n assert self.old_cwd\n target_dir = os.path.join(self.old_cwd, target_dir)\n shutil.copytree(self.tmpdir.name, target_dir)\n raise", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_DataDrivenTestCase.setup_DataDrivenTestCase.reportinfo.return.self_file_self_line_sel": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_DataDrivenTestCase.setup_DataDrivenTestCase.reportinfo.return.self_file_self_line_sel", "embedding": null, "metadata": {"file_path": "mypy/test/data.py", "file_name": "data.py", "file_type": "text/x-python", "category": "test", "start_line": 238, "end_line": 262, "span_ids": ["DataDrivenTestCase.teardown", "DataDrivenTestCase.reportinfo", "DataDrivenTestCase.setup"], "tokens": 208}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DataDrivenTestCase(pytest.Item):\n\n def setup(self) -> None:\n parse_test_case(case=self)\n self.old_cwd = os.getcwd()\n self.tmpdir = tempfile.TemporaryDirectory(prefix='mypy-test-')\n os.chdir(self.tmpdir.name)\n os.mkdir(test_temp_dir)\n for path, content in self.files:\n dir = os.path.dirname(path)\n os.makedirs(dir, exist_ok=True)\n with open(path, 'w', encoding='utf8') as f:\n f.write(content)\n\n def teardown(self) -> None:\n assert self.old_cwd is not None and self.tmpdir is not None, \\\n \"test was not properly set up\"\n os.chdir(self.old_cwd)\n try:\n self.tmpdir.cleanup()\n except OSError:\n pass\n self.old_cwd = None\n self.tmpdir = None\n\n def reportinfo(self) -> Tuple[str, int, str]:\n return self.file, self.line, self.name", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_DataDrivenTestCase.repr_failure_DataDrivenTestCase.repr_failure.return._data_n_format": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_DataDrivenTestCase.repr_failure_DataDrivenTestCase.repr_failure.return._data_n_format", "embedding": null, "metadata": {"file_path": "mypy/test/data.py", "file_name": "data.py", "file_type": "text/x-python", "category": "test", "start_line": 264, "end_line": 275, "span_ids": ["DataDrivenTestCase.repr_failure"], "tokens": 164}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DataDrivenTestCase(pytest.Item):\n\n def repr_failure(self, excinfo: Any, style: Optional[Any] = None) -> str:\n if excinfo.errisinstance(SystemExit):\n # We assume that before doing exit() (which raises SystemExit) we've printed\n # enough context about what happened so that a stack trace is not useful.\n # In particular, uncaught exceptions during semantic analysis or type checking\n # call exit() and they already print out a stack trace.\n excrepr = excinfo.exconly()\n else:\n self.parent._prunetraceback(excinfo)\n excrepr = excinfo.getrepr(style='short')\n\n return \"data: {}:{}:\\n{}\".format(self.file, self.line, excrepr)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_DataDrivenTestCase.find_steps_DataDrivenTestCase.find_steps.return._steps_get_num_for_n": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_DataDrivenTestCase.find_steps_DataDrivenTestCase.find_steps.return._steps_get_num_for_n", "embedding": null, "metadata": {"file_path": "mypy/test/data.py", "file_name": "data.py", "file_type": "text/x-python", "category": "test", "start_line": 277, "end_line": 302, "span_ids": ["DataDrivenTestCase.find_steps"], "tokens": 286}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DataDrivenTestCase(pytest.Item):\n\n def find_steps(self) -> List[List[FileOperation]]:\n \"\"\"Return a list of descriptions of file operations for each incremental step.\n\n The first list item corresponds to the first incremental step, the second for the\n second step, etc. Each operation can either be a file modification/creation (UpdateFile)\n or deletion (DeleteFile).\n\n Defaults to having two steps if there aern't any operations.\n \"\"\"\n steps = {} # type: Dict[int, List[FileOperation]]\n for path, _ in self.files:\n m = re.match(r'.*\\.([0-9]+)$', path)\n if m:\n num = int(m.group(1))\n assert num >= 2\n target_path = re.sub(r'\\.[0-9]+$', '', path)\n module = module_from_path(target_path)\n operation = UpdateFile(module, path, target_path)\n steps.setdefault(num, []).append(operation)\n for num, paths in self.deleted_paths.items():\n assert num >= 2\n for path in paths:\n module = module_from_path(path)\n steps.setdefault(num, []).append(DeleteFile(module, path))\n max_step = max(steps) if steps else 2\n return [steps.get(num, []) for num in range(2, max_step + 1)]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_module_from_path_TestItem.__init__.self.line.line": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_module_from_path_TestItem.__init__.self.line.line", "embedding": null, "metadata": {"file_path": "mypy/test/data.py", "file_name": "data.py", "file_type": "text/x-python", "category": "test", "start_line": 305, "end_line": 338, "span_ids": ["TestItem", "module_from_path", "TestItem.__init__"], "tokens": 232}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def module_from_path(path: str) -> str:\n path = re.sub(r'\\.pyi?$', '', path)\n # We can have a mix of Unix-style and Windows-style separators.\n parts = re.split(r'[/\\\\]', path)\n assert parts[0] == test_temp_dir\n del parts[0]\n module = '.'.join(parts)\n module = re.sub(r'\\.__init__$', '', module)\n return module\n\n\nclass TestItem:\n \"\"\"Parsed test caseitem.\n\n An item is of the form\n [id arg]\n .. data ..\n \"\"\"\n\n id = ''\n arg = '' # type: Optional[str]\n\n # Text data, array of 8-bit strings\n data = None # type: List[str]\n\n file = ''\n line = 0 # Line number in file\n\n def __init__(self, id: str, arg: Optional[str], data: List[str],\n line: int) -> None:\n self.id = id\n self.arg = arg\n self.data = data\n self.line = line", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_parse_test_data_parse_test_data.return.ret": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_parse_test_data_parse_test_data.return.ret", "embedding": null, "metadata": {"file_path": "mypy/test/data.py", "file_name": "data.py", "file_type": "text/x-python", "category": "test", "start_line": 341, "end_line": 383, "span_ids": ["parse_test_data"], "tokens": 334}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def parse_test_data(raw_data: str, name: str) -> List[TestItem]:\n \"\"\"Parse a list of lines that represent a sequence of test items.\"\"\"\n\n lines = ['', '[case ' + name + ']'] + raw_data.split('\\n')\n ret = [] # type: List[TestItem]\n data = [] # type: List[str]\n\n id = None # type: Optional[str]\n arg = None # type: Optional[str]\n\n i = 0\n i0 = 0\n while i < len(lines):\n s = lines[i].strip()\n\n if lines[i].startswith('[') and s.endswith(']'):\n if id:\n data = collapse_line_continuation(data)\n data = strip_list(data)\n ret.append(TestItem(id, arg, strip_list(data), i0 + 1))\n\n i0 = i\n id = s[1:-1]\n arg = None\n if ' ' in id:\n arg = id[id.index(' ') + 1:]\n id = id[:id.index(' ')]\n data = []\n elif lines[i].startswith('\\\\['):\n data.append(lines[i][1:])\n elif not lines[i].startswith('--'):\n data.append(lines[i])\n elif lines[i].startswith('----'):\n data.append(lines[i][2:])\n i += 1\n\n # Process the last item.\n if id:\n data = collapse_line_continuation(data)\n data = strip_list(data)\n ret.append(TestItem(id, arg, data, i0 + 1))\n\n return ret", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_strip_list_expand_variables.return.s_replace_ROOT_root_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_strip_list_expand_variables.return.s_replace_ROOT_root_", "embedding": null, "metadata": {"file_path": "mypy/test/data.py", "file_name": "data.py", "file_type": "text/x-python", "category": "test", "start_line": 386, "end_line": 418, "span_ids": ["strip_list", "collapse_line_continuation", "expand_variables"], "tokens": 214}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def strip_list(l: List[str]) -> List[str]:\n \"\"\"Return a stripped copy of l.\n\n Strip whitespace at the end of all lines, and strip all empty\n lines from the end of the array.\n \"\"\"\n\n r = [] # type: List[str]\n for s in l:\n # Strip spaces at end of line\n r.append(re.sub(r'\\s+$', '', s))\n\n while len(r) > 0 and r[-1] == '':\n r.pop()\n\n return r\n\n\ndef collapse_line_continuation(l: List[str]) -> List[str]:\n r = [] # type: List[str]\n cont = False\n for s in l:\n ss = re.sub(r'\\\\$', '', s)\n if cont:\n r[-1] += re.sub('^ +', '', ss)\n else:\n r.append(ss)\n cont = s.endswith('\\\\')\n return r\n\n\ndef expand_variables(s: str) -> str:\n return s.replace('', root_dir)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_expand_errors_expand_errors.for_i_in_range_len_input_.for_possible_err_comment_.if_m_.if_col_is_None_.else_.output_append_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_expand_errors_expand_errors.for_i_in_range_len_input_.for_possible_err_comment_.if_m_.if_col_is_None_.else_.output_append_", "embedding": null, "metadata": {"file_path": "mypy/test/data.py", "file_name": "data.py", "file_type": "text/x-python", "category": "test", "start_line": 421, "end_line": 449, "span_ids": ["expand_errors"], "tokens": 282}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def expand_errors(input: List[str], output: List[str], fnam: str) -> None:\n \"\"\"Transform comments such as '# E: message' or\n '# E:3: message' in input.\n\n The result is lines like 'fnam:line: error: message'.\n \"\"\"\n\n for i in range(len(input)):\n # The first in the split things isn't a comment\n for possible_err_comment in input[i].split(' # ')[1:]:\n m = re.search(\n r'^([ENW]):((?P\\d+):)? (?P.*)$',\n possible_err_comment.strip())\n if m:\n if m.group(1) == 'E':\n severity = 'error'\n elif m.group(1) == 'N':\n severity = 'note'\n elif m.group(1) == 'W':\n severity = 'warning'\n col = m.group('col')\n message = m.group('message')\n message = message.replace('\\\\#', '#') # adds back escaped # character\n if col is None:\n output.append(\n '{}:{}: {}: {}'.format(fnam, i + 1, severity, message))\n else:\n output.append('{}:{}:{}: {}: {}'.format(\n fnam, i + 1, col, severity, message))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_fix_win_path_fix_win_path.if_not_m_.else_.return._format_filename": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_fix_win_path_fix_win_path.if_not_m_.else_.return._format_filename", "embedding": null, "metadata": {"file_path": "mypy/test/data.py", "file_name": "data.py", "file_type": "text/x-python", "category": "test", "start_line": 452, "end_line": 464, "span_ids": ["fix_win_path"], "tokens": 117}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def fix_win_path(line: str) -> str:\n r\"\"\"Changes Windows paths to Linux paths in error messages.\n\n E.g. foo\\bar.py -> foo/bar.py.\n \"\"\"\n line = line.replace(root_dir, root_dir.replace('\\\\', '/'))\n m = re.match(r'^([\\S/]+):(\\d+:)?(\\s+.*)', line)\n if not m:\n return line\n else:\n filename, lineno, message = m.groups()\n return '{}:{}{}'.format(filename.replace('\\\\', '/'),\n lineno or '', message)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_fix_cobertura_filename_fix_cobertura_filename.return._format_line_m_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_fix_cobertura_filename_fix_cobertura_filename.return._format_line_m_s", "embedding": null, "metadata": {"file_path": "mypy/test/data.py", "file_name": "data.py", "file_type": "text/x-python", "category": "test", "start_line": 467, "end_line": 477, "span_ids": ["fix_cobertura_filename"], "tokens": 115}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def fix_cobertura_filename(line: str) -> str:\n r\"\"\"Changes filename paths to Linux paths in Cobertura output files.\n\n E.g. filename=\"pkg\\subpkg\\a.py\" -> filename=\"pkg/subpkg/a.py\".\n \"\"\"\n m = re.search(r'.*?)\"', line)\n if not m:\n return line\n return '{}{}{}'.format(line[:m.start(1)],\n m.group('filename').replace('\\\\', '/'),\n line[m.end(1):])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py___pytest_addoption.group_addoption_mypyc_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py___pytest_addoption.group_addoption_mypyc_", "embedding": null, "metadata": {"file_path": "mypy/test/data.py", "file_name": "data.py", "file_type": "text/x-python", "category": "test", "start_line": 480, "end_line": 499, "span_ids": ["pytest_addoption", "fix_cobertura_filename"], "tokens": 181}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "##\n#\n# pytest setup\n#\n##\n\n\n# This function name is special to pytest. See\n# https://docs.pytest.org/en/latest/reference.html#initialization-hooks\ndef pytest_addoption(parser: Any) -> None:\n group = parser.getgroup('mypy')\n group.addoption('--update-data', action='store_true', default=False,\n help='Update test data to reflect actual output'\n ' (supported only for certain tests)')\n group.addoption('--save-failures-to', default=None,\n help='Copy the temp directories from failing tests to a target directory')\n group.addoption('--mypy-verbose', action='count',\n help='Set the verbose flag when creating mypy Options')\n group.addoption('--mypyc-showc', action='store_true', default=False,\n help='Display C code on mypyc test failures')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_None_10_pytest_pycollect_makeitem.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_None_10_pytest_pycollect_makeitem.return.None", "embedding": null, "metadata": {"file_path": "mypy/test/data.py", "file_name": "data.py", "file_type": "text/x-python", "category": "test", "start_line": 502, "end_line": 519, "span_ids": ["pytest_addoption", "pytest_pycollect_makeitem"], "tokens": 202}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# This function name is special to pytest. See\n# http://doc.pytest.org/en/latest/writing_plugins.html#collection-hooks\ndef pytest_pycollect_makeitem(collector: Any, name: str,\n obj: object) -> 'Optional[Any]':\n \"\"\"Called by pytest on each object in modules configured in conftest.py files.\n\n collector is pytest.Collector, returns Optional[pytest.Class]\n \"\"\"\n if isinstance(obj, type):\n # Only classes derived from DataSuite contain test cases, not the DataSuite class itself\n if issubclass(obj, DataSuite) and obj is not DataSuite:\n # Non-None result means this obj is a test case.\n # The collect method of the returned DataSuiteCollector instance will be called later,\n # with self.obj being obj.\n return DataSuiteCollector.from_parent( # type: ignore[no-untyped-call]\n parent=collector, name=name\n )\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_split_test_cases_split_test_cases.for_i_in_range_1_len_cas.line_no_data_count_n": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_split_test_cases_split_test_cases.for_i_in_range_1_len_cas.line_no_data_count_n", "embedding": null, "metadata": {"file_path": "mypy/test/data.py", "file_name": "data.py", "file_type": "text/x-python", "category": "test", "start_line": 522, "end_line": 555, "span_ids": ["split_test_cases"], "tokens": 339}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def split_test_cases(parent: 'DataSuiteCollector', suite: 'DataSuite',\n file: str) -> Iterator['DataDrivenTestCase']:\n \"\"\"Iterate over raw test cases in file, at collection time, ignoring sub items.\n\n The collection phase is slow, so any heavy processing should be deferred to after\n uninteresting tests are filtered (when using -k PATTERN switch).\n \"\"\"\n with open(file, encoding='utf-8') as f:\n data = f.read()\n cases = re.split(r'^\\[case ([a-zA-Z_0-9]+)'\n r'(-writescache)?'\n r'(-only_when_cache|-only_when_nocache)?'\n r'(-posix|-windows)?'\n r'(-skip)?'\n r'\\][ \\t]*$\\n',\n data,\n flags=re.DOTALL | re.MULTILINE)\n line_no = cases[0].count('\\n') + 1\n for i in range(1, len(cases), 6):\n name, writescache, only_when, platform_flag, skip, data = cases[i:i + 6]\n platform = platform_flag[1:] if platform_flag else None\n yield DataDrivenTestCase.from_parent(\n parent=parent,\n suite=suite,\n file=file,\n name=add_test_name_suffix(name, suite.test_name_suffix),\n writescache=bool(writescache),\n only_when=only_when,\n platform=platform,\n skip=bool(skip),\n data=data,\n line=line_no,\n )\n line_no += data.count('\\n') + 1", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_DataSuiteCollector_add_test_name_suffix.if_m_.else_.return.name_suffix": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_DataSuiteCollector_add_test_name_suffix.if_m_.else_.return.name_suffix", "embedding": null, "metadata": {"file_path": "mypy/test/data.py", "file_name": "data.py", "file_type": "text/x-python", "category": "test", "start_line": 558, "end_line": 578, "span_ids": ["DataSuiteCollector.collect", "DataSuiteCollector", "add_test_name_suffix"], "tokens": 217}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DataSuiteCollector(pytest.Class):\n def collect(self) -> Iterator[pytest.Item]:\n \"\"\"Called by pytest on each of the object returned from pytest_pycollect_makeitem\"\"\"\n\n # obj is the object for which pytest_pycollect_makeitem returned self.\n suite = self.obj # type: DataSuite\n for f in suite.files:\n yield from split_test_cases(self, suite, os.path.join(suite.data_prefix, f))\n\n\ndef add_test_name_suffix(name: str, suffix: str) -> str:\n # Find magic suffix of form \"-foobar\" (used for things like \"-skip\").\n m = re.search(r'-[-A-Za-z0-9]+$', name)\n if m:\n # Insert suite-specific test name suffix before the magic suffix\n # which must be the last thing in the test case name since we\n # are using endswith() checks.\n magic_suffix = m.group(0)\n return name[:-len(magic_suffix)] + suffix + magic_suffix\n else:\n return name + suffix", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_is_incremental_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/data.py_is_incremental_", "embedding": null, "metadata": {"file_path": "mypy/test/data.py", "file_name": "data.py", "file_type": "text/x-python", "category": "test", "start_line": 581, "end_line": 618, "span_ids": ["has_stable_flags", "is_incremental", "DataSuite.run_case", "DataSuite.setup", "DataSuite"], "tokens": 253}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_incremental(testcase: DataDrivenTestCase) -> bool:\n return 'incremental' in testcase.name.lower() or 'incremental' in testcase.file\n\n\ndef has_stable_flags(testcase: DataDrivenTestCase) -> bool:\n if any(re.match(r'# flags[2-9]:', line) for line in testcase.input):\n return False\n for filename, contents in testcase.files:\n if os.path.basename(filename).startswith('mypy.ini.'):\n return False\n return True\n\n\nclass DataSuite:\n # option fields - class variables\n files = None # type: List[str]\n\n base_path = test_temp_dir\n\n # Allow external users of the test code to override the data prefix\n data_prefix = test_data_prefix\n\n required_out_section = False\n\n native_sep = False\n\n # Name suffix automatically added to each test case in the suite (can be\n # used to distinguish test cases in suites that share data files)\n test_name_suffix = ''\n\n def setup(self) -> None:\n \"\"\"Setup fixtures (ad-hoc)\"\"\"\n pass\n\n @abstractmethod\n def run_case(self, testcase: DataDrivenTestCase) -> None:\n raise NotImplementedError", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/helpers.py_os_run_mypy.if_status_0_.pytest_fail_msg_Sample_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/helpers.py_os_run_mypy.if_status_0_.pytest_fail_msg_Sample_c", "embedding": null, "metadata": {"file_path": "mypy/test/helpers.py", "file_name": "helpers.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 41, "span_ids": ["imports", "run_mypy"], "tokens": 291}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nimport re\nimport sys\nimport time\nimport shutil\nimport contextlib\n\nfrom typing import List, Iterable, Dict, Tuple, Callable, Any, Optional, Iterator\n\nfrom mypy import defaults\nimport mypy.api as api\n\nimport pytest\n\n# Exporting Suite as alias to TestCase for backwards compatibility\n# TODO: avoid aliasing - import and subclass TestCase directly\nfrom unittest import TestCase as Suite # noqa: F401 (re-exporting)\n\nfrom mypy.main import process_options\nfrom mypy.options import Options\nfrom mypy.test.data import DataDrivenTestCase, fix_cobertura_filename\nfrom mypy.test.config import test_temp_dir\nimport mypy.version\n\nskip = pytest.mark.skip\n\n# AssertStringArraysEqual displays special line alignment helper messages if\n# the first different line has at least this many characters,\nMIN_LINE_LENGTH_FOR_ALIGNMENT = 5\n\n\ndef run_mypy(args: List[str]) -> None:\n __tracebackhide__ = True\n # We must enable site packages even though they could cause problems,\n # since stubs for typing_extensions live there.\n outval, errval, status = api.run(args + ['--show-traceback',\n '--no-silence-site-packages'])\n if status != 0:\n sys.stdout.write(outval)\n sys.stderr.write(errval)\n pytest.fail(msg=\"Sample check failed\", pytrace=False)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/helpers.py_assert_string_arrays_equal_assert_string_arrays_equal.if_actual_expected_.raise_AssertionError_msg_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/helpers.py_assert_string_arrays_equal_assert_string_arrays_equal.if_actual_expected_.raise_AssertionError_msg_", "embedding": null, "metadata": {"file_path": "mypy/test/helpers.py", "file_name": "helpers.py", "file_type": "text/x-python", "category": "test", "start_line": 43, "end_line": 116, "span_ids": ["assert_string_arrays_equal"], "tokens": 590}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def assert_string_arrays_equal(expected: List[str], actual: List[str],\n msg: str) -> None:\n \"\"\"Assert that two string arrays are equal.\n\n We consider \"can't\" and \"cannot\" equivalent, by replacing the\n former with the latter before comparing.\n\n Display any differences in a human-readable form.\n \"\"\"\n\n actual = clean_up(actual)\n actual = [line.replace(\"can't\", \"cannot\") for line in actual]\n expected = [line.replace(\"can't\", \"cannot\") for line in expected]\n\n if actual != expected:\n num_skip_start = num_skipped_prefix_lines(expected, actual)\n num_skip_end = num_skipped_suffix_lines(expected, actual)\n\n sys.stderr.write('Expected:\\n')\n\n # If omit some lines at the beginning, indicate it by displaying a line\n # with '...'.\n if num_skip_start > 0:\n sys.stderr.write(' ...\\n')\n\n # Keep track of the first different line.\n first_diff = -1\n\n # Display only this many first characters of identical lines.\n width = 75\n\n for i in range(num_skip_start, len(expected) - num_skip_end):\n if i >= len(actual) or expected[i] != actual[i]:\n if first_diff < 0:\n first_diff = i\n sys.stderr.write(' {:<45} (diff)'.format(expected[i]))\n else:\n e = expected[i]\n sys.stderr.write(' ' + e[:width])\n if len(e) > width:\n sys.stderr.write('...')\n sys.stderr.write('\\n')\n if num_skip_end > 0:\n sys.stderr.write(' ...\\n')\n\n sys.stderr.write('Actual:\\n')\n\n if num_skip_start > 0:\n sys.stderr.write(' ...\\n')\n\n for j in range(num_skip_start, len(actual) - num_skip_end):\n if j >= len(expected) or expected[j] != actual[j]:\n sys.stderr.write(' {:<45} (diff)'.format(actual[j]))\n else:\n a = actual[j]\n sys.stderr.write(' ' + a[:width])\n if len(a) > width:\n sys.stderr.write('...')\n sys.stderr.write('\\n')\n if not actual:\n sys.stderr.write(' (empty)\\n')\n if num_skip_end > 0:\n sys.stderr.write(' ...\\n')\n\n sys.stderr.write('\\n')\n\n if 0 <= first_diff < len(actual) and (\n len(expected[first_diff]) >= MIN_LINE_LENGTH_FOR_ALIGNMENT\n or len(actual[first_diff]) >= MIN_LINE_LENGTH_FOR_ALIGNMENT):\n # Display message that helps visualize the differences between two\n # long lines.\n show_align_message(expected[first_diff], actual[first_diff])\n\n raise AssertionError(msg)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/helpers.py_assert_module_equivalence_assert_target_equivalence.assert_string_arrays_equa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/helpers.py_assert_module_equivalence_assert_target_equivalence.assert_string_arrays_equa", "embedding": null, "metadata": {"file_path": "mypy/test/helpers.py", "file_name": "helpers.py", "file_type": "text/x-python", "category": "test", "start_line": 119, "end_line": 143, "span_ids": ["assert_target_equivalence", "assert_module_equivalence"], "tokens": 186}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def assert_module_equivalence(name: str,\n expected: Iterable[str], actual: Iterable[str]) -> None:\n expected_normalized = sorted(expected)\n actual_normalized = sorted(set(actual).difference({\"__main__\"}))\n assert_string_arrays_equal(\n expected_normalized,\n actual_normalized,\n ('Actual modules ({}) do not match expected modules ({}) '\n 'for \"[{} ...]\"').format(\n ', '.join(actual_normalized),\n ', '.join(expected_normalized),\n name))\n\n\ndef assert_target_equivalence(name: str,\n expected: List[str], actual: List[str]) -> None:\n \"\"\"Compare actual and expected targets (order sensitive).\"\"\"\n assert_string_arrays_equal(\n expected,\n actual,\n ('Actual targets ({}) do not match expected targets ({}) '\n 'for \"[{} ...]\"').format(\n ', '.join(actual),\n ', '.join(expected),\n name))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/helpers.py_update_testcase_output_update_testcase_output.None_3.print_data_file_f_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/helpers.py_update_testcase_output_update_testcase_output.None_3.print_data_file_f_", "embedding": null, "metadata": {"file_path": "mypy/test/helpers.py", "file_name": "helpers.py", "file_type": "text/x-python", "category": "test", "start_line": 146, "end_line": 174, "span_ids": ["update_testcase_output"], "tokens": 318}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def update_testcase_output(testcase: DataDrivenTestCase, output: List[str]) -> None:\n assert testcase.old_cwd is not None, \"test was not properly set up\"\n testcase_path = os.path.join(testcase.old_cwd, testcase.file)\n with open(testcase_path, encoding='utf8') as f:\n data_lines = f.read().splitlines()\n test = '\\n'.join(data_lines[testcase.line:testcase.last_line])\n\n mapping = {} # type: Dict[str, List[str]]\n for old, new in zip(testcase.output, output):\n PREFIX = 'error:'\n ind = old.find(PREFIX)\n if ind != -1 and old[:ind] == new[:ind]:\n old, new = old[ind + len(PREFIX):], new[ind + len(PREFIX):]\n mapping.setdefault(old, []).append(new)\n\n for old in mapping:\n if test.count(old) == len(mapping[old]):\n betweens = test.split(old)\n\n # Interleave betweens and mapping[old]\n from itertools import chain\n interleaved = [betweens[0]] + \\\n list(chain.from_iterable(zip(mapping[old], betweens[1:])))\n test = ''.join(interleaved)\n\n data_lines[testcase.line:testcase.last_line] = [test]\n data = '\\n'.join(data_lines)\n with open(testcase_path, 'w', encoding='utf8') as f:\n print(data, file=f)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/helpers.py_show_align_message_show_align_message.sys_stderr_write_n_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/helpers.py_show_align_message_show_align_message.sys_stderr_write_n_", "embedding": null, "metadata": {"file_path": "mypy/test/helpers.py", "file_name": "helpers.py", "file_type": "text/x-python", "category": "test", "start_line": 177, "end_line": 226, "span_ids": ["show_align_message"], "tokens": 420}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def show_align_message(s1: str, s2: str) -> None:\n \"\"\"Align s1 and s2 so that the their first difference is highlighted.\n\n For example, if s1 is 'foobar' and s2 is 'fobar', display the\n following lines:\n\n E: foobar\n A: fobar\n ^\n\n If s1 and s2 are long, only display a fragment of the strings around the\n first difference. If s1 is very short, do nothing.\n \"\"\"\n\n # Seeing what went wrong is trivial even without alignment if the expected\n # string is very short. In this case do nothing to simplify output.\n if len(s1) < 4:\n return\n\n maxw = 72 # Maximum number of characters shown\n\n sys.stderr.write('Alignment of first line difference:\\n')\n\n trunc = False\n while s1[:30] == s2[:30]:\n s1 = s1[10:]\n s2 = s2[10:]\n trunc = True\n\n if trunc:\n s1 = '...' + s1\n s2 = '...' + s2\n\n max_len = max(len(s1), len(s2))\n extra = ''\n if max_len > maxw:\n extra = '...'\n\n # Write a chunk of both lines, aligned.\n sys.stderr.write(' E: {}{}\\n'.format(s1[:maxw], extra))\n sys.stderr.write(' A: {}{}\\n'.format(s2[:maxw], extra))\n # Write an indicator character under the different columns.\n sys.stderr.write(' ')\n for j in range(min(maxw, max(len(s1), len(s2)))):\n if s1[j:j + 1] != s2[j:j + 1]:\n sys.stderr.write('^') # Difference\n break\n else:\n sys.stderr.write(' ') # Equal\n sys.stderr.write('\\n')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/helpers.py_clean_up_clean_up.return.res": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/helpers.py_clean_up_clean_up.return.res", "embedding": null, "metadata": {"file_path": "mypy/test/helpers.py", "file_name": "helpers.py", "file_type": "text/x-python", "category": "test", "start_line": 229, "end_line": 249, "span_ids": ["clean_up"], "tokens": 181}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def clean_up(a: List[str]) -> List[str]:\n \"\"\"Remove common directory prefix from all strings in a.\n\n This uses a naive string replace; it seems to work well enough. Also\n remove trailing carriage returns.\n \"\"\"\n res = []\n pwd = os.getcwd()\n driver = pwd + '/driver.py'\n for s in a:\n prefix = os.sep\n ss = s\n for p in prefix, prefix.replace(os.sep, '/'):\n if p != '/' and p != '//' and p != '\\\\' and p != '\\\\\\\\':\n ss = ss.replace(p, '')\n # Ignore spaces at end of line.\n ss = re.sub(' +$', '', ss)\n # Remove pwd from driver.py's path\n ss = ss.replace(driver, 'driver.py')\n res.append(re.sub('\\\\r$', '', ss))\n return res", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/helpers.py_local_sys_path_set_normalize_error_messages.return.a": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/helpers.py_local_sys_path_set_normalize_error_messages.return.a", "embedding": null, "metadata": {"file_path": "mypy/test/helpers.py", "file_name": "helpers.py", "file_type": "text/x-python", "category": "test", "start_line": 252, "end_line": 303, "span_ids": ["num_skipped_prefix_lines", "testfile_pyversion", "normalize_error_messages", "local_sys_path_set", "testcase_pyversion", "num_skipped_suffix_lines"], "tokens": 399}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@contextlib.contextmanager\ndef local_sys_path_set() -> Iterator[None]:\n \"\"\"Temporary insert current directory into sys.path.\n\n This can be used by test cases that do runtime imports, for example\n by the stubgen tests.\n \"\"\"\n old_sys_path = sys.path[:]\n if not ('' in sys.path or '.' in sys.path):\n sys.path.insert(0, '')\n try:\n yield\n finally:\n sys.path = old_sys_path\n\n\ndef num_skipped_prefix_lines(a1: List[str], a2: List[str]) -> int:\n num_eq = 0\n while num_eq < min(len(a1), len(a2)) and a1[num_eq] == a2[num_eq]:\n num_eq += 1\n return max(0, num_eq - 4)\n\n\ndef num_skipped_suffix_lines(a1: List[str], a2: List[str]) -> int:\n num_eq = 0\n while (num_eq < min(len(a1), len(a2))\n and a1[-num_eq - 1] == a2[-num_eq - 1]):\n num_eq += 1\n return max(0, num_eq - 4)\n\n\ndef testfile_pyversion(path: str) -> Tuple[int, int]:\n if path.endswith('python2.test'):\n return defaults.PYTHON2_VERSION\n else:\n return defaults.PYTHON3_VERSION\n\n\ndef testcase_pyversion(path: str, testcase_name: str) -> Tuple[int, int]:\n if testcase_name.endswith('python2'):\n return defaults.PYTHON2_VERSION\n else:\n return testfile_pyversion(path)\n\n\ndef normalize_error_messages(messages: List[str]) -> List[str]:\n \"\"\"Translate an array of error messages to use / as path separator.\"\"\"\n\n a = []\n for m in messages:\n a.append(m.replace(os.sep, '/'))\n return a", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/helpers.py_retry_on_error_retry_on_error.while_True_.try_.except_OSError_.time_sleep_wait_time_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/helpers.py_retry_on_error_retry_on_error.while_True_.try_.except_OSError_.time_sleep_wait_time_", "embedding": null, "metadata": {"file_path": "mypy/test/helpers.py", "file_name": "helpers.py", "file_type": "text/x-python", "category": "test", "start_line": 306, "end_line": 326, "span_ids": ["retry_on_error"], "tokens": 157}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def retry_on_error(func: Callable[[], Any], max_wait: float = 1.0) -> None:\n \"\"\"Retry callback with exponential backoff when it raises OSError.\n\n If the function still generates an error after max_wait seconds, propagate\n the exception.\n\n This can be effective against random file system operation failures on\n Windows.\n \"\"\"\n t0 = time.time()\n wait_time = 0.01\n while True:\n try:\n func()\n return\n except OSError:\n wait_time = min(wait_time * 2, t0 + max_wait - time.time())\n if wait_time <= 0.01:\n # Done enough waiting, the error seems persistent.\n raise\n time.sleep(wait_time)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/helpers.py__TODO_assert_true_and_a_assert_type.if_type_value_typ_.raise_AssertionError_Inv": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/helpers.py__TODO_assert_true_and_a_assert_type.if_type_value_typ_.raise_AssertionError_Inv", "embedding": null, "metadata": {"file_path": "mypy/test/helpers.py", "file_name": "helpers.py", "file_type": "text/x-python", "category": "test", "start_line": 328, "end_line": 368, "span_ids": ["good_repr", "assert_equal", "typename", "assert_true", "retry_on_error", "assert_type", "assert_false"], "tokens": 290}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# TODO: assert_true and assert_false are redundant - use plain assert\n\n\ndef assert_true(b: bool, msg: Optional[str] = None) -> None:\n if not b:\n raise AssertionError(msg)\n\n\ndef assert_false(b: bool, msg: Optional[str] = None) -> None:\n if b:\n raise AssertionError(msg)\n\n\ndef good_repr(obj: object) -> str:\n if isinstance(obj, str):\n if obj.count('\\n') > 1:\n bits = [\"'''\\\\\"]\n for line in obj.split('\\n'):\n # force repr to use ' not \", then cut it off\n bits.append(repr('\"' + line)[2:-1])\n bits[-1] += \"'''\"\n return '\\n'.join(bits)\n return repr(obj)\n\n\ndef assert_equal(a: object, b: object, fmt: str = '{} != {}') -> None:\n if a != b:\n raise AssertionError(fmt.format(good_repr(a), good_repr(b)))\n\n\ndef typename(t: type) -> str:\n if '.' in str(t):\n return str(t).split('.')[-1].rstrip(\"'>\")\n else:\n return str(t)[8:-2]\n\n\ndef assert_type(typ: type, value: object) -> None:\n if type(value) != typ:\n raise AssertionError('Invalid type {}, expected {}'.format(\n typename(type(value)), typename(typ)))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/helpers.py_parse_options_parse_options.return.options": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/helpers.py_parse_options_parse_options.return.options", "embedding": null, "metadata": {"file_path": "mypy/test/helpers.py", "file_name": "helpers.py", "file_type": "text/x-python", "category": "test", "start_line": 371, "end_line": 403, "span_ids": ["parse_options"], "tokens": 325}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def parse_options(program_text: str, testcase: DataDrivenTestCase,\n incremental_step: int) -> Options:\n \"\"\"Parse comments like '# flags: --foo' in a test case.\"\"\"\n options = Options()\n flags = re.search('# flags: (.*)$', program_text, flags=re.MULTILINE)\n if incremental_step > 1:\n flags2 = re.search('# flags{}: (.*)$'.format(incremental_step), program_text,\n flags=re.MULTILINE)\n if flags2:\n flags = flags2\n\n if flags:\n flag_list = flags.group(1).split()\n flag_list.append('--no-site-packages') # the tests shouldn't need an installed Python\n targets, options = process_options(flag_list, require_targets=False)\n if targets:\n # TODO: support specifying targets via the flags pragma\n raise RuntimeError('Specifying targets via the flags pragma is not supported.')\n else:\n flag_list = []\n options = Options()\n # TODO: Enable strict optional in test cases by default (requires *many* test case changes)\n options.strict_optional = False\n options.error_summary = False\n\n # Allow custom python version to override testcase_pyversion.\n if all(flag.split('=')[0] not in ['--python-version', '-2', '--py2'] for flag in flag_list):\n options.python_version = testcase_pyversion(testcase.file, testcase.name)\n\n if testcase.config.getoption('--mypy-verbose'):\n options.verbosity = testcase.config.getoption('--mypy-verbose')\n\n return options", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/helpers.py_split_lines_copy_and_fudge_mtime.if_new_time_.os_utime_target_path_tim": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/helpers.py_split_lines_copy_and_fudge_mtime.if_new_time_.os_utime_target_path_tim", "embedding": null, "metadata": {"file_path": "mypy/test/helpers.py", "file_name": "helpers.py", "file_type": "text/x-python", "category": "test", "start_line": 406, "end_line": 431, "span_ids": ["split_lines", "copy_and_fudge_mtime"], "tokens": 265}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def split_lines(*streams: bytes) -> List[str]:\n \"\"\"Returns a single list of string lines from the byte streams in args.\"\"\"\n return [\n s\n for stream in streams\n for s in stream.decode('utf8').splitlines()\n ]\n\n\ndef copy_and_fudge_mtime(source_path: str, target_path: str) -> None:\n # In some systems, mtime has a resolution of 1 second which can\n # cause annoying-to-debug issues when a file has the same size\n # after a change. We manually set the mtime to circumvent this.\n # Note that we increment the old file's mtime, which guarantees a\n # different value, rather than incrementing the mtime after the\n # copy, which could leave the mtime unchanged if the old file had\n # a similarly fudged mtime.\n new_time = None\n if os.path.isfile(target_path):\n new_time = os.stat(target_path).st_mtime + 1\n\n # Use retries to work around potential flakiness on Windows (AppVeyor).\n retry_on_error(lambda: shutil.copy(source_path, target_path))\n\n if new_time:\n os.utime(target_path, times=(new_time, new_time))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/helpers.py_check_test_output_files_check_test_output_files.for_path_expected_conten.assert_string_arrays_equa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/helpers.py_check_test_output_files_check_test_output_files.for_path_expected_conten.assert_string_arrays_equa", "embedding": null, "metadata": {"file_path": "mypy/test/helpers.py", "file_name": "helpers.py", "file_type": "text/x-python", "category": "test", "start_line": 434, "end_line": 457, "span_ids": ["check_test_output_files"], "tokens": 263}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def check_test_output_files(testcase: DataDrivenTestCase,\n step: int,\n strip_prefix: str = '') -> None:\n for path, expected_content in testcase.output_files:\n if path.startswith(strip_prefix):\n path = path[len(strip_prefix):]\n if not os.path.exists(path):\n raise AssertionError(\n 'Expected file {} was not produced by test case{}'.format(\n path, ' on step %d' % step if testcase.output2 else ''))\n with open(path, 'r', encoding='utf8') as output_file:\n actual_output_content = output_file.read().splitlines()\n normalized_output = normalize_file_output(actual_output_content,\n os.path.abspath(test_temp_dir))\n # We always normalize things like timestamp, but only handle operating-system\n # specific things if requested.\n if testcase.normalize_output:\n if testcase.suite.native_sep and os.path.sep == '\\\\':\n normalized_output = [fix_cobertura_filename(line)\n for line in normalized_output]\n normalized_output = normalize_error_messages(normalized_output)\n assert_string_arrays_equal(expected_content.splitlines(), normalized_output,\n 'Output file {} did not match its expected output{}'.format(\n path, ' on step %d' % step if testcase.output2 else ''))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/helpers.py_normalize_file_output_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/helpers.py_normalize_file_output_", "embedding": null, "metadata": {"file_path": "mypy/test/helpers.py", "file_name": "helpers.py", "file_type": "text/x-python", "category": "test", "start_line": 460, "end_line": 472, "span_ids": ["normalize_file_output"], "tokens": 190}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def normalize_file_output(content: List[str], current_abs_path: str) -> List[str]:\n \"\"\"Normalize file output for comparison.\"\"\"\n timestamp_regex = re.compile(r'\\d{10}')\n result = [x.replace(current_abs_path, '$PWD') for x in content]\n version = mypy.version.__version__\n result = [re.sub(r'\\b' + re.escape(version) + r'\\b', '$VERSION', x) for x in result]\n # We generate a new mypy.version when building mypy wheels that\n # lacks base_version, so handle that case.\n base_version = getattr(mypy.version, 'base_version', version)\n result = [re.sub(r'\\b' + re.escape(base_version) + r'\\b', '$VERSION', x) for x in result]\n result = [timestamp_regex.sub('$TIMESTAMP', x) for x in result]\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testapi.py_from_io_import_StringIO_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testapi.py_from_io_import_StringIO_", "embedding": null, "metadata": {"file_path": "mypy/test/testapi.py", "file_name": "testapi.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 46, "span_ids": ["imports", "APISuite.test_capture_version", "APISuite", "APISuite.tearDown", "APISuite.test_capture_help", "APISuite.test_capture_bad_opt", "APISuite.test_capture_empty", "APISuite.setUp"], "tokens": 305}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from io import StringIO\nimport sys\n\nimport mypy.api\n\nfrom mypy.test.helpers import Suite\n\n\nclass APISuite(Suite):\n\n def setUp(self) -> None:\n self.sys_stdout = sys.stdout\n self.sys_stderr = sys.stderr\n sys.stdout = self.stdout = StringIO()\n sys.stderr = self.stderr = StringIO()\n\n def tearDown(self) -> None:\n sys.stdout = self.sys_stdout\n sys.stderr = self.sys_stderr\n assert self.stdout.getvalue() == ''\n assert self.stderr.getvalue() == ''\n\n def test_capture_bad_opt(self) -> None:\n \"\"\"stderr should be captured when a bad option is passed.\"\"\"\n _, stderr, _ = mypy.api.run(['--some-bad-option'])\n assert isinstance(stderr, str)\n assert stderr != ''\n\n def test_capture_empty(self) -> None:\n \"\"\"stderr should be captured when a bad option is passed.\"\"\"\n _, stderr, _ = mypy.api.run([])\n assert isinstance(stderr, str)\n assert stderr != ''\n\n def test_capture_help(self) -> None:\n \"\"\"stdout should be captured when --help is passed.\"\"\"\n stdout, _, _ = mypy.api.run(['--help'])\n assert isinstance(stdout, str)\n assert stdout != ''\n\n def test_capture_version(self) -> None:\n \"\"\"stdout should be captured when --version is passed.\"\"\"\n stdout, _, _ = mypy.api.run(['--version'])\n assert isinstance(stdout, str)\n assert stdout != ''", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testargs.py__Ensure_the_argparse_pa_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testargs.py__Ensure_the_argparse_pa_", "embedding": null, "metadata": {"file_path": "mypy/test/testargs.py", "file_name": "testargs.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 74, "span_ids": ["ArgSuite.test_coherence", "ArgSuite", "ArgSuite.test_executable_inference", "docstring"], "tokens": 630}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Ensure the argparse parser and Options class are in sync.\n\nIn particular, verify that the argparse defaults are the same as the Options\ndefaults, and that argparse doesn't assign any new members to the Options\nobject it creates.\n\"\"\"\nimport argparse\nimport sys\n\nfrom mypy.test.helpers import Suite, assert_equal\nfrom mypy.options import Options\nfrom mypy.main import process_options, infer_python_executable\n\n\nclass ArgSuite(Suite):\n def test_coherence(self) -> None:\n options = Options()\n _, parsed_options = process_options([], require_targets=False)\n # FIX: test this too. Requires changing working dir to avoid finding 'setup.cfg'\n options.config_file = parsed_options.config_file\n assert_equal(options.snapshot(), parsed_options.snapshot())\n\n def test_executable_inference(self) -> None:\n \"\"\"Test the --python-executable flag with --python-version\"\"\"\n sys_ver_str = '{ver.major}.{ver.minor}'.format(ver=sys.version_info)\n\n base = ['file.py'] # dummy file\n\n # test inference given one (infer the other)\n matching_version = base + ['--python-version={}'.format(sys_ver_str)]\n _, options = process_options(matching_version)\n assert options.python_version == sys.version_info[:2]\n assert options.python_executable == sys.executable\n\n matching_version = base + ['--python-executable={}'.format(sys.executable)]\n _, options = process_options(matching_version)\n assert options.python_version == sys.version_info[:2]\n assert options.python_executable == sys.executable\n\n # test inference given both\n matching_version = base + ['--python-version={}'.format(sys_ver_str),\n '--python-executable={}'.format(sys.executable)]\n _, options = process_options(matching_version)\n assert options.python_version == sys.version_info[:2]\n assert options.python_executable == sys.executable\n\n # test that --no-site-packages will disable executable inference\n matching_version = base + ['--python-version={}'.format(sys_ver_str),\n '--no-site-packages']\n _, options = process_options(matching_version)\n assert options.python_version == sys.version_info[:2]\n assert options.python_executable is None\n\n # Test setting python_version/executable from config file\n special_opts = argparse.Namespace()\n special_opts.python_executable = None\n special_opts.python_version = None\n special_opts.no_executable = None\n\n # first test inferring executable from version\n options = Options()\n options.python_executable = None\n options.python_version = sys.version_info[:2]\n infer_python_executable(options, special_opts)\n assert options.python_version == sys.version_info[:2]\n assert options.python_executable == sys.executable\n\n # then test inferring version from executable\n options = Options()\n options.python_executable = sys.executable\n infer_python_executable(options, special_opts)\n assert options.python_version == sys.version_info[:2]\n assert options.python_executable == sys.executable", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testcheck.py_TypeCheckSuite.verify_cache_TypeCheckSuite.verify_cache.with_open_cachedir_tag_a.assert_f_read_startswit": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testcheck.py_TypeCheckSuite.verify_cache_TypeCheckSuite.verify_cache.with_open_cachedir_tag_a.assert_f_read_startswit", "embedding": null, "metadata": {"file_path": "mypy/test/testcheck.py", "file_name": "testcheck.py", "file_type": "text/x-python", "category": "test", "start_line": 260, "end_line": 283, "span_ids": ["TypeCheckSuite.verify_cache"], "tokens": 343}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeCheckSuite(DataSuite):\n\n def verify_cache(self, module_data: List[Tuple[str, str, str]], a: List[str],\n manager: build.BuildManager, graph: Graph) -> None:\n # There should be valid cache metadata for each module except\n # for those that had an error in themselves or one of their\n # dependencies.\n error_paths = self.find_error_message_paths(a)\n busted_paths = {m.path for id, m in manager.modules.items()\n if graph[id].transitive_error}\n modules = self.find_module_files(manager)\n modules.update({module_name: path for module_name, path, text in module_data})\n missing_paths = self.find_missing_cache_files(modules, manager)\n # We would like to assert error_paths.issubset(busted_paths)\n # but this runs into trouble because while some 'notes' are\n # really errors that cause an error to be marked, many are\n # just notes attached to other errors.\n assert error_paths or not busted_paths, \"Some modules reported error despite no errors\"\n if not missing_paths == busted_paths:\n raise AssertionError(\"cache data discrepancy %s != %s\" %\n (missing_paths, busted_paths))\n assert os.path.isfile(os.path.join(manager.options.cache_dir, \".gitignore\"))\n cachedir_tag = os.path.join(manager.options.cache_dir, \"CACHEDIR.TAG\")\n assert os.path.isfile(cachedir_tag)\n with open(cachedir_tag) as f:\n assert f.read().startswith(\"Signature: 8a477f597d28d172789f06886806bc55\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testcheck.py_TypeCheckSuite.find_error_message_paths_TypeCheckSuite.find_missing_cache_files.return.set_missing_values_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testcheck.py_TypeCheckSuite.find_error_message_paths_TypeCheckSuite.find_missing_cache_files.return.set_missing_values_", "embedding": null, "metadata": {"file_path": "mypy/test/testcheck.py", "file_name": "testcheck.py", "file_type": "text/x-python", "category": "test", "start_line": 285, "end_line": 308, "span_ids": ["TypeCheckSuite.find_missing_cache_files", "TypeCheckSuite.find_module_files", "TypeCheckSuite.find_error_message_paths"], "tokens": 221}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeCheckSuite(DataSuite):\n\n def find_error_message_paths(self, a: List[str]) -> Set[str]:\n hits = set()\n for line in a:\n m = re.match(r'([^\\s:]+):(\\d+:)?(\\d+:)? (error|warning|note):', line)\n if m:\n p = m.group(1)\n hits.add(p)\n return hits\n\n def find_module_files(self, manager: build.BuildManager) -> Dict[str, str]:\n modules = {}\n for id, module in manager.modules.items():\n modules[id] = module.path\n return modules\n\n def find_missing_cache_files(self, modules: Dict[str, str],\n manager: build.BuildManager) -> Set[str]:\n ignore_errors = True\n missing = {}\n for id, path in modules.items():\n meta = build.find_cache_meta(id, path, manager)\n if not build.validate_meta(meta, id, path, ignore_errors, manager):\n missing[id] = path\n return set(missing.values())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testcheck.py_TypeCheckSuite.parse_module_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testcheck.py_TypeCheckSuite.parse_module_", "embedding": null, "metadata": {"file_path": "mypy/test/testcheck.py", "file_name": "testcheck.py", "file_type": "text/x-python", "category": "test", "start_line": 311, "end_line": 355, "span_ids": ["TypeCheckSuite.parse_module"], "tokens": 474}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeCheckSuite(DataSuite):\n\n def parse_module(self,\n program_text: str,\n incremental_step: int = 0) -> List[Tuple[str, str, str]]:\n \"\"\"Return the module and program names for a test case.\n\n Normally, the unit tests will parse the default ('__main__')\n module and follow all the imports listed there. You can override\n this behavior and instruct the tests to check multiple modules\n by using a comment like this in the test case input:\n\n # cmd: mypy -m foo.bar foo.baz\n\n You can also use `# cmdN:` to have a different cmd for incremental\n step N (2, 3, ...).\n\n Return a list of tuples (module name, file name, program text).\n \"\"\"\n m = re.search('# cmd: mypy -m ([a-zA-Z0-9_. ]+)$', program_text, flags=re.MULTILINE)\n if incremental_step > 1:\n alt_regex = '# cmd{}: mypy -m ([a-zA-Z0-9_. ]+)$'.format(incremental_step)\n alt_m = re.search(alt_regex, program_text, flags=re.MULTILINE)\n if alt_m is not None:\n # Optionally return a different command if in a later step\n # of incremental mode, otherwise default to reusing the\n # original cmd.\n m = alt_m\n\n if m:\n # The test case wants to use a non-default main\n # module. Look up the module and give it as the thing to\n # analyze.\n module_names = m.group(1)\n out = []\n search_paths = SearchPaths((test_temp_dir,), (), (), ())\n cache = FindModuleCache(search_paths, fscache=None, options=None)\n for module_name in module_names.split(' '):\n path = cache.find_module(module_name)\n assert isinstance(path, str), \"Can't find ad hoc case file: %s\" % module_name\n with open(path, encoding='utf8') as f:\n program_text = f.read()\n out.append((module_name, path, program_text))\n return out\n else:\n return [('__main__', 'main', program_text)]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testcmdline.py__Test_cases_for_the_com_PythonCmdlineSuite.run_case.for_step_in_1_sorted_.test_python_cmdline_testc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testcmdline.py__Test_cases_for_the_com_PythonCmdlineSuite.run_case.for_step_in_1_sorted_.test_python_cmdline_testc", "embedding": null, "metadata": {"file_path": "mypy/test/testcmdline.py", "file_name": "testcmdline.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 38, "span_ids": ["PythonCmdlineSuite.run_case", "PythonCmdlineSuite", "docstring"], "tokens": 206}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Test cases for the command line.\n\nTo begin we test that \"mypy [/]\" always recurses down the\nwhole tree.\n\"\"\"\n\nimport os\nimport re\nimport subprocess\nimport sys\n\nfrom typing import List\nfrom typing import Optional\n\nfrom mypy.test.config import test_temp_dir, PREFIX\nfrom mypy.test.data import DataDrivenTestCase, DataSuite\nfrom mypy.test.helpers import (\n assert_string_arrays_equal, normalize_error_messages, check_test_output_files\n)\n\n# Path to Python 3 interpreter\npython3_path = sys.executable\n\n# Files containing test case descriptions.\ncmdline_files = [\n 'cmdline.test',\n 'reports.test',\n 'envvars.test',\n]\n\n\nclass PythonCmdlineSuite(DataSuite):\n files = cmdline_files\n native_sep = True\n\n def run_case(self, testcase: DataDrivenTestCase) -> None:\n for step in [1] + sorted(testcase.output2):\n test_python_cmdline(testcase, step)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testcmdline.py_test_python_cmdline_test_python_cmdline.if_testcase_output_files_.else_.assert_string_arrays_equa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testcmdline.py_test_python_cmdline_test_python_cmdline.if_testcase_output_files_.else_.assert_string_arrays_equa", "embedding": null, "metadata": {"file_path": "mypy/test/testcmdline.py", "file_name": "testcmdline.py", "file_type": "text/x-python", "category": "test", "start_line": 41, "end_line": 103, "span_ids": ["test_python_cmdline"], "tokens": 645}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_python_cmdline(testcase: DataDrivenTestCase, step: int) -> None:\n assert testcase.old_cwd is not None, \"test was not properly set up\"\n # Write the program to a file.\n program = '_program.py'\n program_path = os.path.join(test_temp_dir, program)\n with open(program_path, 'w', encoding='utf8') as file:\n for s in testcase.input:\n file.write('{}\\n'.format(s))\n args = parse_args(testcase.input[0])\n custom_cwd = parse_cwd(testcase.input[1]) if len(testcase.input) > 1 else None\n args.append('--show-traceback')\n if '--error-summary' not in args:\n args.append('--no-error-summary')\n # Type check the program.\n fixed = [python3_path, '-m', 'mypy']\n env = os.environ.copy()\n env.pop('COLUMNS', None)\n env['PYTHONPATH'] = PREFIX\n process = subprocess.Popen(fixed + args,\n stdout=subprocess.PIPE,\n stderr=subprocess.PIPE,\n cwd=os.path.join(\n test_temp_dir,\n custom_cwd or \"\"\n ),\n env=env)\n outb, errb = process.communicate()\n result = process.returncode\n # Split output into lines.\n out = [s.rstrip('\\n\\r') for s in str(outb, 'utf8').splitlines()]\n err = [s.rstrip('\\n\\r') for s in str(errb, 'utf8').splitlines()]\n\n if \"PYCHARM_HOSTED\" in os.environ:\n for pos, line in enumerate(err):\n if line.startswith('pydev debugger: '):\n # Delete the attaching debugger message itself, plus the extra newline added.\n del err[pos:pos + 2]\n break\n\n # Remove temp file.\n os.remove(program_path)\n # Compare actual output to expected.\n if testcase.output_files:\n # Ignore stdout, but we insist on empty stderr and zero status.\n if err or result:\n raise AssertionError(\n 'Expected zero status and empty stderr%s, got %d and\\n%s' %\n (' on step %d' % step if testcase.output2 else '',\n result, '\\n'.join(err + out)))\n check_test_output_files(testcase, step)\n else:\n if testcase.normalize_output:\n out = normalize_error_messages(err + out)\n obvious_result = 1 if out else 0\n if obvious_result != result:\n out.append('== Return code: {}'.format(result))\n expected_out = testcase.output if step == 1 else testcase.output2[step]\n # Strip \"tmp/\" out of the test so that # E: works...\n expected_out = [s.replace(\"tmp\" + os.sep, \"\") for s in expected_out]\n assert_string_arrays_equal(expected_out, out,\n 'Invalid output ({}, line {}){}'.format(\n testcase.file, testcase.line,\n ' on step %d' % step if testcase.output2 else ''))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testcmdline.py_parse_args_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testcmdline.py_parse_args_", "embedding": null, "metadata": {"file_path": "mypy/test/testcmdline.py", "file_name": "testcmdline.py", "file_type": "text/x-python", "category": "test", "start_line": 106, "end_line": 136, "span_ids": ["parse_cwd", "parse_args"], "tokens": 178}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def parse_args(line: str) -> List[str]:\n \"\"\"Parse the first line of the program for the command line.\n\n This should have the form\n\n # cmd: mypy \n\n For example:\n\n # cmd: mypy pkg/\n \"\"\"\n m = re.match('# cmd: mypy (.*)$', line)\n if not m:\n return [] # No args; mypy will spit out an error.\n return m.group(1).split()\n\n\ndef parse_cwd(line: str) -> Optional[str]:\n \"\"\"Parse the second line of the program for the command line.\n\n This should have the form\n\n # cwd: \n\n For example:\n\n # cwd: main/subdir\n \"\"\"\n m = re.match('# cwd: (.*)$', line)\n return m.group(1) if m else None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testdaemon.py__End_to_end_test_cases__DaemonSuite.run_case.try_.finally_.run_cmd_dmypy_kill_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testdaemon.py__End_to_end_test_cases__DaemonSuite.run_case.try_.finally_.run_cmd_dmypy_kill_", "embedding": null, "metadata": {"file_path": "mypy/test/testdaemon.py", "file_name": "testdaemon.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 37, "span_ids": ["DaemonSuite", "DaemonSuite.run_case", "docstring"], "tokens": 202}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"End-to-end test cases for the daemon (dmypy).\n\nThese are special because they run multiple shell commands.\n\nThis also includes some unit tests.\n\"\"\"\n\nimport os\nimport subprocess\nimport sys\nimport tempfile\nimport unittest\nfrom typing import List, Tuple\n\nfrom mypy.modulefinder import SearchPaths\nfrom mypy.fscache import FileSystemCache\nfrom mypy.dmypy_server import filter_out_missing_top_level_packages\n\nfrom mypy.test.config import test_temp_dir, PREFIX\nfrom mypy.test.data import DataDrivenTestCase, DataSuite\nfrom mypy.test.helpers import assert_string_arrays_equal, normalize_error_messages\n\n# Files containing test cases descriptions.\ndaemon_files = [\n 'daemon.test',\n]\n\n\nclass DaemonSuite(DataSuite):\n files = daemon_files\n\n def run_case(self, testcase: DataDrivenTestCase) -> None:\n try:\n test_daemon(testcase)\n finally:\n # Kill the daemon if it's still running.\n run_cmd('dmypy kill')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testdaemon.py_test_daemon_test_daemon.for_i_step_in_enumerate_.assert_string_arrays_equa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testdaemon.py_test_daemon_test_daemon.for_i_step_in_enumerate_.assert_string_arrays_equa", "embedding": null, "metadata": {"file_path": "mypy/test/testdaemon.py", "file_name": "testdaemon.py", "file_type": "text/x-python", "category": "test", "start_line": 33, "end_line": 49, "span_ids": ["test_daemon"], "tokens": 169}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_daemon(testcase: DataDrivenTestCase) -> None:\n assert testcase.old_cwd is not None, \"test was not properly set up\"\n for i, step in enumerate(parse_script(testcase.input)):\n cmd = step[0]\n expected_lines = step[1:]\n assert cmd.startswith('$')\n cmd = cmd[1:].strip()\n cmd = cmd.replace('{python}', sys.executable)\n sts, output = run_cmd(cmd)\n output_lines = output.splitlines()\n output_lines = normalize_error_messages(output_lines)\n if sts:\n output_lines.append('== Return code: %d' % sts)\n assert_string_arrays_equal(expected_lines,\n output_lines,\n \"Command %d (%s) did not give expected output\" %\n (i + 1, cmd))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testdaemon.py_parse_script_parse_script.return.steps": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testdaemon.py_parse_script_parse_script.return.steps", "embedding": null, "metadata": {"file_path": "mypy/test/testdaemon.py", "file_name": "testdaemon.py", "file_type": "text/x-python", "category": "test", "start_line": 52, "end_line": 70, "span_ids": ["parse_script"], "tokens": 122}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def parse_script(input: List[str]) -> List[List[str]]:\n \"\"\"Parse testcase.input into steps.\n\n Each command starts with a line starting with '$'.\n The first line (less '$') is sent to the shell.\n The remaining lines are expected output.\n \"\"\"\n steps = []\n step = [] # type: List[str]\n for line in input:\n if line.startswith('$'):\n if step:\n assert step[0].startswith('$')\n steps.append(step)\n step = []\n step.append(line)\n if step:\n steps.append(step)\n return steps", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testdeps.py__Test_cases_for_generat_dumped_modules.___main___pkg_pkg_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testdeps.py__Test_cases_for_generat_dumped_modules.___main___pkg_pkg_", "embedding": null, "metadata": {"file_path": "mypy/test/testdeps.py", "file_name": "testdeps.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 22, "span_ids": ["docstring"], "tokens": 175}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Test cases for generating node-level dependencies (for fine-grained incremental checking)\"\"\"\n\nimport os\nfrom collections import defaultdict\n\nfrom typing import List, Tuple, Dict, Optional, Set\nfrom typing_extensions import DefaultDict\n\nfrom mypy import build, defaults\nfrom mypy.modulefinder import BuildSource\nfrom mypy.errors import CompileError\nfrom mypy.nodes import MypyFile, Expression\nfrom mypy.options import Options\nfrom mypy.server.deps import get_dependencies\nfrom mypy.test.config import test_temp_dir\nfrom mypy.test.data import DataDrivenTestCase, DataSuite\nfrom mypy.test.helpers import assert_string_arrays_equal, parse_options\nfrom mypy.types import Type\nfrom mypy.typestate import TypeState\n\n# Only dependencies in these modules are dumped\ndumped_modules = ['__main__', 'pkg', 'pkg.mod']", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testdeps.py_GetDependenciesSuite_GetDependenciesSuite.run_case.assert_string_arrays_equa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testdeps.py_GetDependenciesSuite_GetDependenciesSuite.run_case.assert_string_arrays_equa", "embedding": null, "metadata": {"file_path": "mypy/test/testdeps.py", "file_name": "testdeps.py", "file_type": "text/x-python", "category": "test", "start_line": 25, "end_line": 78, "span_ids": ["GetDependenciesSuite.run_case", "GetDependenciesSuite"], "tokens": 438}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GetDependenciesSuite(DataSuite):\n files = [\n 'deps.test',\n 'deps-types.test',\n 'deps-generics.test',\n 'deps-expressions.test',\n 'deps-statements.test',\n 'deps-classes.test',\n ]\n\n def run_case(self, testcase: DataDrivenTestCase) -> None:\n src = '\\n'.join(testcase.input)\n dump_all = '# __dump_all__' in src\n options = parse_options(src, testcase, incremental_step=1)\n if testcase.name.endswith('python2'):\n options.python_version = defaults.PYTHON2_VERSION\n options.use_builtins_fixtures = True\n options.show_traceback = True\n options.cache_dir = os.devnull\n options.export_types = True\n options.preserve_asts = True\n messages, files, type_map = self.build(src, options)\n a = messages\n if files is None or type_map is None:\n if not a:\n a = ['Unknown compile error (likely syntax error in test case or fixture)']\n else:\n deps = defaultdict(set) # type: DefaultDict[str, Set[str]]\n for module in files:\n if module in dumped_modules or dump_all and module not in ('abc',\n 'typing',\n 'mypy_extensions',\n 'typing_extensions',\n 'enum'):\n new_deps = get_dependencies(files[module], type_map, options.python_version,\n options)\n for source in new_deps:\n deps[source].update(new_deps[source])\n\n TypeState.add_all_protocol_deps(deps)\n\n for source, targets in sorted(deps.items()):\n if source.startswith((' Tuple[List[str],\n Optional[Dict[str, MypyFile]],\n Optional[Dict[Expression, Type]]]:\n try:\n result = build.build(sources=[BuildSource('main', None, source)],\n options=options,\n alt_lib_path=test_temp_dir)\n except CompileError as e:\n # TODO: Should perhaps not return None here.\n return e.messages, None, None\n return result.errors, result.files, result.types", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testdiff.py__Test_cases_for_AST_dif_from_mypy_test_helpers_im": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testdiff.py__Test_cases_for_AST_dif_from_mypy_test_helpers_im", "embedding": null, "metadata": {"file_path": "mypy/test/testdiff.py", "file_name": "testdiff.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 15, "span_ids": ["docstring"], "tokens": 131}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Test cases for AST diff (used for fine-grained incremental checking)\"\"\"\n\nimport os\nfrom typing import List, Tuple, Dict, Optional\n\nfrom mypy import build\nfrom mypy.modulefinder import BuildSource\nfrom mypy.defaults import PYTHON3_VERSION\nfrom mypy.errors import CompileError\nfrom mypy.nodes import MypyFile\nfrom mypy.options import Options\nfrom mypy.server.astdiff import snapshot_symbol_table, compare_symbol_table_snapshots\nfrom mypy.test.config import test_temp_dir\nfrom mypy.test.data import DataDrivenTestCase, DataSuite\nfrom mypy.test.helpers import assert_string_arrays_equal, parse_options", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testdiff.py_ASTDiffSuite_ASTDiffSuite.run_case.assert_string_arrays_equa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testdiff.py_ASTDiffSuite_ASTDiffSuite.run_case.assert_string_arrays_equa", "embedding": null, "metadata": {"file_path": "mypy/test/testdiff.py", "file_name": "testdiff.py", "file_type": "text/x-python", "category": "test", "start_line": 18, "end_line": 49, "span_ids": ["ASTDiffSuite", "ASTDiffSuite.run_case"], "tokens": 264}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTDiffSuite(DataSuite):\n files = ['diff.test']\n\n def run_case(self, testcase: DataDrivenTestCase) -> None:\n first_src = '\\n'.join(testcase.input)\n files_dict = dict(testcase.files)\n second_src = files_dict['tmp/next.py']\n options = parse_options(first_src, testcase, 1)\n\n messages1, files1 = self.build(first_src, options)\n messages2, files2 = self.build(second_src, options)\n\n a = []\n if messages1:\n a.extend(messages1)\n if messages2:\n a.append('== next ==')\n a.extend(messages2)\n\n assert files1 is not None and files2 is not None, ('cases where CompileError'\n ' occurred should not be run')\n prefix = '__main__'\n snapshot1 = snapshot_symbol_table(prefix, files1['__main__'].names)\n snapshot2 = snapshot_symbol_table(prefix, files2['__main__'].names)\n diff = compare_symbol_table_snapshots(prefix, snapshot1, snapshot2)\n for trigger in sorted(diff):\n a.append(trigger)\n\n assert_string_arrays_equal(\n testcase.output, a,\n 'Invalid output ({}, line {})'.format(testcase.file,\n testcase.line))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testdiff.py_ASTDiffSuite.build_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testdiff.py_ASTDiffSuite.build_", "embedding": null, "metadata": {"file_path": "mypy/test/testdiff.py", "file_name": "testdiff.py", "file_type": "text/x-python", "category": "test", "start_line": 51, "end_line": 65, "span_ids": ["ASTDiffSuite.build"], "tokens": 137}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTDiffSuite(DataSuite):\n\n def build(self, source: str,\n options: Options) -> Tuple[List[str], Optional[Dict[str, MypyFile]]]:\n options.use_builtins_fixtures = True\n options.show_traceback = True\n options.cache_dir = os.devnull\n options.python_version = PYTHON3_VERSION\n try:\n result = build.build(sources=[BuildSource('main', None, source)],\n options=options,\n alt_lib_path=test_temp_dir)\n except CompileError as e:\n # TODO: Is it okay to return None?\n return e.messages, None\n return result.errors, result.files", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testerrorstream.py__Tests_for_mypy_increme_ErrorStreamSuite.run_case.test_error_stream_testcas": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testerrorstream.py__Tests_for_mypy_increme_ErrorStreamSuite.run_case.test_error_stream_testcas", "embedding": null, "metadata": {"file_path": "mypy/test/testerrorstream.py", "file_name": "testerrorstream.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 18, "span_ids": ["ErrorStreamSuite", "ErrorStreamSuite.run_case", "docstring"], "tokens": 118}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Tests for mypy incremental error output.\"\"\"\nfrom typing import List\n\nfrom mypy import build\nfrom mypy.test.helpers import assert_string_arrays_equal\nfrom mypy.test.data import DataDrivenTestCase, DataSuite\nfrom mypy.modulefinder import BuildSource\nfrom mypy.errors import CompileError\nfrom mypy.options import Options\n\n\nclass ErrorStreamSuite(DataSuite):\n required_out_section = True\n base_path = '.'\n files = ['errorstream.test']\n\n def run_case(self, testcase: DataDrivenTestCase) -> None:\n test_error_stream(testcase)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testerrorstream.py_test_error_stream_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testerrorstream.py_test_error_stream_", "embedding": null, "metadata": {"file_path": "mypy/test/testerrorstream.py", "file_name": "testerrorstream.py", "file_type": "text/x-python", "category": "test", "start_line": 21, "end_line": 47, "span_ids": ["test_error_stream"], "tokens": 186}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_error_stream(testcase: DataDrivenTestCase) -> None:\n \"\"\"Perform a single error streaming test case.\n\n The argument contains the description of the test case.\n \"\"\"\n options = Options()\n options.show_traceback = True\n\n logged_messages = [] # type: List[str]\n\n def flush_errors(msgs: List[str], serious: bool) -> None:\n if msgs:\n logged_messages.append('==== Errors flushed ====')\n logged_messages.extend(msgs)\n\n sources = [BuildSource('main', '__main__', '\\n'.join(testcase.input))]\n try:\n build.build(sources=sources,\n options=options,\n flush_errors=flush_errors)\n except CompileError as e:\n assert e.messages == []\n\n assert_string_arrays_equal(testcase.output, logged_messages,\n 'Invalid output ({}, line {})'.format(\n testcase.file, testcase.line))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testfinegrained.py__Test_cases_for_fine_gr_CHECK_CONSISTENCY.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testfinegrained.py__Test_cases_for_fine_gr_CHECK_CONSISTENCY.False", "embedding": null, "metadata": {"file_path": "mypy/test/testfinegrained.py", "file_name": "testfinegrained.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 42, "span_ids": ["docstring"], "tokens": 313}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Test cases for fine-grained incremental checking.\n\nEach test cases runs a batch build followed by one or more fine-grained\nincremental steps. We verify that each step produces the expected output.\n\nSee the comment at the top of test-data/unit/fine-grained.test for more\ninformation.\n\nN.B.: Unlike most of the other test suites, testfinegrained does not\nrely on an alt_lib_path for finding source files. This means that they\ncan test interactions with the lib_path that is built implicitly based\non specified sources.\n\"\"\"\n\nimport os\nimport re\nimport shutil\n\nfrom typing import List, Dict, Any, Tuple, Union, cast\n\nfrom mypy import build\nfrom mypy.modulefinder import BuildSource\nfrom mypy.errors import CompileError\nfrom mypy.options import Options\nfrom mypy.test.config import test_temp_dir\nfrom mypy.test.data import (\n DataDrivenTestCase, DataSuite, UpdateFile, DeleteFile\n)\nfrom mypy.test.helpers import (\n assert_string_arrays_equal, parse_options, copy_and_fudge_mtime, assert_module_equivalence,\n assert_target_equivalence\n)\nfrom mypy.server.mergecheck import check_consistency\nfrom mypy.dmypy_util import DEFAULT_STATUS_FILE\nfrom mypy.dmypy_server import Server\nfrom mypy.config_parser import parse_config_file\nfrom mypy.find_sources import create_source_list\n\nimport pytest\n\n# Set to True to perform (somewhat expensive) checks for duplicate AST nodes after merge\nCHECK_CONSISTENCY = False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testfinegrained.py_FineGrainedSuite_FineGrainedSuite.should_skip.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testfinegrained.py_FineGrainedSuite_FineGrainedSuite.should_skip.return.False", "embedding": null, "metadata": {"file_path": "mypy/test/testfinegrained.py", "file_name": "testfinegrained.py", "file_type": "text/x-python", "category": "test", "start_line": 44, "end_line": 73, "span_ids": ["FineGrainedSuite.should_skip", "FineGrainedSuite"], "tokens": 248}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FineGrainedSuite(DataSuite):\n files = [\n 'fine-grained.test',\n 'fine-grained-cycles.test',\n 'fine-grained-blockers.test',\n 'fine-grained-modules.test',\n 'fine-grained-follow-imports.test',\n 'fine-grained-suggest.test',\n ]\n\n # Whether to use the fine-grained cache in the testing. This is overridden\n # by a trivial subclass to produce a suite that uses the cache.\n use_cache = False\n\n def should_skip(self, testcase: DataDrivenTestCase) -> bool:\n # Decide whether to skip the test. This could have been structured\n # as a filter() classmethod also, but we want the tests reported\n # as skipped, not just elided.\n if self.use_cache:\n if testcase.only_when == '-only_when_nocache':\n return True\n # TODO: In caching mode we currently don't well support\n # starting from cached states with errors in them.\n if testcase.output and testcase.output[0] != '==':\n return True\n else:\n if testcase.only_when == '-only_when_cache':\n return True\n\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testfinegrained.py_FineGrainedSuite.run_case_FineGrainedSuite.run_case.if_testcase_triggered_.assert_string_arrays_equa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testfinegrained.py_FineGrainedSuite.run_case_FineGrainedSuite.run_case.if_testcase_triggered_.assert_string_arrays_equa", "embedding": null, "metadata": {"file_path": "mypy/test/testfinegrained.py", "file_name": "testfinegrained.py", "file_type": "text/x-python", "category": "test", "start_line": 75, "end_line": 140, "span_ids": ["FineGrainedSuite.run_case"], "tokens": 445}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FineGrainedSuite(DataSuite):\n\n def run_case(self, testcase: DataDrivenTestCase) -> None:\n if self.should_skip(testcase):\n pytest.skip()\n return\n\n main_src = '\\n'.join(testcase.input)\n main_path = os.path.join(test_temp_dir, 'main')\n with open(main_path, 'w', encoding='utf8') as f:\n f.write(main_src)\n\n options = self.get_options(main_src, testcase, build_cache=False)\n build_options = self.get_options(main_src, testcase, build_cache=True)\n server = Server(options, DEFAULT_STATUS_FILE)\n\n num_regular_incremental_steps = self.get_build_steps(main_src)\n step = 1\n sources = self.parse_sources(main_src, step, options)\n if step <= num_regular_incremental_steps:\n messages = self.build(build_options, sources)\n else:\n messages = self.run_check(server, sources)\n\n a = []\n if messages:\n a.extend(normalize_messages(messages))\n\n assert testcase.tmpdir\n a.extend(self.maybe_suggest(step, server, main_src, testcase.tmpdir.name))\n\n if server.fine_grained_manager:\n if CHECK_CONSISTENCY:\n check_consistency(server.fine_grained_manager)\n\n steps = testcase.find_steps()\n all_triggered = []\n\n for operations in steps:\n step += 1\n output, triggered = self.perform_step(\n operations,\n server,\n options,\n build_options,\n testcase,\n main_src,\n step,\n num_regular_incremental_steps,\n )\n a.append('==')\n a.extend(output)\n all_triggered.extend(triggered)\n\n # Normalize paths in test output (for Windows).\n a = [line.replace('\\\\', '/') for line in a]\n\n assert_string_arrays_equal(\n testcase.output, a,\n 'Invalid output ({}, line {})'.format(\n testcase.file, testcase.line))\n\n if testcase.triggered:\n assert_string_arrays_equal(\n testcase.triggered,\n self.format_triggered(all_triggered),\n 'Invalid active triggers ({}, line {})'.format(testcase.file,\n testcase.line))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testfinegrained.py_FineGrainedSuite.get_options_FineGrainedSuite.get_options.return.options": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testfinegrained.py_FineGrainedSuite.get_options_FineGrainedSuite.get_options.return.options", "embedding": null, "metadata": {"file_path": "mypy/test/testfinegrained.py", "file_name": "testfinegrained.py", "file_type": "text/x-python", "category": "test", "start_line": 142, "end_line": 165, "span_ids": ["FineGrainedSuite.get_options"], "tokens": 218}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FineGrainedSuite(DataSuite):\n\n def get_options(self,\n source: str,\n testcase: DataDrivenTestCase,\n build_cache: bool,) -> Options:\n # This handles things like '# flags: --foo'.\n options = parse_options(source, testcase, incremental_step=1)\n options.incremental = True\n options.use_builtins_fixtures = True\n options.show_traceback = True\n options.error_summary = False\n options.fine_grained_incremental = not build_cache\n options.use_fine_grained_cache = self.use_cache and not build_cache\n options.cache_fine_grained = self.use_cache\n options.local_partial_types = True\n if re.search('flags:.*--follow-imports', source) is None:\n # Override the default for follow_imports\n options.follow_imports = 'error'\n\n for name, _ in testcase.files:\n if 'mypy.ini' in name:\n parse_config_file(options, lambda: None, name)\n break\n\n return options", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testfinegrained.py_FineGrainedSuite.run_check_FineGrainedSuite.get_build_steps.return.1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testfinegrained.py_FineGrainedSuite.run_check_FineGrainedSuite.get_build_steps.return.1", "embedding": null, "metadata": {"file_path": "mypy/test/testfinegrained.py", "file_name": "testfinegrained.py", "file_type": "text/x-python", "category": "test", "start_line": 167, "end_line": 198, "span_ids": ["FineGrainedSuite.build", "FineGrainedSuite.get_build_steps", "FineGrainedSuite.run_check", "FineGrainedSuite.format_triggered"], "tokens": 294}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FineGrainedSuite(DataSuite):\n\n def run_check(self, server: Server, sources: List[BuildSource]) -> List[str]:\n response = server.check(sources, is_tty=False, terminal_width=-1)\n out = cast(str, response['out'] or response['err'])\n return out.splitlines()\n\n def build(self,\n options: Options,\n sources: List[BuildSource]) -> List[str]:\n try:\n result = build.build(sources=sources,\n options=options)\n except CompileError as e:\n return e.messages\n return result.errors\n\n def format_triggered(self, triggered: List[List[str]]) -> List[str]:\n result = []\n for n, triggers in enumerate(triggered):\n filtered = [trigger for trigger in triggers\n if not trigger.endswith('__>')]\n filtered = sorted(filtered)\n result.append(('%d: %s' % (n + 2, ', '.join(filtered))).strip())\n return result\n\n def get_build_steps(self, program_text: str) -> int:\n \"\"\"Get the number of regular incremental steps to run, from the test source\"\"\"\n if not self.use_cache:\n return 0\n m = re.search('# num_build_steps: ([0-9]+)$', program_text, flags=re.MULTILINE)\n if m is not None:\n return int(m.group(1))\n return 1", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testfinegrained.py_FineGrainedSuite.perform_step_FineGrainedSuite.perform_step.return.a_triggered": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testfinegrained.py_FineGrainedSuite.perform_step_FineGrainedSuite.perform_step.return.a_triggered", "embedding": null, "metadata": {"file_path": "mypy/test/testfinegrained.py", "file_name": "testfinegrained.py", "file_type": "text/x-python", "category": "test", "start_line": 201, "end_line": 270, "span_ids": ["FineGrainedSuite.perform_step"], "tokens": 547}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FineGrainedSuite(DataSuite):\n\n def perform_step(self,\n operations: List[Union[UpdateFile, DeleteFile]],\n server: Server,\n options: Options,\n build_options: Options,\n testcase: DataDrivenTestCase,\n main_src: str,\n step: int,\n num_regular_incremental_steps: int) -> Tuple[List[str], List[List[str]]]:\n \"\"\"Perform one fine-grained incremental build step (after some file updates/deletions).\n\n Return (mypy output, triggered targets).\n \"\"\"\n for op in operations:\n if isinstance(op, UpdateFile):\n # Modify/create file\n copy_and_fudge_mtime(op.source_path, op.target_path)\n else:\n # Delete file/directory\n if os.path.isdir(op.path):\n # Sanity check to avoid unexpected deletions\n assert op.path.startswith('tmp')\n shutil.rmtree(op.path)\n else:\n os.remove(op.path)\n sources = self.parse_sources(main_src, step, options)\n\n if step <= num_regular_incremental_steps:\n new_messages = self.build(build_options, sources)\n else:\n new_messages = self.run_check(server, sources)\n\n updated = [] # type: List[str]\n changed = [] # type: List[str]\n targets = [] # type: List[str]\n triggered = []\n if server.fine_grained_manager:\n if CHECK_CONSISTENCY:\n check_consistency(server.fine_grained_manager)\n triggered.append(server.fine_grained_manager.triggered)\n\n updated = server.fine_grained_manager.updated_modules\n changed = [mod for mod, file in server.fine_grained_manager.changed_modules]\n targets = server.fine_grained_manager.processed_targets\n\n expected_stale = testcase.expected_stale_modules.get(step - 1)\n if expected_stale is not None:\n assert_module_equivalence(\n 'stale' + str(step - 1),\n expected_stale, changed)\n\n expected_rechecked = testcase.expected_rechecked_modules.get(step - 1)\n if expected_rechecked is not None:\n assert_module_equivalence(\n 'rechecked' + str(step - 1),\n expected_rechecked, updated)\n\n expected = testcase.expected_fine_grained_targets.get(step)\n if expected:\n assert_target_equivalence(\n 'targets' + str(step),\n expected, targets)\n\n new_messages = normalize_messages(new_messages)\n\n a = new_messages\n assert testcase.tmpdir\n a.extend(self.maybe_suggest(step, server, main_src, testcase.tmpdir.name))\n\n return a, triggered", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testfinegrained.py_FineGrainedSuite.parse_sources_FineGrainedSuite.parse_sources.if_m_.else_.return._base_create_source_li": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testfinegrained.py_FineGrainedSuite.parse_sources_FineGrainedSuite.parse_sources.if_m_.else_.return._base_create_source_li", "embedding": null, "metadata": {"file_path": "mypy/test/testfinegrained.py", "file_name": "testfinegrained.py", "file_type": "text/x-python", "category": "test", "start_line": 266, "end_line": 303, "span_ids": ["FineGrainedSuite.parse_sources"], "tokens": 402}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FineGrainedSuite(DataSuite):\n\n def parse_sources(self, program_text: str,\n incremental_step: int,\n options: Options) -> List[BuildSource]:\n \"\"\"Return target BuildSources for a test case.\n\n Normally, the unit tests will check all files included in the test\n case. This differs from how testcheck works by default, as dmypy\n doesn't currently support following imports.\n\n You can override this behavior and instruct the tests to check\n multiple modules by using a comment like this in the test case\n input:\n\n # cmd: main a.py\n\n You can also use `# cmdN:` to have a different cmd for incremental\n step N (2, 3, ...).\n\n \"\"\"\n m = re.search('# cmd: mypy ([a-zA-Z0-9_./ ]+)$', program_text, flags=re.MULTILINE)\n regex = '# cmd{}: mypy ([a-zA-Z0-9_./ ]+)$'.format(incremental_step)\n alt_m = re.search(regex, program_text, flags=re.MULTILINE)\n if alt_m is not None:\n # Optionally return a different command if in a later step\n # of incremental mode, otherwise default to reusing the\n # original cmd.\n m = alt_m\n\n if m:\n # The test case wants to use a non-default set of files.\n paths = [os.path.join(test_temp_dir, path) for path in m.group(1).strip().split()]\n return create_source_list(paths, options)\n else:\n base = BuildSource(os.path.join(test_temp_dir, 'main'), '__main__', None)\n # Use expand_dir instead of create_source_list to avoid complaints\n # when there aren't any .py files in an increment\n return [base] + create_source_list([test_temp_dir], options,\n allow_empty_dir=True)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testfinegrained.py_FineGrainedSuite.maybe_suggest_FineGrainedSuite.maybe_suggest.return.normalize_messages_output": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testfinegrained.py_FineGrainedSuite.maybe_suggest_FineGrainedSuite.maybe_suggest.return.normalize_messages_output", "embedding": null, "metadata": {"file_path": "mypy/test/testfinegrained.py", "file_name": "testfinegrained.py", "file_type": "text/x-python", "category": "test", "start_line": 305, "end_line": 331, "span_ids": ["FineGrainedSuite.maybe_suggest"], "tokens": 375}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FineGrainedSuite(DataSuite):\n\n def maybe_suggest(self, step: int, server: Server, src: str, tmp_dir: str) -> List[str]:\n output = [] # type: List[str]\n targets = self.get_suggest(src, step)\n for flags, target in targets:\n json = '--json' in flags\n callsites = '--callsites' in flags\n no_any = '--no-any' in flags\n no_errors = '--no-errors' in flags\n try_text = '--try-text' in flags\n m = re.match('--flex-any=([0-9.]+)', flags)\n flex_any = float(m.group(1)) if m else None\n m = re.match(r'--use-fixme=(\\w+)', flags)\n use_fixme = m.group(1) if m else None\n m = re.match('--max-guesses=([0-9]+)', flags)\n max_guesses = int(m.group(1)) if m else None\n res = cast(Dict[str, Any],\n server.cmd_suggest(\n target.strip(), json=json, no_any=no_any, no_errors=no_errors,\n try_text=try_text, flex_any=flex_any, use_fixme=use_fixme,\n callsites=callsites, max_guesses=max_guesses))\n val = res['error'] if 'error' in res else res['out'] + res['err']\n if json:\n # JSON contains already escaped \\ on Windows, so requires a bit of care.\n val = val.replace('\\\\\\\\', '\\\\')\n val = val.replace(os.path.realpath(tmp_dir) + os.path.sep, '')\n output.extend(val.strip().split('\\n'))\n return normalize_messages(output)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testfinegrained.py_FineGrainedSuite.get_suggest_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testfinegrained.py_FineGrainedSuite.get_suggest_", "embedding": null, "metadata": {"file_path": "mypy/test/testfinegrained.py", "file_name": "testfinegrained.py", "file_type": "text/x-python", "category": "test", "start_line": 333, "end_line": 344, "span_ids": ["FineGrainedSuite.get_suggest", "normalize_messages"], "tokens": 151}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FineGrainedSuite(DataSuite):\n\n def get_suggest(self, program_text: str,\n incremental_step: int) -> List[Tuple[str, str]]:\n step_bit = '1?' if incremental_step == 1 else str(incremental_step)\n regex = '# suggest{}: (--[a-zA-Z0-9_\\\\-./=?^ ]+ )*([a-zA-Z0-9_.:/?^ ]+)$'.format(step_bit)\n m = re.findall(regex, program_text, flags=re.MULTILINE)\n return m\n\n\ndef normalize_messages(messages: List[str]) -> List[str]:\n return [re.sub('^tmp' + re.escape(os.sep), '', message)\n for message in messages]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testfinegrainedcache.py__Tests_for_fine_grained_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testfinegrainedcache.py__Tests_for_fine_grained_", "embedding": null, "metadata": {"file_path": "mypy/test/testfinegrainedcache.py", "file_name": "testfinegrainedcache.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 16, "span_ids": ["FineGrainedCacheSuite", "docstring"], "tokens": 130}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Tests for fine-grained incremental checking using the cache.\n\nAll of the real code for this lives in testfinegrained.py.\n\"\"\"\n\n# We can't \"import FineGrainedSuite from ...\" because that will cause pytest\n# to collect the non-caching tests when running this file.\nimport mypy.test.testfinegrained\n\n\nclass FineGrainedCacheSuite(mypy.test.testfinegrained.FineGrainedSuite):\n use_cache = True\n test_name_suffix = '_cached'\n files = (\n mypy.test.testfinegrained.FineGrainedSuite.files + ['fine-grained-cache-incremental.test'])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testformatter.py_from_unittest_import_Test_FancyErrorFormattingTestCases.test_trim_source.None_8": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testformatter.py_from_unittest_import_Test_FancyErrorFormattingTestCases.test_trim_source.None_8", "embedding": null, "metadata": {"file_path": "mypy/test/testformatter.py", "file_name": "testformatter.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 31, "span_ids": ["FancyErrorFormattingTestCases", "imports", "FancyErrorFormattingTestCases.test_trim_source"], "tokens": 384}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from unittest import TestCase, main\n\nfrom mypy.util import trim_source_line, split_words\n\n\nclass FancyErrorFormattingTestCases(TestCase):\n def test_trim_source(self) -> None:\n assert trim_source_line('0123456789abcdef',\n max_len=16, col=5, min_width=2) == ('0123456789abcdef', 0)\n\n # Locations near start.\n assert trim_source_line('0123456789abcdef',\n max_len=7, col=0, min_width=2) == ('0123456...', 0)\n assert trim_source_line('0123456789abcdef',\n max_len=7, col=4, min_width=2) == ('0123456...', 0)\n\n # Middle locations.\n assert trim_source_line('0123456789abcdef',\n max_len=7, col=5, min_width=2) == ('...1234567...', -2)\n assert trim_source_line('0123456789abcdef',\n max_len=7, col=6, min_width=2) == ('...2345678...', -1)\n assert trim_source_line('0123456789abcdef',\n max_len=7, col=8, min_width=2) == ('...456789a...', 1)\n\n # Locations near the end.\n assert trim_source_line('0123456789abcdef',\n max_len=7, col=11, min_width=2) == ('...789abcd...', 4)\n assert trim_source_line('0123456789abcdef',\n max_len=7, col=13, min_width=2) == ('...9abcdef', 6)\n assert trim_source_line('0123456789abcdef',\n max_len=7, col=15, min_width=2) == ('...9abcdef', 6)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testformatter.py_FancyErrorFormattingTestCases.test_split_words_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testformatter.py_FancyErrorFormattingTestCases.test_split_words_", "embedding": null, "metadata": {"file_path": "mypy/test/testformatter.py", "file_name": "testformatter.py", "file_type": "text/x-python", "category": "test", "start_line": 33, "end_line": 52, "span_ids": ["FancyErrorFormattingTestCases.test_split_words", "impl"], "tokens": 244}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FancyErrorFormattingTestCases(TestCase):\n\n def test_split_words(self) -> None:\n assert split_words('Simple message') == ['Simple', 'message']\n assert split_words('Message with \"Some[Long, Types]\"'\n ' in it') == ['Message', 'with',\n '\"Some[Long, Types]\"', 'in', 'it']\n assert split_words('Message with \"Some[Long, Types]\"'\n ' and [error-code]') == ['Message', 'with', '\"Some[Long, Types]\"',\n 'and', '[error-code]']\n assert split_words('\"Type[Stands, First]\" then words') == ['\"Type[Stands, First]\"',\n 'then', 'words']\n assert split_words('First words \"Then[Stands, Type]\"') == ['First', 'words',\n '\"Then[Stands, Type]\"']\n assert split_words('\"Type[Only, Here]\"') == ['\"Type[Only, Here]\"']\n assert split_words('OneWord') == ['OneWord']\n assert split_words(' ') == ['', '']\n\n\nif __name__ == '__main__':\n main()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testgraph.py__Test_cases_for_graph_p_from_mypy_fscache_import_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testgraph.py__Test_cases_for_graph_p_from_mypy_fscache_import_", "embedding": null, "metadata": {"file_path": "mypy/test/testgraph.py", "file_name": "testgraph.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 15, "span_ids": ["docstring"], "tokens": 124}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Test cases for graph processing code in build.py.\"\"\"\n\nimport sys\nfrom typing import AbstractSet, Dict, Set, List\n\nfrom mypy.test.helpers import assert_equal, Suite\nfrom mypy.build import BuildManager, State, BuildSourceSet\nfrom mypy.modulefinder import SearchPaths\nfrom mypy.build import topsort, strongly_connected_components, sorted_components, order_ascc\nfrom mypy.version import __version__\nfrom mypy.options import Options\nfrom mypy.report import Reports\nfrom mypy.plugin import Plugin\nfrom mypy.errors import Errors\nfrom mypy.fscache import FileSystemCache", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testgraph.py_GraphSuite_GraphSuite.test_topsort.assert_equal_res_d_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testgraph.py_GraphSuite_GraphSuite.test_topsort.assert_equal_res_d_", "embedding": null, "metadata": {"file_path": "mypy/test/testgraph.py", "file_name": "testgraph.py", "file_type": "text/x-python", "category": "test", "start_line": 18, "end_line": 27, "span_ids": ["GraphSuite", "GraphSuite.test_topsort"], "tokens": 117}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GraphSuite(Suite):\n\n def test_topsort(self) -> None:\n a = frozenset({'A'})\n b = frozenset({'B'})\n c = frozenset({'C'})\n d = frozenset({'D'})\n data = {a: {b, c}, b: {d}, c: {d}} # type: Dict[AbstractSet[str], Set[AbstractSet[str]]]\n res = list(topsort(data))\n assert_equal(res, [{d}, {b, c}, {a}])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testgraph.py_GraphSuite.test_scc_GraphSuite.test_scc.assert_equal_sccs_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testgraph.py_GraphSuite.test_scc_GraphSuite.test_scc.assert_equal_sccs_", "embedding": null, "metadata": {"file_path": "mypy/test/testgraph.py", "file_name": "testgraph.py", "file_type": "text/x-python", "category": "test", "start_line": 29, "end_line": 39, "span_ids": ["GraphSuite.test_scc"], "tokens": 132}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GraphSuite(Suite):\n\n def test_scc(self) -> None:\n vertices = {'A', 'B', 'C', 'D'}\n edges = {'A': ['B', 'C'],\n 'B': ['C'],\n 'C': ['B', 'D'],\n 'D': []} # type: Dict[str, List[str]]\n sccs = set(frozenset(x) for x in strongly_connected_components(vertices, edges))\n assert_equal(sccs,\n {frozenset({'A'}),\n frozenset({'B', 'C'}),\n frozenset({'D'})})", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testgraph.py_GraphSuite._make_manager_GraphSuite._make_manager.return.manager": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testgraph.py_GraphSuite._make_manager_GraphSuite._make_manager.return.manager", "embedding": null, "metadata": {"file_path": "mypy/test/testgraph.py", "file_name": "testgraph.py", "file_type": "text/x-python", "category": "test", "start_line": 41, "end_line": 62, "span_ids": ["GraphSuite._make_manager"], "tokens": 140}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GraphSuite(Suite):\n\n def _make_manager(self) -> BuildManager:\n errors = Errors()\n options = Options()\n fscache = FileSystemCache()\n search_paths = SearchPaths((), (), (), ())\n manager = BuildManager(\n data_dir='',\n search_paths=search_paths,\n ignore_prefix='',\n source_set=BuildSourceSet([]),\n reports=Reports('', {}),\n options=options,\n version_id=__version__,\n plugin=Plugin(options),\n plugins_snapshot={},\n errors=errors,\n flush_errors=lambda msgs, serious: None,\n fscache=fscache,\n stdout=sys.stdout,\n stderr=sys.stderr,\n )\n return manager", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testgraph.py_GraphSuite.test_sorted_components_GraphSuite.test_sorted_components.assert_equal_res_frozen": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testgraph.py_GraphSuite.test_sorted_components_GraphSuite.test_sorted_components.assert_equal_res_frozen", "embedding": null, "metadata": {"file_path": "mypy/test/testgraph.py", "file_name": "testgraph.py", "file_type": "text/x-python", "category": "test", "start_line": 64, "end_line": 72, "span_ids": ["GraphSuite.test_sorted_components"], "tokens": 133}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GraphSuite(Suite):\n\n def test_sorted_components(self) -> None:\n manager = self._make_manager()\n graph = {'a': State('a', None, 'import b, c', manager),\n 'd': State('d', None, 'pass', manager),\n 'b': State('b', None, 'import c', manager),\n 'c': State('c', None, 'import b, d', manager),\n }\n res = sorted_components(graph)\n assert_equal(res, [frozenset({'d'}), frozenset({'c', 'b'}), frozenset({'a'})])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testgraph.py_GraphSuite.test_order_ascc_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testgraph.py_GraphSuite.test_order_ascc_", "embedding": null, "metadata": {"file_path": "mypy/test/testgraph.py", "file_name": "testgraph.py", "file_type": "text/x-python", "category": "test", "start_line": 74, "end_line": 86, "span_ids": ["GraphSuite.test_order_ascc"], "tokens": 168}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GraphSuite(Suite):\n\n def test_order_ascc(self) -> None:\n manager = self._make_manager()\n graph = {'a': State('a', None, 'import b, c', manager),\n 'd': State('d', None, 'def f(): import a', manager),\n 'b': State('b', None, 'import c', manager),\n 'c': State('c', None, 'import b, d', manager),\n }\n res = sorted_components(graph)\n assert_equal(res, [frozenset({'a', 'd', 'c', 'b'})])\n ascc = res[0]\n scc = order_ascc(graph, ascc)\n assert_equal(scc, ['d', 'c', 'b', 'a'])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py__Test_cases_for_type_in_from_mypy_test_typefixtur": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py__Test_cases_for_type_in_from_mypy_test_typefixtur", "embedding": null, "metadata": {"file_path": "mypy/test/testinfer.py", "file_name": "testinfer.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 11, "span_ids": ["docstring"], "tokens": 122}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Test cases for type inference helper functions.\"\"\"\n\nfrom typing import List, Optional, Tuple, Union, Dict, Set\n\nfrom mypy.test.helpers import Suite, assert_equal\nfrom mypy.argmap import map_actuals_to_formals\nfrom mypy.checker import group_comparison_operands, DisjointDict\nfrom mypy.literals import Key\nfrom mypy.nodes import ARG_POS, ARG_OPT, ARG_STAR, ARG_STAR2, ARG_NAMED, NameExpr\nfrom mypy.types import AnyType, TupleType, Type, TypeOfAny\nfrom mypy.test.typefixture import TypeFixture", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py_MapActualsToFormalsSuite_MapActualsToFormalsSuite.test_too_many_caller_args.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py_MapActualsToFormalsSuite_MapActualsToFormalsSuite.test_too_many_caller_args.None_2", "embedding": null, "metadata": {"file_path": "mypy/test/testinfer.py", "file_name": "testinfer.py", "file_type": "text/x-python", "category": "test", "start_line": 14, "end_line": 73, "span_ids": ["MapActualsToFormalsSuite.test_positional_only", "MapActualsToFormalsSuite.test_optional", "MapActualsToFormalsSuite.test_basic", "MapActualsToFormalsSuite.test_callee_star", "MapActualsToFormalsSuite.test_caller_star", "MapActualsToFormalsSuite", "MapActualsToFormalsSuite.test_too_many_caller_args"], "tokens": 374}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MapActualsToFormalsSuite(Suite):\n \"\"\"Test cases for argmap.map_actuals_to_formals.\"\"\"\n\n def test_basic(self) -> None:\n self.assert_map([], [], [])\n\n def test_positional_only(self) -> None:\n self.assert_map([ARG_POS],\n [ARG_POS],\n [[0]])\n self.assert_map([ARG_POS, ARG_POS],\n [ARG_POS, ARG_POS],\n [[0], [1]])\n\n def test_optional(self) -> None:\n self.assert_map([],\n [ARG_OPT],\n [[]])\n self.assert_map([ARG_POS],\n [ARG_OPT],\n [[0]])\n self.assert_map([ARG_POS],\n [ARG_OPT, ARG_OPT],\n [[0], []])\n\n def test_callee_star(self) -> None:\n self.assert_map([],\n [ARG_STAR],\n [[]])\n self.assert_map([ARG_POS],\n [ARG_STAR],\n [[0]])\n self.assert_map([ARG_POS, ARG_POS],\n [ARG_STAR],\n [[0, 1]])\n\n def test_caller_star(self) -> None:\n self.assert_map([ARG_STAR],\n [ARG_STAR],\n [[0]])\n self.assert_map([ARG_POS, ARG_STAR],\n [ARG_STAR],\n [[0, 1]])\n self.assert_map([ARG_STAR],\n [ARG_POS, ARG_STAR],\n [[0], [0]])\n self.assert_map([ARG_STAR],\n [ARG_OPT, ARG_STAR],\n [[0], [0]])\n\n def test_too_many_caller_args(self) -> None:\n self.assert_map([ARG_POS],\n [],\n [])\n self.assert_map([ARG_STAR],\n [],\n [])\n self.assert_map([ARG_STAR],\n [ARG_POS],\n [[0]])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py_MapActualsToFormalsSuite.test_tuple_star_MapActualsToFormalsSuite.test_tuple_star.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py_MapActualsToFormalsSuite.test_tuple_star_MapActualsToFormalsSuite.test_tuple_star.None_2", "embedding": null, "metadata": {"file_path": "mypy/test/testinfer.py", "file_name": "testinfer.py", "file_type": "text/x-python", "category": "test", "start_line": 75, "end_line": 91, "span_ids": ["MapActualsToFormalsSuite.test_tuple_star"], "tokens": 140}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MapActualsToFormalsSuite(Suite):\n\n def test_tuple_star(self) -> None:\n any_type = AnyType(TypeOfAny.special_form)\n self.assert_vararg_map(\n [ARG_STAR],\n [ARG_POS],\n [[0]],\n self.tuple(any_type))\n self.assert_vararg_map(\n [ARG_STAR],\n [ARG_POS, ARG_POS],\n [[0], [0]],\n self.tuple(any_type, any_type))\n self.assert_vararg_map(\n [ARG_STAR],\n [ARG_POS, ARG_OPT, ARG_OPT],\n [[0], [0], []],\n self.tuple(any_type, any_type))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py_MapActualsToFormalsSuite.tuple_MapActualsToFormalsSuite.test_varargs_and_bare_asterisk.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py_MapActualsToFormalsSuite.tuple_MapActualsToFormalsSuite.test_varargs_and_bare_asterisk.None_1", "embedding": null, "metadata": {"file_path": "mypy/test/testinfer.py", "file_name": "testinfer.py", "file_type": "text/x-python", "category": "test", "start_line": 93, "end_line": 132, "span_ids": ["MapActualsToFormalsSuite.test_some_named_args", "MapActualsToFormalsSuite.tuple", "MapActualsToFormalsSuite.test_duplicate_named_arg", "MapActualsToFormalsSuite.test_varargs_and_bare_asterisk", "MapActualsToFormalsSuite.test_named_args", "MapActualsToFormalsSuite.test_missing_named_arg"], "tokens": 300}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MapActualsToFormalsSuite(Suite):\n\n def tuple(self, *args: Type) -> TupleType:\n return TupleType(list(args), TypeFixture().std_tuple)\n\n def test_named_args(self) -> None:\n self.assert_map(\n ['x'],\n [(ARG_POS, 'x')],\n [[0]])\n self.assert_map(\n ['y', 'x'],\n [(ARG_POS, 'x'), (ARG_POS, 'y')],\n [[1], [0]])\n\n def test_some_named_args(self) -> None:\n self.assert_map(\n ['y'],\n [(ARG_OPT, 'x'), (ARG_OPT, 'y'), (ARG_OPT, 'z')],\n [[], [0], []])\n\n def test_missing_named_arg(self) -> None:\n self.assert_map(\n ['y'],\n [(ARG_OPT, 'x')],\n [[]])\n\n def test_duplicate_named_arg(self) -> None:\n self.assert_map(\n ['x', 'x'],\n [(ARG_OPT, 'x')],\n [[0, 1]])\n\n def test_varargs_and_bare_asterisk(self) -> None:\n self.assert_map(\n [ARG_STAR],\n [ARG_STAR, (ARG_NAMED, 'x')],\n [[0], []])\n self.assert_map(\n [ARG_STAR, 'x'],\n [ARG_STAR, (ARG_NAMED, 'x')],\n [[0], [1]])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py_MapActualsToFormalsSuite.test_keyword_varargs_MapActualsToFormalsSuite.test_keyword_varargs.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py_MapActualsToFormalsSuite.test_keyword_varargs_MapActualsToFormalsSuite.test_keyword_varargs.None_3", "embedding": null, "metadata": {"file_path": "mypy/test/testinfer.py", "file_name": "testinfer.py", "file_type": "text/x-python", "category": "test", "start_line": 134, "end_line": 150, "span_ids": ["MapActualsToFormalsSuite.test_keyword_varargs"], "tokens": 132}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MapActualsToFormalsSuite(Suite):\n\n def test_keyword_varargs(self) -> None:\n self.assert_map(\n ['x'],\n [ARG_STAR2],\n [[0]])\n self.assert_map(\n ['x', ARG_STAR2],\n [ARG_STAR2],\n [[0, 1]])\n self.assert_map(\n ['x', ARG_STAR2],\n [(ARG_POS, 'x'), ARG_STAR2],\n [[0], [1]])\n self.assert_map(\n [ARG_POS, ARG_STAR2],\n [(ARG_POS, 'x'), ARG_STAR2],\n [[0], [1]])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py_MapActualsToFormalsSuite.test_both_kinds_of_varargs_MapActualsToFormalsSuite.test_special_cases.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py_MapActualsToFormalsSuite.test_both_kinds_of_varargs_MapActualsToFormalsSuite.test_special_cases.None_3", "embedding": null, "metadata": {"file_path": "mypy/test/testinfer.py", "file_name": "testinfer.py", "file_type": "text/x-python", "category": "test", "start_line": 152, "end_line": 170, "span_ids": ["MapActualsToFormalsSuite.test_special_cases", "MapActualsToFormalsSuite.test_both_kinds_of_varargs"], "tokens": 175}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MapActualsToFormalsSuite(Suite):\n\n def test_both_kinds_of_varargs(self) -> None:\n self.assert_map(\n [ARG_STAR, ARG_STAR2],\n [(ARG_POS, 'x'), (ARG_POS, 'y')],\n [[0, 1], [0, 1]])\n\n def test_special_cases(self) -> None:\n self.assert_map([ARG_STAR],\n [ARG_STAR, ARG_STAR2],\n [[0], []])\n self.assert_map([ARG_STAR, ARG_STAR2],\n [ARG_STAR, ARG_STAR2],\n [[0], [1]])\n self.assert_map([ARG_STAR2],\n [(ARG_POS, 'x'), ARG_STAR2],\n [[0], [0]])\n self.assert_map([ARG_STAR2],\n [ARG_STAR2],\n [[0]])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py_MapActualsToFormalsSuite.assert_map_MapActualsToFormalsSuite.assert_vararg_map.assert_equal_result_expe": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py_MapActualsToFormalsSuite.assert_map_MapActualsToFormalsSuite.assert_vararg_map.assert_equal_result_expe", "embedding": null, "metadata": {"file_path": "mypy/test/testinfer.py", "file_name": "testinfer.py", "file_type": "text/x-python", "category": "test", "start_line": 172, "end_line": 199, "span_ids": ["MapActualsToFormalsSuite.assert_map", "MapActualsToFormalsSuite.assert_vararg_map"], "tokens": 222}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MapActualsToFormalsSuite(Suite):\n\n def assert_map(self,\n caller_kinds_: List[Union[int, str]],\n callee_kinds_: List[Union[int, Tuple[int, str]]],\n expected: List[List[int]],\n ) -> None:\n caller_kinds, caller_names = expand_caller_kinds(caller_kinds_)\n callee_kinds, callee_names = expand_callee_kinds(callee_kinds_)\n result = map_actuals_to_formals(\n caller_kinds,\n caller_names,\n callee_kinds,\n callee_names,\n lambda i: AnyType(TypeOfAny.special_form))\n assert_equal(result, expected)\n\n def assert_vararg_map(self,\n caller_kinds: List[int],\n callee_kinds: List[int],\n expected: List[List[int]],\n vararg_type: Type,\n ) -> None:\n result = map_actuals_to_formals(\n caller_kinds,\n [],\n callee_kinds,\n [],\n lambda i: vararg_type)\n assert_equal(result, expected)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py_expand_caller_kinds_expand_callee_kinds.return.kinds_names": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py_expand_caller_kinds_expand_callee_kinds.return.kinds_names", "embedding": null, "metadata": {"file_path": "mypy/test/testinfer.py", "file_name": "testinfer.py", "file_type": "text/x-python", "category": "test", "start_line": 202, "end_line": 227, "span_ids": ["expand_caller_kinds", "expand_callee_kinds"], "tokens": 193}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def expand_caller_kinds(kinds_or_names: List[Union[int, str]]\n ) -> Tuple[List[int], List[Optional[str]]]:\n kinds = []\n names = [] # type: List[Optional[str]]\n for k in kinds_or_names:\n if isinstance(k, str):\n kinds.append(ARG_NAMED)\n names.append(k)\n else:\n kinds.append(k)\n names.append(None)\n return kinds, names\n\n\ndef expand_callee_kinds(kinds_and_names: List[Union[int, Tuple[int, str]]]\n ) -> Tuple[List[int], List[Optional[str]]]:\n kinds = []\n names = [] # type: List[Optional[str]]\n for v in kinds_and_names:\n if isinstance(v, tuple):\n kinds.append(v[0])\n names.append(v[1])\n else:\n kinds.append(v)\n names.append(None)\n return kinds, names", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py_OperandDisjointDictSuite_OperandDisjointDictSuite.test_independent_maps.self_assertEqual_d_items_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py_OperandDisjointDictSuite_OperandDisjointDictSuite.test_independent_maps.self_assertEqual_d_items_", "embedding": null, "metadata": {"file_path": "mypy/test/testinfer.py", "file_name": "testinfer.py", "file_type": "text/x-python", "category": "test", "start_line": 230, "end_line": 245, "span_ids": ["OperandDisjointDictSuite", "OperandDisjointDictSuite.test_independent_maps", "OperandDisjointDictSuite.new"], "tokens": 161}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class OperandDisjointDictSuite(Suite):\n \"\"\"Test cases for checker.DisjointDict, which is used for type inference with operands.\"\"\"\n def new(self) -> DisjointDict[int, str]:\n return DisjointDict()\n\n def test_independent_maps(self) -> None:\n d = self.new()\n d.add_mapping({0, 1}, {\"group1\"})\n d.add_mapping({2, 3, 4}, {\"group2\"})\n d.add_mapping({5, 6, 7}, {\"group3\"})\n\n self.assertEqual(d.items(), [\n ({0, 1}, {\"group1\"}),\n ({2, 3, 4}, {\"group2\"}),\n ({5, 6, 7}, {\"group3\"}),\n ])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py_OperandDisjointDictSuite.test_partial_merging_OperandDisjointDictSuite.test_partial_merging.self_assertEqual_d_items_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py_OperandDisjointDictSuite.test_partial_merging_OperandDisjointDictSuite.test_partial_merging.self_assertEqual_d_items_", "embedding": null, "metadata": {"file_path": "mypy/test/testinfer.py", "file_name": "testinfer.py", "file_type": "text/x-python", "category": "test", "start_line": 247, "end_line": 259, "span_ids": ["OperandDisjointDictSuite.test_partial_merging"], "tokens": 170}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class OperandDisjointDictSuite(Suite):\n\n def test_partial_merging(self) -> None:\n d = self.new()\n d.add_mapping({0, 1}, {\"group1\"})\n d.add_mapping({1, 2}, {\"group2\"})\n d.add_mapping({3, 4}, {\"group3\"})\n d.add_mapping({5, 0}, {\"group4\"})\n d.add_mapping({5, 6}, {\"group5\"})\n d.add_mapping({4, 7}, {\"group6\"})\n\n self.assertEqual(d.items(), [\n ({0, 1, 2, 5, 6}, {\"group1\", \"group2\", \"group4\", \"group5\"}),\n ({3, 4, 7}, {\"group3\", \"group6\"}),\n ])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py_OperandDisjointDictSuite.test_full_merging_OperandDisjointDictSuite.test_full_merging.self_assertEqual_d_items_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py_OperandDisjointDictSuite.test_full_merging_OperandDisjointDictSuite.test_full_merging.self_assertEqual_d_items_", "embedding": null, "metadata": {"file_path": "mypy/test/testinfer.py", "file_name": "testinfer.py", "file_type": "text/x-python", "category": "test", "start_line": 261, "end_line": 272, "span_ids": ["OperandDisjointDictSuite.test_full_merging"], "tokens": 184}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class OperandDisjointDictSuite(Suite):\n\n def test_full_merging(self) -> None:\n d = self.new()\n d.add_mapping({0, 1, 2}, {\"a\"})\n d.add_mapping({3, 4, 2}, {\"b\"})\n d.add_mapping({10, 11, 12}, {\"c\"})\n d.add_mapping({13, 14, 15}, {\"d\"})\n d.add_mapping({14, 10, 16}, {\"e\"})\n d.add_mapping({0, 10}, {\"f\"})\n\n self.assertEqual(d.items(), [\n ({0, 1, 2, 3, 4, 10, 11, 12, 13, 14, 15, 16}, {\"a\", \"b\", \"c\", \"d\", \"e\", \"f\"}),\n ])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py_OperandDisjointDictSuite.test_merge_with_multiple_overlaps_OperandDisjointDictSuite.test_merge_with_multiple_overlaps.self_assertEqual_d_items_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py_OperandDisjointDictSuite.test_merge_with_multiple_overlaps_OperandDisjointDictSuite.test_merge_with_multiple_overlaps.self_assertEqual_d_items_", "embedding": null, "metadata": {"file_path": "mypy/test/testinfer.py", "file_name": "testinfer.py", "file_type": "text/x-python", "category": "test", "start_line": 274, "end_line": 284, "span_ids": ["OperandDisjointDictSuite.test_merge_with_multiple_overlaps"], "tokens": 170}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class OperandDisjointDictSuite(Suite):\n\n def test_merge_with_multiple_overlaps(self) -> None:\n d = self.new()\n d.add_mapping({0, 1, 2}, {\"a\"})\n d.add_mapping({3, 4, 5}, {\"b\"})\n d.add_mapping({1, 2, 4, 5}, {\"c\"})\n d.add_mapping({6, 1, 2, 4, 5}, {\"d\"})\n d.add_mapping({6, 1, 2, 4, 5}, {\"e\"})\n\n self.assertEqual(d.items(), [\n ({0, 1, 2, 3, 4, 5, 6}, {\"a\", \"b\", \"c\", \"d\", \"e\"}),\n ])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py_OperandComparisonGroupingSuite_OperandComparisonGroupingSuite.test_basic_cases.for_assignable_in_none_a.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py_OperandComparisonGroupingSuite_OperandComparisonGroupingSuite.test_basic_cases.for_assignable_in_none_a.None_3", "embedding": null, "metadata": {"file_path": "mypy/test/testinfer.py", "file_name": "testinfer.py", "file_type": "text/x-python", "category": "test", "start_line": 287, "end_line": 325, "span_ids": ["OperandComparisonGroupingSuite.test_basic_cases", "OperandComparisonGroupingSuite.literal_keymap", "OperandComparisonGroupingSuite"], "tokens": 497}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class OperandComparisonGroupingSuite(Suite):\n \"\"\"Test cases for checker.group_comparison_operands.\"\"\"\n def literal_keymap(self, assignable_operands: Dict[int, NameExpr]) -> Dict[int, Key]:\n output = {} # type: Dict[int, Key]\n for index, expr in assignable_operands.items():\n output[index] = ('FakeExpr', expr.name)\n return output\n\n def test_basic_cases(self) -> None:\n # Note: the grouping function doesn't actually inspect the input exprs, so we\n # just default to using NameExprs for simplicity.\n x0 = NameExpr('x0')\n x1 = NameExpr('x1')\n x2 = NameExpr('x2')\n x3 = NameExpr('x3')\n x4 = NameExpr('x4')\n\n basic_input = [('==', x0, x1), ('==', x1, x2), ('<', x2, x3), ('==', x3, x4)]\n\n none_assignable = self.literal_keymap({})\n all_assignable = self.literal_keymap({0: x0, 1: x1, 2: x2, 3: x3, 4: x4})\n\n for assignable in [none_assignable, all_assignable]:\n self.assertEqual(\n group_comparison_operands(basic_input, assignable, set()),\n [('==', [0, 1]), ('==', [1, 2]), ('<', [2, 3]), ('==', [3, 4])],\n )\n self.assertEqual(\n group_comparison_operands(basic_input, assignable, {'=='}),\n [('==', [0, 1, 2]), ('<', [2, 3]), ('==', [3, 4])],\n )\n self.assertEqual(\n group_comparison_operands(basic_input, assignable, {'<'}),\n [('==', [0, 1]), ('==', [1, 2]), ('<', [2, 3]), ('==', [3, 4])],\n )\n self.assertEqual(\n group_comparison_operands(basic_input, assignable, {'==', '<'}),\n [('==', [0, 1, 2]), ('<', [2, 3]), ('==', [3, 4])],\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py_OperandComparisonGroupingSuite.test_multiple_groups_OperandComparisonGroupingSuite.test_multiple_groups.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py_OperandComparisonGroupingSuite.test_multiple_groups_OperandComparisonGroupingSuite.test_multiple_groups.None_3", "embedding": null, "metadata": {"file_path": "mypy/test/testinfer.py", "file_name": "testinfer.py", "file_type": "text/x-python", "category": "test", "start_line": 327, "end_line": 366, "span_ids": ["OperandComparisonGroupingSuite.test_multiple_groups"], "tokens": 455}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class OperandComparisonGroupingSuite(Suite):\n\n def test_multiple_groups(self) -> None:\n x0 = NameExpr('x0')\n x1 = NameExpr('x1')\n x2 = NameExpr('x2')\n x3 = NameExpr('x3')\n x4 = NameExpr('x4')\n x5 = NameExpr('x5')\n\n self.assertEqual(\n group_comparison_operands(\n [('==', x0, x1), ('==', x1, x2), ('is', x2, x3), ('is', x3, x4)],\n self.literal_keymap({}),\n {'==', 'is'},\n ),\n [('==', [0, 1, 2]), ('is', [2, 3, 4])],\n )\n self.assertEqual(\n group_comparison_operands(\n [('==', x0, x1), ('==', x1, x2), ('==', x2, x3), ('==', x3, x4)],\n self.literal_keymap({}),\n {'==', 'is'},\n ),\n [('==', [0, 1, 2, 3, 4])],\n )\n self.assertEqual(\n group_comparison_operands(\n [('is', x0, x1), ('==', x1, x2), ('==', x2, x3), ('==', x3, x4)],\n self.literal_keymap({}),\n {'==', 'is'},\n ),\n [('is', [0, 1]), ('==', [1, 2, 3, 4])],\n )\n self.assertEqual(\n group_comparison_operands(\n [('is', x0, x1), ('is', x1, x2), ('<', x2, x3), ('==', x3, x4), ('==', x4, x5)],\n self.literal_keymap({}),\n {'==', 'is'},\n ),\n [('is', [0, 1, 2]), ('<', [2, 3]), ('==', [3, 4, 5])],\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py_OperandComparisonGroupingSuite.test_multiple_groups_coalescing_OperandComparisonGroupingSuite.test_multiple_groups_coalescing.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py_OperandComparisonGroupingSuite.test_multiple_groups_coalescing_OperandComparisonGroupingSuite.test_multiple_groups_coalescing.None_3", "embedding": null, "metadata": {"file_path": "mypy/test/testinfer.py", "file_name": "testinfer.py", "file_type": "text/x-python", "category": "test", "start_line": 368, "end_line": 417, "span_ids": ["OperandComparisonGroupingSuite.test_multiple_groups_coalescing"], "tokens": 493}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class OperandComparisonGroupingSuite(Suite):\n\n def test_multiple_groups_coalescing(self) -> None:\n x0 = NameExpr('x0')\n x1 = NameExpr('x1')\n x2 = NameExpr('x2')\n x3 = NameExpr('x3')\n x4 = NameExpr('x4')\n\n nothing_combined = [('==', [0, 1, 2]), ('<', [2, 3]), ('==', [3, 4, 5])]\n everything_combined = [('==', [0, 1, 2, 3, 4, 5]), ('<', [2, 3])]\n\n # Note: We do 'x4 == x0' at the very end!\n two_groups = [\n ('==', x0, x1), ('==', x1, x2), ('<', x2, x3), ('==', x3, x4), ('==', x4, x0),\n ]\n self.assertEqual(\n group_comparison_operands(\n two_groups,\n self.literal_keymap({0: x0, 1: x1, 2: x2, 3: x3, 4: x4, 5: x0}),\n {'=='},\n ),\n everything_combined,\n \"All vars are assignable, everything is combined\"\n )\n self.assertEqual(\n group_comparison_operands(\n two_groups,\n self.literal_keymap({1: x1, 2: x2, 3: x3, 4: x4}),\n {'=='},\n ),\n nothing_combined,\n \"x0 is unassignable, so no combining\"\n )\n self.assertEqual(\n group_comparison_operands(\n two_groups,\n self.literal_keymap({0: x0, 1: x1, 3: x3, 5: x0}),\n {'=='},\n ),\n everything_combined,\n \"Some vars are unassignable but x0 is, so we combine\"\n )\n self.assertEqual(\n group_comparison_operands(\n two_groups,\n self.literal_keymap({0: x0, 5: x0}),\n {'=='},\n ),\n everything_combined,\n \"All vars are unassignable but x0 is, so we combine\"\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py_OperandComparisonGroupingSuite.test_multiple_groups_different_operators_OperandComparisonGroupingSuite.test_multiple_groups_different_operators.self_assertEqual_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py_OperandComparisonGroupingSuite.test_multiple_groups_different_operators_OperandComparisonGroupingSuite.test_multiple_groups_different_operators.self_assertEqual_", "embedding": null, "metadata": {"file_path": "mypy/test/testinfer.py", "file_name": "testinfer.py", "file_type": "text/x-python", "category": "test", "start_line": 419, "end_line": 431, "span_ids": ["OperandComparisonGroupingSuite.test_multiple_groups_different_operators"], "tokens": 196}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class OperandComparisonGroupingSuite(Suite):\n\n def test_multiple_groups_different_operators(self) -> None:\n x0 = NameExpr('x0')\n x1 = NameExpr('x1')\n x2 = NameExpr('x2')\n x3 = NameExpr('x3')\n\n groups = [('==', x0, x1), ('==', x1, x2), ('is', x2, x3), ('is', x3, x0)]\n keymap = self.literal_keymap({0: x0, 1: x1, 2: x2, 3: x3, 4: x0})\n self.assertEqual(\n group_comparison_operands(groups, keymap, {'==', 'is'}),\n [('==', [0, 1, 2]), ('is', [2, 3, 4])],\n \"Different operators can never be combined\"\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py_OperandComparisonGroupingSuite.test_single_pair_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testinfer.py_OperandComparisonGroupingSuite.test_single_pair_", "embedding": null, "metadata": {"file_path": "mypy/test/testinfer.py", "file_name": "testinfer.py", "file_type": "text/x-python", "category": "test", "start_line": 433, "end_line": 459, "span_ids": ["OperandComparisonGroupingSuite.test_single_pair", "OperandComparisonGroupingSuite.test_empty_pair_list"], "tokens": 253}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class OperandComparisonGroupingSuite(Suite):\n\n def test_single_pair(self) -> None:\n x0 = NameExpr('x0')\n x1 = NameExpr('x1')\n\n single_comparison = [('==', x0, x1)]\n expected_output = [('==', [0, 1])]\n\n assignable_combinations = [\n {}, {0: x0}, {1: x1}, {0: x0, 1: x1},\n ] # type: List[Dict[int, NameExpr]]\n to_group_by = [set(), {'=='}, {'is'}] # type: List[Set[str]]\n\n for combo in assignable_combinations:\n for operators in to_group_by:\n keymap = self.literal_keymap(combo)\n self.assertEqual(\n group_comparison_operands(single_comparison, keymap, operators),\n expected_output,\n )\n\n def test_empty_pair_list(self) -> None:\n # This case should never occur in practice -- ComparisionExprs\n # always contain at least one comparison. But in case it does...\n\n self.assertEqual(group_comparison_operands([], {}, set()), [])\n self.assertEqual(group_comparison_operands([], {}, {'=='}), [])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testipc.py_from_unittest_import_Test_IPCTests.test_transaction_large.p_join_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testipc.py_from_unittest_import_Test_IPCTests.test_transaction_large.p_join_", "embedding": null, "metadata": {"file_path": "mypy/test/testipc.py", "file_name": "testipc.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 36, "span_ids": ["imports", "IPCTests", "server", "IPCTests.test_transaction_large"], "tokens": 231}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from unittest import TestCase, main\nfrom multiprocessing import Process, Queue\n\nfrom mypy.ipc import IPCClient, IPCServer\n\nimport pytest\nimport sys\nimport time\n\nCONNECTION_NAME = 'dmypy-test-ipc'\n\n\ndef server(msg: str, q: 'Queue[str]') -> None:\n server = IPCServer(CONNECTION_NAME)\n q.put(server.connection_name)\n data = b''\n while not data:\n with server:\n server.write(msg.encode())\n data = server.read()\n server.cleanup()\n\n\nclass IPCTests(TestCase):\n def test_transaction_large(self) -> None:\n queue = Queue() # type: Queue[str]\n msg = 't' * 200000 # longer than the max read size of 100_000\n p = Process(target=server, args=(msg, queue), daemon=True)\n p.start()\n connection_name = queue.get()\n with IPCClient(connection_name, timeout=1) as client:\n assert client.read() == msg.encode()\n client.write(b'test')\n queue.close()\n queue.join_thread()\n p.join()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testipc.py_IPCTests.test_connect_twice_IPCTests.test_connect_twice.assert_p_exitcode_0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testipc.py_IPCTests.test_connect_twice_IPCTests.test_connect_twice.assert_p_exitcode_0", "embedding": null, "metadata": {"file_path": "mypy/test/testipc.py", "file_name": "testipc.py", "file_type": "text/x-python", "category": "test", "start_line": 38, "end_line": 54, "span_ids": ["IPCTests.test_connect_twice"], "tokens": 164}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IPCTests(TestCase):\n\n def test_connect_twice(self) -> None:\n queue = Queue() # type: Queue[str]\n msg = 'this is a test message'\n p = Process(target=server, args=(msg, queue), daemon=True)\n p.start()\n connection_name = queue.get()\n with IPCClient(connection_name, timeout=1) as client:\n assert client.read() == msg.encode()\n client.write(b'') # don't let the server hang up yet, we want to connect again.\n\n with IPCClient(connection_name, timeout=1) as client:\n assert client.read() == msg.encode()\n client.write(b'test')\n queue.close()\n queue.join_thread()\n p.join()\n assert p.exitcode == 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testipc.py_IPCTests._Run_test_connect_twice__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testipc.py_IPCTests._Run_test_connect_twice__", "embedding": null, "metadata": {"file_path": "mypy/test/testipc.py", "file_name": "testipc.py", "file_type": "text/x-python", "category": "test", "start_line": 56, "end_line": 75, "span_ids": ["IPCTests.test_connect_twice", "impl:3", "IPCTests.test_connect_alot"], "tokens": 142}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IPCTests(TestCase):\n\n # Run test_connect_twice a lot, in the hopes of finding issues.\n # This is really slow, so it is skipped, but can be enabled if\n # needed to debug IPC issues.\n @pytest.mark.skip\n def test_connect_alot(self) -> None:\n t0 = time.time()\n for i in range(1000):\n try:\n print(i, 'start')\n self.test_connect_twice()\n finally:\n t1 = time.time()\n print(i, t1 - t0)\n sys.stdout.flush()\n t0 = t1\n\n\nif __name__ == '__main__':\n main()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testmerge.py__Test_cases_for_AST_mer_NOT_DUMPED_MODULES._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testmerge.py__Test_cases_for_AST_mer_NOT_DUMPED_MODULES._", "embedding": null, "metadata": {"file_path": "mypy/test/testmerge.py", "file_name": "testmerge.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 42, "span_ids": ["docstring"], "tokens": 286}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Test cases for AST merge (used for fine-grained incremental checking)\"\"\"\n\nimport os\nimport shutil\nfrom typing import List, Tuple, Dict, Optional\n\nfrom mypy import build\nfrom mypy.build import BuildResult\nfrom mypy.modulefinder import BuildSource\nfrom mypy.defaults import PYTHON3_VERSION\nfrom mypy.errors import CompileError\nfrom mypy.nodes import (\n Node, MypyFile, SymbolTable, SymbolTableNode, TypeInfo, Expression, Var, TypeVarExpr,\n UNBOUND_IMPORTED\n)\nfrom mypy.server.subexpr import get_subexpressions\nfrom mypy.server.update import FineGrainedBuildManager\nfrom mypy.strconv import StrConv\nfrom mypy.test.config import test_temp_dir\nfrom mypy.test.data import DataDrivenTestCase, DataSuite\nfrom mypy.test.helpers import assert_string_arrays_equal, normalize_error_messages, parse_options\nfrom mypy.types import TypeStrVisitor, Type\nfrom mypy.util import short_type, IdMapper\n\n\n# Which data structures to dump in a test case?\nSYMTABLE = 'SYMTABLE'\nTYPEINFO = ' TYPEINFO'\nTYPES = 'TYPES'\nAST = 'AST'\n\n\nNOT_DUMPED_MODULES = (\n 'builtins',\n 'typing',\n 'abc',\n 'contextlib',\n 'sys',\n 'mypy_extensions',\n 'typing_extensions',\n 'enum',\n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testmerge.py_ASTMergeSuite_ASTMergeSuite.run_case.assert_string_arrays_equa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testmerge.py_ASTMergeSuite_ASTMergeSuite.run_case.assert_string_arrays_equa", "embedding": null, "metadata": {"file_path": "mypy/test/testmerge.py", "file_name": "testmerge.py", "file_type": "text/x-python", "category": "test", "start_line": 45, "end_line": 102, "span_ids": ["ASTMergeSuite", "ASTMergeSuite.setup", "ASTMergeSuite.run_case"], "tokens": 456}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTMergeSuite(DataSuite):\n files = ['merge.test']\n\n def setup(self) -> None:\n super().setup()\n self.str_conv = StrConv(show_ids=True)\n assert self.str_conv.id_mapper is not None\n self.id_mapper = self.str_conv.id_mapper # type: IdMapper\n self.type_str_conv = TypeStrVisitor(self.id_mapper)\n\n def run_case(self, testcase: DataDrivenTestCase) -> None:\n name = testcase.name\n # We use the test case name to decide which data structures to dump.\n # Dumping everything would result in very verbose test cases.\n if name.endswith('_symtable'):\n kind = SYMTABLE\n elif name.endswith('_typeinfo'):\n kind = TYPEINFO\n elif name.endswith('_types'):\n kind = TYPES\n else:\n kind = AST\n\n main_src = '\\n'.join(testcase.input)\n result = self.build(main_src, testcase)\n assert result is not None, 'cases where CompileError occurred should not be run'\n result.manager.fscache.flush()\n fine_grained_manager = FineGrainedBuildManager(result)\n\n a = []\n if result.errors:\n a.extend(result.errors)\n\n target_path = os.path.join(test_temp_dir, 'target.py')\n shutil.copy(os.path.join(test_temp_dir, 'target.py.next'), target_path)\n\n a.extend(self.dump(fine_grained_manager, kind))\n old_subexpr = get_subexpressions(result.manager.modules['target'])\n\n a.append('==>')\n\n new_file, new_types = self.build_increment(fine_grained_manager, 'target', target_path)\n a.extend(self.dump(fine_grained_manager, kind))\n\n for expr in old_subexpr:\n if isinstance(expr, TypeVarExpr):\n # These are merged so we can't perform the check.\n continue\n # Verify that old AST nodes are removed from the expression type map.\n assert expr not in new_types\n\n if testcase.normalize_output:\n a = normalize_error_messages(a)\n\n assert_string_arrays_equal(\n testcase.output, a,\n 'Invalid output ({}, line {})'.format(testcase.file,\n testcase.line))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testmerge.py_ASTMergeSuite.build_ASTMergeSuite.build.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testmerge.py_ASTMergeSuite.build_ASTMergeSuite.build.return.result", "embedding": null, "metadata": {"file_path": "mypy/test/testmerge.py", "file_name": "testmerge.py", "file_type": "text/x-python", "category": "test", "start_line": 104, "end_line": 122, "span_ids": ["ASTMergeSuite.build"], "tokens": 186}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTMergeSuite(DataSuite):\n\n def build(self, source: str, testcase: DataDrivenTestCase) -> Optional[BuildResult]:\n options = parse_options(source, testcase, incremental_step=1)\n options.incremental = True\n options.fine_grained_incremental = True\n options.use_builtins_fixtures = True\n options.export_types = True\n options.show_traceback = True\n options.python_version = PYTHON3_VERSION\n main_path = os.path.join(test_temp_dir, 'main')\n with open(main_path, 'w', encoding='utf8') as f:\n f.write(source)\n try:\n result = build.build(sources=[BuildSource(main_path, None, None)],\n options=options,\n alt_lib_path=test_temp_dir)\n except CompileError:\n # TODO: Is it okay to return None?\n return None\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testmerge.py_ASTMergeSuite.build_increment_ASTMergeSuite.dump_symbol_table.return.a": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testmerge.py_ASTMergeSuite.build_increment_ASTMergeSuite.dump_symbol_table.return.a", "embedding": null, "metadata": {"file_path": "mypy/test/testmerge.py", "file_name": "testmerge.py", "file_type": "text/x-python", "category": "test", "start_line": 124, "end_line": 172, "span_ids": ["ASTMergeSuite.build_increment", "ASTMergeSuite.dump", "ASTMergeSuite.dump_symbol_tables", "ASTMergeSuite.dump_symbol_table", "ASTMergeSuite.dump_asts"], "tokens": 425}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTMergeSuite(DataSuite):\n\n def build_increment(self, manager: FineGrainedBuildManager,\n module_id: str, path: str) -> Tuple[MypyFile,\n Dict[Expression, Type]]:\n manager.flush_cache()\n manager.update([(module_id, path)], [])\n module = manager.manager.modules[module_id]\n type_map = manager.graph[module_id].type_map()\n return module, type_map\n\n def dump(self,\n manager: FineGrainedBuildManager,\n kind: str) -> List[str]:\n modules = manager.manager.modules\n if kind == AST:\n return self.dump_asts(modules)\n elif kind == TYPEINFO:\n return self.dump_typeinfos(modules)\n elif kind == SYMTABLE:\n return self.dump_symbol_tables(modules)\n elif kind == TYPES:\n return self.dump_types(manager)\n assert False, 'Invalid kind %s' % kind\n\n def dump_asts(self, modules: Dict[str, MypyFile]) -> List[str]:\n a = []\n for m in sorted(modules):\n if m in NOT_DUMPED_MODULES:\n # We don't support incremental checking of changes to builtins, etc.\n continue\n s = modules[m].accept(self.str_conv)\n a.extend(s.splitlines())\n return a\n\n def dump_symbol_tables(self, modules: Dict[str, MypyFile]) -> List[str]:\n a = []\n for id in sorted(modules):\n if not is_dumped_module(id):\n # We don't support incremental checking of changes to builtins, etc.\n continue\n a.extend(self.dump_symbol_table(id, modules[id].names))\n return a\n\n def dump_symbol_table(self, module_id: str, symtable: SymbolTable) -> List[str]:\n a = ['{}:'.format(module_id)]\n for name in sorted(symtable):\n if name.startswith('__'):\n continue\n a.append(' {}: {}'.format(name, self.format_symbol_table_node(symtable[name])))\n return a", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testmerge.py_ASTMergeSuite.format_symbol_table_node_ASTMergeSuite.format_symbol_table_node.return.s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testmerge.py_ASTMergeSuite.format_symbol_table_node_ASTMergeSuite.format_symbol_table_node.return.s", "embedding": null, "metadata": {"file_path": "mypy/test/testmerge.py", "file_name": "testmerge.py", "file_type": "text/x-python", "category": "test", "start_line": 173, "end_line": 187, "span_ids": ["ASTMergeSuite.format_symbol_table_node"], "tokens": 151}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTMergeSuite(DataSuite):\n\n def format_symbol_table_node(self, node: SymbolTableNode) -> str:\n if node.node is None:\n if node.kind == UNBOUND_IMPORTED:\n return 'UNBOUND_IMPORTED'\n return 'None'\n if isinstance(node.node, Node):\n s = '{}<{}>'.format(str(type(node.node).__name__),\n self.id_mapper.id(node.node))\n else:\n s = '? ({})'.format(type(node.node))\n if (isinstance(node.node, Var) and node.node.type and\n not node.node.fullname.startswith('typing.')):\n typestr = self.format_type(node.node.type)\n s += '({})'.format(typestr)\n return s", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testmerge.py_ASTMergeSuite.dump_typeinfos_ASTMergeSuite.dump_typeinfo.return.s_splitlines_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testmerge.py_ASTMergeSuite.dump_typeinfos_ASTMergeSuite.dump_typeinfo.return.s_splitlines_", "embedding": null, "metadata": {"file_path": "mypy/test/testmerge.py", "file_name": "testmerge.py", "file_type": "text/x-python", "category": "test", "start_line": 189, "end_line": 211, "span_ids": ["ASTMergeSuite.dump_typeinfo", "ASTMergeSuite.dump_typeinfos_recursive", "ASTMergeSuite.dump_typeinfos"], "tokens": 201}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTMergeSuite(DataSuite):\n\n def dump_typeinfos(self, modules: Dict[str, MypyFile]) -> List[str]:\n a = []\n for id in sorted(modules):\n if not is_dumped_module(id):\n continue\n a.extend(self.dump_typeinfos_recursive(modules[id].names))\n return a\n\n def dump_typeinfos_recursive(self, names: SymbolTable) -> List[str]:\n a = []\n for name, node in sorted(names.items(), key=lambda x: x[0]):\n if isinstance(node.node, TypeInfo):\n a.extend(self.dump_typeinfo(node.node))\n a.extend(self.dump_typeinfos_recursive(node.node.names))\n return a\n\n def dump_typeinfo(self, info: TypeInfo) -> List[str]:\n if info.fullname == 'enum.Enum':\n # Avoid noise\n return []\n s = info.dump(str_conv=self.str_conv,\n type_str_conv=self.type_str_conv)\n return s.splitlines()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testmerge.py_ASTMergeSuite.dump_types_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testmerge.py_ASTMergeSuite.dump_types_", "embedding": null, "metadata": {"file_path": "mypy/test/testmerge.py", "file_name": "testmerge.py", "file_type": "text/x-python", "category": "test", "start_line": 213, "end_line": 243, "span_ids": ["is_dumped_module", "ASTMergeSuite.format_type", "ASTMergeSuite.dump_types"], "tokens": 279}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ASTMergeSuite(DataSuite):\n\n def dump_types(self, manager: FineGrainedBuildManager) -> List[str]:\n a = []\n # To make the results repeatable, we try to generate unique and\n # deterministic sort keys.\n for module_id in sorted(manager.manager.modules):\n if not is_dumped_module(module_id):\n continue\n all_types = manager.manager.all_types\n # Compute a module type map from the global type map\n tree = manager.graph[module_id].tree\n assert tree is not None\n type_map = {node: all_types[node]\n for node in get_subexpressions(tree)\n if node in all_types}\n if type_map:\n a.append('## {}'.format(module_id))\n for expr in sorted(type_map, key=lambda n: (n.line, short_type(n),\n str(n) + str(type_map[n]))):\n typ = type_map[expr]\n a.append('{}:{}: {}'.format(short_type(expr),\n expr.line,\n self.format_type(typ)))\n return a\n\n def format_type(self, typ: Type) -> str:\n return typ.accept(self.type_str_conv)\n\n\ndef is_dumped_module(id: str) -> bool:\n return id not in NOT_DUMPED_MODULES and (not id.startswith('_') or id == '__main__')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testmodulefinder.py_os_ModuleFinderSuite.setUp.self.fmc_nons.FindModuleCache_self_sear": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testmodulefinder.py_os_ModuleFinderSuite.setUp.self.fmc_nons.FindModuleCache_self_sear", "embedding": null, "metadata": {"file_path": "mypy/test/testmodulefinder.py", "file_name": "testmodulefinder.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 39, "span_ids": ["imports", "ModuleFinderSuite.setUp", "ModuleFinderSuite"], "tokens": 282}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\n\nfrom mypy.options import Options\nfrom mypy.modulefinder import (\n FindModuleCache,\n SearchPaths,\n ModuleNotFoundReason,\n expand_site_packages\n)\n\nfrom mypy.test.helpers import Suite, assert_equal\nfrom mypy.test.config import package_path\ndata_path = os.path.relpath(os.path.join(package_path, \"modulefinder\"))\n\n\nclass ModuleFinderSuite(Suite):\n\n def setUp(self) -> None:\n self.search_paths = SearchPaths(\n python_path=(),\n mypy_path=(\n os.path.join(data_path, \"nsx-pkg1\"),\n os.path.join(data_path, \"nsx-pkg2\"),\n os.path.join(data_path, \"nsx-pkg3\"),\n os.path.join(data_path, \"nsy-pkg1\"),\n os.path.join(data_path, \"nsy-pkg2\"),\n os.path.join(data_path, \"pkg1\"),\n os.path.join(data_path, \"pkg2\"),\n ),\n package_path=(),\n typeshed_path=(),\n )\n options = Options()\n options.namespace_packages = True\n self.fmc_ns = FindModuleCache(self.search_paths, fscache=None, options=options)\n\n options = Options()\n options.namespace_packages = False\n self.fmc_nons = FindModuleCache(self.search_paths, fscache=None, options=options)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testmodulefinder.py_ModuleFinderSuite.test__no_namespace_packages__nsx_ModuleFinderSuite.test__find_nsy_a__init_pyi.assert_equal_expected_fo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testmodulefinder.py_ModuleFinderSuite.test__no_namespace_packages__nsx_ModuleFinderSuite.test__find_nsy_a__init_pyi.assert_equal_expected_fo", "embedding": null, "metadata": {"file_path": "mypy/test/testmodulefinder.py", "file_name": "testmodulefinder.py", "file_type": "text/x-python", "category": "test", "start_line": 41, "end_line": 107, "span_ids": ["ModuleFinderSuite.test__no_namespace_packages__nsx_a", "ModuleFinderSuite.test__no_namespace_packages__nsx", "ModuleFinderSuite.test__find_nsx_c_c_in_pkg3", "ModuleFinderSuite.test__no_namespace_packages__find_b_in_pkg2", "ModuleFinderSuite.test__find_nsx_as_namespace_pkg_in_pkg1", "ModuleFinderSuite.test__find_nsx_b_init_in_pkg2", "ModuleFinderSuite.test__no_namespace_packages__find_a_in_pkg1", "ModuleFinderSuite.test__find_nsx_a_init_in_pkg1", "ModuleFinderSuite.test__find_nsy_a__init_pyi"], "tokens": 743}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ModuleFinderSuite(Suite):\n\n def test__no_namespace_packages__nsx(self) -> None:\n \"\"\"\n If namespace_packages is False, we shouldn't find nsx\n \"\"\"\n found_module = self.fmc_nons.find_module(\"nsx\")\n assert_equal(ModuleNotFoundReason.NOT_FOUND, found_module)\n\n def test__no_namespace_packages__nsx_a(self) -> None:\n \"\"\"\n If namespace_packages is False, we shouldn't find nsx.a.\n \"\"\"\n found_module = self.fmc_nons.find_module(\"nsx.a\")\n assert_equal(ModuleNotFoundReason.NOT_FOUND, found_module)\n\n def test__no_namespace_packages__find_a_in_pkg1(self) -> None:\n \"\"\"\n Find find pkg1/a.py for \"a\" with namespace_packages False.\n \"\"\"\n found_module = self.fmc_nons.find_module(\"a\")\n expected = os.path.join(data_path, \"pkg1\", \"a.py\")\n assert_equal(expected, found_module)\n\n def test__no_namespace_packages__find_b_in_pkg2(self) -> None:\n found_module = self.fmc_ns.find_module(\"b\")\n expected = os.path.join(data_path, \"pkg2\", \"b\", \"__init__.py\")\n assert_equal(expected, found_module)\n\n def test__find_nsx_as_namespace_pkg_in_pkg1(self) -> None:\n \"\"\"\n There's no __init__.py in any of the nsx dirs, return\n the path to the first one found in mypypath.\n \"\"\"\n found_module = self.fmc_ns.find_module(\"nsx\")\n expected = os.path.join(data_path, \"nsx-pkg1\", \"nsx\")\n assert_equal(expected, found_module)\n\n def test__find_nsx_a_init_in_pkg1(self) -> None:\n \"\"\"\n Find nsx-pkg1/nsx/a/__init__.py for \"nsx.a\" in namespace mode.\n \"\"\"\n found_module = self.fmc_ns.find_module(\"nsx.a\")\n expected = os.path.join(data_path, \"nsx-pkg1\", \"nsx\", \"a\", \"__init__.py\")\n assert_equal(expected, found_module)\n\n def test__find_nsx_b_init_in_pkg2(self) -> None:\n \"\"\"\n Find nsx-pkg2/nsx/b/__init__.py for \"nsx.b\" in namespace mode.\n \"\"\"\n found_module = self.fmc_ns.find_module(\"nsx.b\")\n expected = os.path.join(data_path, \"nsx-pkg2\", \"nsx\", \"b\", \"__init__.py\")\n assert_equal(expected, found_module)\n\n def test__find_nsx_c_c_in_pkg3(self) -> None:\n \"\"\"\n Find nsx-pkg3/nsx/c/c.py for \"nsx.c.c\" in namespace mode.\n \"\"\"\n found_module = self.fmc_ns.find_module(\"nsx.c.c\")\n expected = os.path.join(data_path, \"nsx-pkg3\", \"nsx\", \"c\", \"c.py\")\n assert_equal(expected, found_module)\n\n def test__find_nsy_a__init_pyi(self) -> None:\n \"\"\"\n Prefer nsy-pkg1/a/__init__.pyi file over __init__.py.\n \"\"\"\n found_module = self.fmc_ns.find_module(\"nsy.a\")\n expected = os.path.join(data_path, \"nsy-pkg1\", \"nsy\", \"a\", \"__init__.pyi\")\n assert_equal(expected, found_module)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testmodulefinder.py_ModuleFinderSuite.test__find_nsy_b__init_py_ModuleFinderSuite.test__find_nsy_b__init_py.assert_equal_expected_fo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testmodulefinder.py_ModuleFinderSuite.test__find_nsy_b__init_py_ModuleFinderSuite.test__find_nsy_b__init_py.assert_equal_expected_fo", "embedding": null, "metadata": {"file_path": "mypy/test/testmodulefinder.py", "file_name": "testmodulefinder.py", "file_type": "text/x-python", "category": "test", "start_line": 109, "end_line": 117, "span_ids": ["ModuleFinderSuite.test__find_nsy_b__init_py"], "tokens": 135}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ModuleFinderSuite(Suite):\n\n def test__find_nsy_b__init_py(self) -> None:\n \"\"\"\n There is a nsy-pkg2/nsy/b.pyi, but also a nsy-pkg2/nsy/b/__init__.py.\n We expect to find the latter when looking up \"nsy.b\" as\n a package is preferred over a module.\n \"\"\"\n found_module = self.fmc_ns.find_module(\"nsy.b\")\n expected = os.path.join(data_path, \"nsy-pkg2\", \"nsy\", \"b\", \"__init__.py\")\n assert_equal(expected, found_module)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testmodulefinder.py_ModuleFinderSuite.test__find_nsy_c_pyi_ModuleFinderSuite.test__find_nsy_c_pyi.assert_equal_expected_fo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testmodulefinder.py_ModuleFinderSuite.test__find_nsy_c_pyi_ModuleFinderSuite.test__find_nsy_c_pyi.assert_equal_expected_fo", "embedding": null, "metadata": {"file_path": "mypy/test/testmodulefinder.py", "file_name": "testmodulefinder.py", "file_type": "text/x-python", "category": "test", "start_line": 119, "end_line": 127, "span_ids": ["ModuleFinderSuite.test__find_nsy_c_pyi"], "tokens": 126}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ModuleFinderSuite(Suite):\n\n def test__find_nsy_c_pyi(self) -> None:\n \"\"\"\n There is a nsy-pkg2/nsy/c.pyi and nsy-pkg2/nsy/c.py\n We expect to find the former when looking up \"nsy.b\" as\n .pyi is preferred over .py.\n \"\"\"\n found_module = self.fmc_ns.find_module(\"nsy.c\")\n expected = os.path.join(data_path, \"nsy-pkg2\", \"nsy\", \"c.pyi\")\n assert_equal(expected, found_module)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testmodulefinder.py_ModuleFinderSuite.test__find_a_in_pkg1_ModuleFinderSuite.test__find_d_nowhere.assert_equal_ModuleNotFou": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testmodulefinder.py_ModuleFinderSuite.test__find_a_in_pkg1_ModuleFinderSuite.test__find_d_nowhere.assert_equal_ModuleNotFou", "embedding": null, "metadata": {"file_path": "mypy/test/testmodulefinder.py", "file_name": "testmodulefinder.py", "file_type": "text/x-python", "category": "test", "start_line": 129, "end_line": 141, "span_ids": ["ModuleFinderSuite.test__find_d_nowhere", "ModuleFinderSuite.test__find_b_init_in_pkg2", "ModuleFinderSuite.test__find_a_in_pkg1"], "tokens": 154}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ModuleFinderSuite(Suite):\n\n def test__find_a_in_pkg1(self) -> None:\n found_module = self.fmc_ns.find_module(\"a\")\n expected = os.path.join(data_path, \"pkg1\", \"a.py\")\n assert_equal(expected, found_module)\n\n def test__find_b_init_in_pkg2(self) -> None:\n found_module = self.fmc_ns.find_module(\"b\")\n expected = os.path.join(data_path, \"pkg2\", \"b\", \"__init__.py\")\n assert_equal(expected, found_module)\n\n def test__find_d_nowhere(self) -> None:\n found_module = self.fmc_ns.find_module(\"d\")\n assert_equal(ModuleNotFoundReason.NOT_FOUND, found_module)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testmodulefinder.py_ModuleFinderSitePackagesSuite_ModuleFinderSitePackagesSuite.path.return.os_path_join_self_package": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testmodulefinder.py_ModuleFinderSitePackagesSuite_ModuleFinderSitePackagesSuite.path.return.os_path_join_self_package", "embedding": null, "metadata": {"file_path": "mypy/test/testmodulefinder.py", "file_name": "testmodulefinder.py", "file_type": "text/x-python", "category": "test", "start_line": 144, "end_line": 169, "span_ids": ["ModuleFinderSitePackagesSuite.setUp", "ModuleFinderSitePackagesSuite", "ModuleFinderSitePackagesSuite.path"], "tokens": 199}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ModuleFinderSitePackagesSuite(Suite):\n\n def setUp(self) -> None:\n self.package_dir = os.path.relpath(os.path.join(\n package_path,\n \"modulefinder-site-packages\",\n ))\n\n egg_dirs, site_packages = expand_site_packages([self.package_dir])\n\n self.search_paths = SearchPaths(\n python_path=(),\n mypy_path=(os.path.join(data_path, \"pkg1\"),),\n package_path=tuple(egg_dirs + site_packages),\n typeshed_path=(),\n )\n options = Options()\n options.namespace_packages = True\n self.fmc_ns = FindModuleCache(self.search_paths, fscache=None, options=options)\n\n options = Options()\n options.namespace_packages = False\n self.fmc_nons = FindModuleCache(self.search_paths, fscache=None, options=options)\n\n def path(self, *parts: str) -> str:\n return os.path.join(self.package_dir, *parts)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testmodulefinder.py_ModuleFinderSitePackagesSuite.test__packages_with_ns_ModuleFinderSitePackagesSuite.test__packages_with_ns.for_module_expected_in_c.assert_equal_actual_expe": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testmodulefinder.py_ModuleFinderSitePackagesSuite.test__packages_with_ns_ModuleFinderSitePackagesSuite.test__packages_with_ns.for_module_expected_in_c.assert_equal_actual_expe", "embedding": null, "metadata": {"file_path": "mypy/test/testmodulefinder.py", "file_name": "testmodulefinder.py", "file_type": "text/x-python", "category": "test", "start_line": 171, "end_line": 224, "span_ids": ["ModuleFinderSitePackagesSuite.test__packages_with_ns"], "tokens": 709}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ModuleFinderSitePackagesSuite(Suite):\n\n def test__packages_with_ns(self) -> None:\n cases = [\n # Namespace package with py.typed\n (\"ns_pkg_typed\", self.path(\"ns_pkg_typed\")),\n (\"ns_pkg_typed.a\", self.path(\"ns_pkg_typed\", \"a.py\")),\n (\"ns_pkg_typed.b\", self.path(\"ns_pkg_typed\", \"b\")),\n (\"ns_pkg_typed.b.c\", self.path(\"ns_pkg_typed\", \"b\", \"c.py\")),\n (\"ns_pkg_typed.a.a_var\", ModuleNotFoundReason.NOT_FOUND),\n\n # Namespace package without py.typed\n (\"ns_pkg_untyped\", ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS),\n (\"ns_pkg_untyped.a\", ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS),\n (\"ns_pkg_untyped.b\", ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS),\n (\"ns_pkg_untyped.b.c\", ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS),\n (\"ns_pkg_untyped.a.a_var\", ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS),\n\n # Regular package with py.typed\n (\"pkg_typed\", self.path(\"pkg_typed\", \"__init__.py\")),\n (\"pkg_typed.a\", self.path(\"pkg_typed\", \"a.py\")),\n (\"pkg_typed.b\", self.path(\"pkg_typed\", \"b\", \"__init__.py\")),\n (\"pkg_typed.b.c\", self.path(\"pkg_typed\", \"b\", \"c.py\")),\n (\"pkg_typed.a.a_var\", ModuleNotFoundReason.NOT_FOUND),\n\n # Regular package without py.typed\n (\"pkg_untyped\", ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS),\n (\"pkg_untyped.a\", ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS),\n (\"pkg_untyped.b\", ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS),\n (\"pkg_untyped.b.c\", ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS),\n (\"pkg_untyped.a.a_var\", ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS),\n\n # Top-level Python file in site-packages\n (\"standalone\", ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS),\n (\"standalone.standalone_var\", ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS),\n\n # Packages found by following .pth files\n (\"baz_pkg\", self.path(\"baz\", \"baz_pkg\", \"__init__.py\")),\n (\"ns_baz_pkg.a\", self.path(\"baz\", \"ns_baz_pkg\", \"a.py\")),\n (\"neighbor_pkg\", self.path(\"..\", \"modulefinder-src\", \"neighbor_pkg\", \"__init__.py\")),\n (\"ns_neighbor_pkg.a\", self.path(\"..\", \"modulefinder-src\", \"ns_neighbor_pkg\", \"a.py\")),\n\n # Something that doesn't exist\n (\"does_not_exist\", ModuleNotFoundReason.NOT_FOUND),\n\n # A regular package with an installed set of stubs\n (\"foo.bar\", self.path(\"foo-stubs\", \"bar.pyi\")),\n\n # A regular, non-site-packages module\n (\"a\", os.path.join(data_path, \"pkg1\", \"a.py\")),\n ]\n for module, expected in cases:\n template = \"Find(\" + module + \") got {}; expected {}\"\n\n actual = self.fmc_ns.find_module(module)\n assert_equal(actual, expected, template)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testmodulefinder.py_ModuleFinderSitePackagesSuite.test__packages_without_ns_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testmodulefinder.py_ModuleFinderSitePackagesSuite.test__packages_without_ns_", "embedding": null, "metadata": {"file_path": "mypy/test/testmodulefinder.py", "file_name": "testmodulefinder.py", "file_type": "text/x-python", "category": "test", "start_line": 226, "end_line": 280, "span_ids": ["ModuleFinderSitePackagesSuite.test__packages_without_ns"], "tokens": 666}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ModuleFinderSitePackagesSuite(Suite):\n\n def test__packages_without_ns(self) -> None:\n cases = [\n # Namespace package with py.typed\n (\"ns_pkg_typed\", ModuleNotFoundReason.NOT_FOUND),\n (\"ns_pkg_typed.a\", ModuleNotFoundReason.NOT_FOUND),\n (\"ns_pkg_typed.b\", ModuleNotFoundReason.NOT_FOUND),\n (\"ns_pkg_typed.b.c\", ModuleNotFoundReason.NOT_FOUND),\n (\"ns_pkg_typed.a.a_var\", ModuleNotFoundReason.NOT_FOUND),\n\n # Namespace package without py.typed\n (\"ns_pkg_untyped\", ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS),\n (\"ns_pkg_untyped.a\", ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS),\n (\"ns_pkg_untyped.b\", ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS),\n (\"ns_pkg_untyped.b.c\", ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS),\n (\"ns_pkg_untyped.a.a_var\", ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS),\n\n # Regular package with py.typed\n (\"pkg_typed\", self.path(\"pkg_typed\", \"__init__.py\")),\n (\"pkg_typed.a\", self.path(\"pkg_typed\", \"a.py\")),\n (\"pkg_typed.b\", self.path(\"pkg_typed\", \"b\", \"__init__.py\")),\n (\"pkg_typed.b.c\", self.path(\"pkg_typed\", \"b\", \"c.py\")),\n (\"pkg_typed.a.a_var\", ModuleNotFoundReason.NOT_FOUND),\n\n # Regular package without py.typed\n (\"pkg_untyped\", ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS),\n (\"pkg_untyped.a\", ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS),\n (\"pkg_untyped.b\", ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS),\n (\"pkg_untyped.b.c\", ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS),\n (\"pkg_untyped.a.a_var\", ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS),\n\n # Top-level Python file in site-packages\n (\"standalone\", ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS),\n (\"standalone.standalone_var\", ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS),\n\n # Packages found by following .pth files\n (\"baz_pkg\", self.path(\"baz\", \"baz_pkg\", \"__init__.py\")),\n (\"ns_baz_pkg.a\", ModuleNotFoundReason.NOT_FOUND),\n (\"neighbor_pkg\", self.path(\"..\", \"modulefinder-src\", \"neighbor_pkg\", \"__init__.py\")),\n (\"ns_neighbor_pkg.a\", ModuleNotFoundReason.NOT_FOUND),\n\n # Something that doesn't exist\n (\"does_not_exist\", ModuleNotFoundReason.NOT_FOUND),\n\n # A regular package with an installed set of stubs\n (\"foo.bar\", self.path(\"foo-stubs\", \"bar.pyi\")),\n\n # A regular, non-site-packages module\n (\"a\", os.path.join(data_path, \"pkg1\", \"a.py\")),\n ]\n for module, expected in cases:\n template = \"Find(\" + module + \") got {}; expected {}\"\n\n actual = self.fmc_nons.find_module(module)\n assert_equal(actual, expected, template)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testmypyc.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testmypyc.py__", "embedding": null, "metadata": {"file_path": "mypy/test/testmypyc.py", "file_name": "testmypyc.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 13, "span_ids": ["MypycTest.test_using_mypyc", "MypycTest", "docstring"], "tokens": 93}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"A basic check to make sure that we are using a mypyc-compiled version when expected.\"\"\"\n\nimport mypy\n\nfrom unittest import TestCase\nimport os\n\n\nclass MypycTest(TestCase):\n def test_using_mypyc(self) -> None:\n if os.getenv('TEST_MYPYC', None) == '1':\n assert not mypy.__file__.endswith('.py'), \"Expected to find a mypyc-compiled version\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testparse.py__Tests_for_the_mypy_par_ParserSuite.run_case.test_parser_testcase_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testparse.py__Tests_for_the_mypy_par_ParserSuite.run_case.test_parser_testcase_", "embedding": null, "metadata": {"file_path": "mypy/test/testparse.py", "file_name": "testparse.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 22, "span_ids": ["ParserSuite.run_case", "ParserSuite", "docstring"], "tokens": 125}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Tests for the mypy parser.\"\"\"\n\nimport sys\n\nfrom pytest import skip\n\nfrom mypy import defaults\nfrom mypy.test.helpers import assert_string_arrays_equal, parse_options\nfrom mypy.test.data import DataDrivenTestCase, DataSuite\nfrom mypy.parse import parse\nfrom mypy.errors import CompileError\nfrom mypy.options import Options\n\n\nclass ParserSuite(DataSuite):\n required_out_section = True\n base_path = '.'\n files = ['parse.test',\n 'parse-python2.test']\n\n def run_case(self, testcase: DataDrivenTestCase) -> None:\n test_parser(testcase)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testparse.py_test_parser_ParseErrorSuite.run_case.test_parse_error_testcase": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testparse.py_test_parser_ParseErrorSuite.run_case.test_parse_error_testcase", "embedding": null, "metadata": {"file_path": "mypy/test/testparse.py", "file_name": "testparse.py", "file_type": "text/x-python", "category": "test", "start_line": 25, "end_line": 62, "span_ids": ["ParseErrorSuite.run_case", "ParseErrorSuite", "test_parser", "impl"], "tokens": 258}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_parser(testcase: DataDrivenTestCase) -> None:\n \"\"\"Perform a single parser test case.\n\n The argument contains the description of the test case.\n \"\"\"\n options = Options()\n\n if testcase.file.endswith('python2.test'):\n options.python_version = defaults.PYTHON2_VERSION\n else:\n options.python_version = defaults.PYTHON3_VERSION\n\n try:\n n = parse(bytes('\\n'.join(testcase.input), 'ascii'),\n fnam='main',\n module='__main__',\n errors=None,\n options=options)\n a = str(n).split('\\n')\n except CompileError as e:\n a = e.messages\n assert_string_arrays_equal(testcase.output, a,\n 'Invalid parser output ({}, line {})'.format(\n testcase.file, testcase.line))\n\n\n# The file name shown in test case output. This is displayed in error\n# messages, and must match the file name in the test case descriptions.\nINPUT_FILE_NAME = 'file'\n\n\nclass ParseErrorSuite(DataSuite):\n required_out_section = True\n base_path = '.'\n files = ['parse-errors.test']\n\n def run_case(self, testcase: DataDrivenTestCase) -> None:\n test_parse_error(testcase)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testparse.py_test_parse_error_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testparse.py_test_parse_error_", "embedding": null, "metadata": {"file_path": "mypy/test/testparse.py", "file_name": "testparse.py", "file_type": "text/x-python", "category": "test", "start_line": 65, "end_line": 83, "span_ids": ["test_parse_error"], "tokens": 183}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_parse_error(testcase: DataDrivenTestCase) -> None:\n try:\n options = parse_options('\\n'.join(testcase.input), testcase, 0)\n if options.python_version != sys.version_info[:2]:\n skip()\n # Compile temporary file. The test file contains non-ASCII characters.\n parse(bytes('\\n'.join(testcase.input), 'utf-8'), INPUT_FILE_NAME, '__main__', None,\n options)\n raise AssertionError('No errors reported')\n except CompileError as e:\n if e.module_with_blocker is not None:\n assert e.module_with_blocker == '__main__'\n # Verify that there was a compile error and that the error messages\n # are equivalent.\n assert_string_arrays_equal(\n testcase.output, e.messages,\n 'Invalid compiler output ({}, line {})'.format(testcase.file,\n testcase.line))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testpep561.py_from_contextlib_import_co_PEP561Suite.run_case.test_pep561_test_case_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testpep561.py_from_contextlib_import_co_PEP561Suite.run_case.test_pep561_test_case_", "embedding": null, "metadata": {"file_path": "mypy/test/testpep561.py", "file_name": "testpep561.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 41, "span_ids": ["imports", "PEP561Suite", "PEP561Suite.run_case"], "tokens": 214}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from contextlib import contextmanager\nimport os\nimport pytest\nimport re\nimport subprocess\nfrom subprocess import PIPE\nimport sys\nimport tempfile\nfrom typing import Tuple, List, Generator\n\nimport mypy.api\nfrom mypy.test.config import package_path\nfrom mypy.util import try_find_python2_interpreter\nfrom mypy.test.data import DataDrivenTestCase, DataSuite\nfrom mypy.test.config import test_temp_dir\nfrom mypy.test.helpers import assert_string_arrays_equal\n\n\n# NOTE: options.use_builtins_fixtures should not be set in these\n# tests, otherwise mypy will ignore installed third-party packages.\n\n\n_NAMESPACE_PROGRAM = \"\"\"\n{import_style}\nfrom typedpkg_ns.ns.dne import dne\n\naf(\"abc\")\nbf(False)\ndne(123)\n\naf(False)\nbf(2)\ndne(\"abc\")\n\"\"\"\n\n\nclass PEP561Suite(DataSuite):\n files = ['pep561.test']\n\n def run_case(self, test_case: DataDrivenTestCase) -> None:\n test_pep561(test_case)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testpep561.py_virtualenv_virtualenv.with_tempfile_TemporaryDi.if_sys_platform_win32.else_.yield_venv_dir_os_path_a": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testpep561.py_virtualenv_virtualenv.with_tempfile_TemporaryDi.if_sys_platform_win32.else_.yield_venv_dir_os_path_a", "embedding": null, "metadata": {"file_path": "mypy/test/testpep561.py", "file_name": "testpep561.py", "file_type": "text/x-python", "category": "test", "start_line": 44, "end_line": 65, "span_ids": ["virtualenv"], "tokens": 268}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@contextmanager\ndef virtualenv(\n python_executable: str = sys.executable\n ) -> Generator[Tuple[str, str], None, None]:\n \"\"\"Context manager that creates a virtualenv in a temporary directory\n\n returns the path to the created Python executable\"\"\"\n # Sadly, we need virtualenv, as the Python 3 venv module does not support creating a venv\n # for Python 2, and Python 2 does not have its own venv.\n with tempfile.TemporaryDirectory() as venv_dir:\n proc = subprocess.run([sys.executable,\n '-m',\n 'virtualenv',\n '-p{}'.format(python_executable),\n venv_dir], cwd=os.getcwd(), stdout=PIPE, stderr=PIPE)\n if proc.returncode != 0:\n err = proc.stdout.decode('utf-8') + proc.stderr.decode('utf-8')\n raise Exception(\"Failed to create venv. Do you have virtualenv installed?\\n\" + err)\n if sys.platform == 'win32':\n yield venv_dir, os.path.abspath(os.path.join(venv_dir, 'Scripts', 'python'))\n else:\n yield venv_dir, os.path.abspath(os.path.join(venv_dir, 'bin', 'python'))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testpep561.py_install_package_install_package.if_proc_returncode_0_.raise_Exception_proc_stdo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testpep561.py_install_package_install_package.if_proc_returncode_0_.raise_Exception_proc_stdo", "embedding": null, "metadata": {"file_path": "mypy/test/testpep561.py", "file_name": "testpep561.py", "file_type": "text/x-python", "category": "test", "start_line": 68, "end_line": 88, "span_ids": ["install_package"], "tokens": 207}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def install_package(pkg: str,\n python_executable: str = sys.executable,\n use_pip: bool = True,\n editable: bool = False) -> None:\n \"\"\"Install a package from test-data/packages/pkg/\"\"\"\n working_dir = os.path.join(package_path, pkg)\n with tempfile.TemporaryDirectory() as dir:\n if use_pip:\n install_cmd = [python_executable, '-m', 'pip', 'install', '-b', '{}'.format(dir)]\n if editable:\n install_cmd.append('-e')\n install_cmd.append('.')\n else:\n install_cmd = [python_executable, 'setup.py']\n if editable:\n install_cmd.append('develop')\n else:\n install_cmd.append('install')\n proc = subprocess.run(install_cmd, cwd=working_dir, stdout=PIPE, stderr=PIPE)\n if proc.returncode != 0:\n raise Exception(proc.stdout.decode('utf-8') + proc.stderr.decode('utf-8'))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testpep561.py_test_pep561_test_pep561.with_virtualenv_python_a.try_.finally_.if_venv_dir_is_not_None_.os_chdir_old_dir_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testpep561.py_test_pep561_test_pep561.with_virtualenv_python_a.try_.finally_.if_venv_dir_is_not_None_.os_chdir_old_dir_", "embedding": null, "metadata": {"file_path": "mypy/test/testpep561.py", "file_name": "testpep561.py", "file_type": "text/x-python", "category": "test", "start_line": 91, "end_line": 157, "span_ids": ["test_pep561"], "tokens": 662}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_pep561(testcase: DataDrivenTestCase) -> None:\n \"\"\"Test running mypy on files that depend on PEP 561 packages.\"\"\"\n if (sys.platform == 'darwin' and hasattr(sys, 'base_prefix') and\n sys.base_prefix != sys.prefix):\n pytest.skip()\n assert testcase.old_cwd is not None, \"test was not properly set up\"\n if 'python2' in testcase.name.lower():\n python = try_find_python2_interpreter()\n if python is None:\n pytest.skip()\n else:\n python = sys.executable\n assert python is not None, \"Should be impossible\"\n pkgs, pip_args = parse_pkgs(testcase.input[0])\n mypy_args = parse_mypy_args(testcase.input[1])\n use_pip = True\n editable = False\n for arg in pip_args:\n if arg == 'no-pip':\n use_pip = False\n elif arg == 'editable':\n editable = True\n assert pkgs != [], \"No packages to install for PEP 561 test?\"\n with virtualenv(python) as venv:\n venv_dir, python_executable = venv\n for pkg in pkgs:\n install_package(pkg, python_executable, use_pip, editable)\n\n if venv_dir is not None:\n old_dir = os.getcwd()\n os.chdir(venv_dir)\n try:\n cmd_line = list(mypy_args)\n has_program = not ('-p' in cmd_line or '--package' in cmd_line)\n if has_program:\n program = testcase.name + '.py'\n with open(program, 'w', encoding='utf-8') as f:\n for s in testcase.input:\n f.write('{}\\n'.format(s))\n cmd_line.append(program)\n cmd_line.extend(['--no-incremental', '--no-error-summary'])\n if python_executable != sys.executable:\n cmd_line.append('--python-executable={}'.format(python_executable))\n if testcase.files != []:\n for name, content in testcase.files:\n if 'mypy.ini' in name:\n with open('mypy.ini', 'w') as m:\n m.write(content)\n output = []\n # Type check the module\n out, err, returncode = mypy.api.run(cmd_line)\n if has_program:\n os.remove(program)\n # split lines, remove newlines, and remove directory of test case\n for line in (out + err).splitlines():\n if line.startswith(test_temp_dir + os.sep):\n output.append(line[len(test_temp_dir + os.sep):].rstrip(\"\\r\\n\"))\n else:\n # Normalize paths so that the output is the same on Windows and Linux/macOS.\n line = line.replace(test_temp_dir + os.sep, test_temp_dir + '/')\n output.append(line.rstrip(\"\\r\\n\"))\n assert_string_arrays_equal([line for line in testcase.output], output,\n 'Invalid output ({}, line {})'.format(\n testcase.file, testcase.line))\n finally:\n if venv_dir is not None:\n os.chdir(old_dir)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testpep561.py_parse_pkgs_parse_mypy_args.return.m_group_1_split_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testpep561.py_parse_pkgs_parse_mypy_args.return.m_group_1_split_", "embedding": null, "metadata": {"file_path": "mypy/test/testpep561.py", "file_name": "testpep561.py", "file_type": "text/x-python", "category": "test", "start_line": 160, "end_line": 172, "span_ids": ["parse_pkgs", "parse_mypy_args"], "tokens": 129}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def parse_pkgs(comment: str) -> Tuple[List[str], List[str]]:\n if not comment.startswith('# pkgs:'):\n return ([], [])\n else:\n pkgs_str, *args = comment[7:].split(';')\n return ([pkg.strip() for pkg in pkgs_str.split(',')], [arg.strip() for arg in args])\n\n\ndef parse_mypy_args(line: str) -> List[str]:\n m = re.match('# flags: (.*)$', line)\n if not m:\n return [] # No args; mypy will spit out an error.\n return m.group(1).split()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testpep561.py_test_mypy_path_is_respected_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testpep561.py_test_mypy_path_is_respected_", "embedding": null, "metadata": {"file_path": "mypy/test/testpep561.py", "file_name": "testpep561.py", "file_type": "text/x-python", "category": "test", "start_line": 175, "end_line": 212, "span_ids": ["test_mypy_path_is_respected"], "tokens": 357}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@pytest.mark.skipif(sys.platform == 'darwin' and hasattr(sys, 'base_prefix') and\n sys.base_prefix != sys.prefix,\n reason=\"Temporarily skip to avoid having a virtualenv within a venv.\")\ndef test_mypy_path_is_respected() -> None:\n assert False\n packages = 'packages'\n pkg_name = 'a'\n with tempfile.TemporaryDirectory() as temp_dir:\n old_dir = os.getcwd()\n os.chdir(temp_dir)\n try:\n # Create the pkg for files to go into\n full_pkg_name = os.path.join(temp_dir, packages, pkg_name)\n os.makedirs(full_pkg_name)\n\n # Create the empty __init__ file to declare a package\n pkg_init_name = os.path.join(temp_dir, packages, pkg_name, '__init__.py')\n open(pkg_init_name, 'w', encoding='utf8').close()\n\n mypy_config_path = os.path.join(temp_dir, 'mypy.ini')\n with open(mypy_config_path, 'w') as mypy_file:\n mypy_file.write('[mypy]\\n')\n mypy_file.write('mypy_path = ./{}\\n'.format(packages))\n\n with virtualenv() as venv:\n venv_dir, python_executable = venv\n\n cmd_line_args = []\n if python_executable != sys.executable:\n cmd_line_args.append('--python-executable={}'.format(python_executable))\n cmd_line_args.extend(['--config-file', mypy_config_path,\n '--package', pkg_name])\n\n out, err, returncode = mypy.api.run(cmd_line_args)\n assert returncode == 0\n finally:\n os.chdir(old_dir)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testpythoneval.py__Test_cases_for_running_PythonEvaluationSuite.run_case.test_python_evaluation_te": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testpythoneval.py__Test_cases_for_running_PythonEvaluationSuite.run_case.test_python_evaluation_te", "embedding": null, "metadata": {"file_path": "mypy/test/testpythoneval.py", "file_name": "testpythoneval.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 44, "span_ids": ["PythonEvaluationSuite", "PythonEvaluationSuite.run_case", "docstring"], "tokens": 299}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Test cases for running mypy programs using a Python interpreter.\n\nEach test case type checks a program then runs it using Python. The\noutput (stdout) of the program is compared to expected output. Type checking\nuses full builtins and other stubs.\n\nNote: Currently Python interpreter paths are hard coded.\n\nNote: These test cases are *not* included in the main test suite, as including\n this suite would slow down the main suite too much.\n\"\"\"\n\nimport os\nimport os.path\nimport re\nimport subprocess\nfrom subprocess import PIPE\nimport sys\nfrom tempfile import TemporaryDirectory\n\nimport pytest\n\nfrom typing import List\n\nfrom mypy.defaults import PYTHON3_VERSION\nfrom mypy.test.config import test_temp_dir\nfrom mypy.test.data import DataDrivenTestCase, DataSuite\nfrom mypy.test.helpers import assert_string_arrays_equal, split_lines\nfrom mypy.util import try_find_python2_interpreter\nfrom mypy import api\n\n# Path to Python 3 interpreter\npython3_path = sys.executable\nprogram_re = re.compile(r'\\b_program.py\\b')\n\n\nclass PythonEvaluationSuite(DataSuite):\n files = ['pythoneval.test',\n 'python2eval.test',\n 'pythoneval-asyncio.test']\n cache_dir = TemporaryDirectory()\n\n def run_case(self, testcase: DataDrivenTestCase) -> None:\n test_python_evaluation(testcase, os.path.join(self.cache_dir.name, '.mypy_cache'))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testpythoneval.py_test_python_evaluation_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testpythoneval.py_test_python_evaluation_", "embedding": null, "metadata": {"file_path": "mypy/test/testpythoneval.py", "file_name": "testpythoneval.py", "file_type": "text/x-python", "category": "test", "start_line": 47, "end_line": 113, "span_ids": ["adapt_output", "test_python_evaluation"], "tokens": 648}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_python_evaluation(testcase: DataDrivenTestCase, cache_dir: str) -> None:\n \"\"\"Runs Mypy in a subprocess.\n\n If this passes without errors, executes the script again with a given Python\n version.\n \"\"\"\n assert testcase.old_cwd is not None, \"test was not properly set up\"\n # We must enable site packages to get access to installed stubs.\n # TODO: Enable strict optional for these tests\n mypy_cmdline = [\n '--show-traceback',\n '--no-strict-optional',\n '--no-silence-site-packages',\n '--no-error-summary',\n ]\n py2 = testcase.name.lower().endswith('python2')\n if py2:\n mypy_cmdline.append('--py2')\n interpreter = try_find_python2_interpreter()\n if interpreter is None:\n # Skip, can't find a Python 2 interpreter.\n pytest.skip()\n # placate the type checker\n return\n else:\n interpreter = python3_path\n mypy_cmdline.append('--python-version={}'.format('.'.join(map(str, PYTHON3_VERSION))))\n\n # Write the program to a file.\n program = '_' + testcase.name + '.py'\n program_path = os.path.join(test_temp_dir, program)\n mypy_cmdline.append(program_path)\n with open(program_path, 'w', encoding='utf8') as file:\n for s in testcase.input:\n file.write('{}\\n'.format(s))\n mypy_cmdline.append('--cache-dir={}'.format(cache_dir))\n output = []\n # Type check the program.\n out, err, returncode = api.run(mypy_cmdline)\n # split lines, remove newlines, and remove directory of test case\n for line in (out + err).splitlines():\n if line.startswith(test_temp_dir + os.sep):\n output.append(line[len(test_temp_dir + os.sep):].rstrip(\"\\r\\n\"))\n else:\n # Normalize paths so that the output is the same on Windows and Linux/macOS.\n line = line.replace(test_temp_dir + os.sep, test_temp_dir + '/')\n output.append(line.rstrip(\"\\r\\n\"))\n if returncode == 0:\n # Execute the program.\n proc = subprocess.run([interpreter, '-Wignore', program],\n cwd=test_temp_dir, stdout=PIPE, stderr=PIPE)\n output.extend(split_lines(proc.stdout, proc.stderr))\n # Remove temp file.\n os.remove(program_path)\n for i, line in enumerate(output):\n if os.path.sep + 'typeshed' + os.path.sep in line:\n output[i] = line.split(os.path.sep)[-1]\n assert_string_arrays_equal(adapt_output(testcase), output,\n 'Invalid output ({}, line {})'.format(\n testcase.file, testcase.line))\n\n\ndef adapt_output(testcase: DataDrivenTestCase) -> List[str]:\n \"\"\"Translates the generic _program.py into the actual filename.\"\"\"\n program = '_' + testcase.name + '.py'\n return [program_re.sub(program, line) for line in testcase.output]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testreports.py__Test_cases_for_reports_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testreports.py__Test_cases_for_reports_", "embedding": null, "metadata": {"file_path": "mypy/test/testreports.py", "file_name": "testreports.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 41, "span_ids": ["CoberturaReportSuite.test_get_line_rate", "CoberturaReportSuite.test_as_xml", "CoberturaReportSuite", "docstring"], "tokens": 324}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Test cases for reports generated by mypy.\"\"\"\nimport textwrap\n\nfrom mypy.test.helpers import Suite, assert_equal\nfrom mypy.report import CoberturaPackage, get_line_rate\n\nimport lxml.etree as etree # type: ignore\n\n\nclass CoberturaReportSuite(Suite):\n def test_get_line_rate(self) -> None:\n assert_equal('1.0', get_line_rate(0, 0))\n assert_equal('0.3333', get_line_rate(1, 3))\n\n def test_as_xml(self) -> None:\n cobertura_package = CoberturaPackage('foobar')\n cobertura_package.covered_lines = 21\n cobertura_package.total_lines = 42\n\n child_package = CoberturaPackage('raz')\n child_package.covered_lines = 10\n child_package.total_lines = 10\n child_package.classes['class'] = etree.Element('class')\n\n cobertura_package.packages['raz'] = child_package\n\n expected_output = textwrap.dedent('''\\\n \n \n \n \n \n \n \n \n \n \n ''').encode('ascii')\n assert_equal(expected_output,\n etree.tostring(cobertura_package.as_xml(), pretty_print=True))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsemanal.py__Semantic_analyzer_test_SemAnalSuite.run_case.test_semanal_testcase_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsemanal.py__Semantic_analyzer_test_SemAnalSuite.run_case.test_semanal_testcase_", "embedding": null, "metadata": {"file_path": "mypy/test/testsemanal.py", "file_name": "testsemanal.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 52, "span_ids": ["get_semanal_options", "SemAnalSuite", "SemAnalSuite.run_case", "docstring"], "tokens": 367}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Semantic analyzer test cases\"\"\"\n\nimport os.path\n\nfrom typing import Dict, List\n\nfrom mypy import build\nfrom mypy.modulefinder import BuildSource\nfrom mypy.defaults import PYTHON3_VERSION\nfrom mypy.test.helpers import (\n assert_string_arrays_equal, normalize_error_messages, testfile_pyversion, parse_options\n)\nfrom mypy.test.data import DataDrivenTestCase, DataSuite\nfrom mypy.test.config import test_temp_dir\nfrom mypy.errors import CompileError\nfrom mypy.nodes import TypeInfo\nfrom mypy.options import Options\n\n\n# Semantic analyzer test cases: dump parse tree\n\n# Semantic analysis test case description files.\nsemanal_files = ['semanal-basic.test',\n 'semanal-expressions.test',\n 'semanal-classes.test',\n 'semanal-types.test',\n 'semanal-typealiases.test',\n 'semanal-modules.test',\n 'semanal-statements.test',\n 'semanal-abstractclasses.test',\n 'semanal-namedtuple.test',\n 'semanal-typeddict.test',\n 'semenal-literal.test',\n 'semanal-classvar.test',\n 'semanal-python2.test']\n\n\ndef get_semanal_options(program_text: str, testcase: DataDrivenTestCase) -> Options:\n options = parse_options(program_text, testcase, 1)\n options.use_builtins_fixtures = True\n options.semantic_analysis_only = True\n options.show_traceback = True\n options.python_version = PYTHON3_VERSION\n return options\n\n\nclass SemAnalSuite(DataSuite):\n files = semanal_files\n native_sep = True\n\n def run_case(self, testcase: DataDrivenTestCase) -> None:\n test_semanal(testcase)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsemanal.py_test_semanal_test_semanal.assert_string_arrays_equa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsemanal.py_test_semanal_test_semanal.assert_string_arrays_equa", "embedding": null, "metadata": {"file_path": "mypy/test/testsemanal.py", "file_name": "testsemanal.py", "file_type": "text/x-python", "category": "test", "start_line": 55, "end_line": 97, "span_ids": ["test_semanal"], "tokens": 351}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_semanal(testcase: DataDrivenTestCase) -> None:\n \"\"\"Perform a semantic analysis test case.\n\n The testcase argument contains a description of the test case\n (inputs and output).\n \"\"\"\n\n try:\n src = '\\n'.join(testcase.input)\n options = get_semanal_options(src, testcase)\n options.python_version = testfile_pyversion(testcase.file)\n result = build.build(sources=[BuildSource('main', None, src)],\n options=options,\n alt_lib_path=test_temp_dir)\n a = result.errors\n if a:\n raise CompileError(a)\n # Include string representations of the source files in the actual\n # output.\n for fnam in sorted(result.files.keys()):\n f = result.files[fnam]\n # Omit the builtins module and files with a special marker in the\n # path.\n # TODO the test is not reliable\n if (not f.path.endswith((os.sep + 'builtins.pyi',\n 'typing.pyi',\n 'mypy_extensions.pyi',\n 'typing_extensions.pyi',\n 'abc.pyi',\n 'collections.pyi',\n 'sys.pyi'))\n and not os.path.basename(f.path).startswith('_')\n and not os.path.splitext(\n os.path.basename(f.path))[0].endswith('_')):\n a += str(f).split('\\n')\n except CompileError as e:\n a = e.messages\n if testcase.normalize_output:\n a = normalize_error_messages(a)\n assert_string_arrays_equal(\n testcase.output, a,\n 'Invalid semantic analyzer output ({}, line {})'.format(testcase.file,\n testcase.line))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsemanal.py__Semantic_analyzer_error_test_semanal_error.assert_string_arrays_equa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsemanal.py__Semantic_analyzer_error_test_semanal_error.assert_string_arrays_equa", "embedding": null, "metadata": {"file_path": "mypy/test/testsemanal.py", "file_name": "testsemanal.py", "file_type": "text/x-python", "category": "test", "start_line": 100, "end_line": 127, "span_ids": ["test_semanal_error", "test_semanal", "SemAnalErrorSuite.run_case", "SemAnalErrorSuite"], "tokens": 225}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Semantic analyzer error test cases\n\nclass SemAnalErrorSuite(DataSuite):\n files = ['semanal-errors.test']\n\n def run_case(self, testcase: DataDrivenTestCase) -> None:\n test_semanal_error(testcase)\n\n\ndef test_semanal_error(testcase: DataDrivenTestCase) -> None:\n \"\"\"Perform a test case.\"\"\"\n\n try:\n src = '\\n'.join(testcase.input)\n res = build.build(sources=[BuildSource('main', None, src)],\n options=get_semanal_options(src, testcase),\n alt_lib_path=test_temp_dir)\n a = res.errors\n assert a, 'No errors reported in {}, line {}'.format(testcase.file, testcase.line)\n except CompileError as e:\n # Verify that there was a compile error and that the error messages\n # are equivalent.\n a = e.messages\n if testcase.normalize_output:\n a = normalize_error_messages(a)\n assert_string_arrays_equal(\n testcase.output, a,\n 'Invalid compiler output ({}, line {})'.format(testcase.file, testcase.line))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsemanal.py__SymbolNode_table_export_SemAnalSymtableSuite.run_case.assert_string_arrays_equa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsemanal.py__SymbolNode_table_export_SemAnalSymtableSuite.run_case.assert_string_arrays_equa", "embedding": null, "metadata": {"file_path": "mypy/test/testsemanal.py", "file_name": "testsemanal.py", "file_type": "text/x-python", "category": "test", "start_line": 130, "end_line": 158, "span_ids": ["SemAnalSymtableSuite.run_case", "test_semanal_error", "SemAnalSymtableSuite"], "tokens": 246}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# SymbolNode table export test cases\n\nclass SemAnalSymtableSuite(DataSuite):\n required_out_section = True\n files = ['semanal-symtable.test']\n\n def run_case(self, testcase: DataDrivenTestCase) -> None:\n \"\"\"Perform a test case.\"\"\"\n try:\n # Build test case input.\n src = '\\n'.join(testcase.input)\n result = build.build(sources=[BuildSource('main', None, src)],\n options=get_semanal_options(src, testcase),\n alt_lib_path=test_temp_dir)\n # The output is the symbol table converted into a string.\n a = result.errors\n if a:\n raise CompileError(a)\n for f in sorted(result.files.keys()):\n if f not in ('builtins', 'typing', 'abc'):\n a.append('{}:'.format(f))\n for s in str(result.files[f].names).split('\\n'):\n a.append(' ' + s)\n except CompileError as e:\n a = e.messages\n assert_string_arrays_equal(\n testcase.output, a,\n 'Invalid semantic analyzer output ({}, line {})'.format(\n testcase.file, testcase.line))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsemanal.py__Type_info_export_test_c_SemAnalTypeInfoSuite.run_case.assert_string_arrays_equa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsemanal.py__Type_info_export_test_c_SemAnalTypeInfoSuite.run_case.assert_string_arrays_equa", "embedding": null, "metadata": {"file_path": "mypy/test/testsemanal.py", "file_name": "testsemanal.py", "file_type": "text/x-python", "category": "test", "start_line": 161, "end_line": 193, "span_ids": ["SemAnalSymtableSuite.run_case", "SemAnalTypeInfoSuite.run_case", "SemAnalTypeInfoSuite"], "tokens": 259}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Type info export test cases\nclass SemAnalTypeInfoSuite(DataSuite):\n required_out_section = True\n files = ['semanal-typeinfo.test']\n\n def run_case(self, testcase: DataDrivenTestCase) -> None:\n \"\"\"Perform a test case.\"\"\"\n try:\n # Build test case input.\n src = '\\n'.join(testcase.input)\n result = build.build(sources=[BuildSource('main', None, src)],\n options=get_semanal_options(src, testcase),\n alt_lib_path=test_temp_dir)\n a = result.errors\n if a:\n raise CompileError(a)\n\n # Collect all TypeInfos in top-level modules.\n typeinfos = TypeInfoMap()\n for f in result.files.values():\n for n in f.names.values():\n if isinstance(n.node, TypeInfo):\n assert n.fullname is not None\n typeinfos[n.fullname] = n.node\n\n # The output is the symbol table converted into a string.\n a = str(typeinfos).split('\\n')\n except CompileError as e:\n a = e.messages\n assert_string_arrays_equal(\n testcase.output, a,\n 'Invalid semantic analyzer output ({}, line {})'.format(\n testcase.file, testcase.line))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsemanal.py_TypeInfoMap_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsemanal.py_TypeInfoMap_", "embedding": null, "metadata": {"file_path": "mypy/test/testsemanal.py", "file_name": "testsemanal.py", "file_type": "text/x-python", "category": "test", "start_line": 196, "end_line": 207, "span_ids": ["TypeInfoMap", "TypeInfoMap.__str__"], "tokens": 126}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeInfoMap(Dict[str, TypeInfo]):\n def __str__(self) -> str:\n a = ['TypeInfoMap('] # type: List[str]\n for x, y in sorted(self.items()):\n if isinstance(x, str) and (not x.startswith('builtins.') and\n not x.startswith('typing.') and\n not x.startswith('abc.')):\n ti = ('\\n' + ' ').join(str(y).split('\\n'))\n a.append(' {} : {}'.format(x, ti))\n a[-1] += ')'\n return '\\n'.join(a)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsolve.py__Test_cases_for_the_con_SolveSuite.test_multiple_variables.self_assert_solve_self_f": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsolve.py__Test_cases_for_the_con_SolveSuite.test_multiple_variables.self_assert_solve_self_f", "embedding": null, "metadata": {"file_path": "mypy/test/testsolve.py", "file_name": "testsolve.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 61, "span_ids": ["SolveSuite.test_simple_subtype_constraints", "SolveSuite.test_unsatisfiable_constraints", "SolveSuite.test_both_kinds_of_constraints", "SolveSuite", "SolveSuite.setUp", "SolveSuite.test_empty_input", "docstring", "SolveSuite.test_exactly_specified_result", "SolveSuite.test_simple_supertype_constraints", "SolveSuite.test_multiple_variables"], "tokens": 550}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Test cases for the constraint solver used in type inference.\"\"\"\n\nfrom typing import List, Union, Tuple, Optional\n\nfrom mypy.test.helpers import Suite, assert_equal\nfrom mypy.constraints import SUPERTYPE_OF, SUBTYPE_OF, Constraint\nfrom mypy.solve import solve_constraints\nfrom mypy.test.typefixture import TypeFixture\nfrom mypy.types import Type, TypeVarType, TypeVarId\n\n\nclass SolveSuite(Suite):\n def setUp(self) -> None:\n self.fx = TypeFixture()\n\n def test_empty_input(self) -> None:\n self.assert_solve([], [], [])\n\n def test_simple_supertype_constraints(self) -> None:\n self.assert_solve([self.fx.t.id],\n [self.supc(self.fx.t, self.fx.a)],\n [(self.fx.a, self.fx.o)])\n self.assert_solve([self.fx.t.id],\n [self.supc(self.fx.t, self.fx.a),\n self.supc(self.fx.t, self.fx.b)],\n [(self.fx.a, self.fx.o)])\n\n def test_simple_subtype_constraints(self) -> None:\n self.assert_solve([self.fx.t.id],\n [self.subc(self.fx.t, self.fx.a)],\n [self.fx.a])\n self.assert_solve([self.fx.t.id],\n [self.subc(self.fx.t, self.fx.a),\n self.subc(self.fx.t, self.fx.b)],\n [self.fx.b])\n\n def test_both_kinds_of_constraints(self) -> None:\n self.assert_solve([self.fx.t.id],\n [self.supc(self.fx.t, self.fx.b),\n self.subc(self.fx.t, self.fx.a)],\n [(self.fx.b, self.fx.a)])\n\n def test_unsatisfiable_constraints(self) -> None:\n # The constraints are impossible to satisfy.\n self.assert_solve([self.fx.t.id],\n [self.supc(self.fx.t, self.fx.a),\n self.subc(self.fx.t, self.fx.b)],\n [None])\n\n def test_exactly_specified_result(self) -> None:\n self.assert_solve([self.fx.t.id],\n [self.supc(self.fx.t, self.fx.b),\n self.subc(self.fx.t, self.fx.b)],\n [(self.fx.b, self.fx.b)])\n\n def test_multiple_variables(self) -> None:\n self.assert_solve([self.fx.t.id, self.fx.s.id],\n [self.supc(self.fx.t, self.fx.b),\n self.supc(self.fx.s, self.fx.c),\n self.subc(self.fx.t, self.fx.a)],\n [(self.fx.b, self.fx.a), (self.fx.c, self.fx.o)])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsolve.py_SolveSuite.test_no_constraints_for_var_SolveSuite.test_no_constraints_for_var.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsolve.py_SolveSuite.test_no_constraints_for_var_SolveSuite.test_no_constraints_for_var.None_2", "embedding": null, "metadata": {"file_path": "mypy/test/testsolve.py", "file_name": "testsolve.py", "file_type": "text/x-python", "category": "test", "start_line": 63, "end_line": 72, "span_ids": ["SolveSuite.test_no_constraints_for_var"], "tokens": 118}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SolveSuite(Suite):\n\n def test_no_constraints_for_var(self) -> None:\n self.assert_solve([self.fx.t.id],\n [],\n [self.fx.uninhabited])\n self.assert_solve([self.fx.t.id, self.fx.s.id],\n [],\n [self.fx.uninhabited, self.fx.uninhabited])\n self.assert_solve([self.fx.t.id, self.fx.s.id],\n [self.supc(self.fx.s, self.fx.a)],\n [self.fx.uninhabited, (self.fx.a, self.fx.o)])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsolve.py_SolveSuite.test_simple_constraints_with_dynamic_type_SolveSuite.test_simple_constraints_with_dynamic_type._TODO_figure_out_what_t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsolve.py_SolveSuite.test_simple_constraints_with_dynamic_type_SolveSuite.test_simple_constraints_with_dynamic_type._TODO_figure_out_what_t", "embedding": null, "metadata": {"file_path": "mypy/test/testsolve.py", "file_name": "testsolve.py", "file_type": "text/x-python", "category": "test", "start_line": 74, "end_line": 98, "span_ids": ["SolveSuite.test_simple_constraints_with_dynamic_type"], "tokens": 310}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SolveSuite(Suite):\n\n def test_simple_constraints_with_dynamic_type(self) -> None:\n self.assert_solve([self.fx.t.id],\n [self.supc(self.fx.t, self.fx.anyt)],\n [(self.fx.anyt, self.fx.anyt)])\n self.assert_solve([self.fx.t.id],\n [self.supc(self.fx.t, self.fx.anyt),\n self.supc(self.fx.t, self.fx.anyt)],\n [(self.fx.anyt, self.fx.anyt)])\n self.assert_solve([self.fx.t.id],\n [self.supc(self.fx.t, self.fx.anyt),\n self.supc(self.fx.t, self.fx.a)],\n [(self.fx.anyt, self.fx.anyt)])\n\n self.assert_solve([self.fx.t.id],\n [self.subc(self.fx.t, self.fx.anyt)],\n [(self.fx.anyt, self.fx.anyt)])\n self.assert_solve([self.fx.t.id],\n [self.subc(self.fx.t, self.fx.anyt),\n self.subc(self.fx.t, self.fx.anyt)],\n [(self.fx.anyt, self.fx.anyt)])\n # self.assert_solve([self.fx.t.id],\n # [self.subc(self.fx.t, self.fx.anyt),\n # self.subc(self.fx.t, self.fx.a)],\n # [(self.fx.anyt, self.fx.anyt)])\n # TODO: figure out what this should be after changes to meet(any, X)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsolve.py_SolveSuite.test_both_normal_and_any_types_in_results_SolveSuite.test_both_normal_and_any_types_in_results.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsolve.py_SolveSuite.test_both_normal_and_any_types_in_results_SolveSuite.test_both_normal_and_any_types_in_results.None_1", "embedding": null, "metadata": {"file_path": "mypy/test/testsolve.py", "file_name": "testsolve.py", "file_type": "text/x-python", "category": "test", "start_line": 100, "end_line": 111, "span_ids": ["SolveSuite.test_both_normal_and_any_types_in_results"], "tokens": 150}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SolveSuite(Suite):\n\n def test_both_normal_and_any_types_in_results(self) -> None:\n # If one of the bounds is any, we promote the other bound to\n # any as well, since otherwise the type range does not make sense.\n self.assert_solve([self.fx.t.id],\n [self.supc(self.fx.t, self.fx.a),\n self.subc(self.fx.t, self.fx.anyt)],\n [(self.fx.anyt, self.fx.anyt)])\n\n self.assert_solve([self.fx.t.id],\n [self.supc(self.fx.t, self.fx.anyt),\n self.subc(self.fx.t, self.fx.a)],\n [(self.fx.anyt, self.fx.anyt)])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsolve.py_SolveSuite.assert_solve_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsolve.py_SolveSuite.assert_solve_", "embedding": null, "metadata": {"file_path": "mypy/test/testsolve.py", "file_name": "testsolve.py", "file_type": "text/x-python", "category": "test", "start_line": 113, "end_line": 132, "span_ids": ["SolveSuite.assert_solve", "SolveSuite.subc", "SolveSuite.supc"], "tokens": 178}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SolveSuite(Suite):\n\n def assert_solve(self,\n vars: List[TypeVarId],\n constraints: List[Constraint],\n results: List[Union[None, Type, Tuple[Type, Type]]],\n ) -> None:\n res = [] # type: List[Optional[Type]]\n for r in results:\n if isinstance(r, tuple):\n res.append(r[0])\n else:\n res.append(r)\n actual = solve_constraints(vars, constraints)\n assert_equal(str(actual), str(res))\n\n def supc(self, type_var: TypeVarType, bound: Type) -> Constraint:\n return Constraint(type_var.id, SUPERTYPE_OF, bound)\n\n def subc(self, type_var: TypeVarType, bound: Type) -> Constraint:\n return Constraint(type_var.id, SUBTYPE_OF, bound)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_io_from_mypy_moduleinspect_i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_io_from_mypy_moduleinspect_i", "embedding": null, "metadata": {"file_path": "mypy/test/teststubgen.py", "file_name": "teststubgen.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 30, "span_ids": ["imports"], "tokens": 239}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import io\nimport os.path\nimport shutil\nimport sys\nimport tempfile\nimport re\nimport unittest\nfrom types import ModuleType\n\nfrom typing import Any, List, Tuple, Optional\n\nfrom mypy.test.helpers import (\n assert_equal, assert_string_arrays_equal, local_sys_path_set\n)\nfrom mypy.test.data import DataSuite, DataDrivenTestCase\nfrom mypy.errors import CompileError\nfrom mypy.stubgen import (\n generate_stubs, parse_options, Options, collect_build_targets,\n mypy_options, is_blacklisted_path, is_non_library_module\n)\nfrom mypy.stubutil import walk_packages, remove_misplaced_type_comments, common_dir_prefix\nfrom mypy.stubgenc import (\n generate_c_type_stub, infer_method_sig, generate_c_function_stub, generate_c_property_stub\n)\nfrom mypy.stubdoc import (\n parse_signature, parse_all_signatures, build_signature, find_unique_signatures,\n infer_sig_from_docstring, infer_prop_type_from_docstring, FunctionSig, ArgSig,\n infer_arg_sig_from_anon_docstring, is_valid_type\n)\nfrom mypy.moduleinspect import ModuleInspect, InspectError", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenCmdLineSuite_StubgenCmdLineSuite.test_files_found.with_tempfile_TemporaryDi.try_.finally_.os_chdir_current_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenCmdLineSuite_StubgenCmdLineSuite.test_files_found.with_tempfile_TemporaryDi.try_.finally_.os_chdir_current_", "embedding": null, "metadata": {"file_path": "mypy/test/teststubgen.py", "file_name": "teststubgen.py", "file_type": "text/x-python", "category": "test", "start_line": 33, "end_line": 55, "span_ids": ["StubgenCmdLineSuite.test_files_found", "StubgenCmdLineSuite"], "tokens": 238}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubgenCmdLineSuite(unittest.TestCase):\n \"\"\"Test cases for processing command-line options and finding files.\"\"\"\n\n @unittest.skipIf(sys.platform == 'win32', \"clean up fails on Windows\")\n def test_files_found(self) -> None:\n current = os.getcwd()\n with tempfile.TemporaryDirectory() as tmp:\n try:\n os.chdir(tmp)\n os.mkdir('subdir')\n self.make_file('subdir', 'a.py')\n self.make_file('subdir', 'b.py')\n os.mkdir(os.path.join('subdir', 'pack'))\n self.make_file('subdir', 'pack', '__init__.py')\n opts = parse_options(['subdir'])\n py_mods, c_mods = collect_build_targets(opts, mypy_options(opts))\n assert_equal(c_mods, [])\n files = {mod.path for mod in py_mods}\n assert_equal(files, {os.path.join('subdir', 'pack', '__init__.py'),\n os.path.join('subdir', 'a.py'),\n os.path.join('subdir', 'b.py')})\n finally:\n os.chdir(current)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenCmdLineSuite.test_packages_found_StubgenCmdLineSuite.test_packages_found.with_tempfile_TemporaryDi.try_.finally_.os_chdir_current_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenCmdLineSuite.test_packages_found_StubgenCmdLineSuite.test_packages_found.with_tempfile_TemporaryDi.try_.finally_.os_chdir_current_", "embedding": null, "metadata": {"file_path": "mypy/test/teststubgen.py", "file_name": "teststubgen.py", "file_type": "text/x-python", "category": "test", "start_line": 57, "end_line": 75, "span_ids": ["StubgenCmdLineSuite.test_packages_found"], "tokens": 219}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubgenCmdLineSuite(unittest.TestCase):\n\n @unittest.skipIf(sys.platform == 'win32', \"clean up fails on Windows\")\n def test_packages_found(self) -> None:\n current = os.getcwd()\n with tempfile.TemporaryDirectory() as tmp:\n try:\n os.chdir(tmp)\n os.mkdir('pack')\n self.make_file('pack', '__init__.py', content='from . import a, b')\n self.make_file('pack', 'a.py')\n self.make_file('pack', 'b.py')\n opts = parse_options(['-p', 'pack'])\n py_mods, c_mods = collect_build_targets(opts, mypy_options(opts))\n assert_equal(c_mods, [])\n files = {os.path.relpath(mod.path or 'FAIL') for mod in py_mods}\n assert_equal(files, {os.path.join('pack', '__init__.py'),\n os.path.join('pack', 'a.py'),\n os.path.join('pack', 'b.py')})\n finally:\n os.chdir(current)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenCmdLineSuite.test_module_not_found_StubgenCmdLineSuite.run.with_local_sys_path_set_.return.super_run_result_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenCmdLineSuite.test_module_not_found_StubgenCmdLineSuite.run.with_local_sys_path_set_.return.super_run_result_", "embedding": null, "metadata": {"file_path": "mypy/test/teststubgen.py", "file_name": "teststubgen.py", "file_type": "text/x-python", "category": "test", "start_line": 77, "end_line": 100, "span_ids": ["StubgenCmdLineSuite.test_module_not_found", "StubgenCmdLineSuite.make_file", "StubgenCmdLineSuite.run"], "tokens": 227}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubgenCmdLineSuite(unittest.TestCase):\n\n @unittest.skipIf(sys.platform == 'win32', \"clean up fails on Windows\")\n def test_module_not_found(self) -> None:\n current = os.getcwd()\n captured_output = io.StringIO()\n sys.stdout = captured_output\n with tempfile.TemporaryDirectory() as tmp:\n try:\n os.chdir(tmp)\n self.make_file(tmp, 'mymodule.py', content='import a')\n opts = parse_options(['-m', 'mymodule'])\n py_mods, c_mods = collect_build_targets(opts, mypy_options(opts))\n assert captured_output.getvalue() == ''\n finally:\n sys.stdout = sys.__stdout__\n os.chdir(current)\n\n def make_file(self, *path: str, content: str = '') -> None:\n file = os.path.join(*path)\n with open(file, 'w') as f:\n f.write(content)\n\n def run(self, result: Optional[Any] = None) -> Optional[Any]:\n with local_sys_path_set():\n return super().run(result)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenCliParseSuite_StubgenCliParseSuite.test_walk_packages.with_ModuleInspect_as_m.self_assertTrue_all_mypy_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenCliParseSuite_StubgenCliParseSuite.test_walk_packages.with_ModuleInspect_as_m.self_assertTrue_all_mypy_", "embedding": null, "metadata": {"file_path": "mypy/test/teststubgen.py", "file_name": "teststubgen.py", "file_type": "text/x-python", "category": "test", "start_line": 103, "end_line": 121, "span_ids": ["StubgenCliParseSuite.test_walk_packages", "StubgenCliParseSuite"], "tokens": 148}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubgenCliParseSuite(unittest.TestCase):\n def test_walk_packages(self) -> None:\n with ModuleInspect() as m:\n assert_equal(\n set(walk_packages(m, [\"mypy.errors\"])),\n {\"mypy.errors\"})\n\n assert_equal(\n set(walk_packages(m, [\"mypy.errors\", \"mypy.stubgen\"])),\n {\"mypy.errors\", \"mypy.stubgen\"})\n\n all_mypy_packages = set(walk_packages(m, [\"mypy\"]))\n self.assertTrue(all_mypy_packages.issuperset({\n \"mypy\",\n \"mypy.errors\",\n \"mypy.stubgen\",\n \"mypy.test\",\n \"mypy.test.helpers\",\n }))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenUtilSuite_StubgenUtilSuite.test_find_unique_signatures.assert_equal_find_unique_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenUtilSuite_StubgenUtilSuite.test_find_unique_signatures.assert_equal_find_unique_", "embedding": null, "metadata": {"file_path": "mypy/test/teststubgen.py", "file_name": "teststubgen.py", "file_type": "text/x-python", "category": "test", "start_line": 124, "end_line": 185, "span_ids": ["StubgenUtilSuite.test_parse_signature", "StubgenUtilSuite.test_parse_signature_with_default_arg", "StubgenUtilSuite.test_parse_all_signatures", "StubgenUtilSuite.test_parse_signature_with_args", "StubgenUtilSuite.test_build_signature", "StubgenUtilSuite.test_parse_signature_with_star_star_arg", "StubgenUtilSuite.test_parse_signature_with_kw_only_arg", "StubgenUtilSuite", "StubgenUtilSuite.test_parse_signature_with_star_arg", "StubgenUtilSuite.test_find_unique_signatures", "StubgenUtilSuite.test_parse_signature_with_optional_args", "StubgenUtilSuite.test_parse_signature_with_qualified_function", "StubgenUtilSuite.assert_parse_signature"], "tokens": 691}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubgenUtilSuite(unittest.TestCase):\n \"\"\"Unit tests for stubgen utility functions.\"\"\"\n\n def test_parse_signature(self) -> None:\n self.assert_parse_signature('func()', ('func', [], []))\n\n def test_parse_signature_with_args(self) -> None:\n self.assert_parse_signature('func(arg)', ('func', ['arg'], []))\n self.assert_parse_signature('do(arg, arg2)', ('do', ['arg', 'arg2'], []))\n\n def test_parse_signature_with_optional_args(self) -> None:\n self.assert_parse_signature('func([arg])', ('func', [], ['arg']))\n self.assert_parse_signature('func(arg[, arg2])', ('func', ['arg'], ['arg2']))\n self.assert_parse_signature('func([arg[, arg2]])', ('func', [], ['arg', 'arg2']))\n\n def test_parse_signature_with_default_arg(self) -> None:\n self.assert_parse_signature('func(arg=None)', ('func', [], ['arg']))\n self.assert_parse_signature('func(arg, arg2=None)', ('func', ['arg'], ['arg2']))\n self.assert_parse_signature('func(arg=1, arg2=\"\")', ('func', [], ['arg', 'arg2']))\n\n def test_parse_signature_with_qualified_function(self) -> None:\n self.assert_parse_signature('ClassName.func(arg)', ('func', ['arg'], []))\n\n def test_parse_signature_with_kw_only_arg(self) -> None:\n self.assert_parse_signature('ClassName.func(arg, *, arg2=1)',\n ('func', ['arg', '*'], ['arg2']))\n\n def test_parse_signature_with_star_arg(self) -> None:\n self.assert_parse_signature('ClassName.func(arg, *args)',\n ('func', ['arg', '*args'], []))\n\n def test_parse_signature_with_star_star_arg(self) -> None:\n self.assert_parse_signature('ClassName.func(arg, **args)',\n ('func', ['arg', '**args'], []))\n\n def assert_parse_signature(self, sig: str, result: Tuple[str, List[str], List[str]]) -> None:\n assert_equal(parse_signature(sig), result)\n\n def test_build_signature(self) -> None:\n assert_equal(build_signature([], []), '()')\n assert_equal(build_signature(['arg'], []), '(arg)')\n assert_equal(build_signature(['arg', 'arg2'], []), '(arg, arg2)')\n assert_equal(build_signature(['arg'], ['arg2']), '(arg, arg2=...)')\n assert_equal(build_signature(['arg'], ['arg2', '**x']), '(arg, arg2=..., **x)')\n\n def test_parse_all_signatures(self) -> None:\n assert_equal(parse_all_signatures(['random text',\n '.. function:: fn(arg',\n '.. function:: fn()',\n ' .. method:: fn2(arg)']),\n ([('fn', '()'),\n ('fn2', '(arg)')], []))\n\n def test_find_unique_signatures(self) -> None:\n assert_equal(find_unique_signatures(\n [('func', '()'),\n ('func', '()'),\n ('func2', '()'),\n ('func2', '(arg)'),\n ('func3', '(arg, arg2)')]),\n [('func', '()'),\n ('func3', '(arg, arg2)')])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenUtilSuite.test_infer_sig_from_docstring_StubgenUtilSuite.test_infer_sig_from_docstring.None_14": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenUtilSuite.test_infer_sig_from_docstring_StubgenUtilSuite.test_infer_sig_from_docstring.None_14", "embedding": null, "metadata": {"file_path": "mypy/test/teststubgen.py", "file_name": "teststubgen.py", "file_type": "text/x-python", "category": "test", "start_line": 187, "end_line": 243, "span_ids": ["StubgenUtilSuite.test_infer_sig_from_docstring"], "tokens": 752}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubgenUtilSuite(unittest.TestCase):\n\n def test_infer_sig_from_docstring(self) -> None:\n assert_equal(infer_sig_from_docstring('\\nfunc(x) - y', 'func'),\n [FunctionSig(name='func', args=[ArgSig(name='x')], ret_type='Any')])\n\n assert_equal(infer_sig_from_docstring('\\nfunc(x, Y_a=None)', 'func'),\n [FunctionSig(name='func',\n args=[ArgSig(name='x'), ArgSig(name='Y_a', default=True)],\n ret_type='Any')])\n\n assert_equal(infer_sig_from_docstring('\\nfunc(x, Y_a=3)', 'func'),\n [FunctionSig(name='func',\n args=[ArgSig(name='x'), ArgSig(name='Y_a', default=True)],\n ret_type='Any')])\n\n assert_equal(infer_sig_from_docstring('\\nfunc(x, Y_a=[1, 2, 3])', 'func'),\n [FunctionSig(name='func',\n args=[ArgSig(name='x'), ArgSig(name='Y_a', default=True)],\n ret_type='Any')])\n\n assert_equal(infer_sig_from_docstring('\\nafunc(x) - y', 'func'), [])\n assert_equal(infer_sig_from_docstring('\\nfunc(x, y', 'func'), [])\n assert_equal(infer_sig_from_docstring('\\nfunc(x=z(y))', 'func'),\n [FunctionSig(name='func', args=[ArgSig(name='x', default=True)],\n ret_type='Any')])\n\n assert_equal(infer_sig_from_docstring('\\nfunc x', 'func'), [])\n # Try to infer signature from type annotation.\n assert_equal(infer_sig_from_docstring('\\nfunc(x: int)', 'func'),\n [FunctionSig(name='func', args=[ArgSig(name='x', type='int')],\n ret_type='Any')])\n assert_equal(infer_sig_from_docstring('\\nfunc(x: int=3)', 'func'),\n [FunctionSig(name='func', args=[ArgSig(name='x', type='int', default=True)],\n ret_type='Any')])\n\n assert_equal(infer_sig_from_docstring('\\nfunc(x: int=3) -> int', 'func'),\n [FunctionSig(name='func', args=[ArgSig(name='x', type='int', default=True)],\n ret_type='int')])\n\n assert_equal(infer_sig_from_docstring('\\nfunc(x: int=3) -> int \\n', 'func'),\n [FunctionSig(name='func', args=[ArgSig(name='x', type='int', default=True)],\n ret_type='int')])\n\n assert_equal(infer_sig_from_docstring('\\nfunc(x: Tuple[int, str]) -> str', 'func'),\n [FunctionSig(name='func', args=[ArgSig(name='x', type='Tuple[int,str]')],\n ret_type='str')])\n\n assert_equal(\n infer_sig_from_docstring('\\nfunc(x: Tuple[int, Tuple[str, int], str], y: int) -> str',\n 'func'),\n [FunctionSig(name='func',\n args=[ArgSig(name='x', type='Tuple[int,Tuple[str,int],str]'),\n ArgSig(name='y', type='int')],\n ret_type='str')])\n\n assert_equal(infer_sig_from_docstring('\\nfunc(x: foo.bar)', 'func'),\n [FunctionSig(name='func', args=[ArgSig(name='x', type='foo.bar')],\n ret_type='Any')])\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenUtilSuite.test_infer_sig_from_docstring.None_15_StubgenUtilSuite.test_infer_sig_from_docstring.None_19": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenUtilSuite.test_infer_sig_from_docstring.None_15_StubgenUtilSuite.test_infer_sig_from_docstring.None_19", "embedding": null, "metadata": {"file_path": "mypy/test/teststubgen.py", "file_name": "teststubgen.py", "file_type": "text/x-python", "category": "test", "start_line": 245, "end_line": 261, "span_ids": ["StubgenUtilSuite.test_infer_sig_from_docstring"], "tokens": 266}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubgenUtilSuite(unittest.TestCase):\n\n def test_infer_sig_from_docstring(self) -> None:\n # ... other code\n\n assert_equal(infer_sig_from_docstring('\\nfunc(x: list=[1,2,[3,4]])', 'func'),\n [FunctionSig(name='func', args=[ArgSig(name='x', type='list', default=True)],\n ret_type='Any')])\n\n assert_equal(infer_sig_from_docstring('\\nfunc(x: str=\"nasty[\")', 'func'),\n [FunctionSig(name='func', args=[ArgSig(name='x', type='str', default=True)],\n ret_type='Any')])\n\n assert_equal(infer_sig_from_docstring('\\nfunc[(x: foo.bar, invalid]', 'func'), [])\n\n assert_equal(infer_sig_from_docstring('\\nfunc(x: invalid::type)', 'func'),\n [FunctionSig(name='func', args=[ArgSig(name='x', type=None)],\n ret_type='Any')])\n\n assert_equal(infer_sig_from_docstring('\\nfunc(x: str=\"\")', 'func'),\n [FunctionSig(name='func', args=[ArgSig(name='x', type='str', default=True)],\n ret_type='Any')])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenUtilSuite.test_infer_sig_from_docstring_duplicate_args_StubgenUtilSuite.test_infer_sig_from_docstring_bad_indentation.assert_equal_infer_sig_fr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenUtilSuite.test_infer_sig_from_docstring_duplicate_args_StubgenUtilSuite.test_infer_sig_from_docstring_bad_indentation.assert_equal_infer_sig_fr", "embedding": null, "metadata": {"file_path": "mypy/test/teststubgen.py", "file_name": "teststubgen.py", "file_type": "text/x-python", "category": "test", "start_line": 263, "end_line": 273, "span_ids": ["StubgenUtilSuite.test_infer_sig_from_docstring_duplicate_args", "StubgenUtilSuite.test_infer_sig_from_docstring_bad_indentation"], "tokens": 127}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubgenUtilSuite(unittest.TestCase):\n\n def test_infer_sig_from_docstring_duplicate_args(self) -> None:\n assert_equal(infer_sig_from_docstring('\\nfunc(x, x) -> str\\nfunc(x, y) -> int', 'func'),\n [FunctionSig(name='func', args=[ArgSig(name='x'), ArgSig(name='y')],\n ret_type='int')])\n\n def test_infer_sig_from_docstring_bad_indentation(self) -> None:\n assert_equal(infer_sig_from_docstring(\"\"\"\n x\n x\n x\n \"\"\", 'func'), None)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenUtilSuite.test_infer_arg_sig_from_anon_docstring_StubgenUtilSuite.test_infer_arg_sig_from_anon_docstring.assert_equal_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenUtilSuite.test_infer_arg_sig_from_anon_docstring_StubgenUtilSuite.test_infer_arg_sig_from_anon_docstring.assert_equal_", "embedding": null, "metadata": {"file_path": "mypy/test/teststubgen.py", "file_name": "teststubgen.py", "file_type": "text/x-python", "category": "test", "start_line": 275, "end_line": 283, "span_ids": ["StubgenUtilSuite.test_infer_arg_sig_from_anon_docstring"], "tokens": 144}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubgenUtilSuite(unittest.TestCase):\n\n def test_infer_arg_sig_from_anon_docstring(self) -> None:\n assert_equal(infer_arg_sig_from_anon_docstring(\"(*args, **kwargs)\"),\n [ArgSig(name='*args'), ArgSig(name='**kwargs')])\n\n assert_equal(\n infer_arg_sig_from_anon_docstring(\n \"(x: Tuple[int, Tuple[str, int], str]=(1, ('a', 2), 'y'), y: int=4)\"),\n [ArgSig(name='x', type='Tuple[int,Tuple[str,int],str]', default=True),\n ArgSig(name='y', type='int', default=True)])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenUtilSuite.test_infer_prop_type_from_docstring_StubgenUtilSuite.test_remove_misplaced_type_comments_1.assert_equal_remove_mispl": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenUtilSuite.test_infer_prop_type_from_docstring_StubgenUtilSuite.test_remove_misplaced_type_comments_1.assert_equal_remove_mispl", "embedding": null, "metadata": {"file_path": "mypy/test/teststubgen.py", "file_name": "teststubgen.py", "file_type": "text/x-python", "category": "test", "start_line": 285, "end_line": 313, "span_ids": ["StubgenUtilSuite.test_remove_misplaced_type_comments_1", "StubgenUtilSuite.test_infer_prop_type_from_docstring", "StubgenUtilSuite.test_infer_sig_from_docstring_square_brackets"], "tokens": 254}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubgenUtilSuite(unittest.TestCase):\n\n def test_infer_prop_type_from_docstring(self) -> None:\n assert_equal(infer_prop_type_from_docstring('str: A string.'), 'str')\n assert_equal(infer_prop_type_from_docstring('Optional[int]: An int.'), 'Optional[int]')\n assert_equal(infer_prop_type_from_docstring('Tuple[int, int]: A tuple.'),\n 'Tuple[int, int]')\n assert_equal(infer_prop_type_from_docstring('\\nstr: A string.'), None)\n\n def test_infer_sig_from_docstring_square_brackets(self) -> None:\n assert infer_sig_from_docstring(\n 'fetch_row([maxrows, how]) -- Fetches stuff',\n 'fetch_row',\n ) == []\n\n def test_remove_misplaced_type_comments_1(self) -> None:\n good = \"\"\"\n \\u1234\n def f(x): # type: (int) -> int\n\n def g(x):\n # type: (int) -> int\n\n def h():\n\n # type: () int\n\n x = 1 # type: int\n \"\"\"\n\n assert_equal(remove_misplaced_type_comments(good), good)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenUtilSuite.test_remove_misplaced_type_comments_2_StubgenUtilSuite.test_remove_misplaced_type_comments_2.assert_equal_remove_mispl": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenUtilSuite.test_remove_misplaced_type_comments_2_StubgenUtilSuite.test_remove_misplaced_type_comments_2.assert_equal_remove_mispl", "embedding": null, "metadata": {"file_path": "mypy/test/teststubgen.py", "file_name": "teststubgen.py", "file_type": "text/x-python", "category": "test", "start_line": 315, "end_line": 336, "span_ids": ["StubgenUtilSuite.test_remove_misplaced_type_comments_2"], "tokens": 114}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubgenUtilSuite(unittest.TestCase):\n\n def test_remove_misplaced_type_comments_2(self) -> None:\n bad = \"\"\"\n def f(x):\n # type: Callable[[int], int]\n pass\n\n # type: \"foo\"\n # type: 'bar'\n x = 1\n # type: int\n \"\"\"\n bad_fixed = \"\"\"\n def f(x):\n\n pass\n\n\n\n x = 1\n\n \"\"\"\n assert_equal(remove_misplaced_type_comments(bad), bad_fixed)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenUtilSuite.test_remove_misplaced_type_comments_3_StubgenUtilSuite.test_remove_misplaced_type_comments_3.assert_equal_remove_mispl": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenUtilSuite.test_remove_misplaced_type_comments_3_StubgenUtilSuite.test_remove_misplaced_type_comments_3.assert_equal_remove_mispl", "embedding": null, "metadata": {"file_path": "mypy/test/teststubgen.py", "file_name": "teststubgen.py", "file_type": "text/x-python", "category": "test", "start_line": 338, "end_line": 363, "span_ids": ["StubgenUtilSuite.test_remove_misplaced_type_comments_3"], "tokens": 128}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubgenUtilSuite(unittest.TestCase):\n\n def test_remove_misplaced_type_comments_3(self) -> None:\n bad = '''\n def f(x):\n \"\"\"docstring\"\"\"\n # type: (int) -> int\n pass\n\n def g(x):\n \"\"\"docstring\n \"\"\"\n # type: (int) -> int\n pass\n '''\n bad_fixed = '''\n def f(x):\n \"\"\"docstring\"\"\"\n\n pass\n\n def g(x):\n \"\"\"docstring\n \"\"\"\n\n pass\n '''\n assert_equal(remove_misplaced_type_comments(bad), bad_fixed)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenUtilSuite.test_remove_misplaced_type_comments_4_StubgenUtilSuite.test_remove_misplaced_type_comments_4.assert_equal_remove_mispl": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenUtilSuite.test_remove_misplaced_type_comments_4_StubgenUtilSuite.test_remove_misplaced_type_comments_4.assert_equal_remove_mispl", "embedding": null, "metadata": {"file_path": "mypy/test/teststubgen.py", "file_name": "teststubgen.py", "file_type": "text/x-python", "category": "test", "start_line": 365, "end_line": 390, "span_ids": ["StubgenUtilSuite.test_remove_misplaced_type_comments_4"], "tokens": 128}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubgenUtilSuite(unittest.TestCase):\n\n def test_remove_misplaced_type_comments_4(self) -> None:\n bad = \"\"\"\n def f(x):\n '''docstring'''\n # type: (int) -> int\n pass\n\n def g(x):\n '''docstring\n '''\n # type: (int) -> int\n pass\n \"\"\"\n bad_fixed = \"\"\"\n def f(x):\n '''docstring'''\n\n pass\n\n def g(x):\n '''docstring\n '''\n\n pass\n \"\"\"\n assert_equal(remove_misplaced_type_comments(bad), bad_fixed)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenUtilSuite.test_remove_misplaced_type_comments_5_StubgenUtilSuite.test_remove_misplaced_type_comments_5.assert_equal_remove_mispl": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenUtilSuite.test_remove_misplaced_type_comments_5_StubgenUtilSuite.test_remove_misplaced_type_comments_5.assert_equal_remove_mispl", "embedding": null, "metadata": {"file_path": "mypy/test/teststubgen.py", "file_name": "teststubgen.py", "file_type": "text/x-python", "category": "test", "start_line": 392, "end_line": 413, "span_ids": ["StubgenUtilSuite.test_remove_misplaced_type_comments_5"], "tokens": 124}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubgenUtilSuite(unittest.TestCase):\n\n def test_remove_misplaced_type_comments_5(self) -> None:\n bad = \"\"\"\n def f(x):\n # type: (int, List[Any],\n # float, bool) -> int\n pass\n\n def g(x):\n # type: (int, List[Any])\n pass\n \"\"\"\n bad_fixed = \"\"\"\n def f(x):\n\n # float, bool) -> int\n pass\n\n def g(x):\n\n pass\n \"\"\"\n assert_equal(remove_misplaced_type_comments(bad), bad_fixed)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenUtilSuite.test_remove_misplaced_type_comments_bytes_StubgenUtilSuite.test_remove_misplaced_type_comments_bytes.assert_equal_remove_mispl": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenUtilSuite.test_remove_misplaced_type_comments_bytes_StubgenUtilSuite.test_remove_misplaced_type_comments_bytes.assert_equal_remove_mispl", "embedding": null, "metadata": {"file_path": "mypy/test/teststubgen.py", "file_name": "teststubgen.py", "file_type": "text/x-python", "category": "test", "start_line": 415, "end_line": 446, "span_ids": ["StubgenUtilSuite.test_remove_misplaced_type_comments_bytes"], "tokens": 166}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubgenUtilSuite(unittest.TestCase):\n\n def test_remove_misplaced_type_comments_bytes(self) -> None:\n original = b\"\"\"\n \\xbf\n def f(x): # type: (int) -> int\n\n def g(x):\n # type: (int) -> int\n pass\n\n def h():\n # type: int\n pass\n\n x = 1 # type: int\n \"\"\"\n\n dest = b\"\"\"\n \\xbf\n def f(x): # type: (int) -> int\n\n def g(x):\n # type: (int) -> int\n pass\n\n def h():\n\n pass\n\n x = 1 # type: int\n \"\"\"\n\n assert_equal(remove_misplaced_type_comments(original), dest)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenUtilSuite.test_common_dir_prefix_unix_StubgenUtilSuite.test_common_dir_prefix_unix.None_12": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenUtilSuite.test_common_dir_prefix_unix_StubgenUtilSuite.test_common_dir_prefix_unix.None_12", "embedding": null, "metadata": {"file_path": "mypy/test/teststubgen.py", "file_name": "teststubgen.py", "file_type": "text/x-python", "category": "test", "start_line": 448, "end_line": 464, "span_ids": ["StubgenUtilSuite.test_common_dir_prefix_unix"], "tokens": 308}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubgenUtilSuite(unittest.TestCase):\n\n @unittest.skipIf(sys.platform == 'win32',\n 'Tests building the paths common ancestor on *nix')\n def test_common_dir_prefix_unix(self) -> None:\n assert common_dir_prefix([]) == '.'\n assert common_dir_prefix(['x.pyi']) == '.'\n assert common_dir_prefix(['./x.pyi']) == '.'\n assert common_dir_prefix(['foo/bar/x.pyi']) == 'foo/bar'\n assert common_dir_prefix(['foo/bar/x.pyi',\n 'foo/bar/y.pyi']) == 'foo/bar'\n assert common_dir_prefix(['foo/bar/x.pyi', 'foo/y.pyi']) == 'foo'\n assert common_dir_prefix(['foo/x.pyi', 'foo/bar/y.pyi']) == 'foo'\n assert common_dir_prefix(['foo/bar/zar/x.pyi', 'foo/y.pyi']) == 'foo'\n assert common_dir_prefix(['foo/x.pyi', 'foo/bar/zar/y.pyi']) == 'foo'\n assert common_dir_prefix(['foo/bar/zar/x.pyi', 'foo/bar/y.pyi']) == 'foo/bar'\n assert common_dir_prefix(['foo/bar/x.pyi', 'foo/bar/zar/y.pyi']) == 'foo/bar'\n assert common_dir_prefix([r'foo/bar\\x.pyi']) == 'foo'\n assert common_dir_prefix([r'foo\\bar/x.pyi']) == r'foo\\bar'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenUtilSuite.test_common_dir_prefix_win_StubgenUtilSuite.test_common_dir_prefix_win.None_12": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenUtilSuite.test_common_dir_prefix_win_StubgenUtilSuite.test_common_dir_prefix_win.None_12", "embedding": null, "metadata": {"file_path": "mypy/test/teststubgen.py", "file_name": "teststubgen.py", "file_type": "text/x-python", "category": "test", "start_line": 466, "end_line": 482, "span_ids": ["StubgenUtilSuite.test_common_dir_prefix_win"], "tokens": 371}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubgenUtilSuite(unittest.TestCase):\n\n @unittest.skipIf(sys.platform != 'win32',\n 'Tests building the paths common ancestor on Windows')\n def test_common_dir_prefix_win(self) -> None:\n assert common_dir_prefix(['x.pyi']) == '.'\n assert common_dir_prefix([r'.\\x.pyi']) == '.'\n assert common_dir_prefix([r'foo\\bar\\x.pyi']) == r'foo\\bar'\n assert common_dir_prefix([r'foo\\bar\\x.pyi',\n r'foo\\bar\\y.pyi']) == r'foo\\bar'\n assert common_dir_prefix([r'foo\\bar\\x.pyi', r'foo\\y.pyi']) == 'foo'\n assert common_dir_prefix([r'foo\\x.pyi', r'foo\\bar\\y.pyi']) == 'foo'\n assert common_dir_prefix([r'foo\\bar\\zar\\x.pyi', r'foo\\y.pyi']) == 'foo'\n assert common_dir_prefix([r'foo\\x.pyi', r'foo\\bar\\zar\\y.pyi']) == 'foo'\n assert common_dir_prefix([r'foo\\bar\\zar\\x.pyi', r'foo\\bar\\y.pyi']) == r'foo\\bar'\n assert common_dir_prefix([r'foo\\bar\\x.pyi', r'foo\\bar\\zar\\y.pyi']) == r'foo\\bar'\n assert common_dir_prefix([r'foo/bar\\x.pyi']) == r'foo\\bar'\n assert common_dir_prefix([r'foo\\bar/x.pyi']) == r'foo\\bar'\n assert common_dir_prefix([r'foo/bar/x.pyi']) == r'foo\\bar'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenHelpersSuite_StubgenHelpersSuite.test_is_blacklisted_path.None_7": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenHelpersSuite_StubgenHelpersSuite.test_is_blacklisted_path.None_7", "embedding": null, "metadata": {"file_path": "mypy/test/teststubgen.py", "file_name": "teststubgen.py", "file_type": "text/x-python", "category": "test", "start_line": 485, "end_line": 494, "span_ids": ["StubgenHelpersSuite.test_is_blacklisted_path", "StubgenHelpersSuite"], "tokens": 125}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubgenHelpersSuite(unittest.TestCase):\n def test_is_blacklisted_path(self) -> None:\n assert not is_blacklisted_path('foo/bar.py')\n assert not is_blacklisted_path('foo.py')\n assert not is_blacklisted_path('foo/xvendor/bar.py')\n assert not is_blacklisted_path('foo/vendorx/bar.py')\n assert is_blacklisted_path('foo/vendor/bar.py')\n assert is_blacklisted_path('foo/vendored/bar.py')\n assert is_blacklisted_path('foo/vendored/bar/thing.py')\n assert is_blacklisted_path('foo/six.py')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenHelpersSuite.test_is_non_library_module_StubgenHelpersSuite.test_is_non_library_module.None_19": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenHelpersSuite.test_is_non_library_module_StubgenHelpersSuite.test_is_non_library_module.None_19", "embedding": null, "metadata": {"file_path": "mypy/test/teststubgen.py", "file_name": "teststubgen.py", "file_type": "text/x-python", "category": "test", "start_line": 496, "end_line": 523, "span_ids": ["StubgenHelpersSuite.test_is_non_library_module"], "tokens": 281}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubgenHelpersSuite(unittest.TestCase):\n\n def test_is_non_library_module(self) -> None:\n assert not is_non_library_module('foo')\n assert not is_non_library_module('foo.bar')\n\n # The following could be test modules, but we are very conservative and\n # don't treat them as such since they could plausibly be real modules.\n assert not is_non_library_module('foo.bartest')\n assert not is_non_library_module('foo.bartests')\n assert not is_non_library_module('foo.testbar')\n\n assert is_non_library_module('foo.test')\n assert is_non_library_module('foo.test.foo')\n assert is_non_library_module('foo.tests')\n assert is_non_library_module('foo.tests.foo')\n assert is_non_library_module('foo.testing.foo')\n assert is_non_library_module('foo.SelfTest.foo')\n\n assert is_non_library_module('foo.test_bar')\n assert is_non_library_module('foo.bar_tests')\n assert is_non_library_module('foo.testing')\n assert is_non_library_module('foo.conftest')\n assert is_non_library_module('foo.bar_test_util')\n assert is_non_library_module('foo.bar_test_utils')\n assert is_non_library_module('foo.bar_test_base')\n\n assert is_non_library_module('foo.setup')\n\n assert is_non_library_module('foo.__main__')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenPythonSuite_StubgenPythonSuite.run_case.with_local_sys_path_set_.self_run_case_inner_testc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenPythonSuite_StubgenPythonSuite.run_case.with_local_sys_path_set_.self_run_case_inner_testc", "embedding": null, "metadata": {"file_path": "mypy/test/teststubgen.py", "file_name": "teststubgen.py", "file_type": "text/x-python", "category": "test", "start_line": 526, "end_line": 553, "span_ids": ["StubgenPythonSuite", "StubgenPythonSuite.run_case"], "tokens": 181}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubgenPythonSuite(DataSuite):\n \"\"\"Data-driven end-to-end test cases that generate stub files.\n\n You can use these magic test case name suffixes:\n\n *_semanal\n Run semantic analysis (slow as this uses real stubs -- only use\n when necessary)\n *_import\n Import module and perform runtime introspection (in the current\n process!)\n\n You can use these magic comments:\n\n # flags: --some-stubgen-option ...\n Specify custom stubgen options\n\n # modules: module1 module2 ...\n Specify which modules to output (by default only 'main')\n \"\"\"\n\n required_out_section = True\n base_path = '.'\n files = ['stubgen.test']\n\n def run_case(self, testcase: DataDrivenTestCase) -> None:\n with local_sys_path_set():\n self.run_case_inner(testcase)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenPythonSuite.run_case_inner_StubgenPythonSuite.run_case_inner.try_.finally_.shutil_rmtree_out_dir_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenPythonSuite.run_case_inner_StubgenPythonSuite.run_case_inner.try_.finally_.shutil_rmtree_out_dir_", "embedding": null, "metadata": {"file_path": "mypy/test/teststubgen.py", "file_name": "teststubgen.py", "file_type": "text/x-python", "category": "test", "start_line": 555, "end_line": 593, "span_ids": ["StubgenPythonSuite.run_case_inner"], "tokens": 344}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubgenPythonSuite(DataSuite):\n\n def run_case_inner(self, testcase: DataDrivenTestCase) -> None:\n extra = [] # Extra command-line args\n mods = [] # Module names to process\n source = '\\n'.join(testcase.input)\n for file, content in testcase.files + [('./main.py', source)]:\n # Strip ./ prefix and .py suffix.\n mod = file[2:-3].replace('/', '.')\n if mod.endswith('.__init__'):\n mod, _, _ = mod.rpartition('.')\n mods.append(mod)\n if '-p ' not in source:\n extra.extend(['-m', mod])\n with open(file, 'w') as f:\n f.write(content)\n\n options = self.parse_flags(source, extra)\n modules = self.parse_modules(source)\n out_dir = 'out'\n try:\n try:\n if not testcase.name.endswith('_import'):\n options.no_import = True\n if not testcase.name.endswith('_semanal'):\n options.parse_only = True\n generate_stubs(options)\n a = [] # type: List[str]\n for module in modules:\n fnam = module_to_path(out_dir, module)\n self.add_file(fnam, a, header=len(modules) > 1)\n except CompileError as e:\n a = e.messages\n assert_string_arrays_equal(testcase.output, a,\n 'Invalid output ({}, line {})'.format(\n testcase.file, testcase.line))\n finally:\n for mod in mods:\n if mod in sys.modules:\n del sys.modules[mod]\n shutil.rmtree(out_dir)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgencSuite_StubgencSuite.test_generate_c_type_stub_no_crash_for_object.assert_equal_output_0_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgencSuite_StubgencSuite.test_generate_c_type_stub_no_crash_for_object.assert_equal_output_0_", "embedding": null, "metadata": {"file_path": "mypy/test/teststubgen.py", "file_name": "teststubgen.py", "file_type": "text/x-python", "category": "test", "start_line": 628, "end_line": 659, "span_ids": ["StubgencSuite.test_generate_c_type_stub_no_crash_for_object", "StubgencSuite.test_infer_getitem_sig", "StubgencSuite.test_infer_hash_sig", "StubgencSuite.test_infer_binary_op_sig", "StubgencSuite.test_infer_unary_op_sig", "StubgencSuite.test_infer_setitem_sig", "StubgencSuite"], "tokens": 354}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubgencSuite(unittest.TestCase):\n \"\"\"Unit tests for stub generation from C modules using introspection.\n\n Note that these don't cover a lot!\n \"\"\"\n\n def test_infer_hash_sig(self) -> None:\n assert_equal(infer_method_sig('__hash__'), [self_arg])\n\n def test_infer_getitem_sig(self) -> None:\n assert_equal(infer_method_sig('__getitem__'), [self_arg, ArgSig(name='index')])\n\n def test_infer_setitem_sig(self) -> None:\n assert_equal(infer_method_sig('__setitem__'),\n [self_arg, ArgSig(name='index'), ArgSig(name='object')])\n\n def test_infer_binary_op_sig(self) -> None:\n for op in ('eq', 'ne', 'lt', 'le', 'gt', 'ge',\n 'add', 'radd', 'sub', 'rsub', 'mul', 'rmul'):\n assert_equal(infer_method_sig('__%s__' % op), [self_arg, ArgSig(name='other')])\n\n def test_infer_unary_op_sig(self) -> None:\n for op in ('neg', 'pos'):\n assert_equal(infer_method_sig('__%s__' % op), [self_arg])\n\n def test_generate_c_type_stub_no_crash_for_object(self) -> None:\n output = [] # type: List[str]\n mod = ModuleType('module', '') # any module is fine\n imports = [] # type: List[str]\n generate_c_type_stub(mod, 'alias', object, output, imports)\n assert_equal(imports, [])\n assert_equal(output[0], 'class alias:')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgencSuite.test_generate_c_type_stub_variable_type_annotation_StubgencSuite.test_generate_c_type_stub_variable_type_annotation.assert_equal_output_cl": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgencSuite.test_generate_c_type_stub_variable_type_annotation_StubgencSuite.test_generate_c_type_stub_variable_type_annotation.assert_equal_output_cl", "embedding": null, "metadata": {"file_path": "mypy/test/teststubgen.py", "file_name": "teststubgen.py", "file_type": "text/x-python", "category": "test", "start_line": 669, "end_line": 679, "span_ids": ["StubgencSuite.test_generate_c_type_stub_variable_type_annotation"], "tokens": 136}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubgencSuite(unittest.TestCase):\n\n def test_generate_c_type_stub_variable_type_annotation(self) -> None:\n # This class mimics the stubgen unit test 'testClassVariable'\n class TestClassVariableCls:\n x = 1\n\n output = [] # type: List[str]\n imports = [] # type: List[str]\n mod = ModuleType('module', '') # any module is fine\n generate_c_type_stub(mod, 'C', TestClassVariableCls, output, imports)\n assert_equal(imports, [])\n assert_equal(output, ['class C:', ' x: ClassVar[int] = ...'])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgencSuite.test_generate_c_type_with_docstring_StubgencSuite.test_generate_c_type_with_docstring.assert_equal_imports_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgencSuite.test_generate_c_type_with_docstring_StubgencSuite.test_generate_c_type_with_docstring.assert_equal_imports_", "embedding": null, "metadata": {"file_path": "mypy/test/teststubgen.py", "file_name": "teststubgen.py", "file_type": "text/x-python", "category": "test", "start_line": 711, "end_line": 724, "span_ids": ["StubgencSuite.test_generate_c_type_with_docstring"], "tokens": 148}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubgencSuite(unittest.TestCase):\n\n def test_generate_c_type_with_docstring(self) -> None:\n class TestClass:\n def test(self, arg0: str) -> None:\n \"\"\"\n test(self: TestClass, arg0: int)\n \"\"\"\n pass\n output = [] # type: List[str]\n imports = [] # type: List[str]\n mod = ModuleType(TestClass.__module__, '')\n generate_c_function_stub(mod, 'test', TestClass.test, output, imports,\n self_var='self', class_name='TestClass')\n assert_equal(output, ['def test(self, arg0: int) -> Any: ...'])\n assert_equal(imports, [])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgencSuite.test_generate_c_type_with_docstring_empty_default_StubgencSuite.test_generate_c_type_with_docstring_empty_default.assert_equal_imports_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgencSuite.test_generate_c_type_with_docstring_empty_default_StubgencSuite.test_generate_c_type_with_docstring_empty_default.assert_equal_imports_", "embedding": null, "metadata": {"file_path": "mypy/test/teststubgen.py", "file_name": "teststubgen.py", "file_type": "text/x-python", "category": "test", "start_line": 726, "end_line": 739, "span_ids": ["StubgencSuite.test_generate_c_type_with_docstring_empty_default"], "tokens": 153}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubgencSuite(unittest.TestCase):\n\n def test_generate_c_type_with_docstring_empty_default(self) -> None:\n class TestClass:\n def test(self, arg0: str = \"\") -> None:\n \"\"\"\n test(self: TestClass, arg0: str = \"\")\n \"\"\"\n pass\n output = [] # type: List[str]\n imports = [] # type: List[str]\n mod = ModuleType(TestClass.__module__, '')\n generate_c_function_stub(mod, 'test', TestClass.test, output, imports,\n self_var='self', class_name='TestClass')\n assert_equal(output, ['def test(self, arg0: str = ...) -> Any: ...'])\n assert_equal(imports, [])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgencSuite.test_generate_c_function_other_module_arg_StubgencSuite.test_generate_c_function_other_module_arg.assert_equal_imports_i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgencSuite.test_generate_c_function_other_module_arg_StubgencSuite.test_generate_c_function_other_module_arg.assert_equal_imports_i", "embedding": null, "metadata": {"file_path": "mypy/test/teststubgen.py", "file_name": "teststubgen.py", "file_type": "text/x-python", "category": "test", "start_line": 741, "end_line": 755, "span_ids": ["StubgencSuite.test_generate_c_function_other_module_arg"], "tokens": 168}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubgencSuite(unittest.TestCase):\n\n def test_generate_c_function_other_module_arg(self) -> None:\n \"\"\"Test that if argument references type from other module, module will be imported.\"\"\"\n # Provide different type in python spec than in docstring to make sure, that docstring\n # information is used.\n def test(arg0: str) -> None:\n \"\"\"\n test(arg0: argparse.Action)\n \"\"\"\n pass\n output = [] # type: List[str]\n imports = [] # type: List[str]\n mod = ModuleType(self.__module__, '')\n generate_c_function_stub(mod, 'test', test, output, imports)\n assert_equal(output, ['def test(arg0: argparse.Action) -> Any: ...'])\n assert_equal(imports, ['import argparse'])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgencSuite.test_generate_c_function_same_module_arg_StubgencSuite.test_generate_c_function_same_module_arg.assert_equal_imports_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgencSuite.test_generate_c_function_same_module_arg_StubgencSuite.test_generate_c_function_same_module_arg.assert_equal_imports_", "embedding": null, "metadata": {"file_path": "mypy/test/teststubgen.py", "file_name": "teststubgen.py", "file_type": "text/x-python", "category": "test", "start_line": 757, "end_line": 773, "span_ids": ["StubgencSuite.test_generate_c_function_same_module_arg"], "tokens": 183}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubgencSuite(unittest.TestCase):\n\n def test_generate_c_function_same_module_arg(self) -> None:\n \"\"\"Test that if argument references type from same module but using full path, no module\n will be imported, and type specification will be striped to local reference.\n \"\"\"\n # Provide different type in python spec than in docstring to make sure, that docstring\n # information is used.\n def test(arg0: str) -> None:\n \"\"\"\n test(arg0: argparse.Action)\n \"\"\"\n pass\n output = [] # type: List[str]\n imports = [] # type: List[str]\n mod = ModuleType('argparse', '')\n generate_c_function_stub(mod, 'test', test, output, imports)\n assert_equal(output, ['def test(arg0: Action) -> Any: ...'])\n assert_equal(imports, [])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgencSuite.test_generate_c_function_other_module_ret_StubgencSuite.test_generate_c_function_other_module_ret.assert_equal_imports_i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgencSuite.test_generate_c_function_other_module_ret_StubgencSuite.test_generate_c_function_other_module_ret.assert_equal_imports_i", "embedding": null, "metadata": {"file_path": "mypy/test/teststubgen.py", "file_name": "teststubgen.py", "file_type": "text/x-python", "category": "test", "start_line": 775, "end_line": 787, "span_ids": ["StubgencSuite.test_generate_c_function_other_module_ret"], "tokens": 146}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubgencSuite(unittest.TestCase):\n\n def test_generate_c_function_other_module_ret(self) -> None:\n \"\"\"Test that if return type references type from other module, module will be imported.\"\"\"\n def test(arg0: str) -> None:\n \"\"\"\n test(arg0: str) -> argparse.Action\n \"\"\"\n pass\n output = [] # type: List[str]\n imports = [] # type: List[str]\n mod = ModuleType(self.__module__, '')\n generate_c_function_stub(mod, 'test', test, output, imports)\n assert_equal(output, ['def test(arg0: str) -> argparse.Action: ...'])\n assert_equal(imports, ['import argparse'])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgencSuite.test_generate_c_function_same_module_ret_StubgencSuite.test_generate_c_function_same_module_ret.assert_equal_imports_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgencSuite.test_generate_c_function_same_module_ret_StubgencSuite.test_generate_c_function_same_module_ret.assert_equal_imports_", "embedding": null, "metadata": {"file_path": "mypy/test/teststubgen.py", "file_name": "teststubgen.py", "file_type": "text/x-python", "category": "test", "start_line": 789, "end_line": 803, "span_ids": ["StubgencSuite.test_generate_c_function_same_module_ret"], "tokens": 160}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubgencSuite(unittest.TestCase):\n\n def test_generate_c_function_same_module_ret(self) -> None:\n \"\"\"Test that if return type references type from same module but using full path,\n no module will be imported, and type specification will be striped to local reference.\n \"\"\"\n def test(arg0: str) -> None:\n \"\"\"\n test(arg0: str) -> argparse.Action\n \"\"\"\n pass\n output = [] # type: List[str]\n imports = [] # type: List[str]\n mod = ModuleType('argparse', '')\n generate_c_function_stub(mod, 'test', test, output, imports)\n assert_equal(output, ['def test(arg0: str) -> Action: ...'])\n assert_equal(imports, [])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgencSuite.test_generate_c_property_with_pybind11_StubgencSuite.test_generate_c_property_with_pybind11.assert_equal_output_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgencSuite.test_generate_c_property_with_pybind11_StubgencSuite.test_generate_c_property_with_pybind11.assert_equal_output_p", "embedding": null, "metadata": {"file_path": "mypy/test/teststubgen.py", "file_name": "teststubgen.py", "file_type": "text/x-python", "category": "test", "start_line": 817, "end_line": 829, "span_ids": ["StubgencSuite.test_generate_c_property_with_pybind11"], "tokens": 129}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubgencSuite(unittest.TestCase):\n\n def test_generate_c_property_with_pybind11(self) -> None:\n \"\"\"Signatures included by PyBind11 inside property.fget are read.\"\"\"\n class TestClass:\n def get_attribute(self) -> None:\n \"\"\"\n (self: TestClass) -> str\n \"\"\"\n pass\n attribute = property(get_attribute, doc=\"\")\n\n output = [] # type: List[str]\n generate_c_property_stub('attribute', TestClass.attribute, [], [], output, readonly=True)\n assert_equal(output, ['@property', 'def attribute(self) -> str: ...'])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgencSuite.test_generate_c_type_with_single_arg_generic_StubgencSuite.test_generate_c_type_with_single_arg_generic.assert_equal_imports_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgencSuite.test_generate_c_type_with_single_arg_generic_StubgencSuite.test_generate_c_type_with_single_arg_generic.assert_equal_imports_", "embedding": null, "metadata": {"file_path": "mypy/test/teststubgen.py", "file_name": "teststubgen.py", "file_type": "text/x-python", "category": "test", "start_line": 819, "end_line": 832, "span_ids": ["StubgencSuite.test_generate_c_type_with_single_arg_generic"], "tokens": 151}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubgencSuite(unittest.TestCase):\n\n def test_generate_c_type_with_single_arg_generic(self) -> None:\n class TestClass:\n def test(self, arg0: str) -> None:\n \"\"\"\n test(self: TestClass, arg0: List[int])\n \"\"\"\n pass\n output = [] # type: List[str]\n imports = [] # type: List[str]\n mod = ModuleType(TestClass.__module__, '')\n generate_c_function_stub(mod, 'test', TestClass.test, output, imports,\n self_var='self', class_name='TestClass')\n assert_equal(output, ['def test(self, arg0: List[int]) -> Any: ...'])\n assert_equal(imports, [])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgencSuite.test_generate_c_type_with_double_arg_generic_StubgencSuite.test_generate_c_type_with_double_arg_generic.assert_equal_imports_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgencSuite.test_generate_c_type_with_double_arg_generic_StubgencSuite.test_generate_c_type_with_double_arg_generic.assert_equal_imports_", "embedding": null, "metadata": {"file_path": "mypy/test/teststubgen.py", "file_name": "teststubgen.py", "file_type": "text/x-python", "category": "test", "start_line": 834, "end_line": 847, "span_ids": ["StubgencSuite.test_generate_c_type_with_double_arg_generic"], "tokens": 154}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubgencSuite(unittest.TestCase):\n\n def test_generate_c_type_with_double_arg_generic(self) -> None:\n class TestClass:\n def test(self, arg0: str) -> None:\n \"\"\"\n test(self: TestClass, arg0: Dict[str, int])\n \"\"\"\n pass\n output = [] # type: List[str]\n imports = [] # type: List[str]\n mod = ModuleType(TestClass.__module__, '')\n generate_c_function_stub(mod, 'test', TestClass.test, output, imports,\n self_var='self', class_name='TestClass')\n assert_equal(output, ['def test(self, arg0: Dict[str,int]) -> Any: ...'])\n assert_equal(imports, [])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgencSuite.test_generate_c_type_with_nested_generic_StubgencSuite.test_generate_c_type_with_nested_generic.assert_equal_imports_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgencSuite.test_generate_c_type_with_nested_generic_StubgencSuite.test_generate_c_type_with_nested_generic.assert_equal_imports_", "embedding": null, "metadata": {"file_path": "mypy/test/teststubgen.py", "file_name": "teststubgen.py", "file_type": "text/x-python", "category": "test", "start_line": 849, "end_line": 862, "span_ids": ["StubgencSuite.test_generate_c_type_with_nested_generic"], "tokens": 155}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubgencSuite(unittest.TestCase):\n\n def test_generate_c_type_with_nested_generic(self) -> None:\n class TestClass:\n def test(self, arg0: str) -> None:\n \"\"\"\n test(self: TestClass, arg0: Dict[str, List[int]])\n \"\"\"\n pass\n output = [] # type: List[str]\n imports = [] # type: List[str]\n mod = ModuleType(TestClass.__module__, '')\n generate_c_function_stub(mod, 'test', TestClass.test, output, imports,\n self_var='self', class_name='TestClass')\n assert_equal(output, ['def test(self, arg0: Dict[str,List[int]]) -> Any: ...'])\n assert_equal(imports, [])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgencSuite.test_generate_c_type_with_generic_using_other_module_first_StubgencSuite.test_generate_c_type_with_generic_using_other_module_first.assert_equal_imports_i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgencSuite.test_generate_c_type_with_generic_using_other_module_first_StubgencSuite.test_generate_c_type_with_generic_using_other_module_first.assert_equal_imports_i", "embedding": null, "metadata": {"file_path": "mypy/test/teststubgen.py", "file_name": "teststubgen.py", "file_type": "text/x-python", "category": "test", "start_line": 864, "end_line": 877, "span_ids": ["StubgencSuite.test_generate_c_type_with_generic_using_other_module_first"], "tokens": 163}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubgencSuite(unittest.TestCase):\n\n def test_generate_c_type_with_generic_using_other_module_first(self) -> None:\n class TestClass:\n def test(self, arg0: str) -> None:\n \"\"\"\n test(self: TestClass, arg0: Dict[argparse.Action, int])\n \"\"\"\n pass\n output = [] # type: List[str]\n imports = [] # type: List[str]\n mod = ModuleType(TestClass.__module__, '')\n generate_c_function_stub(mod, 'test', TestClass.test, output, imports,\n self_var='self', class_name='TestClass')\n assert_equal(output, ['def test(self, arg0: Dict[argparse.Action,int]) -> Any: ...'])\n assert_equal(imports, ['import argparse'])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgencSuite.test_generate_c_type_with_generic_using_other_module_last_StubgencSuite.test_generate_c_type_with_generic_using_other_module_last.assert_equal_imports_i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgencSuite.test_generate_c_type_with_generic_using_other_module_last_StubgencSuite.test_generate_c_type_with_generic_using_other_module_last.assert_equal_imports_i", "embedding": null, "metadata": {"file_path": "mypy/test/teststubgen.py", "file_name": "teststubgen.py", "file_type": "text/x-python", "category": "test", "start_line": 879, "end_line": 892, "span_ids": ["StubgencSuite.test_generate_c_type_with_generic_using_other_module_last"], "tokens": 162}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubgencSuite(unittest.TestCase):\n\n def test_generate_c_type_with_generic_using_other_module_last(self) -> None:\n class TestClass:\n def test(self, arg0: str) -> None:\n \"\"\"\n test(self: TestClass, arg0: Dict[str, argparse.Action])\n \"\"\"\n pass\n output = [] # type: List[str]\n imports = [] # type: List[str]\n mod = ModuleType(TestClass.__module__, '')\n generate_c_function_stub(mod, 'test', TestClass.test, output, imports,\n self_var='self', class_name='TestClass')\n assert_equal(output, ['def test(self, arg0: Dict[str,argparse.Action]) -> Any: ...'])\n assert_equal(imports, ['import argparse'])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgencSuite.test_generate_c_type_with_overload_pybind11_StubgencSuite.test_generate_c_type_with_overload_pybind11.assert_equal_set_imports_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgencSuite.test_generate_c_type_with_overload_pybind11_StubgencSuite.test_generate_c_type_with_overload_pybind11.assert_equal_set_imports_", "embedding": null, "metadata": {"file_path": "mypy/test/teststubgen.py", "file_name": "teststubgen.py", "file_type": "text/x-python", "category": "test", "start_line": 894, "end_line": 918, "span_ids": ["StubgencSuite.test_generate_c_type_with_overload_pybind11"], "tokens": 265}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubgencSuite(unittest.TestCase):\n\n def test_generate_c_type_with_overload_pybind11(self) -> None:\n class TestClass:\n def __init__(self, arg0: str) -> None:\n \"\"\"\n __init__(*args, **kwargs)\n Overloaded function.\n\n 1. __init__(self: TestClass, arg0: str) -> None\n\n 2. __init__(self: TestClass, arg0: str, arg1: str) -> None\n \"\"\"\n pass\n output = [] # type: List[str]\n imports = [] # type: List[str]\n mod = ModuleType(TestClass.__module__, '')\n generate_c_function_stub(mod, '__init__', TestClass.__init__, output, imports,\n self_var='self', class_name='TestClass')\n assert_equal(output, [\n '@overload',\n 'def __init__(self, arg0: str) -> None: ...',\n '@overload',\n 'def __init__(self, arg0: str, arg1: str) -> None: ...',\n '@overload',\n 'def __init__(*args, **kwargs) -> Any: ...'])\n assert_equal(set(imports), {'from typing import overload'})", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_ArgSigSuite_ArgSigSuite.test_repr.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_ArgSigSuite_ArgSigSuite.test_repr.None_3", "embedding": null, "metadata": {"file_path": "mypy/test/teststubgen.py", "file_name": "teststubgen.py", "file_type": "text/x-python", "category": "test", "start_line": 921, "end_line": 930, "span_ids": ["ArgSigSuite.test_repr", "ArgSigSuite"], "tokens": 133}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ArgSigSuite(unittest.TestCase):\n def test_repr(self) -> None:\n assert_equal(repr(ArgSig(name='asd\"dsa')),\n \"ArgSig(name='asd\\\"dsa', type=None, default=False)\")\n assert_equal(repr(ArgSig(name=\"asd'dsa\")),\n 'ArgSig(name=\"asd\\'dsa\", type=None, default=False)')\n assert_equal(repr(ArgSig(\"func\", 'str')),\n \"ArgSig(name='func', type='str', default=False)\")\n assert_equal(repr(ArgSig(\"func\", 'str', default=True)),\n \"ArgSig(name='func', type='str', default=True)\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_IsValidTypeSuite_IsValidTypeSuite.test_is_valid_type.None_12": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_IsValidTypeSuite_IsValidTypeSuite.test_is_valid_type.None_12", "embedding": null, "metadata": {"file_path": "mypy/test/teststubgen.py", "file_name": "teststubgen.py", "file_type": "text/x-python", "category": "test", "start_line": 933, "end_line": 947, "span_ids": ["IsValidTypeSuite.test_is_valid_type", "IsValidTypeSuite"], "tokens": 141}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IsValidTypeSuite(unittest.TestCase):\n def test_is_valid_type(self) -> None:\n assert is_valid_type('int')\n assert is_valid_type('str')\n assert is_valid_type('Foo_Bar234')\n assert is_valid_type('foo.bar')\n assert is_valid_type('List[int]')\n assert is_valid_type('Dict[str, int]')\n assert is_valid_type('None')\n assert not is_valid_type('foo-bar')\n assert not is_valid_type('x->y')\n assert not is_valid_type('True')\n assert not is_valid_type('False')\n assert not is_valid_type('x,y')\n assert not is_valid_type('x, y')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_ModuleInspectSuite_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_ModuleInspectSuite_", "embedding": null, "metadata": {"file_path": "mypy/test/teststubgen.py", "file_name": "teststubgen.py", "file_type": "text/x-python", "category": "test", "start_line": 950, "end_line": 995, "span_ids": ["ModuleInspectSuite", "module_to_path", "ModuleInspectSuite.test_non_existent", "ModuleInspectSuite.test_python_package", "ModuleInspectSuite.test_c_module", "ModuleInspectSuite.test_python_module"], "tokens": 369}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ModuleInspectSuite(unittest.TestCase):\n def test_python_module(self) -> None:\n with ModuleInspect() as m:\n p = m.get_package_properties('inspect')\n assert p is not None\n assert p.name == 'inspect'\n assert p.file\n assert p.path is None\n assert p.is_c_module is False\n assert p.subpackages == []\n\n def test_python_package(self) -> None:\n with ModuleInspect() as m:\n p = m.get_package_properties('unittest')\n assert p is not None\n assert p.name == 'unittest'\n assert p.file\n assert p.path\n assert p.is_c_module is False\n assert p.subpackages\n assert all(sub.startswith('unittest.') for sub in p.subpackages)\n\n def test_c_module(self) -> None:\n with ModuleInspect() as m:\n p = m.get_package_properties('_socket')\n assert p is not None\n assert p.name == '_socket'\n assert p.path is None\n assert p.is_c_module is True\n assert p.subpackages == []\n\n def test_non_existent(self) -> None:\n with ModuleInspect() as m:\n with self.assertRaises(InspectError) as e:\n m.get_package_properties('foobar-non-existent')\n assert str(e.exception) == \"No module named 'foobar-non-existent'\"\n\n\ndef module_to_path(out_dir: str, module: str) -> str:\n fnam = os.path.join(out_dir, '{}.pyi'.format(module.replace('.', '/')))\n if not os.path.exists(fnam):\n alt_fnam = fnam.replace('.pyi', '/__init__.pyi')\n if os.path.exists(alt_fnam):\n return alt_fnam\n return fnam", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_contextlib_stubtest_builtins_stub._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_contextlib_stubtest_builtins_stub._", "embedding": null, "metadata": {"file_path": "mypy/test/teststubtest.py", "file_name": "teststubtest.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 58, "span_ids": ["imports", "use_tmp_dir", "impl"], "tokens": 296}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import contextlib\nimport inspect\nimport io\nimport os\nimport re\nimport sys\nimport tempfile\nimport textwrap\nimport unittest\nfrom pathlib import Path\nfrom typing import Any, Callable, Iterator, List, Optional\n\nimport mypy.stubtest\nfrom mypy.stubtest import parse_options, test_stubs\nfrom mypy.test.data import root_dir\n\n\n@contextlib.contextmanager\ndef use_tmp_dir() -> Iterator[None]:\n current = os.getcwd()\n with tempfile.TemporaryDirectory() as tmp:\n try:\n os.chdir(tmp)\n yield\n finally:\n os.chdir(current)\n\n\nTEST_MODULE_NAME = \"test_module\"\n\nstubtest_builtins_stub = \"\"\"\nfrom typing import Generic, Mapping, Sequence, TypeVar, overload\n\nT = TypeVar('T')\nT_co = TypeVar('T_co', covariant=True)\nKT = TypeVar('KT')\nVT = TypeVar('VT')\n\nclass object:\n def __init__(self) -> None: pass\nclass type: ...\n\nclass tuple(Sequence[T_co], Generic[T_co]): ...\nclass dict(Mapping[KT, VT]): ...\n\nclass function: pass\nclass ellipsis: pass\n\nclass int: ...\nclass float: ...\nclass bool(int): ...\nclass str: ...\nclass bytes: ...\n\ndef property(f: T) -> T: ...\ndef classmethod(f: T) -> T: ...\ndef staticmethod(f: T) -> T: ...\n\"\"\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestUnit_StubtestUnit.test_basic_good.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestUnit_StubtestUnit.test_basic_good.None_1", "embedding": null, "metadata": {"file_path": "mypy/test/teststubtest.py", "file_name": "teststubtest.py", "file_type": "text/x-python", "category": "test", "start_line": 128, "end_line": 146, "span_ids": ["StubtestUnit", "StubtestUnit.test_basic_good"], "tokens": 123}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubtestUnit(unittest.TestCase):\n @collect_cases\n def test_basic_good(self) -> Iterator[Case]:\n yield Case(\n stub=\"def f(number: int, text: str) -> None: ...\",\n runtime=\"def f(number, text): pass\",\n error=None,\n )\n yield Case(\n stub=\"\"\"\n class X:\n def f(self, number: int, text: str) -> None: ...\n \"\"\",\n runtime=\"\"\"\n class X:\n def f(self, number, text): pass\n \"\"\",\n error=None,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestUnit.test_types_StubtestUnit.test_types.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestUnit.test_types_StubtestUnit.test_types.None_2", "embedding": null, "metadata": {"file_path": "mypy/test/teststubtest.py", "file_name": "teststubtest.py", "file_type": "text/x-python", "category": "test", "start_line": 148, "end_line": 168, "span_ids": ["StubtestUnit.test_types"], "tokens": 146}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubtestUnit(unittest.TestCase):\n\n @collect_cases\n def test_types(self) -> Iterator[Case]:\n yield Case(\n stub=\"def mistyped_class() -> None: ...\",\n runtime=\"class mistyped_class: pass\",\n error=\"mistyped_class\",\n )\n yield Case(\n stub=\"class mistyped_fn: ...\", runtime=\"def mistyped_fn(): pass\", error=\"mistyped_fn\"\n )\n yield Case(\n stub=\"\"\"\n class X:\n def mistyped_var(self) -> int: ...\n \"\"\",\n runtime=\"\"\"\n class X:\n mistyped_var = 1\n \"\"\",\n error=\"X.mistyped_var\",\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestUnit.test_arg_name_StubtestUnit.test_arg_name.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestUnit.test_arg_name_StubtestUnit.test_arg_name.None_2", "embedding": null, "metadata": {"file_path": "mypy/test/teststubtest.py", "file_name": "teststubtest.py", "file_type": "text/x-python", "category": "test", "start_line": 170, "end_line": 209, "span_ids": ["StubtestUnit.test_arg_name"], "tokens": 310}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubtestUnit(unittest.TestCase):\n\n @collect_cases\n def test_arg_name(self) -> Iterator[Case]:\n yield Case(\n stub=\"def bad(number: int, text: str) -> None: ...\",\n runtime=\"def bad(num, text) -> None: pass\",\n error=\"bad\",\n )\n if sys.version_info >= (3, 8):\n yield Case(\n stub=\"def good_posonly(__number: int, text: str) -> None: ...\",\n runtime=\"def good_posonly(num, /, text): pass\",\n error=None,\n )\n yield Case(\n stub=\"def bad_posonly(__number: int, text: str) -> None: ...\",\n runtime=\"def bad_posonly(flag, /, text): pass\",\n error=\"bad_posonly\",\n )\n yield Case(\n stub=\"\"\"\n class BadMethod:\n def f(self, number: int, text: str) -> None: ...\n \"\"\",\n runtime=\"\"\"\n class BadMethod:\n def f(self, n, text): pass\n \"\"\",\n error=\"BadMethod.f\",\n )\n yield Case(\n stub=\"\"\"\n class GoodDunder:\n def __exit__(self, t, v, tb) -> None: ...\n \"\"\",\n runtime=\"\"\"\n class GoodDunder:\n def __exit__(self, exc_type, exc_val, exc_tb): pass\n \"\"\",\n error=None,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestUnit.test_arg_kind_StubtestUnit.test_arg_kind.if_sys_version_info_3.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestUnit.test_arg_kind_StubtestUnit.test_arg_kind.if_sys_version_info_3.None_1", "embedding": null, "metadata": {"file_path": "mypy/test/teststubtest.py", "file_name": "teststubtest.py", "file_type": "text/x-python", "category": "test", "start_line": 211, "end_line": 238, "span_ids": ["StubtestUnit.test_arg_kind"], "tokens": 271}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubtestUnit(unittest.TestCase):\n\n @collect_cases\n def test_arg_kind(self) -> Iterator[Case]:\n yield Case(\n stub=\"def runtime_kwonly(number: int, text: str) -> None: ...\",\n runtime=\"def runtime_kwonly(number, *, text): pass\",\n error=\"runtime_kwonly\",\n )\n yield Case(\n stub=\"def stub_kwonly(number: int, *, text: str) -> None: ...\",\n runtime=\"def stub_kwonly(number, text): pass\",\n error=\"stub_kwonly\",\n )\n yield Case(\n stub=\"def stub_posonly(__number: int, text: str) -> None: ...\",\n runtime=\"def stub_posonly(number, text): pass\",\n error=\"stub_posonly\",\n )\n if sys.version_info >= (3, 8):\n yield Case(\n stub=\"def good_posonly(__number: int, text: str) -> None: ...\",\n runtime=\"def good_posonly(number, /, text): pass\",\n error=None,\n )\n yield Case(\n stub=\"def runtime_posonly(number: int, text: str) -> None: ...\",\n runtime=\"def runtime_posonly(number, /, text): pass\",\n error=\"runtime_posonly\",\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestUnit.test_default_value_StubtestUnit.test_default_value.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestUnit.test_default_value_StubtestUnit.test_default_value.None_5", "embedding": null, "metadata": {"file_path": "mypy/test/teststubtest.py", "file_name": "teststubtest.py", "file_type": "text/x-python", "category": "test", "start_line": 240, "end_line": 273, "span_ids": ["StubtestUnit.test_default_value"], "tokens": 282}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubtestUnit(unittest.TestCase):\n\n @collect_cases\n def test_default_value(self) -> Iterator[Case]:\n yield Case(\n stub=\"def f1(text: str = ...) -> None: ...\",\n runtime=\"def f1(text = 'asdf'): pass\",\n error=None,\n )\n yield Case(\n stub=\"def f2(text: str = ...) -> None: ...\", runtime=\"def f2(text): pass\", error=\"f2\"\n )\n yield Case(\n stub=\"def f3(text: str) -> None: ...\",\n runtime=\"def f3(text = 'asdf'): pass\",\n error=\"f3\",\n )\n yield Case(\n stub=\"def f4(text: str = ...) -> None: ...\",\n runtime=\"def f4(text = None): pass\",\n error=\"f4\",\n )\n yield Case(\n stub=\"def f5(data: bytes = ...) -> None: ...\",\n runtime=\"def f5(data = 'asdf'): pass\",\n error=\"f5\",\n )\n yield Case(\n stub=\"\"\"\n from typing import TypeVar\n T = TypeVar(\"T\", bound=str)\n def f6(text: T = ...) -> None: ...\n \"\"\",\n runtime=\"def f6(text = None): pass\",\n error=\"f6\",\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestUnit.test_static_class_method_StubtestUnit.test_static_class_method.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestUnit.test_static_class_method_StubtestUnit.test_static_class_method.None_4", "embedding": null, "metadata": {"file_path": "mypy/test/teststubtest.py", "file_name": "teststubtest.py", "file_type": "text/x-python", "category": "test", "start_line": 275, "end_line": 338, "span_ids": ["StubtestUnit.test_static_class_method"], "tokens": 371}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubtestUnit(unittest.TestCase):\n\n @collect_cases\n def test_static_class_method(self) -> Iterator[Case]:\n yield Case(\n stub=\"\"\"\n class Good:\n @classmethod\n def f(cls, number: int, text: str) -> None: ...\n \"\"\",\n runtime=\"\"\"\n class Good:\n @classmethod\n def f(cls, number, text): pass\n \"\"\",\n error=None,\n )\n yield Case(\n stub=\"\"\"\n class Bad1:\n def f(cls, number: int, text: str) -> None: ...\n \"\"\",\n runtime=\"\"\"\n class Bad1:\n @classmethod\n def f(cls, number, text): pass\n \"\"\",\n error=\"Bad1.f\",\n )\n yield Case(\n stub=\"\"\"\n class Bad2:\n @classmethod\n def f(cls, number: int, text: str) -> None: ...\n \"\"\",\n runtime=\"\"\"\n class Bad2:\n @staticmethod\n def f(self, number, text): pass\n \"\"\",\n error=\"Bad2.f\",\n )\n yield Case(\n stub=\"\"\"\n class Bad3:\n @staticmethod\n def f(cls, number: int, text: str) -> None: ...\n \"\"\",\n runtime=\"\"\"\n class Bad3:\n @classmethod\n def f(self, number, text): pass\n \"\"\",\n error=\"Bad3.f\",\n )\n yield Case(\n stub=\"\"\"\n class GoodNew:\n def __new__(cls, *args, **kwargs): ...\n \"\"\",\n runtime=\"\"\"\n class GoodNew:\n def __new__(cls, *args, **kwargs): pass\n \"\"\",\n error=None,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestUnit.test_arg_mismatch_StubtestUnit.test_arg_mismatch.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestUnit.test_arg_mismatch_StubtestUnit.test_arg_mismatch.None_4", "embedding": null, "metadata": {"file_path": "mypy/test/teststubtest.py", "file_name": "teststubtest.py", "file_type": "text/x-python", "category": "test", "start_line": 340, "end_line": 356, "span_ids": ["StubtestUnit.test_arg_mismatch"], "tokens": 234}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubtestUnit(unittest.TestCase):\n\n @collect_cases\n def test_arg_mismatch(self) -> Iterator[Case]:\n yield Case(\n stub=\"def f1(a, *, b, c) -> None: ...\", runtime=\"def f1(a, *, b, c): pass\", error=None\n )\n yield Case(\n stub=\"def f2(a, *, b) -> None: ...\", runtime=\"def f2(a, *, b, c): pass\", error=\"f2\"\n )\n yield Case(\n stub=\"def f3(a, *, b, c) -> None: ...\", runtime=\"def f3(a, *, b): pass\", error=\"f3\"\n )\n yield Case(\n stub=\"def f4(a, *, b, c) -> None: ...\", runtime=\"def f4(a, b, *, c): pass\", error=\"f4\"\n )\n yield Case(\n stub=\"def f5(a, b, *, c) -> None: ...\", runtime=\"def f5(a, *, b, c): pass\", error=\"f5\"\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestUnit.test_varargs_varkwargs_StubtestUnit.test_varargs_varkwargs.None_16": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestUnit.test_varargs_varkwargs_StubtestUnit.test_varargs_varkwargs.None_16", "embedding": null, "metadata": {"file_path": "mypy/test/teststubtest.py", "file_name": "teststubtest.py", "file_type": "text/x-python", "category": "test", "start_line": 358, "end_line": 423, "span_ids": ["StubtestUnit.test_varargs_varkwargs"], "tokens": 738}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubtestUnit(unittest.TestCase):\n\n @collect_cases\n def test_varargs_varkwargs(self) -> Iterator[Case]:\n yield Case(\n stub=\"def f1(*args, **kwargs) -> None: ...\",\n runtime=\"def f1(*args, **kwargs): pass\",\n error=None,\n )\n yield Case(\n stub=\"def f2(*args, **kwargs) -> None: ...\",\n runtime=\"def f2(**kwargs): pass\",\n error=\"f2\",\n )\n yield Case(\n stub=\"def g1(a, b, c, d) -> None: ...\", runtime=\"def g1(a, *args): pass\", error=None\n )\n yield Case(\n stub=\"def g2(a, b, c, d, *args) -> None: ...\", runtime=\"def g2(a): pass\", error=\"g2\"\n )\n yield Case(\n stub=\"def g3(a, b, c, d, *args) -> None: ...\",\n runtime=\"def g3(a, *args): pass\",\n error=None,\n )\n yield Case(\n stub=\"def h1(a) -> None: ...\", runtime=\"def h1(a, b, c, d, *args): pass\", error=\"h1\"\n )\n yield Case(\n stub=\"def h2(a, *args) -> None: ...\", runtime=\"def h2(a, b, c, d): pass\", error=\"h2\"\n )\n yield Case(\n stub=\"def h3(a, *args) -> None: ...\",\n runtime=\"def h3(a, b, c, d, *args): pass\",\n error=\"h3\",\n )\n yield Case(\n stub=\"def j1(a: int, *args) -> None: ...\", runtime=\"def j1(a): pass\", error=\"j1\"\n )\n yield Case(\n stub=\"def j2(a: int) -> None: ...\", runtime=\"def j2(a, *args): pass\", error=\"j2\"\n )\n yield Case(\n stub=\"def j3(a, b, c) -> None: ...\", runtime=\"def j3(a, *args, c): pass\", error=\"j3\"\n )\n yield Case(stub=\"def k1(a, **kwargs) -> None: ...\", runtime=\"def k1(a): pass\", error=\"k1\")\n yield Case(\n # In theory an error, but led to worse results in practice\n stub=\"def k2(a) -> None: ...\",\n runtime=\"def k2(a, **kwargs): pass\",\n error=None,\n )\n yield Case(\n stub=\"def k3(a, b) -> None: ...\", runtime=\"def k3(a, **kwargs): pass\", error=\"k3\"\n )\n yield Case(\n stub=\"def k4(a, *, b) -> None: ...\", runtime=\"def k4(a, **kwargs): pass\", error=None\n )\n yield Case(\n stub=\"def k5(a, *, b) -> None: ...\",\n runtime=\"def k5(a, *, b, c, **kwargs): pass\",\n error=\"k5\",\n )\n yield Case(\n stub=\"def k6(a, *, b, **kwargs) -> None: ...\",\n runtime=\"def k6(a, *, b, c, **kwargs): pass\",\n error=\"k6\",\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestUnit.test_overload_StubtestUnit.test_overload.if_sys_version_info_3.yield_Case_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestUnit.test_overload_StubtestUnit.test_overload.if_sys_version_info_3.yield_Case_", "embedding": null, "metadata": {"file_path": "mypy/test/teststubtest.py", "file_name": "teststubtest.py", "file_type": "text/x-python", "category": "test", "start_line": 425, "end_line": 479, "span_ids": ["StubtestUnit.test_overload"], "tokens": 438}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubtestUnit(unittest.TestCase):\n\n @collect_cases\n def test_overload(self) -> Iterator[Case]:\n yield Case(\n stub=\"\"\"\n from typing import overload\n\n @overload\n def f1(a: int, *, c: int = ...) -> int: ...\n @overload\n def f1(a: int, b: int, c: int = ...) -> str: ...\n \"\"\",\n runtime=\"def f1(a, b = 0, c = 0): pass\",\n error=None,\n )\n yield Case(\n stub=\"\"\"\n @overload\n def f2(a: int, *, c: int = ...) -> int: ...\n @overload\n def f2(a: int, b: int, c: int = ...) -> str: ...\n \"\"\",\n runtime=\"def f2(a, b, c = 0): pass\",\n error=\"f2\",\n )\n yield Case(\n stub=\"\"\"\n @overload\n def f3(a: int) -> int: ...\n @overload\n def f3(a: int, b: str) -> str: ...\n \"\"\",\n runtime=\"def f3(a, b = None): pass\",\n error=\"f3\",\n )\n yield Case(\n stub=\"\"\"\n @overload\n def f4(a: int, *args, b: int, **kwargs) -> int: ...\n @overload\n def f4(a: str, *args, b: int, **kwargs) -> str: ...\n \"\"\",\n runtime=\"def f4(a, *args, b, **kwargs): pass\",\n error=None,\n )\n if sys.version_info >= (3, 8):\n yield Case(\n stub=\"\"\"\n @overload\n def f5(__a: int) -> int: ...\n @overload\n def f5(__b: str) -> str: ...\n \"\"\",\n runtime=\"def f5(x, /): pass\",\n error=None,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestUnit.test_property_StubtestUnit.test_property.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestUnit.test_property_StubtestUnit.test_property.None_3", "embedding": null, "metadata": {"file_path": "mypy/test/teststubtest.py", "file_name": "teststubtest.py", "file_type": "text/x-python", "category": "test", "start_line": 481, "end_line": 531, "span_ids": ["StubtestUnit.test_property"], "tokens": 252}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubtestUnit(unittest.TestCase):\n\n @collect_cases\n def test_property(self) -> Iterator[Case]:\n yield Case(\n stub=\"\"\"\n class Good:\n @property\n def f(self) -> int: ...\n \"\"\",\n runtime=\"\"\"\n class Good:\n @property\n def f(self) -> int: return 1\n \"\"\",\n error=None,\n )\n yield Case(\n stub=\"\"\"\n class Bad:\n @property\n def f(self) -> int: ...\n \"\"\",\n runtime=\"\"\"\n class Bad:\n def f(self) -> int: return 1\n \"\"\",\n error=\"Bad.f\",\n )\n yield Case(\n stub=\"\"\"\n class GoodReadOnly:\n @property\n def f(self) -> int: ...\n \"\"\",\n runtime=\"\"\"\n class GoodReadOnly:\n f = 1\n \"\"\",\n error=None,\n )\n yield Case(\n stub=\"\"\"\n class BadReadOnly:\n @property\n def f(self) -> str: ...\n \"\"\",\n runtime=\"\"\"\n class BadReadOnly:\n f = 1\n \"\"\",\n error=\"BadReadOnly.f\",\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestUnit.test_enum_StubtestUnit.test_decorator.yield_Case_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestUnit.test_enum_StubtestUnit.test_decorator.yield_Case_", "embedding": null, "metadata": {"file_path": "mypy/test/teststubtest.py", "file_name": "teststubtest.py", "file_type": "text/x-python", "category": "test", "start_line": 565, "end_line": 600, "span_ids": ["StubtestUnit.test_enum", "StubtestUnit.test_decorator"], "tokens": 200}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubtestUnit(unittest.TestCase):\n\n @collect_cases\n def test_enum(self) -> Iterator[Case]:\n yield Case(\n stub=\"\"\"\n import enum\n class X(enum.Enum):\n a: int\n b: str\n c: str\n \"\"\",\n runtime=\"\"\"\n import enum\n class X(enum.Enum):\n a = 1\n b = \"asdf\"\n c = 2\n \"\"\",\n error=\"X.c\",\n )\n\n @collect_cases\n def test_decorator(self) -> Iterator[Case]:\n yield Case(\n stub=\"\"\"\n from typing import Any, Callable\n def decorator(f: Callable[[], int]) -> Callable[..., Any]: ...\n @decorator\n def f() -> Any: ...\n \"\"\",\n runtime=\"\"\"\n def decorator(f): return f\n @decorator\n def f(): return 3\n \"\"\",\n error=None,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestUnit.test_mro_remove_color_code._this_works_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestUnit.test_mro_remove_color_code._this_works_", "embedding": null, "metadata": {"file_path": "mypy/test/teststubtest.py", "file_name": "teststubtest.py", "file_type": "text/x-python", "category": "test", "start_line": 647, "end_line": 681, "span_ids": ["StubtestUnit.test_mro", "remove_color_code"], "tokens": 215}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubtestUnit(unittest.TestCase):\n\n @collect_cases\n def test_mro(self) -> Iterator[Case]:\n yield Case(\n stub=\"\"\"\n class A:\n def foo(self, x: int) -> None: ...\n class B(A):\n pass\n class C(A):\n pass\n \"\"\",\n runtime=\"\"\"\n class A:\n def foo(self, x: int) -> None: ...\n class B(A):\n def foo(self, x: int) -> None: ...\n class C(A):\n def foo(self, y: int) -> None: ...\n \"\"\",\n error=\"C.foo\"\n )\n yield Case(\n stub=\"\"\"\n class X: ...\n \"\"\",\n runtime=\"\"\"\n class X:\n def __init__(self, x): pass\n \"\"\",\n error=\"X.__init__\"\n )\n\n\ndef remove_color_code(s: str) -> str:\n return re.sub(\"\\\\x1b.*?m\", \"\", s) # this works!", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestMiscUnit_StubtestMiscUnit.test_output.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestMiscUnit_StubtestMiscUnit.test_output.None_1", "embedding": null, "metadata": {"file_path": "mypy/test/teststubtest.py", "file_name": "teststubtest.py", "file_type": "text/x-python", "category": "test", "start_line": 684, "end_line": 707, "span_ids": ["StubtestMiscUnit.test_output", "StubtestMiscUnit"], "tokens": 243}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubtestMiscUnit(unittest.TestCase):\n def test_output(self) -> None:\n output = run_stubtest(\n stub=\"def bad(number: int, text: str) -> None: ...\",\n runtime=\"def bad(num, text): pass\",\n options=[],\n )\n expected = (\n 'error: {0}.bad is inconsistent, stub argument \"number\" differs from runtime '\n 'argument \"num\"\\nStub: at line 1\\ndef (number: builtins.int, text: builtins.str)\\n'\n \"Runtime: at line 1 in file {0}.py\\ndef (num, text)\\n\\n\".format(TEST_MODULE_NAME)\n )\n assert remove_color_code(output) == expected\n\n output = run_stubtest(\n stub=\"def bad(number: int, text: str) -> None: ...\",\n runtime=\"def bad(num, text): pass\",\n options=[\"--concise\"],\n )\n expected = (\n \"{}.bad is inconsistent, \"\n 'stub argument \"number\" differs from runtime argument \"num\"\\n'.format(TEST_MODULE_NAME)\n )\n assert remove_color_code(output) == expected", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestMiscUnit.test_ignore_flags_StubtestMiscUnit.test_ignore_flags.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestMiscUnit.test_ignore_flags_StubtestMiscUnit.test_ignore_flags.None_2", "embedding": null, "metadata": {"file_path": "mypy/test/teststubtest.py", "file_name": "teststubtest.py", "file_type": "text/x-python", "category": "test", "start_line": 709, "end_line": 723, "span_ids": ["StubtestMiscUnit.test_ignore_flags"], "tokens": 130}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubtestMiscUnit(unittest.TestCase):\n\n def test_ignore_flags(self) -> None:\n output = run_stubtest(\n stub=\"\", runtime=\"__all__ = ['f']\\ndef f(): pass\", options=[\"--ignore-missing-stub\"]\n )\n assert not output\n\n output = run_stubtest(\n stub=\"\", runtime=\"def f(): pass\", options=[\"--ignore-missing-stub\"]\n )\n assert not output\n\n output = run_stubtest(\n stub=\"def f(__a): ...\", runtime=\"def f(a): pass\", options=[\"--ignore-positional-only\"]\n )\n assert not output", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestMiscUnit.test_allowlist_StubtestMiscUnit.test_allowlist.try_.finally_.os_unlink_allowlist_name_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestMiscUnit.test_allowlist_StubtestMiscUnit.test_allowlist.try_.finally_.os_unlink_allowlist_name_", "embedding": null, "metadata": {"file_path": "mypy/test/teststubtest.py", "file_name": "teststubtest.py", "file_type": "text/x-python", "category": "test", "start_line": 725, "end_line": 777, "span_ids": ["StubtestMiscUnit.test_allowlist"], "tokens": 428}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubtestMiscUnit(unittest.TestCase):\n\n def test_allowlist(self) -> None:\n # Can't use this as a context because Windows\n allowlist = tempfile.NamedTemporaryFile(mode=\"w+\", delete=False)\n try:\n with allowlist:\n allowlist.write(\"{}.bad # comment\\n# comment\".format(TEST_MODULE_NAME))\n\n output = run_stubtest(\n stub=\"def bad(number: int, text: str) -> None: ...\",\n runtime=\"def bad(asdf, text): pass\",\n options=[\"--allowlist\", allowlist.name],\n )\n assert not output\n\n # test unused entry detection\n output = run_stubtest(stub=\"\", runtime=\"\", options=[\"--allowlist\", allowlist.name])\n assert output == \"note: unused allowlist entry {}.bad\\n\".format(TEST_MODULE_NAME)\n\n output = run_stubtest(\n stub=\"\",\n runtime=\"\",\n options=[\"--allowlist\", allowlist.name, \"--ignore-unused-allowlist\"],\n )\n assert not output\n\n # test regex matching\n with open(allowlist.name, mode=\"w+\") as f:\n f.write(\"{}.b.*\\n\".format(TEST_MODULE_NAME))\n f.write(\"(unused_missing)?\\n\")\n f.write(\"unused.*\\n\")\n\n output = run_stubtest(\n stub=textwrap.dedent(\n \"\"\"\n def good() -> None: ...\n def bad(number: int) -> None: ...\n def also_bad(number: int) -> None: ...\n \"\"\".lstrip(\"\\n\")\n ),\n runtime=textwrap.dedent(\n \"\"\"\n def good(): pass\n def bad(asdf): pass\n def also_bad(asdf): pass\n \"\"\".lstrip(\"\\n\")\n ),\n options=[\"--allowlist\", allowlist.name, \"--generate-allowlist\"],\n )\n assert output == \"note: unused allowlist entry unused.*\\n{}.also_bad\\n\".format(\n TEST_MODULE_NAME\n )\n finally:\n os.unlink(allowlist.name)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestMiscUnit.test_mypy_build_StubtestMiscUnit.test_mypy_build.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestMiscUnit.test_mypy_build_StubtestMiscUnit.test_mypy_build.None_1", "embedding": null, "metadata": {"file_path": "mypy/test/teststubtest.py", "file_name": "teststubtest.py", "file_type": "text/x-python", "category": "test", "start_line": 810, "end_line": 821, "span_ids": ["StubtestMiscUnit.test_mypy_build"], "tokens": 159}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubtestMiscUnit(unittest.TestCase):\n\n def test_mypy_build(self) -> None:\n output = run_stubtest(stub=\"+\", runtime=\"\", options=[])\n assert remove_color_code(output) == (\n \"error: not checking stubs due to failed mypy compile:\\n{}.pyi:1: \"\n \"error: invalid syntax\\n\".format(TEST_MODULE_NAME)\n )\n\n output = run_stubtest(stub=\"def f(): ...\\ndef f(): ...\", runtime=\"\", options=[])\n assert remove_color_code(output) == (\n 'error: not checking stubs due to mypy build errors:\\n{}.pyi:2: '\n 'error: Name \"f\" already defined on line 1\\n'.format(TEST_MODULE_NAME)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestMiscUnit.test_missing_stubs_StubtestMiscUnit.test_signature.assert_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestMiscUnit.test_missing_stubs_StubtestMiscUnit.test_signature.assert_", "embedding": null, "metadata": {"file_path": "mypy/test/teststubtest.py", "file_name": "teststubtest.py", "file_type": "text/x-python", "category": "test", "start_line": 823, "end_line": 845, "span_ids": ["StubtestMiscUnit.test_signature", "StubtestMiscUnit.test_missing_stubs", "StubtestMiscUnit.test_get_typeshed_stdlib_modules"], "tokens": 252}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubtestMiscUnit(unittest.TestCase):\n\n def test_missing_stubs(self) -> None:\n output = io.StringIO()\n with contextlib.redirect_stdout(output):\n test_stubs(parse_options([\"not_a_module\"]))\n assert \"error: not_a_module failed to find stubs\" in remove_color_code(output.getvalue())\n\n def test_get_typeshed_stdlib_modules(self) -> None:\n stdlib = mypy.stubtest.get_typeshed_stdlib_modules(None)\n assert \"builtins\" in stdlib\n assert \"os\" in stdlib\n assert \"os.path\" in stdlib\n assert \"mypy_extensions\" not in stdlib\n assert \"asyncio\" in stdlib\n assert (\"dataclasses\" in stdlib) == (sys.version_info >= (3, 7))\n\n def test_signature(self) -> None:\n def f(a: int, b: int, *, c: int, d: int = 0, **kwargs: Any) -> None:\n pass\n\n assert (\n str(mypy.stubtest.Signature.from_inspect_signature(inspect.signature(f)))\n == \"def (a, b, *, c, d = ..., **kwargs)\"\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestMiscUnit.test_config_file_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestMiscUnit.test_config_file_", "embedding": null, "metadata": {"file_path": "mypy/test/teststubtest.py", "file_name": "teststubtest.py", "file_type": "text/x-python", "category": "test", "start_line": 843, "end_line": 857, "span_ids": ["StubtestMiscUnit.test_config_file"], "tokens": 167}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubtestMiscUnit(unittest.TestCase):\n\n def test_config_file(self) -> None:\n runtime = \"temp = 5\\n\"\n stub = \"from decimal import Decimal\\ntemp: Decimal\\n\"\n config_file = (\n \"[mypy]\\n\"\n \"plugins={}/test-data/unit/plugins/decimal_to_int.py\\n\".format(root_dir)\n )\n output = run_stubtest(stub=stub, runtime=runtime, options=[])\n assert output == (\n \"error: test_module.temp variable differs from runtime type Literal[5]\\n\"\n \"Stub: at line 2\\ndecimal.Decimal\\nRuntime:\\n5\\n\\n\"\n )\n output = run_stubtest(stub=stub, runtime=runtime, options=[], config_file=config_file)\n assert output == \"\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsubtypes.py_from_mypy_test_helpers_im_SubtypingSuite.test_generic_interface_subtyping.self_assert_equivalent_fx": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsubtypes.py_from_mypy_test_helpers_im_SubtypingSuite.test_generic_interface_subtyping.self_assert_equivalent_fx", "embedding": null, "metadata": {"file_path": "mypy/test/testsubtypes.py", "file_name": "testsubtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 78, "span_ids": ["SubtypingSuite.test_generic_subtyping_with_inheritance_covariant", "SubtypingSuite.test_trivial_cases", "SubtypingSuite.test_generic_interface_subtyping", "imports", "SubtypingSuite", "SubtypingSuite.test_generic_subtyping_with_inheritance_invariant", "SubtypingSuite.test_simple_generic_instance_subtyping_covariant", "SubtypingSuite.test_simple_generic_instance_subtyping_invariant", "SubtypingSuite.test_simple_generic_instance_subtyping_contravariant", "SubtypingSuite.test_interface_subtyping", "SubtypingSuite.test_generic_subtyping_with_inheritance_contravariant", "SubtypingSuite.setUp", "SubtypingSuite.test_instance_subtyping"], "tokens": 816}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from mypy.test.helpers import Suite, assert_true, skip\nfrom mypy.nodes import CONTRAVARIANT, INVARIANT, COVARIANT\nfrom mypy.subtypes import is_subtype\nfrom mypy.test.typefixture import TypeFixture, InterfaceTypeFixture\nfrom mypy.types import Type\n\n\nclass SubtypingSuite(Suite):\n def setUp(self) -> None:\n self.fx = TypeFixture(INVARIANT)\n self.fx_contra = TypeFixture(CONTRAVARIANT)\n self.fx_co = TypeFixture(COVARIANT)\n\n def test_trivial_cases(self) -> None:\n for simple in self.fx_co.a, self.fx_co.o, self.fx_co.b:\n self.assert_subtype(simple, simple)\n\n def test_instance_subtyping(self) -> None:\n self.assert_strict_subtype(self.fx.a, self.fx.o)\n self.assert_strict_subtype(self.fx.b, self.fx.o)\n self.assert_strict_subtype(self.fx.b, self.fx.a)\n\n self.assert_not_subtype(self.fx.a, self.fx.d)\n self.assert_not_subtype(self.fx.b, self.fx.c)\n\n def test_simple_generic_instance_subtyping_invariant(self) -> None:\n self.assert_subtype(self.fx.ga, self.fx.ga)\n self.assert_subtype(self.fx.hab, self.fx.hab)\n\n self.assert_not_subtype(self.fx.ga, self.fx.g2a)\n self.assert_not_subtype(self.fx.ga, self.fx.gb)\n self.assert_not_subtype(self.fx.gb, self.fx.ga)\n\n def test_simple_generic_instance_subtyping_covariant(self) -> None:\n self.assert_subtype(self.fx_co.ga, self.fx_co.ga)\n self.assert_subtype(self.fx_co.hab, self.fx_co.hab)\n\n self.assert_not_subtype(self.fx_co.ga, self.fx_co.g2a)\n self.assert_not_subtype(self.fx_co.ga, self.fx_co.gb)\n self.assert_subtype(self.fx_co.gb, self.fx_co.ga)\n\n def test_simple_generic_instance_subtyping_contravariant(self) -> None:\n self.assert_subtype(self.fx_contra.ga, self.fx_contra.ga)\n self.assert_subtype(self.fx_contra.hab, self.fx_contra.hab)\n\n self.assert_not_subtype(self.fx_contra.ga, self.fx_contra.g2a)\n self.assert_subtype(self.fx_contra.ga, self.fx_contra.gb)\n self.assert_not_subtype(self.fx_contra.gb, self.fx_contra.ga)\n\n def test_generic_subtyping_with_inheritance_invariant(self) -> None:\n self.assert_subtype(self.fx.gsab, self.fx.gb)\n self.assert_not_subtype(self.fx.gsab, self.fx.ga)\n self.assert_not_subtype(self.fx.gsaa, self.fx.gb)\n\n def test_generic_subtyping_with_inheritance_covariant(self) -> None:\n self.assert_subtype(self.fx_co.gsab, self.fx_co.gb)\n self.assert_subtype(self.fx_co.gsab, self.fx_co.ga)\n self.assert_not_subtype(self.fx_co.gsaa, self.fx_co.gb)\n\n def test_generic_subtyping_with_inheritance_contravariant(self) -> None:\n self.assert_subtype(self.fx_contra.gsab, self.fx_contra.gb)\n self.assert_not_subtype(self.fx_contra.gsab, self.fx_contra.ga)\n self.assert_subtype(self.fx_contra.gsaa, self.fx_contra.gb)\n\n def test_interface_subtyping(self) -> None:\n self.assert_subtype(self.fx.e, self.fx.f)\n self.assert_equivalent(self.fx.f, self.fx.f)\n self.assert_not_subtype(self.fx.a, self.fx.f)\n\n @skip\n def test_generic_interface_subtyping(self) -> None:\n # TODO make this work\n fx2 = InterfaceTypeFixture()\n\n self.assert_subtype(fx2.m1, fx2.gfa)\n self.assert_not_subtype(fx2.m1, fx2.gfb)\n\n self.assert_equivalent(fx2.gfa, fx2.gfa)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsubtypes.py_SubtypingSuite.test_basic_callable_subtyping_SubtypingSuite.test_basic_callable_subtyping.self_assert_unrelated_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsubtypes.py_SubtypingSuite.test_basic_callable_subtyping_SubtypingSuite.test_basic_callable_subtyping.self_assert_unrelated_", "embedding": null, "metadata": {"file_path": "mypy/test/testsubtypes.py", "file_name": "testsubtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 80, "end_line": 91, "span_ids": ["SubtypingSuite.test_basic_callable_subtyping"], "tokens": 149}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SubtypingSuite(Suite):\n\n def test_basic_callable_subtyping(self) -> None:\n self.assert_strict_subtype(self.fx.callable(self.fx.o, self.fx.d),\n self.fx.callable(self.fx.a, self.fx.d))\n self.assert_strict_subtype(self.fx.callable(self.fx.d, self.fx.b),\n self.fx.callable(self.fx.d, self.fx.a))\n\n self.assert_strict_subtype(self.fx.callable(self.fx.a, self.fx.nonet),\n self.fx.callable(self.fx.a, self.fx.a))\n\n self.assert_unrelated(\n self.fx.callable(self.fx.a, self.fx.a, self.fx.a),\n self.fx.callable(self.fx.a, self.fx.a))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsubtypes.py_SubtypingSuite.test_default_arg_callable_subtyping_SubtypingSuite.test_default_arg_callable_subtyping.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsubtypes.py_SubtypingSuite.test_default_arg_callable_subtyping_SubtypingSuite.test_default_arg_callable_subtyping.None_5", "embedding": null, "metadata": {"file_path": "mypy/test/testsubtypes.py", "file_name": "testsubtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 93, "end_line": 116, "span_ids": ["SubtypingSuite.test_default_arg_callable_subtyping"], "tokens": 287}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SubtypingSuite(Suite):\n\n def test_default_arg_callable_subtyping(self) -> None:\n self.assert_strict_subtype(\n self.fx.callable_default(1, self.fx.a, self.fx.d, self.fx.a),\n self.fx.callable(self.fx.a, self.fx.d, self.fx.a))\n\n self.assert_strict_subtype(\n self.fx.callable_default(1, self.fx.a, self.fx.d, self.fx.a),\n self.fx.callable(self.fx.a, self.fx.a))\n\n self.assert_strict_subtype(\n self.fx.callable_default(0, self.fx.a, self.fx.d, self.fx.a),\n self.fx.callable_default(1, self.fx.a, self.fx.d, self.fx.a))\n\n self.assert_unrelated(\n self.fx.callable_default(1, self.fx.a, self.fx.d, self.fx.a),\n self.fx.callable(self.fx.d, self.fx.d, self.fx.a))\n\n self.assert_unrelated(\n self.fx.callable_default(0, self.fx.a, self.fx.d, self.fx.a),\n self.fx.callable_default(1, self.fx.a, self.fx.a, self.fx.a))\n\n self.assert_unrelated(\n self.fx.callable_default(1, self.fx.a, self.fx.a),\n self.fx.callable(self.fx.a, self.fx.a, self.fx.a))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsubtypes.py_SubtypingSuite.test_var_arg_callable_subtyping_1_SubtypingSuite.test_var_arg_callable_subtyping_7.self_assert_not_subtype_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsubtypes.py_SubtypingSuite.test_var_arg_callable_subtyping_1_SubtypingSuite.test_var_arg_callable_subtyping_7.self_assert_not_subtype_", "embedding": null, "metadata": {"file_path": "mypy/test/testsubtypes.py", "file_name": "testsubtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 118, "end_line": 151, "span_ids": ["SubtypingSuite.test_var_arg_callable_subtyping_7", "SubtypingSuite.test_var_arg_callable_subtyping_4", "SubtypingSuite.test_var_arg_callable_subtyping_3", "SubtypingSuite.test_var_arg_callable_subtyping_2", "SubtypingSuite.test_var_arg_callable_subtyping_6", "SubtypingSuite.test_var_arg_callable_subtyping_1", "SubtypingSuite.test_var_arg_callable_subtyping_5"], "tokens": 399}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SubtypingSuite(Suite):\n\n def test_var_arg_callable_subtyping_1(self) -> None:\n self.assert_strict_subtype(\n self.fx.callable_var_arg(0, self.fx.a, self.fx.a),\n self.fx.callable_var_arg(0, self.fx.b, self.fx.a))\n\n def test_var_arg_callable_subtyping_2(self) -> None:\n self.assert_strict_subtype(\n self.fx.callable_var_arg(0, self.fx.a, self.fx.a),\n self.fx.callable(self.fx.b, self.fx.a))\n\n def test_var_arg_callable_subtyping_3(self) -> None:\n self.assert_strict_subtype(\n self.fx.callable_var_arg(0, self.fx.a, self.fx.a),\n self.fx.callable(self.fx.a))\n\n def test_var_arg_callable_subtyping_4(self) -> None:\n self.assert_strict_subtype(\n self.fx.callable_var_arg(1, self.fx.a, self.fx.d, self.fx.a),\n self.fx.callable(self.fx.b, self.fx.a))\n\n def test_var_arg_callable_subtyping_5(self) -> None:\n self.assert_strict_subtype(\n self.fx.callable_var_arg(0, self.fx.a, self.fx.d, self.fx.a),\n self.fx.callable(self.fx.b, self.fx.a))\n\n def test_var_arg_callable_subtyping_6(self) -> None:\n self.assert_strict_subtype(\n self.fx.callable_var_arg(0, self.fx.a, self.fx.f, self.fx.d),\n self.fx.callable_var_arg(0, self.fx.b, self.fx.e, self.fx.d))\n\n def test_var_arg_callable_subtyping_7(self) -> None:\n self.assert_not_subtype(\n self.fx.callable_var_arg(0, self.fx.b, self.fx.d),\n self.fx.callable(self.fx.a, self.fx.d))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsubtypes.py_SubtypingSuite.test_var_arg_callable_subtyping_8_SubtypingSuite.test_var_arg_callable_subtyping_8.self_assert_subtype_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsubtypes.py_SubtypingSuite.test_var_arg_callable_subtyping_8_SubtypingSuite.test_var_arg_callable_subtyping_8.self_assert_subtype_", "embedding": null, "metadata": {"file_path": "mypy/test/testsubtypes.py", "file_name": "testsubtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 153, "end_line": 159, "span_ids": ["SubtypingSuite.test_var_arg_callable_subtyping_8"], "tokens": 113}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SubtypingSuite(Suite):\n\n def test_var_arg_callable_subtyping_8(self) -> None:\n self.assert_not_subtype(\n self.fx.callable_var_arg(0, self.fx.b, self.fx.d),\n self.fx.callable_var_arg(0, self.fx.a, self.fx.a, self.fx.d))\n self.assert_subtype(\n self.fx.callable_var_arg(0, self.fx.a, self.fx.d),\n self.fx.callable_var_arg(0, self.fx.b, self.fx.b, self.fx.d))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsubtypes.py_SubtypingSuite.test_var_arg_callable_subtyping_9_SubtypingSuite.test_var_arg_callable_subtyping_9.self_assert_subtype_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsubtypes.py_SubtypingSuite.test_var_arg_callable_subtyping_9_SubtypingSuite.test_var_arg_callable_subtyping_9.self_assert_subtype_", "embedding": null, "metadata": {"file_path": "mypy/test/testsubtypes.py", "file_name": "testsubtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 161, "end_line": 167, "span_ids": ["SubtypingSuite.test_var_arg_callable_subtyping_9"], "tokens": 113}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SubtypingSuite(Suite):\n\n def test_var_arg_callable_subtyping_9(self) -> None:\n self.assert_not_subtype(\n self.fx.callable_var_arg(0, self.fx.b, self.fx.b, self.fx.d),\n self.fx.callable_var_arg(0, self.fx.a, self.fx.d))\n self.assert_subtype(\n self.fx.callable_var_arg(0, self.fx.a, self.fx.a, self.fx.d),\n self.fx.callable_var_arg(0, self.fx.b, self.fx.d))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsubtypes.py_SubtypingSuite.test_type_callable_subtyping_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsubtypes.py_SubtypingSuite.test_type_callable_subtyping_", "embedding": null, "metadata": {"file_path": "mypy/test/testsubtypes.py", "file_name": "testsubtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 169, "end_line": 207, "span_ids": ["SubtypingSuite.assert_not_subtype", "SubtypingSuite.assert_equivalent", "SubtypingSuite.assert_unrelated", "SubtypingSuite.test_type_callable_subtyping", "SubtypingSuite.assert_subtype", "SubtypingSuite.assert_strict_subtype"], "tokens": 372}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SubtypingSuite(Suite):\n\n def test_type_callable_subtyping(self) -> None:\n self.assert_subtype(\n self.fx.callable_type(self.fx.d, self.fx.a), self.fx.type_type)\n\n self.assert_strict_subtype(\n self.fx.callable_type(self.fx.d, self.fx.b),\n self.fx.callable(self.fx.d, self.fx.a))\n\n self.assert_strict_subtype(self.fx.callable_type(self.fx.a, self.fx.b),\n self.fx.callable(self.fx.a, self.fx.b))\n\n # IDEA: Maybe add these test cases (they are tested pretty well in type\n # checker tests already):\n # * more interface subtyping test cases\n # * more generic interface subtyping test cases\n # * type variables\n # * tuple types\n # * None type\n # * any type\n # * generic function types\n\n def assert_subtype(self, s: Type, t: Type) -> None:\n assert_true(is_subtype(s, t), '{} not subtype of {}'.format(s, t))\n\n def assert_not_subtype(self, s: Type, t: Type) -> None:\n assert_true(not is_subtype(s, t), '{} subtype of {}'.format(s, t))\n\n def assert_strict_subtype(self, s: Type, t: Type) -> None:\n self.assert_subtype(s, t)\n self.assert_not_subtype(t, s)\n\n def assert_equivalent(self, s: Type, t: Type) -> None:\n self.assert_subtype(s, t)\n self.assert_subtype(t, s)\n\n def assert_unrelated(self, s: Type, t: Type) -> None:\n self.assert_not_subtype(s, t)\n self.assert_not_subtype(t, s)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtransform.py__Identity_AST_transform_TransformSuite.run_case.test_transform_testcase_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtransform.py__Identity_AST_transform_TransformSuite.run_case.test_transform_testcase_", "embedding": null, "metadata": {"file_path": "mypy/test/testtransform.py", "file_name": "testtransform.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 30, "span_ids": ["TransformSuite.run_case", "TransformSuite", "docstring"], "tokens": 211}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Identity AST transform test cases\"\"\"\n\nimport os.path\n\nfrom mypy import build\nfrom mypy.modulefinder import BuildSource\nfrom mypy.test.helpers import (\n assert_string_arrays_equal, normalize_error_messages, parse_options\n)\nfrom mypy.test.data import DataDrivenTestCase, DataSuite\nfrom mypy.test.config import test_temp_dir\nfrom mypy.test.visitors import TypeAssertTransformVisitor\nfrom mypy.errors import CompileError\n\n\nclass TransformSuite(DataSuite):\n required_out_section = True\n # Reuse semantic analysis test cases.\n files = ['semanal-basic.test',\n 'semanal-expressions.test',\n 'semanal-classes.test',\n 'semanal-types.test',\n 'semanal-modules.test',\n 'semanal-statements.test',\n 'semanal-abstractclasses.test',\n 'semanal-python2.test']\n native_sep = True\n\n def run_case(self, testcase: DataDrivenTestCase) -> None:\n test_transform(testcase)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtransform.py_test_transform_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtransform.py_test_transform_", "embedding": null, "metadata": {"file_path": "mypy/test/testtransform.py", "file_name": "testtransform.py", "file_type": "text/x-python", "category": "test", "start_line": 33, "end_line": 74, "span_ids": ["test_transform"], "tokens": 340}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_transform(testcase: DataDrivenTestCase) -> None:\n \"\"\"Perform an identity transform test case.\"\"\"\n\n try:\n src = '\\n'.join(testcase.input)\n options = parse_options(src, testcase, 1)\n options.use_builtins_fixtures = True\n options.semantic_analysis_only = True\n options.show_traceback = True\n result = build.build(sources=[BuildSource('main', None, src)],\n options=options,\n alt_lib_path=test_temp_dir)\n a = result.errors\n if a:\n raise CompileError(a)\n # Include string representations of the source files in the actual\n # output.\n for fnam in sorted(result.files.keys()):\n f = result.files[fnam]\n\n # Omit the builtins module and files with a special marker in the\n # path.\n # TODO the test is not reliable\n if (not f.path.endswith((os.sep + 'builtins.pyi',\n 'typing.pyi',\n 'abc.pyi'))\n and not os.path.basename(f.path).startswith('_')\n and not os.path.splitext(\n os.path.basename(f.path))[0].endswith('_')):\n t = TypeAssertTransformVisitor()\n t.test_only = True\n f = t.mypyfile(f)\n a += str(f).split('\\n')\n except CompileError as e:\n a = e.messages\n if testcase.normalize_output:\n a = normalize_error_messages(a)\n assert_string_arrays_equal(\n testcase.output, a,\n 'Invalid semantic analyzer output ({}, line {})'.format(testcase.file,\n testcase.line))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypegen.py__Test_cases_for_the_typ_from_mypy_options_import_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypegen.py__Test_cases_for_the_typ_from_mypy_options_import_", "embedding": null, "metadata": {"file_path": "mypy/test/testtypegen.py", "file_name": "testtypegen.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 14, "span_ids": ["docstring"], "tokens": 110}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Test cases for the type checker: exporting inferred types\"\"\"\n\nimport re\n\nfrom mypy import build\nfrom mypy.modulefinder import BuildSource\nfrom mypy.test.config import test_temp_dir\nfrom mypy.test.data import DataDrivenTestCase, DataSuite\nfrom mypy.test.helpers import assert_string_arrays_equal\nfrom mypy.test.visitors import SkippedNodeSearcher, ignore_node\nfrom mypy.util import short_type\nfrom mypy.nodes import NameExpr\nfrom mypy.errors import CompileError\nfrom mypy.options import Options", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypegen.py_TypeExportSuite_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypegen.py_TypeExportSuite_", "embedding": null, "metadata": {"file_path": "mypy/test/testtypegen.py", "file_name": "testtypegen.py", "file_type": "text/x-python", "category": "test", "start_line": 17, "end_line": 73, "span_ids": ["TypeExportSuite.run_case", "TypeExportSuite"], "tokens": 453}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeExportSuite(DataSuite):\n required_out_section = True\n files = ['typexport-basic.test']\n\n def run_case(self, testcase: DataDrivenTestCase) -> None:\n try:\n line = testcase.input[0]\n mask = ''\n if line.startswith('##'):\n mask = '(' + line[2:].strip() + ')$'\n\n src = '\\n'.join(testcase.input)\n options = Options()\n options.strict_optional = False # TODO: Enable strict optional checking\n options.use_builtins_fixtures = True\n options.show_traceback = True\n options.export_types = True\n options.preserve_asts = True\n result = build.build(sources=[BuildSource('main', None, src)],\n options=options,\n alt_lib_path=test_temp_dir)\n a = result.errors\n map = result.types\n nodes = map.keys()\n\n # Ignore NameExpr nodes of variables with explicit (trivial) types\n # to simplify output.\n searcher = SkippedNodeSearcher()\n for file in result.files.values():\n file.accept(searcher)\n ignored = searcher.nodes\n\n # Filter nodes that should be included in the output.\n keys = []\n for node in nodes:\n if node.line is not None and node.line != -1 and map[node]:\n if ignore_node(node) or node in ignored:\n continue\n if (re.match(mask, short_type(node))\n or (isinstance(node, NameExpr)\n and re.match(mask, node.name))):\n # Include node in output.\n keys.append(node)\n\n for key in sorted(keys,\n key=lambda n: (n.line, short_type(n),\n str(n) + str(map[n]))):\n ts = str(map[key]).replace('*', '') # Remove erased tags\n ts = ts.replace('__main__.', '')\n a.append('{}({}) : {}'.format(short_type(key), key.line, ts))\n except CompileError as e:\n a = e.messages\n assert_string_arrays_equal(\n testcase.output, a,\n 'Invalid type checker output ({}, line {})'.format(testcase.file,\n testcase.line))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py__Test_cases_for_mypy_ty_from_mypy_typeops_import_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py__Test_cases_for_mypy_ty_from_mypy_typeops_import_", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 21, "span_ids": ["docstring"], "tokens": 252}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Test cases for mypy types and type operations.\"\"\"\n\nfrom typing import List, Tuple\n\nfrom mypy.test.helpers import Suite, assert_equal, assert_true, assert_false, assert_type, skip\nfrom mypy.erasetype import erase_type\nfrom mypy.expandtype import expand_type\nfrom mypy.join import join_types, join_simple\nfrom mypy.meet import meet_types, narrow_declared_type\nfrom mypy.sametypes import is_same_type\nfrom mypy.indirection import TypeIndirectionVisitor\nfrom mypy.types import (\n UnboundType, AnyType, CallableType, TupleType, TypeVarDef, Type, Instance, NoneType,\n Overloaded, TypeType, UnionType, UninhabitedType, TypeVarId, TypeOfAny,\n LiteralType, get_proper_type\n)\nfrom mypy.nodes import ARG_POS, ARG_OPT, ARG_STAR, ARG_STAR2, CONTRAVARIANT, INVARIANT, COVARIANT\nfrom mypy.subtypes import is_subtype, is_more_precise, is_proper_subtype\nfrom mypy.test.typefixture import TypeFixture, InterfaceTypeFixture\nfrom mypy.state import strict_optional_set\nfrom mypy.typeops import true_only, false_only", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypesSuite_TypesSuite.test_callable_type.assert_equal_str_c2_de": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypesSuite_TypesSuite.test_callable_type.assert_equal_str_c2_de", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 24, "end_line": 50, "span_ids": ["TypesSuite.test_any", "TypesSuite.test_callable_type", "TypesSuite.setUp", "TypesSuite", "TypesSuite.test_simple_unbound_type", "TypesSuite.test_generic_unbound_type"], "tokens": 250}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypesSuite(Suite):\n def setUp(self) -> None:\n self.x = UnboundType('X') # Helpers\n self.y = UnboundType('Y')\n self.fx = TypeFixture()\n self.function = self.fx.function\n\n def test_any(self) -> None:\n assert_equal(str(AnyType(TypeOfAny.special_form)), 'Any')\n\n def test_simple_unbound_type(self) -> None:\n u = UnboundType('Foo')\n assert_equal(str(u), 'Foo?')\n\n def test_generic_unbound_type(self) -> None:\n u = UnboundType('Foo', [UnboundType('T'), AnyType(TypeOfAny.special_form)])\n assert_equal(str(u), 'Foo?[T?, Any]')\n\n def test_callable_type(self) -> None:\n c = CallableType([self.x, self.y],\n [ARG_POS, ARG_POS],\n [None, None],\n AnyType(TypeOfAny.special_form), self.function)\n assert_equal(str(c), 'def (X?, Y?) -> Any')\n\n c2 = CallableType([], [], [], NoneType(), self.fx.function)\n assert_equal(str(c2), 'def ()')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypesSuite.test_callable_type_with_default_args_TypesSuite.test_callable_type_with_default_args.assert_equal_str_c2_de": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypesSuite.test_callable_type_with_default_args_TypesSuite.test_callable_type_with_default_args.assert_equal_str_c2_de", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 52, "end_line": 59, "span_ids": ["TypesSuite.test_callable_type_with_default_args"], "tokens": 131}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypesSuite(Suite):\n\n def test_callable_type_with_default_args(self) -> None:\n c = CallableType([self.x, self.y], [ARG_POS, ARG_OPT], [None, None],\n AnyType(TypeOfAny.special_form), self.function)\n assert_equal(str(c), 'def (X?, Y? =) -> Any')\n\n c2 = CallableType([self.x, self.y], [ARG_OPT, ARG_OPT], [None, None],\n AnyType(TypeOfAny.special_form), self.function)\n assert_equal(str(c2), 'def (X? =, Y? =) -> Any')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypesSuite.test_callable_type_with_var_args_TypesSuite.test_callable_type_with_var_args.assert_equal_str_c3_de": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypesSuite.test_callable_type_with_var_args_TypesSuite.test_callable_type_with_var_args.assert_equal_str_c3_de", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 61, "end_line": 72, "span_ids": ["TypesSuite.test_callable_type_with_var_args"], "tokens": 173}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypesSuite(Suite):\n\n def test_callable_type_with_var_args(self) -> None:\n c = CallableType([self.x], [ARG_STAR], [None], AnyType(TypeOfAny.special_form),\n self.function)\n assert_equal(str(c), 'def (*X?) -> Any')\n\n c2 = CallableType([self.x, self.y], [ARG_POS, ARG_STAR],\n [None, None], AnyType(TypeOfAny.special_form), self.function)\n assert_equal(str(c2), 'def (X?, *Y?) -> Any')\n\n c3 = CallableType([self.x, self.y], [ARG_OPT, ARG_STAR], [None, None],\n AnyType(TypeOfAny.special_form), self.function)\n assert_equal(str(c3), 'def (X? =, *Y?) -> Any')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypesSuite.test_tuple_type_TypesSuite.test_type_variable_binding.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypesSuite.test_tuple_type_TypesSuite.test_type_variable_binding.None_1", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 74, "end_line": 83, "span_ids": ["TypesSuite.test_type_variable_binding", "TypesSuite.test_tuple_type"], "tokens": 158}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypesSuite(Suite):\n\n def test_tuple_type(self) -> None:\n assert_equal(str(TupleType([], self.fx.std_tuple)), 'Tuple[]')\n assert_equal(str(TupleType([self.x], self.fx.std_tuple)), 'Tuple[X?]')\n assert_equal(str(TupleType([self.x, AnyType(TypeOfAny.special_form)],\n self.fx.std_tuple)), 'Tuple[X?, Any]')\n\n def test_type_variable_binding(self) -> None:\n assert_equal(str(TypeVarDef('X', 'X', 1, [], self.fx.o)), 'X')\n assert_equal(str(TypeVarDef('X', 'X', 1, [self.x, self.y], self.fx.o)),\n 'X in (X?, Y?)')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypesSuite.test_generic_function_type_TypesSuite.test_type_alias_expand_once.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypesSuite.test_generic_function_type_TypesSuite.test_type_alias_expand_once.None_5", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 85, "end_line": 103, "span_ids": ["TypesSuite.test_type_alias_expand_once", "TypesSuite.test_generic_function_type"], "tokens": 252}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypesSuite(Suite):\n\n def test_generic_function_type(self) -> None:\n c = CallableType([self.x, self.y], [ARG_POS, ARG_POS], [None, None],\n self.y, self.function, name=None,\n variables=[TypeVarDef('X', 'X', -1, [], self.fx.o)])\n assert_equal(str(c), 'def [X] (X?, Y?) -> Y?')\n\n v = [TypeVarDef('Y', 'Y', -1, [], self.fx.o),\n TypeVarDef('X', 'X', -2, [], self.fx.o)]\n c2 = CallableType([], [], [], NoneType(), self.function, name=None, variables=v)\n assert_equal(str(c2), 'def [Y, X] ()')\n\n def test_type_alias_expand_once(self) -> None:\n A, target = self.fx.def_alias_1(self.fx.a)\n assert get_proper_type(A) == target\n assert get_proper_type(target) == target\n\n A, target = self.fx.def_alias_2(self.fx.a)\n assert get_proper_type(A) == target\n assert get_proper_type(target) == target", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypesSuite.test_type_alias_expand_all_TypesSuite.test_indirection_no_infinite_recursion.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypesSuite.test_type_alias_expand_all_TypesSuite.test_indirection_no_infinite_recursion.None_3", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 105, "end_line": 127, "span_ids": ["TypesSuite.test_type_alias_expand_all", "TypesSuite.test_indirection_no_infinite_recursion"], "tokens": 242}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypesSuite(Suite):\n\n def test_type_alias_expand_all(self) -> None:\n A, _ = self.fx.def_alias_1(self.fx.a)\n assert A.expand_all_if_possible() is None\n A, _ = self.fx.def_alias_2(self.fx.a)\n assert A.expand_all_if_possible() is None\n\n B = self.fx.non_rec_alias(self.fx.a)\n C = self.fx.non_rec_alias(TupleType([B, B], Instance(self.fx.std_tuplei,\n [B])))\n assert C.expand_all_if_possible() == TupleType([self.fx.a, self.fx.a],\n Instance(self.fx.std_tuplei,\n [self.fx.a]))\n\n def test_indirection_no_infinite_recursion(self) -> None:\n A, _ = self.fx.def_alias_1(self.fx.a)\n visitor = TypeIndirectionVisitor()\n modules = A.accept(visitor)\n assert modules == {'__main__', 'builtins'}\n\n A, _ = self.fx.def_alias_2(self.fx.a)\n visitor = TypeIndirectionVisitor()\n modules = A.accept(visitor)\n assert modules == {'__main__', 'builtins'}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypeOpsSuite_TypeOpsSuite.test_erase_with_type_object.self_assert_erase_self_fx": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypeOpsSuite_TypeOpsSuite.test_erase_with_type_object.self_assert_erase_self_fx", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 130, "end_line": 216, "span_ids": ["TypeOpsSuite.test_erase_with_type_variable", "TypeOpsSuite.test_erase_with_generic_type_recursive", "TypeOpsSuite.setUp", "TypeOpsSuite", "TypeOpsSuite.test_expand_basic_generic_types", "TypeOpsSuite.assert_expand", "TypeOpsSuite.test_erase_with_tuple_type", "TypeOpsSuite.test_trivial_expand", "TypeOpsSuite.test_trivial_expand_recursive", "TypeOpsSuite.test_erase_with_generic_type", "TypeOpsSuite.test_expand_naked_type_var", "TypeOpsSuite.test_erase_with_function_type", "TypeOpsSuite.test_erase_with_type_object", "TypeOpsSuite.test_trivial_erase"], "tokens": 804}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeOpsSuite(Suite):\n def setUp(self) -> None:\n self.fx = TypeFixture(INVARIANT)\n self.fx_co = TypeFixture(COVARIANT)\n self.fx_contra = TypeFixture(CONTRAVARIANT)\n\n # expand_type\n\n def test_trivial_expand(self) -> None:\n for t in (self.fx.a, self.fx.o, self.fx.t, self.fx.nonet,\n self.tuple(self.fx.a),\n self.callable([], self.fx.a, self.fx.a), self.fx.anyt):\n self.assert_expand(t, [], t)\n self.assert_expand(t, [], t)\n self.assert_expand(t, [], t)\n\n def test_trivial_expand_recursive(self) -> None:\n A, _ = self.fx.def_alias_1(self.fx.a)\n self.assert_expand(A, [], A)\n A, _ = self.fx.def_alias_2(self.fx.a)\n self.assert_expand(A, [], A)\n\n def test_expand_naked_type_var(self) -> None:\n self.assert_expand(self.fx.t, [(self.fx.t.id, self.fx.a)], self.fx.a)\n self.assert_expand(self.fx.t, [(self.fx.s.id, self.fx.a)], self.fx.t)\n\n def test_expand_basic_generic_types(self) -> None:\n self.assert_expand(self.fx.gt, [(self.fx.t.id, self.fx.a)], self.fx.ga)\n\n # IDEA: Add test cases for\n # tuple types\n # callable types\n # multiple arguments\n\n def assert_expand(self,\n orig: Type,\n map_items: List[Tuple[TypeVarId, Type]],\n result: Type,\n ) -> None:\n lower_bounds = {}\n\n for id, t in map_items:\n lower_bounds[id] = t\n\n exp = expand_type(orig, lower_bounds)\n # Remove erased tags (asterisks).\n assert_equal(str(exp).replace('*', ''), str(result))\n\n # erase_type\n\n def test_trivial_erase(self) -> None:\n for t in (self.fx.a, self.fx.o, self.fx.nonet, self.fx.anyt):\n self.assert_erase(t, t)\n\n def test_erase_with_type_variable(self) -> None:\n self.assert_erase(self.fx.t, self.fx.anyt)\n\n def test_erase_with_generic_type(self) -> None:\n self.assert_erase(self.fx.ga, self.fx.gdyn)\n self.assert_erase(self.fx.hab,\n Instance(self.fx.hi, [self.fx.anyt, self.fx.anyt]))\n\n def test_erase_with_generic_type_recursive(self) -> None:\n tuple_any = Instance(self.fx.std_tuplei, [AnyType(TypeOfAny.explicit)])\n A, _ = self.fx.def_alias_1(self.fx.a)\n self.assert_erase(A, tuple_any)\n A, _ = self.fx.def_alias_2(self.fx.a)\n self.assert_erase(A, UnionType([self.fx.a, tuple_any]))\n\n def test_erase_with_tuple_type(self) -> None:\n self.assert_erase(self.tuple(self.fx.a), self.fx.std_tuple)\n\n def test_erase_with_function_type(self) -> None:\n self.assert_erase(self.fx.callable(self.fx.a, self.fx.b),\n CallableType(arg_types=[self.fx.anyt, self.fx.anyt],\n arg_kinds=[ARG_STAR, ARG_STAR2],\n arg_names=[None, None],\n ret_type=self.fx.anyt,\n fallback=self.fx.function))\n\n def test_erase_with_type_object(self) -> None:\n self.assert_erase(self.fx.callable_type(self.fx.a, self.fx.b),\n CallableType(arg_types=[self.fx.anyt, self.fx.anyt],\n arg_kinds=[ARG_STAR, ARG_STAR2],\n arg_names=[None, None],\n ret_type=self.fx.anyt,\n fallback=self.fx.type_type))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypeOpsSuite.test_erase_with_type_type_TypeOpsSuite._is_proper_subtype": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypeOpsSuite.test_erase_with_type_type_TypeOpsSuite._is_proper_subtype", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 218, "end_line": 241, "span_ids": ["TypeOpsSuite.test_erase_with_type_type", "TypeOpsSuite.assert_erase", "TypeOpsSuite.test_is_more_precise"], "tokens": 249}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeOpsSuite(Suite):\n\n def test_erase_with_type_type(self) -> None:\n self.assert_erase(self.fx.type_a, self.fx.type_a)\n self.assert_erase(self.fx.type_t, self.fx.type_any)\n\n def assert_erase(self, orig: Type, result: Type) -> None:\n assert_equal(str(erase_type(orig)), str(result))\n\n # is_more_precise\n\n def test_is_more_precise(self) -> None:\n fx = self.fx\n assert_true(is_more_precise(fx.b, fx.a))\n assert_true(is_more_precise(fx.b, fx.b))\n assert_true(is_more_precise(fx.b, fx.b))\n assert_true(is_more_precise(fx.b, fx.anyt))\n assert_true(is_more_precise(self.tuple(fx.b, fx.a),\n self.tuple(fx.b, fx.a)))\n assert_true(is_more_precise(self.tuple(fx.b, fx.b),\n self.tuple(fx.b, fx.a)))\n\n assert_false(is_more_precise(fx.a, fx.b))\n assert_false(is_more_precise(fx.anyt, fx.b))\n\n # is_proper_subtype", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypeOpsSuite.test_is_proper_subtype_TypeOpsSuite.test_is_proper_subtype.None_17": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypeOpsSuite.test_is_proper_subtype_TypeOpsSuite.test_is_proper_subtype.None_17", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 243, "end_line": 270, "span_ids": ["TypeOpsSuite.test_is_proper_subtype"], "tokens": 320}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeOpsSuite(Suite):\n\n def test_is_proper_subtype(self) -> None:\n fx = self.fx\n\n assert_true(is_proper_subtype(fx.a, fx.a))\n assert_true(is_proper_subtype(fx.b, fx.a))\n assert_true(is_proper_subtype(fx.b, fx.o))\n assert_true(is_proper_subtype(fx.b, fx.o))\n\n assert_false(is_proper_subtype(fx.a, fx.b))\n assert_false(is_proper_subtype(fx.o, fx.b))\n\n assert_true(is_proper_subtype(fx.anyt, fx.anyt))\n assert_false(is_proper_subtype(fx.a, fx.anyt))\n assert_false(is_proper_subtype(fx.anyt, fx.a))\n\n assert_true(is_proper_subtype(fx.ga, fx.ga))\n assert_true(is_proper_subtype(fx.gdyn, fx.gdyn))\n assert_false(is_proper_subtype(fx.ga, fx.gdyn))\n assert_false(is_proper_subtype(fx.gdyn, fx.ga))\n\n assert_true(is_proper_subtype(fx.t, fx.t))\n assert_false(is_proper_subtype(fx.t, fx.s))\n\n assert_true(is_proper_subtype(fx.a, UnionType([fx.a, fx.b])))\n assert_true(is_proper_subtype(UnionType([fx.a, fx.b]),\n UnionType([fx.a, fx.b, fx.c])))\n assert_false(is_proper_subtype(UnionType([fx.a, fx.b]),\n UnionType([fx.b, fx.c])))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypeOpsSuite.test_is_proper_subtype_covariance_TypeOpsSuite.test_is_proper_subtype_invariance.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypeOpsSuite.test_is_proper_subtype_covariance_TypeOpsSuite.test_is_proper_subtype_invariance.None_4", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 272, "end_line": 297, "span_ids": ["TypeOpsSuite.test_is_proper_subtype_covariance", "TypeOpsSuite.test_is_proper_subtype_contravariance", "TypeOpsSuite.test_is_proper_subtype_invariance"], "tokens": 324}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeOpsSuite(Suite):\n\n def test_is_proper_subtype_covariance(self) -> None:\n fx_co = self.fx_co\n\n assert_true(is_proper_subtype(fx_co.gsab, fx_co.gb))\n assert_true(is_proper_subtype(fx_co.gsab, fx_co.ga))\n assert_false(is_proper_subtype(fx_co.gsaa, fx_co.gb))\n assert_true(is_proper_subtype(fx_co.gb, fx_co.ga))\n assert_false(is_proper_subtype(fx_co.ga, fx_co.gb))\n\n def test_is_proper_subtype_contravariance(self) -> None:\n fx_contra = self.fx_contra\n\n assert_true(is_proper_subtype(fx_contra.gsab, fx_contra.gb))\n assert_false(is_proper_subtype(fx_contra.gsab, fx_contra.ga))\n assert_true(is_proper_subtype(fx_contra.gsaa, fx_contra.gb))\n assert_false(is_proper_subtype(fx_contra.gb, fx_contra.ga))\n assert_true(is_proper_subtype(fx_contra.ga, fx_contra.gb))\n\n def test_is_proper_subtype_invariance(self) -> None:\n fx = self.fx\n\n assert_true(is_proper_subtype(fx.gsab, fx.gb))\n assert_false(is_proper_subtype(fx.gsab, fx.ga))\n assert_false(is_proper_subtype(fx.gsaa, fx.gb))\n assert_false(is_proper_subtype(fx.gb, fx.ga))\n assert_false(is_proper_subtype(fx.ga, fx.gb))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypeOpsSuite.test_is_proper_subtype_and_subtype_literal_types_TypeOpsSuite.test_is_proper_subtype_and_subtype_literal_types.None_19": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypeOpsSuite.test_is_proper_subtype_and_subtype_literal_types_TypeOpsSuite.test_is_proper_subtype_and_subtype_literal_types.None_19", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 299, "end_line": 328, "span_ids": ["TypeOpsSuite.test_is_proper_subtype_and_subtype_literal_types"], "tokens": 341}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeOpsSuite(Suite):\n\n def test_is_proper_subtype_and_subtype_literal_types(self) -> None:\n fx = self.fx\n\n lit1 = LiteralType(1, fx.a)\n lit2 = LiteralType(\"foo\", fx.d)\n lit3 = LiteralType(\"bar\", fx.d)\n\n assert_true(is_proper_subtype(lit1, fx.a))\n assert_false(is_proper_subtype(lit1, fx.d))\n assert_false(is_proper_subtype(fx.a, lit1))\n assert_true(is_proper_subtype(fx.uninhabited, lit1))\n assert_false(is_proper_subtype(lit1, fx.uninhabited))\n assert_true(is_proper_subtype(lit1, lit1))\n assert_false(is_proper_subtype(lit1, lit2))\n assert_false(is_proper_subtype(lit2, lit3))\n\n assert_true(is_subtype(lit1, fx.a))\n assert_false(is_subtype(lit1, fx.d))\n assert_false(is_subtype(fx.a, lit1))\n assert_true(is_subtype(fx.uninhabited, lit1))\n assert_false(is_subtype(lit1, fx.uninhabited))\n assert_true(is_subtype(lit1, lit1))\n assert_false(is_subtype(lit1, lit2))\n assert_false(is_subtype(lit2, lit3))\n\n assert_false(is_proper_subtype(lit1, fx.anyt))\n assert_false(is_proper_subtype(fx.anyt, lit1))\n\n assert_true(is_subtype(lit1, fx.anyt))\n assert_true(is_subtype(fx.anyt, lit1))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypeOpsSuite.test_subtype_aliases_TypeOpsSuite.test_subtype_aliases.None_9": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypeOpsSuite.test_subtype_aliases_TypeOpsSuite.test_subtype_aliases.None_9", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 330, "end_line": 349, "span_ids": ["TypeOpsSuite.test_subtype_aliases"], "tokens": 225}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeOpsSuite(Suite):\n\n def test_subtype_aliases(self) -> None:\n A1, _ = self.fx.def_alias_1(self.fx.a)\n AA1, _ = self.fx.def_alias_1(self.fx.a)\n assert_true(is_subtype(A1, AA1))\n assert_true(is_subtype(AA1, A1))\n\n A2, _ = self.fx.def_alias_2(self.fx.a)\n AA2, _ = self.fx.def_alias_2(self.fx.a)\n assert_true(is_subtype(A2, AA2))\n assert_true(is_subtype(AA2, A2))\n\n B1, _ = self.fx.def_alias_1(self.fx.b)\n B2, _ = self.fx.def_alias_2(self.fx.b)\n assert_true(is_subtype(B1, A1))\n assert_true(is_subtype(B2, A2))\n assert_false(is_subtype(A1, B1))\n assert_false(is_subtype(A2, B2))\n\n assert_false(is_subtype(A2, A1))\n assert_true(is_subtype(A1, A2))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypeOpsSuite._can_be_true_can_be_fa_TypeOpsSuite.test_true_only_of_instance.assert_true_self_fx_a_can": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypeOpsSuite._can_be_true_can_be_fa_TypeOpsSuite.test_true_only_of_instance.assert_true_self_fx_a_can", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 351, "end_line": 398, "span_ids": ["TypeOpsSuite.test_true_only_of_true_type_is_idempotent", "TypeOpsSuite.test_subtype_aliases", "TypeOpsSuite.test_true_only_of_instance", "TypeOpsSuite.test_empty_tuple_always_false", "TypeOpsSuite.test_union_can_not_be_false_if_none_false", "TypeOpsSuite.test_nonempty_tuple_always_true", "TypeOpsSuite.test_union_can_be_true_if_any_true", "TypeOpsSuite.test_union_can_not_be_true_if_none_true", "TypeOpsSuite.test_union_can_be_false_if_any_false", "TypeOpsSuite.test_true_only_of_false_type_is_uninhabited"], "tokens": 449}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeOpsSuite(Suite):\n\n # can_be_true / can_be_false\n\n def test_empty_tuple_always_false(self) -> None:\n tuple_type = self.tuple()\n assert_true(tuple_type.can_be_false)\n assert_false(tuple_type.can_be_true)\n\n def test_nonempty_tuple_always_true(self) -> None:\n tuple_type = self.tuple(AnyType(TypeOfAny.special_form),\n AnyType(TypeOfAny.special_form))\n assert_true(tuple_type.can_be_true)\n assert_false(tuple_type.can_be_false)\n\n def test_union_can_be_true_if_any_true(self) -> None:\n union_type = UnionType([self.fx.a, self.tuple()])\n assert_true(union_type.can_be_true)\n\n def test_union_can_not_be_true_if_none_true(self) -> None:\n union_type = UnionType([self.tuple(), self.tuple()])\n assert_false(union_type.can_be_true)\n\n def test_union_can_be_false_if_any_false(self) -> None:\n union_type = UnionType([self.fx.a, self.tuple()])\n assert_true(union_type.can_be_false)\n\n def test_union_can_not_be_false_if_none_false(self) -> None:\n union_type = UnionType([self.tuple(self.fx.a), self.tuple(self.fx.d)])\n assert_false(union_type.can_be_false)\n\n # true_only / false_only\n\n def test_true_only_of_false_type_is_uninhabited(self) -> None:\n to = true_only(NoneType())\n assert_type(UninhabitedType, to)\n\n def test_true_only_of_true_type_is_idempotent(self) -> None:\n always_true = self.tuple(AnyType(TypeOfAny.special_form))\n to = true_only(always_true)\n assert_true(always_true is to)\n\n def test_true_only_of_instance(self) -> None:\n to = true_only(self.fx.a)\n assert_equal(str(to), \"A\")\n assert_true(to.can_be_true)\n assert_false(to.can_be_false)\n assert_type(Instance, to)\n # The original class still can be false\n assert_true(self.fx.a.can_be_false)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypeOpsSuite.test_true_only_of_union_TypeOpsSuite.test_true_only_of_union.assert_true_to_items_1_i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypeOpsSuite.test_true_only_of_union_TypeOpsSuite.test_true_only_of_union.assert_true_to_items_1_i", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 400, "end_line": 410, "span_ids": ["TypeOpsSuite.test_true_only_of_union"], "tokens": 140}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeOpsSuite(Suite):\n\n def test_true_only_of_union(self) -> None:\n tup_type = self.tuple(AnyType(TypeOfAny.special_form))\n # Union of something that is unknown, something that is always true, something\n # that is always false\n union_type = UnionType([self.fx.a, tup_type, self.tuple()])\n to = true_only(union_type)\n assert isinstance(to, UnionType)\n assert_equal(len(to.items), 2)\n assert_true(to.items[0].can_be_true)\n assert_false(to.items[0].can_be_false)\n assert_true(to.items[1] is tup_type)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypeOpsSuite.test_false_only_of_true_type_is_uninhabited_TypeOpsSuite.test_false_only_of_instance.assert_true_self_fx_a_can": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypeOpsSuite.test_false_only_of_true_type_is_uninhabited_TypeOpsSuite.test_false_only_of_instance.assert_true_self_fx_a_can", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 412, "end_line": 437, "span_ids": ["TypeOpsSuite.test_false_only_tuple", "TypeOpsSuite.test_false_only_of_true_type_is_uninhabited", "TypeOpsSuite.test_false_only_of_false_type_is_idempotent", "TypeOpsSuite.test_false_only_of_instance"], "tokens": 247}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeOpsSuite(Suite):\n\n def test_false_only_of_true_type_is_uninhabited(self) -> None:\n with strict_optional_set(True):\n fo = false_only(self.tuple(AnyType(TypeOfAny.special_form)))\n assert_type(UninhabitedType, fo)\n\n def test_false_only_tuple(self) -> None:\n with strict_optional_set(False):\n fo = false_only(self.tuple(self.fx.a))\n assert_equal(fo, NoneType())\n with strict_optional_set(True):\n fo = false_only(self.tuple(self.fx.a))\n assert_equal(fo, UninhabitedType())\n\n def test_false_only_of_false_type_is_idempotent(self) -> None:\n always_false = NoneType()\n fo = false_only(always_false)\n assert_true(always_false is fo)\n\n def test_false_only_of_instance(self) -> None:\n fo = false_only(self.fx.a)\n assert_equal(str(fo), \"A\")\n assert_false(fo.can_be_true)\n assert_true(fo.can_be_false)\n assert_type(Instance, fo)\n # The original class still can be true\n assert_true(self.fx.a.can_be_true)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypeOpsSuite.test_false_only_of_union_TypeOpsSuite.tuple.return.TupleType_list_a_self_f": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypeOpsSuite.test_false_only_of_union_TypeOpsSuite.tuple.return.TupleType_list_a_self_f", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 439, "end_line": 457, "span_ids": ["TypeOpsSuite.tuple", "TypeOpsSuite.test_false_only_of_union"], "tokens": 195}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeOpsSuite(Suite):\n\n def test_false_only_of_union(self) -> None:\n with strict_optional_set(True):\n tup_type = self.tuple()\n # Union of something that is unknown, something that is always true, something\n # that is always false\n union_type = UnionType([self.fx.a, self.tuple(AnyType(TypeOfAny.special_form)),\n tup_type])\n assert_equal(len(union_type.items), 3)\n fo = false_only(union_type)\n assert isinstance(fo, UnionType)\n assert_equal(len(fo.items), 2)\n assert_false(fo.items[0].can_be_true)\n assert_true(fo.items[0].can_be_false)\n assert_true(fo.items[1] is tup_type)\n\n # Helpers\n\n def tuple(self, *a: Type) -> TupleType:\n return TupleType(list(a), self.fx.std_tuple)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypeOpsSuite.callable_TypeOpsSuite.callable.return.CallableType_list_a_1_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_TypeOpsSuite.callable_TypeOpsSuite.callable.return.CallableType_list_a_1_", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 459, "end_line": 475, "span_ids": ["TypeOpsSuite.callable"], "tokens": 169}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeOpsSuite(Suite):\n\n def callable(self, vars: List[str], *a: Type) -> CallableType:\n \"\"\"callable(args, a1, ..., an, r) constructs a callable with\n argument types a1, ... an and return type r and type arguments\n vars.\n \"\"\"\n tv = [] # type: List[TypeVarDef]\n n = -1\n for v in vars:\n tv.append(TypeVarDef(v, v, n, [], self.fx.o))\n n -= 1\n return CallableType(list(a[:-1]),\n [ARG_POS] * (len(a) - 1),\n [None] * (len(a) - 1),\n a[-1],\n self.fx.function,\n name=None,\n variables=tv)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite_JoinSuite.test_class_subtyping.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite_JoinSuite.test_class_subtyping.None_4", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 478, "end_line": 491, "span_ids": ["JoinSuite.test_trivial_cases", "JoinSuite.setUp", "JoinSuite", "JoinSuite.test_class_subtyping"], "tokens": 150}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class JoinSuite(Suite):\n def setUp(self) -> None:\n self.fx = TypeFixture()\n\n def test_trivial_cases(self) -> None:\n for simple in self.fx.a, self.fx.o, self.fx.b:\n self.assert_join(simple, simple, simple)\n\n def test_class_subtyping(self) -> None:\n self.assert_join(self.fx.a, self.fx.o, self.fx.o)\n self.assert_join(self.fx.b, self.fx.o, self.fx.o)\n self.assert_join(self.fx.a, self.fx.d, self.fx.o)\n self.assert_join(self.fx.b, self.fx.c, self.fx.a)\n self.assert_join(self.fx.b, self.fx.d, self.fx.o)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite.test_tuples_JoinSuite.test_tuples.None_6": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite.test_tuples_JoinSuite.test_tuples.None_6", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 493, "end_line": 513, "span_ids": ["JoinSuite.test_tuples"], "tokens": 213}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class JoinSuite(Suite):\n\n def test_tuples(self) -> None:\n self.assert_join(self.tuple(), self.tuple(), self.tuple())\n self.assert_join(self.tuple(self.fx.a),\n self.tuple(self.fx.a),\n self.tuple(self.fx.a))\n self.assert_join(self.tuple(self.fx.b, self.fx.c),\n self.tuple(self.fx.a, self.fx.d),\n self.tuple(self.fx.a, self.fx.o))\n\n self.assert_join(self.tuple(self.fx.a, self.fx.a),\n self.fx.std_tuple,\n self.var_tuple(self.fx.anyt))\n self.assert_join(self.tuple(self.fx.a),\n self.tuple(self.fx.a, self.fx.a),\n self.var_tuple(self.fx.a))\n self.assert_join(self.tuple(self.fx.b),\n self.tuple(self.fx.a, self.fx.c),\n self.var_tuple(self.fx.a))\n self.assert_join(self.tuple(),\n self.tuple(self.fx.a),\n self.var_tuple(self.fx.a))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite.test_var_tuples_JoinSuite.test_function_types.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite.test_var_tuples_JoinSuite.test_function_types.None_4", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 515, "end_line": 542, "span_ids": ["JoinSuite.test_var_tuples", "JoinSuite.test_function_types"], "tokens": 278}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class JoinSuite(Suite):\n\n def test_var_tuples(self) -> None:\n self.assert_join(self.tuple(self.fx.a),\n self.var_tuple(self.fx.a),\n self.var_tuple(self.fx.a))\n self.assert_join(self.var_tuple(self.fx.a),\n self.tuple(self.fx.a),\n self.var_tuple(self.fx.a))\n self.assert_join(self.var_tuple(self.fx.a),\n self.tuple(),\n self.var_tuple(self.fx.a))\n\n def test_function_types(self) -> None:\n self.assert_join(self.callable(self.fx.a, self.fx.b),\n self.callable(self.fx.a, self.fx.b),\n self.callable(self.fx.a, self.fx.b))\n\n self.assert_join(self.callable(self.fx.a, self.fx.b),\n self.callable(self.fx.b, self.fx.b),\n self.callable(self.fx.b, self.fx.b))\n self.assert_join(self.callable(self.fx.a, self.fx.b),\n self.callable(self.fx.a, self.fx.a),\n self.callable(self.fx.a, self.fx.a))\n self.assert_join(self.callable(self.fx.a, self.fx.b),\n self.fx.function,\n self.fx.function)\n self.assert_join(self.callable(self.fx.a, self.fx.b),\n self.callable(self.fx.d, self.fx.b),\n self.fx.function)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite.test_type_vars_JoinSuite.test_none.for_t_in_NoneType_sel.self_assert_join_t_NoneT": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite.test_type_vars_JoinSuite.test_none.for_t_in_NoneType_sel.self_assert_join_t_NoneT", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 544, "end_line": 554, "span_ids": ["JoinSuite.test_type_vars", "JoinSuite.test_none"], "tokens": 144}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class JoinSuite(Suite):\n\n def test_type_vars(self) -> None:\n self.assert_join(self.fx.t, self.fx.t, self.fx.t)\n self.assert_join(self.fx.s, self.fx.s, self.fx.s)\n self.assert_join(self.fx.t, self.fx.s, self.fx.o)\n\n def test_none(self) -> None:\n # Any type t joined with None results in t.\n for t in [NoneType(), self.fx.a, self.fx.o, UnboundType('x'),\n self.fx.t, self.tuple(),\n self.callable(self.fx.a, self.fx.b), self.fx.anyt]:\n self.assert_join(t, NoneType(), t)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite.test_unbound_type_JoinSuite.test_unbound_type.for_t_in_self_fx_a_self.self_assert_join_t_Unbou": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite.test_unbound_type_JoinSuite.test_unbound_type.for_t_in_self_fx_a_self.self_assert_join_t_Unbou", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 556, "end_line": 565, "span_ids": ["JoinSuite.test_unbound_type"], "tokens": 161}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class JoinSuite(Suite):\n\n def test_unbound_type(self) -> None:\n self.assert_join(UnboundType('x'), UnboundType('x'), self.fx.anyt)\n self.assert_join(UnboundType('x'), UnboundType('y'), self.fx.anyt)\n\n # Any type t joined with an unbound type results in dynamic. Unbound\n # type means that there is an error somewhere in the program, so this\n # does not affect type safety (whatever the result).\n for t in [self.fx.a, self.fx.o, self.fx.ga, self.fx.t, self.tuple(),\n self.callable(self.fx.a, self.fx.b)]:\n self.assert_join(t, UnboundType('X'), self.fx.anyt)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite.test_any_type_JoinSuite.test_mixed_truth_restricted_type.assert_true_j_can_be_fals": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite.test_any_type_JoinSuite.test_mixed_truth_restricted_type.assert_true_j_can_be_fals", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 567, "end_line": 588, "span_ids": ["JoinSuite.test_any_type", "JoinSuite.test_mixed_truth_restricted_type_simple", "JoinSuite.test_mixed_truth_restricted_type"], "tokens": 253}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class JoinSuite(Suite):\n\n def test_any_type(self) -> None:\n # Join against 'Any' type always results in 'Any'.\n for t in [self.fx.anyt, self.fx.a, self.fx.o, NoneType(),\n UnboundType('x'), self.fx.t, self.tuple(),\n self.callable(self.fx.a, self.fx.b)]:\n self.assert_join(t, self.fx.anyt, self.fx.anyt)\n\n def test_mixed_truth_restricted_type_simple(self) -> None:\n # join_simple against differently restricted truthiness types drops restrictions.\n true_a = true_only(self.fx.a)\n false_o = false_only(self.fx.o)\n j = join_simple(self.fx.o, true_a, false_o)\n assert_true(j.can_be_true)\n assert_true(j.can_be_false)\n\n def test_mixed_truth_restricted_type(self) -> None:\n # join_types against differently restricted truthiness types drops restrictions.\n true_any = true_only(AnyType(TypeOfAny.special_form))\n false_o = false_only(self.fx.o)\n j = join_types(true_any, false_o)\n assert_true(j.can_be_true)\n assert_true(j.can_be_false)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite.test_other_mixed_types_JoinSuite.test_other_mixed_types.for_t1_in_self_fx_a_sel.for_t2_in_self_fx_a_sel.if_str_t1_str_t2_.self_assert_join_t1_t2_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite.test_other_mixed_types_JoinSuite.test_other_mixed_types.for_t1_in_self_fx_a_sel.for_t2_in_self_fx_a_sel.if_str_t1_str_t2_.self_assert_join_t1_t2_", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 590, "end_line": 597, "span_ids": ["JoinSuite.test_other_mixed_types"], "tokens": 116}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class JoinSuite(Suite):\n\n def test_other_mixed_types(self) -> None:\n # In general, joining unrelated types produces object.\n for t1 in [self.fx.a, self.fx.t, self.tuple(),\n self.callable(self.fx.a, self.fx.b)]:\n for t2 in [self.fx.a, self.fx.t, self.tuple(),\n self.callable(self.fx.a, self.fx.b)]:\n if str(t1) != str(t2):\n self.assert_join(t1, t2, self.fx.o)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite.test_simple_generics_JoinSuite.test_simple_generics.for_t_in_self_fx_a_self.self_assert_join_t_self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite.test_simple_generics_JoinSuite.test_simple_generics.for_t_in_self_fx_a_self.self_assert_join_t_self_", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 599, "end_line": 610, "span_ids": ["JoinSuite.test_simple_generics"], "tokens": 167}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class JoinSuite(Suite):\n\n def test_simple_generics(self) -> None:\n self.assert_join(self.fx.ga, self.fx.ga, self.fx.ga)\n self.assert_join(self.fx.ga, self.fx.gb, self.fx.ga)\n self.assert_join(self.fx.ga, self.fx.gd, self.fx.o)\n self.assert_join(self.fx.ga, self.fx.g2a, self.fx.o)\n\n self.assert_join(self.fx.ga, self.fx.nonet, self.fx.ga)\n self.assert_join(self.fx.ga, self.fx.anyt, self.fx.anyt)\n\n for t in [self.fx.a, self.fx.o, self.fx.t, self.tuple(),\n self.callable(self.fx.a, self.fx.b)]:\n self.assert_join(t, self.fx.ga, self.fx.o)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite.test_generics_with_multiple_args_JoinSuite.test_callables_with_any.self_assert_join_self_cal": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite.test_generics_with_multiple_args_JoinSuite.test_callables_with_any.self_assert_join_self_cal", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 612, "end_line": 636, "span_ids": ["JoinSuite.test_generics_with_multiple_args", "JoinSuite.test_callables_with_any", "JoinSuite.test_generic_types_and_any", "JoinSuite.test_generics_with_inheritance_and_shared_supertype", "JoinSuite.test_generics_with_inheritance"], "tokens": 328}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class JoinSuite(Suite):\n\n def test_generics_with_multiple_args(self) -> None:\n self.assert_join(self.fx.hab, self.fx.hab, self.fx.hab)\n self.assert_join(self.fx.hab, self.fx.hbb, self.fx.hab)\n self.assert_join(self.fx.had, self.fx.haa, self.fx.o)\n\n def test_generics_with_inheritance(self) -> None:\n self.assert_join(self.fx.gsab, self.fx.gb, self.fx.gb)\n self.assert_join(self.fx.gsba, self.fx.gb, self.fx.ga)\n self.assert_join(self.fx.gsab, self.fx.gd, self.fx.o)\n\n def test_generics_with_inheritance_and_shared_supertype(self) -> None:\n self.assert_join(self.fx.gsba, self.fx.gs2a, self.fx.ga)\n self.assert_join(self.fx.gsab, self.fx.gs2a, self.fx.ga)\n self.assert_join(self.fx.gsab, self.fx.gs2d, self.fx.o)\n\n def test_generic_types_and_any(self) -> None:\n self.assert_join(self.fx.gdyn, self.fx.ga, self.fx.gdyn)\n\n def test_callables_with_any(self) -> None:\n self.assert_join(self.callable(self.fx.a, self.fx.a, self.fx.anyt,\n self.fx.a),\n self.callable(self.fx.a, self.fx.anyt, self.fx.a,\n self.fx.anyt),\n self.callable(self.fx.a, self.fx.anyt, self.fx.anyt,\n self.fx.anyt))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite.test_overloaded_JoinSuite.test_overloaded.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite.test_overloaded_JoinSuite.test_overloaded.None_5", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 638, "end_line": 654, "span_ids": ["JoinSuite.test_overloaded"], "tokens": 214}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class JoinSuite(Suite):\n\n def test_overloaded(self) -> None:\n c = self.callable\n\n def ov(*items: CallableType) -> Overloaded:\n return Overloaded(list(items))\n\n fx = self.fx\n func = fx.function\n c1 = c(fx.a, fx.a)\n c2 = c(fx.b, fx.b)\n c3 = c(fx.c, fx.c)\n self.assert_join(ov(c1, c2), c1, c1)\n self.assert_join(ov(c1, c2), c2, c2)\n self.assert_join(ov(c1, c2), ov(c1, c2), ov(c1, c2))\n self.assert_join(ov(c1, c2), ov(c1, c3), c1)\n self.assert_join(ov(c2, c1), ov(c3, c1), c1)\n self.assert_join(ov(c1, c2), c3, func)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite.test_overloaded_with_any_JoinSuite.test_overloaded_with_any.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite.test_overloaded_with_any_JoinSuite.test_overloaded_with_any.None_1", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 656, "end_line": 665, "span_ids": ["JoinSuite.test_overloaded_with_any"], "tokens": 126}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class JoinSuite(Suite):\n\n def test_overloaded_with_any(self) -> None:\n c = self.callable\n\n def ov(*items: CallableType) -> Overloaded:\n return Overloaded(list(items))\n\n fx = self.fx\n any = fx.anyt\n self.assert_join(ov(c(fx.a, fx.a), c(fx.b, fx.b)), c(any, fx.b), c(any, fx.b))\n self.assert_join(ov(c(fx.a, fx.a), c(any, fx.b)), c(fx.b, fx.b), c(any, fx.b))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite.test_join_interface_types_JoinSuite.test_generic_interfaces.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite.test_join_interface_types_JoinSuite.test_generic_interfaces.None_3", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 667, "end_line": 697, "span_ids": ["JoinSuite.test_generic_interfaces", "JoinSuite.test_join_interface_and_class_types", "JoinSuite.test_join_interface_types", "JoinSuite.test_join_class_types_with_interface_result"], "tokens": 288}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class JoinSuite(Suite):\n\n @skip\n def test_join_interface_types(self) -> None:\n self.assert_join(self.fx.f, self.fx.f, self.fx.f)\n self.assert_join(self.fx.f, self.fx.f2, self.fx.o)\n self.assert_join(self.fx.f, self.fx.f3, self.fx.f)\n\n @skip\n def test_join_interface_and_class_types(self) -> None:\n self.assert_join(self.fx.o, self.fx.f, self.fx.o)\n self.assert_join(self.fx.a, self.fx.f, self.fx.o)\n\n self.assert_join(self.fx.e, self.fx.f, self.fx.f)\n\n @skip\n def test_join_class_types_with_interface_result(self) -> None:\n # Unique result\n self.assert_join(self.fx.e, self.fx.e2, self.fx.f)\n\n # Ambiguous result\n self.assert_join(self.fx.e2, self.fx.e3, self.fx.anyt)\n\n @skip\n def test_generic_interfaces(self) -> None:\n fx = InterfaceTypeFixture()\n\n self.assert_join(fx.gfa, fx.gfa, fx.gfa)\n self.assert_join(fx.gfa, fx.gfb, fx.o)\n\n self.assert_join(fx.m1, fx.gfa, fx.gfa)\n\n self.assert_join(fx.m1, fx.gfb, fx.o)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite.test_simple_type_objects_JoinSuite.test_simple_type_objects.self_assert_join_self_fx_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite.test_simple_type_objects_JoinSuite.test_simple_type_objects.self_assert_join_self_fx_", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 699, "end_line": 712, "span_ids": ["JoinSuite.test_simple_type_objects"], "tokens": 150}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class JoinSuite(Suite):\n\n def test_simple_type_objects(self) -> None:\n t1 = self.type_callable(self.fx.a, self.fx.a)\n t2 = self.type_callable(self.fx.b, self.fx.b)\n tr = self.type_callable(self.fx.b, self.fx.a)\n\n self.assert_join(t1, t1, t1)\n j = join_types(t1, t1)\n assert isinstance(j, CallableType)\n assert_true(j.is_type_obj())\n\n self.assert_join(t1, t2, tr)\n self.assert_join(t1, self.fx.type_type, self.fx.type_type)\n self.assert_join(self.fx.type_type, self.fx.type_type,\n self.fx.type_type)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite.test_type_type_JoinSuite.test_type_type.None_6": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite.test_type_type_JoinSuite.test_type_type.None_6", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 714, "end_line": 721, "span_ids": ["JoinSuite.test_type_type"], "tokens": 152}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class JoinSuite(Suite):\n\n def test_type_type(self) -> None:\n self.assert_join(self.fx.type_a, self.fx.type_b, self.fx.type_a)\n self.assert_join(self.fx.type_b, self.fx.type_any, self.fx.type_any)\n self.assert_join(self.fx.type_b, self.fx.type_type, self.fx.type_type)\n self.assert_join(self.fx.type_b, self.fx.type_c, self.fx.type_a)\n self.assert_join(self.fx.type_c, self.fx.type_d, TypeType.make_normalized(self.fx.o))\n self.assert_join(self.fx.type_type, self.fx.type_any, self.fx.type_type)\n self.assert_join(self.fx.type_b, self.fx.anyt, self.fx.anyt)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite.test_literal_type_JoinSuite.test_literal_type.None_15": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite.test_literal_type_JoinSuite.test_literal_type.None_15", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 723, "end_line": 756, "span_ids": ["JoinSuite.test_literal_type"], "tokens": 456}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class JoinSuite(Suite):\n\n def test_literal_type(self) -> None:\n a = self.fx.a\n d = self.fx.d\n lit1 = LiteralType(1, a)\n lit2 = LiteralType(2, a)\n lit3 = LiteralType(\"foo\", d)\n\n self.assert_join(lit1, lit1, lit1)\n self.assert_join(lit1, a, a)\n self.assert_join(lit1, d, self.fx.o)\n self.assert_join(lit1, lit2, a)\n self.assert_join(lit1, lit3, self.fx.o)\n self.assert_join(lit1, self.fx.anyt, self.fx.anyt)\n self.assert_join(UnionType([lit1, lit2]), lit2, UnionType([lit1, lit2]))\n self.assert_join(UnionType([lit1, lit2]), a, a)\n self.assert_join(UnionType([lit1, lit3]), a, UnionType([a, lit3]))\n self.assert_join(UnionType([d, lit3]), lit3, d)\n self.assert_join(UnionType([d, lit3]), d, UnionType([d, lit3]))\n self.assert_join(UnionType([a, lit1]), lit1, a)\n self.assert_join(UnionType([a, lit1]), lit2, a)\n self.assert_join(UnionType([lit1, lit2]),\n UnionType([lit1, lit2]),\n UnionType([lit1, lit2]))\n\n # The order in which we try joining two unions influences the\n # ordering of the items in the final produced unions. So, we\n # manually call 'assert_simple_join' and tune the output\n # after swapping the arguments here.\n self.assert_simple_join(UnionType([lit1, lit2]),\n UnionType([lit2, lit3]),\n UnionType([lit1, lit2, lit3]))\n self.assert_simple_join(UnionType([lit2, lit3]),\n UnionType([lit1, lit2]),\n UnionType([lit2, lit3, lit1]))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite._There_are_additional_te_JoinSuite.assert_simple_join.assert_true_is_subtype_t_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite._There_are_additional_te_JoinSuite.assert_simple_join.assert_true_is_subtype_t_", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 758, "end_line": 775, "span_ids": ["JoinSuite.assert_simple_join", "JoinSuite.assert_join", "JoinSuite.test_literal_type"], "tokens": 184}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class JoinSuite(Suite):\n\n # There are additional test cases in check-inference.test.\n\n # TODO: Function types + varargs and default args.\n\n def assert_join(self, s: Type, t: Type, join: Type) -> None:\n self.assert_simple_join(s, t, join)\n self.assert_simple_join(t, s, join)\n\n def assert_simple_join(self, s: Type, t: Type, join: Type) -> None:\n result = join_types(s, t)\n actual = str(result)\n expected = str(join)\n assert_equal(actual, expected,\n 'join({}, {}) == {{}} ({{}} expected)'.format(s, t))\n assert_true(is_subtype(s, result),\n '{} not subtype of {}'.format(s, result))\n assert_true(is_subtype(t, result),\n '{} not subtype of {}'.format(t, result))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite.tuple_JoinSuite.type_callable.return.CallableType_list_a_1_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_JoinSuite.tuple_JoinSuite.type_callable.return.CallableType_list_a_1_", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 777, "end_line": 799, "span_ids": ["JoinSuite.tuple", "JoinSuite.type_callable", "JoinSuite.callable", "JoinSuite.var_tuple"], "tokens": 249}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class JoinSuite(Suite):\n\n def tuple(self, *a: Type) -> TupleType:\n return TupleType(list(a), self.fx.std_tuple)\n\n def var_tuple(self, t: Type) -> Instance:\n \"\"\"Construct a variable-length tuple type\"\"\"\n return Instance(self.fx.std_tuplei, [t])\n\n def callable(self, *a: Type) -> CallableType:\n \"\"\"callable(a1, ..., an, r) constructs a callable with argument types\n a1, ... an and return type r.\n \"\"\"\n n = len(a) - 1\n return CallableType(list(a[:-1]), [ARG_POS] * n, [None] * n,\n a[-1], self.fx.function)\n\n def type_callable(self, *a: Type) -> CallableType:\n \"\"\"type_callable(a1, ..., an, r) constructs a callable with\n argument types a1, ... an and return type r, and which\n represents a type.\n \"\"\"\n n = len(a) - 1\n return CallableType(list(a[:-1]), [ARG_POS] * n, [None] * n,\n a[-1], self.fx.type_type)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_MeetSuite_MeetSuite.test_class_subtyping.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_MeetSuite_MeetSuite.test_class_subtyping.None_4", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 802, "end_line": 815, "span_ids": ["MeetSuite.test_class_subtyping", "MeetSuite.test_trivial_cases", "MeetSuite", "MeetSuite.setUp"], "tokens": 154}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MeetSuite(Suite):\n def setUp(self) -> None:\n self.fx = TypeFixture()\n\n def test_trivial_cases(self) -> None:\n for simple in self.fx.a, self.fx.o, self.fx.b:\n self.assert_meet(simple, simple, simple)\n\n def test_class_subtyping(self) -> None:\n self.assert_meet(self.fx.a, self.fx.o, self.fx.a)\n self.assert_meet(self.fx.a, self.fx.b, self.fx.b)\n self.assert_meet(self.fx.b, self.fx.o, self.fx.b)\n self.assert_meet(self.fx.a, self.fx.d, NoneType())\n self.assert_meet(self.fx.b, self.fx.c, NoneType())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_MeetSuite.test_tuples_MeetSuite.test_tuples.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_MeetSuite.test_tuples_MeetSuite.test_tuples.None_4", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 817, "end_line": 831, "span_ids": ["MeetSuite.test_tuples"], "tokens": 161}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MeetSuite(Suite):\n\n def test_tuples(self) -> None:\n self.assert_meet(self.tuple(), self.tuple(), self.tuple())\n self.assert_meet(self.tuple(self.fx.a),\n self.tuple(self.fx.a),\n self.tuple(self.fx.a))\n self.assert_meet(self.tuple(self.fx.b, self.fx.c),\n self.tuple(self.fx.a, self.fx.d),\n self.tuple(self.fx.b, NoneType()))\n\n self.assert_meet(self.tuple(self.fx.a, self.fx.a),\n self.fx.std_tuple,\n self.tuple(self.fx.a, self.fx.a))\n self.assert_meet(self.tuple(self.fx.a),\n self.tuple(self.fx.a, self.fx.a),\n NoneType())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_MeetSuite.test_function_types_MeetSuite.test_function_types.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_MeetSuite.test_function_types_MeetSuite.test_function_types.None_2", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 833, "end_line": 843, "span_ids": ["MeetSuite.test_function_types"], "tokens": 136}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MeetSuite(Suite):\n\n def test_function_types(self) -> None:\n self.assert_meet(self.callable(self.fx.a, self.fx.b),\n self.callable(self.fx.a, self.fx.b),\n self.callable(self.fx.a, self.fx.b))\n\n self.assert_meet(self.callable(self.fx.a, self.fx.b),\n self.callable(self.fx.b, self.fx.b),\n self.callable(self.fx.a, self.fx.b))\n self.assert_meet(self.callable(self.fx.a, self.fx.b),\n self.callable(self.fx.a, self.fx.a),\n self.callable(self.fx.a, self.fx.b))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_MeetSuite.test_type_vars_MeetSuite.test_none.for_t_in_self_fx_a_self.self_assert_meet_t_NoneT": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_MeetSuite.test_type_vars_MeetSuite.test_none.for_t_in_self_fx_a_self.self_assert_meet_t_NoneT", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 845, "end_line": 858, "span_ids": ["MeetSuite.test_none", "MeetSuite.test_type_vars"], "tokens": 175}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MeetSuite(Suite):\n\n def test_type_vars(self) -> None:\n self.assert_meet(self.fx.t, self.fx.t, self.fx.t)\n self.assert_meet(self.fx.s, self.fx.s, self.fx.s)\n self.assert_meet(self.fx.t, self.fx.s, NoneType())\n\n def test_none(self) -> None:\n self.assert_meet(NoneType(), NoneType(), NoneType())\n\n self.assert_meet(NoneType(), self.fx.anyt, NoneType())\n\n # Any type t joined with None results in None, unless t is Any.\n for t in [self.fx.a, self.fx.o, UnboundType('x'), self.fx.t,\n self.tuple(), self.callable(self.fx.a, self.fx.b)]:\n self.assert_meet(t, NoneType(), NoneType())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_MeetSuite.test_unbound_type_MeetSuite.test_dynamic_type.for_t_in_self_fx_anyt_s.self_assert_meet_t_self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_MeetSuite.test_unbound_type_MeetSuite.test_dynamic_type.for_t_in_self_fx_anyt_s.self_assert_meet_t_self_", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 860, "end_line": 878, "span_ids": ["MeetSuite.test_dynamic_type", "MeetSuite.test_unbound_type"], "tokens": 262}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MeetSuite(Suite):\n\n def test_unbound_type(self) -> None:\n self.assert_meet(UnboundType('x'), UnboundType('x'), self.fx.anyt)\n self.assert_meet(UnboundType('x'), UnboundType('y'), self.fx.anyt)\n\n self.assert_meet(UnboundType('x'), self.fx.anyt, UnboundType('x'))\n\n # The meet of any type t with an unbound type results in dynamic.\n # Unbound type means that there is an error somewhere in the program,\n # so this does not affect type safety.\n for t in [self.fx.a, self.fx.o, self.fx.t, self.tuple(),\n self.callable(self.fx.a, self.fx.b)]:\n self.assert_meet(t, UnboundType('X'), self.fx.anyt)\n\n def test_dynamic_type(self) -> None:\n # Meet against dynamic type always results in dynamic.\n for t in [self.fx.anyt, self.fx.a, self.fx.o, NoneType(),\n UnboundType('x'), self.fx.t, self.tuple(),\n self.callable(self.fx.a, self.fx.b)]:\n self.assert_meet(t, self.fx.anyt, t)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_MeetSuite.test_simple_generics_MeetSuite.test_simple_generics.for_t_in_self_fx_a_self.self_assert_meet_t_self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_MeetSuite.test_simple_generics_MeetSuite.test_simple_generics.for_t_in_self_fx_a_self.self_assert_meet_t_self_", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 880, "end_line": 892, "span_ids": ["MeetSuite.test_simple_generics"], "tokens": 190}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MeetSuite(Suite):\n\n def test_simple_generics(self) -> None:\n self.assert_meet(self.fx.ga, self.fx.ga, self.fx.ga)\n self.assert_meet(self.fx.ga, self.fx.o, self.fx.ga)\n self.assert_meet(self.fx.ga, self.fx.gb, self.fx.gb)\n self.assert_meet(self.fx.ga, self.fx.gd, self.fx.nonet)\n self.assert_meet(self.fx.ga, self.fx.g2a, self.fx.nonet)\n\n self.assert_meet(self.fx.ga, self.fx.nonet, self.fx.nonet)\n self.assert_meet(self.fx.ga, self.fx.anyt, self.fx.ga)\n\n for t in [self.fx.a, self.fx.t, self.tuple(),\n self.callable(self.fx.a, self.fx.b)]:\n self.assert_meet(t, self.fx.ga, self.fx.nonet)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_MeetSuite.test_generics_with_multiple_args_MeetSuite.test_meet_with_generic_interfaces.self_assert_meet_fx_gfb_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_MeetSuite.test_generics_with_multiple_args_MeetSuite.test_meet_with_generic_interfaces.self_assert_meet_fx_gfb_", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 894, "end_line": 941, "span_ids": ["MeetSuite.test_meet_with_generic_interfaces", "MeetSuite.test_generic_types_and_dynamic", "MeetSuite.test_callables_with_dynamic", "MeetSuite.test_meet_interface_and_class_types", "MeetSuite.test_generics_with_multiple_args", "MeetSuite.test_generics_with_inheritance", "MeetSuite.test_meet_interface_types", "MeetSuite.test_generics_with_inheritance_and_shared_supertype", "MeetSuite.test_meet_class_types_with_shared_interfaces"], "tokens": 612}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MeetSuite(Suite):\n\n def test_generics_with_multiple_args(self) -> None:\n self.assert_meet(self.fx.hab, self.fx.hab, self.fx.hab)\n self.assert_meet(self.fx.hab, self.fx.haa, self.fx.hab)\n self.assert_meet(self.fx.hab, self.fx.had, self.fx.nonet)\n self.assert_meet(self.fx.hab, self.fx.hbb, self.fx.hbb)\n\n def test_generics_with_inheritance(self) -> None:\n self.assert_meet(self.fx.gsab, self.fx.gb, self.fx.gsab)\n self.assert_meet(self.fx.gsba, self.fx.gb, self.fx.nonet)\n\n def test_generics_with_inheritance_and_shared_supertype(self) -> None:\n self.assert_meet(self.fx.gsba, self.fx.gs2a, self.fx.nonet)\n self.assert_meet(self.fx.gsab, self.fx.gs2a, self.fx.nonet)\n\n def test_generic_types_and_dynamic(self) -> None:\n self.assert_meet(self.fx.gdyn, self.fx.ga, self.fx.ga)\n\n def test_callables_with_dynamic(self) -> None:\n self.assert_meet(self.callable(self.fx.a, self.fx.a, self.fx.anyt,\n self.fx.a),\n self.callable(self.fx.a, self.fx.anyt, self.fx.a,\n self.fx.anyt),\n self.callable(self.fx.a, self.fx.anyt, self.fx.anyt,\n self.fx.anyt))\n\n def test_meet_interface_types(self) -> None:\n self.assert_meet(self.fx.f, self.fx.f, self.fx.f)\n self.assert_meet(self.fx.f, self.fx.f2, self.fx.nonet)\n self.assert_meet(self.fx.f, self.fx.f3, self.fx.f3)\n\n def test_meet_interface_and_class_types(self) -> None:\n self.assert_meet(self.fx.o, self.fx.f, self.fx.f)\n self.assert_meet(self.fx.a, self.fx.f, self.fx.nonet)\n\n self.assert_meet(self.fx.e, self.fx.f, self.fx.e)\n\n def test_meet_class_types_with_shared_interfaces(self) -> None:\n # These have nothing special with respect to meets, unlike joins. These\n # are for completeness only.\n self.assert_meet(self.fx.e, self.fx.e2, self.fx.nonet)\n self.assert_meet(self.fx.e2, self.fx.e3, self.fx.nonet)\n\n @skip\n def test_meet_with_generic_interfaces(self) -> None:\n fx = InterfaceTypeFixture()\n self.assert_meet(fx.gfa, fx.m1, fx.m1)\n self.assert_meet(fx.gfa, fx.gfa, fx.gfa)\n self.assert_meet(fx.gfb, fx.m1, fx.nonet)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_MeetSuite.test_type_type_MeetSuite.test_type_type.None_6": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_MeetSuite.test_type_type_MeetSuite.test_type_type.None_6", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 943, "end_line": 950, "span_ids": ["MeetSuite.test_type_type"], "tokens": 156}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MeetSuite(Suite):\n\n def test_type_type(self) -> None:\n self.assert_meet(self.fx.type_a, self.fx.type_b, self.fx.type_b)\n self.assert_meet(self.fx.type_b, self.fx.type_any, self.fx.type_b)\n self.assert_meet(self.fx.type_b, self.fx.type_type, self.fx.type_b)\n self.assert_meet(self.fx.type_b, self.fx.type_c, self.fx.nonet)\n self.assert_meet(self.fx.type_c, self.fx.type_d, self.fx.nonet)\n self.assert_meet(self.fx.type_type, self.fx.type_any, self.fx.type_any)\n self.assert_meet(self.fx.type_b, self.fx.anyt, self.fx.type_b)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_MeetSuite.test_literal_type_MeetSuite.test_literal_type.None_10": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_MeetSuite.test_literal_type_MeetSuite.test_literal_type.None_10", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 952, "end_line": 970, "span_ids": ["MeetSuite.test_literal_type"], "tokens": 278}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MeetSuite(Suite):\n\n def test_literal_type(self) -> None:\n a = self.fx.a\n d = self.fx.d\n lit1 = LiteralType(1, a)\n lit2 = LiteralType(2, a)\n lit3 = LiteralType(\"foo\", d)\n\n self.assert_meet(lit1, lit1, lit1)\n self.assert_meet(lit1, a, lit1)\n self.assert_meet_uninhabited(lit1, lit3)\n self.assert_meet_uninhabited(lit1, lit2)\n self.assert_meet(UnionType([lit1, lit2]), lit1, lit1)\n self.assert_meet(UnionType([lit1, lit2]), UnionType([lit2, lit3]), lit2)\n self.assert_meet(UnionType([lit1, lit2]), UnionType([lit1, lit2]), UnionType([lit1, lit2]))\n self.assert_meet(lit1, self.fx.anyt, lit1)\n self.assert_meet(lit1, self.fx.o, lit1)\n\n assert_true(is_same_type(lit1, narrow_declared_type(lit1, a)))\n assert_true(is_same_type(lit2, narrow_declared_type(lit2, a)))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_MeetSuite._FIX_generic_interfaces__MeetSuite.assert_meet.self_assert_simple_meet_t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_MeetSuite._FIX_generic_interfaces__MeetSuite.assert_meet.self_assert_simple_meet_t", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 972, "end_line": 982, "span_ids": ["MeetSuite.assert_meet_uninhabited", "MeetSuite.assert_meet", "MeetSuite.test_literal_type"], "tokens": 126}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MeetSuite(Suite):\n\n # FIX generic interfaces + ranges\n\n def assert_meet_uninhabited(self, s: Type, t: Type) -> None:\n with strict_optional_set(False):\n self.assert_meet(s, t, self.fx.nonet)\n with strict_optional_set(True):\n self.assert_meet(s, t, self.fx.uninhabited)\n\n def assert_meet(self, s: Type, t: Type, meet: Type) -> None:\n self.assert_simple_meet(s, t, meet)\n self.assert_simple_meet(t, s, meet)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_MeetSuite.assert_simple_meet_MeetSuite.assert_simple_meet.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_MeetSuite.assert_simple_meet_MeetSuite.assert_simple_meet.None_2", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 984, "end_line": 993, "span_ids": ["MeetSuite.assert_simple_meet"], "tokens": 117}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MeetSuite(Suite):\n\n def assert_simple_meet(self, s: Type, t: Type, meet: Type) -> None:\n result = meet_types(s, t)\n actual = str(result)\n expected = str(meet)\n assert_equal(actual, expected,\n 'meet({}, {}) == {{}} ({{}} expected)'.format(s, t))\n assert_true(is_subtype(result, s),\n '{} not subtype of {}'.format(result, s))\n assert_true(is_subtype(result, t),\n '{} not subtype of {}'.format(result, t))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_MeetSuite.tuple_MeetSuite.callable.return.CallableType_list_a_1_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_MeetSuite.tuple_MeetSuite.callable.return.CallableType_list_a_1_", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 995, "end_line": 1005, "span_ids": ["MeetSuite.tuple", "MeetSuite.callable"], "tokens": 119}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MeetSuite(Suite):\n\n def tuple(self, *a: Type) -> TupleType:\n return TupleType(list(a), self.fx.std_tuple)\n\n def callable(self, *a: Type) -> CallableType:\n \"\"\"callable(a1, ..., an, r) constructs a callable with argument types\n a1, ... an and return type r.\n \"\"\"\n n = len(a) - 1\n return CallableType(list(a[:-1]),\n [ARG_POS] * n, [None] * n,\n a[-1], self.fx.function)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_SameTypeSuite_SameTypeSuite.test_literal_type.None_7": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_SameTypeSuite_SameTypeSuite.test_literal_type.None_7", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 1008, "end_line": 1028, "span_ids": ["SameTypeSuite", "SameTypeSuite.test_literal_type", "SameTypeSuite.setUp"], "tokens": 209}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SameTypeSuite(Suite):\n def setUp(self) -> None:\n self.fx = TypeFixture()\n\n def test_literal_type(self) -> None:\n b = self.fx.b # Reminder: b is a subclass of a\n d = self.fx.d\n\n lit1 = LiteralType(1, b)\n lit2 = LiteralType(2, b)\n lit3 = LiteralType(\"foo\", d)\n\n self.assert_same(lit1, lit1)\n self.assert_same(UnionType([lit1, lit2]), UnionType([lit1, lit2]))\n self.assert_same(UnionType([lit1, lit2]), UnionType([lit2, lit1]))\n self.assert_not_same(lit1, b)\n self.assert_not_same(lit1, lit2)\n self.assert_not_same(lit1, lit3)\n\n self.assert_not_same(lit1, self.fx.anyt)\n self.assert_not_same(lit1, self.fx.nonet)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_SameTypeSuite.assert_same_SameTypeSuite.assert_not_same.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_SameTypeSuite.assert_same_SameTypeSuite.assert_not_same.None_1", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 1030, "end_line": 1036, "span_ids": ["SameTypeSuite.assert_not_same", "SameTypeSuite.assert_same"], "tokens": 120}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SameTypeSuite(Suite):\n\n def assert_same(self, s: Type, t: Type, strict: bool = True) -> None:\n self.assert_simple_is_same(s, t, expected=True, strict=strict)\n self.assert_simple_is_same(t, s, expected=True, strict=strict)\n\n def assert_not_same(self, s: Type, t: Type, strict: bool = True) -> None:\n self.assert_simple_is_same(s, t, False, strict=strict)\n self.assert_simple_is_same(t, s, False, strict=strict)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_SameTypeSuite.assert_simple_is_same_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testtypes.py_SameTypeSuite.assert_simple_is_same_", "embedding": null, "metadata": {"file_path": "mypy/test/testtypes.py", "file_name": "testtypes.py", "file_type": "text/x-python", "category": "test", "start_line": 1038, "end_line": 1049, "span_ids": ["SameTypeSuite.assert_simple_is_same"], "tokens": 148}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SameTypeSuite(Suite):\n\n def assert_simple_is_same(self, s: Type, t: Type, expected: bool, strict: bool) -> None:\n actual = is_same_type(s, t)\n assert_equal(actual, expected,\n 'is_same_type({}, {}) is {{}} ({{}} expected)'.format(s, t))\n\n if strict:\n actual2 = (s == t)\n assert_equal(actual2, expected,\n '({} == {}) is {{}} ({{}} expected)'.format(s, t))\n assert_equal(hash(s) == hash(t), expected,\n '(hash({}) == hash({}) is {{}} ({{}} expected)'.format(s, t))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/typefixture.py__Fixture_used_in_type_r_TypeFixture": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/typefixture.py__Fixture_used_in_type_r_TypeFixture", "embedding": null, "metadata": {"file_path": "mypy/test/typefixture.py", "file_name": "typefixture.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 260, "span_ids": ["TypeFixture", "docstring"], "tokens": 117}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Fixture used in type-related test cases.\n\nIt contains class TypeInfos and Type objects.\n\"\"\"\n\nfrom typing import List, Optional, Tuple\n\nfrom mypy.types import (\n Type, TypeVarType, AnyType, NoneType, Instance, CallableType, TypeVarDef, TypeType,\n UninhabitedType, TypeOfAny, TypeAliasType, UnionType\n)\nfrom mypy.nodes import (\n TypeInfo, ClassDef, Block, ARG_POS, ARG_OPT, ARG_STAR, SymbolTable,\n COVARIANT, TypeAlias\n)\n\n\nclass TypeFixture:", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/typefixture.py_TypeFixture._Helper_class_that_is_u_TypeFixture.__init__._H_B_B_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/typefixture.py_TypeFixture._Helper_class_that_is_u_TypeFixture.__init__._H_B_B_", "embedding": null, "metadata": {"file_path": "mypy/test/typefixture.py", "file_name": "typefixture.py", "file_type": "text/x-python", "category": "test", "start_line": 19, "end_line": 145, "span_ids": ["TypeFixture", "TypeFixture.__init__"], "tokens": 1695}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeFixture:\n \"\"\"Helper class that is used as a fixture in type-related unit tests.\n\n The members are initialized to contain various type-related values.\n \"\"\"\n\n def __init__(self, variance: int = COVARIANT) -> None:\n # The 'object' class\n self.oi = self.make_type_info('builtins.object') # class object\n self.o = Instance(self.oi, []) # object\n\n # Type variables (these are effectively global)\n\n def make_type_var(name: str, id: int, values: List[Type], upper_bound: Type,\n variance: int) -> TypeVarType:\n return TypeVarType(TypeVarDef(name, name, id, values, upper_bound, variance))\n\n self.t = make_type_var('T', 1, [], self.o, variance) # T`1 (type variable)\n self.tf = make_type_var('T', -1, [], self.o, variance) # T`-1 (type variable)\n self.tf2 = make_type_var('T', -2, [], self.o, variance) # T`-2 (type variable)\n self.s = make_type_var('S', 2, [], self.o, variance) # S`2 (type variable)\n self.s1 = make_type_var('S', 1, [], self.o, variance) # S`1 (type variable)\n self.sf = make_type_var('S', -2, [], self.o, variance) # S`-2 (type variable)\n self.sf1 = make_type_var('S', -1, [], self.o, variance) # S`-1 (type variable)\n\n # Simple types\n self.anyt = AnyType(TypeOfAny.special_form)\n self.nonet = NoneType()\n self.uninhabited = UninhabitedType()\n\n # Abstract class TypeInfos\n\n # class F\n self.fi = self.make_type_info('F', is_abstract=True)\n\n # class F2\n self.f2i = self.make_type_info('F2', is_abstract=True)\n\n # class F3(F)\n self.f3i = self.make_type_info('F3', is_abstract=True, mro=[self.fi])\n\n # Class TypeInfos\n self.std_tuplei = self.make_type_info('builtins.tuple',\n mro=[self.oi],\n typevars=['T'],\n variances=[COVARIANT]) # class tuple\n self.type_typei = self.make_type_info('builtins.type') # class type\n self.functioni = self.make_type_info('builtins.function') # function TODO\n self.ai = self.make_type_info('A', mro=[self.oi]) # class A\n self.bi = self.make_type_info('B', mro=[self.ai, self.oi]) # class B(A)\n self.ci = self.make_type_info('C', mro=[self.ai, self.oi]) # class C(A)\n self.di = self.make_type_info('D', mro=[self.oi]) # class D\n # class E(F)\n self.ei = self.make_type_info('E', mro=[self.fi, self.oi])\n # class E2(F2, F)\n self.e2i = self.make_type_info('E2', mro=[self.f2i, self.fi, self.oi])\n # class E3(F, F2)\n self.e3i = self.make_type_info('E3', mro=[self.fi, self.f2i, self.oi])\n\n # Generic class TypeInfos\n # G[T]\n self.gi = self.make_type_info('G', mro=[self.oi],\n typevars=['T'],\n variances=[variance])\n # G2[T]\n self.g2i = self.make_type_info('G2', mro=[self.oi],\n typevars=['T'],\n variances=[variance])\n # H[S, T]\n self.hi = self.make_type_info('H', mro=[self.oi],\n typevars=['S', 'T'],\n variances=[variance, variance])\n # GS[T, S] <: G[S]\n self.gsi = self.make_type_info('GS', mro=[self.gi, self.oi],\n typevars=['T', 'S'],\n variances=[variance, variance],\n bases=[Instance(self.gi, [self.s])])\n # GS2[S] <: G[S]\n self.gs2i = self.make_type_info('GS2', mro=[self.gi, self.oi],\n typevars=['S'],\n variances=[variance],\n bases=[Instance(self.gi, [self.s1])])\n # list[T]\n self.std_listi = self.make_type_info('builtins.list', mro=[self.oi],\n typevars=['T'],\n variances=[variance])\n\n # Instance types\n self.std_tuple = Instance(self.std_tuplei, [self.anyt]) # tuple\n self.type_type = Instance(self.type_typei, []) # type\n self.function = Instance(self.functioni, []) # function TODO\n self.a = Instance(self.ai, []) # A\n self.b = Instance(self.bi, []) # B\n self.c = Instance(self.ci, []) # C\n self.d = Instance(self.di, []) # D\n\n self.e = Instance(self.ei, []) # E\n self.e2 = Instance(self.e2i, []) # E2\n self.e3 = Instance(self.e3i, []) # E3\n\n self.f = Instance(self.fi, []) # F\n self.f2 = Instance(self.f2i, []) # F2\n self.f3 = Instance(self.f3i, []) # F3\n\n # Generic instance types\n self.ga = Instance(self.gi, [self.a]) # G[A]\n self.gb = Instance(self.gi, [self.b]) # G[B]\n self.gd = Instance(self.gi, [self.d]) # G[D]\n self.go = Instance(self.gi, [self.o]) # G[object]\n self.gt = Instance(self.gi, [self.t]) # G[T`1]\n self.gtf = Instance(self.gi, [self.tf]) # G[T`-1]\n self.gtf2 = Instance(self.gi, [self.tf2]) # G[T`-2]\n self.gs = Instance(self.gi, [self.s]) # G[S]\n self.gdyn = Instance(self.gi, [self.anyt]) # G[Any]\n\n self.g2a = Instance(self.g2i, [self.a]) # G2[A]\n\n self.gsaa = Instance(self.gsi, [self.a, self.a]) # GS[A, A]\n self.gsab = Instance(self.gsi, [self.a, self.b]) # GS[A, B]\n self.gsba = Instance(self.gsi, [self.b, self.a]) # GS[B, A]\n\n self.gs2a = Instance(self.gs2i, [self.a]) # GS2[A]\n self.gs2b = Instance(self.gs2i, [self.b]) # GS2[B]\n self.gs2d = Instance(self.gs2i, [self.d]) # GS2[D]\n\n self.hab = Instance(self.hi, [self.a, self.b]) # H[A, B]\n self.haa = Instance(self.hi, [self.a, self.a]) # H[A, A]\n self.hbb = Instance(self.hi, [self.b, self.b]) # H[B, B]\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/typefixture.py_TypeFixture.__init__.self.hts_TypeFixture.__init__.self.type_any.TypeType_make_normalized_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/typefixture.py_TypeFixture.__init__.self.hts_TypeFixture.__init__.self.type_any.TypeType_make_normalized_", "embedding": null, "metadata": {"file_path": "mypy/test/typefixture.py", "file_name": "typefixture.py", "file_type": "text/x-python", "category": "test", "start_line": 146, "end_line": 157, "span_ids": ["TypeFixture.__init__"], "tokens": 189}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeFixture:\n\n def __init__(self, variance: int = COVARIANT) -> None:\n # ... other code\n self.hts = Instance(self.hi, [self.t, self.s]) # H[T, S]\n self.had = Instance(self.hi, [self.a, self.d]) # H[A, D]\n\n self.lsta = Instance(self.std_listi, [self.a]) # List[A]\n self.lstb = Instance(self.std_listi, [self.b]) # List[B]\n\n self.type_a = TypeType.make_normalized(self.a)\n self.type_b = TypeType.make_normalized(self.b)\n self.type_c = TypeType.make_normalized(self.c)\n self.type_d = TypeType.make_normalized(self.d)\n self.type_t = TypeType.make_normalized(self.t)\n self.type_any = TypeType.make_normalized(self.anyt)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/typefixture.py_TypeFixture._Helper_methods_TypeFixture.callable_type.return.CallableType_list_a_1_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/typefixture.py_TypeFixture._Helper_methods_TypeFixture.callable_type.return.CallableType_list_a_1_", "embedding": null, "metadata": {"file_path": "mypy/test/typefixture.py", "file_name": "typefixture.py", "file_type": "text/x-python", "category": "test", "start_line": 159, "end_line": 174, "span_ids": ["TypeFixture.callable", "TypeFixture.__init__", "TypeFixture.callable_type"], "tokens": 194}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeFixture:\n\n # Helper methods\n\n def callable(self, *a: Type) -> CallableType:\n \"\"\"callable(a1, ..., an, r) constructs a callable with argument types\n a1, ... an and return type r.\n \"\"\"\n return CallableType(list(a[:-1]), [ARG_POS] * (len(a) - 1),\n [None] * (len(a) - 1), a[-1], self.function)\n\n def callable_type(self, *a: Type) -> CallableType:\n \"\"\"callable_type(a1, ..., an, r) constructs a callable with\n argument types a1, ... an and return type r, and which\n represents a type.\n \"\"\"\n return CallableType(list(a[:-1]), [ARG_POS] * (len(a) - 1),\n [None] * (len(a) - 1), a[-1], self.type_type)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/typefixture.py_TypeFixture.callable_default_TypeFixture.callable_default.return.CallableType_list_a_1_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/typefixture.py_TypeFixture.callable_default_TypeFixture.callable_default.return.CallableType_list_a_1_", "embedding": null, "metadata": {"file_path": "mypy/test/typefixture.py", "file_name": "typefixture.py", "file_type": "text/x-python", "category": "test", "start_line": 176, "end_line": 185, "span_ids": ["TypeFixture.callable_default"], "tokens": 121}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeFixture:\n\n def callable_default(self, min_args: int, *a: Type) -> CallableType:\n \"\"\"callable_default(min_args, a1, ..., an, r) constructs a\n callable with argument types a1, ... an and return type r,\n with min_args mandatory fixed arguments.\n \"\"\"\n n = len(a) - 1\n return CallableType(list(a[:-1]),\n [ARG_POS] * min_args + [ARG_OPT] * (n - min_args),\n [None] * n,\n a[-1], self.function)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/typefixture.py_TypeFixture.callable_var_arg_TypeFixture.callable_var_arg.return.CallableType_list_a_1_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/typefixture.py_TypeFixture.callable_var_arg_TypeFixture.callable_var_arg.return.CallableType_list_a_1_", "embedding": null, "metadata": {"file_path": "mypy/test/typefixture.py", "file_name": "typefixture.py", "file_type": "text/x-python", "category": "test", "start_line": 187, "end_line": 196, "span_ids": ["TypeFixture.callable_var_arg"], "tokens": 125}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeFixture:\n\n def callable_var_arg(self, min_args: int, *a: Type) -> CallableType:\n \"\"\"callable_var_arg(min_args, a1, ..., an, r) constructs a callable\n with argument types a1, ... *an and return type r.\n \"\"\"\n n = len(a) - 1\n return CallableType(list(a[:-1]),\n [ARG_POS] * min_args +\n [ARG_OPT] * (n - 1 - min_args) +\n [ARG_STAR], [None] * n,\n a[-1], self.function)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/typefixture.py_TypeFixture.make_type_info_TypeFixture.make_type_info.return.info": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/typefixture.py_TypeFixture.make_type_info_TypeFixture.make_type_info.return.info", "embedding": null, "metadata": {"file_path": "mypy/test/typefixture.py", "file_name": "typefixture.py", "file_type": "text/x-python", "category": "test", "start_line": 198, "end_line": 240, "span_ids": ["TypeFixture.make_type_info"], "tokens": 347}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeFixture:\n\n def make_type_info(self, name: str,\n module_name: Optional[str] = None,\n is_abstract: bool = False,\n mro: Optional[List[TypeInfo]] = None,\n bases: Optional[List[Instance]] = None,\n typevars: Optional[List[str]] = None,\n variances: Optional[List[int]] = None) -> TypeInfo:\n \"\"\"Make a TypeInfo suitable for use in unit tests.\"\"\"\n\n class_def = ClassDef(name, Block([]), None, [])\n class_def.fullname = name\n\n if module_name is None:\n if '.' in name:\n module_name = name.rsplit('.', 1)[0]\n else:\n module_name = '__main__'\n\n if typevars:\n v = [] # type: List[TypeVarDef]\n for id, n in enumerate(typevars, 1):\n if variances:\n variance = variances[id - 1]\n else:\n variance = COVARIANT\n v.append(TypeVarDef(n, n, id, [], self.o, variance=variance))\n class_def.type_vars = v\n\n info = TypeInfo(SymbolTable(), class_def, module_name)\n if mro is None:\n mro = []\n if name != 'builtins.object':\n mro.append(self.oi)\n info.mro = [info] + mro\n if bases is None:\n if mro:\n # By default, assume that there is a single non-generic base.\n bases = [Instance(mro[0], [])]\n else:\n bases = []\n info.bases = bases\n\n return info", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/typefixture.py_TypeFixture.def_alias_1_TypeFixture.non_rec_alias.return.TypeAliasType_AN_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/typefixture.py_TypeFixture.def_alias_1_TypeFixture.non_rec_alias.return.TypeAliasType_AN_", "embedding": null, "metadata": {"file_path": "mypy/test/typefixture.py", "file_name": "typefixture.py", "file_type": "text/x-python", "category": "test", "start_line": 242, "end_line": 260, "span_ids": ["TypeFixture.non_rec_alias", "TypeFixture.def_alias_1", "TypeFixture.def_alias_2"], "tokens": 232}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeFixture:\n\n def def_alias_1(self, base: Instance) -> Tuple[TypeAliasType, Type]:\n A = TypeAliasType(None, [])\n target = Instance(self.std_tuplei,\n [UnionType([base, A])]) # A = Tuple[Union[base, A], ...]\n AN = TypeAlias(target, '__main__.A', -1, -1)\n A.alias = AN\n return A, target\n\n def def_alias_2(self, base: Instance) -> Tuple[TypeAliasType, Type]:\n A = TypeAliasType(None, [])\n target = UnionType([base,\n Instance(self.std_tuplei, [A])]) # A = Union[base, Tuple[A, ...]]\n AN = TypeAlias(target, '__main__.A', -1, -1)\n A.alias = AN\n return A, target\n\n def non_rec_alias(self, target: Type) -> TypeAliasType:\n AN = TypeAlias(target, '__main__.A', -1, -1)\n return TypeAliasType(AN, [])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/typefixture.py_InterfaceTypeFixture_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/typefixture.py_InterfaceTypeFixture_", "embedding": null, "metadata": {"file_path": "mypy/test/typefixture.py", "file_name": "typefixture.py", "file_type": "text/x-python", "category": "test", "start_line": 263, "end_line": 282, "span_ids": ["InterfaceTypeFixture.__init__", "InterfaceTypeFixture"], "tokens": 169}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class InterfaceTypeFixture(TypeFixture):\n \"\"\"Extension of TypeFixture that contains additional generic\n interface types.\"\"\"\n\n def __init__(self) -> None:\n super().__init__()\n # GF[T]\n self.gfi = self.make_type_info('GF', typevars=['T'], is_abstract=True)\n\n # M1 <: GF[A]\n self.m1i = self.make_type_info('M1',\n is_abstract=True,\n mro=[self.gfi, self.oi],\n bases=[Instance(self.gfi, [self.a])])\n\n self.gfa = Instance(self.gfi, [self.a]) # GF[A]\n self.gfb = Instance(self.gfi, [self.b]) # GF[B]\n\n self.m1 = Instance(self.m1i, []) # M1", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/visitors.py__Visitor_classes_pulled_from_mypy_types_import_Ty": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/visitors.py__Visitor_classes_pulled_from_mypy_types_import_Ty", "embedding": null, "metadata": {"file_path": "mypy/test/visitors.py", "file_name": "visitors.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 17, "span_ids": ["docstring"], "tokens": 104}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Visitor classes pulled out from different tests\n\nThese are here because we don't currently support having interpreted\nclasses subtype compiled ones but pytest grabs the python file\neven if the test was compiled.\n\n\"\"\"\n\nfrom typing import Set\n\nfrom mypy.nodes import (\n NameExpr, TypeVarExpr, CallExpr, Expression, MypyFile, AssignmentStmt, IntExpr\n)\nfrom mypy.traverser import TraverserVisitor\n\nfrom mypy.treetransform import TransformVisitor\nfrom mypy.types import Type", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/visitors.py__from_testtypegen_SkippedNodeSearcher.skip_if_typing.if_self_is_typing_.self_nodes_add_n_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/visitors.py__from_testtypegen_SkippedNodeSearcher.skip_if_typing.if_self_is_typing_.self_nodes_add_n_", "embedding": null, "metadata": {"file_path": "mypy/test/visitors.py", "file_name": "visitors.py", "file_type": "text/x-python", "category": "test", "start_line": 20, "end_line": 45, "span_ids": ["SkippedNodeSearcher.visit_assignment_stmt", "SkippedNodeSearcher.__init__", "SkippedNodeSearcher.skip_if_typing", "SkippedNodeSearcher.visit_mypy_file", "SkippedNodeSearcher.visit_name_expr", "SkippedNodeSearcher", "SkippedNodeSearcher.visit_int_expr", "docstring"], "tokens": 231}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# from testtypegen\nclass SkippedNodeSearcher(TraverserVisitor):\n def __init__(self) -> None:\n self.nodes = set() # type: Set[Expression]\n self.is_typing = False\n\n def visit_mypy_file(self, f: MypyFile) -> None:\n self.is_typing = f.fullname == 'typing' or f.fullname == 'builtins'\n super().visit_mypy_file(f)\n\n def visit_assignment_stmt(self, s: AssignmentStmt) -> None:\n if s.type or ignore_node(s.rvalue):\n for lvalue in s.lvalues:\n if isinstance(lvalue, NameExpr):\n self.nodes.add(lvalue)\n super().visit_assignment_stmt(s)\n\n def visit_name_expr(self, n: NameExpr) -> None:\n self.skip_if_typing(n)\n\n def visit_int_expr(self, n: IntExpr) -> None:\n self.skip_if_typing(n)\n\n def skip_if_typing(self, n: Expression) -> None:\n if self.is_typing:\n self.nodes.add(n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/visitors.py_ignore_node_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/visitors.py_ignore_node_", "embedding": null, "metadata": {"file_path": "mypy/test/visitors.py", "file_name": "visitors.py", "file_type": "text/x-python", "category": "test", "start_line": 48, "end_line": 72, "span_ids": ["TypeAssertTransformVisitor.type", "ignore_node", "TypeAssertTransformVisitor"], "tokens": 199}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def ignore_node(node: Expression) -> bool:\n \"\"\"Return True if node is to be omitted from test case output.\"\"\"\n\n # We want to get rid of object() expressions in the typing module stub\n # and also TypeVar(...) expressions. Since detecting whether a node comes\n # from the typing module is not easy, we just to strip them all away.\n if isinstance(node, TypeVarExpr):\n return True\n if isinstance(node, NameExpr) and node.fullname == 'builtins.object':\n return True\n if isinstance(node, NameExpr) and node.fullname == 'builtins.None':\n return True\n if isinstance(node, CallExpr) and (ignore_node(node.callee) or\n node.analyzed):\n return True\n\n return False\n\n\n# from testtransform\nclass TypeAssertTransformVisitor(TransformVisitor):\n def type(self, type: Type) -> Type:\n assert type is not None\n return type", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/traverser.py__Generic_node_traverser_from_mypy_nodes_import_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/traverser.py__Generic_node_traverser_from_mypy_nodes_import_", "embedding": null, "metadata": {"file_path": "mypy/traverser.py", "file_name": "traverser.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 17, "span_ids": ["docstring"], "tokens": 221}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Generic node traverser visitor\"\"\"\n\nfrom typing import List\nfrom mypy_extensions import mypyc_attr\n\nfrom mypy.visitor import NodeVisitor\nfrom mypy.nodes import (\n Block, MypyFile, FuncBase, FuncItem, CallExpr, ClassDef, Decorator, FuncDef,\n ExpressionStmt, AssignmentStmt, OperatorAssignmentStmt, WhileStmt,\n ForStmt, ReturnStmt, AssertStmt, DelStmt, IfStmt, RaiseStmt,\n TryStmt, WithStmt, NameExpr, MemberExpr, OpExpr, SliceExpr, CastExpr, RevealExpr,\n UnaryExpr, ListExpr, TupleExpr, DictExpr, SetExpr, IndexExpr, AssignmentExpr,\n GeneratorExpr, ListComprehension, SetComprehension, DictionaryComprehension,\n ConditionalExpr, TypeApplication, ExecStmt, Import, ImportFrom,\n LambdaExpr, ComparisonExpr, OverloadedFuncDef, YieldFromExpr,\n YieldExpr, StarExpr, BackquoteExpr, AwaitExpr, PrintStmt, SuperExpr, Node, REVEAL_TYPE,\n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/traverser.py_TraverserVisitor_TraverserVisitor.visit_raise_stmt.if_o_from_expr_is_not_Non.o_from_expr_accept_self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/traverser.py_TraverserVisitor_TraverserVisitor.visit_raise_stmt.if_o_from_expr_is_not_Non.o_from_expr_accept_self_", "embedding": null, "metadata": {"file_path": "mypy/traverser.py", "file_name": "traverser.py", "file_type": "text/x-python", "category": "implementation", "start_line": 20, "end_line": 134, "span_ids": ["TraverserVisitor", "TraverserVisitor.visit_while_stmt", "TraverserVisitor.visit_func", "TraverserVisitor.visit_assignment_stmt", "TraverserVisitor.visit_decorator", "TraverserVisitor.visit_for_stmt", "TraverserVisitor.visit_if_stmt", "TraverserVisitor.visit_mypy_file", "TraverserVisitor.visit_operator_assignment_stmt", "TraverserVisitor.visit_del_stmt", "TraverserVisitor.visit_overloaded_func_def", "TraverserVisitor.visit_expression_stmt", "TraverserVisitor.visit_class_def", "TraverserVisitor.visit_func_def", "TraverserVisitor.__init__", "TraverserVisitor.visit_raise_stmt", "TraverserVisitor.visit_return_stmt", "TraverserVisitor.visit_block", "TraverserVisitor.visit_assert_stmt"], "tokens": 787}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@mypyc_attr(allow_interpreted_subclasses=True)\nclass TraverserVisitor(NodeVisitor[None]):\n \"\"\"A parse tree visitor that traverses the parse tree during visiting.\n\n It does not perform any actions outside the traversal. Subclasses\n should override visit methods to perform actions during\n traversal. Calling the superclass method allows reusing the\n traversal implementation.\n \"\"\"\n\n def __init__(self) -> None:\n pass\n\n # Visit methods\n\n def visit_mypy_file(self, o: MypyFile) -> None:\n for d in o.defs:\n d.accept(self)\n\n def visit_block(self, block: Block) -> None:\n for s in block.body:\n s.accept(self)\n\n def visit_func(self, o: FuncItem) -> None:\n if o.arguments is not None:\n for arg in o.arguments:\n init = arg.initializer\n if init is not None:\n init.accept(self)\n\n for arg in o.arguments:\n self.visit_var(arg.variable)\n\n o.body.accept(self)\n\n def visit_func_def(self, o: FuncDef) -> None:\n self.visit_func(o)\n\n def visit_overloaded_func_def(self, o: OverloadedFuncDef) -> None:\n for item in o.items:\n item.accept(self)\n if o.impl:\n o.impl.accept(self)\n\n def visit_class_def(self, o: ClassDef) -> None:\n for d in o.decorators:\n d.accept(self)\n for base in o.base_type_exprs:\n base.accept(self)\n if o.metaclass:\n o.metaclass.accept(self)\n for v in o.keywords.values():\n v.accept(self)\n o.defs.accept(self)\n if o.analyzed:\n o.analyzed.accept(self)\n\n def visit_decorator(self, o: Decorator) -> None:\n o.func.accept(self)\n o.var.accept(self)\n for decorator in o.decorators:\n decorator.accept(self)\n\n def visit_expression_stmt(self, o: ExpressionStmt) -> None:\n o.expr.accept(self)\n\n def visit_assignment_stmt(self, o: AssignmentStmt) -> None:\n o.rvalue.accept(self)\n for l in o.lvalues:\n l.accept(self)\n\n def visit_operator_assignment_stmt(self, o: OperatorAssignmentStmt) -> None:\n o.rvalue.accept(self)\n o.lvalue.accept(self)\n\n def visit_while_stmt(self, o: WhileStmt) -> None:\n o.expr.accept(self)\n o.body.accept(self)\n if o.else_body:\n o.else_body.accept(self)\n\n def visit_for_stmt(self, o: ForStmt) -> None:\n o.index.accept(self)\n o.expr.accept(self)\n o.body.accept(self)\n if o.else_body:\n o.else_body.accept(self)\n\n def visit_return_stmt(self, o: ReturnStmt) -> None:\n if o.expr is not None:\n o.expr.accept(self)\n\n def visit_assert_stmt(self, o: AssertStmt) -> None:\n if o.expr is not None:\n o.expr.accept(self)\n if o.msg is not None:\n o.msg.accept(self)\n\n def visit_del_stmt(self, o: DelStmt) -> None:\n if o.expr is not None:\n o.expr.accept(self)\n\n def visit_if_stmt(self, o: IfStmt) -> None:\n for e in o.expr:\n e.accept(self)\n for b in o.body:\n b.accept(self)\n if o.else_body:\n o.else_body.accept(self)\n\n def visit_raise_stmt(self, o: RaiseStmt) -> None:\n if o.expr is not None:\n o.expr.accept(self)\n if o.from_expr is not None:\n o.from_expr.accept(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/traverser.py_ReturnSeeker_has_return_statement.return.seeker_found": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/traverser.py_ReturnSeeker_has_return_statement.return.seeker_found", "embedding": null, "metadata": {"file_path": "mypy/traverser.py", "file_name": "traverser.py", "file_type": "text/x-python", "category": "implementation", "start_line": 300, "end_line": 317, "span_ids": ["has_return_statement", "ReturnSeeker", "ReturnSeeker.__init__", "ReturnSeeker.visit_return_stmt"], "tokens": 137}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ReturnSeeker(TraverserVisitor):\n def __init__(self) -> None:\n self.found = False\n\n def visit_return_stmt(self, o: ReturnStmt) -> None:\n if (o.expr is None or isinstance(o.expr, NameExpr) and o.expr.name == 'None'):\n return\n self.found = True\n\n\ndef has_return_statement(fdef: FuncBase) -> bool:\n \"\"\"Find if a function has a non-trivial return statement.\n\n Plain 'return' and 'return None' don't count.\n \"\"\"\n seeker = ReturnSeeker()\n fdef.accept(seeker)\n return seeker.found", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/traverser.py_ReturnCollector_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/traverser.py_ReturnCollector_", "embedding": null, "metadata": {"file_path": "mypy/traverser.py", "file_name": "traverser.py", "file_type": "text/x-python", "category": "implementation", "start_line": 320, "end_line": 339, "span_ids": ["ReturnCollector.__init__", "ReturnCollector.visit_func_def", "ReturnCollector.visit_return_stmt", "all_return_statements", "ReturnCollector"], "tokens": 147}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ReturnCollector(TraverserVisitor):\n def __init__(self) -> None:\n self.return_statements = [] # type: List[ReturnStmt]\n self.inside_func = False\n\n def visit_func_def(self, defn: FuncDef) -> None:\n if not self.inside_func:\n self.inside_func = True\n super().visit_func_def(defn)\n self.inside_func = False\n\n def visit_return_stmt(self, stmt: ReturnStmt) -> None:\n self.return_statements.append(stmt)\n\n\ndef all_return_statements(node: Node) -> List[ReturnStmt]:\n v = ReturnCollector()\n node.accept(v)\n return v.return_statements", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/treetransform.py__Base_visitor_that_impl_from_mypy_util_import_rep": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/treetransform.py__Base_visitor_that_impl_from_mypy_util_import_rep", "embedding": null, "metadata": {"file_path": "mypy/treetransform.py", "file_name": "treetransform.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 28, "span_ids": ["docstring"], "tokens": 367}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Base visitor that implements an identity AST transform.\n\nSubclass TransformVisitor to perform non-trivial transformations.\n\"\"\"\n\nfrom typing import List, Dict, cast, Optional, Iterable\n\nfrom mypy.nodes import (\n MypyFile, Import, Node, ImportAll, ImportFrom, FuncItem, FuncDef,\n OverloadedFuncDef, ClassDef, Decorator, Block, Var,\n OperatorAssignmentStmt, ExpressionStmt, AssignmentStmt, ReturnStmt,\n RaiseStmt, AssertStmt, DelStmt, BreakStmt, ContinueStmt,\n PassStmt, GlobalDecl, WhileStmt, ForStmt, IfStmt, TryStmt, WithStmt,\n CastExpr, RevealExpr, TupleExpr, GeneratorExpr, ListComprehension, ListExpr,\n ConditionalExpr, DictExpr, SetExpr, NameExpr, IntExpr, StrExpr, BytesExpr,\n UnicodeExpr, FloatExpr, CallExpr, SuperExpr, MemberExpr, IndexExpr,\n SliceExpr, OpExpr, UnaryExpr, LambdaExpr, TypeApplication, PrintStmt,\n SymbolTable, RefExpr, TypeVarExpr, ParamSpecExpr, NewTypeExpr, PromoteExpr,\n ComparisonExpr, TempNode, StarExpr, Statement, Expression,\n YieldFromExpr, NamedTupleExpr, TypedDictExpr, NonlocalDecl, SetComprehension,\n DictionaryComprehension, ComplexExpr, TypeAliasExpr, EllipsisExpr,\n YieldExpr, ExecStmt, Argument, BackquoteExpr, AwaitExpr, AssignmentExpr,\n OverloadPart, EnumCallExpr, REVEAL_TYPE, GDEF\n)\nfrom mypy.types import Type, FunctionLike, ProperType\nfrom mypy.traverser import TraverserVisitor\nfrom mypy.visitor import NodeVisitor\nfrom mypy.util import replace_object_state", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/treetransform.py_TransformVisitor.visit_func_def_TransformVisitor.visit_func_def.if_node_in_self_func_plac.else_.return.new": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/treetransform.py_TransformVisitor.visit_func_def_TransformVisitor.visit_func_def.if_node_in_self_func_plac.else_.return.new", "embedding": null, "metadata": {"file_path": "mypy/treetransform.py", "file_name": "treetransform.py", "file_type": "text/x-python", "category": "implementation", "start_line": 93, "end_line": 133, "span_ids": ["TransformVisitor.visit_func_def"], "tokens": 365}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TransformVisitor(NodeVisitor[Node]):\n\n def visit_func_def(self, node: FuncDef) -> FuncDef:\n # Note that a FuncDef must be transformed to a FuncDef.\n\n # These contortions are needed to handle the case of recursive\n # references inside the function being transformed.\n # Set up placeholder nodes for references within this function\n # to other functions defined inside it.\n # Don't create an entry for this function itself though,\n # since we want self-references to point to the original\n # function if this is the top-level node we are transforming.\n init = FuncMapInitializer(self)\n for stmt in node.body.body:\n stmt.accept(init)\n\n new = FuncDef(node.name,\n [self.copy_argument(arg) for arg in node.arguments],\n self.block(node.body),\n cast(Optional[FunctionLike], self.optional_type(node.type)))\n\n self.copy_function_attributes(new, node)\n\n new._fullname = node._fullname\n new.is_decorated = node.is_decorated\n new.is_conditional = node.is_conditional\n new.is_abstract = node.is_abstract\n new.is_static = node.is_static\n new.is_class = node.is_class\n new.is_property = node.is_property\n new.is_final = node.is_final\n new.original_def = node.original_def\n\n if node in self.func_placeholder_map:\n # There is a placeholder definition for this function. Replace\n # the attributes of the placeholder with those form the transformed\n # function. We know that the classes will be identical (otherwise\n # this wouldn't work).\n result = self.func_placeholder_map[node]\n replace_object_state(result, new)\n return result\n else:\n return new", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/treetransform.py_TransformVisitor.visit_lambda_expr_TransformVisitor.copy_function_attributes.new.line.original_line": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/treetransform.py_TransformVisitor.visit_lambda_expr_TransformVisitor.copy_function_attributes.new.line.original_line", "embedding": null, "metadata": {"file_path": "mypy/treetransform.py", "file_name": "treetransform.py", "file_type": "text/x-python", "category": "implementation", "start_line": 135, "end_line": 149, "span_ids": ["TransformVisitor.visit_lambda_expr", "TransformVisitor.copy_function_attributes"], "tokens": 146}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TransformVisitor(NodeVisitor[Node]):\n\n def visit_lambda_expr(self, node: LambdaExpr) -> LambdaExpr:\n new = LambdaExpr([self.copy_argument(arg) for arg in node.arguments],\n self.block(node.body),\n cast(Optional[FunctionLike], self.optional_type(node.type)))\n self.copy_function_attributes(new, node)\n return new\n\n def copy_function_attributes(self, new: FuncItem,\n original: FuncItem) -> None:\n new.info = original.info\n new.min_args = original.min_args\n new.max_pos = original.max_pos\n new.is_overload = original.is_overload\n new.is_generator = original.is_generator\n new.line = original.line", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/treetransform.py_TransformVisitor.visit_overloaded_func_def_TransformVisitor.visit_overloaded_func_def.return.new": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/treetransform.py_TransformVisitor.visit_overloaded_func_def_TransformVisitor.visit_overloaded_func_def.return.new", "embedding": null, "metadata": {"file_path": "mypy/treetransform.py", "file_name": "treetransform.py", "file_type": "text/x-python", "category": "implementation", "start_line": 151, "end_line": 167, "span_ids": ["TransformVisitor.visit_overloaded_func_def"], "tokens": 184}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TransformVisitor(NodeVisitor[Node]):\n\n def visit_overloaded_func_def(self, node: OverloadedFuncDef) -> OverloadedFuncDef:\n items = [cast(OverloadPart, item.accept(self)) for item in node.items]\n for newitem, olditem in zip(items, node.items):\n newitem.line = olditem.line\n new = OverloadedFuncDef(items)\n new._fullname = node._fullname\n new_type = self.optional_type(node.type)\n assert isinstance(new_type, ProperType)\n new.type = new_type\n new.info = node.info\n new.is_static = node.is_static\n new.is_class = node.is_class\n new.is_property = node.is_property\n new.is_final = node.is_final\n if node.impl:\n new.impl = cast(OverloadPart, node.impl.accept(self))\n return new", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/treetransform.py_TransformVisitor.visit_class_def_TransformVisitor.visit_decorator.return.new": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/treetransform.py_TransformVisitor.visit_class_def_TransformVisitor.visit_decorator.return.new", "embedding": null, "metadata": {"file_path": "mypy/treetransform.py", "file_name": "treetransform.py", "file_type": "text/x-python", "category": "implementation", "start_line": 169, "end_line": 197, "span_ids": ["TransformVisitor.visit_decorator", "TransformVisitor.visit_global_decl", "TransformVisitor.visit_class_def", "TransformVisitor.visit_block", "TransformVisitor.visit_nonlocal_decl"], "tokens": 257}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TransformVisitor(NodeVisitor[Node]):\n\n def visit_class_def(self, node: ClassDef) -> ClassDef:\n new = ClassDef(node.name,\n self.block(node.defs),\n node.type_vars,\n self.expressions(node.base_type_exprs),\n self.optional_expr(node.metaclass))\n new.fullname = node.fullname\n new.info = node.info\n new.decorators = [self.expr(decorator)\n for decorator in node.decorators]\n return new\n\n def visit_global_decl(self, node: GlobalDecl) -> GlobalDecl:\n return GlobalDecl(node.names[:])\n\n def visit_nonlocal_decl(self, node: NonlocalDecl) -> NonlocalDecl:\n return NonlocalDecl(node.names[:])\n\n def visit_block(self, node: Block) -> Block:\n return Block(self.statements(node.body))\n\n def visit_decorator(self, node: Decorator) -> Decorator:\n # Note that a Decorator must be transformed to a Decorator.\n func = self.visit_func_def(node.func)\n func.line = node.func.line\n new = Decorator(func, self.expressions(node.decorators),\n self.visit_var(node.var))\n new.is_overload = node.is_overload\n return new", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/treetransform.py_TransformVisitor.visit_var_TransformVisitor.visit_var.return.new": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/treetransform.py_TransformVisitor.visit_var_TransformVisitor.visit_var.return.new", "embedding": null, "metadata": {"file_path": "mypy/treetransform.py", "file_name": "treetransform.py", "file_type": "text/x-python", "category": "implementation", "start_line": 199, "end_line": 219, "span_ids": ["TransformVisitor.visit_var"], "tokens": 211}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TransformVisitor(NodeVisitor[Node]):\n\n def visit_var(self, node: Var) -> Var:\n # Note that a Var must be transformed to a Var.\n if node in self.var_map:\n return self.var_map[node]\n new = Var(node.name, self.optional_type(node.type))\n new.line = node.line\n new._fullname = node._fullname\n new.info = node.info\n new.is_self = node.is_self\n new.is_ready = node.is_ready\n new.is_initialized_in_class = node.is_initialized_in_class\n new.is_staticmethod = node.is_staticmethod\n new.is_classmethod = node.is_classmethod\n new.is_property = node.is_property\n new.is_final = node.is_final\n new.final_value = node.final_value\n new.final_unset_in_class = node.final_unset_in_class\n new.final_set_in_init = node.final_set_in_init\n new.set_line(node.line)\n self.var_map[node] = new\n return new", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/treetransform.py_TransformVisitor.visit_expression_stmt_TransformVisitor.visit_int_expr.return.IntExpr_node_value_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/treetransform.py_TransformVisitor.visit_expression_stmt_TransformVisitor.visit_int_expr.return.IntExpr_node_value_", "embedding": null, "metadata": {"file_path": "mypy/treetransform.py", "file_name": "treetransform.py", "file_type": "text/x-python", "category": "implementation", "start_line": 221, "end_line": 315, "span_ids": ["TransformVisitor.visit_expression_stmt", "TransformVisitor.visit_operator_assignment_stmt", "TransformVisitor.visit_break_stmt", "TransformVisitor.visit_int_expr", "TransformVisitor.visit_with_stmt", "TransformVisitor.visit_if_stmt", "TransformVisitor.visit_assert_stmt", "TransformVisitor.visit_pass_stmt", "TransformVisitor.visit_print_stmt", "TransformVisitor.visit_assignment_stmt", "TransformVisitor.visit_try_stmt", "TransformVisitor.visit_continue_stmt", "TransformVisitor.visit_while_stmt", "TransformVisitor.visit_raise_stmt", "TransformVisitor.visit_exec_stmt", "TransformVisitor.visit_del_stmt", "TransformVisitor.visit_star_expr", "TransformVisitor.visit_for_stmt", "TransformVisitor.visit_return_stmt", "TransformVisitor.duplicate_assignment"], "tokens": 790}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TransformVisitor(NodeVisitor[Node]):\n\n def visit_expression_stmt(self, node: ExpressionStmt) -> ExpressionStmt:\n return ExpressionStmt(self.expr(node.expr))\n\n def visit_assignment_stmt(self, node: AssignmentStmt) -> AssignmentStmt:\n return self.duplicate_assignment(node)\n\n def duplicate_assignment(self, node: AssignmentStmt) -> AssignmentStmt:\n new = AssignmentStmt(self.expressions(node.lvalues),\n self.expr(node.rvalue),\n self.optional_type(node.unanalyzed_type))\n new.line = node.line\n new.is_final_def = node.is_final_def\n new.type = self.optional_type(node.type)\n return new\n\n def visit_operator_assignment_stmt(self,\n node: OperatorAssignmentStmt) -> OperatorAssignmentStmt:\n return OperatorAssignmentStmt(node.op,\n self.expr(node.lvalue),\n self.expr(node.rvalue))\n\n def visit_while_stmt(self, node: WhileStmt) -> WhileStmt:\n return WhileStmt(self.expr(node.expr),\n self.block(node.body),\n self.optional_block(node.else_body))\n\n def visit_for_stmt(self, node: ForStmt) -> ForStmt:\n new = ForStmt(self.expr(node.index),\n self.expr(node.expr),\n self.block(node.body),\n self.optional_block(node.else_body),\n self.optional_type(node.unanalyzed_index_type))\n new.is_async = node.is_async\n new.index_type = self.optional_type(node.index_type)\n return new\n\n def visit_return_stmt(self, node: ReturnStmt) -> ReturnStmt:\n return ReturnStmt(self.optional_expr(node.expr))\n\n def visit_assert_stmt(self, node: AssertStmt) -> AssertStmt:\n return AssertStmt(self.expr(node.expr), self.optional_expr(node.msg))\n\n def visit_del_stmt(self, node: DelStmt) -> DelStmt:\n return DelStmt(self.expr(node.expr))\n\n def visit_if_stmt(self, node: IfStmt) -> IfStmt:\n return IfStmt(self.expressions(node.expr),\n self.blocks(node.body),\n self.optional_block(node.else_body))\n\n def visit_break_stmt(self, node: BreakStmt) -> BreakStmt:\n return BreakStmt()\n\n def visit_continue_stmt(self, node: ContinueStmt) -> ContinueStmt:\n return ContinueStmt()\n\n def visit_pass_stmt(self, node: PassStmt) -> PassStmt:\n return PassStmt()\n\n def visit_raise_stmt(self, node: RaiseStmt) -> RaiseStmt:\n return RaiseStmt(self.optional_expr(node.expr),\n self.optional_expr(node.from_expr))\n\n def visit_try_stmt(self, node: TryStmt) -> TryStmt:\n return TryStmt(self.block(node.body),\n self.optional_names(node.vars),\n self.optional_expressions(node.types),\n self.blocks(node.handlers),\n self.optional_block(node.else_body),\n self.optional_block(node.finally_body))\n\n def visit_with_stmt(self, node: WithStmt) -> WithStmt:\n new = WithStmt(self.expressions(node.expr),\n self.optional_expressions(node.target),\n self.block(node.body),\n self.optional_type(node.unanalyzed_type))\n new.is_async = node.is_async\n new.analyzed_types = [self.type(typ) for typ in node.analyzed_types]\n return new\n\n def visit_print_stmt(self, node: PrintStmt) -> PrintStmt:\n return PrintStmt(self.expressions(node.args),\n node.newline,\n self.optional_expr(node.target))\n\n def visit_exec_stmt(self, node: ExecStmt) -> ExecStmt:\n return ExecStmt(self.expr(node.expr),\n self.optional_expr(node.globals),\n self.optional_expr(node.locals))\n\n def visit_star_expr(self, node: StarExpr) -> StarExpr:\n return StarExpr(node.expr)\n\n def visit_int_expr(self, node: IntExpr) -> IntExpr:\n return IntExpr(node.value)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/treetransform.py_TransformVisitor.visit_str_expr_TransformVisitor.visit_member_expr.return.member": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/treetransform.py_TransformVisitor.visit_str_expr_TransformVisitor.visit_member_expr.return.member", "embedding": null, "metadata": {"file_path": "mypy/treetransform.py", "file_name": "treetransform.py", "file_type": "text/x-python", "category": "implementation", "start_line": 317, "end_line": 354, "span_ids": ["TransformVisitor.visit_float_expr", "TransformVisitor.visit_member_expr", "TransformVisitor.visit_bytes_expr", "TransformVisitor.duplicate_name", "TransformVisitor.visit_ellipsis", "TransformVisitor.visit_name_expr", "TransformVisitor.visit_str_expr", "TransformVisitor.visit_unicode_expr", "TransformVisitor.visit_complex_expr"], "tokens": 333}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TransformVisitor(NodeVisitor[Node]):\n\n def visit_str_expr(self, node: StrExpr) -> StrExpr:\n return StrExpr(node.value, node.from_python_3)\n\n def visit_bytes_expr(self, node: BytesExpr) -> BytesExpr:\n return BytesExpr(node.value)\n\n def visit_unicode_expr(self, node: UnicodeExpr) -> UnicodeExpr:\n return UnicodeExpr(node.value)\n\n def visit_float_expr(self, node: FloatExpr) -> FloatExpr:\n return FloatExpr(node.value)\n\n def visit_complex_expr(self, node: ComplexExpr) -> ComplexExpr:\n return ComplexExpr(node.value)\n\n def visit_ellipsis(self, node: EllipsisExpr) -> EllipsisExpr:\n return EllipsisExpr()\n\n def visit_name_expr(self, node: NameExpr) -> NameExpr:\n return self.duplicate_name(node)\n\n def duplicate_name(self, node: NameExpr) -> NameExpr:\n # This method is used when the transform result must be a NameExpr.\n # visit_name_expr() is used when there is no such restriction.\n new = NameExpr(node.name)\n self.copy_ref(new, node)\n new.is_special_form = node.is_special_form\n return new\n\n def visit_member_expr(self, node: MemberExpr) -> MemberExpr:\n member = MemberExpr(self.expr(node.expr),\n node.name)\n if node.def_var:\n # This refers to an attribute and we don't transform attributes by default,\n # just normal variables.\n member.def_var = node.def_var\n self.copy_ref(member, node)\n return member", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/treetransform.py_TransformVisitor.copy_ref_TransformVisitor.copy_ref.new.is_inferred_def.original_is_inferred_def": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/treetransform.py_TransformVisitor.copy_ref_TransformVisitor.copy_ref.new.is_inferred_def.original_is_inferred_def", "embedding": null, "metadata": {"file_path": "mypy/treetransform.py", "file_name": "treetransform.py", "file_type": "text/x-python", "category": "implementation", "start_line": 362, "end_line": 378, "span_ids": ["TransformVisitor.copy_ref"], "tokens": 179}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TransformVisitor(NodeVisitor[Node]):\n\n def copy_ref(self, new: RefExpr, original: RefExpr) -> None:\n new.kind = original.kind\n new.fullname = original.fullname\n target = original.node\n if isinstance(target, Var):\n # Do not transform references to global variables. See\n # testGenericFunctionAliasExpand for an example where this is important.\n if original.kind != GDEF:\n target = self.visit_var(target)\n elif isinstance(target, Decorator):\n target = self.visit_var(target.var)\n elif isinstance(target, FuncDef):\n # Use a placeholder node for the function if it exists.\n target = self.func_placeholder_map.get(target, target)\n new.node = target\n new.is_new_def = original.is_new_def\n new.is_inferred_def = original.is_inferred_def", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/treetransform.py_TransformVisitor.visit_yield_from_expr_TransformVisitor.visit_list_comprehension.return.ListComprehension_generat": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/treetransform.py_TransformVisitor.visit_yield_from_expr_TransformVisitor.visit_list_comprehension.return.ListComprehension_generat", "embedding": null, "metadata": {"file_path": "mypy/treetransform.py", "file_name": "treetransform.py", "file_type": "text/x-python", "category": "implementation", "start_line": 371, "end_line": 456, "span_ids": ["TransformVisitor.visit_reveal_expr", "TransformVisitor.visit_index_expr", "TransformVisitor.visit_list_comprehension", "TransformVisitor.visit_comparison_expr", "TransformVisitor.visit_dict_expr", "TransformVisitor.visit_cast_expr", "TransformVisitor.visit_tuple_expr", "TransformVisitor.visit_call_expr", "TransformVisitor.visit_type_application", "TransformVisitor.visit_yield_expr", "TransformVisitor.visit_unary_expr", "TransformVisitor.visit_op_expr", "TransformVisitor.visit_set_expr", "TransformVisitor.visit_assignment_expr", "TransformVisitor.visit_await_expr", "TransformVisitor.visit_super_expr", "TransformVisitor.visit_yield_from_expr", "TransformVisitor.visit_list_expr"], "tokens": 792}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TransformVisitor(NodeVisitor[Node]):\n\n def visit_yield_from_expr(self, node: YieldFromExpr) -> YieldFromExpr:\n return YieldFromExpr(self.expr(node.expr))\n\n def visit_yield_expr(self, node: YieldExpr) -> YieldExpr:\n return YieldExpr(self.optional_expr(node.expr))\n\n def visit_await_expr(self, node: AwaitExpr) -> AwaitExpr:\n return AwaitExpr(self.expr(node.expr))\n\n def visit_call_expr(self, node: CallExpr) -> CallExpr:\n return CallExpr(self.expr(node.callee),\n self.expressions(node.args),\n node.arg_kinds[:],\n node.arg_names[:],\n self.optional_expr(node.analyzed))\n\n def visit_op_expr(self, node: OpExpr) -> OpExpr:\n new = OpExpr(node.op, self.expr(node.left), self.expr(node.right))\n new.method_type = self.optional_type(node.method_type)\n return new\n\n def visit_comparison_expr(self, node: ComparisonExpr) -> ComparisonExpr:\n new = ComparisonExpr(node.operators, self.expressions(node.operands))\n new.method_types = [self.optional_type(t) for t in node.method_types]\n return new\n\n def visit_cast_expr(self, node: CastExpr) -> CastExpr:\n return CastExpr(self.expr(node.expr),\n self.type(node.type))\n\n def visit_reveal_expr(self, node: RevealExpr) -> RevealExpr:\n if node.kind == REVEAL_TYPE:\n assert node.expr is not None\n return RevealExpr(kind=REVEAL_TYPE, expr=self.expr(node.expr))\n else:\n # Reveal locals expressions don't have any sub expressions\n return node\n\n def visit_super_expr(self, node: SuperExpr) -> SuperExpr:\n call = self.expr(node.call)\n assert isinstance(call, CallExpr)\n new = SuperExpr(node.name, call)\n new.info = node.info\n return new\n\n def visit_assignment_expr(self, node: AssignmentExpr) -> AssignmentExpr:\n return AssignmentExpr(node.target, node.value)\n\n def visit_unary_expr(self, node: UnaryExpr) -> UnaryExpr:\n new = UnaryExpr(node.op, self.expr(node.expr))\n new.method_type = self.optional_type(node.method_type)\n return new\n\n def visit_list_expr(self, node: ListExpr) -> ListExpr:\n return ListExpr(self.expressions(node.items))\n\n def visit_dict_expr(self, node: DictExpr) -> DictExpr:\n return DictExpr([(self.expr(key) if key else None, self.expr(value))\n for key, value in node.items])\n\n def visit_tuple_expr(self, node: TupleExpr) -> TupleExpr:\n return TupleExpr(self.expressions(node.items))\n\n def visit_set_expr(self, node: SetExpr) -> SetExpr:\n return SetExpr(self.expressions(node.items))\n\n def visit_index_expr(self, node: IndexExpr) -> IndexExpr:\n new = IndexExpr(self.expr(node.base), self.expr(node.index))\n if node.method_type:\n new.method_type = self.type(node.method_type)\n if node.analyzed:\n if isinstance(node.analyzed, TypeApplication):\n new.analyzed = self.visit_type_application(node.analyzed)\n else:\n new.analyzed = self.visit_type_alias_expr(node.analyzed)\n new.analyzed.set_line(node.analyzed.line)\n return new\n\n def visit_type_application(self, node: TypeApplication) -> TypeApplication:\n return TypeApplication(self.expr(node.expr),\n self.types(node.types))\n\n def visit_list_comprehension(self, node: ListComprehension) -> ListComprehension:\n generator = self.duplicate_generator(node.generator)\n generator.set_line(node.generator.line, node.generator.column)\n return ListComprehension(generator)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/treetransform.py_TransformVisitor.visit_set_comprehension_TransformVisitor.expr.return.new": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/treetransform.py_TransformVisitor.visit_set_comprehension_TransformVisitor.expr.return.new", "embedding": null, "metadata": {"file_path": "mypy/treetransform.py", "file_name": "treetransform.py", "file_type": "text/x-python", "category": "implementation", "start_line": 458, "end_line": 544, "span_ids": ["TransformVisitor.visit__promote_expr", "TransformVisitor.visit_temp_node", "TransformVisitor.visit_set_comprehension", "TransformVisitor.expr", "TransformVisitor.mypyfile", "TransformVisitor.visit_slice_expr", "TransformVisitor.visit_generator_expr", "TransformVisitor.visit_typeddict_expr", "TransformVisitor.visit_type_alias_expr", "TransformVisitor.visit_dictionary_comprehension", "TransformVisitor.visit_paramspec_expr", "TransformVisitor.visit_enum_call_expr", "TransformVisitor.node", "TransformVisitor.visit_namedtuple_expr", "TransformVisitor.duplicate_generator", "TransformVisitor.visit_backquote_expr", "TransformVisitor.visit_conditional_expr", "TransformVisitor.visit_type_var_expr", "TransformVisitor.visit_newtype_expr"], "tokens": 786}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TransformVisitor(NodeVisitor[Node]):\n\n def visit_set_comprehension(self, node: SetComprehension) -> SetComprehension:\n generator = self.duplicate_generator(node.generator)\n generator.set_line(node.generator.line, node.generator.column)\n return SetComprehension(generator)\n\n def visit_dictionary_comprehension(self, node: DictionaryComprehension\n ) -> DictionaryComprehension:\n return DictionaryComprehension(self.expr(node.key), self.expr(node.value),\n [self.expr(index) for index in node.indices],\n [self.expr(s) for s in node.sequences],\n [[self.expr(cond) for cond in conditions]\n for conditions in node.condlists],\n node.is_async)\n\n def visit_generator_expr(self, node: GeneratorExpr) -> GeneratorExpr:\n return self.duplicate_generator(node)\n\n def duplicate_generator(self, node: GeneratorExpr) -> GeneratorExpr:\n return GeneratorExpr(self.expr(node.left_expr),\n [self.expr(index) for index in node.indices],\n [self.expr(s) for s in node.sequences],\n [[self.expr(cond) for cond in conditions]\n for conditions in node.condlists],\n node.is_async)\n\n def visit_slice_expr(self, node: SliceExpr) -> SliceExpr:\n return SliceExpr(self.optional_expr(node.begin_index),\n self.optional_expr(node.end_index),\n self.optional_expr(node.stride))\n\n def visit_conditional_expr(self, node: ConditionalExpr) -> ConditionalExpr:\n return ConditionalExpr(self.expr(node.cond),\n self.expr(node.if_expr),\n self.expr(node.else_expr))\n\n def visit_backquote_expr(self, node: BackquoteExpr) -> BackquoteExpr:\n return BackquoteExpr(self.expr(node.expr))\n\n def visit_type_var_expr(self, node: TypeVarExpr) -> TypeVarExpr:\n return TypeVarExpr(node.name, node.fullname,\n self.types(node.values),\n self.type(node.upper_bound), variance=node.variance)\n\n def visit_paramspec_expr(self, node: ParamSpecExpr) -> ParamSpecExpr:\n return ParamSpecExpr(\n node.name, node.fullname, self.type(node.upper_bound), variance=node.variance\n )\n\n def visit_type_alias_expr(self, node: TypeAliasExpr) -> TypeAliasExpr:\n return TypeAliasExpr(node.node)\n\n def visit_newtype_expr(self, node: NewTypeExpr) -> NewTypeExpr:\n res = NewTypeExpr(node.name, node.old_type, line=node.line, column=node.column)\n res.info = node.info\n return res\n\n def visit_namedtuple_expr(self, node: NamedTupleExpr) -> NamedTupleExpr:\n return NamedTupleExpr(node.info)\n\n def visit_enum_call_expr(self, node: EnumCallExpr) -> EnumCallExpr:\n return EnumCallExpr(node.info, node.items, node.values)\n\n def visit_typeddict_expr(self, node: TypedDictExpr) -> Node:\n return TypedDictExpr(node.info)\n\n def visit__promote_expr(self, node: PromoteExpr) -> PromoteExpr:\n return PromoteExpr(node.type)\n\n def visit_temp_node(self, node: TempNode) -> TempNode:\n return TempNode(self.type(node.type))\n\n def node(self, node: Node) -> Node:\n new = node.accept(self)\n new.set_line(node.line)\n return new\n\n def mypyfile(self, node: MypyFile) -> MypyFile:\n new = node.accept(self)\n assert isinstance(new, MypyFile)\n new.set_line(node.line)\n return new\n\n def expr(self, expr: Expression) -> Expression:\n new = expr.accept(self)\n assert isinstance(new, Expression)\n new.set_line(expr.line, expr.column)\n return new", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/treetransform.py_TransformVisitor.stmt_TransformVisitor.types.return._self_type_type_for_type": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/treetransform.py_TransformVisitor.stmt_TransformVisitor.types.return._self_type_type_for_type", "embedding": null, "metadata": {"file_path": "mypy/treetransform.py", "file_name": "treetransform.py", "file_type": "text/x-python", "category": "implementation", "start_line": 546, "end_line": 609, "span_ids": ["TransformVisitor.expressions", "TransformVisitor.blocks", "TransformVisitor.optional_block", "TransformVisitor.types", "TransformVisitor.optional_names", "TransformVisitor.block", "TransformVisitor.optional_type", "TransformVisitor.optional_expr", "TransformVisitor.optional_expressions", "TransformVisitor.stmt", "TransformVisitor.names", "TransformVisitor.type", "TransformVisitor.statements"], "tokens": 475}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TransformVisitor(NodeVisitor[Node]):\n\n def stmt(self, stmt: Statement) -> Statement:\n new = stmt.accept(self)\n assert isinstance(new, Statement)\n new.set_line(stmt.line, stmt.column)\n return new\n\n # Helpers\n #\n # All the node helpers also propagate line numbers.\n\n def optional_expr(self, expr: Optional[Expression]) -> Optional[Expression]:\n if expr:\n return self.expr(expr)\n else:\n return None\n\n def block(self, block: Block) -> Block:\n new = self.visit_block(block)\n new.line = block.line\n return new\n\n def optional_block(self, block: Optional[Block]) -> Optional[Block]:\n if block:\n return self.block(block)\n else:\n return None\n\n def statements(self, statements: List[Statement]) -> List[Statement]:\n return [self.stmt(stmt) for stmt in statements]\n\n def expressions(self, expressions: List[Expression]) -> List[Expression]:\n return [self.expr(expr) for expr in expressions]\n\n def optional_expressions(self, expressions: Iterable[Optional[Expression]]\n ) -> List[Optional[Expression]]:\n return [self.optional_expr(expr) for expr in expressions]\n\n def blocks(self, blocks: List[Block]) -> List[Block]:\n return [self.block(block) for block in blocks]\n\n def names(self, names: List[NameExpr]) -> List[NameExpr]:\n return [self.duplicate_name(name) for name in names]\n\n def optional_names(self, names: Iterable[Optional[NameExpr]]) -> List[Optional[NameExpr]]:\n result = [] # type: List[Optional[NameExpr]]\n for name in names:\n if name:\n result.append(self.duplicate_name(name))\n else:\n result.append(None)\n return result\n\n def type(self, type: Type) -> Type:\n # Override this method to transform types.\n return type\n\n def optional_type(self, type: Optional[Type]) -> Optional[Type]:\n if type:\n return self.type(type)\n else:\n return None\n\n def types(self, types: List[Type]) -> List[Type]:\n return [self.type(type) for type in types]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/treetransform.py_FuncMapInitializer_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/treetransform.py_FuncMapInitializer_", "embedding": null, "metadata": {"file_path": "mypy/treetransform.py", "file_name": "treetransform.py", "file_type": "text/x-python", "category": "implementation", "start_line": 612, "end_line": 627, "span_ids": ["FuncMapInitializer.visit_func_def", "FuncMapInitializer", "FuncMapInitializer.__init__"], "tokens": 137}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FuncMapInitializer(TraverserVisitor):\n \"\"\"This traverser creates mappings from nested FuncDefs to placeholder FuncDefs.\n\n The placeholders will later be replaced with transformed nodes.\n \"\"\"\n\n def __init__(self, transformer: TransformVisitor) -> None:\n self.transformer = transformer\n\n def visit_func_def(self, node: FuncDef) -> None:\n if node not in self.transformer.func_placeholder_map:\n # Haven't seen this FuncDef before, so create a placeholder node.\n self.transformer.func_placeholder_map[node] = FuncDef(\n node.name, node.arguments, node.body, None)\n super().visit_func_def(node)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/tvar_scope.py_from_typing_import_Option_TypeVarLikeScope.class_frame.return.TypeVarLikeScope_self_get": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/tvar_scope.py_from_typing_import_Option_TypeVarLikeScope.class_frame.return.TypeVarLikeScope_self_get", "embedding": null, "metadata": {"file_path": "mypy/tvar_scope.py", "file_name": "tvar_scope.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 56, "span_ids": ["imports", "TypeVarLikeScope", "TypeVarLikeScope.__init__", "TypeVarLikeScope.get_function_scope", "TypeVarLikeScope.method_frame", "TypeVarLikeScope.allow_binding", "TypeVarLikeScope.class_frame"], "tokens": 495}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from typing import Optional, Dict, Union\nfrom mypy.types import TypeVarLikeDef, TypeVarDef, ParamSpecDef\nfrom mypy.nodes import ParamSpecExpr, TypeVarExpr, TypeVarLikeExpr, SymbolTableNode\n\n\nclass TypeVarLikeScope:\n \"\"\"Scope that holds bindings for type variables and parameter specifications.\n\n Node fullname -> TypeVarLikeDef.\n \"\"\"\n\n def __init__(self,\n parent: 'Optional[TypeVarLikeScope]' = None,\n is_class_scope: bool = False,\n prohibited: 'Optional[TypeVarLikeScope]' = None) -> None:\n \"\"\"Initializer for TypeVarLikeScope\n\n Parameters:\n parent: the outer scope for this scope\n is_class_scope: True if this represents a generic class\n prohibited: Type variables that aren't strictly in scope exactly,\n but can't be bound because they're part of an outer class's scope.\n \"\"\"\n self.scope = {} # type: Dict[str, TypeVarLikeDef]\n self.parent = parent\n self.func_id = 0\n self.class_id = 0\n self.is_class_scope = is_class_scope\n self.prohibited = prohibited\n if parent is not None:\n self.func_id = parent.func_id\n self.class_id = parent.class_id\n\n def get_function_scope(self) -> 'Optional[TypeVarLikeScope]':\n \"\"\"Get the nearest parent that's a function scope, not a class scope\"\"\"\n it = self # type: Optional[TypeVarLikeScope]\n while it is not None and it.is_class_scope:\n it = it.parent\n return it\n\n def allow_binding(self, fullname: str) -> bool:\n if fullname in self.scope:\n return False\n elif self.parent and not self.parent.allow_binding(fullname):\n return False\n elif self.prohibited and not self.prohibited.allow_binding(fullname):\n return False\n return True\n\n def method_frame(self) -> 'TypeVarLikeScope':\n \"\"\"A new scope frame for binding a method\"\"\"\n return TypeVarLikeScope(self, False, None)\n\n def class_frame(self) -> 'TypeVarLikeScope':\n \"\"\"A new scope frame for binding a class. Prohibits *this* class's tvars\"\"\"\n return TypeVarLikeScope(self.get_function_scope(), True, self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/tvar_scope.py_TypeVarLikeScope.bind_new_TypeVarLikeScope.bind_new.return.tvar_def": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/tvar_scope.py_TypeVarLikeScope.bind_new_TypeVarLikeScope.bind_new.return.tvar_def", "embedding": null, "metadata": {"file_path": "mypy/tvar_scope.py", "file_name": "tvar_scope.py", "file_type": "text/x-python", "category": "implementation", "start_line": 58, "end_line": 87, "span_ids": ["TypeVarLikeScope.bind_new"], "tokens": 228}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeVarLikeScope:\n\n def bind_new(self, name: str, tvar_expr: TypeVarLikeExpr) -> TypeVarLikeDef:\n if self.is_class_scope:\n self.class_id += 1\n i = self.class_id\n else:\n self.func_id -= 1\n i = self.func_id\n if isinstance(tvar_expr, TypeVarExpr):\n tvar_def = TypeVarDef(\n name,\n tvar_expr.fullname,\n i,\n values=tvar_expr.values,\n upper_bound=tvar_expr.upper_bound,\n variance=tvar_expr.variance,\n line=tvar_expr.line,\n column=tvar_expr.column\n ) # type: TypeVarLikeDef\n elif isinstance(tvar_expr, ParamSpecExpr):\n tvar_def = ParamSpecDef(\n name,\n tvar_expr.fullname,\n i,\n line=tvar_expr.line,\n column=tvar_expr.column\n )\n else:\n assert False\n self.scope[tvar_expr.fullname] = tvar_def\n return tvar_def", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/tvar_scope.py_TypeVarLikeScope.bind_existing_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/tvar_scope.py_TypeVarLikeScope.bind_existing_", "embedding": null, "metadata": {"file_path": "mypy/tvar_scope.py", "file_name": "tvar_scope.py", "file_type": "text/x-python", "category": "implementation", "start_line": 89, "end_line": 107, "span_ids": ["TypeVarLikeScope.__str__", "TypeVarLikeScope.get_binding", "TypeVarLikeScope.bind_existing"], "tokens": 185}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeVarLikeScope:\n\n def bind_existing(self, tvar_def: TypeVarLikeDef) -> None:\n self.scope[tvar_def.fullname] = tvar_def\n\n def get_binding(self, item: Union[str, SymbolTableNode]) -> Optional[TypeVarLikeDef]:\n fullname = item.fullname if isinstance(item, SymbolTableNode) else item\n assert fullname is not None\n if fullname in self.scope:\n return self.scope[fullname]\n elif self.parent is not None:\n return self.parent.get_binding(fullname)\n else:\n return None\n\n def __str__(self) -> str:\n me = \", \".join('{}: {}`{}'.format(k, v.name, v.id) for k, v in self.scope.items())\n if self.parent is None:\n return me\n return \"{} <- {}\".format(str(self.parent), me)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/type_visitor.py__Type_visitor_classes__from_mypy_types_import_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/type_visitor.py__Type_visitor_classes__from_mypy_types_import_", "embedding": null, "metadata": {"file_path": "mypy/type_visitor.py", "file_name": "type_visitor.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 27, "span_ids": ["docstring"], "tokens": 272}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Type visitor classes.\n\nThis module defines the type visitors that are intended to be\nsubclassed by other code. They have been separated out into their own\nmodule to ease converting mypy to run under mypyc, since currently\nmypyc-extension classes can extend interpreted classes but not the\nother way around. Separating them out, then, allows us to compile\ntypes before we can compile everything that uses a TypeVisitor.\n\nThe visitors are all re-exported from mypy.types and that is how\nother modules refer to them.\n\"\"\"\n\nfrom abc import abstractmethod\nfrom mypy.ordered_dict import OrderedDict\nfrom typing import Generic, TypeVar, cast, Any, List, Callable, Iterable, Optional, Set, Sequence\nfrom mypy_extensions import trait, mypyc_attr\n\nT = TypeVar('T')\n\nfrom mypy.types import (\n Type, AnyType, CallableType, Overloaded, TupleType, TypedDictType, LiteralType,\n RawExpressionType, Instance, NoneType, TypeType,\n UnionType, TypeVarType, PartialType, DeletedType, UninhabitedType, TypeVarLikeDef,\n UnboundType, ErasedType, StarType, EllipsisType, TypeList, CallableArgument,\n PlaceholderType, TypeAliasType, get_proper_type\n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/type_visitor.py_TypeVisitor_TypeVisitor.visit_type_alias_type.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/type_visitor.py_TypeVisitor_TypeVisitor.visit_type_alias_type.pass", "embedding": null, "metadata": {"file_path": "mypy/type_visitor.py", "file_name": "type_visitor.py", "file_type": "text/x-python", "category": "implementation", "start_line": 30, "end_line": 104, "span_ids": ["TypeVisitor.visit_partial_type", "TypeVisitor.visit_type_type", "TypeVisitor.visit_type_var", "TypeVisitor.visit_deleted_type", "TypeVisitor.visit_overloaded", "TypeVisitor.visit_any", "TypeVisitor", "TypeVisitor.visit_instance", "TypeVisitor.visit_union_type", "TypeVisitor.visit_callable_type", "TypeVisitor.visit_type_alias_type", "TypeVisitor.visit_uninhabited_type", "TypeVisitor.visit_none_type", "TypeVisitor.visit_unbound_type", "TypeVisitor.visit_tuple_type", "TypeVisitor.visit_literal_type", "TypeVisitor.visit_erased_type", "TypeVisitor.visit_typeddict_type"], "tokens": 434}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@trait\n@mypyc_attr(allow_interpreted_subclasses=True)\nclass TypeVisitor(Generic[T]):\n \"\"\"Visitor class for types (Type subclasses).\n\n The parameter T is the return type of the visit methods.\n \"\"\"\n\n @abstractmethod\n def visit_unbound_type(self, t: UnboundType) -> T:\n pass\n\n @abstractmethod\n def visit_any(self, t: AnyType) -> T:\n pass\n\n @abstractmethod\n def visit_none_type(self, t: NoneType) -> T:\n pass\n\n @abstractmethod\n def visit_uninhabited_type(self, t: UninhabitedType) -> T:\n pass\n\n @abstractmethod\n def visit_erased_type(self, t: ErasedType) -> T:\n pass\n\n @abstractmethod\n def visit_deleted_type(self, t: DeletedType) -> T:\n pass\n\n @abstractmethod\n def visit_type_var(self, t: TypeVarType) -> T:\n pass\n\n @abstractmethod\n def visit_instance(self, t: Instance) -> T:\n pass\n\n @abstractmethod\n def visit_callable_type(self, t: CallableType) -> T:\n pass\n\n @abstractmethod\n def visit_overloaded(self, t: Overloaded) -> T:\n pass\n\n @abstractmethod\n def visit_tuple_type(self, t: TupleType) -> T:\n pass\n\n @abstractmethod\n def visit_typeddict_type(self, t: TypedDictType) -> T:\n pass\n\n @abstractmethod\n def visit_literal_type(self, t: LiteralType) -> T:\n pass\n\n @abstractmethod\n def visit_union_type(self, t: UnionType) -> T:\n pass\n\n @abstractmethod\n def visit_partial_type(self, t: PartialType) -> T:\n pass\n\n @abstractmethod\n def visit_type_type(self, t: TypeType) -> T:\n pass\n\n @abstractmethod\n def visit_type_alias_type(self, t: TypeAliasType) -> T:\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/type_visitor.py_SyntheticTypeVisitor_SyntheticTypeVisitor.visit_placeholder_type.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/type_visitor.py_SyntheticTypeVisitor_SyntheticTypeVisitor.visit_placeholder_type.pass", "embedding": null, "metadata": {"file_path": "mypy/type_visitor.py", "file_name": "type_visitor.py", "file_type": "text/x-python", "category": "implementation", "start_line": 107, "end_line": 136, "span_ids": ["SyntheticTypeVisitor.visit_callable_argument", "SyntheticTypeVisitor.visit_type_list", "SyntheticTypeVisitor.visit_raw_expression_type", "SyntheticTypeVisitor.visit_star_type", "SyntheticTypeVisitor.visit_ellipsis_type", "SyntheticTypeVisitor", "SyntheticTypeVisitor.visit_placeholder_type"], "tokens": 180}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@trait\n@mypyc_attr(allow_interpreted_subclasses=True)\nclass SyntheticTypeVisitor(TypeVisitor[T]):\n \"\"\"A TypeVisitor that also knows how to visit synthetic AST constructs.\n\n Not just real types.\"\"\"\n\n @abstractmethod\n def visit_star_type(self, t: StarType) -> T:\n pass\n\n @abstractmethod\n def visit_type_list(self, t: TypeList) -> T:\n pass\n\n @abstractmethod\n def visit_callable_argument(self, t: CallableArgument) -> T:\n pass\n\n @abstractmethod\n def visit_ellipsis_type(self, t: EllipsisType) -> T:\n pass\n\n @abstractmethod\n def visit_raw_expression_type(self, t: RawExpressionType) -> T:\n pass\n\n @abstractmethod\n def visit_placeholder_type(self, t: PlaceholderType) -> T:\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/type_visitor.py_TypeTranslator_TypeTranslator.visit_deleted_type.return.t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/type_visitor.py_TypeTranslator_TypeTranslator.visit_deleted_type.return.t", "embedding": null, "metadata": {"file_path": "mypy/type_visitor.py", "file_name": "type_visitor.py", "file_type": "text/x-python", "category": "implementation", "start_line": 139, "end_line": 163, "span_ids": ["TypeTranslator", "TypeTranslator.visit_any", "TypeTranslator.visit_uninhabited_type", "TypeTranslator.visit_none_type", "TypeTranslator.visit_unbound_type", "TypeTranslator.visit_deleted_type", "TypeTranslator.visit_erased_type"], "tokens": 169}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@mypyc_attr(allow_interpreted_subclasses=True)\nclass TypeTranslator(TypeVisitor[Type]):\n \"\"\"Identity type transformation.\n\n Subclass this and override some methods to implement a non-trivial\n transformation.\n \"\"\"\n\n def visit_unbound_type(self, t: UnboundType) -> Type:\n return t\n\n def visit_any(self, t: AnyType) -> Type:\n return t\n\n def visit_none_type(self, t: NoneType) -> Type:\n return t\n\n def visit_uninhabited_type(self, t: UninhabitedType) -> Type:\n return t\n\n def visit_erased_type(self, t: ErasedType) -> Type:\n return t\n\n def visit_deleted_type(self, t: DeletedType) -> Type:\n return t", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/type_visitor.py_TypeTranslator.visit_instance_TypeTranslator.visit_instance.return.Instance_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/type_visitor.py_TypeTranslator.visit_instance_TypeTranslator.visit_instance.return.Instance_", "embedding": null, "metadata": {"file_path": "mypy/type_visitor.py", "file_name": "type_visitor.py", "file_type": "text/x-python", "category": "implementation", "start_line": 165, "end_line": 177, "span_ids": ["TypeTranslator.visit_instance"], "tokens": 138}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@mypyc_attr(allow_interpreted_subclasses=True)\nclass TypeTranslator(TypeVisitor[Type]):\n\n def visit_instance(self, t: Instance) -> Type:\n last_known_value = None # type: Optional[LiteralType]\n if t.last_known_value is not None:\n raw_last_known_value = t.last_known_value.accept(self)\n assert isinstance(raw_last_known_value, LiteralType) # type: ignore\n last_known_value = raw_last_known_value\n return Instance(\n typ=t.type,\n args=self.translate_types(t.args),\n line=t.line,\n column=t.column,\n last_known_value=last_known_value,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/type_visitor.py_TypeTranslator.visit_type_var_TypeTranslator.visit_type_alias_type.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/type_visitor.py_TypeTranslator.visit_type_var_TypeTranslator.visit_type_alias_type.pass", "embedding": null, "metadata": {"file_path": "mypy/type_visitor.py", "file_name": "type_visitor.py", "file_type": "text/x-python", "category": "implementation", "start_line": 179, "end_line": 244, "span_ids": ["TypeTranslator.visit_literal_type", "TypeTranslator.translate_variables", "TypeTranslator.visit_type_var", "TypeTranslator.visit_partial_type", "TypeTranslator.visit_overloaded", "TypeTranslator.visit_typeddict_type", "TypeTranslator.visit_callable_type", "TypeTranslator.visit_type_type", "TypeTranslator.visit_union_type", "TypeTranslator.visit_tuple_type", "TypeTranslator.visit_type_alias_type", "TypeTranslator.translate_types"], "tokens": 586}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@mypyc_attr(allow_interpreted_subclasses=True)\nclass TypeTranslator(TypeVisitor[Type]):\n\n def visit_type_var(self, t: TypeVarType) -> Type:\n return t\n\n def visit_partial_type(self, t: PartialType) -> Type:\n return t\n\n def visit_callable_type(self, t: CallableType) -> Type:\n return t.copy_modified(arg_types=self.translate_types(t.arg_types),\n ret_type=t.ret_type.accept(self),\n variables=self.translate_variables(t.variables))\n\n def visit_tuple_type(self, t: TupleType) -> Type:\n return TupleType(self.translate_types(t.items),\n # TODO: This appears to be unsafe.\n cast(Any, t.partial_fallback.accept(self)),\n t.line, t.column)\n\n def visit_typeddict_type(self, t: TypedDictType) -> Type:\n items = OrderedDict([\n (item_name, item_type.accept(self))\n for (item_name, item_type) in t.items.items()\n ])\n return TypedDictType(items,\n t.required_keys,\n # TODO: This appears to be unsafe.\n cast(Any, t.fallback.accept(self)),\n t.line, t.column)\n\n def visit_literal_type(self, t: LiteralType) -> Type:\n fallback = t.fallback.accept(self)\n assert isinstance(fallback, Instance) # type: ignore\n return LiteralType(\n value=t.value,\n fallback=fallback,\n line=t.line,\n column=t.column,\n )\n\n def visit_union_type(self, t: UnionType) -> Type:\n return UnionType(self.translate_types(t.items), t.line, t.column)\n\n def translate_types(self, types: Iterable[Type]) -> List[Type]:\n return [t.accept(self) for t in types]\n\n def translate_variables(self,\n variables: Sequence[TypeVarLikeDef]) -> Sequence[TypeVarLikeDef]:\n return variables\n\n def visit_overloaded(self, t: Overloaded) -> Type:\n items = [] # type: List[CallableType]\n for item in t.items():\n new = item.accept(self)\n assert isinstance(new, CallableType) # type: ignore\n items.append(new)\n return Overloaded(items=items)\n\n def visit_type_type(self, t: TypeType) -> Type:\n return TypeType.make_normalized(t.item.accept(self), line=t.line, column=t.column)\n\n @abstractmethod\n def visit_type_alias_type(self, t: TypeAliasType) -> Type:\n # This method doesn't have a default implementation for type translators,\n # because type aliases are special: some information is contained in the\n # TypeAlias node, and we normally don't generate new nodes. Every subclass\n # must implement this depending on its semantics.\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/type_visitor.py_TypeQuery_TypeQuery.visit_type_alias_type.return.get_proper_type_t_accept": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/type_visitor.py_TypeQuery_TypeQuery.visit_type_alias_type.return.get_proper_type_t_accept", "embedding": null, "metadata": {"file_path": "mypy/type_visitor.py", "file_name": "type_visitor.py", "file_type": "text/x-python", "category": "implementation", "start_line": 247, "end_line": 335, "span_ids": ["TypeQuery.visit_overloaded", "TypeQuery.visit_placeholder_type", "TypeQuery.visit_instance", "TypeQuery.visit_uninhabited_type", "TypeQuery.visit_union_type", "TypeQuery.visit_type_list", "TypeQuery.visit_partial_type", "TypeQuery.visit_ellipsis_type", "TypeQuery.visit_typeddict_type", "TypeQuery.visit_raw_expression_type", "TypeQuery.visit_callable_argument", "TypeQuery.visit_callable_type", "TypeQuery.__init__", "TypeQuery.visit_erased_type", "TypeQuery.visit_type_type", "TypeQuery.visit_star_type", "TypeQuery.visit_none_type", "TypeQuery.visit_tuple_type", "TypeQuery.visit_unbound_type", "TypeQuery.visit_literal_type", "TypeQuery.visit_any", "TypeQuery.visit_type_alias_type", "TypeQuery.visit_deleted_type", "TypeQuery.visit_type_var", "TypeQuery"], "tokens": 742}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@mypyc_attr(allow_interpreted_subclasses=True)\nclass TypeQuery(SyntheticTypeVisitor[T]):\n \"\"\"Visitor for performing queries of types.\n\n strategy is used to combine results for a series of types,\n common use cases involve a boolean query using `any` or `all`.\n\n Note: this visitor keeps an internal state (tracks type aliases to avoid\n recursion), so it should *never* be re-used for querying different types,\n create a new visitor instance instead.\n\n # TODO: check that we don't have existing violations of this rule.\n \"\"\"\n\n def __init__(self, strategy: Callable[[Iterable[T]], T]) -> None:\n self.strategy = strategy\n # Keep track of the type aliases already visited. This is needed to avoid\n # infinite recursion on types like A = Union[int, List[A]].\n self.seen_aliases = set() # type: Set[TypeAliasType]\n\n def visit_unbound_type(self, t: UnboundType) -> T:\n return self.query_types(t.args)\n\n def visit_type_list(self, t: TypeList) -> T:\n return self.query_types(t.items)\n\n def visit_callable_argument(self, t: CallableArgument) -> T:\n return t.typ.accept(self)\n\n def visit_any(self, t: AnyType) -> T:\n return self.strategy([])\n\n def visit_uninhabited_type(self, t: UninhabitedType) -> T:\n return self.strategy([])\n\n def visit_none_type(self, t: NoneType) -> T:\n return self.strategy([])\n\n def visit_erased_type(self, t: ErasedType) -> T:\n return self.strategy([])\n\n def visit_deleted_type(self, t: DeletedType) -> T:\n return self.strategy([])\n\n def visit_type_var(self, t: TypeVarType) -> T:\n return self.query_types([t.upper_bound] + t.values)\n\n def visit_partial_type(self, t: PartialType) -> T:\n return self.strategy([])\n\n def visit_instance(self, t: Instance) -> T:\n return self.query_types(t.args)\n\n def visit_callable_type(self, t: CallableType) -> T:\n # FIX generics\n return self.query_types(t.arg_types + [t.ret_type])\n\n def visit_tuple_type(self, t: TupleType) -> T:\n return self.query_types(t.items)\n\n def visit_typeddict_type(self, t: TypedDictType) -> T:\n return self.query_types(t.items.values())\n\n def visit_raw_expression_type(self, t: RawExpressionType) -> T:\n return self.strategy([])\n\n def visit_literal_type(self, t: LiteralType) -> T:\n return self.strategy([])\n\n def visit_star_type(self, t: StarType) -> T:\n return t.type.accept(self)\n\n def visit_union_type(self, t: UnionType) -> T:\n return self.query_types(t.items)\n\n def visit_overloaded(self, t: Overloaded) -> T:\n return self.query_types(t.items())\n\n def visit_type_type(self, t: TypeType) -> T:\n return t.item.accept(self)\n\n def visit_ellipsis_type(self, t: EllipsisType) -> T:\n return self.strategy([])\n\n def visit_placeholder_type(self, t: PlaceholderType) -> T:\n return self.query_types(t.args)\n\n def visit_type_alias_type(self, t: TypeAliasType) -> T:\n return get_proper_type(t).accept(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/type_visitor.py_TypeQuery.query_types_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/type_visitor.py_TypeQuery.query_types_", "embedding": null, "metadata": {"file_path": "mypy/type_visitor.py", "file_name": "type_visitor.py", "file_type": "text/x-python", "category": "implementation", "start_line": 337, "end_line": 354, "span_ids": ["TypeQuery.query_types"], "tokens": 169}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@mypyc_attr(allow_interpreted_subclasses=True)\nclass TypeQuery(SyntheticTypeVisitor[T]):\n\n def query_types(self, types: Iterable[Type]) -> T:\n \"\"\"Perform a query for a list of types.\n\n Use the strategy to combine the results.\n Skip type aliases already visited types to avoid infinite recursion.\n \"\"\"\n res = [] # type: List[T]\n for t in types:\n if isinstance(t, TypeAliasType):\n # Avoid infinite recursion for recursive type aliases.\n # TODO: Ideally we should fire subvisitors here (or use caching) if we care\n # about duplicates.\n if t in self.seen_aliases:\n continue\n self.seen_aliases.add(t)\n res.append(t.accept(self))\n return self.strategy(res)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py__Semantic_analysis_of_t_GENERIC_STUB_NOT_AT_RUNTIME_TYPES._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py__Semantic_analysis_of_t_GENERIC_STUB_NOT_AT_RUNTIME_TYPES._", "embedding": null, "metadata": {"file_path": "mypy/typeanal.py", "file_name": "typeanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 63, "span_ids": ["docstring:3", "docstring"], "tokens": 595}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Semantic analysis of types\"\"\"\n\nimport itertools\nfrom itertools import chain\nfrom contextlib import contextmanager\nfrom mypy.ordered_dict import OrderedDict\n\nfrom typing import Callable, List, Optional, Set, Tuple, Iterator, TypeVar, Iterable, Sequence\nfrom typing_extensions import Final\nfrom mypy_extensions import DefaultNamedArg\n\nfrom mypy.messages import MessageBuilder, quote_type_string, format_type_bare\nfrom mypy.options import Options\nfrom mypy.types import (\n Type, UnboundType, TypeVarType, TupleType, TypedDictType, UnionType, Instance, AnyType,\n CallableType, NoneType, ErasedType, DeletedType, TypeList, TypeVarDef, SyntheticTypeVisitor,\n StarType, PartialType, EllipsisType, UninhabitedType, TypeType,\n CallableArgument, TypeQuery, union_items, TypeOfAny, LiteralType, RawExpressionType,\n PlaceholderType, Overloaded, get_proper_type, TypeAliasType, TypeVarLikeDef, ParamSpecDef\n)\n\nfrom mypy.nodes import (\n TypeInfo, Context, SymbolTableNode, Var, Expression,\n get_nongen_builtins, check_arg_names, check_arg_kinds, ARG_POS, ARG_NAMED,\n ARG_OPT, ARG_NAMED_OPT, ARG_STAR, ARG_STAR2, TypeVarExpr, TypeVarLikeExpr, ParamSpecExpr,\n TypeAlias, PlaceholderNode, SYMBOL_FUNCBASE_TYPES, Decorator, MypyFile\n)\nfrom mypy.typetraverser import TypeTraverserVisitor\nfrom mypy.tvar_scope import TypeVarLikeScope\nfrom mypy.exprtotype import expr_to_unanalyzed_type, TypeTranslationError\nfrom mypy.plugin import Plugin, TypeAnalyzerPluginInterface, AnalyzeTypeContext\nfrom mypy.semanal_shared import SemanticAnalyzerCoreInterface\nfrom mypy.errorcodes import ErrorCode\nfrom mypy import nodes, message_registry, errorcodes as codes\n\nT = TypeVar('T')\n\ntype_constructors = {\n 'typing.Callable',\n 'typing.Optional',\n 'typing.Tuple',\n 'typing.Type',\n 'typing.Union',\n 'typing.Literal',\n 'typing_extensions.Literal',\n 'typing.Annotated',\n 'typing_extensions.Annotated',\n} # type: Final\n\nARG_KINDS_BY_CONSTRUCTOR = {\n 'mypy_extensions.Arg': ARG_POS,\n 'mypy_extensions.DefaultArg': ARG_OPT,\n 'mypy_extensions.NamedArg': ARG_NAMED,\n 'mypy_extensions.DefaultNamedArg': ARG_NAMED_OPT,\n 'mypy_extensions.VarArg': ARG_STAR,\n 'mypy_extensions.KwArg': ARG_STAR2,\n} # type: Final\n\nGENERIC_STUB_NOT_AT_RUNTIME_TYPES = {\n 'queue.Queue',\n 'builtins._PathLike',\n 'asyncio.futures.Future',\n}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser_TypeAnalyser.visit_unbound_type.return.typ": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser_TypeAnalyser.visit_unbound_type.return.typ", "embedding": null, "metadata": {"file_path": "mypy/typeanal.py", "file_name": "typeanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 103, "end_line": 165, "span_ids": ["TypeAnalyser", "TypeAnalyser.__init__", "TypeAnalyser.visit_unbound_type"], "tokens": 625}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeAnalyser(SyntheticTypeVisitor[Type], TypeAnalyzerPluginInterface):\n \"\"\"Semantic analyzer for types.\n\n Converts unbound types into bound types. This is a no-op for already\n bound types.\n\n If an incomplete reference is encountered, this does a defer. The\n caller never needs to defer.\n \"\"\"\n\n # Is this called from an untyped function definition?\n in_dynamic_func = False # type: bool\n # Is this called from global scope?\n global_scope = True # type: bool\n\n def __init__(self,\n api: SemanticAnalyzerCoreInterface,\n tvar_scope: TypeVarLikeScope,\n plugin: Plugin,\n options: Options,\n is_typeshed_stub: bool, *,\n defining_alias: bool = False,\n allow_tuple_literal: bool = False,\n allow_unnormalized: bool = False,\n allow_unbound_tvars: bool = False,\n allow_placeholder: bool = False,\n report_invalid_types: bool = True) -> None:\n self.api = api\n self.lookup_qualified = api.lookup_qualified\n self.lookup_fqn_func = api.lookup_fully_qualified\n self.fail_func = api.fail\n self.note_func = api.note\n self.tvar_scope = tvar_scope\n # Are we analysing a type alias definition rvalue?\n self.defining_alias = defining_alias\n self.allow_tuple_literal = allow_tuple_literal\n # Positive if we are analyzing arguments of another (outer) type\n self.nesting_level = 0\n # Should we allow unnormalized types like `list[int]`\n # (currently allowed in stubs)?\n self.allow_unnormalized = allow_unnormalized\n # Should we accept unbound type variables (always OK in aliases)?\n self.allow_unbound_tvars = allow_unbound_tvars or defining_alias\n # If false, record incomplete ref if we generate PlaceholderType.\n self.allow_placeholder = allow_placeholder\n # Should we report an error whenever we encounter a RawExpressionType outside\n # of a Literal context: e.g. whenever we encounter an invalid type? Normally,\n # we want to report an error, but the caller may want to do more specialized\n # error handling.\n self.report_invalid_types = report_invalid_types\n self.plugin = plugin\n self.options = options\n self.is_typeshed_stub = is_typeshed_stub\n # Names of type aliases encountered while analysing a type will be collected here.\n self.aliases_used = set() # type: Set[str]\n\n def visit_unbound_type(self, t: UnboundType, defining_literal: bool = False) -> Type:\n typ = self.visit_unbound_type_nonoptional(t, defining_literal)\n if t.optional:\n # We don't need to worry about double-wrapping Optionals or\n # wrapping Anys: Union simplification will take care of that.\n return make_optional_type(typ)\n return typ", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.visit_unbound_type_nonoptional_TypeAnalyser.cannot_resolve_type.self_api_fail_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.visit_unbound_type_nonoptional_TypeAnalyser.cannot_resolve_type.self_api_fail_", "embedding": null, "metadata": {"file_path": "mypy/typeanal.py", "file_name": "typeanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 170, "end_line": 264, "span_ids": ["TypeAnalyser.cannot_resolve_type", "TypeAnalyser.visit_unbound_type_nonoptional"], "tokens": 985}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeAnalyser(SyntheticTypeVisitor[Type], TypeAnalyzerPluginInterface):\n\n def visit_unbound_type_nonoptional(self, t: UnboundType, defining_literal: bool) -> Type:\n sym = self.lookup_qualified(t.name, t)\n if sym is not None:\n node = sym.node\n if isinstance(node, PlaceholderNode):\n if node.becomes_typeinfo:\n # Reference to placeholder type.\n if self.api.final_iteration:\n self.cannot_resolve_type(t)\n return AnyType(TypeOfAny.from_error)\n elif self.allow_placeholder:\n self.api.defer()\n else:\n self.api.record_incomplete_ref()\n return PlaceholderType(node.fullname, self.anal_array(t.args), t.line)\n else:\n if self.api.final_iteration:\n self.cannot_resolve_type(t)\n return AnyType(TypeOfAny.from_error)\n else:\n # Reference to an unknown placeholder node.\n self.api.record_incomplete_ref()\n return AnyType(TypeOfAny.special_form)\n if node is None:\n self.fail('Internal error (node is None, kind={})'.format(sym.kind), t)\n return AnyType(TypeOfAny.special_form)\n fullname = node.fullname\n hook = self.plugin.get_type_analyze_hook(fullname)\n if hook is not None:\n return hook(AnalyzeTypeContext(t, t, self))\n if (fullname in get_nongen_builtins(self.options.python_version)\n and t.args and\n not self.allow_unnormalized and\n not self.api.is_future_flag_set(\"annotations\")):\n self.fail(no_subscript_builtin_alias(fullname,\n propose_alt=not self.defining_alias), t)\n tvar_def = self.tvar_scope.get_binding(sym)\n if isinstance(sym.node, ParamSpecExpr):\n if tvar_def is None:\n self.fail('ParamSpec \"{}\" is unbound'.format(t.name), t)\n return AnyType(TypeOfAny.from_error)\n self.fail('Invalid location for ParamSpec \"{}\"'.format(t.name), t)\n self.note(\n 'You can use ParamSpec as the first argument to Callable, e.g., '\n \"'Callable[{}, int]'\".format(t.name),\n t\n )\n return AnyType(TypeOfAny.from_error)\n if isinstance(sym.node, TypeVarExpr) and tvar_def is not None and self.defining_alias:\n self.fail('Can\\'t use bound type variable \"{}\"'\n ' to define generic alias'.format(t.name), t)\n return AnyType(TypeOfAny.from_error)\n if isinstance(sym.node, TypeVarExpr) and tvar_def is not None:\n assert isinstance(tvar_def, TypeVarDef)\n if len(t.args) > 0:\n self.fail('Type variable \"{}\" used with arguments'.format(t.name), t)\n return TypeVarType(tvar_def, t.line)\n special = self.try_analyze_special_unbound_type(t, fullname)\n if special is not None:\n return special\n if isinstance(node, TypeAlias):\n self.aliases_used.add(fullname)\n an_args = self.anal_array(t.args)\n disallow_any = self.options.disallow_any_generics and not self.is_typeshed_stub\n res = expand_type_alias(node, an_args, self.fail, node.no_args, t,\n unexpanded_type=t,\n disallow_any=disallow_any)\n # The only case where expand_type_alias() can return an incorrect instance is\n # when it is top-level instance, so no need to recurse.\n if (isinstance(res, Instance) and # type: ignore[misc]\n len(res.args) != len(res.type.type_vars) and\n not self.defining_alias):\n fix_instance(\n res,\n self.fail,\n self.note,\n disallow_any=disallow_any,\n python_version=self.options.python_version,\n use_generic_error=True,\n unexpanded_type=t)\n return res\n elif isinstance(node, TypeInfo):\n return self.analyze_type_with_type_info(node, t.args, t)\n else:\n return self.analyze_unbound_type_without_type_info(t, sym, defining_literal)\n else: # sym is None\n return AnyType(TypeOfAny.special_form)\n\n def cannot_resolve_type(self, t: UnboundType) -> None:\n # TODO: Move error message generation to messages.py. We'd first\n # need access to MessageBuilder here. Also move the similar\n # message generation logic in semanal.py.\n self.api.fail(\n 'Cannot resolve name \"{}\" (possible cyclic definition)'.format(t.name),\n t)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.try_analyze_special_unbound_type_TypeAnalyser.try_analyze_special_unbound_type.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.try_analyze_special_unbound_type_TypeAnalyser.try_analyze_special_unbound_type.return.None", "embedding": null, "metadata": {"file_path": "mypy/typeanal.py", "file_name": "typeanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 266, "end_line": 351, "span_ids": ["TypeAnalyser.try_analyze_special_unbound_type"], "tokens": 1069}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeAnalyser(SyntheticTypeVisitor[Type], TypeAnalyzerPluginInterface):\n\n def try_analyze_special_unbound_type(self, t: UnboundType, fullname: str) -> Optional[Type]:\n \"\"\"Bind special type that is recognized through magic name such as 'typing.Any'.\n\n Return the bound type if successful, and return None if the type is a normal type.\n \"\"\"\n if fullname == 'builtins.None':\n return NoneType()\n elif fullname == 'typing.Any' or fullname == 'builtins.Any':\n return AnyType(TypeOfAny.explicit)\n elif fullname in ('typing.Final', 'typing_extensions.Final'):\n self.fail(\"Final can be only used as an outermost qualifier\"\n \" in a variable annotation\", t)\n return AnyType(TypeOfAny.from_error)\n elif (fullname == 'typing.Tuple' or\n (fullname == 'builtins.tuple' and (self.options.python_version >= (3, 9) or\n self.api.is_future_flag_set('annotations')))):\n # Tuple is special because it is involved in builtin import cycle\n # and may be not ready when used.\n sym = self.api.lookup_fully_qualified_or_none('builtins.tuple')\n if not sym or isinstance(sym.node, PlaceholderNode):\n if self.api.is_incomplete_namespace('builtins'):\n self.api.record_incomplete_ref()\n else:\n self.fail('Name \"tuple\" is not defined', t)\n return AnyType(TypeOfAny.special_form)\n if len(t.args) == 0 and not t.empty_tuple_index:\n # Bare 'Tuple' is same as 'tuple'\n any_type = self.get_omitted_any(t)\n return self.named_type('builtins.tuple', [any_type],\n line=t.line, column=t.column)\n if len(t.args) == 2 and isinstance(t.args[1], EllipsisType):\n # Tuple[T, ...] (uniform, variable-length tuple)\n instance = self.named_type('builtins.tuple', [self.anal_type(t.args[0])])\n instance.line = t.line\n return instance\n return self.tuple_type(self.anal_array(t.args))\n elif fullname == 'typing.Union':\n items = self.anal_array(t.args)\n return UnionType.make_union(items)\n elif fullname == 'typing.Optional':\n if len(t.args) != 1:\n self.fail('Optional[...] must have exactly one type argument', t)\n return AnyType(TypeOfAny.from_error)\n item = self.anal_type(t.args[0])\n return make_optional_type(item)\n elif fullname == 'typing.Callable':\n return self.analyze_callable_type(t)\n elif (fullname == 'typing.Type' or\n (fullname == 'builtins.type' and (self.options.python_version >= (3, 9) or\n self.api.is_future_flag_set('annotations')))):\n if len(t.args) == 0:\n if fullname == 'typing.Type':\n any_type = self.get_omitted_any(t)\n return TypeType(any_type, line=t.line, column=t.column)\n else:\n # To prevent assignment of 'builtins.type' inferred as 'builtins.object'\n # See https://github.com/python/mypy/issues/9476 for more information\n return None\n type_str = 'Type[...]' if fullname == 'typing.Type' else 'type[...]'\n if len(t.args) != 1:\n self.fail(type_str + ' must have exactly one type argument', t)\n item = self.anal_type(t.args[0])\n return TypeType.make_normalized(item, line=t.line)\n elif fullname == 'typing.ClassVar':\n if self.nesting_level > 0:\n self.fail('Invalid type: ClassVar nested inside other type', t)\n if len(t.args) == 0:\n return AnyType(TypeOfAny.from_omitted_generics, line=t.line, column=t.column)\n if len(t.args) != 1:\n self.fail('ClassVar[...] must have at most one type argument', t)\n return AnyType(TypeOfAny.from_error)\n return self.anal_type(t.args[0])\n elif fullname in ('mypy_extensions.NoReturn', 'typing.NoReturn'):\n return UninhabitedType(is_noreturn=True)\n elif fullname in ('typing_extensions.Literal', 'typing.Literal'):\n return self.analyze_literal_type(t)\n elif fullname in ('typing_extensions.Annotated', 'typing.Annotated'):\n if len(t.args) < 2:\n self.fail(\"Annotated[...] must have exactly one type argument\"\n \" and at least one annotation\", t)\n return AnyType(TypeOfAny.from_error)\n return self.anal_type(t.args[0])\n elif self.anal_type_guard_arg(t, fullname) is not None:\n # In most contexts, TypeGuard[...] acts as an alias for bool (ignoring its args)\n return self.named_type('builtins.bool')\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.get_omitted_any_TypeAnalyser.analyze_type_with_type_info.return.instance": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.get_omitted_any_TypeAnalyser.analyze_type_with_type_info.return.instance", "embedding": null, "metadata": {"file_path": "mypy/typeanal.py", "file_name": "typeanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 350, "end_line": 397, "span_ids": ["TypeAnalyser.analyze_type_with_type_info", "TypeAnalyser.get_omitted_any"], "tokens": 538}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeAnalyser(SyntheticTypeVisitor[Type], TypeAnalyzerPluginInterface):\n\n def get_omitted_any(self, typ: Type, fullname: Optional[str] = None) -> AnyType:\n disallow_any = not self.is_typeshed_stub and self.options.disallow_any_generics\n return get_omitted_any(disallow_any, self.fail, self.note, typ,\n self.options.python_version, fullname)\n\n def analyze_type_with_type_info(\n self, info: TypeInfo, args: Sequence[Type], ctx: Context) -> Type:\n \"\"\"Bind unbound type when were able to find target TypeInfo.\n\n This handles simple cases like 'int', 'modname.UserClass[str]', etc.\n \"\"\"\n\n if len(args) > 0 and info.fullname == 'builtins.tuple':\n fallback = Instance(info, [AnyType(TypeOfAny.special_form)], ctx.line)\n return TupleType(self.anal_array(args), fallback, ctx.line)\n # Analyze arguments and (usually) construct Instance type. The\n # number of type arguments and their values are\n # checked only later, since we do not always know the\n # valid count at this point. Thus we may construct an\n # Instance with an invalid number of type arguments.\n instance = Instance(info, self.anal_array(args), ctx.line, ctx.column)\n # Check type argument count.\n if len(instance.args) != len(info.type_vars) and not self.defining_alias:\n fix_instance(instance, self.fail, self.note,\n disallow_any=self.options.disallow_any_generics and\n not self.is_typeshed_stub,\n python_version=self.options.python_version)\n\n tup = info.tuple_type\n if tup is not None:\n # The class has a Tuple[...] base class so it will be\n # represented as a tuple type.\n if args:\n self.fail('Generic tuple types not supported', ctx)\n return AnyType(TypeOfAny.from_error)\n return tup.copy_modified(items=self.anal_array(tup.items),\n fallback=instance)\n td = info.typeddict_type\n if td is not None:\n # The class has a TypedDict[...] base class so it will be\n # represented as a typeddict type.\n if args:\n self.fail('Generic TypedDict types not supported', ctx)\n return AnyType(TypeOfAny.from_error)\n # Create a named TypedDictType\n return td.copy_modified(item_types=self.anal_array(list(td.items.values())),\n fallback=instance)\n return instance", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.analyze_unbound_type_without_type_info_TypeAnalyser.analyze_unbound_type_without_type_info._type_List_str_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.analyze_unbound_type_without_type_info_TypeAnalyser.analyze_unbound_type_without_type_info._type_List_str_", "embedding": null, "metadata": {"file_path": "mypy/typeanal.py", "file_name": "typeanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 390, "end_line": 446, "span_ids": ["TypeAnalyser.analyze_unbound_type_without_type_info"], "tokens": 620}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeAnalyser(SyntheticTypeVisitor[Type], TypeAnalyzerPluginInterface):\n\n def analyze_unbound_type_without_type_info(self, t: UnboundType, sym: SymbolTableNode,\n defining_literal: bool) -> Type:\n \"\"\"Figure out what an unbound type that doesn't refer to a TypeInfo node means.\n\n This is something unusual. We try our best to find out what it is.\n \"\"\"\n name = sym.fullname\n if name is None:\n assert sym.node is not None\n name = sym.node.name\n # Option 1:\n # Something with an Any type -- make it an alias for Any in a type\n # context. This is slightly problematic as it allows using the type 'Any'\n # as a base class -- however, this will fail soon at runtime so the problem\n # is pretty minor.\n if isinstance(sym.node, Var):\n typ = get_proper_type(sym.node.type)\n if isinstance(typ, AnyType):\n return AnyType(TypeOfAny.from_unimported_type,\n missing_import_name=typ.missing_import_name)\n # Option 2:\n # Unbound type variable. Currently these may be still valid,\n # for example when defining a generic type alias.\n unbound_tvar = (isinstance(sym.node, TypeVarExpr) and\n self.tvar_scope.get_binding(sym) is None)\n if self.allow_unbound_tvars and unbound_tvar:\n return t\n\n # Option 3:\n # Enum value. Note: we only want to return a LiteralType when\n # we're using this enum value specifically within context of\n # a \"Literal[...]\" type. So, if `defining_literal` is not set,\n # we bail out early with an error.\n #\n # If, in the distant future, we decide to permit things like\n # `def foo(x: Color.RED) -> None: ...`, we can remove that\n # check entirely.\n if isinstance(sym.node, Var) and sym.node.info and sym.node.info.is_enum:\n value = sym.node.name\n base_enum_short_name = sym.node.info.name\n if not defining_literal:\n msg = message_registry.INVALID_TYPE_RAW_ENUM_VALUE.format(\n base_enum_short_name, value)\n self.fail(msg, t)\n return AnyType(TypeOfAny.from_error)\n return LiteralType(\n value=value,\n fallback=Instance(sym.node.info, [], line=t.line, column=t.column),\n line=t.line,\n column=t.column,\n )\n\n # None of the above options worked. We parse the args (if there are any)\n # to make sure there are no remaining semanal-only types, then give up.\n t = t.copy_modified(args=self.anal_array(t.args))\n # TODO: Move this message building logic to messages.py.\n notes = [] # type: List[str]\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.analyze_unbound_type_without_type_info.None_4_TypeAnalyser.analyze_unbound_type_without_type_info.return.t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.analyze_unbound_type_without_type_info.None_4_TypeAnalyser.analyze_unbound_type_without_type_info.return.t", "embedding": null, "metadata": {"file_path": "mypy/typeanal.py", "file_name": "typeanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 459, "end_line": 486, "span_ids": ["TypeAnalyser.analyze_unbound_type_without_type_info"], "tokens": 410}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeAnalyser(SyntheticTypeVisitor[Type], TypeAnalyzerPluginInterface):\n\n def analyze_unbound_type_without_type_info(self, t: UnboundType, sym: SymbolTableNode,\n defining_literal: bool) -> Type:\n # ... other code\n if isinstance(sym.node, Var):\n notes.append('See https://mypy.readthedocs.io/en/'\n 'stable/common_issues.html#variables-vs-type-aliases')\n message = 'Variable \"{}\" is not valid as a type'\n elif isinstance(sym.node, (SYMBOL_FUNCBASE_TYPES, Decorator)):\n message = 'Function \"{}\" is not valid as a type'\n notes.append('Perhaps you need \"Callable[...]\" or a callback protocol?')\n elif isinstance(sym.node, MypyFile):\n # TODO: suggest a protocol when supported.\n message = 'Module \"{}\" is not valid as a type'\n elif unbound_tvar:\n message = 'Type variable \"{}\" is unbound'\n short = name.split('.')[-1]\n notes.append(('(Hint: Use \"Generic[{}]\" or \"Protocol[{}]\" base class'\n ' to bind \"{}\" inside a class)').format(short, short, short))\n notes.append('(Hint: Use \"{}\" in function signature to bind \"{}\"'\n ' inside a function)'.format(short, short))\n else:\n message = 'Cannot interpret reference \"{}\" as a type'\n self.fail(message.format(name), t, code=codes.VALID_TYPE)\n for note in notes:\n self.note(note, t, code=codes.VALID_TYPE)\n\n # TODO: Would it be better to always return Any instead of UnboundType\n # in case of an error? On one hand, UnboundType has a name so error messages\n # are more detailed, on the other hand, some of them may be bogus,\n # see https://github.com/python/mypy/issues/4987.\n return t", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.visit_any_TypeAnalyser.visit_type_var.return.t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.visit_any_TypeAnalyser.visit_type_var.return.t", "embedding": null, "metadata": {"file_path": "mypy/typeanal.py", "file_name": "typeanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 476, "end_line": 509, "span_ids": ["TypeAnalyser.visit_callable_argument", "TypeAnalyser.visit_type_var", "TypeAnalyser.visit_erased_type", "TypeAnalyser.visit_type_alias_type", "TypeAnalyser.visit_instance", "TypeAnalyser.visit_deleted_type", "TypeAnalyser.visit_type_list", "TypeAnalyser.visit_any", "TypeAnalyser.visit_none_type", "TypeAnalyser.visit_uninhabited_type"], "tokens": 299}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeAnalyser(SyntheticTypeVisitor[Type], TypeAnalyzerPluginInterface):\n\n def visit_any(self, t: AnyType) -> Type:\n return t\n\n def visit_none_type(self, t: NoneType) -> Type:\n return t\n\n def visit_uninhabited_type(self, t: UninhabitedType) -> Type:\n return t\n\n def visit_erased_type(self, t: ErasedType) -> Type:\n # This type should exist only temporarily during type inference\n assert False, \"Internal error: Unexpected erased type\"\n\n def visit_deleted_type(self, t: DeletedType) -> Type:\n return t\n\n def visit_type_list(self, t: TypeList) -> Type:\n self.fail('Bracketed expression \"[...]\" is not valid as a type', t)\n self.note('Did you mean \"List[...]\"?', t)\n return AnyType(TypeOfAny.from_error)\n\n def visit_callable_argument(self, t: CallableArgument) -> Type:\n self.fail('Invalid type', t)\n return AnyType(TypeOfAny.from_error)\n\n def visit_instance(self, t: Instance) -> Type:\n return t\n\n def visit_type_alias_type(self, t: TypeAliasType) -> Type:\n # TODO: should we do something here?\n return t\n\n def visit_type_var(self, t: TypeVarType) -> Type:\n return t", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.visit_tuple_type_TypeAnalyser.visit_typeddict_type.return.TypedDictType_items_set_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.visit_tuple_type_TypeAnalyser.visit_typeddict_type.return.TypedDictType_items_set_", "embedding": null, "metadata": {"file_path": "mypy/typeanal.py", "file_name": "typeanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 544, "end_line": 578, "span_ids": ["TypeAnalyser.visit_typeddict_type", "TypeAnalyser.visit_tuple_type"], "tokens": 481}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeAnalyser(SyntheticTypeVisitor[Type], TypeAnalyzerPluginInterface):\n\n def visit_tuple_type(self, t: TupleType) -> Type:\n # Types such as (t1, t2, ...) only allowed in assignment statements. They'll\n # generate errors elsewhere, and Tuple[t1, t2, ...] must be used instead.\n if t.implicit and not self.allow_tuple_literal:\n self.fail('Syntax error in type annotation', t, code=codes.SYNTAX)\n if len(t.items) == 0:\n self.note('Suggestion: Use Tuple[()] instead of () for an empty tuple, or '\n 'None for a function without a return value', t, code=codes.SYNTAX)\n elif len(t.items) == 1:\n self.note('Suggestion: Is there a spurious trailing comma?', t, code=codes.SYNTAX)\n else:\n self.note('Suggestion: Use Tuple[T1, ..., Tn] instead of (T1, ..., Tn)', t,\n code=codes.SYNTAX)\n return AnyType(TypeOfAny.from_error)\n star_count = sum(1 for item in t.items if isinstance(item, StarType))\n if star_count > 1:\n self.fail('At most one star type allowed in a tuple', t)\n if t.implicit:\n return TupleType([AnyType(TypeOfAny.from_error) for _ in t.items],\n self.named_type('builtins.tuple'),\n t.line)\n else:\n return AnyType(TypeOfAny.from_error)\n any_type = AnyType(TypeOfAny.special_form)\n # If the fallback isn't filled in yet, its type will be the falsey FakeInfo\n fallback = (t.partial_fallback if t.partial_fallback.type\n else self.named_type('builtins.tuple', [any_type]))\n return TupleType(self.anal_array(t.items), fallback, t.line)\n\n def visit_typeddict_type(self, t: TypedDictType) -> Type:\n items = OrderedDict([\n (item_name, self.anal_type(item_type))\n for (item_name, item_type) in t.items.items()\n ])\n return TypedDictType(items, set(t.required_keys), t.fallback)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.visit_raw_expression_type_TypeAnalyser.visit_raw_expression_type.return.AnyType_TypeOfAny_from_er": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.visit_raw_expression_type_TypeAnalyser.visit_raw_expression_type.return.AnyType_TypeOfAny_from_er", "embedding": null, "metadata": {"file_path": "mypy/typeanal.py", "file_name": "typeanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 568, "end_line": 599, "span_ids": ["TypeAnalyser.visit_raw_expression_type"], "tokens": 417}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeAnalyser(SyntheticTypeVisitor[Type], TypeAnalyzerPluginInterface):\n\n def visit_raw_expression_type(self, t: RawExpressionType) -> Type:\n # We should never see a bare Literal. We synthesize these raw literals\n # in the earlier stages of semantic analysis, but those\n # \"fake literals\" should always be wrapped in an UnboundType\n # corresponding to 'Literal'.\n #\n # Note: if at some point in the distant future, we decide to\n # make signatures like \"foo(x: 20) -> None\" legal, we can change\n # this method so it generates and returns an actual LiteralType\n # instead.\n\n if self.report_invalid_types:\n if t.base_type_name in ('builtins.int', 'builtins.bool'):\n # The only time it makes sense to use an int or bool is inside of\n # a literal type.\n msg = \"Invalid type: try using Literal[{}] instead?\".format(repr(t.literal_value))\n elif t.base_type_name in ('builtins.float', 'builtins.complex'):\n # We special-case warnings for floats and complex numbers.\n msg = \"Invalid type: {} literals cannot be used as a type\".format(t.simple_name())\n else:\n # And in all other cases, we default to a generic error message.\n # Note: the reason why we use a generic error message for strings\n # but not ints or bools is because whenever we see an out-of-place\n # string, it's unclear if the user meant to construct a literal type\n # or just misspelled a regular type. So we avoid guessing.\n msg = 'Invalid type comment or annotation'\n\n self.fail(msg, t, code=codes.VALID_TYPE)\n if t.note is not None:\n self.note(t.note, t, code=codes.VALID_TYPE)\n\n return AnyType(TypeOfAny.from_error, line=t.line, column=t.column)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.analyze_callable_args_for_paramspec_TypeAnalyser.analyze_callable_args_for_paramspec.return.CallableType_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.analyze_callable_args_for_paramspec_TypeAnalyser.analyze_callable_args_for_paramspec.return.CallableType_", "embedding": null, "metadata": {"file_path": "mypy/typeanal.py", "file_name": "typeanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 630, "end_line": 654, "span_ids": ["TypeAnalyser.analyze_callable_args_for_paramspec"], "tokens": 223}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeAnalyser(SyntheticTypeVisitor[Type], TypeAnalyzerPluginInterface):\n\n def analyze_callable_args_for_paramspec(\n self,\n callable_args: Type,\n ret_type: Type,\n fallback: Instance,\n ) -> Optional[CallableType]:\n \"\"\"Construct a 'Callable[P, RET]', where P is ParamSpec, return None if we cannot.\"\"\"\n if not isinstance(callable_args, UnboundType):\n return None\n sym = self.lookup_qualified(callable_args.name, callable_args)\n if sym is None:\n return None\n tvar_def = self.tvar_scope.get_binding(sym)\n if not isinstance(tvar_def, ParamSpecDef):\n return None\n\n # TODO(shantanu): construct correct type for paramspec\n return CallableType(\n [AnyType(TypeOfAny.explicit), AnyType(TypeOfAny.explicit)],\n [nodes.ARG_STAR, nodes.ARG_STAR2],\n [None, None],\n ret_type=ret_type,\n fallback=fallback,\n is_ellipsis_args=True\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.analyze_callable_type_TypeAnalyser.analyze_callable_type.return.ret_accept_self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.analyze_callable_type_TypeAnalyser.analyze_callable_type.return.ret_accept_self_", "embedding": null, "metadata": {"file_path": "mypy/typeanal.py", "file_name": "typeanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 656, "end_line": 708, "span_ids": ["TypeAnalyser.analyze_callable_type"], "tokens": 512}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeAnalyser(SyntheticTypeVisitor[Type], TypeAnalyzerPluginInterface):\n\n def analyze_callable_type(self, t: UnboundType) -> Type:\n fallback = self.named_type('builtins.function')\n if len(t.args) == 0:\n # Callable (bare). Treat as Callable[..., Any].\n any_type = self.get_omitted_any(t)\n ret = CallableType([any_type, any_type],\n [nodes.ARG_STAR, nodes.ARG_STAR2],\n [None, None],\n ret_type=any_type,\n fallback=fallback,\n is_ellipsis_args=True)\n elif len(t.args) == 2:\n callable_args = t.args[0]\n ret_type = t.args[1]\n if isinstance(callable_args, TypeList):\n # Callable[[ARG, ...], RET] (ordinary callable type)\n analyzed_args = self.analyze_callable_args(callable_args)\n if analyzed_args is None:\n return AnyType(TypeOfAny.from_error)\n args, kinds, names = analyzed_args\n ret = CallableType(args,\n kinds,\n names,\n ret_type=ret_type,\n fallback=fallback)\n elif isinstance(callable_args, EllipsisType):\n # Callable[..., RET] (with literal ellipsis; accept arbitrary arguments)\n ret = CallableType([AnyType(TypeOfAny.explicit),\n AnyType(TypeOfAny.explicit)],\n [nodes.ARG_STAR, nodes.ARG_STAR2],\n [None, None],\n ret_type=ret_type,\n fallback=fallback,\n is_ellipsis_args=True)\n else:\n # Callable[P, RET] (where P is ParamSpec)\n maybe_ret = self.analyze_callable_args_for_paramspec(\n callable_args,\n ret_type,\n fallback\n )\n if maybe_ret is None:\n # Callable[?, RET] (where ? is something invalid)\n # TODO(shantanu): change error to mention paramspec, once we actually have some\n # support for it\n self.fail('The first argument to Callable must be a list of types or \"...\"', t)\n return AnyType(TypeOfAny.from_error)\n ret = maybe_ret\n else:\n self.fail('Please use \"Callable[[], ]\" or \"Callable\"', t)\n return AnyType(TypeOfAny.from_error)\n assert isinstance(ret, CallableType)\n return ret.accept(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.analyze_callable_args_TypeAnalyser.analyze_callable_args.return.args_kinds_names": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.analyze_callable_args_TypeAnalyser.analyze_callable_args.return.args_kinds_names", "embedding": null, "metadata": {"file_path": "mypy/typeanal.py", "file_name": "typeanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 710, "end_line": 745, "span_ids": ["TypeAnalyser.analyze_callable_args"], "tokens": 346}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeAnalyser(SyntheticTypeVisitor[Type], TypeAnalyzerPluginInterface):\n\n def analyze_callable_args(self, arglist: TypeList) -> Optional[Tuple[List[Type],\n List[int],\n List[Optional[str]]]]:\n args = [] # type: List[Type]\n kinds = [] # type: List[int]\n names = [] # type: List[Optional[str]]\n for arg in arglist.items:\n if isinstance(arg, CallableArgument):\n args.append(arg.typ)\n names.append(arg.name)\n if arg.constructor is None:\n return None\n found = self.lookup_qualified(arg.constructor, arg)\n if found is None:\n # Looking it up already put an error message in\n return None\n elif found.fullname not in ARG_KINDS_BY_CONSTRUCTOR:\n self.fail('Invalid argument constructor \"{}\"'.format(\n found.fullname), arg)\n return None\n else:\n assert found.fullname is not None\n kind = ARG_KINDS_BY_CONSTRUCTOR[found.fullname]\n kinds.append(kind)\n if arg.name is not None and kind in {ARG_STAR, ARG_STAR2}:\n self.fail(\"{} arguments should not have names\".format(\n arg.constructor), arg)\n return None\n else:\n args.append(arg)\n kinds.append(ARG_POS)\n names.append(None)\n # Note that arglist below is only used for error context.\n check_arg_names(names, [arglist] * len(args), self.fail, \"Callable\")\n check_arg_kinds(kinds, [arglist] * len(args), self.fail)\n return args, kinds, names", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.analyze_literal_type_TypeAnalyser.analyze_literal_type.return.UnionType_make_union_outp": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.analyze_literal_type_TypeAnalyser.analyze_literal_type.return.UnionType_make_union_outp", "embedding": null, "metadata": {"file_path": "mypy/typeanal.py", "file_name": "typeanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 747, "end_line": 759, "span_ids": ["TypeAnalyser.analyze_literal_type"], "tokens": 148}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeAnalyser(SyntheticTypeVisitor[Type], TypeAnalyzerPluginInterface):\n\n def analyze_literal_type(self, t: UnboundType) -> Type:\n if len(t.args) == 0:\n self.fail('Literal[...] must have at least one parameter', t)\n return AnyType(TypeOfAny.from_error)\n\n output = [] # type: List[Type]\n for i, arg in enumerate(t.args):\n analyzed_types = self.analyze_literal_param(i + 1, arg, t)\n if analyzed_types is None:\n return AnyType(TypeOfAny.from_error)\n else:\n output.extend(analyzed_types)\n return UnionType.make_union(output, line=t.line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.analyze_literal_param_TypeAnalyser.analyze_literal_param.arg.get_proper_type_arg_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.analyze_literal_param_TypeAnalyser.analyze_literal_param.arg.get_proper_type_arg_", "embedding": null, "metadata": {"file_path": "mypy/typeanal.py", "file_name": "typeanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 761, "end_line": 783, "span_ids": ["TypeAnalyser.analyze_literal_param"], "tokens": 250}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeAnalyser(SyntheticTypeVisitor[Type], TypeAnalyzerPluginInterface):\n\n def analyze_literal_param(self, idx: int, arg: Type, ctx: Context) -> Optional[List[Type]]:\n # This UnboundType was originally defined as a string.\n if isinstance(arg, UnboundType) and arg.original_str_expr is not None:\n assert arg.original_str_fallback is not None\n return [LiteralType(\n value=arg.original_str_expr,\n fallback=self.named_type_with_normalized_str(arg.original_str_fallback),\n line=arg.line,\n column=arg.column,\n )]\n\n # If arg is an UnboundType that was *not* originally defined as\n # a string, try expanding it in case it's a type alias or something.\n if isinstance(arg, UnboundType):\n self.nesting_level += 1\n try:\n arg = self.visit_unbound_type(arg, defining_literal=True)\n finally:\n self.nesting_level -= 1\n\n # Literal[...] cannot contain Any. Give up and add an error message\n # (if we haven't already).\n arg = get_proper_type(arg)\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.analyze_literal_param.if_isinstance_arg_AnyTyp_TypeAnalyser.analyze_literal_param.if_isinstance_arg_AnyTyp.else_.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.analyze_literal_param.if_isinstance_arg_AnyTyp_TypeAnalyser.analyze_literal_param.if_isinstance_arg_AnyTyp.else_.return.None", "embedding": null, "metadata": {"file_path": "mypy/typeanal.py", "file_name": "typeanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 784, "end_line": 833, "span_ids": ["TypeAnalyser.analyze_literal_param"], "tokens": 620}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeAnalyser(SyntheticTypeVisitor[Type], TypeAnalyzerPluginInterface):\n\n def analyze_literal_param(self, idx: int, arg: Type, ctx: Context) -> Optional[List[Type]]:\n # ... other code\n if isinstance(arg, AnyType):\n # Note: We can encounter Literals containing 'Any' under three circumstances:\n #\n # 1. If the user attempts use an explicit Any as a parameter\n # 2. If the user is trying to use an enum value imported from a module with\n # no type hints, giving it an an implicit type of 'Any'\n # 3. If there's some other underlying problem with the parameter.\n #\n # We report an error in only the first two cases. In the third case, we assume\n # some other region of the code has already reported a more relevant error.\n #\n # TODO: Once we start adding support for enums, make sure we report a custom\n # error for case 2 as well.\n if arg.type_of_any not in (TypeOfAny.from_error, TypeOfAny.special_form):\n self.fail('Parameter {} of Literal[...] cannot be of type \"Any\"'.format(idx), ctx)\n return None\n elif isinstance(arg, RawExpressionType):\n # A raw literal. Convert it directly into a literal if we can.\n if arg.literal_value is None:\n name = arg.simple_name()\n if name in ('float', 'complex'):\n msg = 'Parameter {} of Literal[...] cannot be of type \"{}\"'.format(idx, name)\n else:\n msg = 'Invalid type: Literal[...] cannot contain arbitrary expressions'\n self.fail(msg, ctx)\n # Note: we deliberately ignore arg.note here: the extra info might normally be\n # helpful, but it generally won't make sense in the context of a Literal[...].\n return None\n\n # Remap bytes and unicode into the appropriate type for the correct Python version\n fallback = self.named_type_with_normalized_str(arg.base_type_name)\n assert isinstance(fallback, Instance)\n return [LiteralType(arg.literal_value, fallback, line=arg.line, column=arg.column)]\n elif isinstance(arg, (NoneType, LiteralType)):\n # Types that we can just add directly to the literal/potential union of literals.\n return [arg]\n elif isinstance(arg, Instance) and arg.last_known_value is not None:\n # Types generated from declarations like \"var: Final = 4\".\n return [arg.last_known_value]\n elif isinstance(arg, UnionType):\n out = []\n for union_arg in arg.items:\n union_result = self.analyze_literal_param(idx, union_arg, ctx)\n if union_result is None:\n return None\n out.extend(union_result)\n return out\n else:\n self.fail('Parameter {} of Literal[...] is invalid'.format(idx), ctx)\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.analyze_type_TypeAnalyser.tvar_scope_frame.self.tvar_scope_2.old_scope": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.analyze_type_TypeAnalyser.tvar_scope_frame.self.tvar_scope_2.old_scope", "embedding": null, "metadata": {"file_path": "mypy/typeanal.py", "file_name": "typeanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 835, "end_line": 849, "span_ids": ["TypeAnalyser.tvar_scope_frame", "TypeAnalyser.fail", "TypeAnalyser.analyze_type", "TypeAnalyser.note"], "tokens": 163}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeAnalyser(SyntheticTypeVisitor[Type], TypeAnalyzerPluginInterface):\n\n def analyze_type(self, t: Type) -> Type:\n return t.accept(self)\n\n def fail(self, msg: str, ctx: Context, *, code: Optional[ErrorCode] = None) -> None:\n self.fail_func(msg, ctx, code=code)\n\n def note(self, msg: str, ctx: Context, *, code: Optional[ErrorCode] = None) -> None:\n self.note_func(msg, ctx, code=code)\n\n @contextmanager\n def tvar_scope_frame(self) -> Iterator[None]:\n old_scope = self.tvar_scope\n self.tvar_scope = self.tvar_scope.method_frame()\n yield\n self.tvar_scope = old_scope", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.infer_type_variables_TypeAnalyser.infer_type_variables.return.list_zip_names_tvars_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.infer_type_variables_TypeAnalyser.infer_type_variables.return.list_zip_names_tvars_", "embedding": null, "metadata": {"file_path": "mypy/typeanal.py", "file_name": "typeanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 851, "end_line": 873, "span_ids": ["TypeAnalyser.infer_type_variables"], "tokens": 256}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeAnalyser(SyntheticTypeVisitor[Type], TypeAnalyzerPluginInterface):\n\n def infer_type_variables(self,\n type: CallableType) -> List[Tuple[str, TypeVarLikeExpr]]:\n \"\"\"Return list of unique type variables referred to in a callable.\"\"\"\n names = [] # type: List[str]\n tvars = [] # type: List[TypeVarLikeExpr]\n for arg in type.arg_types:\n for name, tvar_expr in arg.accept(\n TypeVarLikeQuery(self.lookup_qualified, self.tvar_scope)\n ):\n if name not in names:\n names.append(name)\n tvars.append(tvar_expr)\n # When finding type variables in the return type of a function, don't\n # look inside Callable types. Type variables only appearing in\n # functions in the return type belong to those functions, not the\n # function we're currently analyzing.\n for name, tvar_expr in type.ret_type.accept(\n TypeVarLikeQuery(self.lookup_qualified, self.tvar_scope, include_callables=False)\n ):\n if name not in names:\n names.append(name)\n tvars.append(tvar_expr)\n return list(zip(names, tvars))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.bind_function_type_variables_TypeAnalyser.bind_function_type_variables.return.defs": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.bind_function_type_variables_TypeAnalyser.bind_function_type_variables.return.defs", "embedding": null, "metadata": {"file_path": "mypy/typeanal.py", "file_name": "typeanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 875, "end_line": 900, "span_ids": ["TypeAnalyser.bind_function_type_variables"], "tokens": 308}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeAnalyser(SyntheticTypeVisitor[Type], TypeAnalyzerPluginInterface):\n\n def bind_function_type_variables(\n self, fun_type: CallableType, defn: Context\n ) -> Sequence[TypeVarLikeDef]:\n \"\"\"Find the type variables of the function type and bind them in our tvar_scope\"\"\"\n if fun_type.variables:\n for var in fun_type.variables:\n var_node = self.lookup_qualified(var.name, defn)\n assert var_node, \"Binding for function type variable not found within function\"\n var_expr = var_node.node\n assert isinstance(var_expr, TypeVarLikeExpr)\n self.tvar_scope.bind_new(var.name, var_expr)\n return fun_type.variables\n typevars = self.infer_type_variables(fun_type)\n # Do not define a new type variable if already defined in scope.\n typevars = [(name, tvar) for name, tvar in typevars\n if not self.is_defined_type_var(name, defn)]\n defs = [] # type: List[TypeVarLikeDef]\n for name, tvar in typevars:\n if not self.tvar_scope.allow_binding(tvar.fullname):\n self.fail(\"Type variable '{}' is bound by an outer class\".format(name), defn)\n self.tvar_scope.bind_new(name, tvar)\n binding = self.tvar_scope.get_binding(tvar.fullname)\n assert binding is not None\n defs.append(binding)\n\n return defs", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.is_defined_type_var_TypeAnalyser.anal_var_defs.return._self_anal_var_def_vd_fo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.is_defined_type_var_TypeAnalyser.anal_var_defs.return._self_anal_var_def_vd_fo", "embedding": null, "metadata": {"file_path": "mypy/typeanal.py", "file_name": "typeanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 902, "end_line": 938, "span_ids": ["TypeAnalyser.anal_var_def", "TypeAnalyser.anal_var_defs", "TypeAnalyser.anal_array", "TypeAnalyser.is_defined_type_var", "TypeAnalyser.anal_type"], "tokens": 326}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeAnalyser(SyntheticTypeVisitor[Type], TypeAnalyzerPluginInterface):\n\n def is_defined_type_var(self, tvar: str, context: Context) -> bool:\n tvar_node = self.lookup_qualified(tvar, context)\n if not tvar_node:\n return False\n return self.tvar_scope.get_binding(tvar_node) is not None\n\n def anal_array(self, a: Iterable[Type], nested: bool = True) -> List[Type]:\n res = [] # type: List[Type]\n for t in a:\n res.append(self.anal_type(t, nested))\n return res\n\n def anal_type(self, t: Type, nested: bool = True) -> Type:\n if nested:\n self.nesting_level += 1\n try:\n return t.accept(self)\n finally:\n if nested:\n self.nesting_level -= 1\n\n def anal_var_def(self, var_def: TypeVarLikeDef) -> TypeVarLikeDef:\n if isinstance(var_def, TypeVarDef):\n return TypeVarDef(\n var_def.name,\n var_def.fullname,\n var_def.id.raw_id,\n self.anal_array(var_def.values),\n var_def.upper_bound.accept(self),\n var_def.variance,\n var_def.line\n )\n else:\n return var_def\n\n def anal_var_defs(self, var_defs: Sequence[TypeVarLikeDef]) -> List[TypeVarLikeDef]:\n return [self.anal_var_def(vd) for vd in var_defs]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.named_type_with_normalized_str_TypeAnalyser.named_type_with_normalized_str.return.self_named_type_fully_qua": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.named_type_with_normalized_str_TypeAnalyser.named_type_with_normalized_str.return.self_named_type_fully_qua", "embedding": null, "metadata": {"file_path": "mypy/typeanal.py", "file_name": "typeanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 940, "end_line": 949, "span_ids": ["TypeAnalyser.named_type_with_normalized_str"], "tokens": 164}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeAnalyser(SyntheticTypeVisitor[Type], TypeAnalyzerPluginInterface):\n\n def named_type_with_normalized_str(self, fully_qualified_name: str) -> Instance:\n \"\"\"Does almost the same thing as `named_type`, except that we immediately\n unalias `builtins.bytes` and `builtins.unicode` to `builtins.str` as appropriate.\n \"\"\"\n python_version = self.options.python_version\n if python_version[0] == 2 and fully_qualified_name == 'builtins.bytes':\n fully_qualified_name = 'builtins.str'\n if python_version[0] >= 3 and fully_qualified_name == 'builtins.unicode':\n fully_qualified_name = 'builtins.str'\n return self.named_type(fully_qualified_name)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.named_type_MsgCallback.Callable_str_Context_D": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.named_type_MsgCallback.Callable_str_Context_D", "embedding": null, "metadata": {"file_path": "mypy/typeanal.py", "file_name": "typeanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 951, "end_line": 969, "span_ids": ["TypeAnalyser.tuple_type", "TypeAnalyser.named_type", "impl:9"], "tokens": 220}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeAnalyser(SyntheticTypeVisitor[Type], TypeAnalyzerPluginInterface):\n\n def named_type(self, fully_qualified_name: str,\n args: Optional[List[Type]] = None,\n line: int = -1,\n column: int = -1) -> Instance:\n node = self.lookup_fqn_func(fully_qualified_name)\n assert isinstance(node.node, TypeInfo)\n any_type = AnyType(TypeOfAny.special_form)\n return Instance(node.node, args or [any_type] * len(node.node.defn.type_vars),\n line=line, column=column)\n\n def tuple_type(self, items: List[Type]) -> TupleType:\n any_type = AnyType(TypeOfAny.special_form)\n return TupleType(items, fallback=self.named_type('builtins.tuple', [any_type]))\n\n\nTypeVarLikeList = List[Tuple[str, TypeVarLikeExpr]]\n\n# Mypyc doesn't support callback protocols yet.\nMsgCallback = Callable[[str, Context, DefaultNamedArg(Optional[ErrorCode], 'code')], None]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_get_omitted_any_get_omitted_any.return.any_type": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_get_omitted_any_get_omitted_any.return.any_type", "embedding": null, "metadata": {"file_path": "mypy/typeanal.py", "file_name": "typeanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1012, "end_line": 1053, "span_ids": ["get_omitted_any"], "tokens": 454}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_omitted_any(disallow_any: bool, fail: MsgCallback, note: MsgCallback,\n orig_type: Type, python_version: Tuple[int, int],\n fullname: Optional[str] = None,\n unexpanded_type: Optional[Type] = None) -> AnyType:\n if disallow_any:\n nongen_builtins = get_nongen_builtins(python_version)\n if fullname in nongen_builtins:\n typ = orig_type\n # We use a dedicated error message for builtin generics (as the most common case).\n alternative = nongen_builtins[fullname]\n fail(message_registry.IMPLICIT_GENERIC_ANY_BUILTIN.format(alternative), typ,\n code=codes.TYPE_ARG)\n else:\n typ = unexpanded_type or orig_type\n type_str = typ.name if isinstance(typ, UnboundType) else format_type_bare(typ)\n\n fail(\n message_registry.BARE_GENERIC.format(quote_type_string(type_str)),\n typ,\n code=codes.TYPE_ARG)\n base_type = get_proper_type(orig_type)\n base_fullname = (\n base_type.type.fullname if isinstance(base_type, Instance) else fullname\n )\n # Ideally, we'd check whether the type is quoted or `from __future__ annotations`\n # is set before issuing this note\n if python_version < (3, 9) and base_fullname in GENERIC_STUB_NOT_AT_RUNTIME_TYPES:\n # Recommend `from __future__ import annotations` or to put type in quotes\n # (string literal escaping) for classes not generic at runtime\n note(\n \"Subscripting classes that are not generic at runtime may require \"\n \"escaping, see https://mypy.readthedocs.io/en/stable/runtime_troubles.html\"\n \"#not-generic-runtime\",\n typ,\n code=codes.TYPE_ARG)\n\n any_type = AnyType(TypeOfAny.from_error, line=typ.line, column=typ.column)\n else:\n any_type = AnyType(\n TypeOfAny.from_omitted_generics, line=orig_type.line, column=orig_type.column\n )\n return any_type", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_fix_instance_fix_instance.t.invalid.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_fix_instance_fix_instance.t.invalid.True", "embedding": null, "metadata": {"file_path": "mypy/typeanal.py", "file_name": "typeanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1034, "end_line": 1067, "span_ids": ["fix_instance"], "tokens": 339}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def fix_instance(t: Instance, fail: MsgCallback, note: MsgCallback,\n disallow_any: bool, python_version: Tuple[int, int],\n use_generic_error: bool = False,\n unexpanded_type: Optional[Type] = None,) -> None:\n \"\"\"Fix a malformed instance by replacing all type arguments with Any.\n\n Also emit a suitable error if this is not due to implicit Any's.\n \"\"\"\n if len(t.args) == 0:\n if use_generic_error:\n fullname = None # type: Optional[str]\n else:\n fullname = t.type.fullname\n any_type = get_omitted_any(disallow_any, fail, note, t, python_version, fullname,\n unexpanded_type)\n t.args = (any_type,) * len(t.type.type_vars)\n return\n # Invalid number of type parameters.\n n = len(t.type.type_vars)\n s = '{} type arguments'.format(n)\n if n == 0:\n s = 'no type arguments'\n elif n == 1:\n s = '1 type argument'\n act = str(len(t.args))\n if act == '0':\n act = 'none'\n fail('\"{}\" expects {}, but {} given'.format(\n t.type.name, s, act), t, code=codes.TYPE_ARG)\n # Construct the correct number of type arguments, as\n # otherwise the type checker may crash as it expects\n # things to be right.\n t.args = tuple(AnyType(TypeOfAny.from_error) for _ in t.type.type_vars)\n t.invalid = True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_expand_type_alias_expand_type_alias.return.typ": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_expand_type_alias_expand_type_alias.return.typ", "embedding": null, "metadata": {"file_path": "mypy/typeanal.py", "file_name": "typeanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1046, "end_line": 1093, "span_ids": ["expand_type_alias"], "tokens": 567}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def expand_type_alias(node: TypeAlias, args: List[Type],\n fail: MsgCallback, no_args: bool, ctx: Context, *,\n unexpanded_type: Optional[Type] = None,\n disallow_any: bool = False) -> Type:\n \"\"\"Expand a (generic) type alias target following the rules outlined in TypeAlias docstring.\n\n Here:\n target: original target type (contains unbound type variables)\n alias_tvars: type variable names\n args: types to be substituted in place of type variables\n fail: error reporter callback\n no_args: whether original definition used a bare generic `A = List`\n ctx: context where expansion happens\n \"\"\"\n exp_len = len(node.alias_tvars)\n act_len = len(args)\n if exp_len > 0 and act_len == 0:\n # Interpret bare Alias same as normal generic, i.e., Alias[Any, Any, ...]\n return set_any_tvars(node, ctx.line, ctx.column,\n disallow_any=disallow_any, fail=fail,\n unexpanded_type=unexpanded_type)\n if exp_len == 0 and act_len == 0:\n if no_args:\n assert isinstance(node.target, Instance) # type: ignore[misc]\n # Note: this is the only case where we use an eager expansion. See more info about\n # no_args aliases like L = List in the docstring for TypeAlias class.\n return Instance(node.target.type, [], line=ctx.line, column=ctx.column)\n return TypeAliasType(node, [], line=ctx.line, column=ctx.column)\n if (exp_len == 0 and act_len > 0\n and isinstance(node.target, Instance) # type: ignore[misc]\n and no_args):\n tp = Instance(node.target.type, args)\n tp.line = ctx.line\n tp.column = ctx.column\n return tp\n if act_len != exp_len:\n fail('Bad number of arguments for type alias, expected: %s, given: %s'\n % (exp_len, act_len), ctx)\n return set_any_tvars(node, ctx.line, ctx.column, from_error=True)\n typ = TypeAliasType(node, args, ctx.line, ctx.column)\n assert typ.alias is not None\n # HACK: Implement FlexibleAlias[T, typ] by expanding it to typ here.\n if (isinstance(typ.alias.target, Instance) # type: ignore\n and typ.alias.target.type.fullname == 'mypy_extensions.FlexibleAlias'):\n exp = get_proper_type(typ)\n assert isinstance(exp, Instance)\n return exp.args[-1]\n return typ", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_set_any_tvars_set_any_tvars.return.TypeAliasType_node_any_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_set_any_tvars_set_any_tvars.return.TypeAliasType_node_any_", "embedding": null, "metadata": {"file_path": "mypy/typeanal.py", "file_name": "typeanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1096, "end_line": 1114, "span_ids": ["set_any_tvars"], "tokens": 220}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def set_any_tvars(node: TypeAlias,\n newline: int, newcolumn: int, *,\n from_error: bool = False,\n disallow_any: bool = False,\n fail: Optional[MsgCallback] = None,\n unexpanded_type: Optional[Type] = None) -> Type:\n if from_error or disallow_any:\n type_of_any = TypeOfAny.from_error\n else:\n type_of_any = TypeOfAny.from_omitted_generics\n if disallow_any:\n assert fail is not None\n otype = unexpanded_type or node.target\n type_str = otype.name if isinstance(otype, UnboundType) else format_type_bare(otype)\n\n fail(message_registry.BARE_GENERIC.format(quote_type_string(type_str)),\n Context(newline, newcolumn), code=codes.TYPE_ARG)\n any_type = AnyType(type_of_any, line=newline, column=newcolumn)\n return TypeAliasType(node, [any_type] * len(node.alias_tvars), newline, newcolumn)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_remove_dups_TypeVarLikeQuery._seems_like_callable.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_remove_dups_TypeVarLikeQuery._seems_like_callable.return.False", "embedding": null, "metadata": {"file_path": "mypy/typeanal.py", "file_name": "typeanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1117, "end_line": 1151, "span_ids": ["remove_dups", "TypeVarLikeQuery.__init__", "TypeVarLikeQuery", "flatten_tvars", "TypeVarLikeQuery._seems_like_callable"], "tokens": 275}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def remove_dups(tvars: Iterable[T]) -> List[T]:\n # Get unique elements in order of appearance\n all_tvars = set() # type: Set[T]\n new_tvars = [] # type: List[T]\n for t in tvars:\n if t not in all_tvars:\n new_tvars.append(t)\n all_tvars.add(t)\n return new_tvars\n\n\ndef flatten_tvars(ll: Iterable[List[T]]) -> List[T]:\n return remove_dups(chain.from_iterable(ll))\n\n\nclass TypeVarLikeQuery(TypeQuery[TypeVarLikeList]):\n\n def __init__(self,\n lookup: Callable[[str, Context], Optional[SymbolTableNode]],\n scope: 'TypeVarLikeScope',\n *,\n include_callables: bool = True,\n include_bound_tvars: bool = False) -> None:\n self.include_callables = include_callables\n self.lookup = lookup\n self.scope = scope\n self.include_bound_tvars = include_bound_tvars\n super().__init__(flatten_tvars)\n\n def _seems_like_callable(self, type: UnboundType) -> bool:\n if not type.args:\n return False\n if isinstance(type.args[0], (EllipsisType, TypeList)):\n return True\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeVarLikeQuery.visit_unbound_type_TypeVarLikeQuery.visit_callable_type.if_self_include_callables.else_.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeVarLikeQuery.visit_unbound_type_TypeVarLikeQuery.visit_callable_type.if_self_include_callables.else_.return._", "embedding": null, "metadata": {"file_path": "mypy/typeanal.py", "file_name": "typeanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1153, "end_line": 1171, "span_ids": ["TypeVarLikeQuery.visit_unbound_type", "TypeVarLikeQuery.visit_callable_type"], "tokens": 193}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeVarLikeQuery(TypeQuery[TypeVarLikeList]):\n\n def visit_unbound_type(self, t: UnboundType) -> TypeVarLikeList:\n name = t.name\n node = self.lookup(name, t)\n if node and isinstance(node.node, TypeVarLikeExpr) and (\n self.include_bound_tvars or self.scope.get_binding(node) is None):\n assert isinstance(node.node, TypeVarLikeExpr)\n return [(name, node.node)]\n elif not self.include_callables and self._seems_like_callable(t):\n return []\n elif node and node.fullname in ('typing_extensions.Literal', 'typing.Literal'):\n return []\n else:\n return super().visit_unbound_type(t)\n\n def visit_callable_type(self, t: CallableType) -> TypeVarLikeList:\n if self.include_callables:\n return super().visit_callable_type(t)\n else:\n return []", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_check_for_explicit_any_CollectAllInnerTypesQuery.combine_lists_strategy.return.list_itertools_chain_from": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_check_for_explicit_any_CollectAllInnerTypesQuery.combine_lists_strategy.return.list_itertools_chain_from", "embedding": null, "metadata": {"file_path": "mypy/typeanal.py", "file_name": "typeanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1174, "end_line": 1262, "span_ids": ["CollectAnyTypesQuery.__init__", "collect_any_types", "has_any_from_unimported_type", "HasExplicitAny.visit_any", "HasAnyFromUnimportedType", "HasExplicitAny", "HasExplicitAny.__init__", "CollectAllInnerTypesQuery", "CollectAllInnerTypesQuery.__init__", "HasAnyFromUnimportedType.visit_typeddict_type", "HasExplicitAny.visit_typeddict_type", "CollectAllInnerTypesQuery.query_types", "CollectAnyTypesQuery.visit_any", "collect_all_inner_types", "HasAnyFromUnimportedType.__init__", "CollectAllInnerTypesQuery.combine_lists_strategy", "check_for_explicit_any", "CollectAnyTypesQuery", "has_explicit_any", "CollectAnyTypesQuery.combine_lists_strategy", "HasAnyFromUnimportedType.visit_any"], "tokens": 665}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def check_for_explicit_any(typ: Optional[Type],\n options: Options,\n is_typeshed_stub: bool,\n msg: MessageBuilder,\n context: Context) -> None:\n if (options.disallow_any_explicit and\n not is_typeshed_stub and\n typ and\n has_explicit_any(typ)):\n msg.explicit_any(context)\n\n\ndef has_explicit_any(t: Type) -> bool:\n \"\"\"\n Whether this type is or type it contains is an Any coming from explicit type annotation\n \"\"\"\n return t.accept(HasExplicitAny())\n\n\nclass HasExplicitAny(TypeQuery[bool]):\n def __init__(self) -> None:\n super().__init__(any)\n\n def visit_any(self, t: AnyType) -> bool:\n return t.type_of_any == TypeOfAny.explicit\n\n def visit_typeddict_type(self, t: TypedDictType) -> bool:\n # typeddict is checked during TypedDict declaration, so don't typecheck it here.\n return False\n\n\ndef has_any_from_unimported_type(t: Type) -> bool:\n \"\"\"Return true if this type is Any because an import was not followed.\n\n If type t is such Any type or has type arguments that contain such Any type\n this function will return true.\n \"\"\"\n return t.accept(HasAnyFromUnimportedType())\n\n\nclass HasAnyFromUnimportedType(TypeQuery[bool]):\n def __init__(self) -> None:\n super().__init__(any)\n\n def visit_any(self, t: AnyType) -> bool:\n return t.type_of_any == TypeOfAny.from_unimported_type\n\n def visit_typeddict_type(self, t: TypedDictType) -> bool:\n # typeddict is checked during TypedDict declaration, so don't typecheck it here\n return False\n\n\ndef collect_any_types(t: Type) -> List[AnyType]:\n \"\"\"Return all inner `AnyType`s of type t\"\"\"\n return t.accept(CollectAnyTypesQuery())\n\n\nclass CollectAnyTypesQuery(TypeQuery[List[AnyType]]):\n def __init__(self) -> None:\n super().__init__(self.combine_lists_strategy)\n\n def visit_any(self, t: AnyType) -> List[AnyType]:\n return [t]\n\n @classmethod\n def combine_lists_strategy(cls, it: Iterable[List[AnyType]]) -> List[AnyType]:\n result = [] # type: List[AnyType]\n for l in it:\n result.extend(l)\n return result\n\n\ndef collect_all_inner_types(t: Type) -> List[Type]:\n \"\"\"\n Return all types that `t` contains\n \"\"\"\n return t.accept(CollectAllInnerTypesQuery())\n\n\nclass CollectAllInnerTypesQuery(TypeQuery[List[Type]]):\n def __init__(self) -> None:\n super().__init__(self.combine_lists_strategy)\n\n def query_types(self, types: Iterable[Type]) -> List[Type]:\n return self.strategy([t.accept(self) for t in types]) + list(types)\n\n @classmethod\n def combine_lists_strategy(cls, it: Iterable[List[Type]]) -> List[Type]:\n return list(itertools.chain.from_iterable(it))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_make_optional_type_make_optional_type.if_isinstance_t_NoneType.else_.return.UnionType_t_NoneType_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_make_optional_type_make_optional_type.if_isinstance_t_NoneType.else_.return.UnionType_t_NoneType_", "embedding": null, "metadata": {"file_path": "mypy/typeanal.py", "file_name": "typeanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1265, "end_line": 1280, "span_ids": ["make_optional_type"], "tokens": 141}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def make_optional_type(t: Type) -> Type:\n \"\"\"Return the type corresponding to Optional[t].\n\n Note that we can't use normal union simplification, since this function\n is called during semantic analysis and simplification only works during\n type checking.\n \"\"\"\n t = get_proper_type(t)\n if isinstance(t, NoneType):\n return t\n elif isinstance(t, UnionType):\n items = [item for item in union_items(t)\n if not isinstance(item, NoneType)]\n return UnionType(items + [NoneType()], t.line, t.column)\n else:\n return UnionType([t, NoneType()], t.line, t.column)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_fix_instance_types_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_fix_instance_types_", "embedding": null, "metadata": {"file_path": "mypy/typeanal.py", "file_name": "typeanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1307, "end_line": 1330, "span_ids": ["InstanceFixer.visit_instance", "fix_instance_types", "InstanceFixer.__init__", "InstanceFixer"], "tokens": 222}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def fix_instance_types(t: Type, fail: MsgCallback, note: MsgCallback,\n python_version: Tuple[int, int]) -> None:\n \"\"\"Recursively fix all instance types (type argument count) in a given type.\n\n For example 'Union[Dict, List[str, int]]' will be transformed into\n 'Union[Dict[Any, Any], List[Any]]' in place.\n \"\"\"\n t.accept(InstanceFixer(fail, note, python_version))\n\n\nclass InstanceFixer(TypeTraverserVisitor):\n def __init__(\n self, fail: MsgCallback, note: MsgCallback, python_version: Tuple[int, int]\n ) -> None:\n self.fail = fail\n self.note = note\n self.python_version = python_version\n\n def visit_instance(self, typ: Instance) -> None:\n super().visit_instance(typ)\n if len(typ.args) != len(typ.type.type_vars):\n fix_instance(typ, self.fail, self.note, disallow_any=False,\n python_version=self.python_version, use_generic_error=True)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py__Miscellaneous_type_ope_try_getting_instance_fallback.if_isinstance_typ_Instan.else_.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py__Miscellaneous_type_ope_try_getting_instance_fallback.if_isinstance_typ_Instan.else_.return.None", "embedding": null, "metadata": {"file_path": "mypy/typeops.py", "file_name": "typeops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 64, "span_ids": ["tuple_fallback", "is_recursive_pair", "try_getting_instance_fallback", "docstring"], "tokens": 537}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Miscellaneous type operations and helpers for use during type checking.\n\nNOTE: These must not be accessed from mypy.nodes or mypy.types to avoid import\n cycles. These must not be called from the semantic analysis main pass\n since these may assume that MROs are ready.\n\"\"\"\n\nfrom typing import cast, Optional, List, Sequence, Set, Iterable, TypeVar, Dict, Tuple, Any\nfrom typing_extensions import Type as TypingType\nimport itertools\nimport sys\n\nfrom mypy.types import (\n TupleType, Instance, FunctionLike, Type, CallableType, TypeVarDef, TypeVarLikeDef, Overloaded,\n TypeVarType, UninhabitedType, FormalArgument, UnionType, NoneType, TypedDictType,\n AnyType, TypeOfAny, TypeType, ProperType, LiteralType, get_proper_type, get_proper_types,\n copy_type, TypeAliasType, TypeQuery\n)\nfrom mypy.nodes import (\n FuncBase, FuncItem, OverloadedFuncDef, TypeInfo, ARG_STAR, ARG_STAR2, ARG_POS,\n Expression, StrExpr, Var, Decorator, SYMBOL_FUNCBASE_TYPES\n)\nfrom mypy.maptype import map_instance_to_supertype\nfrom mypy.expandtype import expand_type_by_instance, expand_type\nfrom mypy.sharedparse import argument_elide_name\n\nfrom mypy.typevars import fill_typevars\n\nfrom mypy import state\n\n\ndef is_recursive_pair(s: Type, t: Type) -> bool:\n \"\"\"Is this a pair of recursive type aliases?\"\"\"\n return (isinstance(s, TypeAliasType) and isinstance(t, TypeAliasType) and\n s.is_recursive and t.is_recursive)\n\n\ndef tuple_fallback(typ: TupleType) -> Instance:\n \"\"\"Return fallback type for a tuple.\"\"\"\n from mypy.join import join_type_list\n\n info = typ.partial_fallback.type\n if info.fullname != 'builtins.tuple':\n return typ.partial_fallback\n return Instance(info, [join_type_list(typ.items)])\n\n\ndef try_getting_instance_fallback(typ: ProperType) -> Optional[Instance]:\n \"\"\"Returns the Instance fallback for this type if one exists.\n\n Otherwise, returns None.\n \"\"\"\n if isinstance(typ, Instance):\n return typ\n elif isinstance(typ, TupleType):\n return tuple_fallback(typ)\n elif isinstance(typ, TypedDictType):\n return typ.fallback\n elif isinstance(typ, FunctionLike):\n return typ.fallback\n elif isinstance(typ, LiteralType):\n return typ.fallback\n else:\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_type_object_type_from_function_type_object_type_from_function.if_isinstance_signature_.else_.return.Overloaded_items_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_type_object_type_from_function_type_object_type_from_function.if_isinstance_signature_.else_.return.Overloaded_items_", "embedding": null, "metadata": {"file_path": "mypy/typeops.py", "file_name": "typeops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 66, "end_line": 109, "span_ids": ["type_object_type_from_function"], "tokens": 500}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def type_object_type_from_function(signature: FunctionLike,\n info: TypeInfo,\n def_info: TypeInfo,\n fallback: Instance,\n is_new: bool) -> FunctionLike:\n # We first need to record all non-trivial (explicit) self types in __init__,\n # since they will not be available after we bind them. Note, we use explicit\n # self-types only in the defining class, similar to __new__ (but not exactly the same,\n # see comment in class_callable below). This is mostly useful for annotating library\n # classes such as subprocess.Popen.\n default_self = fill_typevars(info)\n if not is_new and not info.is_newtype:\n orig_self_types = [(it.arg_types[0] if it.arg_types and it.arg_types[0] != default_self\n and it.arg_kinds[0] == ARG_POS else None) for it in signature.items()]\n else:\n orig_self_types = [None] * len(signature.items())\n\n # The __init__ method might come from a generic superclass 'def_info'\n # with type variables that do not map identically to the type variables of\n # the class 'info' being constructed. For example:\n #\n # class A(Generic[T]):\n # def __init__(self, x: T) -> None: ...\n # class B(A[List[T]]):\n # ...\n #\n # We need to map B's __init__ to the type (List[T]) -> None.\n signature = bind_self(signature, original_type=default_self, is_classmethod=is_new)\n signature = cast(FunctionLike, map_type_from_supertype(signature, info, def_info))\n\n special_sig = None # type: Optional[str]\n if def_info.fullname == 'builtins.dict':\n # Special signature!\n special_sig = 'dict'\n\n if isinstance(signature, CallableType):\n return class_callable(signature, info, fallback, special_sig, is_new, orig_self_types[0])\n else:\n # Overloaded __init__/__new__.\n assert isinstance(signature, Overloaded)\n items = [] # type: List[CallableType]\n for item, orig_self in zip(signature.items(), orig_self_types):\n items.append(class_callable(item, info, fallback, special_sig, is_new, orig_self))\n return Overloaded(items)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_class_callable_class_callable.return.c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_class_callable_class_callable.return.c", "embedding": null, "metadata": {"file_path": "mypy/typeops.py", "file_name": "typeops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 112, "end_line": 140, "span_ids": ["class_callable"], "tokens": 295}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def class_callable(init_type: CallableType, info: TypeInfo, type_type: Instance,\n special_sig: Optional[str],\n is_new: bool, orig_self_type: Optional[Type] = None) -> CallableType:\n \"\"\"Create a type object type based on the signature of __init__.\"\"\"\n variables = [] # type: List[TypeVarLikeDef]\n variables.extend(info.defn.type_vars)\n variables.extend(init_type.variables)\n\n from mypy.subtypes import is_subtype\n\n init_ret_type = get_proper_type(init_type.ret_type)\n orig_self_type = get_proper_type(orig_self_type)\n default_ret_type = fill_typevars(info)\n explicit_type = init_ret_type if is_new else orig_self_type\n if (\n isinstance(explicit_type, (Instance, TupleType))\n # Only use the declared return type from __new__ or declared self in __init__\n # if it is actually returning a subtype of what we would return otherwise.\n and is_subtype(explicit_type, default_ret_type, ignore_type_params=True)\n ):\n ret_type = explicit_type # type: Type\n else:\n ret_type = default_ret_type\n\n callable_type = init_type.copy_modified(\n ret_type=ret_type, fallback=type_type, name=None, variables=variables,\n special_sig=special_sig)\n c = callable_type.with_name(info.name)\n return c", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_map_type_from_supertype_map_type_from_supertype.return.expand_type_by_instance_t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_map_type_from_supertype_map_type_from_supertype.return.expand_type_by_instance_t", "embedding": null, "metadata": {"file_path": "mypy/typeops.py", "file_name": "typeops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 143, "end_line": 171, "span_ids": ["map_type_from_supertype"], "tokens": 332}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def map_type_from_supertype(typ: Type,\n sub_info: TypeInfo,\n super_info: TypeInfo) -> Type:\n \"\"\"Map type variables in a type defined in a supertype context to be valid\n in the subtype context. Assume that the result is unique; if more than\n one type is possible, return one of the alternatives.\n\n For example, assume\n\n class D(Generic[S]): ...\n class C(D[E[T]], Generic[T]): ...\n\n Now S in the context of D would be mapped to E[T] in the context of C.\n \"\"\"\n # Create the type of self in subtype, of form t[a1, ...].\n inst_type = fill_typevars(sub_info)\n if isinstance(inst_type, TupleType):\n inst_type = tuple_fallback(inst_type)\n # Map the type of self to supertype. This gets us a description of the\n # supertype type variables in terms of subtype variables, i.e. t[t1, ...]\n # so that any type variables in tN are to be interpreted in subtype\n # context.\n inst_type = map_instance_to_supertype(inst_type, super_info)\n # Finally expand the type variables in type with those in the previously\n # constructed type. Note that both type and inst_type may have type\n # variables, but in type they are interpreted in supertype context while\n # in inst_type they are interpreted in subtype context. This works even if\n # the names of type variables in supertype and subtype overlap.\n return expand_type_by_instance(typ, inst_type)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_supported_self_type_F.TypeVar_F_bound_Functi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_supported_self_type_F.TypeVar_F_bound_Functi", "embedding": null, "metadata": {"file_path": "mypy/typeops.py", "file_name": "typeops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 174, "end_line": 186, "span_ids": ["supported_self_type", "impl"], "tokens": 112}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def supported_self_type(typ: ProperType) -> bool:\n \"\"\"Is this a supported kind of explicit self-types?\n\n Currently, this means a X or Type[X], where X is an instance or\n a type variable with an instance upper bound.\n \"\"\"\n if isinstance(typ, TypeType):\n return supported_self_type(typ.item)\n return (isinstance(typ, TypeVarType) or\n (isinstance(typ, Instance) and typ != fill_typevars(typ.type)))\n\n\nF = TypeVar('F', bound=FunctionLike)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_bind_self_bind_self.return.cast_F_res_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_bind_self_bind_self.return.cast_F_res_", "embedding": null, "metadata": {"file_path": "mypy/typeops.py", "file_name": "typeops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 189, "end_line": 275, "span_ids": ["bind_self"], "tokens": 860}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def bind_self(method: F, original_type: Optional[Type] = None, is_classmethod: bool = False) -> F:\n \"\"\"Return a copy of `method`, with the type of its first parameter (usually\n self or cls) bound to original_type.\n\n If the type of `self` is a generic type (T, or Type[T] for classmethods),\n instantiate every occurrence of type with original_type in the rest of the\n signature and in the return type.\n\n original_type is the type of E in the expression E.copy(). It is None in\n compatibility checks. In this case we treat it as the erasure of the\n declared type of self.\n\n This way we can express \"the type of self\". For example:\n\n T = TypeVar('T', bound='A')\n class A:\n def copy(self: T) -> T: ...\n\n class B(A): pass\n\n b = B().copy() # type: B\n\n \"\"\"\n from mypy.infer import infer_type_arguments\n\n if isinstance(method, Overloaded):\n return cast(F, Overloaded([bind_self(c, original_type, is_classmethod)\n for c in method.items()]))\n assert isinstance(method, CallableType)\n func = method\n if not func.arg_types:\n # Invalid method, return something.\n return cast(F, func)\n if func.arg_kinds[0] == ARG_STAR:\n # The signature is of the form 'def foo(*args, ...)'.\n # In this case we shouldn't drop the first arg,\n # since func will be absorbed by the *args.\n\n # TODO: infer bounds on the type of *args?\n return cast(F, func)\n self_param_type = get_proper_type(func.arg_types[0])\n\n variables = [] # type: Sequence[TypeVarLikeDef]\n if func.variables and supported_self_type(self_param_type):\n if original_type is None:\n # TODO: type check method override (see #7861).\n original_type = erase_to_bound(self_param_type)\n original_type = get_proper_type(original_type)\n\n all_ids = func.type_var_ids()\n typeargs = infer_type_arguments(all_ids, self_param_type, original_type,\n is_supertype=True)\n if (is_classmethod\n # TODO: why do we need the extra guards here?\n and any(isinstance(get_proper_type(t), UninhabitedType) for t in typeargs)\n and isinstance(original_type, (Instance, TypeVarType, TupleType))):\n # In case we call a classmethod through an instance x, fallback to type(x)\n typeargs = infer_type_arguments(all_ids, self_param_type, TypeType(original_type),\n is_supertype=True)\n\n ids = [tid for tid in all_ids\n if any(tid == t.id for t in get_type_vars(self_param_type))]\n\n # Technically, some constrains might be unsolvable, make them .\n to_apply = [t if t is not None else UninhabitedType() for t in typeargs]\n\n def expand(target: Type) -> Type:\n return expand_type(target, {id: to_apply[all_ids.index(id)] for id in ids})\n\n arg_types = [expand(x) for x in func.arg_types[1:]]\n ret_type = expand(func.ret_type)\n variables = [v for v in func.variables if v.id not in ids]\n else:\n arg_types = func.arg_types[1:]\n ret_type = func.ret_type\n variables = func.variables\n\n original_type = get_proper_type(original_type)\n if isinstance(original_type, CallableType) and original_type.is_type_obj():\n original_type = TypeType.make_normalized(original_type.ret_type)\n res = func.copy_modified(arg_types=arg_types,\n arg_kinds=func.arg_kinds[1:],\n arg_names=func.arg_names[1:],\n variables=variables,\n ret_type=ret_type,\n bound_args=[original_type])\n return cast(F, res)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_erase_to_bound_callable_corresponding_argument.return.by_name_if_by_name_is_not": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_erase_to_bound_callable_corresponding_argument.return.by_name_if_by_name_is_not", "embedding": null, "metadata": {"file_path": "mypy/typeops.py", "file_name": "typeops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 278, "end_line": 313, "span_ids": ["erase_to_bound", "callable_corresponding_argument"], "tokens": 351}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def erase_to_bound(t: Type) -> Type:\n # TODO: use value restrictions to produce a union?\n t = get_proper_type(t)\n if isinstance(t, TypeVarType):\n return t.upper_bound\n if isinstance(t, TypeType):\n if isinstance(t.item, TypeVarType):\n return TypeType.make_normalized(t.item.upper_bound)\n return t\n\n\ndef callable_corresponding_argument(typ: CallableType,\n model: FormalArgument) -> Optional[FormalArgument]:\n \"\"\"Return the argument a function that corresponds to `model`\"\"\"\n\n by_name = typ.argument_by_name(model.name)\n by_pos = typ.argument_by_position(model.pos)\n if by_name is None and by_pos is None:\n return None\n if by_name is not None and by_pos is not None:\n if by_name == by_pos:\n return by_name\n # If we're dealing with an optional pos-only and an optional\n # name-only arg, merge them. This is the case for all functions\n # taking both *args and **args, or a pair of functions like so:\n\n # def right(a: int = ...) -> None: ...\n # def left(__a: int = ..., *, a: int = ...) -> None: ...\n from mypy.subtypes import is_equivalent\n\n if (not (by_name.required or by_pos.required)\n and by_pos.name is None\n and by_name.pos is None\n and is_equivalent(by_name.typ, by_pos.typ)):\n return FormalArgument(by_name.name, by_pos.pos, by_name.typ, False)\n return by_name if by_name is not None else by_pos", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_make_simplified_union_make_simplified_union.return.UnionType_make_union_simp": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_make_simplified_union_make_simplified_union.return.UnionType_make_union_simp", "embedding": null, "metadata": {"file_path": "mypy/typeops.py", "file_name": "typeops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 317, "end_line": 388, "span_ids": ["make_simplified_union"], "tokens": 688}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def make_simplified_union(items: Sequence[Type],\n line: int = -1, column: int = -1,\n *, keep_erased: bool = False,\n contract_literals: bool = True) -> ProperType:\n \"\"\"Build union type with redundant union items removed.\n\n If only a single item remains, this may return a non-union type.\n\n Examples:\n\n * [int, str] -> Union[int, str]\n * [int, object] -> object\n * [int, int] -> int\n * [int, Any] -> Union[int, Any] (Any types are not simplified away!)\n * [Any, Any] -> Any\n\n Note: This must NOT be used during semantic analysis, since TypeInfos may not\n be fully initialized.\n The keep_erased flag is used for type inference against union types\n containing type variables. If set to True, keep all ErasedType items.\n \"\"\"\n items = get_proper_types(items)\n while any(isinstance(typ, UnionType) for typ in items):\n all_items = [] # type: List[ProperType]\n for typ in items:\n if isinstance(typ, UnionType):\n all_items.extend(get_proper_types(typ.items))\n else:\n all_items.append(typ)\n items = all_items\n\n from mypy.subtypes import is_proper_subtype\n\n removed = set() # type: Set[int]\n\n # Avoid slow nested for loop for Union of Literal of strings (issue #9169)\n if all((isinstance(item, LiteralType) and\n item.fallback.type.fullname == 'builtins.str')\n for item in items):\n seen = set() # type: Set[str]\n for index, item in enumerate(items):\n assert isinstance(item, LiteralType)\n assert isinstance(item.value, str)\n if item.value in seen:\n removed.add(index)\n seen.add(item.value)\n\n else:\n for i, ti in enumerate(items):\n if i in removed: continue\n # Keep track of the truishness info for deleted subtypes which can be relevant\n cbt = cbf = False\n for j, tj in enumerate(items):\n if i != j and is_proper_subtype(tj, ti, keep_erased_types=keep_erased) and \\\n is_redundant_literal_instance(ti, tj):\n # We found a redundant item in the union.\n removed.add(j)\n cbt = cbt or tj.can_be_true\n cbf = cbf or tj.can_be_false\n # if deleted subtypes had more general truthiness, use that\n if not ti.can_be_true and cbt:\n items[i] = true_or_false(ti)\n elif not ti.can_be_false and cbf:\n items[i] = true_or_false(ti)\n\n simplified_set = [items[i] for i in range(len(items)) if i not in removed]\n\n # If more than one literal exists in the union, try to simplify\n if (contract_literals and sum(isinstance(item, LiteralType) for item in simplified_set) > 1):\n simplified_set = try_contracting_literals_in_union(simplified_set)\n\n return UnionType.make_union(simplified_set, line, column)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_get_type_special_method_bool_ret_type_true_only.if_not_t_can_be_true_.else_.return.new_t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_get_type_special_method_bool_ret_type_true_only.if_not_t_can_be_true_.else_.return.new_t", "embedding": null, "metadata": {"file_path": "mypy/typeops.py", "file_name": "typeops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 383, "end_line": 423, "span_ids": ["get_type_special_method_bool_ret_type", "true_only"], "tokens": 351}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_type_special_method_bool_ret_type(t: Type) -> Optional[Type]:\n t = get_proper_type(t)\n\n if isinstance(t, Instance):\n bool_method = t.type.names.get(\"__bool__\", None)\n if bool_method:\n callee = get_proper_type(bool_method.type)\n if isinstance(callee, CallableType):\n return callee.ret_type\n\n return None\n\n\ndef true_only(t: Type) -> ProperType:\n \"\"\"\n Restricted version of t with only True-ish values\n \"\"\"\n t = get_proper_type(t)\n\n if not t.can_be_true:\n # All values of t are False-ish, so there are no true values in it\n return UninhabitedType(line=t.line, column=t.column)\n elif not t.can_be_false:\n # All values of t are already True-ish, so true_only is idempotent in this case\n return t\n elif isinstance(t, UnionType):\n # The true version of a union type is the union of the true versions of its components\n new_items = [true_only(item) for item in t.items]\n can_be_true_items = [item for item in new_items if item.can_be_true]\n return make_simplified_union(can_be_true_items, line=t.line, column=t.column)\n else:\n ret_type = get_type_special_method_bool_ret_type(t)\n\n if ret_type and ret_type.can_be_false and not ret_type.can_be_true:\n new_t = copy_type(t)\n new_t.can_be_true = False\n return new_t\n\n new_t = copy_type(t)\n new_t.can_be_false = False\n return new_t", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_false_only_false_only.if_not_t_can_be_false_.else_.return.new_t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_false_only_false_only.if_not_t_can_be_false_.else_.return.new_t", "embedding": null, "metadata": {"file_path": "mypy/typeops.py", "file_name": "typeops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 426, "end_line": 458, "span_ids": ["false_only"], "tokens": 305}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def false_only(t: Type) -> ProperType:\n \"\"\"\n Restricted version of t with only False-ish values\n \"\"\"\n t = get_proper_type(t)\n\n if not t.can_be_false:\n if state.strict_optional:\n # All values of t are True-ish, so there are no false values in it\n return UninhabitedType(line=t.line)\n else:\n # When strict optional checking is disabled, everything can be\n # False-ish since anything can be None\n return NoneType(line=t.line)\n elif not t.can_be_true:\n # All values of t are already False-ish, so false_only is idempotent in this case\n return t\n elif isinstance(t, UnionType):\n # The false version of a union type is the union of the false versions of its components\n new_items = [false_only(item) for item in t.items]\n can_be_false_items = [item for item in new_items if item.can_be_false]\n return make_simplified_union(can_be_false_items, line=t.line, column=t.column)\n else:\n ret_type = get_type_special_method_bool_ret_type(t)\n\n if ret_type and ret_type.can_be_true and not ret_type.can_be_false:\n new_t = copy_type(t)\n new_t.can_be_false = False\n return new_t\n\n new_t = copy_type(t)\n new_t.can_be_true = False\n return new_t", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_true_or_false_erase_to_union_or_bound.if_typ_values_.else_.return.get_proper_type_typ_upper": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_true_or_false_erase_to_union_or_bound.if_typ_values_.else_.return.get_proper_type_typ_upper", "embedding": null, "metadata": {"file_path": "mypy/typeops.py", "file_name": "typeops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 461, "end_line": 490, "span_ids": ["erase_to_union_or_bound", "erase_def_to_union_or_bound", "true_or_false"], "tokens": 232}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def true_or_false(t: Type) -> ProperType:\n \"\"\"\n Unrestricted version of t with both True-ish and False-ish values\n \"\"\"\n t = get_proper_type(t)\n\n if isinstance(t, UnionType):\n new_items = [true_or_false(item) for item in t.items]\n return make_simplified_union(new_items, line=t.line, column=t.column)\n\n new_t = copy_type(t)\n new_t.can_be_true = new_t.can_be_true_default()\n new_t.can_be_false = new_t.can_be_false_default()\n return new_t\n\n\ndef erase_def_to_union_or_bound(tdef: TypeVarLikeDef) -> Type:\n # TODO(shantanu): fix for ParamSpecDef\n assert isinstance(tdef, TypeVarDef)\n if tdef.values:\n return make_simplified_union(tdef.values)\n else:\n return tdef.upper_bound\n\n\ndef erase_to_union_or_bound(typ: TypeVarType) -> ProperType:\n if typ.values:\n return make_simplified_union(typ.values)\n else:\n return get_proper_type(typ.upper_bound)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_function_type_function_type.if_func_type_.else_.if_isinstance_func_FuncI.else_.return.Overloaded_dummy_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_function_type_function_type.if_func_type_.else_.if_isinstance_func_FuncI.else_.return.Overloaded_dummy_", "embedding": null, "metadata": {"file_path": "mypy/typeops.py", "file_name": "typeops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 493, "end_line": 513, "span_ids": ["function_type"], "tokens": 195}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def function_type(func: FuncBase, fallback: Instance) -> FunctionLike:\n if func.type:\n assert isinstance(func.type, FunctionLike)\n return func.type\n else:\n # Implicit type signature with dynamic types.\n if isinstance(func, FuncItem):\n return callable_type(func, fallback)\n else:\n # Broken overloads can have self.type set to None.\n # TODO: should we instead always set the type in semantic analyzer?\n assert isinstance(func, OverloadedFuncDef)\n any_type = AnyType(TypeOfAny.from_error)\n dummy = CallableType([any_type, any_type],\n [ARG_STAR, ARG_STAR2],\n [None, None], any_type,\n fallback,\n line=func.line, is_ellipsis_args=True)\n # Return an Overloaded, because some callers may expect that\n # an OverloadedFuncDef has an Overloaded type.\n return Overloaded([dummy])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_callable_type_callable_type.return.CallableType_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_callable_type_callable_type.return.CallableType_", "embedding": null, "metadata": {"file_path": "mypy/typeops.py", "file_name": "typeops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 516, "end_line": 537, "span_ids": ["callable_type"], "tokens": 228}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def callable_type(fdef: FuncItem, fallback: Instance,\n ret_type: Optional[Type] = None) -> CallableType:\n # TODO: somewhat unfortunate duplication with prepare_method_signature in semanal\n if fdef.info and not fdef.is_static and fdef.arg_names:\n self_type = fill_typevars(fdef.info) # type: Type\n if fdef.is_class or fdef.name == '__new__':\n self_type = TypeType.make_normalized(self_type)\n args = [self_type] + [AnyType(TypeOfAny.unannotated)] * (len(fdef.arg_names)-1)\n else:\n args = [AnyType(TypeOfAny.unannotated)] * len(fdef.arg_names)\n\n return CallableType(\n args,\n fdef.arg_kinds,\n [None if argument_elide_name(n) else n for n in fdef.arg_names],\n ret_type or AnyType(TypeOfAny.unannotated),\n fallback,\n name=fdef.name,\n line=fdef.line,\n column=fdef.column,\n implicit=True,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_try_getting_str_literals_try_getting_str_literals.return.try_getting_str_literals_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_try_getting_str_literals_try_getting_str_literals.return.try_getting_str_literals_", "embedding": null, "metadata": {"file_path": "mypy/typeops.py", "file_name": "typeops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 540, "end_line": 556, "span_ids": ["try_getting_str_literals"], "tokens": 171}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def try_getting_str_literals(expr: Expression, typ: Type) -> Optional[List[str]]:\n \"\"\"If the given expression or type corresponds to a string literal\n or a union of string literals, returns a list of the underlying strings.\n Otherwise, returns None.\n\n Specifically, this function is guaranteed to return a list with\n one or more strings if one one the following is true:\n\n 1. 'expr' is a StrExpr\n 2. 'typ' is a LiteralType containing a string\n 3. 'typ' is a UnionType containing only LiteralType of strings\n \"\"\"\n if isinstance(expr, StrExpr):\n return [expr.value]\n\n # TODO: See if we can eliminate this function and call the below one directly\n return try_getting_str_literals_from_type(typ)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_try_getting_str_literals_from_type_try_getting_str_literals_from_type.return.try_getting_literals_from": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_try_getting_str_literals_from_type_try_getting_str_literals_from_type.return.try_getting_literals_from", "embedding": null, "metadata": {"file_path": "mypy/typeops.py", "file_name": "typeops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 559, "end_line": 567, "span_ids": ["try_getting_str_literals_from_type"], "tokens": 111}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def try_getting_str_literals_from_type(typ: Type) -> Optional[List[str]]:\n \"\"\"If the given expression or type corresponds to a string Literal\n or a union of string Literals, returns a list of the underlying strings.\n Otherwise, returns None.\n\n For example, if we had the type 'Literal[\"foo\", \"bar\"]' as input, this function\n would return a list of strings [\"foo\", \"bar\"].\n \"\"\"\n return try_getting_literals_from_type(typ, str, \"builtins.str\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_try_getting_int_literals_from_type_T.TypeVar_T_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_try_getting_int_literals_from_type_T.TypeVar_T_", "embedding": null, "metadata": {"file_path": "mypy/typeops.py", "file_name": "typeops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 570, "end_line": 581, "span_ids": ["impl:3", "try_getting_int_literals_from_type"], "tokens": 122}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def try_getting_int_literals_from_type(typ: Type) -> Optional[List[int]]:\n \"\"\"If the given expression or type corresponds to an int Literal\n or a union of int Literals, returns a list of the underlying ints.\n Otherwise, returns None.\n\n For example, if we had the type 'Literal[1, 2, 3]' as input, this function\n would return a list of ints [1, 2, 3].\n \"\"\"\n return try_getting_literals_from_type(typ, int, \"builtins.int\")\n\n\nT = TypeVar('T')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_try_getting_literals_from_type_try_getting_literals_from_type.return.literals": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_try_getting_literals_from_type_try_getting_literals_from_type.return.literals", "embedding": null, "metadata": {"file_path": "mypy/typeops.py", "file_name": "typeops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 584, "end_line": 611, "span_ids": ["try_getting_literals_from_type"], "tokens": 231}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def try_getting_literals_from_type(typ: Type,\n target_literal_type: TypingType[T],\n target_fullname: str) -> Optional[List[T]]:\n \"\"\"If the given expression or type corresponds to a Literal or\n union of Literals where the underlying values corresponds to the given\n target type, returns a list of those underlying values. Otherwise,\n returns None.\n \"\"\"\n typ = get_proper_type(typ)\n\n if isinstance(typ, Instance) and typ.last_known_value is not None:\n possible_literals = [typ.last_known_value] # type: List[Type]\n elif isinstance(typ, UnionType):\n possible_literals = list(typ.items)\n else:\n possible_literals = [typ]\n\n literals = [] # type: List[T]\n for lit in get_proper_types(possible_literals):\n if isinstance(lit, LiteralType) and lit.fallback.type.fullname == target_fullname:\n val = lit.value\n if isinstance(val, target_literal_type):\n literals.append(val)\n else:\n return None\n else:\n return None\n return literals", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_is_literal_type_like_get_enum_values.return._name_for_name_sym_in_ty": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_is_literal_type_like_get_enum_values.return._name_for_name_sym_in_ty", "embedding": null, "metadata": {"file_path": "mypy/typeops.py", "file_name": "typeops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 614, "end_line": 634, "span_ids": ["get_enum_values", "is_literal_type_like"], "tokens": 185}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_literal_type_like(t: Optional[Type]) -> bool:\n \"\"\"Returns 'true' if the given type context is potentially either a LiteralType,\n a Union of LiteralType, or something similar.\n \"\"\"\n t = get_proper_type(t)\n if t is None:\n return False\n elif isinstance(t, LiteralType):\n return True\n elif isinstance(t, UnionType):\n return any(is_literal_type_like(item) for item in t.items)\n elif isinstance(t, TypeVarType):\n return (is_literal_type_like(t.upper_bound)\n or any(is_literal_type_like(item) for item in t.values))\n else:\n return False\n\n\ndef get_enum_values(typ: Instance) -> List[str]:\n \"\"\"Return the list of values for an Enum.\"\"\"\n return [name for name, sym in typ.type.names.items() if isinstance(sym.node, Var)]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_is_singleton_type_is_singleton_type.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_is_singleton_type_is_singleton_type.return._", "embedding": null, "metadata": {"file_path": "mypy/typeops.py", "file_name": "typeops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 637, "end_line": 661, "span_ids": ["is_singleton_type"], "tokens": 285}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_singleton_type(typ: Type) -> bool:\n \"\"\"Returns 'true' if this type is a \"singleton type\" -- if there exists\n exactly only one runtime value associated with this type.\n\n That is, given two values 'a' and 'b' that have the same type 't',\n 'is_singleton_type(t)' returns True if and only if the expression 'a is b' is\n always true.\n\n Currently, this returns True when given NoneTypes, enum LiteralTypes and\n enum types with a single value.\n\n Note that other kinds of LiteralTypes cannot count as singleton types. For\n example, suppose we do 'a = 100000 + 1' and 'b = 100001'. It is not guaranteed\n that 'a is b' will always be true -- some implementations of Python will end up\n constructing two distinct instances of 100001.\n \"\"\"\n typ = get_proper_type(typ)\n # TODO:\n # Also make this return True if the type corresponds to ... (ellipsis) or NotImplemented?\n return (\n isinstance(typ, NoneType)\n or (isinstance(typ, LiteralType)\n and (typ.is_enum_literal() or isinstance(typ.value, bool)))\n or (isinstance(typ, Instance) and typ.type.is_enum and len(get_enum_values(typ)) == 1)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_try_expanding_enum_to_union_try_expanding_enum_to_union.if_isinstance_typ_UnionT.else_.return.typ": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_try_expanding_enum_to_union_try_expanding_enum_to_union.if_isinstance_typ_UnionT.else_.return.typ", "embedding": null, "metadata": {"file_path": "mypy/typeops.py", "file_name": "typeops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 671, "end_line": 714, "span_ids": ["try_expanding_enum_to_union"], "tokens": 424}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def try_expanding_enum_to_union(typ: Type, target_fullname: str) -> ProperType:\n \"\"\"Attempts to recursively expand any enum Instances with the given target_fullname\n into a Union of all of its component LiteralTypes.\n\n For example, if we have:\n\n class Color(Enum):\n RED = 1\n BLUE = 2\n YELLOW = 3\n\n class Status(Enum):\n SUCCESS = 1\n FAILURE = 2\n UNKNOWN = 3\n\n ...and if we call `try_expanding_enum_to_union(Union[Color, Status], 'module.Color')`,\n this function will return Literal[Color.RED, Color.BLUE, Color.YELLOW, Status].\n \"\"\"\n typ = get_proper_type(typ)\n\n if isinstance(typ, UnionType):\n items = [try_expanding_enum_to_union(item, target_fullname) for item in typ.items]\n return make_simplified_union(items, contract_literals=False)\n elif isinstance(typ, Instance) and typ.type.is_enum and typ.type.fullname == target_fullname:\n new_items = []\n for name, symbol in typ.type.names.items():\n if not isinstance(symbol.node, Var):\n continue\n # Skip \"_order_\" and \"__order__\", since Enum will remove it\n if name in (\"_order_\", \"__order__\"):\n continue\n new_items.append(LiteralType(name, typ))\n # SymbolTables are really just dicts, and dicts are guaranteed to preserve\n # insertion order only starting with Python 3.7. So, we sort these for older\n # versions of Python to help make tests deterministic.\n #\n # We could probably skip the sort for Python 3.6 since people probably run mypy\n # only using CPython, but we might as well for the sake of full correctness.\n if sys.version_info < (3, 7):\n new_items.sort(key=lambda lit: lit.value)\n return make_simplified_union(new_items, contract_literals=False)\n else:\n return typ", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_coerce_to_literal_coerce_to_literal.return.original_type": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_coerce_to_literal_coerce_to_literal.return.original_type", "embedding": null, "metadata": {"file_path": "mypy/typeops.py", "file_name": "typeops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 710, "end_line": 726, "span_ids": ["coerce_to_literal"], "tokens": 159}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def coerce_to_literal(typ: Type) -> Type:\n \"\"\"Recursively converts any Instances that have a last_known_value or are\n instances of enum types with a single value into the corresponding LiteralType.\n \"\"\"\n original_type = typ\n typ = get_proper_type(typ)\n if isinstance(typ, UnionType):\n new_items = [coerce_to_literal(item) for item in typ.items]\n return make_simplified_union(new_items)\n elif isinstance(typ, Instance):\n if typ.last_known_value:\n return typ.last_known_value\n elif typ.type.is_enum:\n enum_values = get_enum_values(typ)\n if len(enum_values) == 1:\n return LiteralType(value=enum_values[0], fallback=typ)\n return original_type", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_get_type_vars_TypeVarExtractor.visit_type_var.return._t_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_get_type_vars_TypeVarExtractor.visit_type_var.return._t_", "embedding": null, "metadata": {"file_path": "mypy/typeops.py", "file_name": "typeops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 729, "end_line": 744, "span_ids": ["TypeVarExtractor.visit_type_var", "get_type_vars", "TypeVarExtractor", "TypeVarExtractor.__init__", "TypeVarExtractor._merge"], "tokens": 121}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_type_vars(tp: Type) -> List[TypeVarType]:\n return tp.accept(TypeVarExtractor())\n\n\nclass TypeVarExtractor(TypeQuery[List[TypeVarType]]):\n def __init__(self) -> None:\n super().__init__(self._merge)\n\n def _merge(self, iter: Iterable[List[TypeVarType]]) -> List[TypeVarType]:\n out = []\n for item in iter:\n out.extend(item)\n return out\n\n def visit_type_var(self, t: TypeVarType) -> List[TypeVarType]:\n return [t]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_custom_special_method_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_custom_special_method_", "embedding": null, "metadata": {"file_path": "mypy/typeops.py", "file_name": "typeops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 784, "end_line": 821, "span_ids": ["custom_special_method", "is_redundant_literal_instance"], "tokens": 371}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def custom_special_method(typ: Type, name: str, check_all: bool = False) -> bool:\n \"\"\"Does this type have a custom special method such as __format__() or __eq__()?\n\n If check_all is True ensure all items of a union have a custom method, not just some.\n \"\"\"\n typ = get_proper_type(typ)\n if isinstance(typ, Instance):\n method = typ.type.get(name)\n if method and isinstance(method.node, (SYMBOL_FUNCBASE_TYPES, Decorator, Var)):\n if method.node.info:\n return not method.node.info.fullname.startswith('builtins.')\n return False\n if isinstance(typ, UnionType):\n if check_all:\n return all(custom_special_method(t, name, check_all) for t in typ.items)\n return any(custom_special_method(t, name) for t in typ.items)\n if isinstance(typ, TupleType):\n return custom_special_method(tuple_fallback(typ), name, check_all)\n if isinstance(typ, CallableType) and typ.is_type_obj():\n # Look up __method__ on the metaclass for class objects.\n return custom_special_method(typ.fallback, name, check_all)\n if isinstance(typ, AnyType):\n # Avoid false positives in uncertain cases.\n return True\n # TODO: support other types (see ExpressionChecker.has_member())?\n return False\n\n\ndef is_redundant_literal_instance(general: ProperType, specific: ProperType) -> bool:\n if not isinstance(general, Instance) or general.last_known_value is None:\n return True\n if isinstance(specific, Instance) and specific.last_known_value == general.last_known_value:\n return True\n if isinstance(specific, UninhabitedType):\n return True\n\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py__Classes_for_representi__dummy.object_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py__Classes_for_representi__dummy.object_", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 81, "span_ids": ["docstring:32", "docstring"], "tokens": 683}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Classes for representing mypy types.\"\"\"\n\nimport copy\nimport sys\nfrom abc import abstractmethod\nfrom mypy.ordered_dict import OrderedDict\n\nfrom typing import (\n Any, TypeVar, Dict, List, Tuple, cast, Set, Optional, Union, Iterable, NamedTuple,\n Sequence, Iterator, overload\n)\nfrom typing_extensions import ClassVar, Final, TYPE_CHECKING, overload\n\nimport mypy.nodes\nfrom mypy import state\nfrom mypy.nodes import (\n INVARIANT, SymbolNode, ARG_POS, ARG_OPT, ARG_STAR, ARG_STAR2, ARG_NAMED, ARG_NAMED_OPT,\n FuncDef,\n)\nfrom mypy.util import IdMapper\nfrom mypy.bogus_type import Bogus\n\n\nT = TypeVar('T')\n\nJsonDict = Dict[str, Any]\n\n# The set of all valid expressions that can currently be contained\n# inside of a Literal[...].\n#\n# Literals can contain bytes and enum-values: we special-case both of these\n# and store the value as a string. We rely on the fallback type that's also\n# stored with the Literal to determine how a string is being used.\n#\n# TODO: confirm that we're happy with representing enums (and the\n# other types) in the manner described above.\n#\n# Note: if we change the set of types included below, we must also\n# make sure to audit the following methods:\n#\n# 1. types.LiteralType's serialize and deserialize methods: this method\n# needs to make sure it can convert the below types into JSON and back.\n#\n# 2. types.LiteralType's 'alue_repr` method: this method is ultimately used\n# by TypeStrVisitor's visit_literal_type to generate a reasonable\n# repr-able output.\n#\n# 3. server.astdiff.SnapshotTypeVisitor's visit_literal_type_method: this\n# method assumes that the following types supports equality checks and\n# hashability.\n#\n# Note: Although \"Literal[None]\" is a valid type, we internally always convert\n# such a type directly into \"None\". So, \"None\" is not a valid parameter of\n# LiteralType and is omitted from this list.\nLiteralValue = Union[int, str, bool]\n\n\n# If we only import type_visitor in the middle of the file, mypy\n# breaks, and if we do it at the top, it breaks at runtime because of\n# import cycle issues, so we do it at the top while typechecking and\n# then again in the middle at runtime.\n# We should be able to remove this once we are switched to the new\n# semantic analyzer!\nif TYPE_CHECKING:\n from mypy.type_visitor import (\n TypeVisitor as TypeVisitor,\n SyntheticTypeVisitor as SyntheticTypeVisitor,\n )\n\n# Supported names of TypedDict type constructors.\nTPDICT_NAMES = ('typing.TypedDict',\n 'typing_extensions.TypedDict',\n 'mypy_extensions.TypedDict') # type: Final\n\n# Supported fallback instance type names for TypedDict types.\nTPDICT_FB_NAMES = ('typing._TypedDict',\n 'typing_extensions._TypedDict',\n 'mypy_extensions._TypedDict') # type: Final\n\n# A placeholder used for Bogus[...] parameters\n_dummy = object()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py__type_Final_Any__TypeOfAny.None_22": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py__type_Final_Any__TypeOfAny.None_22", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 81, "end_line": 109, "span_ids": ["docstring:32", "TypeOfAny"], "tokens": 341}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": " # type: Final[Any]\n\n\nclass TypeOfAny:\n \"\"\"\n This class describes different types of Any. Each 'Any' can be of only one type at a time.\n \"\"\"\n # Was this Any type inferred without a type annotation?\n unannotated = 1 # type: Final\n # Does this Any come from an explicit type annotation?\n explicit = 2 # type: Final\n # Does this come from an unfollowed import? See --disallow-any-unimported option\n from_unimported_type = 3 # type: Final\n # Does this Any type come from omitted generics?\n from_omitted_generics = 4 # type: Final\n # Does this Any come from an error?\n from_error = 5 # type: Final\n # Is this a type that can't be represented in mypy's type system? For instance, type of\n # call to NewType...). Even though these types aren't real Anys, we treat them as such.\n # Also used for variables named '_'.\n special_form = 6 # type: Final\n # Does this Any come from interaction with another Any?\n from_another_any = 7 # type: Final\n # Does this Any come from an implementation limitation/bug?\n implementation_artifact = 8 # type: Final\n # Does this Any come from use in the suggestion engine? This is\n # used to ignore Anys inserted by the suggestion engine when\n # generating constraints.\n suggestion_engine = 9 # type: Final", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_deserialize_type_Type.deserialize.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_deserialize_type_Type.deserialize.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 112, "end_line": 149, "span_ids": ["Type.__repr__", "Type.serialize", "Type.__init__", "Type.can_be_false_default", "Type.accept", "deserialize_type", "Type.can_be_true_default", "Type.deserialize", "Type"], "tokens": 291}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def deserialize_type(data: Union[JsonDict, str]) -> 'Type':\n if isinstance(data, str):\n return Instance.deserialize(data)\n classname = data['.class']\n method = deserialize_map.get(classname)\n if method is not None:\n return method(data)\n raise NotImplementedError('unexpected .class {}'.format(classname))\n\n\nclass Type(mypy.nodes.Context):\n \"\"\"Abstract base class for all types.\"\"\"\n\n __slots__ = ('can_be_true', 'can_be_false')\n\n def __init__(self, line: int = -1, column: int = -1) -> None:\n super().__init__(line, column)\n self.can_be_true = self.can_be_true_default()\n self.can_be_false = self.can_be_false_default()\n\n def can_be_true_default(self) -> bool:\n return True\n\n def can_be_false_default(self) -> bool:\n return True\n\n def accept(self, visitor: 'TypeVisitor[T]') -> T:\n raise RuntimeError('Not implemented')\n\n def __repr__(self) -> str:\n return self.accept(TypeStrVisitor())\n\n def serialize(self) -> Union[JsonDict, str]:\n raise NotImplementedError('Cannot serialize {} instance'.format(self.__class__.__name__))\n\n @classmethod\n def deserialize(cls, data: JsonDict) -> 'Type':\n raise NotImplementedError('Cannot deserialize {} instance'.format(cls.__name__))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypeAliasType_TypeAliasType.__init__.super___init___line_co": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypeAliasType_TypeAliasType.__init__.super___init___line_co", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 152, "end_line": 176, "span_ids": ["TypeAliasType.__init__", "TypeAliasType"], "tokens": 228}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeAliasType(Type):\n \"\"\"A type alias to another type.\n\n NOTE: this is not being used yet, and the implementation is still incomplete.\n\n To support recursive type aliases we don't immediately expand a type alias\n during semantic analysis, but create an instance of this type that records the target alias\n definition node (mypy.nodes.TypeAlias) and type arguments (for generic aliases).\n\n This is very similar to how TypeInfo vs Instance interact, where a recursive class-based\n structure like\n class Node:\n value: int\n children: List[Node]\n can be represented in a tree-like manner.\n \"\"\"\n\n __slots__ = ('alias', 'args', 'line', 'column', 'type_ref')\n\n def __init__(self, alias: Optional[mypy.nodes.TypeAlias], args: List[Type],\n line: int = -1, column: int = -1) -> None:\n self.alias = alias\n self.args = args\n self.type_ref = None # type: Optional[str]\n super().__init__(line, column)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypeAliasType._expand_once_TypeAliasType._expand_once.return.replace_alias_tvars_self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypeAliasType._expand_once_TypeAliasType._expand_once.return.replace_alias_tvars_self_", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 178, "end_line": 192, "span_ids": ["TypeAliasType._expand_once"], "tokens": 172}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeAliasType(Type):\n\n def _expand_once(self) -> Type:\n \"\"\"Expand to the target type exactly once.\n\n This doesn't do full expansion, i.e. the result can contain another\n (or even this same) type alias. Use this internal helper only when really needed,\n its public wrapper mypy.types.get_proper_type() is preferred.\n \"\"\"\n assert self.alias is not None\n if self.alias.no_args:\n # We know that no_args=True aliases like L = List must have an instance\n # as their target.\n assert isinstance(self.alias.target, Instance) # type: ignore[misc]\n return self.alias.target.copy_modified(args=self.args)\n return replace_alias_tvars(self.alias.target, self.alias.alias_tvars, self.args,\n self.line, self.column)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypeAliasType._partial_expansion_TypeAliasType.copy_modified.return.TypeAliasType_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypeAliasType._partial_expansion_TypeAliasType.copy_modified.return.TypeAliasType_", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 194, "end_line": 270, "span_ids": ["TypeAliasType.can_be_true_default", "TypeAliasType.__eq__", "TypeAliasType.copy_modified", "TypeAliasType.deserialize", "TypeAliasType.can_be_false_default", "TypeAliasType.serialize", "TypeAliasType._partial_expansion", "TypeAliasType.is_recursive", "TypeAliasType.__hash__", "TypeAliasType.expand_all_if_possible", "TypeAliasType.accept"], "tokens": 663}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeAliasType(Type):\n\n def _partial_expansion(self) -> Tuple['ProperType', bool]:\n # Private method mostly for debugging and testing.\n unroller = UnrollAliasVisitor(set())\n unrolled = self.accept(unroller)\n assert isinstance(unrolled, ProperType)\n return unrolled, unroller.recursed\n\n def expand_all_if_possible(self) -> Optional['ProperType']:\n \"\"\"Attempt a full expansion of the type alias (including nested aliases).\n\n If the expansion is not possible, i.e. the alias is (mutually-)recursive,\n return None.\n \"\"\"\n unrolled, recursed = self._partial_expansion()\n if recursed:\n return None\n return unrolled\n\n @property\n def is_recursive(self) -> bool:\n assert self.alias is not None, 'Unfixed type alias'\n is_recursive = self.alias._is_recursive\n if is_recursive is None:\n is_recursive = self.expand_all_if_possible() is None\n # We cache the value on the underlying TypeAlias node as an optimization,\n # since the value is the same for all instances of the same alias.\n self.alias._is_recursive = is_recursive\n return is_recursive\n\n def can_be_true_default(self) -> bool:\n if self.alias is not None:\n return self.alias.target.can_be_true\n return super().can_be_true_default()\n\n def can_be_false_default(self) -> bool:\n if self.alias is not None:\n return self.alias.target.can_be_false\n return super().can_be_false_default()\n\n def accept(self, visitor: 'TypeVisitor[T]') -> T:\n return visitor.visit_type_alias_type(self)\n\n def __hash__(self) -> int:\n return hash((self.alias, tuple(self.args)))\n\n def __eq__(self, other: object) -> bool:\n # Note: never use this to determine subtype relationships, use is_subtype().\n if not isinstance(other, TypeAliasType):\n return NotImplemented\n return (self.alias == other.alias\n and self.args == other.args)\n\n def serialize(self) -> JsonDict:\n assert self.alias is not None\n data = {'.class': 'TypeAliasType',\n 'type_ref': self.alias.fullname,\n 'args': [arg.serialize() for arg in self.args]} # type: JsonDict\n return data\n\n @classmethod\n def deserialize(cls, data: JsonDict) -> 'TypeAliasType':\n assert data['.class'] == 'TypeAliasType'\n args = [] # type: List[Type]\n if 'args' in data:\n args_list = data['args']\n assert isinstance(args_list, list)\n args = [deserialize_type(arg) for arg in args_list]\n alias = TypeAliasType(None, args)\n alias.type_ref = data['type_ref']\n return alias\n\n def copy_modified(self, *,\n args: Optional[List[Type]] = None) -> 'TypeAliasType':\n return TypeAliasType(\n self.alias,\n args if args is not None else self.args.copy(),\n self.line, self.column)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypeVarLikeDef_TypeVarLikeDef.deserialize.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypeVarLikeDef_TypeVarLikeDef.deserialize.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 331, "end_line": 354, "span_ids": ["TypeVarLikeDef.deserialize", "TypeVarLikeDef.serialize", "TypeVarLikeDef", "TypeVarLikeDef.__init__", "TypeVarLikeDef.__repr__"], "tokens": 184}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeVarLikeDef(mypy.nodes.Context):\n name = '' # Name (may be qualified)\n fullname = '' # Fully qualified name\n id = None # type: TypeVarId\n\n def __init__(\n self, name: str, fullname: str, id: Union[TypeVarId, int], line: int = -1, column: int = -1\n ) -> None:\n super().__init__(line, column)\n self.name = name\n self.fullname = fullname\n if isinstance(id, int):\n id = TypeVarId(id)\n self.id = id\n\n def __repr__(self) -> str:\n return self.name\n\n def serialize(self) -> JsonDict:\n raise NotImplementedError\n\n @classmethod\n def deserialize(cls, data: JsonDict) -> 'TypeVarLikeDef':\n raise NotImplementedError", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypeVarDef_TypeVarDef.deserialize.return.TypeVarDef_data_name_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypeVarDef_TypeVarDef.deserialize.return.TypeVarDef_data_name_", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 357, "end_line": 406, "span_ids": ["TypeVarDef", "TypeVarDef.deserialize", "TypeVarDef.__init__", "TypeVarDef.serialize", "TypeVarDef.__repr__", "TypeVarDef.new_unification_variable"], "tokens": 480}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeVarDef(TypeVarLikeDef):\n \"\"\"Definition of a single type variable.\"\"\"\n values = None # type: List[Type] # Value restriction, empty list if no restriction\n upper_bound = None # type: Type\n variance = INVARIANT # type: int\n\n def __init__(self, name: str, fullname: str, id: Union[TypeVarId, int], values: List[Type],\n upper_bound: Type, variance: int = INVARIANT, line: int = -1,\n column: int = -1) -> None:\n super().__init__(name, fullname, id, line, column)\n assert values is not None, \"No restrictions must be represented by empty list\"\n self.values = values\n self.upper_bound = upper_bound\n self.variance = variance\n\n @staticmethod\n def new_unification_variable(old: 'TypeVarDef') -> 'TypeVarDef':\n new_id = TypeVarId.new(meta_level=1)\n return TypeVarDef(old.name, old.fullname, new_id, old.values,\n old.upper_bound, old.variance, old.line, old.column)\n\n def __repr__(self) -> str:\n if self.values:\n return '{} in {}'.format(self.name, tuple(self.values))\n elif not is_named_instance(self.upper_bound, 'builtins.object'):\n return '{} <: {}'.format(self.name, self.upper_bound)\n else:\n return self.name\n\n def serialize(self) -> JsonDict:\n assert not self.id.is_meta_var()\n return {'.class': 'TypeVarDef',\n 'name': self.name,\n 'fullname': self.fullname,\n 'id': self.id.raw_id,\n 'values': [v.serialize() for v in self.values],\n 'upper_bound': self.upper_bound.serialize(),\n 'variance': self.variance,\n }\n\n @classmethod\n def deserialize(cls, data: JsonDict) -> 'TypeVarDef':\n assert data['.class'] == 'TypeVarDef'\n return TypeVarDef(data['name'],\n data['fullname'],\n data['id'],\n [deserialize_type(v) for v in data['values']],\n deserialize_type(data['upper_bound']),\n data['variance'],\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_ParamSpecDef_ParamSpecDef.deserialize.return.ParamSpecDef_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_ParamSpecDef_ParamSpecDef.deserialize.return.ParamSpecDef_", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 409, "end_line": 428, "span_ids": ["ParamSpecDef", "ParamSpecDef.serialize", "ParamSpecDef.deserialize"], "tokens": 131}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ParamSpecDef(TypeVarLikeDef):\n \"\"\"Definition of a single ParamSpec variable.\"\"\"\n\n def serialize(self) -> JsonDict:\n assert not self.id.is_meta_var()\n return {\n '.class': 'ParamSpecDef',\n 'name': self.name,\n 'fullname': self.fullname,\n 'id': self.id.raw_id,\n }\n\n @classmethod\n def deserialize(cls, data: JsonDict) -> 'ParamSpecDef':\n assert data['.class'] == 'ParamSpecDef'\n return ParamSpecDef(\n data['name'],\n data['fullname'],\n data['id'],\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_UnboundType_UnboundType.deserialize.return.UnboundType_data_name_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_UnboundType_UnboundType.deserialize.return.UnboundType_data_name_", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 431, "end_line": 517, "span_ids": ["UnboundType.__hash__", "UnboundType.__init__", "UnboundType.accept", "UnboundType.copy_modified", "UnboundType", "UnboundType.__eq__", "UnboundType.deserialize", "UnboundType.serialize"], "tokens": 792}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class UnboundType(ProperType):\n \"\"\"Instance type that has not been bound during semantic analysis.\"\"\"\n\n __slots__ = ('name', 'args', 'optional', 'empty_tuple_index',\n 'original_str_expr', 'original_str_fallback')\n\n def __init__(self,\n name: Optional[str],\n args: Optional[Sequence[Type]] = None,\n line: int = -1,\n column: int = -1,\n optional: bool = False,\n empty_tuple_index: bool = False,\n original_str_expr: Optional[str] = None,\n original_str_fallback: Optional[str] = None,\n ) -> None:\n super().__init__(line, column)\n if not args:\n args = []\n assert name is not None\n self.name = name\n self.args = tuple(args)\n # Should this type be wrapped in an Optional?\n self.optional = optional\n # Special case for X[()]\n self.empty_tuple_index = empty_tuple_index\n # If this UnboundType was originally defined as a str or bytes, keep track of\n # the original contents of that string-like thing. This way, if this UnboundExpr\n # ever shows up inside of a LiteralType, we can determine whether that\n # Literal[...] is valid or not. E.g. Literal[foo] is most likely invalid\n # (unless 'foo' is an alias for another literal or something) and\n # Literal[\"foo\"] most likely is.\n #\n # We keep track of the entire string instead of just using a boolean flag\n # so we can distinguish between things like Literal[\"foo\"] vs\n # Literal[\" foo \"].\n #\n # We also keep track of what the original base fallback type was supposed to be\n # so we don't have to try and recompute it later\n self.original_str_expr = original_str_expr\n self.original_str_fallback = original_str_fallback\n\n def copy_modified(self,\n args: Bogus[Optional[Sequence[Type]]] = _dummy,\n ) -> 'UnboundType':\n if args is _dummy:\n args = self.args\n return UnboundType(\n name=self.name,\n args=args,\n line=self.line,\n column=self.column,\n optional=self.optional,\n empty_tuple_index=self.empty_tuple_index,\n original_str_expr=self.original_str_expr,\n original_str_fallback=self.original_str_fallback,\n )\n\n def accept(self, visitor: 'TypeVisitor[T]') -> T:\n return visitor.visit_unbound_type(self)\n\n def __hash__(self) -> int:\n return hash((self.name, self.optional, tuple(self.args), self.original_str_expr))\n\n def __eq__(self, other: object) -> bool:\n if not isinstance(other, UnboundType):\n return NotImplemented\n return (self.name == other.name and self.optional == other.optional and\n self.args == other.args and self.original_str_expr == other.original_str_expr and\n self.original_str_fallback == other.original_str_fallback)\n\n def serialize(self) -> JsonDict:\n return {'.class': 'UnboundType',\n 'name': self.name,\n 'args': [a.serialize() for a in self.args],\n 'expr': self.original_str_expr,\n 'expr_fallback': self.original_str_fallback,\n }\n\n @classmethod\n def deserialize(cls, data: JsonDict) -> 'UnboundType':\n assert data['.class'] == 'UnboundType'\n return UnboundType(data['name'],\n [deserialize_type(a) for a in data['args']],\n original_str_expr=data['expr'],\n original_str_fallback=data['expr_fallback'],\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_CallableArgument_CallableArgument.serialize.assert_False_Synthetic_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_CallableArgument_CallableArgument.serialize.assert_False_Synthetic_", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 520, "end_line": 541, "span_ids": ["CallableArgument.accept", "CallableArgument.__init__", "CallableArgument.serialize", "CallableArgument"], "tokens": 199}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CallableArgument(ProperType):\n \"\"\"Represents a Arg(type, 'name') inside a Callable's type list.\n\n Note that this is a synthetic type for helping parse ASTs, not a real type.\n \"\"\"\n typ = None # type: Type\n name = None # type: Optional[str]\n constructor = None # type: Optional[str]\n\n def __init__(self, typ: Type, name: Optional[str], constructor: Optional[str],\n line: int = -1, column: int = -1) -> None:\n super().__init__(line, column)\n self.typ = typ\n self.name = name\n self.constructor = constructor\n\n def accept(self, visitor: 'TypeVisitor[T]') -> T:\n assert isinstance(visitor, SyntheticTypeVisitor)\n return visitor.visit_callable_argument(self)\n\n def serialize(self) -> JsonDict:\n assert False, \"Synthetic types don't serialize\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypeList_TypeList.serialize.assert_False_Synthetic_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypeList_TypeList.serialize.assert_False_Synthetic_", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 544, "end_line": 564, "span_ids": ["TypeList.serialize", "TypeList.__init__", "TypeList", "TypeList.accept"], "tokens": 197}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeList(ProperType):\n \"\"\"Information about argument types and names [...].\n\n This is used for the arguments of a Callable type, i.e. for\n [arg, ...] in Callable[[arg, ...], ret]. This is not a real type\n but a syntactic AST construct. UnboundTypes can also have TypeList\n types before they are processed into Callable types.\n \"\"\"\n\n items = None # type: List[Type]\n\n def __init__(self, items: List[Type], line: int = -1, column: int = -1) -> None:\n super().__init__(line, column)\n self.items = items\n\n def accept(self, visitor: 'TypeVisitor[T]') -> T:\n assert isinstance(visitor, SyntheticTypeVisitor)\n return visitor.visit_type_list(self)\n\n def serialize(self) -> JsonDict:\n assert False, \"Synthetic types don't serialize\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_AnyType_AnyType.accept.return.visitor_visit_any_self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_AnyType_AnyType.accept.return.visitor_visit_any_self_", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 567, "end_line": 604, "span_ids": ["AnyType", "AnyType.is_from_error", "AnyType.accept", "AnyType.__init__"], "tokens": 375}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class AnyType(ProperType):\n \"\"\"The type 'Any'.\"\"\"\n\n __slots__ = ('type_of_any', 'source_any', 'missing_import_name')\n\n def __init__(self,\n type_of_any: int,\n source_any: Optional['AnyType'] = None,\n missing_import_name: Optional[str] = None,\n line: int = -1,\n column: int = -1) -> None:\n super().__init__(line, column)\n self.type_of_any = type_of_any\n # If this Any was created as a result of interacting with another 'Any', record the source\n # and use it in reports.\n self.source_any = source_any\n if source_any and source_any.source_any:\n self.source_any = source_any.source_any\n\n if source_any is None:\n self.missing_import_name = missing_import_name\n else:\n self.missing_import_name = source_any.missing_import_name\n\n # Only unimported type anys and anys from other anys should have an import name\n assert (missing_import_name is None or\n type_of_any in (TypeOfAny.from_unimported_type, TypeOfAny.from_another_any))\n # Only Anys that come from another Any can have source_any.\n assert type_of_any != TypeOfAny.from_another_any or source_any is not None\n # We should not have chains of Anys.\n assert not self.source_any or self.source_any.type_of_any != TypeOfAny.from_another_any\n\n @property\n def is_from_error(self) -> bool:\n return self.type_of_any == TypeOfAny.from_error\n\n def accept(self, visitor: 'TypeVisitor[T]') -> T:\n return visitor.visit_any(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_AnyType.copy_modified_AnyType.copy_modified.return.AnyType_type_of_any_type_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_AnyType.copy_modified_AnyType.copy_modified.return.AnyType_type_of_any_type_", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 606, "end_line": 617, "span_ids": ["AnyType.copy_modified"], "tokens": 140}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class AnyType(ProperType):\n\n def copy_modified(self,\n # Mark with Bogus because _dummy is just an object (with type Any)\n type_of_any: Bogus[int] = _dummy,\n original_any: Bogus[Optional['AnyType']] = _dummy,\n ) -> 'AnyType':\n if type_of_any is _dummy:\n type_of_any = self.type_of_any\n if original_any is _dummy:\n original_any = self.source_any\n return AnyType(type_of_any=type_of_any, source_any=original_any,\n missing_import_name=self.missing_import_name,\n line=self.line, column=self.column)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_AnyType.__hash___AnyType.deserialize.return.AnyType_data_type_of_any": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_AnyType.__hash___AnyType.deserialize.return.AnyType_data_type_of_any", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 619, "end_line": 636, "span_ids": ["AnyType.serialize", "AnyType.deserialize", "AnyType.__eq__", "AnyType.__hash__"], "tokens": 178}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class AnyType(ProperType):\n\n def __hash__(self) -> int:\n return hash(AnyType)\n\n def __eq__(self, other: object) -> bool:\n return isinstance(other, AnyType)\n\n def serialize(self) -> JsonDict:\n return {'.class': 'AnyType', 'type_of_any': self.type_of_any,\n 'source_any': self.source_any.serialize() if self.source_any is not None else None,\n 'missing_import_name': self.missing_import_name}\n\n @classmethod\n def deserialize(cls, data: JsonDict) -> 'AnyType':\n assert data['.class'] == 'AnyType'\n source = data['source_any']\n return AnyType(data['type_of_any'],\n AnyType.deserialize(source) if source is not None else None,\n data['missing_import_name'])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_UninhabitedType_UninhabitedType.deserialize.return.UninhabitedType_is_noretu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_UninhabitedType_UninhabitedType.deserialize.return.UninhabitedType_is_noretu", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 639, "end_line": 685, "span_ids": ["UninhabitedType.__eq__", "UninhabitedType.__hash__", "UninhabitedType.deserialize", "UninhabitedType.serialize", "UninhabitedType", "UninhabitedType.can_be_true_default", "UninhabitedType.__init__", "UninhabitedType.accept", "UninhabitedType.can_be_false_default"], "tokens": 460}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class UninhabitedType(ProperType):\n \"\"\"This type has no members.\n\n This type is the bottom type.\n With strict Optional checking, it is the only common subtype between all\n other types, which allows `meet` to be well defined. Without strict\n Optional checking, NoneType fills this role.\n\n In general, for any type T:\n join(UninhabitedType, T) = T\n meet(UninhabitedType, T) = UninhabitedType\n is_subtype(UninhabitedType, T) = True\n \"\"\"\n\n is_noreturn = False # Does this come from a NoReturn? Purely for error messages.\n # It is important to track whether this is an actual NoReturn type, or just a result\n # of ambiguous type inference, in the latter case we don't want to mark a branch as\n # unreachable in binder.\n ambiguous = False # Is this a result of inference for a variable without constraints?\n\n def __init__(self, is_noreturn: bool = False, line: int = -1, column: int = -1) -> None:\n super().__init__(line, column)\n self.is_noreturn = is_noreturn\n\n def can_be_true_default(self) -> bool:\n return False\n\n def can_be_false_default(self) -> bool:\n return False\n\n def accept(self, visitor: 'TypeVisitor[T]') -> T:\n return visitor.visit_uninhabited_type(self)\n\n def __hash__(self) -> int:\n return hash(UninhabitedType)\n\n def __eq__(self, other: object) -> bool:\n return isinstance(other, UninhabitedType)\n\n def serialize(self) -> JsonDict:\n return {'.class': 'UninhabitedType',\n 'is_noreturn': self.is_noreturn}\n\n @classmethod\n def deserialize(cls, data: JsonDict) -> 'UninhabitedType':\n assert data['.class'] == 'UninhabitedType'\n return UninhabitedType(is_noreturn=data['is_noreturn'])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_NoneType_NoneType.deserialize.return.NoneType_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_NoneType_NoneType.deserialize.return.NoneType_", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 688, "end_line": 717, "span_ids": ["NoneType.__eq__", "NoneType.accept", "NoneType.can_be_true_default", "NoneType.deserialize", "NoneType.__init__", "NoneType", "NoneType.__hash__", "NoneType.serialize"], "tokens": 201}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class NoneType(ProperType):\n \"\"\"The type of 'None'.\n\n This type can be written by users as 'None'.\n \"\"\"\n\n __slots__ = ()\n\n def __init__(self, line: int = -1, column: int = -1) -> None:\n super().__init__(line, column)\n\n def can_be_true_default(self) -> bool:\n return False\n\n def __hash__(self) -> int:\n return hash(NoneType)\n\n def __eq__(self, other: object) -> bool:\n return isinstance(other, NoneType)\n\n def accept(self, visitor: 'TypeVisitor[T]') -> T:\n return visitor.visit_none_type(self)\n\n def serialize(self) -> JsonDict:\n return {'.class': 'NoneType'}\n\n @classmethod\n def deserialize(cls, data: JsonDict) -> 'NoneType':\n assert data['.class'] == 'NoneType'\n return NoneType()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py__NoneType_used_to_be_cal_NOT_READY.mypy_nodes_FakeInfo_De_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py__NoneType_used_to_be_cal_NOT_READY.mypy_nodes_FakeInfo_De_s", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 720, "end_line": 762, "span_ids": ["DeletedType.serialize", "DeletedType.__init__", "DeletedType.accept", "NoneType.deserialize", "impl:16", "impl:14", "DeletedType", "ErasedType.accept", "DeletedType.deserialize", "ErasedType"], "tokens": 321}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# NoneType used to be called NoneTyp so to avoid needlessly breaking\n# external plugins we keep that alias here.\nNoneTyp = NoneType\n\n\nclass ErasedType(ProperType):\n \"\"\"Placeholder for an erased type.\n\n This is used during type inference. This has the special property that\n it is ignored during type inference.\n \"\"\"\n\n def accept(self, visitor: 'TypeVisitor[T]') -> T:\n return visitor.visit_erased_type(self)\n\n\nclass DeletedType(ProperType):\n \"\"\"Type of deleted variables.\n\n These can be used as lvalues but not rvalues.\n \"\"\"\n\n source = '' # type: Optional[str] # May be None; name that generated this value\n\n def __init__(self, source: Optional[str] = None, line: int = -1, column: int = -1) -> None:\n super().__init__(line, column)\n self.source = source\n\n def accept(self, visitor: 'TypeVisitor[T]') -> T:\n return visitor.visit_deleted_type(self)\n\n def serialize(self) -> JsonDict:\n return {'.class': 'DeletedType',\n 'source': self.source}\n\n @classmethod\n def deserialize(cls, data: JsonDict) -> 'DeletedType':\n assert data['.class'] == 'DeletedType'\n return DeletedType(data['source'])\n\n\n# Fake TypeInfo to be used as a placeholder during Instance de-serialization.\nNOT_READY = mypy.nodes.FakeInfo('De-serialization failure: TypeInfo not fixed')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_None_43_Instance.__eq__.return._self_type_other_type": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_None_43_Instance.__eq__.return._self_type_other_type", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 762, "end_line": 843, "span_ids": ["impl:16", "Instance.accept", "Instance.__eq__", "Instance.__hash__", "Instance.__init__", "Instance"], "tokens": 815}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": " # type: Final\n\n\nclass Instance(ProperType):\n \"\"\"An instance type of form C[T1, ..., Tn].\n\n The list of type variables may be empty.\n \"\"\"\n\n __slots__ = ('type', 'args', 'erased', 'invalid', 'type_ref', 'last_known_value')\n\n def __init__(self, typ: mypy.nodes.TypeInfo, args: Sequence[Type],\n line: int = -1, column: int = -1, erased: bool = False,\n last_known_value: Optional['LiteralType'] = None) -> None:\n super().__init__(line, column)\n self.type = typ\n self.args = tuple(args)\n self.type_ref = None # type: Optional[str]\n\n # True if result of type variable substitution\n self.erased = erased\n\n # True if recovered after incorrect number of type arguments error\n self.invalid = False\n\n # This field keeps track of the underlying Literal[...] value associated with\n # this instance, if one is known.\n #\n # This field is set whenever possible within expressions, but is erased upon\n # variable assignment (see erasetype.remove_instance_last_known_values) unless\n # the variable is declared to be final.\n #\n # For example, consider the following program:\n #\n # a = 1\n # b: Final[int] = 2\n # c: Final = 3\n # print(a + b + c + 4)\n #\n # The 'Instance' objects associated with the expressions '1', '2', '3', and '4' will\n # have last_known_values of type Literal[1], Literal[2], Literal[3], and Literal[4]\n # respectively. However, the Instance object assigned to 'a' and 'b' will have their\n # last_known_value erased: variable 'a' is mutable; variable 'b' was declared to be\n # specifically an int.\n #\n # Or more broadly, this field lets this Instance \"remember\" its original declaration\n # when applicable. We want this behavior because we want implicit Final declarations\n # to act pretty much identically with constants: we should be able to replace any\n # places where we use some Final variable with the original value and get the same\n # type-checking behavior. For example, we want this program:\n #\n # def expects_literal(x: Literal[3]) -> None: pass\n # var: Final = 3\n # expects_literal(var)\n #\n # ...to type-check in the exact same way as if we had written the program like this:\n #\n # def expects_literal(x: Literal[3]) -> None: pass\n # expects_literal(3)\n #\n # In order to make this work (especially with literal types), we need var's type\n # (an Instance) to remember the \"original\" value.\n #\n # Preserving this value within expressions is useful for similar reasons.\n #\n # Currently most of mypy will ignore this field and will continue to treat this type like\n # a regular Instance. We end up using this field only when we are explicitly within a\n # Literal context.\n self.last_known_value = last_known_value\n\n def accept(self, visitor: 'TypeVisitor[T]') -> T:\n return visitor.visit_instance(self)\n\n def __hash__(self) -> int:\n return hash((self.type, tuple(self.args), self.last_known_value))\n\n def __eq__(self, other: object) -> bool:\n if not isinstance(other, Instance):\n return NotImplemented\n return (self.type == other.type\n and self.args == other.args\n and self.last_known_value == other.last_known_value)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_Instance.serialize_Instance.serialize.return.data": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_Instance.serialize_Instance.serialize.return.data", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 845, "end_line": 856, "span_ids": ["Instance.serialize"], "tokens": 126}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Instance(ProperType):\n\n def serialize(self) -> Union[JsonDict, str]:\n assert self.type is not None\n type_ref = self.type.fullname\n if not self.args and not self.last_known_value:\n return type_ref\n data = {'.class': 'Instance',\n } # type: JsonDict\n data['type_ref'] = type_ref\n data['args'] = [arg.serialize() for arg in self.args]\n if self.last_known_value is not None:\n data['last_known_value'] = self.last_known_value.serialize()\n return data", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_Instance.deserialize_Instance.deserialize.return.inst": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_Instance.deserialize_Instance.deserialize.return.inst", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 858, "end_line": 874, "span_ids": ["Instance.deserialize"], "tokens": 177}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Instance(ProperType):\n\n @classmethod\n def deserialize(cls, data: Union[JsonDict, str]) -> 'Instance':\n if isinstance(data, str):\n inst = Instance(NOT_READY, [])\n inst.type_ref = data\n return inst\n assert data['.class'] == 'Instance'\n args = [] # type: List[Type]\n if 'args' in data:\n args_list = data['args']\n assert isinstance(args_list, list)\n args = [deserialize_type(arg) for arg in args_list]\n inst = Instance(NOT_READY, args)\n inst.type_ref = data['type_ref'] # Will be fixed up by fixup.py later.\n if 'last_known_value' in data:\n inst.last_known_value = LiteralType.deserialize(data['last_known_value'])\n return inst", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_Instance.copy_modified_Instance.has_readable_member.return.self_type_has_readable_me": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_Instance.copy_modified_Instance.has_readable_member.return.self_type_has_readable_me", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 876, "end_line": 890, "span_ids": ["Instance.has_readable_member", "Instance.copy_modified"], "tokens": 144}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Instance(ProperType):\n\n def copy_modified(self, *,\n args: Bogus[List[Type]] = _dummy,\n erased: Bogus[bool] = _dummy,\n last_known_value: Bogus[Optional['LiteralType']] = _dummy) -> 'Instance':\n return Instance(\n self.type,\n args if args is not _dummy else self.args,\n self.line,\n self.column,\n erased if erased is not _dummy else self.erased,\n last_known_value if last_known_value is not _dummy else self.last_known_value,\n )\n\n def has_readable_member(self, name: str) -> bool:\n return self.type.has_readable_member(name)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypeVarType_TypeVarType.deserialize.return.TypeVarType_tvdef_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypeVarType_TypeVarType.deserialize.return.TypeVarType_tvdef_", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 893, "end_line": 945, "span_ids": ["TypeVarType.accept", "TypeVarType.__eq__", "TypeVarType.serialize", "TypeVarType.deserialize", "TypeVarType.__hash__", "TypeVarType.__init__", "TypeVarType"], "tokens": 483}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeVarType(ProperType):\n \"\"\"A type variable type.\n\n This refers to either a class type variable (id > 0) or a function\n type variable (id < 0).\n \"\"\"\n\n __slots__ = ('name', 'fullname', 'id', 'values', 'upper_bound', 'variance')\n\n def __init__(self, binder: TypeVarDef, line: int = -1, column: int = -1) -> None:\n super().__init__(line, column)\n self.name = binder.name # Name of the type variable (for messages and debugging)\n self.fullname = binder.fullname # type: str\n self.id = binder.id # type: TypeVarId\n # Value restriction, empty list if no restriction\n self.values = binder.values # type: List[Type]\n # Upper bound for values\n self.upper_bound = binder.upper_bound # type: Type\n # See comments in TypeVarDef for more about variance.\n self.variance = binder.variance # type: int\n\n def accept(self, visitor: 'TypeVisitor[T]') -> T:\n return visitor.visit_type_var(self)\n\n def __hash__(self) -> int:\n return hash(self.id)\n\n def __eq__(self, other: object) -> bool:\n if not isinstance(other, TypeVarType):\n return NotImplemented\n return self.id == other.id\n\n def serialize(self) -> JsonDict:\n assert not self.id.is_meta_var()\n return {'.class': 'TypeVarType',\n 'name': self.name,\n 'fullname': self.fullname,\n 'id': self.id.raw_id,\n 'values': [v.serialize() for v in self.values],\n 'upper_bound': self.upper_bound.serialize(),\n 'variance': self.variance,\n }\n\n @classmethod\n def deserialize(cls, data: JsonDict) -> 'TypeVarType':\n assert data['.class'] == 'TypeVarType'\n tvdef = TypeVarDef(data['name'],\n data['fullname'],\n data['id'],\n [deserialize_type(v) for v in data['values']],\n deserialize_type(data['upper_bound']),\n data['variance'])\n return TypeVarType(tvdef)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_FunctionLike_FormalArgument.NamedTuple_FormalArgumen": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_FunctionLike_FormalArgument.NamedTuple_FormalArgumen", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 948, "end_line": 980, "span_ids": ["FunctionLike.is_type_obj", "FunctionLike.__init__", "FunctionLike.items", "FunctionLike.type_object", "FunctionLike.get_name", "FunctionLike", "FunctionLike.with_name", "impl:18"], "tokens": 236}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FunctionLike(ProperType):\n \"\"\"Abstract base class for function types.\"\"\"\n\n __slots__ = ('fallback',)\n\n def __init__(self, line: int = -1, column: int = -1) -> None:\n super().__init__(line, column)\n self.can_be_false = False\n if TYPE_CHECKING: # we don't want a runtime None value\n # Corresponding instance type (e.g. builtins.type)\n self.fallback = cast(Instance, None)\n\n @abstractmethod\n def is_type_obj(self) -> bool: pass\n\n @abstractmethod\n def type_object(self) -> mypy.nodes.TypeInfo: pass\n\n @abstractmethod\n def items(self) -> List['CallableType']: pass\n\n @abstractmethod\n def with_name(self, name: str) -> 'FunctionLike': pass\n\n @abstractmethod\n def get_name(self) -> Optional[str]: pass\n\n\nFormalArgument = NamedTuple('FormalArgument', [\n ('name', Optional[str]),\n ('pos', Optional[int]),\n ('typ', Type),\n ('required', bool)])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_CallableType_CallableType.__slots__._arg_types_Types_of": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_CallableType_CallableType.__slots__._arg_types_Types_of", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 993, "end_line": 1019, "span_ids": ["CallableType"], "tokens": 358}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CallableType(FunctionLike):\n \"\"\"Type of a non-overloaded callable object (such as function).\"\"\"\n\n __slots__ = ('arg_types', # Types of function arguments\n 'arg_kinds', # ARG_ constants\n 'arg_names', # Argument names; None if not a keyword argument\n 'min_args', # Minimum number of arguments; derived from arg_kinds\n 'ret_type', # Return value type\n 'name', # Name (may be None; for error messages and plugins)\n 'definition', # For error messages. May be None.\n 'variables', # Type variables for a generic function\n 'is_ellipsis_args', # Is this Callable[..., t] (with literal '...')?\n 'is_classmethod_class', # Is this callable constructed for the benefit\n # of a classmethod's 'cls' argument?\n 'implicit', # Was this type implicitly generated instead of explicitly\n # specified by the user?\n 'special_sig', # Non-None for signatures that require special handling\n # (currently only value is 'dict' for a signature similar to\n # 'dict')\n 'from_type_type', # Was this callable generated by analyzing Type[...]\n # instantiation?\n 'bound_args', # Bound type args, mostly unused but may be useful for\n # tools that consume mypy ASTs\n 'def_extras', # Information about original definition we want to serialize.\n # This is used for more detailed error messages.\n 'type_guard', # T, if -> TypeGuard[T] (ret_type is bool in this case).\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_CallableType.copy_modified_CallableType.copy_modified.return.CallableType_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_CallableType.copy_modified_CallableType.copy_modified.return.CallableType_", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1075, "end_line": 1113, "span_ids": ["CallableType.copy_modified"], "tokens": 566}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CallableType(FunctionLike):\n\n def copy_modified(self,\n arg_types: Bogus[Sequence[Type]] = _dummy,\n arg_kinds: Bogus[List[int]] = _dummy,\n arg_names: Bogus[List[Optional[str]]] = _dummy,\n ret_type: Bogus[Type] = _dummy,\n fallback: Bogus[Instance] = _dummy,\n name: Bogus[Optional[str]] = _dummy,\n definition: Bogus[SymbolNode] = _dummy,\n variables: Bogus[Sequence[TypeVarLikeDef]] = _dummy,\n line: Bogus[int] = _dummy,\n column: Bogus[int] = _dummy,\n is_ellipsis_args: Bogus[bool] = _dummy,\n implicit: Bogus[bool] = _dummy,\n special_sig: Bogus[Optional[str]] = _dummy,\n from_type_type: Bogus[bool] = _dummy,\n bound_args: Bogus[List[Optional[Type]]] = _dummy,\n def_extras: Bogus[Dict[str, Any]] = _dummy,\n type_guard: Bogus[Optional[Type]] = _dummy,\n ) -> 'CallableType':\n return CallableType(\n arg_types=arg_types if arg_types is not _dummy else self.arg_types,\n arg_kinds=arg_kinds if arg_kinds is not _dummy else self.arg_kinds,\n arg_names=arg_names if arg_names is not _dummy else self.arg_names,\n ret_type=ret_type if ret_type is not _dummy else self.ret_type,\n fallback=fallback if fallback is not _dummy else self.fallback,\n name=name if name is not _dummy else self.name,\n definition=definition if definition is not _dummy else self.definition,\n variables=variables if variables is not _dummy else self.variables,\n line=line if line is not _dummy else self.line,\n column=column if column is not _dummy else self.column,\n is_ellipsis_args=(\n is_ellipsis_args if is_ellipsis_args is not _dummy else self.is_ellipsis_args),\n implicit=implicit if implicit is not _dummy else self.implicit,\n special_sig=special_sig if special_sig is not _dummy else self.special_sig,\n from_type_type=from_type_type if from_type_type is not _dummy else self.from_type_type,\n bound_args=bound_args if bound_args is not _dummy else self.bound_args,\n def_extras=def_extras if def_extras is not _dummy else dict(self.def_extras),\n type_guard=type_guard if type_guard is not _dummy else self.type_guard,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_CallableType.var_arg_CallableType.max_possible_positional_args.return.len_kind_not_in_blacklis": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_CallableType.var_arg_CallableType.max_possible_positional_args.return.len_kind_not_in_blacklis", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1099, "end_line": 1153, "span_ids": ["CallableType.kw_arg", "CallableType.type_object", "CallableType.is_var_arg", "CallableType.accept", "CallableType.max_possible_positional_args", "CallableType.is_kw_arg", "CallableType.var_arg", "CallableType.with_name", "CallableType.is_type_obj", "CallableType.get_name"], "tokens": 481}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CallableType(FunctionLike):\n\n def var_arg(self) -> Optional[FormalArgument]:\n \"\"\"The formal argument for *args.\"\"\"\n for position, (type, kind) in enumerate(zip(self.arg_types, self.arg_kinds)):\n if kind == ARG_STAR:\n return FormalArgument(None, position, type, False)\n return None\n\n def kw_arg(self) -> Optional[FormalArgument]:\n \"\"\"The formal argument for **kwargs.\"\"\"\n for position, (type, kind) in enumerate(zip(self.arg_types, self.arg_kinds)):\n if kind == ARG_STAR2:\n return FormalArgument(None, position, type, False)\n return None\n\n @property\n def is_var_arg(self) -> bool:\n \"\"\"Does this callable have a *args argument?\"\"\"\n return ARG_STAR in self.arg_kinds\n\n @property\n def is_kw_arg(self) -> bool:\n \"\"\"Does this callable have a **kwargs argument?\"\"\"\n return ARG_STAR2 in self.arg_kinds\n\n def is_type_obj(self) -> bool:\n return self.fallback.type.is_metaclass()\n\n def type_object(self) -> mypy.nodes.TypeInfo:\n assert self.is_type_obj()\n ret = get_proper_type(self.ret_type)\n if isinstance(ret, TypeVarType):\n ret = get_proper_type(ret.upper_bound)\n if isinstance(ret, TupleType):\n ret = ret.partial_fallback\n assert isinstance(ret, Instance)\n return ret.type\n\n def accept(self, visitor: 'TypeVisitor[T]') -> T:\n return visitor.visit_callable_type(self)\n\n def with_name(self, name: str) -> 'CallableType':\n \"\"\"Return a copy of this type with the specified name.\"\"\"\n return self.copy_modified(ret_type=self.ret_type, name=name)\n\n def get_name(self) -> Optional[str]:\n return self.name\n\n def max_possible_positional_args(self) -> int:\n \"\"\"Returns maximum number of positional arguments this method could possibly accept.\n\n This takes into account *arg and **kwargs but excludes keyword-only args.\"\"\"\n if self.is_var_arg or self.is_kw_arg:\n return sys.maxsize\n blacklist = (ARG_NAMED, ARG_NAMED_OPT)\n return len([kind not in blacklist for kind in self.arg_kinds])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_CallableType.formal_arguments_CallableType.formal_arguments.for_i_in_range_len_self_a.yield_FormalArgument_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_CallableType.formal_arguments_CallableType.formal_arguments.for_i_in_range_len_self_a.yield_FormalArgument_", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1155, "end_line": 1177, "span_ids": ["CallableType.formal_arguments"], "tokens": 231}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CallableType(FunctionLike):\n\n def formal_arguments(self, include_star_args: bool = False) -> Iterator[FormalArgument]:\n \"\"\"Yields the formal arguments corresponding to this callable, ignoring *arg and **kwargs.\n\n To handle *args and **kwargs, use the 'callable.var_args' and 'callable.kw_args' fields,\n if they are not None.\n\n If you really want to include star args in the yielded output, set the\n 'include_star_args' parameter to 'True'.\"\"\"\n done_with_positional = False\n for i in range(len(self.arg_types)):\n kind = self.arg_kinds[i]\n if kind in (ARG_STAR, ARG_STAR2, ARG_NAMED, ARG_NAMED_OPT):\n done_with_positional = True\n if not include_star_args and kind in (ARG_STAR, ARG_STAR2):\n continue\n\n required = kind in (ARG_POS, ARG_NAMED)\n pos = None if done_with_positional else i\n yield FormalArgument(\n self.arg_names[i],\n pos,\n self.arg_types[i],\n required)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_CallableType.argument_by_name_CallableType.argument_by_name.return.self_try_synthesizing_arg": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_CallableType.argument_by_name_CallableType.argument_by_name.return.self_try_synthesizing_arg", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1179, "end_line": 1193, "span_ids": ["CallableType.argument_by_name"], "tokens": 173}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CallableType(FunctionLike):\n\n def argument_by_name(self, name: Optional[str]) -> Optional[FormalArgument]:\n if name is None:\n return None\n seen_star = False\n for i, (arg_name, kind, typ) in enumerate(\n zip(self.arg_names, self.arg_kinds, self.arg_types)):\n # No more positional arguments after these.\n if kind in (ARG_STAR, ARG_STAR2, ARG_NAMED, ARG_NAMED_OPT):\n seen_star = True\n if kind == ARG_STAR or kind == ARG_STAR2:\n continue\n if arg_name == name:\n position = None if seen_star else i\n return FormalArgument(name, position, typ, kind in (ARG_POS, ARG_NAMED))\n return self.try_synthesizing_arg_from_kwarg(name)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_CallableType.argument_by_position_CallableType.argument_by_position.if_kind_in_ARG_POS_ARG_.else_.return.self_try_synthesizing_arg": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_CallableType.argument_by_position_CallableType.argument_by_position.if_kind_in_ARG_POS_ARG_.else_.return.self_try_synthesizing_arg", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1195, "end_line": 1208, "span_ids": ["CallableType.argument_by_position"], "tokens": 128}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CallableType(FunctionLike):\n\n def argument_by_position(self, position: Optional[int]) -> Optional[FormalArgument]:\n if position is None:\n return None\n if position >= len(self.arg_names):\n return self.try_synthesizing_arg_from_vararg(position)\n name, kind, typ = (\n self.arg_names[position],\n self.arg_kinds[position],\n self.arg_types[position],\n )\n if kind in (ARG_POS, ARG_OPT):\n return FormalArgument(name, position, typ, kind == ARG_POS)\n else:\n return self.try_synthesizing_arg_from_vararg(position)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_CallableType.try_synthesizing_arg_from_kwarg_CallableType.__hash__.return.hash_self_ret_type_self": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_CallableType.try_synthesizing_arg_from_kwarg_CallableType.__hash__.return.hash_self_ret_type_self", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1210, "end_line": 1241, "span_ids": ["CallableType.try_synthesizing_arg_from_kwarg", "CallableType.type_var_ids", "CallableType.items", "CallableType.is_generic", "CallableType.try_synthesizing_arg_from_vararg", "CallableType.__hash__"], "tokens": 257}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CallableType(FunctionLike):\n\n def try_synthesizing_arg_from_kwarg(self,\n name: Optional[str]) -> Optional[FormalArgument]:\n kw_arg = self.kw_arg()\n if kw_arg is not None:\n return FormalArgument(name, None, kw_arg.typ, False)\n else:\n return None\n\n def try_synthesizing_arg_from_vararg(self,\n position: Optional[int]) -> Optional[FormalArgument]:\n var_arg = self.var_arg()\n if var_arg is not None:\n return FormalArgument(None, position, var_arg.typ, False)\n else:\n return None\n\n def items(self) -> List['CallableType']:\n return [self]\n\n def is_generic(self) -> bool:\n return bool(self.variables)\n\n def type_var_ids(self) -> List[TypeVarId]:\n a = [] # type: List[TypeVarId]\n for tv in self.variables:\n a.append(tv.id)\n return a\n\n def __hash__(self) -> int:\n return hash((self.ret_type, self.is_type_obj(),\n self.is_ellipsis_args, self.name,\n tuple(self.arg_types), tuple(self.arg_names), tuple(self.arg_kinds)))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_CallableType.__eq___CallableType.__eq__.if_isinstance_other_Call.else_.return.NotImplemented": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_CallableType.__eq___CallableType.__eq__.if_isinstance_other_Call.else_.return.NotImplemented", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1243, "end_line": 1253, "span_ids": ["CallableType.__eq__"], "tokens": 113}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CallableType(FunctionLike):\n\n def __eq__(self, other: object) -> bool:\n if isinstance(other, CallableType):\n return (self.ret_type == other.ret_type and\n self.arg_types == other.arg_types and\n self.arg_names == other.arg_names and\n self.arg_kinds == other.arg_kinds and\n self.name == other.name and\n self.is_type_obj() == other.is_type_obj() and\n self.is_ellipsis_args == other.is_ellipsis_args)\n else:\n return NotImplemented", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_CallableType.serialize_CallableType.serialize.return._class_CallableType_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_CallableType.serialize_CallableType.serialize.return._class_CallableType_", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1271, "end_line": 1291, "span_ids": ["CallableType.serialize"], "tokens": 245}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CallableType(FunctionLike):\n\n def serialize(self) -> JsonDict:\n # TODO: As an optimization, leave out everything related to\n # generic functions for non-generic functions.\n assert (self.type_guard is None\n or isinstance(get_proper_type(self.type_guard), Instance)), str(self.type_guard)\n return {'.class': 'CallableType',\n 'arg_types': [t.serialize() for t in self.arg_types],\n 'arg_kinds': self.arg_kinds,\n 'arg_names': self.arg_names,\n 'ret_type': self.ret_type.serialize(),\n 'fallback': self.fallback.serialize(),\n 'name': self.name,\n # We don't serialize the definition (only used for error messages).\n 'variables': [v.serialize() for v in self.variables],\n 'is_ellipsis_args': self.is_ellipsis_args,\n 'implicit': self.implicit,\n 'bound_args': [(None if t is None else t.serialize())\n for t in self.bound_args],\n 'def_extras': dict(self.def_extras),\n 'type_guard': self.type_guard.serialize() if self.type_guard is not None else None,\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_CallableType.deserialize_CallableType.deserialize.return.CallableType_deserialize": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_CallableType.deserialize_CallableType.deserialize.return.CallableType_deserialize", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1293, "end_line": 1311, "span_ids": ["CallableType.deserialize"], "tokens": 194}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CallableType(FunctionLike):\n\n @classmethod\n def deserialize(cls, data: JsonDict) -> 'CallableType':\n assert data['.class'] == 'CallableType'\n # TODO: Set definition to the containing SymbolNode?\n return CallableType([deserialize_type(t) for t in data['arg_types']],\n data['arg_kinds'],\n data['arg_names'],\n deserialize_type(data['ret_type']),\n Instance.deserialize(data['fallback']),\n name=data['name'],\n variables=[TypeVarDef.deserialize(v) for v in data['variables']],\n is_ellipsis_args=data['is_ellipsis_args'],\n implicit=data['implicit'],\n bound_args=[(None if t is None else deserialize_type(t))\n for t in data['bound_args']],\n def_extras=data['def_extras'],\n type_guard=(deserialize_type(data['type_guard'])\n if data['type_guard'] is not None else None),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_Overloaded_Overloaded.deserialize.return.Overloaded_CallableType_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_Overloaded_Overloaded.deserialize.return.Overloaded_CallableType_", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1293, "end_line": 1353, "span_ids": ["Overloaded.items", "Overloaded.is_type_obj", "Overloaded.name", "Overloaded.accept", "Overloaded", "Overloaded.__eq__", "Overloaded.serialize", "Overloaded.type_object", "Overloaded.__hash__", "Overloaded.deserialize", "Overloaded.with_name", "Overloaded.__init__", "Overloaded.get_name"], "tokens": 511}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Overloaded(FunctionLike):\n \"\"\"Overloaded function type T1, ... Tn, where each Ti is CallableType.\n\n The variant to call is chosen based on static argument\n types. Overloaded function types can only be defined in stub\n files, and thus there is no explicit runtime dispatch\n implementation.\n \"\"\"\n\n _items = None # type: List[CallableType] # Must not be empty\n\n def __init__(self, items: List[CallableType]) -> None:\n super().__init__(items[0].line, items[0].column)\n self._items = items\n self.fallback = items[0].fallback\n\n def items(self) -> List[CallableType]:\n return self._items\n\n def name(self) -> Optional[str]:\n return self.get_name()\n\n def is_type_obj(self) -> bool:\n # All the items must have the same type object status, so it's\n # sufficient to query only (any) one of them.\n return self._items[0].is_type_obj()\n\n def type_object(self) -> mypy.nodes.TypeInfo:\n # All the items must have the same type object, so it's sufficient to\n # query only (any) one of them.\n return self._items[0].type_object()\n\n def with_name(self, name: str) -> 'Overloaded':\n ni = [] # type: List[CallableType]\n for it in self._items:\n ni.append(it.with_name(name))\n return Overloaded(ni)\n\n def get_name(self) -> Optional[str]:\n return self._items[0].name\n\n def accept(self, visitor: 'TypeVisitor[T]') -> T:\n return visitor.visit_overloaded(self)\n\n def __hash__(self) -> int:\n return hash(tuple(self.items()))\n\n def __eq__(self, other: object) -> bool:\n if not isinstance(other, Overloaded):\n return NotImplemented\n return self.items() == other.items()\n\n def serialize(self) -> JsonDict:\n return {'.class': 'Overloaded',\n 'items': [t.serialize() for t in self.items()],\n }\n\n @classmethod\n def deserialize(cls, data: JsonDict) -> 'Overloaded':\n assert data['.class'] == 'Overloaded'\n return Overloaded([CallableType.deserialize(t) for t in data['items']])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TupleType_TupleType.slice.return.TupleType_self_items_begi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TupleType_TupleType.slice.return.TupleType_self_items_begi", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1356, "end_line": 1421, "span_ids": ["TupleType", "TupleType.__hash__", "TupleType.length", "TupleType.__eq__", "TupleType.copy_modified", "TupleType.accept", "TupleType.serialize", "TupleType.slice", "TupleType.__init__", "TupleType.deserialize"], "tokens": 620}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TupleType(ProperType):\n \"\"\"The tuple type Tuple[T1, ..., Tn] (at least one type argument).\n\n Instance variables:\n items: Tuple item types\n partial_fallback: The (imprecise) underlying instance type that is used\n for non-tuple methods. This is generally builtins.tuple[Any] for\n regular tuples, but it's different for named tuples and classes with\n a tuple base class. Use mypy.typeops.tuple_fallback to calculate the\n precise fallback type derived from item types.\n implicit: If True, derived from a tuple expression (t,....) instead of Tuple[t, ...]\n \"\"\"\n\n items = None # type: List[Type]\n partial_fallback = None # type: Instance\n implicit = False\n\n def __init__(self, items: List[Type], fallback: Instance, line: int = -1,\n column: int = -1, implicit: bool = False) -> None:\n super().__init__(line, column)\n self.items = items\n self.partial_fallback = fallback\n self.implicit = implicit\n self.can_be_true = len(self.items) > 0\n self.can_be_false = len(self.items) == 0\n\n def length(self) -> int:\n return len(self.items)\n\n def accept(self, visitor: 'TypeVisitor[T]') -> T:\n return visitor.visit_tuple_type(self)\n\n def __hash__(self) -> int:\n return hash((tuple(self.items), self.partial_fallback))\n\n def __eq__(self, other: object) -> bool:\n if not isinstance(other, TupleType):\n return NotImplemented\n return self.items == other.items and self.partial_fallback == other.partial_fallback\n\n def serialize(self) -> JsonDict:\n return {'.class': 'TupleType',\n 'items': [t.serialize() for t in self.items],\n 'partial_fallback': self.partial_fallback.serialize(),\n 'implicit': self.implicit,\n }\n\n @classmethod\n def deserialize(cls, data: JsonDict) -> 'TupleType':\n assert data['.class'] == 'TupleType'\n return TupleType([deserialize_type(t) for t in data['items']],\n Instance.deserialize(data['partial_fallback']),\n implicit=data['implicit'])\n\n def copy_modified(self, *, fallback: Optional[Instance] = None,\n items: Optional[List[Type]] = None) -> 'TupleType':\n if fallback is None:\n fallback = self.partial_fallback\n if items is None:\n items = self.items\n return TupleType(items, fallback, self.line, self.column)\n\n def slice(self, begin: Optional[int], end: Optional[int],\n stride: Optional[int]) -> 'TupleType':\n return TupleType(self.items[begin:end:stride], self.partial_fallback,\n self.line, self.column, self.implicit)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypedDictType_TypedDictType.as_anonymous.return.self_fallback_type_typedd": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypedDictType_TypedDictType.as_anonymous.return.self_fallback_type_typedd", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1424, "end_line": 1497, "span_ids": ["TypedDictType", "TypedDictType.__hash__", "TypedDictType.__eq__", "TypedDictType.__init__", "TypedDictType.as_anonymous", "TypedDictType.is_anonymous", "TypedDictType.serialize", "TypedDictType.accept", "TypedDictType.deserialize"], "tokens": 736}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypedDictType(ProperType):\n \"\"\"Type of TypedDict object {'k1': v1, ..., 'kn': vn}.\n\n A TypedDict object is a dictionary with specific string (literal) keys. Each\n key has a value with a distinct type that depends on the key. TypedDict objects\n are normal dict objects at runtime.\n\n A TypedDictType can be either named or anonymous. If it's anonymous, its\n fallback will be typing_extensions._TypedDict (Instance). _TypedDict is a subclass\n of Mapping[str, object] and defines all non-mapping dict methods that TypedDict\n supports. Some dict methods are unsafe and not supported. _TypedDict isn't defined\n at runtime.\n\n If a TypedDict is named, its fallback will be an Instance of the named type\n (ex: \"Point\") whose TypeInfo has a typeddict_type that is anonymous. This\n is similar to how named tuples work.\n\n TODO: The fallback structure is perhaps overly complicated.\n \"\"\"\n\n items = None # type: OrderedDict[str, Type] # item_name -> item_type\n required_keys = None # type: Set[str]\n fallback = None # type: Instance\n\n def __init__(self, items: 'OrderedDict[str, Type]', required_keys: Set[str],\n fallback: Instance, line: int = -1, column: int = -1) -> None:\n super().__init__(line, column)\n self.items = items\n self.required_keys = required_keys\n self.fallback = fallback\n self.can_be_true = len(self.items) > 0\n self.can_be_false = len(self.required_keys) == 0\n\n def accept(self, visitor: 'TypeVisitor[T]') -> T:\n return visitor.visit_typeddict_type(self)\n\n def __hash__(self) -> int:\n return hash((frozenset(self.items.items()), self.fallback,\n frozenset(self.required_keys)))\n\n def __eq__(self, other: object) -> bool:\n if isinstance(other, TypedDictType):\n if frozenset(self.items.keys()) != frozenset(other.items.keys()):\n return False\n for (_, left_item_type, right_item_type) in self.zip(other):\n if not left_item_type == right_item_type:\n return False\n return self.fallback == other.fallback and self.required_keys == other.required_keys\n else:\n return NotImplemented\n\n def serialize(self) -> JsonDict:\n return {'.class': 'TypedDictType',\n 'items': [[n, t.serialize()] for (n, t) in self.items.items()],\n 'required_keys': sorted(self.required_keys),\n 'fallback': self.fallback.serialize(),\n }\n\n @classmethod\n def deserialize(cls, data: JsonDict) -> 'TypedDictType':\n assert data['.class'] == 'TypedDictType'\n return TypedDictType(OrderedDict([(n, deserialize_type(t))\n for (n, t) in data['items']]),\n set(data['required_keys']),\n Instance.deserialize(data['fallback']))\n\n def is_anonymous(self) -> bool:\n return self.fallback.type.fullname in TPDICT_FB_NAMES\n\n def as_anonymous(self) -> 'TypedDictType':\n if self.is_anonymous():\n return self\n assert self.fallback.type.typeddict_type is not None\n return self.fallback.type.typeddict_type.as_anonymous()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypedDictType.copy_modified_TypedDictType.copy_modified.return.TypedDictType_items_requ": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypedDictType.copy_modified_TypedDictType.copy_modified.return.TypedDictType_items_requ", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1499, "end_line": 1510, "span_ids": ["TypedDictType.copy_modified"], "tokens": 128}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypedDictType(ProperType):\n\n def copy_modified(self, *, fallback: Optional[Instance] = None,\n item_types: Optional[List[Type]] = None,\n required_keys: Optional[Set[str]] = None) -> 'TypedDictType':\n if fallback is None:\n fallback = self.fallback\n if item_types is None:\n items = self.items\n else:\n items = OrderedDict(zip(self.items, item_types))\n if required_keys is None:\n required_keys = self.required_keys\n return TypedDictType(items, required_keys, fallback, self.line, self.column)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypedDictType.create_anonymous_fallback_TypedDictType.zip.for_item_name_left_item.if_right_item_type_is_not.yield_item_name_left_it": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypedDictType.create_anonymous_fallback_TypedDictType.zip.for_item_name_left_item.if_right_item_type_is_not.yield_item_name_left_it", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1512, "end_line": 1524, "span_ids": ["TypedDictType.create_anonymous_fallback", "TypedDictType.names_are_wider_than", "TypedDictType.zip"], "tokens": 152}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypedDictType(ProperType):\n\n def create_anonymous_fallback(self, *, value_type: Type) -> Instance:\n anonymous = self.as_anonymous()\n return anonymous.fallback\n\n def names_are_wider_than(self, other: 'TypedDictType') -> bool:\n return len(other.items.keys() - self.items.keys()) == 0\n\n def zip(self, right: 'TypedDictType') -> Iterable[Tuple[str, Type, Type]]:\n left = self\n for (item_name, left_item_type) in left.items.items():\n right_item_type = right.items.get(item_name)\n if right_item_type is not None:\n yield (item_name, left_item_type, right_item_type)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypedDictType.zipall_TypedDictType.zipall.for_item_name_right_ite.yield_item_name_None_r": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypedDictType.zipall_TypedDictType.zipall.for_item_name_right_ite.yield_item_name_None_r", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1526, "end_line": 1535, "span_ids": ["TypedDictType.zipall"], "tokens": 122}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypedDictType(ProperType):\n\n def zipall(self, right: 'TypedDictType') \\\n -> Iterable[Tuple[str, Optional[Type], Optional[Type]]]:\n left = self\n for (item_name, left_item_type) in left.items.items():\n right_item_type = right.items.get(item_name)\n yield (item_name, left_item_type, right_item_type)\n for (item_name, right_item_type) in right.items.items():\n if item_name in left.items:\n continue\n yield (item_name, None, right_item_type)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_RawExpressionType_RawExpressionType.__eq__.if_isinstance_other_RawE.else_.return.NotImplemented": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_RawExpressionType_RawExpressionType.__eq__.if_isinstance_other_RawE.else_.return.NotImplemented", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1538, "end_line": 1611, "span_ids": ["RawExpressionType.accept", "RawExpressionType.__init__", "RawExpressionType.__hash__", "RawExpressionType.simple_name", "RawExpressionType", "RawExpressionType.__eq__", "RawExpressionType.serialize"], "tokens": 571}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RawExpressionType(ProperType):\n \"\"\"A synthetic type representing some arbitrary expression that does not cleanly\n translate into a type.\n\n This synthetic type is only used at the beginning stages of semantic analysis\n and should be completely removing during the process for mapping UnboundTypes to\n actual types: we either turn it into a LiteralType or an AnyType.\n\n For example, suppose `Foo[1]` is initially represented as the following:\n\n UnboundType(\n name='Foo',\n args=[\n RawExpressionType(value=1, base_type_name='builtins.int'),\n ],\n )\n\n As we perform semantic analysis, this type will transform into one of two\n possible forms.\n\n If 'Foo' was an alias for 'Literal' all along, this type is transformed into:\n\n LiteralType(value=1, fallback=int_instance_here)\n\n Alternatively, if 'Foo' is an unrelated class, we report an error and instead\n produce something like this:\n\n Instance(type=typeinfo_for_foo, args=[AnyType(TypeOfAny.from_error))\n\n If the \"note\" field is not None, the provided note will be reported alongside the\n error at this point.\n\n Note: if \"literal_value\" is None, that means this object is representing some\n expression that cannot possibly be a parameter of Literal[...]. For example,\n \"Foo[3j]\" would be represented as:\n\n UnboundType(\n name='Foo',\n args=[\n RawExpressionType(value=None, base_type_name='builtins.complex'),\n ],\n )\n \"\"\"\n def __init__(self,\n literal_value: Optional[LiteralValue],\n base_type_name: str,\n line: int = -1,\n column: int = -1,\n note: Optional[str] = None,\n ) -> None:\n super().__init__(line, column)\n self.literal_value = literal_value\n self.base_type_name = base_type_name\n self.note = note\n\n def simple_name(self) -> str:\n return self.base_type_name.replace(\"builtins.\", \"\")\n\n def accept(self, visitor: 'TypeVisitor[T]') -> T:\n assert isinstance(visitor, SyntheticTypeVisitor)\n return visitor.visit_raw_expression_type(self)\n\n def serialize(self) -> JsonDict:\n assert False, \"Synthetic types don't serialize\"\n\n def __hash__(self) -> int:\n return hash((self.literal_value, self.base_type_name))\n\n def __eq__(self, other: object) -> bool:\n if isinstance(other, RawExpressionType):\n return (self.base_type_name == other.base_type_name\n and self.literal_value == other.literal_value)\n else:\n return NotImplemented", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_LiteralType_LiteralType.is_enum_literal.return.self_fallback_type_is_enu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_LiteralType_LiteralType.is_enum_literal.return.self_fallback_type_is_enu", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1614, "end_line": 1656, "span_ids": ["LiteralType.__hash__", "LiteralType.__eq__", "LiteralType.can_be_true_default", "LiteralType.__init__", "LiteralType.can_be_false_default", "LiteralType.is_enum_literal", "LiteralType", "LiteralType.accept"], "tokens": 345}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LiteralType(ProperType):\n \"\"\"The type of a Literal instance. Literal[Value]\n\n A Literal always consists of:\n\n 1. A native Python object corresponding to the contained inner value\n 2. A fallback for this Literal. The fallback also corresponds to the\n parent type this Literal subtypes.\n\n For example, 'Literal[42]' is represented as\n 'LiteralType(value=42, fallback=instance_of_int)'\n\n As another example, `Literal[Color.RED]` (where Color is an enum) is\n represented as `LiteralType(value=\"RED\", fallback=instance_of_color)'.\n \"\"\"\n __slots__ = ('value', 'fallback')\n\n def __init__(self, value: LiteralValue, fallback: Instance,\n line: int = -1, column: int = -1) -> None:\n self.value = value\n super().__init__(line, column)\n self.fallback = fallback\n\n def can_be_false_default(self) -> bool:\n return not self.value\n\n def can_be_true_default(self) -> bool:\n return bool(self.value)\n\n def accept(self, visitor: 'TypeVisitor[T]') -> T:\n return visitor.visit_literal_type(self)\n\n def __hash__(self) -> int:\n return hash((self.value, self.fallback))\n\n def __eq__(self, other: object) -> bool:\n if isinstance(other, LiteralType):\n return self.fallback == other.fallback and self.value == other.value\n else:\n return NotImplemented\n\n def is_enum_literal(self) -> bool:\n return self.fallback.type.is_enum", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_LiteralType.value_repr_LiteralType.deserialize.return.LiteralType_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_LiteralType.value_repr_LiteralType.deserialize.return.LiteralType_", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1658, "end_line": 1699, "span_ids": ["LiteralType.serialize", "LiteralType.value_repr", "LiteralType.deserialize"], "tokens": 375}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LiteralType(ProperType):\n\n def value_repr(self) -> str:\n \"\"\"Returns the string representation of the underlying type.\n\n This function is almost equivalent to running `repr(self.value)`,\n except it includes some additional logic to correctly handle cases\n where the value is a string, byte string, a unicode string, or an enum.\n \"\"\"\n raw = repr(self.value)\n fallback_name = self.fallback.type.fullname\n\n # If this is backed by an enum,\n if self.is_enum_literal():\n return '{}.{}'.format(fallback_name, self.value)\n\n if fallback_name == 'builtins.bytes':\n # Note: 'builtins.bytes' only appears in Python 3, so we want to\n # explicitly prefix with a \"b\"\n return 'b' + raw\n elif fallback_name == 'builtins.unicode':\n # Similarly, 'builtins.unicode' only appears in Python 2, where we also\n # want to explicitly prefix\n return 'u' + raw\n else:\n # 'builtins.str' could mean either depending on context, but either way\n # we don't prefix: it's the \"native\" string. And of course, if value is\n # some other type, we just return that string repr directly.\n return raw\n\n def serialize(self) -> Union[JsonDict, str]:\n return {\n '.class': 'LiteralType',\n 'value': self.value,\n 'fallback': self.fallback.serialize(),\n }\n\n @classmethod\n def deserialize(cls, data: JsonDict) -> 'LiteralType':\n assert data['.class'] == 'LiteralType'\n return LiteralType(\n value=data['value'],\n fallback=Instance.deserialize(data['fallback']),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_StarType_StarType.serialize.assert_False_Synthetic_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_StarType_StarType.serialize.assert_False_Synthetic_", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1702, "end_line": 1719, "span_ids": ["StarType", "StarType.__init__", "StarType.serialize", "StarType.accept"], "tokens": 140}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StarType(ProperType):\n \"\"\"The star type *type_parameter.\n\n This is not a real type but a syntactic AST construct.\n \"\"\"\n\n type = None # type: Type\n\n def __init__(self, type: Type, line: int = -1, column: int = -1) -> None:\n super().__init__(line, column)\n self.type = type\n\n def accept(self, visitor: 'TypeVisitor[T]') -> T:\n assert isinstance(visitor, SyntheticTypeVisitor)\n return visitor.visit_star_type(self)\n\n def serialize(self) -> JsonDict:\n assert False, \"Synthetic types don't serialize\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_UnionType_UnionType.accept.return.visitor_visit_union_type_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_UnionType_UnionType.accept.return.visitor_visit_union_type_", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1722, "end_line": 1768, "span_ids": ["UnionType.length", "UnionType.__hash__", "UnionType.__init__", "UnionType.make_union", "UnionType", "UnionType.make_union_4", "UnionType.__eq__", "UnionType.accept", "UnionType.make_union_3"], "tokens": 464}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class UnionType(ProperType):\n \"\"\"The union type Union[T1, ..., Tn] (at least one type argument).\"\"\"\n\n __slots__ = ('items', 'is_evaluated', 'uses_pep604_syntax')\n\n def __init__(self, items: Sequence[Type], line: int = -1, column: int = -1,\n is_evaluated: bool = True, uses_pep604_syntax: bool = False) -> None:\n super().__init__(line, column)\n self.items = flatten_nested_unions(items)\n self.can_be_true = any(item.can_be_true for item in items)\n self.can_be_false = any(item.can_be_false for item in items)\n # is_evaluated should be set to false for type comments and string literals\n self.is_evaluated = is_evaluated\n # uses_pep604_syntax is True if Union uses OR syntax (X | Y)\n self.uses_pep604_syntax = uses_pep604_syntax\n\n def __hash__(self) -> int:\n return hash(frozenset(self.items))\n\n def __eq__(self, other: object) -> bool:\n if not isinstance(other, UnionType):\n return NotImplemented\n return frozenset(self.items) == frozenset(other.items)\n\n @overload\n @staticmethod\n def make_union(items: Sequence[ProperType],\n line: int = -1, column: int = -1) -> ProperType: ...\n\n @overload\n @staticmethod\n def make_union(items: Sequence[Type], line: int = -1, column: int = -1) -> Type: ...\n\n @staticmethod\n def make_union(items: Sequence[Type], line: int = -1, column: int = -1) -> Type:\n if len(items) > 1:\n return UnionType(items, line, column)\n elif len(items) == 1:\n return items[0]\n else:\n return UninhabitedType()\n\n def length(self) -> int:\n return len(self.items)\n\n def accept(self, visitor: 'TypeVisitor[T]') -> T:\n return visitor.visit_union_type(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_UnionType.has_readable_member_UnionType.has_readable_member.return.all_isinstance_x_UnionT": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_UnionType.has_readable_member_UnionType.has_readable_member.return.all_isinstance_x_UnionT", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1765, "end_line": 1773, "span_ids": ["UnionType.has_readable_member"], "tokens": 117}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class UnionType(ProperType):\n\n def has_readable_member(self, name: str) -> bool:\n \"\"\"For a tree of unions of instances, check whether all instances have a given member.\n\n TODO: Deal with attributes of TupleType etc.\n TODO: This should probably be refactored to go elsewhere.\n \"\"\"\n return all((isinstance(x, UnionType) and x.has_readable_member(name)) or\n (isinstance(x, Instance) and x.type.has_readable_member(name))\n for x in get_proper_types(self.relevant_items()))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_UnionType.relevant_items_UnionType.deserialize.return.UnionType_deserialize_ty": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_UnionType.relevant_items_UnionType.deserialize.return.UnionType_deserialize_ty", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1775, "end_line": 1790, "span_ids": ["UnionType.serialize", "UnionType.deserialize", "UnionType.relevant_items"], "tokens": 154}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class UnionType(ProperType):\n\n def relevant_items(self) -> List[Type]:\n \"\"\"Removes NoneTypes from Unions when strict Optional checking is off.\"\"\"\n if state.strict_optional:\n return self.items\n else:\n return [i for i in get_proper_types(self.items) if not isinstance(i, NoneType)]\n\n def serialize(self) -> JsonDict:\n return {'.class': 'UnionType',\n 'items': [t.serialize() for t in self.items],\n }\n\n @classmethod\n def deserialize(cls, data: JsonDict) -> 'UnionType':\n assert data['.class'] == 'UnionType'\n return UnionType([deserialize_type(t) for t in data['items']])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_PartialType_PartialType.accept.return.visitor_visit_partial_typ": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_PartialType_PartialType.accept.return.visitor_visit_partial_typ", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1793, "end_line": 1825, "span_ids": ["PartialType", "PartialType.__init__", "PartialType.accept"], "tokens": 304}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PartialType(ProperType):\n \"\"\"Type such as List[?] where type arguments are unknown, or partial None type.\n\n These are used for inferring types in multiphase initialization such as this:\n\n x = [] # x gets a partial type List[?], as item type is unknown\n x.append(1) # partial type gets replaced with normal type List[int]\n\n Or with None:\n\n x = None # x gets a partial type None\n if c:\n x = 1 # Infer actual type int for x\n \"\"\"\n\n # None for the 'None' partial type; otherwise a generic class\n type = None # type: Optional[mypy.nodes.TypeInfo]\n var = None # type: mypy.nodes.Var\n # For partial defaultdict[K, V], the type V (K is unknown). If V is generic,\n # the type argument is Any and will be replaced later.\n value_type = None # type: Optional[Instance]\n\n def __init__(self,\n type: 'Optional[mypy.nodes.TypeInfo]',\n var: 'mypy.nodes.Var',\n value_type: 'Optional[Instance]' = None) -> None:\n super().__init__()\n self.type = type\n self.var = var\n self.value_type = value_type\n\n def accept(self, visitor: 'TypeVisitor[T]') -> T:\n return visitor.visit_partial_type(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_EllipsisType_EllipsisType.serialize.assert_False_Synthetic_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_EllipsisType_EllipsisType.serialize.assert_False_Synthetic_", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1828, "end_line": 1841, "span_ids": ["EllipsisType.accept", "EllipsisType.serialize", "EllipsisType"], "tokens": 110}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class EllipsisType(ProperType):\n \"\"\"The type ... (ellipsis).\n\n This is not a real type but a syntactic AST construct, used in Callable[..., T], for example.\n\n A semantically analyzed type will never have ellipsis types.\n \"\"\"\n\n def accept(self, visitor: 'TypeVisitor[T]') -> T:\n assert isinstance(visitor, SyntheticTypeVisitor)\n return visitor.visit_ellipsis_type(self)\n\n def serialize(self) -> JsonDict:\n assert False, \"Synthetic types don't serialize\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypeType_TypeType.deserialize.return.TypeType_make_normalized_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypeType_TypeType.deserialize.return.TypeType_make_normalized_", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1844, "end_line": 1912, "span_ids": ["TypeType.__eq__", "TypeType.__hash__", "TypeType.serialize", "TypeType.deserialize", "TypeType.accept", "TypeType.make_normalized", "TypeType", "TypeType.__init__"], "tokens": 680}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeType(ProperType):\n \"\"\"For types like Type[User].\n\n This annotates variables that are class objects, constrained by\n the type argument. See PEP 484 for more details.\n\n We may encounter expressions whose values are specific classes;\n those are represented as callables (possibly overloaded)\n corresponding to the class's constructor's signature and returning\n an instance of that class. The difference with Type[C] is that\n those callables always represent the exact class given as the\n return type; Type[C] represents any class that's a subclass of C,\n and C may also be a type variable or a union (or Any).\n\n Many questions around subtype relationships between Type[C1] and\n def(...) -> C2 are answered by looking at the subtype\n relationships between C1 and C2, since Type[] is considered\n covariant.\n\n There's an unsolved problem with constructor signatures (also\n unsolved in PEP 484): calling a variable whose type is Type[C]\n assumes the constructor signature for C, even though a subclass of\n C might completely change the constructor signature. For now we\n just assume that users of Type[C] are careful not to do that (in\n the future we might detect when they are violating that\n assumption).\n \"\"\"\n\n # This can't be everything, but it can be a class reference,\n # a generic class instance, a union, Any, a type variable...\n item = None # type: ProperType\n\n def __init__(self, item: Bogus[Union[Instance, AnyType, TypeVarType, TupleType, NoneType,\n CallableType]], *,\n line: int = -1, column: int = -1) -> None:\n \"\"\"To ensure Type[Union[A, B]] is always represented as Union[Type[A], Type[B]], item of\n type UnionType must be handled through make_normalized static method.\n \"\"\"\n super().__init__(line, column)\n self.item = item\n\n @staticmethod\n def make_normalized(item: Type, *, line: int = -1, column: int = -1) -> ProperType:\n item = get_proper_type(item)\n if isinstance(item, UnionType):\n return UnionType.make_union(\n [TypeType.make_normalized(union_item) for union_item in item.items],\n line=line, column=column\n )\n return TypeType(item, line=line, column=column) # type: ignore[arg-type]\n\n def accept(self, visitor: 'TypeVisitor[T]') -> T:\n return visitor.visit_type_type(self)\n\n def __hash__(self) -> int:\n return hash(self.item)\n\n def __eq__(self, other: object) -> bool:\n if not isinstance(other, TypeType):\n return NotImplemented\n return self.item == other.item\n\n def serialize(self) -> JsonDict:\n return {'.class': 'TypeType', 'item': self.item.serialize()}\n\n @classmethod\n def deserialize(cls, data: JsonDict) -> Type:\n assert data['.class'] == 'TypeType'\n return TypeType.make_normalized(deserialize_type(data['item']))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_PlaceholderType_PlaceholderType.serialize.assert_False_Internal_e": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_PlaceholderType_PlaceholderType.serialize.assert_False_Internal_e", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1915, "end_line": 1943, "span_ids": ["PlaceholderType.__init__", "PlaceholderType.serialize", "PlaceholderType", "PlaceholderType.accept"], "tokens": 286}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PlaceholderType(ProperType):\n \"\"\"Temporary, yet-unknown type during semantic analysis.\n\n This is needed when there's a reference to a type before the real symbol\n table entry of the target type is available (specifically, we use a\n temporary PlaceholderNode symbol node). Consider this example:\n\n class str(Sequence[str]): ...\n\n We use a PlaceholderType for the 'str' in 'Sequence[str]' since we can't create\n a TypeInfo for 'str' until all base classes have been resolved. We'll soon\n perform another analysis iteration which replaces the base class with a complete\n type without any placeholders. After semantic analysis, no placeholder types must\n exist.\n \"\"\"\n\n def __init__(self, fullname: Optional[str], args: List[Type], line: int) -> None:\n super().__init__(line)\n self.fullname = fullname # Must be a valid full name of an actual node (or None).\n self.args = args\n\n def accept(self, visitor: 'TypeVisitor[T]') -> T:\n assert isinstance(visitor, SyntheticTypeVisitor)\n return visitor.visit_placeholder_type(self)\n\n def serialize(self) -> str:\n # We should never get here since all placeholders should be replaced\n # during semantic analysis.\n assert False, \"Internal error: unresolved placeholder type {}\".format(self.fullname)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_get_proper_type_get_proper_type_3.return.typ": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_get_proper_type_get_proper_type_3.return.typ", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1946, "end_line": 1967, "span_ids": ["get_proper_type_2", "get_proper_type_3", "get_proper_type"], "tokens": 231}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@overload\ndef get_proper_type(typ: None) -> None: ...\n@overload\ndef get_proper_type(typ: Type) -> ProperType: ...\n\n\ndef get_proper_type(typ: Optional[Type]) -> Optional[ProperType]:\n \"\"\"Get the expansion of a type alias type.\n\n If the type is already a proper type, this is a no-op. Use this function\n wherever a decision is made on a call like e.g. 'if isinstance(typ, UnionType): ...',\n because 'typ' in this case may be an alias to union. Note: if after making the decision\n on the isinstance() call you pass on the original type (and not one of its components)\n it is recommended to *always* pass on the unexpanded alias.\n \"\"\"\n if typ is None:\n return None\n while isinstance(typ, TypeAliasType):\n typ = typ._expand_once()\n assert isinstance(typ, ProperType), typ\n # TODO: store the name of original type alias on this type, so we can show it in errors.\n return typ", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_get_proper_types_from_mypy_type_visitor_im": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_get_proper_types_from_mypy_type_visitor_im", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1970, "end_line": 1990, "span_ids": ["get_proper_types_6", "impl:20", "get_proper_types", "get_proper_types_5"], "tokens": 197}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@overload\ndef get_proper_types(it: Iterable[Type]) -> List[ProperType]: ... # type: ignore[misc]\n@overload\ndef get_proper_types(it: Iterable[Optional[Type]]) -> List[Optional[ProperType]]: ...\n\n\ndef get_proper_types(it: Iterable[Optional[Type]]\n ) -> Union[List[ProperType], List[Optional[ProperType]]]:\n return [get_proper_type(t) for t in it]\n\n\n# We split off the type visitor base classes to another module\n# to make it easier to gradually get modules working with mypyc.\n# Import them here, after the types are defined.\n# This is intended as a re-export also.\nfrom mypy.type_visitor import ( # noqa\n TypeVisitor as TypeVisitor,\n SyntheticTypeVisitor as SyntheticTypeVisitor,\n TypeTranslator as TypeTranslator,\n TypeQuery as TypeQuery,\n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypeStrVisitor_TypeStrVisitor.visit_deleted_type.if_t_source_is_None_.else_.return._Deleted_format_t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypeStrVisitor_TypeStrVisitor.visit_deleted_type.if_t_source_is_None_.else_.return._Deleted_format_t", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1993, "end_line": 2043, "span_ids": ["TypeStrVisitor", "TypeStrVisitor.visit_unbound_type", "TypeStrVisitor.visit_none_type", "TypeStrVisitor.visit_uninhabited_type", "TypeStrVisitor.visit_type_list", "TypeStrVisitor.visit_deleted_type", "TypeStrVisitor.visit_any", "TypeStrVisitor.__init__", "TypeStrVisitor.visit_erased_type", "TypeStrVisitor.visit_callable_argument"], "tokens": 394}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeStrVisitor(SyntheticTypeVisitor[str]):\n \"\"\"Visitor for pretty-printing types into strings.\n\n This is mostly for debugging/testing.\n\n Do not preserve original formatting.\n\n Notes:\n - Represent unbound types as Foo? or Foo?[...].\n - Represent the NoneType type as None.\n \"\"\"\n\n def __init__(self, id_mapper: Optional[IdMapper] = None) -> None:\n self.id_mapper = id_mapper\n self.any_as_dots = False\n\n def visit_unbound_type(self, t: UnboundType) -> str:\n s = t.name + '?'\n if t.args:\n s += '[{}]'.format(self.list_str(t.args))\n return s\n\n def visit_type_list(self, t: TypeList) -> str:\n return ''.format(self.list_str(t.items))\n\n def visit_callable_argument(self, t: CallableArgument) -> str:\n typ = t.typ.accept(self)\n if t.name is None:\n return \"{}({})\".format(t.constructor, typ)\n else:\n return \"{}({}, {})\".format(t.constructor, typ, t.name)\n\n def visit_any(self, t: AnyType) -> str:\n if self.any_as_dots and t.type_of_any == TypeOfAny.special_form:\n return '...'\n return 'Any'\n\n def visit_none_type(self, t: NoneType) -> str:\n return \"None\"\n\n def visit_uninhabited_type(self, t: UninhabitedType) -> str:\n return \"\"\n\n def visit_erased_type(self, t: ErasedType) -> str:\n return \"\"\n\n def visit_deleted_type(self, t: DeletedType) -> str:\n if t.source is None:\n return \"\"\n else:\n return \"\".format(t.source)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypeStrVisitor.visit_instance_TypeStrVisitor.visit_type_var.return.s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypeStrVisitor.visit_instance_TypeStrVisitor.visit_type_var.return.s", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2045, "end_line": 2070, "span_ids": ["TypeStrVisitor.visit_instance", "TypeStrVisitor.visit_type_var"], "tokens": 247}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeStrVisitor(SyntheticTypeVisitor[str]):\n\n def visit_instance(self, t: Instance) -> str:\n if t.last_known_value and not t.args:\n # Instances with a literal fallback should never be generic. If they are,\n # something went wrong so we fall back to showing the full Instance repr.\n s = '{}?'.format(t.last_known_value)\n else:\n s = t.type.fullname or t.type.name or ''\n\n if t.erased:\n s += '*'\n if t.args:\n s += '[{}]'.format(self.list_str(t.args))\n if self.id_mapper:\n s += '<{}>'.format(self.id_mapper.id(t.type))\n return s\n\n def visit_type_var(self, t: TypeVarType) -> str:\n if t.name is None:\n # Anonymous type variable type (only numeric id).\n s = '`{}'.format(t.id)\n else:\n # Named type variable type.\n s = '{}`{}'.format(t.name, t.id)\n if self.id_mapper and t.upper_bound:\n s += '(upper_bound={})'.format(t.upper_bound.accept(self))\n return s", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypeStrVisitor.visit_callable_type_TypeStrVisitor.visit_callable_type.return._def_format_s_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypeStrVisitor.visit_callable_type_TypeStrVisitor.visit_callable_type.return._def_format_s_", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2098, "end_line": 2143, "span_ids": ["TypeStrVisitor.visit_callable_type"], "tokens": 426}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeStrVisitor(SyntheticTypeVisitor[str]):\n\n def visit_callable_type(self, t: CallableType) -> str:\n s = ''\n bare_asterisk = False\n for i in range(len(t.arg_types)):\n if s != '':\n s += ', '\n if t.arg_kinds[i] in (ARG_NAMED, ARG_NAMED_OPT) and not bare_asterisk:\n s += '*, '\n bare_asterisk = True\n if t.arg_kinds[i] == ARG_STAR:\n s += '*'\n if t.arg_kinds[i] == ARG_STAR2:\n s += '**'\n name = t.arg_names[i]\n if name:\n s += name + ': '\n s += t.arg_types[i].accept(self)\n if t.arg_kinds[i] in (ARG_OPT, ARG_NAMED_OPT):\n s += ' ='\n\n s = '({})'.format(s)\n\n if not isinstance(get_proper_type(t.ret_type), NoneType):\n if t.type_guard is not None:\n s += ' -> TypeGuard[{}]'.format(t.type_guard.accept(self))\n else:\n s += ' -> {}'.format(t.ret_type.accept(self))\n\n if t.variables:\n vs = []\n for var in t.variables:\n if isinstance(var, TypeVarDef):\n # We reimplement TypeVarDef.__repr__ here in order to support id_mapper.\n if var.values:\n vals = '({})'.format(', '.join(val.accept(self) for val in var.values))\n vs.append('{} in {}'.format(var.name, vals))\n elif not is_named_instance(var.upper_bound, 'builtins.object'):\n vs.append('{} <: {}'.format(var.name, var.upper_bound.accept(self)))\n else:\n vs.append(var.name)\n else:\n # For other TypeVarLikeDefs, just use the repr\n vs.append(repr(var))\n s = '{} {}'.format('[{}]'.format(', '.join(vs)), s)\n\n return 'def {}'.format(s)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypeStrVisitor.visit_overloaded_TypeStrVisitor.visit_tuple_type.return._Tuple_format_s_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypeStrVisitor.visit_overloaded_TypeStrVisitor.visit_tuple_type.return._Tuple_format_s_", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2116, "end_line": 2128, "span_ids": ["TypeStrVisitor.visit_tuple_type", "TypeStrVisitor.visit_overloaded"], "tokens": 149}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeStrVisitor(SyntheticTypeVisitor[str]):\n\n def visit_overloaded(self, t: Overloaded) -> str:\n a = []\n for i in t.items():\n a.append(i.accept(self))\n return 'Overload({})'.format(', '.join(a))\n\n def visit_tuple_type(self, t: TupleType) -> str:\n s = self.list_str(t.items)\n if t.partial_fallback and t.partial_fallback.type:\n fallback_name = t.partial_fallback.type.fullname\n if fallback_name != 'builtins.tuple':\n return 'Tuple[{}, fallback={}]'.format(s, t.partial_fallback.accept(self))\n return 'Tuple[{}]'.format(s)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypeStrVisitor.visit_typeddict_type_TypeStrVisitor.visit_typeddict_type.return._TypedDict_format_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypeStrVisitor.visit_typeddict_type_TypeStrVisitor.visit_typeddict_type.return._TypedDict_format_", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2130, "end_line": 2143, "span_ids": ["TypeStrVisitor.visit_typeddict_type"], "tokens": 170}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeStrVisitor(SyntheticTypeVisitor[str]):\n\n def visit_typeddict_type(self, t: TypedDictType) -> str:\n def item_str(name: str, typ: str) -> str:\n if name in t.required_keys:\n return '{!r}: {}'.format(name, typ)\n else:\n return '{!r}?: {}'.format(name, typ)\n\n s = '{' + ', '.join(item_str(name, typ.accept(self))\n for name, typ in t.items.items()) + '}'\n prefix = ''\n if t.fallback and t.fallback.type:\n if t.fallback.type.fullname not in TPDICT_FB_NAMES:\n prefix = repr(t.fallback.type.fullname) + ', '\n return 'TypedDict({}{})'.format(prefix, s)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypeStrVisitor.visit_raw_expression_type_TypeStrVisitor.list_str.return._join_res_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypeStrVisitor.visit_raw_expression_type_TypeStrVisitor.list_str.return._join_res_", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2145, "end_line": 2191, "span_ids": ["TypeStrVisitor.visit_star_type", "TypeStrVisitor.visit_union_type", "TypeStrVisitor.visit_partial_type", "TypeStrVisitor.visit_literal_type", "TypeStrVisitor.visit_type_type", "TypeStrVisitor.visit_placeholder_type", "TypeStrVisitor.list_str", "TypeStrVisitor.visit_raw_expression_type", "TypeStrVisitor.visit_ellipsis_type", "TypeStrVisitor.visit_type_alias_type"], "tokens": 405}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeStrVisitor(SyntheticTypeVisitor[str]):\n\n def visit_raw_expression_type(self, t: RawExpressionType) -> str:\n return repr(t.literal_value)\n\n def visit_literal_type(self, t: LiteralType) -> str:\n return 'Literal[{}]'.format(t.value_repr())\n\n def visit_star_type(self, t: StarType) -> str:\n s = t.type.accept(self)\n return '*{}'.format(s)\n\n def visit_union_type(self, t: UnionType) -> str:\n s = self.list_str(t.items)\n return 'Union[{}]'.format(s)\n\n def visit_partial_type(self, t: PartialType) -> str:\n if t.type is None:\n return ''\n else:\n return ''.format(t.type.name,\n ', '.join(['?'] * len(t.type.type_vars)))\n\n def visit_ellipsis_type(self, t: EllipsisType) -> str:\n return '...'\n\n def visit_type_type(self, t: TypeType) -> str:\n return 'Type[{}]'.format(t.item.accept(self))\n\n def visit_placeholder_type(self, t: PlaceholderType) -> str:\n return ''.format(t.fullname)\n\n def visit_type_alias_type(self, t: TypeAliasType) -> str:\n if t.alias is not None:\n unrolled, recursed = t._partial_expansion()\n self.any_as_dots = recursed\n type_str = unrolled.accept(self)\n self.any_as_dots = False\n return type_str\n return ''\n\n def list_str(self, a: Iterable[Type]) -> str:\n \"\"\"Convert items of an array to strings (pretty-print types)\n and join the results with commas.\n \"\"\"\n res = []\n for t in a:\n res.append(t.accept(self))\n return ', '.join(res)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_UnrollAliasVisitor_UnrollAliasVisitor.visit_type_alias_type.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_UnrollAliasVisitor_UnrollAliasVisitor.visit_type_alias_type.return.result", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2194, "end_line": 2211, "span_ids": ["UnrollAliasVisitor", "UnrollAliasVisitor.__init__", "UnrollAliasVisitor.visit_type_alias_type"], "tokens": 180}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class UnrollAliasVisitor(TypeTranslator):\n def __init__(self, initial_aliases: Set[TypeAliasType]) -> None:\n self.recursed = False\n self.initial_aliases = initial_aliases\n\n def visit_type_alias_type(self, t: TypeAliasType) -> Type:\n if t in self.initial_aliases:\n self.recursed = True\n return AnyType(TypeOfAny.special_form)\n # Create a new visitor on encountering a new type alias, so that an alias like\n # A = Tuple[B, B]\n # B = int\n # will not be detected as recursive on the second encounter of B.\n subvisitor = UnrollAliasVisitor(self.initial_aliases | {t})\n result = get_proper_type(t).accept(subvisitor)\n if subvisitor.recursed:\n self.recursed = True\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_strip_type_copy_type.return.copy_copy_t_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_strip_type_copy_type.return.copy_copy_t_", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2214, "end_line": 2238, "span_ids": ["impl:21", "is_named_instance", "strip_type", "copy_type"], "tokens": 178}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def strip_type(typ: Type) -> ProperType:\n \"\"\"Make a copy of type without 'debugging info' (function name).\"\"\"\n typ = get_proper_type(typ)\n if isinstance(typ, CallableType):\n return typ.copy_modified(name=None)\n elif isinstance(typ, Overloaded):\n return Overloaded([cast(CallableType, strip_type(item))\n for item in typ.items()])\n else:\n return typ\n\n\ndef is_named_instance(t: Type, fullname: str) -> bool:\n t = get_proper_type(t)\n return isinstance(t, Instance) and t.type.fullname == fullname\n\n\nTP = TypeVar('TP', bound=Type)\n\n\ndef copy_type(t: TP) -> TP:\n \"\"\"\n Build a copy of the type; used to mutate the copy with truthiness information\n \"\"\"\n return copy.copy(t)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_InstantiateAliasVisitor_InstantiateAliasVisitor.visit_type_var.return.typ": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_InstantiateAliasVisitor_InstantiateAliasVisitor.visit_type_var.return.typ", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2241, "end_line": 2260, "span_ids": ["InstantiateAliasVisitor.visit_type_alias_type", "InstantiateAliasVisitor.__init__", "InstantiateAliasVisitor", "InstantiateAliasVisitor.visit_type_var", "InstantiateAliasVisitor.visit_unbound_type"], "tokens": 215}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class InstantiateAliasVisitor(TypeTranslator):\n def __init__(self, vars: List[str], subs: List[Type]) -> None:\n self.replacements = {v: s for (v, s) in zip(vars, subs)}\n\n def visit_type_alias_type(self, typ: TypeAliasType) -> Type:\n return typ.copy_modified(args=[t.accept(self) for t in typ.args])\n\n def visit_unbound_type(self, typ: UnboundType) -> Type:\n # TODO: stop using unbound type variables for type aliases.\n # Now that type aliases are very similar to TypeInfos we should\n # make type variable tracking similar as well. Maybe we can even support\n # upper bounds etc. for generic type aliases.\n if typ.name in self.replacements:\n return self.replacements[typ.name]\n return typ\n\n def visit_type_var(self, typ: TypeVarType) -> Type:\n if typ.name in self.replacements:\n return self.replacements[typ.name]\n return typ", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_replace_alias_tvars_has_type_vars.return.typ_accept_HasTypeVars_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_replace_alias_tvars_has_type_vars.return.typ_accept_HasTypeVars_", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2263, "end_line": 2285, "span_ids": ["has_type_vars", "replace_alias_tvars", "HasTypeVars.visit_type_var", "HasTypeVars", "HasTypeVars.__init__"], "tokens": 183}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def replace_alias_tvars(tp: Type, vars: List[str], subs: List[Type],\n newline: int, newcolumn: int) -> Type:\n \"\"\"Replace type variables in a generic type alias tp with substitutions subs\n resetting context. Length of subs should be already checked.\n \"\"\"\n replacer = InstantiateAliasVisitor(vars, subs)\n new_tp = tp.accept(replacer)\n new_tp.line = newline\n new_tp.column = newcolumn\n return new_tp\n\n\nclass HasTypeVars(TypeQuery[bool]):\n def __init__(self) -> None:\n super().__init__(any)\n\n def visit_type_var(self, t: TypeVarType) -> bool:\n return True\n\n\ndef has_type_vars(typ: Type) -> bool:\n \"\"\"Check if a type contains any type variables (recursively).\"\"\"\n return typ.accept(HasTypeVars())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_flatten_nested_unions_flatten_nested_unions.return.flat_items": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_flatten_nested_unions_flatten_nested_unions.return.flat_items", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2288, "end_line": 2303, "span_ids": ["flatten_nested_unions"], "tokens": 168}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def flatten_nested_unions(types: Iterable[Type],\n handle_type_alias_type: bool = False) -> List[Type]:\n \"\"\"Flatten nested unions in a type list.\"\"\"\n # This and similar functions on unions can cause infinite recursion\n # if passed a \"pathological\" alias like A = Union[int, A] or similar.\n # TODO: ban such aliases in semantic analyzer.\n flat_items = [] # type: List[Type]\n if handle_type_alias_type:\n types = get_proper_types(types)\n for tp in types:\n if isinstance(tp, ProperType) and isinstance(tp, UnionType):\n flat_items.extend(flatten_nested_unions(tp.items,\n handle_type_alias_type=handle_type_alias_type))\n else:\n flat_items.append(tp)\n return flat_items", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_union_items_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_union_items_", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2306, "end_line": 2359, "span_ids": ["is_literal_type", "is_optional", "is_generic_instance", "union_items", "impl:23", "remove_optional"], "tokens": 393}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def union_items(typ: Type) -> List[ProperType]:\n \"\"\"Return the flattened items of a union type.\n\n For non-union types, return a list containing just the argument.\n \"\"\"\n typ = get_proper_type(typ)\n if isinstance(typ, UnionType):\n items = []\n for item in typ.items:\n items.extend(union_items(item))\n return items\n else:\n return [typ]\n\n\ndef is_generic_instance(tp: Type) -> bool:\n tp = get_proper_type(tp)\n return isinstance(tp, Instance) and bool(tp.args)\n\n\ndef is_optional(t: Type) -> bool:\n t = get_proper_type(t)\n return isinstance(t, UnionType) and any(isinstance(get_proper_type(e), NoneType)\n for e in t.items)\n\n\ndef remove_optional(typ: Type) -> Type:\n typ = get_proper_type(typ)\n if isinstance(typ, UnionType):\n return UnionType.make_union([t for t in typ.items\n if not isinstance(get_proper_type(t), NoneType)])\n else:\n return typ\n\n\ndef is_literal_type(typ: ProperType, fallback_fullname: str, value: LiteralValue) -> bool:\n \"\"\"Check if this type is a LiteralType with the given fallback type and value.\"\"\"\n if isinstance(typ, Instance) and typ.last_known_value:\n typ = typ.last_known_value\n if not isinstance(typ, LiteralType):\n return False\n if typ.fallback.type.fullname != fallback_fullname:\n return False\n return typ.value == value\n\n\nnames = globals().copy() # type: Final\nnames.pop('NOT_READY', None)\ndeserialize_map = {\n key: obj.deserialize\n for key, obj in names.items()\n if isinstance(obj, type) and issubclass(obj, Type) and obj is not Type\n} # type: Final", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typestate.py___SubtypeCache.Dict_TypeInfo_Dict_Subty": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typestate.py___SubtypeCache.Dict_TypeInfo_Dict_Subty", "embedding": null, "metadata": {"file_path": "mypy/typestate.py", "file_name": "typestate.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 23, "span_ids": ["docstring"], "tokens": 208}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"\nA shared state for all TypeInfos that holds global cache and dependency information,\nand potentially other mutable TypeInfo state. This module contains mutable global state.\n\"\"\"\n\nfrom typing import Dict, Set, Tuple, Optional, List\nfrom typing_extensions import ClassVar, Final\n\nfrom mypy.nodes import TypeInfo\nfrom mypy.types import Instance, TypeAliasType, get_proper_type, Type\nfrom mypy.server.trigger import make_trigger\nfrom mypy import state\n\n# Represents that the 'left' instance is a subtype of the 'right' instance\nSubtypeRelationship = Tuple[Instance, Instance]\n\n# A tuple encoding the specific conditions under which we performed the subtype check.\n# (e.g. did we want a proper subtype? A regular subtype while ignoring variance?)\nSubtypeKind = Tuple[bool, ...]\n\n# A cache that keeps track of whether the given TypeInfo is a part of a particular\n# subtype relationship\nSubtypeCache = Dict[TypeInfo, Dict[SubtypeKind, Set[SubtypeRelationship]]]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typestate.py_TypeState_TypeState._type_Final_Set_TypeInf": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typestate.py_TypeState_TypeState._type_Final_Set_TypeInf", "embedding": null, "metadata": {"file_path": "mypy/typestate.py", "file_name": "typestate.py", "file_type": "text/x-python", "category": "implementation", "start_line": 26, "end_line": 76, "span_ids": ["TypeState"], "tokens": 803}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeState:\n \"\"\"This class provides subtype caching to improve performance of subtype checks.\n It also holds protocol fine grained dependencies.\n\n Note: to avoid leaking global state, 'reset_all_subtype_caches()' should be called\n after a build has finished and after a daemon shutdown. This subtype cache only exists for\n performance reasons, resetting subtype caches for a class has no semantic effect.\n The protocol dependencies however are only stored here, and shouldn't be deleted unless\n not needed any more (e.g. during daemon shutdown).\n \"\"\"\n # '_subtype_caches' keeps track of (subtype, supertype) pairs where supertypes are\n # instances of the given TypeInfo. The cache also keeps track of whether the check\n # was done in strict optional mode and of the specific *kind* of subtyping relationship,\n # which we represent as an arbitrary hashable tuple.\n # We need the caches, since subtype checks for structural types are very slow.\n _subtype_caches = {} # type: Final[SubtypeCache]\n\n # This contains protocol dependencies generated after running a full build,\n # or after an update. These dependencies are special because:\n # * They are a global property of the program; i.e. some dependencies for imported\n # classes can be generated in the importing modules.\n # * Because of the above, they are serialized separately, after a full run,\n # or a full update.\n # `proto_deps` can be None if after deserialization it turns out that they are\n # inconsistent with the other cache files (or an error occurred during deserialization).\n # A blocking error will be generated in this case, since we can't proceed safely.\n # For the description of kinds of protocol dependencies and corresponding examples,\n # see _snapshot_protocol_deps.\n proto_deps = {} # type: ClassVar[Optional[Dict[str, Set[str]]]]\n\n # Protocols (full names) a given class attempted to implement.\n # Used to calculate fine grained protocol dependencies and optimize protocol\n # subtype cache invalidation in fine grained mode. For example, if we pass a value\n # of type a.A to a function expecting something compatible with protocol p.P,\n # we'd have 'a.A' -> {'p.P', ...} in the map. This map is flushed after every incremental\n # update.\n _attempted_protocols = {} # type: Final[Dict[str, Set[str]]]\n # We also snapshot protocol members of the above protocols. For example, if we pass\n # a value of type a.A to a function expecting something compatible with Iterable, we'd have\n # 'a.A' -> {'__iter__', ...} in the map. This map is also flushed after every incremental\n # update. This map is needed to only generate dependencies like -> \n # instead of a wildcard to avoid unnecessarily invalidating classes.\n _checked_against_members = {} # type: Final[Dict[str, Set[str]]]\n # TypeInfos that appeared as a left type (subtype) in a subtype check since latest\n # dependency snapshot update. This is an optimisation for fine grained mode; during a full\n # run we only take a dependency snapshot at the very end, so this set will contain all\n # subtype-checked TypeInfos. After a fine grained update however, we can gather only new\n # dependencies generated from (typically) few TypeInfos that were subtype-checked\n # (i.e. appeared as r.h.s. in an assignment or an argument in a function call in\n # a re-checked target) during the update.\n _rechecked_types = set() # type: Final[Set[TypeInfo]]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typestate.py_TypeState._The_two_attributes_belo_TypeState.record_protocol_subtype_check.TypeState__checked_agains": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typestate.py_TypeState._The_two_attributes_belo_TypeState.record_protocol_subtype_check.TypeState__checked_agains", "embedding": null, "metadata": {"file_path": "mypy/typestate.py", "file_name": "typestate.py", "file_type": "text/x-python", "category": "implementation", "start_line": 78, "end_line": 158, "span_ids": ["TypeState.is_assumed_proper_subtype", "TypeState.reset_all_subtype_caches", "TypeState.record_protocol_subtype_check", "TypeState", "TypeState.reset_all_subtype_caches_for", "TypeState.is_assumed_subtype", "TypeState.reset_protocol_deps", "TypeState.record_subtype_cache_entry", "TypeState.is_cached_subtype_check", "TypeState.reset_subtype_caches_for"], "tokens": 814}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeState:\n\n # The two attributes below are assumption stacks for subtyping relationships between\n # recursive type aliases. Normally, one would pass type assumptions as an additional\n # arguments to is_subtype(), but this would mean updating dozens of related functions\n # threading this through all callsites (see also comment for TypeInfo.assuming).\n _assuming = [] # type: Final[List[Tuple[TypeAliasType, TypeAliasType]]]\n _assuming_proper = [] # type: Final[List[Tuple[TypeAliasType, TypeAliasType]]]\n # Ditto for inference of generic constraints against recursive type aliases.\n _inferring = [] # type: Final[List[TypeAliasType]]\n\n # N.B: We do all of the accesses to these properties through\n # TypeState, instead of making these classmethods and accessing\n # via the cls parameter, since mypyc can optimize accesses to\n # Final attributes of a directly referenced type.\n\n @staticmethod\n def is_assumed_subtype(left: Type, right: Type) -> bool:\n for (l, r) in reversed(TypeState._assuming):\n if (get_proper_type(l) == get_proper_type(left)\n and get_proper_type(r) == get_proper_type(right)):\n return True\n return False\n\n @staticmethod\n def is_assumed_proper_subtype(left: Type, right: Type) -> bool:\n for (l, r) in reversed(TypeState._assuming_proper):\n if (get_proper_type(l) == get_proper_type(left)\n and get_proper_type(r) == get_proper_type(right)):\n return True\n return False\n\n @staticmethod\n def reset_all_subtype_caches() -> None:\n \"\"\"Completely reset all known subtype caches.\"\"\"\n TypeState._subtype_caches.clear()\n\n @staticmethod\n def reset_subtype_caches_for(info: TypeInfo) -> None:\n \"\"\"Reset subtype caches (if any) for a given supertype TypeInfo.\"\"\"\n if info in TypeState._subtype_caches:\n TypeState._subtype_caches[info].clear()\n\n @staticmethod\n def reset_all_subtype_caches_for(info: TypeInfo) -> None:\n \"\"\"Reset subtype caches (if any) for a given supertype TypeInfo and its MRO.\"\"\"\n for item in info.mro:\n TypeState.reset_subtype_caches_for(item)\n\n @staticmethod\n def is_cached_subtype_check(kind: SubtypeKind, left: Instance, right: Instance) -> bool:\n info = right.type\n if info not in TypeState._subtype_caches:\n return False\n cache = TypeState._subtype_caches[info]\n key = (state.strict_optional,) + kind\n if key not in cache:\n return False\n return (left, right) in cache[key]\n\n @staticmethod\n def record_subtype_cache_entry(kind: SubtypeKind,\n left: Instance, right: Instance) -> None:\n cache = TypeState._subtype_caches.setdefault(right.type, dict())\n cache.setdefault((state.strict_optional,) + kind, set()).add((left, right))\n\n @staticmethod\n def reset_protocol_deps() -> None:\n \"\"\"Reset dependencies after a full run or before a daemon shutdown.\"\"\"\n TypeState.proto_deps = {}\n TypeState._attempted_protocols.clear()\n TypeState._checked_against_members.clear()\n TypeState._rechecked_types.clear()\n\n @staticmethod\n def record_protocol_subtype_check(left_type: TypeInfo, right_type: TypeInfo) -> None:\n assert right_type.is_protocol\n TypeState._rechecked_types.add(left_type)\n TypeState._attempted_protocols.setdefault(\n left_type.fullname, set()).add(right_type.fullname)\n TypeState._checked_against_members.setdefault(\n left_type.fullname,\n set()).update(right_type.protocol_members)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typestate.py_TypeState._snapshot_protocol_deps_TypeState._snapshot_protocol_deps.return.deps": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typestate.py_TypeState._snapshot_protocol_deps_TypeState._snapshot_protocol_deps.return.deps", "embedding": null, "metadata": {"file_path": "mypy/typestate.py", "file_name": "typestate.py", "file_type": "text/x-python", "category": "implementation", "start_line": 160, "end_line": 213, "span_ids": ["TypeState._snapshot_protocol_deps"], "tokens": 613}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeState:\n\n @staticmethod\n def _snapshot_protocol_deps() -> Dict[str, Set[str]]:\n \"\"\"Collect protocol attribute dependencies found so far from registered subtype checks.\n\n There are three kinds of protocol dependencies. For example, after a subtype check:\n\n x: Proto = C()\n\n the following dependencies will be generated:\n 1. ..., , -> \n 2. ..., , -> [for every attr in Proto members]\n 3. -> Proto # this one to invalidate the subtype cache\n\n The first kind is generated immediately per-module in deps.py (see also an example there\n for motivation why it is needed). While two other kinds are generated here after all\n modules are type checked and we have recorded all the subtype checks. To understand these\n two kinds, consider a simple example:\n\n class A:\n def __iter__(self) -> Iterator[int]:\n ...\n\n it: Iterable[int] = A()\n\n We add -> to invalidate the assignment (module target in this case),\n whenever the signature of a.A.__iter__ changes. We also add -> typing.Iterable,\n to invalidate the subtype caches of the latter. (Note that the same logic applies to\n proper subtype checks, and calculating meets and joins, if this involves calling\n 'subtypes.is_protocol_implementation').\n \"\"\"\n deps = {} # type: Dict[str, Set[str]]\n for info in TypeState._rechecked_types:\n for attr in TypeState._checked_against_members[info.fullname]:\n # The need for full MRO here is subtle, during an update, base classes of\n # a concrete class may not be reprocessed, so not all -> deps\n # are added.\n for base_info in info.mro[:-1]:\n trigger = make_trigger('%s.%s' % (base_info.fullname, attr))\n if 'typing' in trigger or 'builtins' in trigger:\n # TODO: avoid everything from typeshed\n continue\n deps.setdefault(trigger, set()).add(make_trigger(info.fullname))\n for proto in TypeState._attempted_protocols[info.fullname]:\n trigger = make_trigger(info.fullname)\n if 'typing' in trigger or 'builtins' in trigger:\n continue\n # If any class that was checked against a protocol changes,\n # we need to reset the subtype cache for the protocol.\n #\n # Note: strictly speaking, the protocol doesn't need to be\n # re-checked, we only need to reset the cache, and its uses\n # elsewhere are still valid (unless invalidated by other deps).\n deps.setdefault(trigger, set()).add(proto)\n return deps", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typestate.py_TypeState.update_protocol_deps_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typestate.py_TypeState.update_protocol_deps_", "embedding": null, "metadata": {"file_path": "mypy/typestate.py", "file_name": "typestate.py", "file_type": "text/x-python", "category": "implementation", "start_line": 215, "end_line": 256, "span_ids": ["TypeState.update_protocol_deps", "reset_global_state", "TypeState.add_all_protocol_deps"], "tokens": 374}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeState:\n\n @staticmethod\n def update_protocol_deps(second_map: Optional[Dict[str, Set[str]]] = None) -> None:\n \"\"\"Update global protocol dependency map.\n\n We update the global map incrementally, using a snapshot only from recently\n type checked types. If second_map is given, update it as well. This is currently used\n by FineGrainedBuildManager that maintains normal (non-protocol) dependencies.\n \"\"\"\n assert TypeState.proto_deps is not None, (\n \"This should not be called after failed cache load\")\n new_deps = TypeState._snapshot_protocol_deps()\n for trigger, targets in new_deps.items():\n TypeState.proto_deps.setdefault(trigger, set()).update(targets)\n if second_map is not None:\n for trigger, targets in new_deps.items():\n second_map.setdefault(trigger, set()).update(targets)\n TypeState._rechecked_types.clear()\n TypeState._attempted_protocols.clear()\n TypeState._checked_against_members.clear()\n\n @staticmethod\n def add_all_protocol_deps(deps: Dict[str, Set[str]]) -> None:\n \"\"\"Add all known protocol dependencies to deps.\n\n This is used by tests and debug output, and also when collecting\n all collected or loaded dependencies as part of build.\n \"\"\"\n TypeState.update_protocol_deps() # just in case\n if TypeState.proto_deps is not None:\n for trigger, targets in TypeState.proto_deps.items():\n deps.setdefault(trigger, set()).update(targets)\n\n\ndef reset_global_state() -> None:\n \"\"\"Reset most existing global state.\n\n Currently most of it is in this module. Few exceptions are strict optional status and\n and functools.lru_cache.\n \"\"\"\n TypeState.reset_all_subtype_caches()\n TypeState.reset_protocol_deps()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typetraverser.py_from_typing_import_Iterab_from_mypy_types_import_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typetraverser.py_from_typing_import_Iterab_from_mypy_types_import_", "embedding": null, "metadata": {"file_path": "mypy/typetraverser.py", "file_name": "typetraverser.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 10, "span_ids": ["imports"], "tokens": 107}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from typing import Iterable\n\nfrom mypy_extensions import trait\n\nfrom mypy.types import (\n Type, SyntheticTypeVisitor, AnyType, UninhabitedType, NoneType, ErasedType, DeletedType,\n TypeVarType, LiteralType, Instance, CallableType, TupleType, TypedDictType, UnionType,\n Overloaded, TypeType, CallableArgument, UnboundType, TypeList, StarType, EllipsisType,\n PlaceholderType, PartialType, RawExpressionType, TypeAliasType\n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typetraverser.py_TypeTraverserVisitor_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typetraverser.py_TypeTraverserVisitor_", "embedding": null, "metadata": {"file_path": "mypy/typetraverser.py", "file_name": "typetraverser.py", "file_type": "text/x-python", "category": "implementation", "start_line": 13, "end_line": 105, "span_ids": ["TypeTraverserVisitor.visit_type_type", "TypeTraverserVisitor.visit_deleted_type", "TypeTraverserVisitor.visit_union_type", "TypeTraverserVisitor.visit_none_type", "TypeTraverserVisitor.visit_instance", "TypeTraverserVisitor.visit_uninhabited_type", "TypeTraverserVisitor.visit_type_list", "TypeTraverserVisitor.traverse_types", "TypeTraverserVisitor.visit_erased_type", "TypeTraverserVisitor.visit_unbound_type", "TypeTraverserVisitor", "TypeTraverserVisitor.visit_callable_type", "TypeTraverserVisitor.visit_callable_argument", "TypeTraverserVisitor.visit_tuple_type", "TypeTraverserVisitor.visit_raw_expression_type", "TypeTraverserVisitor.visit_any", "TypeTraverserVisitor.visit_placeholder_type", "TypeTraverserVisitor.visit_type_var", "TypeTraverserVisitor.visit_type_alias_type", "TypeTraverserVisitor.visit_literal_type", "TypeTraverserVisitor.visit_star_type", "TypeTraverserVisitor.visit_ellipsis_type", "TypeTraverserVisitor.visit_typeddict_type", "TypeTraverserVisitor.visit_partial_type", "TypeTraverserVisitor.visit_overloaded"], "tokens": 648}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@trait\nclass TypeTraverserVisitor(SyntheticTypeVisitor[None]):\n \"\"\"Visitor that traverses all components of a type\"\"\"\n\n # Atomic types\n\n def visit_any(self, t: AnyType) -> None:\n pass\n\n def visit_uninhabited_type(self, t: UninhabitedType) -> None:\n pass\n\n def visit_none_type(self, t: NoneType) -> None:\n pass\n\n def visit_erased_type(self, t: ErasedType) -> None:\n pass\n\n def visit_deleted_type(self, t: DeletedType) -> None:\n pass\n\n def visit_type_var(self, t: TypeVarType) -> None:\n # Note that type variable values and upper bound aren't treated as\n # components, since they are components of the type variable\n # definition. We want to traverse everything just once.\n pass\n\n def visit_literal_type(self, t: LiteralType) -> None:\n t.fallback.accept(self)\n\n # Composite types\n\n def visit_instance(self, t: Instance) -> None:\n self.traverse_types(t.args)\n\n def visit_callable_type(self, t: CallableType) -> None:\n # FIX generics\n self.traverse_types(t.arg_types)\n t.ret_type.accept(self)\n t.fallback.accept(self)\n\n def visit_tuple_type(self, t: TupleType) -> None:\n self.traverse_types(t.items)\n t.partial_fallback.accept(self)\n\n def visit_typeddict_type(self, t: TypedDictType) -> None:\n self.traverse_types(t.items.values())\n t.fallback.accept(self)\n\n def visit_union_type(self, t: UnionType) -> None:\n self.traverse_types(t.items)\n\n def visit_overloaded(self, t: Overloaded) -> None:\n self.traverse_types(t.items())\n\n def visit_type_type(self, t: TypeType) -> None:\n t.item.accept(self)\n\n # Special types (not real types)\n\n def visit_callable_argument(self, t: CallableArgument) -> None:\n t.typ.accept(self)\n\n def visit_unbound_type(self, t: UnboundType) -> None:\n self.traverse_types(t.args)\n\n def visit_type_list(self, t: TypeList) -> None:\n self.traverse_types(t.items)\n\n def visit_star_type(self, t: StarType) -> None:\n t.type.accept(self)\n\n def visit_ellipsis_type(self, t: EllipsisType) -> None:\n pass\n\n def visit_placeholder_type(self, t: PlaceholderType) -> None:\n self.traverse_types(t.args)\n\n def visit_partial_type(self, t: PartialType) -> None:\n pass\n\n def visit_raw_expression_type(self, t: RawExpressionType) -> None:\n pass\n\n def visit_type_alias_type(self, t: TypeAliasType) -> None:\n self.traverse_types(t.args)\n\n # Helpers\n\n def traverse_types(self, types: Iterable[Type]) -> None:\n for typ in types:\n typ.accept(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typevars.py_from_typing_import_Union__fill_typevars.return.typ_tuple_type_copy_modif": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typevars.py_from_typing_import_Union__fill_typevars.return.typ_tuple_type_copy_modif", "embedding": null, "metadata": {"file_path": "mypy/typevars.py", "file_name": "typevars.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 21, "span_ids": ["fill_typevars", "imports"], "tokens": 198}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from typing import Union, List\n\nfrom mypy.nodes import TypeInfo\n\nfrom mypy.erasetype import erase_typevars\nfrom mypy.types import Instance, TypeVarType, TupleType, Type, TypeOfAny, AnyType\n\n\ndef fill_typevars(typ: TypeInfo) -> Union[Instance, TupleType]:\n \"\"\"For a non-generic type, return instance type representing the type.\n\n For a generic G type with parameters T1, .., Tn, return G[T1, ..., Tn].\n \"\"\"\n tv = [] # type: List[Type]\n # TODO: why do we need to keep both typ.type_vars and typ.defn.type_vars?\n for i in range(len(typ.defn.type_vars)):\n tv.append(TypeVarType(typ.defn.type_vars[i]))\n inst = Instance(typ, tv)\n if typ.tuple_type is None:\n return inst\n return typ.tuple_type.copy_modified(fallback=inst)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typevars.py_fill_typevars_with_any_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typevars.py_fill_typevars_with_any_", "embedding": null, "metadata": {"file_path": "mypy/typevars.py", "file_name": "typevars.py", "file_type": "text/x-python", "category": "implementation", "start_line": 24, "end_line": 40, "span_ids": ["fill_typevars_with_any", "has_no_typevars"], "tokens": 221}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def fill_typevars_with_any(typ: TypeInfo) -> Union[Instance, TupleType]:\n \"\"\"Apply a correct number of Any's as type arguments to a type.\"\"\"\n inst = Instance(typ, [AnyType(TypeOfAny.special_form)] * len(typ.defn.type_vars))\n if typ.tuple_type is None:\n return inst\n return typ.tuple_type.copy_modified(fallback=inst)\n\n\ndef has_no_typevars(typ: Type) -> bool:\n # We test if a type contains type variables by erasing all type variables\n # and comparing the result to the original type. We use comparison by equality that\n # in turn uses `__eq__` defined for types. Note: we can't use `is_same_type` because\n # it is not safe with unresolved forward references, while this function may be called\n # before forward references resolution patch pass. Note also that it is not safe to use\n # `is` comparison because `erase_typevars` doesn't preserve type identity.\n return typ == erase_typevars(typ)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py__Utility_functions_with_short_type.return.t_split_1_rstrip_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py__Utility_functions_with_short_type.return.t_split_1_rstrip_", "embedding": null, "metadata": {"file_path": "mypy/util.py", "file_name": "util.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 87, "span_ids": ["split_target", "short_type", "module_prefix", "docstring", "split_module_names"], "tokens": 672}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Utility functions with no non-trivial dependencies.\"\"\"\n\nimport os\nimport pathlib\nimport re\nimport subprocess\nimport sys\nimport hashlib\nimport io\nimport shutil\n\nfrom typing import (\n TypeVar, List, Tuple, Optional, Dict, Sequence, Iterable, Container, IO, Callable\n)\nfrom typing_extensions import Final, Type, Literal\n\ntry:\n import curses\n import _curses # noqa\n CURSES_ENABLED = True\nexcept ImportError:\n CURSES_ENABLED = False\n\nT = TypeVar('T')\n\nENCODING_RE = \\\n re.compile(br'([ \\t\\v]*#.*(\\r\\n?|\\n))??[ \\t\\v]*#.*coding[:=][ \\t]*([-\\w.]+)') # type: Final\n\nDEFAULT_SOURCE_OFFSET = 4 # type: Final\nDEFAULT_COLUMNS = 80 # type: Final\n\n# At least this number of columns will be shown on each side of\n# error location when printing source code snippet.\nMINIMUM_WIDTH = 20\n\n# VT100 color code processing was added in Windows 10, but only the second major update,\n# Threshold 2. Fortunately, everyone (even on LTSB, Long Term Support Branch) should\n# have a version of Windows 10 newer than this. Note that Windows 8 and below are not\n# supported, but are either going out of support, or make up only a few % of the market.\nMINIMUM_WINDOWS_MAJOR_VT100 = 10\nMINIMUM_WINDOWS_BUILD_VT100 = 10586\n\ndefault_python2_interpreter = \\\n ['python2', 'python', '/usr/bin/python', 'C:\\\\Python27\\\\python.exe'] # type: Final\n\n\ndef split_module_names(mod_name: str) -> List[str]:\n \"\"\"Return the module and all parent module names.\n\n So, if `mod_name` is 'a.b.c', this function will return\n ['a.b.c', 'a.b', and 'a'].\n \"\"\"\n out = [mod_name]\n while '.' in mod_name:\n mod_name = mod_name.rsplit('.', 1)[0]\n out.append(mod_name)\n return out\n\n\ndef module_prefix(modules: Iterable[str], target: str) -> Optional[str]:\n result = split_target(modules, target)\n if result is None:\n return None\n return result[0]\n\n\ndef split_target(modules: Iterable[str], target: str) -> Optional[Tuple[str, str]]:\n remaining = [] # type: List[str]\n while True:\n if target in modules:\n return target, '.'.join(remaining)\n components = target.rsplit('.', 1)\n if len(components) == 1:\n return None\n target = components[0]\n remaining.insert(0, components[1])\n\n\ndef short_type(obj: object) -> str:\n \"\"\"Return the last component of the type name of an object.\n\n If obj is None, return 'nil'. For example, if obj is 1, return 'int'.\n \"\"\"\n if obj is None:\n return 'nil'\n t = str(type(obj))\n return t.split('.')[-1].rstrip(\"'>\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_find_python_encoding_find_python_encoding.if_result_.else_.return.default_encoding_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_find_python_encoding_find_python_encoding.if_result_.else_.return.default_encoding_1", "embedding": null, "metadata": {"file_path": "mypy/util.py", "file_name": "util.py", "file_type": "text/x-python", "category": "implementation", "start_line": 89, "end_line": 101, "span_ids": ["find_python_encoding"], "tokens": 166}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def find_python_encoding(text: bytes, pyversion: Tuple[int, int]) -> Tuple[str, int]:\n \"\"\"PEP-263 for detecting Python file encoding\"\"\"\n result = ENCODING_RE.match(text)\n if result:\n line = 2 if result.group(1) else 1\n encoding = result.group(3).decode('ascii')\n # Handle some aliases that Python is happy to accept and that are used in the wild.\n if encoding.startswith(('iso-latin-1-', 'latin-1-')) or encoding == 'iso-latin-1':\n encoding = 'latin-1'\n return encoding, line\n else:\n default_encoding = 'utf8' if pyversion[0] >= 3 else 'ascii'\n return default_encoding, -1", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_DecodeError_read_py_file.try_.else_.return.source_lines": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_DecodeError_read_py_file.try_.else_.return.source_lines", "embedding": null, "metadata": {"file_path": "mypy/util.py", "file_name": "util.py", "file_type": "text/x-python", "category": "implementation", "start_line": 104, "end_line": 146, "span_ids": ["DecodeError", "decode_python_encoding", "read_py_file"], "tokens": 304}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DecodeError(Exception):\n \"\"\"Exception raised when a file cannot be decoded due to an unknown encoding type.\n\n Essentially a wrapper for the LookupError raised by `bytearray.decode`\n \"\"\"\n\n\ndef decode_python_encoding(source: bytes, pyversion: Tuple[int, int]) -> str:\n \"\"\"Read the Python file with while obeying PEP-263 encoding detection.\n\n Returns the source as a string.\n \"\"\"\n # check for BOM UTF-8 encoding and strip it out if present\n if source.startswith(b'\\xef\\xbb\\xbf'):\n encoding = 'utf8'\n source = source[3:]\n else:\n # look at first two lines and check if PEP-263 coding is present\n encoding, _ = find_python_encoding(source, pyversion)\n\n try:\n source_text = source.decode(encoding)\n except LookupError as lookuperr:\n raise DecodeError(str(lookuperr)) from lookuperr\n return source_text\n\n\ndef read_py_file(path: str, read: Callable[[str], bytes],\n pyversion: Tuple[int, int]) -> Optional[List[str]]:\n \"\"\"Try reading a Python file as list of source lines.\n\n Return None if something goes wrong.\n \"\"\"\n try:\n source = read(path)\n except OSError:\n return None\n else:\n try:\n source_lines = decode_python_encoding(source, pyversion).splitlines()\n except DecodeError:\n return None\n return source_lines", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_trim_source_line_trim_source_line.return._line_max_len_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_trim_source_line_trim_source_line.return._line_max_len_", "embedding": null, "metadata": {"file_path": "mypy/util.py", "file_name": "util.py", "file_type": "text/x-python", "category": "implementation", "start_line": 149, "end_line": 178, "span_ids": ["trim_source_line"], "tokens": 354}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def trim_source_line(line: str, max_len: int, col: int, min_width: int) -> Tuple[str, int]:\n \"\"\"Trim a line of source code to fit into max_len.\n\n Show 'min_width' characters on each side of 'col' (an error location). If either\n start or end is trimmed, this is indicated by adding '...' there.\n A typical result looks like this:\n ...some_variable = function_to_call(one_arg, other_arg) or...\n\n Return the trimmed string and the column offset to to adjust error location.\n \"\"\"\n if max_len < 2 * min_width + 1:\n # In case the window is too tiny it is better to still show something.\n max_len = 2 * min_width + 1\n\n # Trivial case: line already fits in.\n if len(line) <= max_len:\n return line, 0\n\n # If column is not too large so that there is still min_width after it,\n # the line doesn't need to be trimmed at the start.\n if col + min_width < max_len:\n return line[:max_len] + '...', 0\n\n # Otherwise, if the column is not too close to the end, trim both sides.\n if col < len(line) - min_width - 1:\n offset = col - max_len + min_width + 1\n return '...' + line[offset:col + min_width + 1] + '...', offset - 3\n\n # Finally, if the column is near the end, just trim the start.\n return '...' + line[-max_len:], len(line) - max_len - 3", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_get_mypy_comments_ERROR_TEMPLATE._xml_version_1_0_en": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_get_mypy_comments_ERROR_TEMPLATE._xml_version_1_0_en", "embedding": null, "metadata": {"file_path": "mypy/util.py", "file_name": "util.py", "file_type": "text/x-python", "category": "implementation", "start_line": 182, "end_line": 238, "span_ids": ["get_mypy_comments", "impl:23", "impl:25", "try_find_python2_interpreter"], "tokens": 553}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_mypy_comments(source: str) -> List[Tuple[int, str]]:\n PREFIX = '# mypy: '\n # Don't bother splitting up the lines unless we know it is useful\n if PREFIX not in source:\n return []\n lines = source.split('\\n')\n results = []\n for i, line in enumerate(lines):\n if line.startswith(PREFIX):\n results.append((i + 1, line[len(PREFIX):]))\n\n return results\n\n\n_python2_interpreter = None # type: Optional[str]\n\n\ndef try_find_python2_interpreter() -> Optional[str]:\n global _python2_interpreter\n if _python2_interpreter:\n return _python2_interpreter\n for interpreter in default_python2_interpreter:\n try:\n retcode = subprocess.Popen([\n interpreter, '-c',\n 'import sys, typing; assert sys.version_info[:2] == (2, 7)'\n ]).wait()\n if not retcode:\n _python2_interpreter = interpreter\n return interpreter\n except OSError:\n pass\n return None\n\n\nPASS_TEMPLATE = \"\"\"\n\n \n \n\n\"\"\" # type: Final\n\nFAIL_TEMPLATE = \"\"\"\n\n \n {text}\n \n\n\"\"\" # type: Final\n\nERROR_TEMPLATE = \"\"\"\n\n \n {text}\n \n\n\"\"\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_IdMapper_IdMapper.id.return.self_id_map_o_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_IdMapper_IdMapper.id.return.self_id_map_o_", "embedding": null, "metadata": {"file_path": "mypy/util.py", "file_name": "util.py", "file_type": "text/x-python", "category": "implementation", "start_line": 261, "end_line": 278, "span_ids": ["IdMapper", "IdMapper.__init__", "IdMapper.id"], "tokens": 140}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IdMapper:\n \"\"\"Generate integer ids for objects.\n\n Unlike id(), these start from 0 and increment by 1, and ids won't\n get reused across the life-time of IdMapper.\n\n Assume objects don't redefine __eq__ or __hash__.\n \"\"\"\n\n def __init__(self) -> None:\n self.id_map = {} # type: Dict[object, int]\n self.next_id = 0\n\n def id(self, o: object) -> int:\n if o not in self.id_map:\n self.id_map[o] = self.next_id\n self.next_id += 1\n return self.id_map[o]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_get_prefix_correct_relative_import.return.cur_mod_id_targ": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_get_prefix_correct_relative_import.return.cur_mod_id_targ", "embedding": null, "metadata": {"file_path": "mypy/util.py", "file_name": "util.py", "file_type": "text/x-python", "category": "implementation", "start_line": 281, "end_line": 299, "span_ids": ["correct_relative_import", "get_prefix"], "tokens": 165}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_prefix(fullname: str) -> str:\n \"\"\"Drop the final component of a qualified name (e.g. ('x.y' -> 'x').\"\"\"\n return fullname.rsplit('.', 1)[0]\n\n\ndef correct_relative_import(cur_mod_id: str,\n relative: int,\n target: str,\n is_cur_package_init_file: bool) -> Tuple[str, bool]:\n if relative == 0:\n return target, True\n parts = cur_mod_id.split(\".\")\n rel = relative\n if is_cur_package_init_file:\n rel -= 1\n ok = len(parts) >= rel\n if rel != 0:\n cur_mod_id = \".\".join(parts[:-rel])\n return cur_mod_id + ((\".\" + target) if target else \"\"), ok", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_fields_cache_get_class_descriptors.return.fields_cache_cls_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_fields_cache_get_class_descriptors.return.fields_cache_cls_", "embedding": null, "metadata": {"file_path": "mypy/util.py", "file_name": "util.py", "file_type": "text/x-python", "category": "implementation", "start_line": 303, "end_line": 315, "span_ids": ["get_class_descriptors", "impl:31"], "tokens": 155}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "fields_cache = {} # type: Final[Dict[Type[object], List[str]]]\n\n\ndef get_class_descriptors(cls: 'Type[object]') -> Sequence[str]:\n import inspect # Lazy import for minor startup speed win\n # Maintain a cache of type -> attributes defined by descriptors in the class\n # (that is, attributes from __slots__ and C extension classes)\n if cls not in fields_cache:\n members = inspect.getmembers(\n cls,\n lambda o: inspect.isgetsetdescriptor(o) or inspect.ismemberdescriptor(o))\n fields_cache[cls] = [x for x, y in members if x != '__weakref__' and x != '__dict__']\n return fields_cache[cls]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_replace_object_state_replace_object_state.for_attr_in_get_class_des.try_.except_AttributeError_.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_replace_object_state_replace_object_state.for_attr_in_get_class_des.try_.except_AttributeError_.pass", "embedding": null, "metadata": {"file_path": "mypy/util.py", "file_name": "util.py", "file_type": "text/x-python", "category": "implementation", "start_line": 317, "end_line": 342, "span_ids": ["replace_object_state"], "tokens": 229}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def replace_object_state(new: object, old: object, copy_dict: bool = False) -> None:\n \"\"\"Copy state of old node to the new node.\n\n This handles cases where there is __dict__ and/or attribute descriptors\n (either from slots or because the type is defined in a C extension module).\n\n Assume that both objects have the same __class__.\n \"\"\"\n if hasattr(old, '__dict__'):\n if copy_dict:\n new.__dict__ = dict(old.__dict__)\n else:\n new.__dict__ = old.__dict__\n\n for attr in get_class_descriptors(old.__class__):\n try:\n if hasattr(old, attr):\n setattr(new, attr, getattr(old, attr))\n elif hasattr(new, attr):\n delattr(new, attr)\n # There is no way to distinguish getsetdescriptors that allow\n # writes from ones that don't (I think?), so we just ignore\n # AttributeErrors if we need to.\n # TODO: What about getsetdescriptors that act like properties???\n except AttributeError:\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_is_sub_path_unmangle.return.name_rstrip_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_is_sub_path_unmangle.return.name_rstrip_", "embedding": null, "metadata": {"file_path": "mypy/util.py", "file_name": "util.py", "file_type": "text/x-python", "category": "implementation", "start_line": 345, "end_line": 362, "span_ids": ["hard_exit", "unmangle", "is_sub_path"], "tokens": 138}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_sub_path(path1: str, path2: str) -> bool:\n \"\"\"Given two paths, return if path1 is a sub-path of path2.\"\"\"\n return pathlib.Path(path2) in pathlib.Path(path1).parents\n\n\ndef hard_exit(status: int = 0) -> None:\n \"\"\"Kill the current process without fully cleaning up.\n\n This can be quite a bit faster than a normal exit() since objects are not freed.\n \"\"\"\n sys.stdout.flush()\n sys.stderr.flush()\n os._exit(status)\n\n\ndef unmangle(name: str) -> str:\n \"\"\"Remove internal suffixes from a short name.\"\"\"\n return name.rstrip(\"'\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_get_unique_redefinition_name_get_unique_redefinition_name.return.r_name_str_i_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_get_unique_redefinition_name_get_unique_redefinition_name.return.r_name_str_i_", "embedding": null, "metadata": {"file_path": "mypy/util.py", "file_name": "util.py", "file_type": "text/x-python", "category": "implementation", "start_line": 365, "end_line": 378, "span_ids": ["get_unique_redefinition_name"], "tokens": 128}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_unique_redefinition_name(name: str, existing: Container[str]) -> str:\n \"\"\"Get a simple redefinition name not present among existing.\n\n For example, for name 'foo' we try 'foo-redefinition', 'foo-redefinition2',\n 'foo-redefinition3', etc. until we find one that is not in existing.\n \"\"\"\n r_name = name + '-redefinition'\n if r_name not in existing:\n return r_name\n\n i = 2\n while r_name + str(i) in existing:\n i += 1\n return r_name + str(i)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_check_python_version_check_python_version.if_sys_version_info_3_.sys_exit_Running_name_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_check_python_version_check_python_version.if_sys_version_info_3_.sys_exit_Running_name_", "embedding": null, "metadata": {"file_path": "mypy/util.py", "file_name": "util.py", "file_type": "text/x-python", "category": "implementation", "start_line": 381, "end_line": 390, "span_ids": ["check_python_version"], "tokens": 167}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def check_python_version(program: str) -> None:\n \"\"\"Report issues with the Python used to run mypy, dmypy, or stubgen\"\"\"\n # Check for known bad Python versions.\n if sys.version_info[:2] < (3, 5):\n sys.exit(\"Running {name} with Python 3.4 or lower is not supported; \"\n \"please upgrade to 3.5 or newer\".format(name=program))\n # this can be deleted once we drop support for 3.5\n if sys.version_info[:3] == (3, 5, 0):\n sys.exit(\"Running {name} with Python 3.5.0 is not supported; \"\n \"please upgrade to 3.5.1 or newer\".format(name=program))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_soft_wrap_soft_wrap.return.padding_join_lines_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_soft_wrap_soft_wrap.return.padding_join_lines_", "embedding": null, "metadata": {"file_path": "mypy/util.py", "file_name": "util.py", "file_type": "text/x-python", "category": "implementation", "start_line": 422, "end_line": 456, "span_ids": ["soft_wrap"], "tokens": 328}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def soft_wrap(msg: str, max_len: int, first_offset: int,\n num_indent: int = 0) -> str:\n \"\"\"Wrap a long error message into few lines.\n\n Breaks will only happen between words, and never inside a quoted group\n (to avoid breaking types such as \"Union[int, str]\"). The 'first_offset' is\n the width before the start of first line.\n\n Pad every next line with 'num_indent' spaces. Every line will be at most 'max_len'\n characters, except if it is a single word or quoted group.\n\n For example:\n first_offset\n ------------------------\n path/to/file: error: 58: Some very long error message\n that needs to be split in separate lines.\n \"Long[Type, Names]\" are never split.\n ^^^^--------------------------------------------------\n num_indent max_len\n \"\"\"\n words = split_words(msg)\n next_line = words.pop(0)\n lines = [] # type: List[str]\n while words:\n next_word = words.pop(0)\n max_line_len = max_len - num_indent if lines else max_len - first_offset\n # Add 1 to account for space between words.\n if len(next_line) + len(next_word) + 1 <= max_line_len:\n next_line += ' ' + next_word\n else:\n lines.append(next_line)\n next_line = next_word\n lines.append(next_line)\n padding = '\\n' + ' ' * num_indent\n return padding.join(lines)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_hash_digest_parse_gray_color.return.gray": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_hash_digest_parse_gray_color.return.gray", "embedding": null, "metadata": {"file_path": "mypy/util.py", "file_name": "util.py", "file_type": "text/x-python", "category": "implementation", "start_line": 459, "end_line": 475, "span_ids": ["hash_digest", "parse_gray_color"], "tokens": 157}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def hash_digest(data: bytes) -> str:\n \"\"\"Compute a hash digest of some data.\n\n We use a cryptographic hash because we want a low probability of\n accidental collision, but we don't really care about any of the\n cryptographic properties.\n \"\"\"\n # Once we drop Python 3.5 support, we should consider using\n # blake2b, which is faster.\n return hashlib.sha256(data).hexdigest()\n\n\ndef parse_gray_color(cup: bytes) -> str:\n \"\"\"Reproduce a gray color in ANSI escape sequence\"\"\"\n set_color = ''.join([cup[:-1].decode(), 'm'])\n gray = curses.tparm(set_color.encode('utf-8'), 1, 89).decode()\n return gray", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_FancyFormatter_FancyFormatter.__init__.if_not_self_dummy_term_.self.colors._red_self_RED_green_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_FancyFormatter_FancyFormatter.__init__.if_not_self_dummy_term_.self.colors._red_self_RED_green_", "embedding": null, "metadata": {"file_path": "mypy/util.py", "file_name": "util.py", "file_type": "text/x-python", "category": "implementation", "start_line": 478, "end_line": 500, "span_ids": ["FancyFormatter", "FancyFormatter.__init__"], "tokens": 235}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FancyFormatter:\n \"\"\"Apply color and bold font to terminal output.\n\n This currently only works on Linux and Mac.\n \"\"\"\n def __init__(self, f_out: IO[str], f_err: IO[str], show_error_codes: bool) -> None:\n self.show_error_codes = show_error_codes\n # Check if we are in a human-facing terminal on a supported platform.\n if sys.platform not in ('linux', 'darwin', 'win32'):\n self.dummy_term = True\n return\n force_color = int(os.getenv('MYPY_FORCE_COLOR', '0'))\n if not force_color and (not f_out.isatty() or not f_err.isatty()):\n self.dummy_term = True\n return\n if sys.platform == 'win32':\n self.dummy_term = not self.initialize_win_colors()\n else:\n self.dummy_term = not self.initialize_unix_colors()\n if not self.dummy_term:\n self.colors = {'red': self.RED, 'green': self.GREEN,\n 'blue': self.BLUE, 'yellow': self.YELLOW,\n 'none': ''}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_FancyFormatter.initialize_win_colors_FancyFormatter.initialize_win_colors.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_FancyFormatter.initialize_win_colors_FancyFormatter.initialize_win_colors.return.False", "embedding": null, "metadata": {"file_path": "mypy/util.py", "file_name": "util.py", "file_type": "text/x-python", "category": "implementation", "start_line": 502, "end_line": 532, "span_ids": ["FancyFormatter.initialize_win_colors"], "tokens": 322}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FancyFormatter:\n\n def initialize_win_colors(self) -> bool:\n \"\"\"Return True if initialization was successful and we can use colors, False otherwise\"\"\"\n # Windows ANSI escape sequences are only supported on Threshold 2 and above.\n # we check with an assert at runtime and an if check for mypy, as asserts do not\n # yet narrow platform\n assert sys.platform == 'win32'\n if sys.platform == 'win32':\n winver = sys.getwindowsversion()\n if (winver.major < MINIMUM_WINDOWS_MAJOR_VT100\n or winver.build < MINIMUM_WINDOWS_BUILD_VT100):\n return False\n import ctypes\n kernel32 = ctypes.windll.kernel32\n ENABLE_PROCESSED_OUTPUT = 0x1\n ENABLE_WRAP_AT_EOL_OUTPUT = 0x2\n ENABLE_VIRTUAL_TERMINAL_PROCESSING = 0x4\n STD_OUTPUT_HANDLE = -11\n kernel32.SetConsoleMode(kernel32.GetStdHandle(STD_OUTPUT_HANDLE),\n ENABLE_PROCESSED_OUTPUT\n | ENABLE_WRAP_AT_EOL_OUTPUT\n | ENABLE_VIRTUAL_TERMINAL_PROCESSING)\n self.BOLD = '\\033[1m'\n self.UNDER = '\\033[4m'\n self.BLUE = '\\033[94m'\n self.GREEN = '\\033[92m'\n self.RED = '\\033[91m'\n self.YELLOW = '\\033[93m'\n self.NORMAL = '\\033[0m'\n self.DIM = '\\033[2m'\n return True\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_FancyFormatter.initialize_unix_colors_FancyFormatter.initialize_unix_colors.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_FancyFormatter.initialize_unix_colors_FancyFormatter.initialize_unix_colors.return.True", "embedding": null, "metadata": {"file_path": "mypy/util.py", "file_name": "util.py", "file_type": "text/x-python", "category": "implementation", "start_line": 534, "end_line": 568, "span_ids": ["FancyFormatter.initialize_unix_colors"], "tokens": 341}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FancyFormatter:\n\n def initialize_unix_colors(self) -> bool:\n \"\"\"Return True if initialization was successful and we can use colors, False otherwise\"\"\"\n if not CURSES_ENABLED:\n return False\n try:\n # setupterm wants a fd to potentially write an \"initialization sequence\".\n # We override sys.stdout for the daemon API so if stdout doesn't have an fd,\n # just give it /dev/null.\n try:\n fd = sys.stdout.fileno()\n except io.UnsupportedOperation:\n with open(\"/dev/null\", \"rb\") as f:\n curses.setupterm(fd=f.fileno())\n else:\n curses.setupterm(fd=fd)\n except curses.error:\n # Most likely terminfo not found.\n return False\n bold = curses.tigetstr('bold')\n under = curses.tigetstr('smul')\n set_color = curses.tigetstr('setaf')\n set_eseq = curses.tigetstr('cup')\n\n if not (bold and under and set_color and set_eseq):\n return False\n\n self.NORMAL = curses.tigetstr('sgr0').decode()\n self.BOLD = bold.decode()\n self.UNDER = under.decode()\n self.DIM = parse_gray_color(set_eseq)\n self.BLUE = curses.tparm(set_color, curses.COLOR_BLUE).decode()\n self.GREEN = curses.tparm(set_color, curses.COLOR_GREEN).decode()\n self.RED = curses.tparm(set_color, curses.COLOR_RED).decode()\n self.YELLOW = curses.tparm(set_color, curses.COLOR_YELLOW).decode()\n return True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_FancyFormatter.style_FancyFormatter.style.return.start_self_colors_color": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_FancyFormatter.style_FancyFormatter.style.return.start_self_colors_color", "embedding": null, "metadata": {"file_path": "mypy/util.py", "file_name": "util.py", "file_type": "text/x-python", "category": "implementation", "start_line": 570, "end_line": 583, "span_ids": ["FancyFormatter.style"], "tokens": 130}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FancyFormatter:\n\n def style(self, text: str, color: Literal['red', 'green', 'blue', 'yellow', 'none'],\n bold: bool = False, underline: bool = False, dim: bool = False) -> str:\n \"\"\"Apply simple color and style (underlined or bold).\"\"\"\n if self.dummy_term:\n return text\n if bold:\n start = self.BOLD\n else:\n start = ''\n if underline:\n start += self.UNDER\n if dim:\n start += self.DIM\n return start + self.colors[color] + text + self.NORMAL", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_FancyFormatter.fit_in_terminal_FancyFormatter.fit_in_terminal.return.new_messages": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_FancyFormatter.fit_in_terminal_FancyFormatter.fit_in_terminal.return.new_messages", "embedding": null, "metadata": {"file_path": "mypy/util.py", "file_name": "util.py", "file_type": "text/x-python", "category": "implementation", "start_line": 585, "end_line": 609, "span_ids": ["FancyFormatter.fit_in_terminal"], "tokens": 308}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FancyFormatter:\n\n def fit_in_terminal(self, messages: List[str],\n fixed_terminal_width: Optional[int] = None) -> List[str]:\n \"\"\"Improve readability by wrapping error messages and trimming source code.\"\"\"\n width = fixed_terminal_width or get_terminal_width()\n new_messages = messages.copy()\n for i, error in enumerate(messages):\n if ': error:' in error:\n loc, msg = error.split('error:', maxsplit=1)\n msg = soft_wrap(msg, width, first_offset=len(loc) + len('error: '))\n new_messages[i] = loc + 'error:' + msg\n if error.startswith(' ' * DEFAULT_SOURCE_OFFSET) and '^' not in error:\n # TODO: detecting source code highlights through an indent can be surprising.\n # Restore original error message and error location.\n error = error[DEFAULT_SOURCE_OFFSET:]\n column = messages[i+1].index('^') - DEFAULT_SOURCE_OFFSET\n\n # Let source have some space also on the right side, plus 6\n # to accommodate ... on each side.\n max_len = width - DEFAULT_SOURCE_OFFSET - 6\n source_line, offset = trim_source_line(error, max_len, column, MINIMUM_WIDTH)\n\n new_messages[i] = ' ' * DEFAULT_SOURCE_OFFSET + source_line\n # Also adjust the error marker position.\n new_messages[i+1] = ' ' * (DEFAULT_SOURCE_OFFSET + column - offset) + '^'\n return new_messages", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_FancyFormatter.colorize_FancyFormatter.colorize.if_error_in_error_.else_.return.error": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_FancyFormatter.colorize_FancyFormatter.colorize.if_error_in_error_.else_.return.error", "embedding": null, "metadata": {"file_path": "mypy/util.py", "file_name": "util.py", "file_type": "text/x-python", "category": "implementation", "start_line": 614, "end_line": 639, "span_ids": ["FancyFormatter.colorize"], "tokens": 278}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FancyFormatter:\n\n def colorize(self, error: str) -> str:\n \"\"\"Colorize an output line by highlighting the status and error code.\"\"\"\n if ': error:' in error:\n loc, msg = error.split('error:', maxsplit=1)\n if not self.show_error_codes:\n return (loc + self.style('error:', 'red', bold=True) +\n self.highlight_quote_groups(msg))\n codepos = msg.rfind('[')\n if codepos != -1:\n code = msg[codepos:]\n msg = msg[:codepos]\n else:\n code = \"\" # no error code specified\n return (loc + self.style('error:', 'red', bold=True) +\n self.highlight_quote_groups(msg) + self.style(code, 'yellow'))\n elif ': note:' in error:\n loc, msg = error.split('note:', maxsplit=1)\n formatted = self.highlight_quote_groups(self.underline_link(msg))\n return loc + self.style('note:', 'blue') + formatted\n elif error.startswith(' ' * DEFAULT_SOURCE_OFFSET):\n # TODO: detecting source code highlights through an indent can be surprising.\n if '^' not in error:\n return self.style(error, 'none', dim=True)\n return self.style(error, 'red')\n else:\n return error", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_FancyFormatter.highlight_quote_groups_FancyFormatter.highlight_quote_groups.return.out": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_FancyFormatter.highlight_quote_groups_FancyFormatter.highlight_quote_groups.return.out", "embedding": null, "metadata": {"file_path": "mypy/util.py", "file_name": "util.py", "file_type": "text/x-python", "category": "implementation", "start_line": 637, "end_line": 652, "span_ids": ["FancyFormatter.highlight_quote_groups"], "tokens": 135}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FancyFormatter:\n\n def highlight_quote_groups(self, msg: str) -> str:\n \"\"\"Make groups quoted with double quotes bold (including quotes).\n\n This is used to highlight types, attribute names etc.\n \"\"\"\n if msg.count('\"') % 2:\n # Broken error message, don't do any formatting.\n return msg\n parts = msg.split('\"')\n out = ''\n for i, part in enumerate(parts):\n if i % 2 == 0:\n out += self.style(part, 'none')\n else:\n out += self.style('\"' + part + '\"', 'none', bold=True)\n return out", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_FancyFormatter.underline_link_FancyFormatter.format_success.return.self_style_msg_green_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_FancyFormatter.underline_link_FancyFormatter.format_success.return.self_style_msg_green_", "embedding": null, "metadata": {"file_path": "mypy/util.py", "file_name": "util.py", "file_type": "text/x-python", "category": "implementation", "start_line": 654, "end_line": 678, "span_ids": ["FancyFormatter.format_success", "FancyFormatter.underline_link"], "tokens": 221}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FancyFormatter:\n\n def underline_link(self, note: str) -> str:\n \"\"\"Underline a link in a note message (if any).\n\n This assumes there is at most one link in the message.\n \"\"\"\n match = re.search(r'https?://\\S*', note)\n if not match:\n return note\n start = match.start()\n end = match.end()\n return (note[:start] +\n self.style(note[start:end], 'none', underline=True) +\n note[end:])\n\n def format_success(self, n_sources: int, use_color: bool = True) -> str:\n \"\"\"Format short summary in case of success.\n\n n_sources is total number of files passed directly on command line,\n i.e. excluding stubs and followed imports.\n \"\"\"\n msg = 'Success: no issues found in {}' \\\n ' source file{}'.format(n_sources, 's' if n_sources != 1 else '')\n if not use_color:\n return msg\n return self.style(msg, 'green', bold=True)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/version.py_os_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/version.py_os_", "embedding": null, "metadata": {"file_path": "mypy/version.py", "file_name": "version.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 17, "span_ids": ["imports"], "tokens": 168}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nfrom mypy import git\n\n# Base version.\n# - Release versions have the form \"0.NNN\".\n# - Dev versions have the form \"0.NNN+dev\" (PLUS sign to conform to PEP 440).\n# - For 1.0 we'll switch back to 1.2.3 form.\n__version__ = '0.820+dev'\nbase_version = __version__\n\nmypy_dir = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))\nif __version__.endswith('+dev') and git.is_git_repo(mypy_dir) and git.have_git():\n __version__ += '.' + git.git_revision(mypy_dir).decode('utf-8')\n if git.is_dirty(mypy_dir):\n __version__ += '.dirty'\ndel mypy_dir", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/visitor.py__Generic_abstract_synta_ExpressionVisitor.visit_dictionary_comprehension.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/visitor.py__Generic_abstract_synta_ExpressionVisitor.visit_dictionary_comprehension.pass", "embedding": null, "metadata": {"file_path": "mypy/visitor.py", "file_name": "visitor.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 137, "span_ids": ["ExpressionVisitor.visit_cast_expr", "ExpressionVisitor.visit_unary_expr", "ExpressionVisitor.visit_op_expr", "docstring", "ExpressionVisitor.visit_comparison_expr", "ExpressionVisitor.visit_unicode_expr", "ExpressionVisitor.visit_name_expr", "ExpressionVisitor.visit_list_expr", "ExpressionVisitor.visit_assignment_expr", "ExpressionVisitor.visit_list_comprehension", "ExpressionVisitor.visit_call_expr", "ExpressionVisitor.visit_dictionary_comprehension", "ExpressionVisitor.visit_float_expr", "ExpressionVisitor.visit_complex_expr", "ExpressionVisitor.visit_ellipsis", "ExpressionVisitor.visit_star_expr", "ExpressionVisitor.visit_lambda_expr", "ExpressionVisitor.visit_dict_expr", "ExpressionVisitor.visit_tuple_expr", "ExpressionVisitor", "ExpressionVisitor.visit_bytes_expr", "ExpressionVisitor.visit_int_expr", "ExpressionVisitor.visit_type_application", "ExpressionVisitor.visit_reveal_expr", "ExpressionVisitor.visit_yield_expr", "ExpressionVisitor.visit_set_comprehension", "ExpressionVisitor.visit_member_expr", "ExpressionVisitor.visit_str_expr", "ExpressionVisitor.visit_yield_from_expr", "ExpressionVisitor.visit_index_expr", "ExpressionVisitor.visit_set_expr", "ExpressionVisitor.visit_super_expr"], "tokens": 902}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Generic abstract syntax tree node visitor\"\"\"\n\nfrom abc import abstractmethod\nfrom typing import TypeVar, Generic\nfrom typing_extensions import TYPE_CHECKING\nfrom mypy_extensions import trait, mypyc_attr\n\nif TYPE_CHECKING:\n # break import cycle only needed for mypy\n import mypy.nodes\n\n\nT = TypeVar('T')\n\n\n@trait\n@mypyc_attr(allow_interpreted_subclasses=True)\nclass ExpressionVisitor(Generic[T]):\n @abstractmethod\n def visit_int_expr(self, o: 'mypy.nodes.IntExpr') -> T:\n pass\n\n @abstractmethod\n def visit_str_expr(self, o: 'mypy.nodes.StrExpr') -> T:\n pass\n\n @abstractmethod\n def visit_bytes_expr(self, o: 'mypy.nodes.BytesExpr') -> T:\n pass\n\n @abstractmethod\n def visit_unicode_expr(self, o: 'mypy.nodes.UnicodeExpr') -> T:\n pass\n\n @abstractmethod\n def visit_float_expr(self, o: 'mypy.nodes.FloatExpr') -> T:\n pass\n\n @abstractmethod\n def visit_complex_expr(self, o: 'mypy.nodes.ComplexExpr') -> T:\n pass\n\n @abstractmethod\n def visit_ellipsis(self, o: 'mypy.nodes.EllipsisExpr') -> T:\n pass\n\n @abstractmethod\n def visit_star_expr(self, o: 'mypy.nodes.StarExpr') -> T:\n pass\n\n @abstractmethod\n def visit_name_expr(self, o: 'mypy.nodes.NameExpr') -> T:\n pass\n\n @abstractmethod\n def visit_member_expr(self, o: 'mypy.nodes.MemberExpr') -> T:\n pass\n\n @abstractmethod\n def visit_yield_from_expr(self, o: 'mypy.nodes.YieldFromExpr') -> T:\n pass\n\n @abstractmethod\n def visit_yield_expr(self, o: 'mypy.nodes.YieldExpr') -> T:\n pass\n\n @abstractmethod\n def visit_call_expr(self, o: 'mypy.nodes.CallExpr') -> T:\n pass\n\n @abstractmethod\n def visit_op_expr(self, o: 'mypy.nodes.OpExpr') -> T:\n pass\n\n @abstractmethod\n def visit_comparison_expr(self, o: 'mypy.nodes.ComparisonExpr') -> T:\n pass\n\n @abstractmethod\n def visit_cast_expr(self, o: 'mypy.nodes.CastExpr') -> T:\n pass\n\n @abstractmethod\n def visit_reveal_expr(self, o: 'mypy.nodes.RevealExpr') -> T:\n pass\n\n @abstractmethod\n def visit_super_expr(self, o: 'mypy.nodes.SuperExpr') -> T:\n pass\n\n @abstractmethod\n def visit_unary_expr(self, o: 'mypy.nodes.UnaryExpr') -> T:\n pass\n\n @abstractmethod\n def visit_assignment_expr(self, o: 'mypy.nodes.AssignmentExpr') -> T:\n pass\n\n @abstractmethod\n def visit_list_expr(self, o: 'mypy.nodes.ListExpr') -> T:\n pass\n\n @abstractmethod\n def visit_dict_expr(self, o: 'mypy.nodes.DictExpr') -> T:\n pass\n\n @abstractmethod\n def visit_tuple_expr(self, o: 'mypy.nodes.TupleExpr') -> T:\n pass\n\n @abstractmethod\n def visit_set_expr(self, o: 'mypy.nodes.SetExpr') -> T:\n pass\n\n @abstractmethod\n def visit_index_expr(self, o: 'mypy.nodes.IndexExpr') -> T:\n pass\n\n @abstractmethod\n def visit_type_application(self, o: 'mypy.nodes.TypeApplication') -> T:\n pass\n\n @abstractmethod\n def visit_lambda_expr(self, o: 'mypy.nodes.LambdaExpr') -> T:\n pass\n\n @abstractmethod\n def visit_list_comprehension(self, o: 'mypy.nodes.ListComprehension') -> T:\n pass\n\n @abstractmethod\n def visit_set_comprehension(self, o: 'mypy.nodes.SetComprehension') -> T:\n pass\n\n @abstractmethod\n def visit_dictionary_comprehension(self, o: 'mypy.nodes.DictionaryComprehension') -> T:\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/visitor.py_ExpressionVisitor.visit_generator_expr_ExpressionVisitor.visit_temp_node.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/visitor.py_ExpressionVisitor.visit_generator_expr_ExpressionVisitor.visit_temp_node.pass", "embedding": null, "metadata": {"file_path": "mypy/visitor.py", "file_name": "visitor.py", "file_type": "text/x-python", "category": "implementation", "start_line": 139, "end_line": 193, "span_ids": ["ExpressionVisitor.visit_namedtuple_expr", "ExpressionVisitor.visit_await_expr", "ExpressionVisitor.visit_backquote_expr", "ExpressionVisitor.visit_typeddict_expr", "ExpressionVisitor.visit_temp_node", "ExpressionVisitor.visit_type_alias_expr", "ExpressionVisitor.visit_slice_expr", "ExpressionVisitor.visit_conditional_expr", "ExpressionVisitor.visit_generator_expr", "ExpressionVisitor.visit_newtype_expr", "ExpressionVisitor.visit_enum_call_expr", "ExpressionVisitor.visit_paramspec_expr", "ExpressionVisitor.visit_type_var_expr", "ExpressionVisitor.visit__promote_expr"], "tokens": 413}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@trait\n@mypyc_attr(allow_interpreted_subclasses=True)\nclass ExpressionVisitor(Generic[T]):\n\n @abstractmethod\n def visit_generator_expr(self, o: 'mypy.nodes.GeneratorExpr') -> T:\n pass\n\n @abstractmethod\n def visit_slice_expr(self, o: 'mypy.nodes.SliceExpr') -> T:\n pass\n\n @abstractmethod\n def visit_conditional_expr(self, o: 'mypy.nodes.ConditionalExpr') -> T:\n pass\n\n @abstractmethod\n def visit_backquote_expr(self, o: 'mypy.nodes.BackquoteExpr') -> T:\n pass\n\n @abstractmethod\n def visit_type_var_expr(self, o: 'mypy.nodes.TypeVarExpr') -> T:\n pass\n\n @abstractmethod\n def visit_paramspec_expr(self, o: 'mypy.nodes.ParamSpecExpr') -> T:\n pass\n\n @abstractmethod\n def visit_type_alias_expr(self, o: 'mypy.nodes.TypeAliasExpr') -> T:\n pass\n\n @abstractmethod\n def visit_namedtuple_expr(self, o: 'mypy.nodes.NamedTupleExpr') -> T:\n pass\n\n @abstractmethod\n def visit_enum_call_expr(self, o: 'mypy.nodes.EnumCallExpr') -> T:\n pass\n\n @abstractmethod\n def visit_typeddict_expr(self, o: 'mypy.nodes.TypedDictExpr') -> T:\n pass\n\n @abstractmethod\n def visit_newtype_expr(self, o: 'mypy.nodes.NewTypeExpr') -> T:\n pass\n\n @abstractmethod\n def visit__promote_expr(self, o: 'mypy.nodes.PromoteExpr') -> T:\n pass\n\n @abstractmethod\n def visit_await_expr(self, o: 'mypy.nodes.AwaitExpr') -> T:\n pass\n\n @abstractmethod\n def visit_temp_node(self, o: 'mypy.nodes.TempNode') -> T:\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/visitor.py_StatementVisitor_StatementVisitor.visit_exec_stmt.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/visitor.py_StatementVisitor_StatementVisitor.visit_exec_stmt.pass", "embedding": null, "metadata": {"file_path": "mypy/visitor.py", "file_name": "visitor.py", "file_type": "text/x-python", "category": "implementation", "start_line": 196, "end_line": 311, "span_ids": ["StatementVisitor.visit_func_def", "StatementVisitor.visit_assert_stmt", "StatementVisitor", "StatementVisitor.visit_class_def", "StatementVisitor.visit_print_stmt", "StatementVisitor.visit_with_stmt", "StatementVisitor.visit_import_all", "StatementVisitor.visit_block", "StatementVisitor.visit_raise_stmt", "StatementVisitor.visit_del_stmt", "StatementVisitor.visit_break_stmt", "StatementVisitor.visit_continue_stmt", "StatementVisitor.visit_expression_stmt", "StatementVisitor.visit_assignment_stmt", "StatementVisitor.visit_overloaded_func_def", "StatementVisitor.visit_return_stmt", "StatementVisitor.visit_while_stmt", "StatementVisitor.visit_decorator", "StatementVisitor.visit_if_stmt", "StatementVisitor.visit_pass_stmt", "StatementVisitor.visit_import", "StatementVisitor.visit_global_decl", "StatementVisitor.visit_for_stmt", "StatementVisitor.visit_import_from", "StatementVisitor.visit_exec_stmt", "StatementVisitor.visit_operator_assignment_stmt", "StatementVisitor.visit_try_stmt", "StatementVisitor.visit_nonlocal_decl"], "tokens": 746}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@trait\n@mypyc_attr(allow_interpreted_subclasses=True)\nclass StatementVisitor(Generic[T]):\n # Definitions\n\n @abstractmethod\n def visit_assignment_stmt(self, o: 'mypy.nodes.AssignmentStmt') -> T:\n pass\n\n @abstractmethod\n def visit_for_stmt(self, o: 'mypy.nodes.ForStmt') -> T:\n pass\n\n @abstractmethod\n def visit_with_stmt(self, o: 'mypy.nodes.WithStmt') -> T:\n pass\n\n @abstractmethod\n def visit_del_stmt(self, o: 'mypy.nodes.DelStmt') -> T:\n pass\n\n @abstractmethod\n def visit_func_def(self, o: 'mypy.nodes.FuncDef') -> T:\n pass\n\n @abstractmethod\n def visit_overloaded_func_def(self, o: 'mypy.nodes.OverloadedFuncDef') -> T:\n pass\n\n @abstractmethod\n def visit_class_def(self, o: 'mypy.nodes.ClassDef') -> T:\n pass\n\n @abstractmethod\n def visit_global_decl(self, o: 'mypy.nodes.GlobalDecl') -> T:\n pass\n\n @abstractmethod\n def visit_nonlocal_decl(self, o: 'mypy.nodes.NonlocalDecl') -> T:\n pass\n\n @abstractmethod\n def visit_decorator(self, o: 'mypy.nodes.Decorator') -> T:\n pass\n\n # Module structure\n\n @abstractmethod\n def visit_import(self, o: 'mypy.nodes.Import') -> T:\n pass\n\n @abstractmethod\n def visit_import_from(self, o: 'mypy.nodes.ImportFrom') -> T:\n pass\n\n @abstractmethod\n def visit_import_all(self, o: 'mypy.nodes.ImportAll') -> T:\n pass\n\n # Statements\n\n @abstractmethod\n def visit_block(self, o: 'mypy.nodes.Block') -> T:\n pass\n\n @abstractmethod\n def visit_expression_stmt(self, o: 'mypy.nodes.ExpressionStmt') -> T:\n pass\n\n @abstractmethod\n def visit_operator_assignment_stmt(self, o: 'mypy.nodes.OperatorAssignmentStmt') -> T:\n pass\n\n @abstractmethod\n def visit_while_stmt(self, o: 'mypy.nodes.WhileStmt') -> T:\n pass\n\n @abstractmethod\n def visit_return_stmt(self, o: 'mypy.nodes.ReturnStmt') -> T:\n pass\n\n @abstractmethod\n def visit_assert_stmt(self, o: 'mypy.nodes.AssertStmt') -> T:\n pass\n\n @abstractmethod\n def visit_if_stmt(self, o: 'mypy.nodes.IfStmt') -> T:\n pass\n\n @abstractmethod\n def visit_break_stmt(self, o: 'mypy.nodes.BreakStmt') -> T:\n pass\n\n @abstractmethod\n def visit_continue_stmt(self, o: 'mypy.nodes.ContinueStmt') -> T:\n pass\n\n @abstractmethod\n def visit_pass_stmt(self, o: 'mypy.nodes.PassStmt') -> T:\n pass\n\n @abstractmethod\n def visit_raise_stmt(self, o: 'mypy.nodes.RaiseStmt') -> T:\n pass\n\n @abstractmethod\n def visit_try_stmt(self, o: 'mypy.nodes.TryStmt') -> T:\n pass\n\n @abstractmethod\n def visit_print_stmt(self, o: 'mypy.nodes.PrintStmt') -> T:\n pass\n\n @abstractmethod\n def visit_exec_stmt(self, o: 'mypy.nodes.ExecStmt') -> T:\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py_CFG_CFG.__str__.return._n_join_lines_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py_CFG_CFG.__str__.return._n_join_lines_", "embedding": null, "metadata": {"file_path": "mypyc/analysis/dataflow.py", "file_name": "dataflow.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 37, "span_ids": ["CFG.__str__", "CFG", "CFG.__init__"], "tokens": 176}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CFG:\n \"\"\"Control-flow graph.\n\n Node 0 is always assumed to be the entry point. There must be a\n non-empty set of exits.\n \"\"\"\n\n def __init__(self,\n succ: Dict[BasicBlock, List[BasicBlock]],\n pred: Dict[BasicBlock, List[BasicBlock]],\n exits: Set[BasicBlock]) -> None:\n assert exits\n self.succ = succ\n self.pred = pred\n self.exits = exits\n\n def __str__(self) -> str:\n lines = []\n lines.append('exits: %s' % sorted(self.exits, key=lambda e: e.label))\n lines.append('succ: %s' % self.succ)\n lines.append('pred: %s' % self.pred)\n return '\\n'.join(lines)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py_get_cfg_get_cfg.return.CFG_succ_map_pred_map_e": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py_get_cfg_get_cfg.return.CFG_succ_map_pred_map_e", "embedding": null, "metadata": {"file_path": "mypyc/analysis/dataflow.py", "file_name": "dataflow.py", "file_type": "text/x-python", "category": "implementation", "start_line": 40, "end_line": 85, "span_ids": ["get_cfg"], "tokens": 398}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_cfg(blocks: List[BasicBlock]) -> CFG:\n \"\"\"Calculate basic block control-flow graph.\n\n The result is a dictionary like this:\n\n basic block index -> (successors blocks, predecesssor blocks)\n \"\"\"\n succ_map = {}\n pred_map = {} # type: Dict[BasicBlock, List[BasicBlock]]\n exits = set()\n for block in blocks:\n\n assert not any(isinstance(op, ControlOp) for op in block.ops[:-1]), (\n \"Control-flow ops must be at the end of blocks\")\n\n last = block.ops[-1]\n if isinstance(last, Branch):\n succ = [last.true, last.false]\n elif isinstance(last, Goto):\n succ = [last.label]\n else:\n succ = []\n exits.add(block)\n\n # Errors can occur anywhere inside a block, which means that\n # we can't assume that the entire block has executed before\n # jumping to the error handler. In our CFG construction, we\n # model this as saying that a block can jump to its error\n # handler or the error handlers of any of its normal\n # successors (to represent an error before that next block\n # completes). This works well for analyses like \"must\n # defined\", where it implies that registers assigned in a\n # block may be undefined in its error handler, but is in\n # general not a precise representation of reality; any\n # analyses that require more fidelity must wait until after\n # exception insertion.\n for error_point in [block] + succ:\n if error_point.error_handler:\n succ.append(error_point.error_handler)\n\n succ_map[block] = succ\n pred_map[block] = []\n for prev, nxt in succ_map.items():\n for label in nxt:\n pred_map[label].append(prev)\n return CFG(succ_map, pred_map, exits)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py_get_real_target_cleanup_cfg.while_changed_.for_i_block_in_enumerate.if_i_0_or_cfg_pred_blo.else_.changed.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py_get_real_target_cleanup_cfg.while_changed_.for_i_block_in_enumerate.if_i_0_or_cfg_pred_blo.else_.changed.True", "embedding": null, "metadata": {"file_path": "mypyc/analysis/dataflow.py", "file_name": "dataflow.py", "file_type": "text/x-python", "category": "implementation", "start_line": 88, "end_line": 122, "span_ids": ["cleanup_cfg", "get_real_target"], "tokens": 249}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_real_target(label: BasicBlock) -> BasicBlock:\n if len(label.ops) == 1 and isinstance(label.ops[-1], Goto):\n label = label.ops[-1].label\n return label\n\n\ndef cleanup_cfg(blocks: List[BasicBlock]) -> None:\n \"\"\"Cleanup the control flow graph.\n\n This eliminates obviously dead basic blocks and eliminates blocks that contain\n nothing but a single jump.\n\n There is a lot more that could be done.\n \"\"\"\n changed = True\n while changed:\n # First collapse any jumps to basic block that only contain a goto\n for block in blocks:\n term = block.ops[-1]\n if isinstance(term, Goto):\n term.label = get_real_target(term.label)\n elif isinstance(term, Branch):\n term.true = get_real_target(term.true)\n term.false = get_real_target(term.false)\n\n # Then delete any blocks that have no predecessors\n changed = False\n cfg = get_cfg(blocks)\n orig_blocks = blocks[:]\n blocks.clear()\n for i, block in enumerate(orig_blocks):\n if i == 0 or cfg.pred[block]:\n blocks.append(block)\n else:\n changed = True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py_T_GenAndKill.Tuple_Set_Value_Set_Val": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py_T_GenAndKill.Tuple_Set_Value_Set_Val", "embedding": null, "metadata": {"file_path": "mypyc/analysis/dataflow.py", "file_name": "dataflow.py", "file_type": "text/x-python", "category": "implementation", "start_line": 125, "end_line": 139, "span_ids": ["AnalysisResult.__str__", "impl", "AnalysisResult", "impl:5", "AnalysisResult.__init__"], "tokens": 113}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "T = TypeVar('T')\n\nAnalysisDict = Dict[Tuple[BasicBlock, int], Set[T]]\n\n\nclass AnalysisResult(Generic[T]):\n def __init__(self, before: 'AnalysisDict[T]', after: 'AnalysisDict[T]') -> None:\n self.before = before\n self.after = after\n\n def __str__(self) -> str:\n return 'before: %s\\nafter: %s\\n' % (self.before, self.after)\n\n\nGenAndKill = Tuple[Set[Value], Set[Value]]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py_DefinedVisitor_DefinedVisitor.visit_set_mem.return.set_set_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py_DefinedVisitor_DefinedVisitor.visit_set_mem.return.set_set_", "embedding": null, "metadata": {"file_path": "mypyc/analysis/dataflow.py", "file_name": "dataflow.py", "file_type": "text/x-python", "category": "implementation", "start_line": 233, "end_line": 265, "span_ids": ["DefinedVisitor", "DefinedVisitor.visit_register_op", "DefinedVisitor.visit_unreachable", "DefinedVisitor.visit_return", "DefinedVisitor.visit_assign_multi", "DefinedVisitor.visit_set_mem", "DefinedVisitor.visit_assign", "DefinedVisitor.visit_branch"], "tokens": 263}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DefinedVisitor(BaseAnalysisVisitor):\n \"\"\"Visitor for finding defined registers.\n\n Note that this only deals with registers and not temporaries, on\n the assumption that we never access temporaries when they might be\n undefined.\n \"\"\"\n\n def visit_branch(self, op: Branch) -> GenAndKill:\n return set(), set()\n\n def visit_return(self, op: Return) -> GenAndKill:\n return set(), set()\n\n def visit_unreachable(self, op: Unreachable) -> GenAndKill:\n return set(), set()\n\n def visit_register_op(self, op: RegisterOp) -> GenAndKill:\n return set(), set()\n\n def visit_assign(self, op: Assign) -> GenAndKill:\n # Loading an error value may undefine the register.\n if isinstance(op.src, LoadErrorValue) and op.src.undefines:\n return set(), {op.dest}\n else:\n return {op.dest}, set()\n\n def visit_assign_multi(self, op: AssignMulti) -> GenAndKill:\n # Array registers are special and we don't track the definedness of them.\n return set(), set()\n\n def visit_set_mem(self, op: SetMem) -> GenAndKill:\n return set(), set()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py_analyze_maybe_defined_regs_analyze_maybe_defined_regs.return.run_analysis_blocks_block": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py_analyze_maybe_defined_regs_analyze_maybe_defined_regs.return.run_analysis_blocks_block", "embedding": null, "metadata": {"file_path": "mypyc/analysis/dataflow.py", "file_name": "dataflow.py", "file_type": "text/x-python", "category": "implementation", "start_line": 259, "end_line": 271, "span_ids": ["analyze_maybe_defined_regs"], "tokens": 102}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def analyze_maybe_defined_regs(blocks: List[BasicBlock],\n cfg: CFG,\n initial_defined: Set[Value]) -> AnalysisResult[Value]:\n \"\"\"Calculate potentially defined registers at each CFG location.\n\n A register is defined if it has a value along some path from the initial location.\n \"\"\"\n return run_analysis(blocks=blocks,\n cfg=cfg,\n gen_and_kill=DefinedVisitor(),\n initial=initial_defined,\n backward=False,\n kind=MAYBE_ANALYSIS)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py_analyze_must_defined_regs_analyze_must_defined_regs.return.run_analysis_blocks_block": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py_analyze_must_defined_regs_analyze_must_defined_regs.return.run_analysis_blocks_block", "embedding": null, "metadata": {"file_path": "mypyc/analysis/dataflow.py", "file_name": "dataflow.py", "file_type": "text/x-python", "category": "implementation", "start_line": 274, "end_line": 294, "span_ids": ["analyze_must_defined_regs"], "tokens": 152}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def analyze_must_defined_regs(\n blocks: List[BasicBlock],\n cfg: CFG,\n initial_defined: Set[Value],\n regs: Iterable[Value]) -> AnalysisResult[Value]:\n \"\"\"Calculate always defined registers at each CFG location.\n\n This analysis can work before exception insertion, since it is a\n sound assumption that registers defined in a block might not be\n initialized in its error handler.\n\n A register is defined if it has a value along all paths from the\n initial location.\n \"\"\"\n return run_analysis(blocks=blocks,\n cfg=cfg,\n gen_and_kill=DefinedVisitor(),\n initial=initial_defined,\n backward=False,\n kind=MUST_ANALYSIS,\n universe=set(regs))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py_BorrowedArgumentsVisitor_BorrowedArgumentsVisitor.visit_set_mem.return.set_set_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py_BorrowedArgumentsVisitor_BorrowedArgumentsVisitor.visit_set_mem.return.set_set_", "embedding": null, "metadata": {"file_path": "mypyc/analysis/dataflow.py", "file_name": "dataflow.py", "file_type": "text/x-python", "category": "implementation", "start_line": 306, "end_line": 331, "span_ids": ["BorrowedArgumentsVisitor.visit_branch", "BorrowedArgumentsVisitor", "BorrowedArgumentsVisitor.visit_unreachable", "BorrowedArgumentsVisitor.visit_set_mem", "BorrowedArgumentsVisitor.visit_assign_multi", "BorrowedArgumentsVisitor.visit_register_op", "BorrowedArgumentsVisitor.visit_return", "BorrowedArgumentsVisitor.visit_assign", "BorrowedArgumentsVisitor.__init__"], "tokens": 202}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BorrowedArgumentsVisitor(BaseAnalysisVisitor):\n def __init__(self, args: Set[Value]) -> None:\n self.args = args\n\n def visit_branch(self, op: Branch) -> GenAndKill:\n return set(), set()\n\n def visit_return(self, op: Return) -> GenAndKill:\n return set(), set()\n\n def visit_unreachable(self, op: Unreachable) -> GenAndKill:\n return set(), set()\n\n def visit_register_op(self, op: RegisterOp) -> GenAndKill:\n return set(), set()\n\n def visit_assign(self, op: Assign) -> GenAndKill:\n if op.dest in self.args:\n return set(), {op.dest}\n return set(), set()\n\n def visit_assign_multi(self, op: AssignMulti) -> GenAndKill:\n return set(), set()\n\n def visit_set_mem(self, op: SetMem) -> GenAndKill:\n return set(), set()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py_analyze_borrowed_arguments_analyze_borrowed_arguments.return.run_analysis_blocks_block": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py_analyze_borrowed_arguments_analyze_borrowed_arguments.return.run_analysis_blocks_block", "embedding": null, "metadata": {"file_path": "mypyc/analysis/dataflow.py", "file_name": "dataflow.py", "file_type": "text/x-python", "category": "implementation", "start_line": 322, "end_line": 336, "span_ids": ["analyze_borrowed_arguments"], "tokens": 110}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def analyze_borrowed_arguments(\n blocks: List[BasicBlock],\n cfg: CFG,\n borrowed: Set[Value]) -> AnalysisResult[Value]:\n \"\"\"Calculate arguments that can use references borrowed from the caller.\n\n When assigning to an argument, it no longer is borrowed.\n \"\"\"\n return run_analysis(blocks=blocks,\n cfg=cfg,\n gen_and_kill=BorrowedArgumentsVisitor(borrowed),\n initial=borrowed,\n backward=False,\n kind=MUST_ANALYSIS,\n universe=borrowed)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py_UndefinedVisitor_UndefinedVisitor.visit_set_mem.return.set_set_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py_UndefinedVisitor_UndefinedVisitor.visit_set_mem.return.set_set_", "embedding": null, "metadata": {"file_path": "mypyc/analysis/dataflow.py", "file_name": "dataflow.py", "file_type": "text/x-python", "category": "implementation", "start_line": 351, "end_line": 371, "span_ids": ["UndefinedVisitor.visit_assign", "UndefinedVisitor.visit_unreachable", "UndefinedVisitor.visit_assign_multi", "UndefinedVisitor.visit_return", "UndefinedVisitor.visit_set_mem", "UndefinedVisitor", "UndefinedVisitor.visit_branch", "UndefinedVisitor.visit_register_op"], "tokens": 175}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class UndefinedVisitor(BaseAnalysisVisitor):\n def visit_branch(self, op: Branch) -> GenAndKill:\n return set(), set()\n\n def visit_return(self, op: Return) -> GenAndKill:\n return set(), set()\n\n def visit_unreachable(self, op: Unreachable) -> GenAndKill:\n return set(), set()\n\n def visit_register_op(self, op: RegisterOp) -> GenAndKill:\n return set(), {op} if not op.is_void else set()\n\n def visit_assign(self, op: Assign) -> GenAndKill:\n return set(), {op.dest}\n\n def visit_assign_multi(self, op: AssignMulti) -> GenAndKill:\n return set(), {op.dest}\n\n def visit_set_mem(self, op: SetMem) -> GenAndKill:\n return set(), set()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py_analyze_live_regs_MAYBE_ANALYSIS.1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py_analyze_live_regs_MAYBE_ANALYSIS.1", "embedding": null, "metadata": {"file_path": "mypyc/analysis/dataflow.py", "file_name": "dataflow.py", "file_type": "text/x-python", "category": "implementation", "start_line": 401, "end_line": 418, "span_ids": ["analyze_live_regs", "impl:7"], "tokens": 115}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def analyze_live_regs(blocks: List[BasicBlock],\n cfg: CFG) -> AnalysisResult[Value]:\n \"\"\"Calculate live registers at each CFG location.\n\n A register is live at a location if it can be read along some CFG path starting\n from the location.\n \"\"\"\n return run_analysis(blocks=blocks,\n cfg=cfg,\n gen_and_kill=LivenessVisitor(),\n initial=set(),\n backward=True,\n kind=MAYBE_ANALYSIS)\n\n\n# Analysis kinds\nMUST_ANALYSIS = 0\nMAYBE_ANALYSIS = 1", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py__TODO_the_return_type_of_run_analysis.None_8": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py__TODO_the_return_type_of_run_analysis.None_8", "embedding": null, "metadata": {"file_path": "mypyc/analysis/dataflow.py", "file_name": "dataflow.py", "file_type": "text/x-python", "category": "implementation", "start_line": 421, "end_line": 515, "span_ids": ["run_analysis", "impl:7"], "tokens": 840}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# TODO the return type of this function is too complicated. Abtract it into its\n# own class.\n\ndef run_analysis(blocks: List[BasicBlock],\n cfg: CFG,\n gen_and_kill: OpVisitor[Tuple[Set[T], Set[T]]],\n initial: Set[T],\n kind: int,\n backward: bool,\n universe: Optional[Set[T]] = None) -> AnalysisResult[T]:\n \"\"\"Run a general set-based data flow analysis.\n\n Args:\n blocks: All basic blocks\n cfg: Control-flow graph for the code\n gen_and_kill: Implementation of gen and kill functions for each op\n initial: Value of analysis for the entry points (for a forward analysis) or the\n exit points (for a backward analysis)\n kind: MUST_ANALYSIS or MAYBE_ANALYSIS\n backward: If False, the analysis is a forward analysis; it's backward otherwise\n universe: For a must analysis, the set of all possible values. This is the starting\n value for the work list algorithm, which will narrow this down until reaching a\n fixed point. For a maybe analysis the iteration always starts from an empty set\n and this argument is ignored.\n\n Return analysis results: (before, after)\n \"\"\"\n block_gen = {}\n block_kill = {}\n\n # Calculate kill and gen sets for entire basic blocks.\n for block in blocks:\n gen = set() # type: Set[T]\n kill = set() # type: Set[T]\n ops = block.ops\n if backward:\n ops = list(reversed(ops))\n for op in ops:\n opgen, opkill = op.accept(gen_and_kill)\n gen = ((gen - opkill) | opgen)\n kill = ((kill - opgen) | opkill)\n block_gen[block] = gen\n block_kill[block] = kill\n\n # Set up initial state for worklist algorithm.\n worklist = list(blocks)\n if not backward:\n worklist = worklist[::-1] # Reverse for a small performance improvement\n workset = set(worklist)\n before = {} # type: Dict[BasicBlock, Set[T]]\n after = {} # type: Dict[BasicBlock, Set[T]]\n for block in blocks:\n if kind == MAYBE_ANALYSIS:\n before[block] = set()\n after[block] = set()\n else:\n assert universe is not None, \"Universe must be defined for a must analysis\"\n before[block] = set(universe)\n after[block] = set(universe)\n\n if backward:\n pred_map = cfg.succ\n succ_map = cfg.pred\n else:\n pred_map = cfg.pred\n succ_map = cfg.succ\n\n # Run work list algorithm to generate in and out sets for each basic block.\n while worklist:\n label = worklist.pop()\n workset.remove(label)\n if pred_map[label]:\n new_before = None # type: Union[Set[T], None]\n for pred in pred_map[label]:\n if new_before is None:\n new_before = set(after[pred])\n elif kind == MAYBE_ANALYSIS:\n new_before |= after[pred]\n else:\n new_before &= after[pred]\n assert new_before is not None\n else:\n new_before = set(initial)\n before[label] = new_before\n new_after = (new_before - block_kill[label]) | block_gen[label]\n if new_after != after[label]:\n for succ in succ_map[label]:\n if succ not in workset:\n worklist.append(succ)\n workset.add(succ)\n after[label] = new_after\n\n # Run algorithm for each basic block to generate opcode-level sets.\n op_before = {} # type: Dict[Tuple[BasicBlock, int], Set[T]]\n op_after = {} # type: Dict[Tuple[BasicBlock, int], Set[T]]\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py_run_analysis.None_5_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py_run_analysis.None_5_", "embedding": null, "metadata": {"file_path": "mypyc/analysis/dataflow.py", "file_name": "dataflow.py", "file_type": "text/x-python", "category": "implementation", "start_line": 516, "end_line": 531, "span_ids": ["run_analysis"], "tokens": 202}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def run_analysis(blocks: List[BasicBlock],\n cfg: CFG,\n gen_and_kill: OpVisitor[Tuple[Set[T], Set[T]]],\n initial: Set[T],\n kind: int,\n backward: bool,\n universe: Optional[Set[T]] = None) -> AnalysisResult[T]:\n # ... other code\n for block in blocks:\n label = block\n cur = before[label]\n ops_enum = enumerate(block.ops) # type: Iterator[Tuple[int, Op]]\n if backward:\n ops_enum = reversed(list(ops_enum))\n for idx, op in ops_enum:\n op_before[label, idx] = cur\n opgen, opkill = op.accept(gen_and_kill)\n cur = (cur - opkill) | opgen\n op_after[label, idx] = cur\n if backward:\n op_after, op_before = op_before, op_after\n\n return AnalysisResult(op_before, op_after)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/build.py__Support_for_building_e_get_extension.return.Extension": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/build.py__Support_for_building_e_get_extension.return.Extension", "embedding": null, "metadata": {"file_path": "mypyc/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 61, "span_ids": ["get_extension", "docstring"], "tokens": 424}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Support for building extensions using mypyc with distutils or setuptools\n\nThe main entry point is mypycify, which produces a list of extension\nmodules to be passed to setup. A trivial setup.py for a mypyc built\nproject, then, looks like:\n\n from distutils.core import setup\n from mypyc.build import mypycify\n\n setup(name='test_module',\n ext_modules=mypycify(['foo.py']),\n )\n\nSee the mypycify docs for additional arguments.\n\nmypycify can integrate with either distutils or setuptools, but needs\nto know at import-time whether it is using distutils or setuputils. We\nhackily decide based on whether setuptools has been imported already.\n\"\"\"\n\nimport sys\nimport os.path\nimport hashlib\nimport time\nimport re\n\nfrom typing import List, Tuple, Any, Optional, Dict, Union, Set, Iterable, cast\nfrom typing_extensions import TYPE_CHECKING, NoReturn, Type\n\nfrom mypy.main import process_options\nfrom mypy.errors import CompileError\nfrom mypy.options import Options\nfrom mypy.build import BuildSource\nfrom mypy.fscache import FileSystemCache\nfrom mypy.util import write_junit_xml\n\nfrom mypyc.namegen import exported_name\nfrom mypyc.options import CompilerOptions\nfrom mypyc.errors import Errors\nfrom mypyc.common import RUNTIME_C_FILES, shared_lib_name\nfrom mypyc.ir.pprint import format_modules\n\nfrom mypyc.codegen import emitmodule\n\nif TYPE_CHECKING:\n from distutils.core import Extension # noqa\n\nfrom distutils import sysconfig, ccompiler\n\n\ndef get_extension() -> Type['Extension']:\n # We can work with either setuptools or distutils, and pick setuptools\n # if it has been imported.\n use_setuptools = 'setuptools' in sys.modules\n\n if not use_setuptools:\n from distutils.core import Extension\n else:\n from setuptools import Extension # type: ignore # noqa\n\n return Extension", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/build.py_setup_mypycify_vars_fail.sys_exit_message_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/build.py_setup_mypycify_vars_fail.sys_exit_message_", "embedding": null, "metadata": {"file_path": "mypyc/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 64, "end_line": 80, "span_ids": ["fail", "setup_mypycify_vars"], "tokens": 209}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def setup_mypycify_vars() -> None:\n \"\"\"Rewrite a bunch of config vars in pretty dubious ways.\"\"\"\n # There has to be a better approach to this.\n\n # The vars can contain ints but we only work with str ones\n vars = cast(Dict[str, str], sysconfig.get_config_vars())\n if sys.platform == 'darwin':\n # Disable building 32-bit binaries, since we generate too much code\n # for a 32-bit Mach-O object. There has to be a better way to do this.\n vars['LDSHARED'] = vars['LDSHARED'].replace('-arch i386', '')\n vars['LDFLAGS'] = vars['LDFLAGS'].replace('-arch i386', '')\n vars['CFLAGS'] = vars['CFLAGS'].replace('-arch i386', '')\n\n\ndef fail(message: str) -> NoReturn:\n # TODO: Is there something else we should do to fail?\n sys.exit(message)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/build.py_get_mypy_config_get_mypy_config.return.mypyc_sources_all_source": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/build.py_get_mypy_config_get_mypy_config.return.mypyc_sources_all_source", "embedding": null, "metadata": {"file_path": "mypyc/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 83, "end_line": 121, "span_ids": ["get_mypy_config"], "tokens": 377}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_mypy_config(mypy_options: List[str],\n only_compile_paths: Optional[Iterable[str]],\n compiler_options: CompilerOptions,\n fscache: Optional[FileSystemCache],\n ) -> Tuple[List[BuildSource], List[BuildSource], Options]:\n \"\"\"Construct mypy BuildSources and Options from file and options lists\"\"\"\n all_sources, options = process_options(mypy_options, fscache=fscache)\n if only_compile_paths is not None:\n paths_set = set(only_compile_paths)\n mypyc_sources = [s for s in all_sources if s.path in paths_set]\n else:\n mypyc_sources = all_sources\n\n if compiler_options.separate:\n mypyc_sources = [src for src in mypyc_sources\n if src.path and not src.path.endswith('__init__.py')]\n\n if not mypyc_sources:\n return mypyc_sources, all_sources, options\n\n # Override whatever python_version is inferred from the .ini file,\n # and set the python_version to be the currently used version.\n options.python_version = sys.version_info[:2]\n\n if options.python_version[0] == 2:\n fail('Python 2 not supported')\n if not options.strict_optional:\n fail('Disabling strict optional checking not supported')\n options.show_traceback = True\n # Needed to get types for all AST nodes\n options.export_types = True\n # We use mypy incremental mode when doing separate/incremental mypyc compilation\n options.incremental = compiler_options.separate\n options.preserve_asts = True\n\n for source in mypyc_sources:\n options.per_module_options.setdefault(source.module, {})['mypyc'] = True\n\n return mypyc_sources, all_sources, options", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/build.py_generate_c_extension_shim_generate_c_extension_shim.return.cpath": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/build.py_generate_c_extension_shim_generate_c_extension_shim.return.cpath", "embedding": null, "metadata": {"file_path": "mypyc/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 124, "end_line": 148, "span_ids": ["generate_c_extension_shim"], "tokens": 224}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_c_extension_shim(\n full_module_name: str, module_name: str, dir_name: str, group_name: str) -> str:\n \"\"\"Create a C extension shim with a passthrough PyInit function.\n\n Arguments:\n full_module_name: the dotted full module name\n module_name: the final component of the module name\n dir_name: the directory to place source code\n group_name: the name of the group\n \"\"\"\n cname = '%s.c' % full_module_name.replace('.', os.sep)\n cpath = os.path.join(dir_name, cname)\n\n # We load the C extension shim template from a file.\n # (So that the file could be reused as a bazel template also.)\n with open(os.path.join(include_dir(), 'module_shim.tmpl')) as f:\n shim_template = f.read()\n\n write_file(\n cpath,\n shim_template.format(modname=module_name,\n libname=shared_lib_name(group_name),\n full_modname=exported_name(full_module_name)))\n\n return cpath", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/build.py_group_name_include_dir.return.os_path_join_os_path_absp": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/build.py_group_name_include_dir.return.os_path_join_os_path_absp", "embedding": null, "metadata": {"file_path": "mypyc/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 151, "end_line": 163, "span_ids": ["group_name", "include_dir"], "tokens": 117}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def group_name(modules: List[str]) -> str:\n \"\"\"Produce a probably unique name for a group from a list of module names.\"\"\"\n if len(modules) == 1:\n return modules[0]\n\n h = hashlib.sha1()\n h.update(','.join(modules).encode())\n return h.hexdigest()[:20]\n\n\ndef include_dir() -> str:\n \"\"\"Find the path of the lib-rt dir that needs to be included\"\"\"\n return os.path.join(os.path.abspath(os.path.dirname(__file__)), 'lib-rt')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/build.py_generate_c_generate_c.return.ctext_n_join_format_m": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/build.py_generate_c_generate_c.return.ctext_n_join_format_m", "embedding": null, "metadata": {"file_path": "mypyc/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 166, "end_line": 223, "span_ids": ["generate_c"], "tokens": 418}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_c(sources: List[BuildSource],\n options: Options,\n groups: emitmodule.Groups,\n fscache: FileSystemCache,\n compiler_options: CompilerOptions,\n ) -> Tuple[List[List[Tuple[str, str]]], str]:\n \"\"\"Drive the actual core compilation step.\n\n The groups argument describes how modules are assigned to C\n extension modules. See the comments on the Groups type in\n mypyc.emitmodule for details.\n\n Returns the C source code and (for debugging) the pretty printed IR.\n \"\"\"\n t0 = time.time()\n\n # Do the actual work now\n serious = False\n result = None\n try:\n result = emitmodule.parse_and_typecheck(\n sources, options, compiler_options, groups, fscache)\n messages = result.errors\n except CompileError as e:\n messages = e.messages\n if not e.use_stdout:\n serious = True\n\n t1 = time.time()\n if compiler_options.verbose:\n print(\"Parsed and typechecked in {:.3f}s\".format(t1 - t0))\n\n if not messages and result:\n errors = Errors()\n modules, ctext = emitmodule.compile_modules_to_c(\n result, compiler_options=compiler_options, errors=errors, groups=groups)\n\n if errors.num_errors:\n messages.extend(errors.new_messages())\n\n t2 = time.time()\n if compiler_options.verbose:\n print(\"Compiled to C in {:.3f}s\".format(t2 - t1))\n\n # ... you know, just in case.\n if options.junit_xml:\n py_version = \"{}_{}\".format(\n options.python_version[0], options.python_version[1]\n )\n write_junit_xml(\n t2 - t0, serious, messages, options.junit_xml, py_version, options.platform\n )\n\n if messages:\n print(\"\\n\".join(messages))\n sys.exit(1)\n\n return ctext, '\\n'.join(format_modules(modules))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/build.py_build_using_shared_lib_build_using_shared_lib.return.extensions": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/build.py_build_using_shared_lib_build_using_shared_lib.return.extensions", "embedding": null, "metadata": {"file_path": "mypyc/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 226, "end_line": 268, "span_ids": ["build_using_shared_lib"], "tokens": 346}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def build_using_shared_lib(sources: List[BuildSource],\n group_name: str,\n cfiles: List[str],\n deps: List[str],\n build_dir: str,\n extra_compile_args: List[str],\n ) -> List['Extension']:\n \"\"\"Produce the list of extension modules when a shared library is needed.\n\n This creates one shared library extension module that all of the\n others import and then one shim extension module for each\n module in the build, that simply calls an initialization function\n in the shared library.\n\n The shared library (which lib_name is the name of) is a python\n extension module that exports the real initialization functions in\n Capsules stored in module attributes.\n \"\"\"\n extensions = [get_extension()(\n shared_lib_name(group_name),\n sources=cfiles,\n include_dirs=[include_dir(), build_dir],\n depends=deps,\n extra_compile_args=extra_compile_args,\n )]\n\n for source in sources:\n module_name = source.module.split('.')[-1]\n shim_file = generate_c_extension_shim(source.module, module_name, build_dir, group_name)\n\n # We include the __init__ in the \"module name\" we stick in the Extension,\n # since this seems to be needed for it to end up in the right place.\n full_module_name = source.module\n assert source.path\n if os.path.split(source.path)[1] == '__init__.py':\n full_module_name += '.__init__'\n extensions.append(get_extension()(\n full_module_name,\n sources=[shim_file],\n extra_compile_args=extra_compile_args,\n ))\n\n return extensions", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/build.py_build_single_module_build_single_module.return._get_extension_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/build.py_build_single_module_build_single_module.return._get_extension_", "embedding": null, "metadata": {"file_path": "mypyc/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 271, "end_line": 284, "span_ids": ["build_single_module"], "tokens": 105}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def build_single_module(sources: List[BuildSource],\n cfiles: List[str],\n extra_compile_args: List[str],\n ) -> List['Extension']:\n \"\"\"Produce the list of extension modules for a standalone extension.\n\n This contains just one module, since there is no need for a shared module.\n \"\"\"\n return [get_extension()(\n sources[0].module,\n sources=cfiles,\n include_dirs=[include_dir()],\n extra_compile_args=extra_compile_args,\n )]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/build.py_write_file_write_file.if_old_contents_encode.os_utime_path_times_new": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/build.py_write_file_write_file.if_old_contents_encode.os_utime_path_times_new", "embedding": null, "metadata": {"file_path": "mypyc/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 287, "end_line": 312, "span_ids": ["write_file"], "tokens": 246}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def write_file(path: str, contents: str) -> None:\n \"\"\"Write data into a file.\n\n If the file already exists and has the same contents we\n want to write, skip writing so as to preserve the mtime\n and avoid triggering recompilation.\n \"\"\"\n # We encode it ourselves and open the files as binary to avoid windows\n # newline translation\n encoded_contents = contents.encode('utf-8')\n try:\n with open(path, 'rb') as f:\n old_contents = f.read() # type: Optional[bytes]\n except IOError:\n old_contents = None\n if old_contents != encoded_contents:\n os.makedirs(os.path.dirname(path), exist_ok=True)\n with open(path, 'wb') as f:\n f.write(encoded_contents)\n\n # Fudge the mtime forward because otherwise when two builds happen close\n # together (like in a test) setuptools might not realize the source is newer\n # than the new artifact.\n # XXX: This is bad though.\n new_mtime = os.stat(path).st_mtime + 1\n os.utime(path, times=(new_mtime, new_mtime))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/build.py_construct_groups_construct_groups.return.groups": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/build.py_construct_groups_construct_groups.return.groups", "embedding": null, "metadata": {"file_path": "mypyc/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 315, "end_line": 353, "span_ids": ["construct_groups"], "tokens": 308}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def construct_groups(\n sources: List[BuildSource],\n separate: Union[bool, List[Tuple[List[str], Optional[str]]]],\n use_shared_lib: bool,\n) -> emitmodule.Groups:\n \"\"\"Compute Groups given the input source list and separate configs.\n\n separate is the user-specified configuration for how to assign\n modules to compilation groups (see mypycify docstring for details).\n\n This takes that and expands it into our internal representation of\n group configuration, documented in mypyc.emitmodule's definition\n of Group.\n \"\"\"\n\n if separate is True:\n groups = [\n ([source], None) for source in sources\n ] # type: emitmodule.Groups\n elif isinstance(separate, list):\n groups = []\n used_sources = set()\n for files, name in separate:\n group_sources = [src for src in sources if src.path in files]\n groups.append((group_sources, name))\n used_sources.update(group_sources)\n unused_sources = [src for src in sources if src not in used_sources]\n if unused_sources:\n groups.extend([([source], None) for source in unused_sources])\n else:\n groups = [(sources, None)]\n\n # Generate missing names\n for i, (group, name) in enumerate(groups):\n if use_shared_lib and not name:\n name = group_name([source.module for source in group])\n groups[i] = (group, name)\n\n return groups", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/build.py_get_header_deps_get_header_deps.return.sorted_headers_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/build.py_get_header_deps_get_header_deps.return.sorted_headers_", "embedding": null, "metadata": {"file_path": "mypyc/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 356, "end_line": 369, "span_ids": ["get_header_deps"], "tokens": 116}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_header_deps(cfiles: List[Tuple[str, str]]) -> List[str]:\n \"\"\"Find all the headers used by a group of cfiles.\n\n We do this by just regexping the source, which is a bit simpler than\n properly plumbing the data through.\n\n Arguments:\n cfiles: A list of (file name, file contents) pairs.\n \"\"\"\n headers = set() # type: Set[str]\n for _, contents in cfiles:\n headers.update(re.findall(r'#include \"(.*)\"', contents))\n\n return sorted(headers)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/build.py_mypyc_build_mypyc_build.return.groups_group_cfilenames": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/build.py_mypyc_build_mypyc_build.return.groups_group_cfilenames", "embedding": null, "metadata": {"file_path": "mypyc/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 372, "end_line": 421, "span_ids": ["mypyc_build"], "tokens": 525}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def mypyc_build(\n paths: List[str],\n compiler_options: CompilerOptions,\n *,\n separate: Union[bool, List[Tuple[List[str], Optional[str]]]] = False,\n only_compile_paths: Optional[Iterable[str]] = None,\n skip_cgen_input: Optional[Any] = None,\n always_use_shared_lib: bool = False\n) -> Tuple[emitmodule.Groups, List[Tuple[List[str], List[str]]]]:\n \"\"\"Do the front and middle end of mypyc building, producing and writing out C source.\"\"\"\n fscache = FileSystemCache()\n mypyc_sources, all_sources, options = get_mypy_config(\n paths, only_compile_paths, compiler_options, fscache)\n\n # We generate a shared lib if there are multiple modules or if any\n # of the modules are in package. (Because I didn't want to fuss\n # around with making the single module code handle packages.)\n use_shared_lib = (\n len(mypyc_sources) > 1\n or any('.' in x.module for x in mypyc_sources)\n or always_use_shared_lib\n )\n\n groups = construct_groups(mypyc_sources, separate, use_shared_lib)\n\n # We let the test harness just pass in the c file contents instead\n # so that it can do a corner-cutting version without full stubs.\n if not skip_cgen_input:\n group_cfiles, ops_text = generate_c(all_sources, options, groups, fscache,\n compiler_options=compiler_options)\n # TODO: unique names?\n write_file(os.path.join(compiler_options.target_dir, 'ops.txt'), ops_text)\n else:\n group_cfiles = skip_cgen_input\n\n # Write out the generated C and collect the files for each group\n # Should this be here??\n group_cfilenames = [] # type: List[Tuple[List[str], List[str]]]\n for cfiles in group_cfiles:\n cfilenames = []\n for cfile, ctext in cfiles:\n cfile = os.path.join(compiler_options.target_dir, cfile)\n write_file(cfile, ctext)\n if os.path.splitext(cfile)[1] == '.c':\n cfilenames.append(cfile)\n\n deps = [os.path.join(compiler_options.target_dir, dep) for dep in get_header_deps(cfiles)]\n group_cfilenames.append((cfilenames, deps))\n\n return groups, group_cfilenames", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/build.py_mypycify_mypycify._type_List_str_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/build.py_mypycify_mypycify._type_List_str_", "embedding": null, "metadata": {"file_path": "mypyc/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 424, "end_line": 506, "span_ids": ["mypycify"], "tokens": 757}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def mypycify(\n paths: List[str],\n *,\n only_compile_paths: Optional[Iterable[str]] = None,\n verbose: bool = False,\n opt_level: str = '3',\n strip_asserts: bool = False,\n multi_file: bool = False,\n separate: Union[bool, List[Tuple[List[str], Optional[str]]]] = False,\n skip_cgen_input: Optional[Any] = None,\n target_dir: Optional[str] = None,\n include_runtime_files: Optional[bool] = None\n) -> List['Extension']:\n \"\"\"Main entry point to building using mypyc.\n\n This produces a list of Extension objects that should be passed as the\n ext_modules parameter to setup.\n\n Arguments:\n paths: A list of file paths to build. It may also contain mypy options.\n only_compile_paths: If not None, an iterable of paths that are to be\n the only modules compiled, even if other modules\n appear in the mypy command line given to paths.\n (These modules must still be passed to paths.)\n\n verbose: Should mypyc be more verbose. Defaults to false.\n\n opt_level: The optimization level, as a string. Defaults to '3' (meaning '-O3').\n strip_asserts: Should asserts be stripped from the generated code.\n\n multi_file: Should each Python module be compiled into its own C source file.\n This can reduce compile time and memory requirements at the likely\n cost of runtime performance of compiled code. Defaults to false.\n separate: Should compiled modules be placed in separate extension modules.\n If False, all modules are placed in a single shared library.\n If True, every module is placed in its own library.\n Otherwise separate should be a list of\n (file name list, optional shared library name) pairs specifying\n groups of files that should be placed in the same shared library\n (while all other modules will be placed in its own library).\n\n Each group can be compiled independently, which can\n speed up compilation, but calls between groups can\n be slower than calls within a group and can't be\n inlined.\n target_dir: The directory to write C output files. Defaults to 'build'.\n include_runtime_files: If not None, whether the mypyc runtime library\n should be directly #include'd instead of linked\n separately in order to reduce compiler invocations.\n Defaults to False in multi_file mode, True otherwise.\n \"\"\"\n\n # Figure out our configuration\n compiler_options = CompilerOptions(\n strip_asserts=strip_asserts,\n multi_file=multi_file,\n verbose=verbose,\n separate=separate is not False,\n target_dir=target_dir,\n include_runtime_files=include_runtime_files,\n )\n\n # Generate all the actual important C code\n groups, group_cfilenames = mypyc_build(\n paths,\n only_compile_paths=only_compile_paths,\n compiler_options=compiler_options,\n separate=separate,\n skip_cgen_input=skip_cgen_input,\n )\n\n # Mess around with setuptools and actually get the thing built\n setup_mypycify_vars()\n\n # Create a compiler object so we can make decisions based on what\n # compiler is being used. typeshed is missing some attribues on the\n # compiler object so we give it type Any\n compiler = ccompiler.new_compiler() # type: Any\n sysconfig.customize_compiler(compiler)\n\n build_dir = compiler_options.target_dir\n\n cflags = [] # type: List[str]\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/build.py_mypycify.if_compiler_compiler_type_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/build.py_mypycify.if_compiler_compiler_type_", "embedding": null, "metadata": {"file_path": "mypyc/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 507, "end_line": 555, "span_ids": ["mypycify"], "tokens": 591}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def mypycify(\n paths: List[str],\n *,\n only_compile_paths: Optional[Iterable[str]] = None,\n verbose: bool = False,\n opt_level: str = '3',\n strip_asserts: bool = False,\n multi_file: bool = False,\n separate: Union[bool, List[Tuple[List[str], Optional[str]]]] = False,\n skip_cgen_input: Optional[Any] = None,\n target_dir: Optional[str] = None,\n include_runtime_files: Optional[bool] = None\n) -> List['Extension']:\n # ... other code\n if compiler.compiler_type == 'unix':\n cflags += [\n '-O{}'.format(opt_level), '-Werror', '-Wno-unused-function', '-Wno-unused-label',\n '-Wno-unreachable-code', '-Wno-unused-variable',\n '-Wno-unused-command-line-argument', '-Wno-unknown-warning-option',\n ]\n if 'gcc' in compiler.compiler[0]:\n # This flag is needed for gcc but does not exist on clang.\n cflags += ['-Wno-unused-but-set-variable']\n elif compiler.compiler_type == 'msvc':\n if opt_level == '3':\n opt_level = '2'\n cflags += [\n '/O{}'.format(opt_level),\n '/wd4102', # unreferenced label\n '/wd4101', # unreferenced local variable\n '/wd4146', # negating unsigned int\n ]\n if multi_file:\n # Disable whole program optimization in multi-file mode so\n # that we actually get the compilation speed and memory\n # use wins that multi-file mode is intended for.\n cflags += [\n '/GL-',\n '/wd9025', # warning about overriding /GL\n ]\n\n # If configured to (defaults to yes in multi-file mode), copy the\n # runtime library in. Otherwise it just gets #included to save on\n # compiler invocations.\n shared_cfilenames = []\n if not compiler_options.include_runtime_files:\n for name in RUNTIME_C_FILES:\n rt_file = os.path.join(build_dir, name)\n with open(os.path.join(include_dir(), name), encoding='utf-8') as f:\n write_file(rt_file, f.read())\n shared_cfilenames.append(rt_file)\n\n extensions = []\n for (group_sources, lib_name), (cfilenames, deps) in zip(groups, group_cfilenames):\n if lib_name:\n extensions.extend(build_using_shared_lib(\n group_sources, lib_name, cfilenames + shared_cfilenames, deps, build_dir, cflags))\n else:\n extensions.extend(build_single_module(\n group_sources, cfilenames + shared_cfilenames, cflags))\n\n return extensions", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/cstring.py__Encode_valid_C_string__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/cstring.py__Encode_valid_C_string__", "embedding": null, "metadata": {"file_path": "mypyc/codegen/cstring.py", "file_name": "cstring.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 55, "span_ids": ["encode_bytes_as_c_string", "c_string_initializer", "docstring"], "tokens": 507}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Encode valid C string literals from Python strings.\n\nIf a character is not allowed in C string literals, it is either emitted\nas a simple escape sequence (e.g. '\\\\n'), or an octal escape sequence\nwith exactly three digits ('\\\\oXXX'). Question marks are escaped to\nprevent trigraphs in the string literal from being interpreted. Note\nthat '\\\\?' is an invalid escape sequence in Python.\n\nConsider the string literal \"AB\\\\xCDEF\". As one would expect, Python\nparses it as ['A', 'B', 0xCD, 'E', 'F']. However, the C standard\nspecifies that all hexadecimal digits immediately following '\\\\x' will\nbe interpreted as part of the escape sequence. Therefore, it is\nunexpectedly parsed as ['A', 'B', 0xCDEF].\n\nEmitting (\"AB\\\\xCD\" \"EF\") would avoid this behaviour. However, we opt\nfor simplicity and use octal escape sequences instead. They do not\nsuffer from the same issue as they are defined to parse at most three\noctal digits.\n\"\"\"\n\nimport string\n\nfrom typing_extensions import Final\n\n\nCHAR_MAP = ['\\\\{:03o}'.format(i) for i in range(256)] # type: Final\n\n# It is safe to use string.printable as it always uses the C locale.\nfor c in string.printable:\n CHAR_MAP[ord(c)] = c\n\n# These assignments must come last because we prioritize simple escape\n# sequences over any other representation.\nfor c in ('\\'', '\"', '\\\\', 'a', 'b', 'f', 'n', 'r', 't', 'v'):\n escaped = '\\\\{}'.format(c)\n decoded = escaped.encode('ascii').decode('unicode_escape')\n CHAR_MAP[ord(decoded)] = escaped\n\n# This escape sequence is invalid in Python.\nCHAR_MAP[ord('?')] = r'\\?'\n\n\ndef encode_bytes_as_c_string(b: bytes) -> str:\n \"\"\"Produce contents of a C string literal for a byte string, without quotes.\"\"\"\n escaped = ''.join([CHAR_MAP[i] for i in b])\n return escaped\n\n\ndef c_string_initializer(value: bytes) -> str:\n \"\"\"Create initializer for a C char[]/ char * variable from a string.\n\n For example, if value if b'foo', the result would be '\"foo\"'.\n \"\"\"\n return '\"' + encode_bytes_as_c_string(value) + '\"'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_HeaderDeclaration_HeaderDeclaration.__init__.self.needs_export.needs_export": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_HeaderDeclaration_HeaderDeclaration.__init__.self.needs_export.needs_export", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emit.py", "file_name": "emit.py", "file_type": "text/x-python", "category": "implementation", "start_line": 25, "end_line": 53, "span_ids": ["HeaderDeclaration.__init__", "HeaderDeclaration"], "tokens": 243}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class HeaderDeclaration:\n \"\"\"A representation of a declaration in C.\n\n This is used to generate declarations in header files and\n (optionally) definitions in source files.\n\n Attributes:\n decl: C source code for the declaration.\n defn: Optionally, C source code for a definition.\n dependencies: The names of any objects that must be declared prior.\n is_type: Whether the declaration is of a C type. (C types will be declared in\n external header files and not marked 'extern'.)\n needs_export: Whether the declared object needs to be exported to\n other modules in the linking table.\n \"\"\"\n\n def __init__(self,\n decl: Union[str, List[str]],\n defn: Optional[List[str]] = None,\n *,\n dependencies: Optional[Set[str]] = None,\n is_type: bool = False,\n needs_export: bool = False\n ) -> None:\n self.decl = [decl] if isinstance(decl, str) else decl\n self.defn = defn\n self.dependencies = dependencies or set()\n self.is_type = is_type\n self.needs_export = needs_export", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter_Emitter.new_label.return.___LL_d_self_context_t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter_Emitter.new_label.return.___LL_d_self_context_t", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emit.py", "file_name": "emit.py", "file_type": "text/x-python", "category": "implementation", "start_line": 92, "end_line": 158, "span_ids": ["Emitter.emit_label", "Emitter.emit_from_emitter", "Emitter.emit_printf", "Emitter.new_label", "Emitter", "Emitter.label", "Emitter.emit_line", "Emitter.emit_lines", "Emitter.attr", "Emitter.temp_name", "Emitter.indent", "Emitter.dedent", "Emitter.reg", "Emitter.__init__"], "tokens": 530}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Emitter:\n \"\"\"Helper for C code generation.\"\"\"\n\n def __init__(self,\n context: EmitterContext,\n value_names: Optional[Dict[Value, str]] = None,\n capi_version: Optional[Tuple[int, int]] = None,\n ) -> None:\n self.context = context\n self.capi_version = capi_version or sys.version_info[:2]\n self.names = context.names\n self.value_names = value_names or {}\n self.fragments = [] # type: List[str]\n self._indent = 0\n\n # Low-level operations\n\n def indent(self) -> None:\n self._indent += 4\n\n def dedent(self) -> None:\n self._indent -= 4\n assert self._indent >= 0\n\n def label(self, label: BasicBlock) -> str:\n return 'CPyL%s' % label.label\n\n def reg(self, reg: Value) -> str:\n return REG_PREFIX + self.value_names[reg]\n\n def attr(self, name: str) -> str:\n return ATTR_PREFIX + name\n\n def emit_line(self, line: str = '') -> None:\n if line.startswith('}'):\n self.dedent()\n self.fragments.append(self._indent * ' ' + line + '\\n')\n if line.endswith('{'):\n self.indent()\n\n def emit_lines(self, *lines: str) -> None:\n for line in lines:\n self.emit_line(line)\n\n def emit_label(self, label: Union[BasicBlock, str]) -> None:\n if isinstance(label, str):\n text = label\n else:\n text = self.label(label)\n # Extra semicolon prevents an error when the next line declares a tempvar\n self.fragments.append('{}: ;\\n'.format(text))\n\n def emit_from_emitter(self, emitter: 'Emitter') -> None:\n self.fragments.extend(emitter.fragments)\n\n def emit_printf(self, fmt: str, *args: str) -> None:\n fmt = fmt.replace('\\n', '\\\\n')\n self.emit_line('printf(%s);' % ', '.join(['\"%s\"' % fmt] + list(args)))\n self.emit_line('fflush(stdout);')\n\n def temp_name(self) -> str:\n self.context.temp_counter += 1\n return '__tmp%d' % self.context.temp_counter\n\n def new_label(self) -> str:\n self.context.temp_counter += 1\n return '__LL%d' % self.context.temp_counter", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.get_module_group_prefix_Emitter.get_module_group_prefix.if_target_group_name_and_.else_.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.get_module_group_prefix_Emitter.get_module_group_prefix.if_target_group_name_and_.else_.return._", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emit.py", "file_name": "emit.py", "file_type": "text/x-python", "category": "implementation", "start_line": 151, "end_line": 175, "span_ids": ["Emitter.get_module_group_prefix"], "tokens": 273}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Emitter:\n\n def get_module_group_prefix(self, module_name: str) -> str:\n \"\"\"Get the group prefix for a module (relative to the current group).\n\n The prefix should be prepended to the object name whenever\n accessing an object from this module.\n\n If the module lives is in the current compilation group, there is\n no prefix. But if it lives in a different group (and hence a separate\n extension module), we need to access objects from it indirectly via an\n export table.\n\n For example, for code in group `a` to call a function `bar` in group `b`,\n it would need to do `exports_b.CPyDef_bar(...)`, while code that is\n also in group `b` can simply do `CPyDef_bar(...)`.\n\n Thus the prefix for a module in group `b` is 'exports_b.' if the current\n group is *not* b and just '' if it is.\n \"\"\"\n groups = self.context.group_map\n target_group_name = groups.get(module_name)\n if target_group_name and target_group_name != self.context.group_name:\n self.context.group_deps.add(target_group_name)\n return 'exports_{}.'.format(exported_name(target_group_name))\n else:\n return ''", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.get_group_prefix_Emitter.static_name.return._format_star_ma": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.get_group_prefix_Emitter.static_name.return._format_star_ma", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emit.py", "file_name": "emit.py", "file_type": "text/x-python", "category": "implementation", "start_line": 177, "end_line": 197, "span_ids": ["Emitter.static_name", "Emitter.get_group_prefix"], "tokens": 216}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Emitter:\n\n def get_group_prefix(self, obj: Union[ClassIR, FuncDecl]) -> str:\n \"\"\"Get the group prefix for an object.\"\"\"\n # See docs above\n return self.get_module_group_prefix(obj.module_name)\n\n def static_name(self, id: str, module: Optional[str], prefix: str = STATIC_PREFIX) -> str:\n \"\"\"Create name of a C static variable.\n\n These are used for literals and imported modules, among other\n things.\n\n The caller should ensure that the (id, module) pair cannot\n overlap with other calls to this method within a compilation\n group.\n \"\"\"\n lib_prefix = '' if not module else self.get_module_group_prefix(module)\n # If we are accessing static via the export table, we need to dereference\n # the pointer also.\n star_maybe = '*' if lib_prefix else ''\n suffix = self.names.private_name(module or '', id)\n return '{}{}{}{}'.format(star_maybe, lib_prefix, prefix, suffix)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.type_struct_name_Emitter.native_function_name.return._format_NATIVE_PREF": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.type_struct_name_Emitter.native_function_name.return._format_NATIVE_PREF", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emit.py", "file_name": "emit.py", "file_type": "text/x-python", "category": "implementation", "start_line": 199, "end_line": 226, "span_ids": ["Emitter.c_undefined_value", "Emitter.c_error_value", "Emitter.type_struct_name", "Emitter.native_function_name", "Emitter.ctype_spaced", "Emitter.ctype"], "tokens": 247}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Emitter:\n\n def type_struct_name(self, cl: ClassIR) -> str:\n return self.static_name(cl.name, cl.module_name, prefix=TYPE_PREFIX)\n\n def ctype(self, rtype: RType) -> str:\n return rtype._ctype\n\n def ctype_spaced(self, rtype: RType) -> str:\n \"\"\"Adds a space after ctype for non-pointers.\"\"\"\n ctype = self.ctype(rtype)\n if ctype[-1] == '*':\n return ctype\n else:\n return ctype + ' '\n\n def c_undefined_value(self, rtype: RType) -> str:\n if not rtype.is_unboxed:\n return 'NULL'\n elif isinstance(rtype, RPrimitive):\n return rtype.c_undefined\n elif isinstance(rtype, RTuple):\n return self.tuple_undefined_value(rtype)\n assert False, rtype\n\n def c_error_value(self, rtype: RType) -> str:\n return self.c_undefined_value(rtype)\n\n def native_function_name(self, fn: FuncDecl) -> str:\n return '{}{}'.format(NATIVE_PREFIX, fn.cname(self.names))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.tuple_c_declaration_Emitter.tuple_c_declaration.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.tuple_c_declaration_Emitter.tuple_c_declaration.return.result", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emit.py", "file_name": "emit.py", "file_type": "text/x-python", "category": "implementation", "start_line": 228, "end_line": 250, "span_ids": ["Emitter.tuple_c_declaration"], "tokens": 234}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Emitter:\n\n def tuple_c_declaration(self, rtuple: RTuple) -> List[str]:\n result = [\n '#ifndef MYPYC_DECLARED_{}'.format(rtuple.struct_name),\n '#define MYPYC_DECLARED_{}'.format(rtuple.struct_name),\n 'typedef struct {} {{'.format(rtuple.struct_name),\n ]\n if len(rtuple.types) == 0: # empty tuple\n # Empty tuples contain a flag so that they can still indicate\n # error values.\n result.append('int empty_struct_error_flag;')\n else:\n i = 0\n for typ in rtuple.types:\n result.append('{}f{};'.format(self.ctype_spaced(typ), i))\n i += 1\n result.append('}} {};'.format(rtuple.struct_name))\n values = self.tuple_undefined_value_helper(rtuple)\n result.append('static {} {} = {{ {} }};'.format(\n self.ctype(rtuple), self.tuple_undefined_value(rtuple), ''.join(values)))\n result.append('#endif')\n result.append('')\n\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.tuple_undefined_check_cond_Emitter.tuple_undefined_check_cond.if_isinstance_item_type_.else_.return._f0_format_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.tuple_undefined_check_cond_Emitter.tuple_undefined_check_cond.if_isinstance_item_type_.else_.return._f0_format_", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emit.py", "file_name": "emit.py", "file_type": "text/x-python", "category": "implementation", "start_line": 267, "end_line": 280, "span_ids": ["Emitter.tuple_undefined_check_cond"], "tokens": 169}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Emitter:\n\n def tuple_undefined_check_cond(\n self, rtuple: RTuple, tuple_expr_in_c: str,\n c_type_compare_val: Callable[[RType], str], compare: str) -> str:\n if len(rtuple.types) == 0:\n # empty tuple\n return '{}.empty_struct_error_flag {} {}'.format(\n tuple_expr_in_c, compare, c_type_compare_val(int_rprimitive))\n item_type = rtuple.types[0]\n if isinstance(item_type, RTuple):\n return self.tuple_undefined_check_cond(\n item_type, tuple_expr_in_c + '.f0', c_type_compare_val, compare)\n else:\n return '{}.f0 {} {}'.format(\n tuple_expr_in_c, compare, c_type_compare_val(item_type))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.tuple_undefined_value_Emitter.tuple_undefined_value_helper.return.res_1_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.tuple_undefined_value_Emitter.tuple_undefined_value_helper.return.res_1_", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emit.py", "file_name": "emit.py", "file_type": "text/x-python", "category": "implementation", "start_line": 282, "end_line": 299, "span_ids": ["Emitter.tuple_undefined_value", "Emitter.tuple_undefined_value_helper"], "tokens": 158}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Emitter:\n\n def tuple_undefined_value(self, rtuple: RTuple) -> str:\n return 'tuple_undefined_' + rtuple.unique_id\n\n def tuple_undefined_value_helper(self, rtuple: RTuple) -> List[str]:\n res = []\n # see tuple_c_declaration()\n if len(rtuple.types) == 0:\n return [self.c_undefined_value(int_rprimitive)]\n for item in rtuple.types:\n if not isinstance(item, RTuple):\n res.append(self.c_undefined_value(item))\n else:\n sub_list = self.tuple_undefined_value_helper(item)\n res.append('{ ')\n res.extend(sub_list)\n res.append(' }')\n res.append(', ')\n return res[:-1]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter._Higher_level_operations_Emitter.declare_tuple_struct.if_tuple_type_struct_name.self_context_declarations": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter._Higher_level_operations_Emitter.declare_tuple_struct.if_tuple_type_struct_name.self_context_declarations", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emit.py", "file_name": "emit.py", "file_type": "text/x-python", "category": "implementation", "start_line": 301, "end_line": 315, "span_ids": ["Emitter.declare_tuple_struct", "Emitter.tuple_undefined_value_helper"], "tokens": 114}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Emitter:\n\n # Higher-level operations\n\n def declare_tuple_struct(self, tuple_type: RTuple) -> None:\n if tuple_type.struct_name not in self.context.declarations:\n dependencies = set()\n for typ in tuple_type.types:\n # XXX other types might eventually need similar behavior\n if isinstance(typ, RTuple):\n dependencies.add(typ.struct_name)\n\n self.context.declarations[tuple_type.struct_name] = HeaderDeclaration(\n self.tuple_c_declaration(tuple_type),\n dependencies=dependencies,\n is_type=True,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.emit_inc_ref_Emitter.emit_inc_ref._Otherwise_assume_it_s_a": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.emit_inc_ref_Emitter.emit_inc_ref._Otherwise_assume_it_s_a", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emit.py", "file_name": "emit.py", "file_type": "text/x-python", "category": "implementation", "start_line": 317, "end_line": 330, "span_ids": ["Emitter.emit_inc_ref"], "tokens": 166}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Emitter:\n\n def emit_inc_ref(self, dest: str, rtype: RType) -> None:\n \"\"\"Increment reference count of C expression `dest`.\n\n For composite unboxed structures (e.g. tuples) recursively\n increment reference counts for each component.\n \"\"\"\n if is_int_rprimitive(rtype):\n self.emit_line('CPyTagged_IncRef(%s);' % dest)\n elif isinstance(rtype, RTuple):\n for i, item_type in enumerate(rtype.types):\n self.emit_inc_ref('{}.f{}'.format(dest, i), item_type)\n elif not rtype.is_unboxed:\n self.emit_line('CPy_INCREF(%s);' % dest)\n # Otherwise assume it's an unboxed, pointerless value and do nothing.", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.emit_dec_ref_Emitter.pretty_name.return.str_typ_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.emit_dec_ref_Emitter.pretty_name.return.str_typ_", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emit.py", "file_name": "emit.py", "file_type": "text/x-python", "category": "implementation", "start_line": 332, "end_line": 352, "span_ids": ["Emitter.emit_dec_ref", "Emitter.pretty_name"], "tokens": 251}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Emitter:\n\n def emit_dec_ref(self, dest: str, rtype: RType, is_xdec: bool = False) -> None:\n \"\"\"Decrement reference count of C expression `dest`.\n\n For composite unboxed structures (e.g. tuples) recursively\n decrement reference counts for each component.\n \"\"\"\n x = 'X' if is_xdec else ''\n if is_int_rprimitive(rtype):\n self.emit_line('CPyTagged_%sDecRef(%s);' % (x, dest))\n elif isinstance(rtype, RTuple):\n for i, item_type in enumerate(rtype.types):\n self.emit_dec_ref('{}.f{}'.format(dest, i), item_type, is_xdec)\n elif not rtype.is_unboxed:\n self.emit_line('CPy_%sDecRef(%s);' % (x, dest))\n # Otherwise assume it's an unboxed, pointerless value and do nothing.\n\n def pretty_name(self, typ: RType) -> str:\n value_type = optional_value_type(typ)\n if value_type is not None:\n return '%s or None' % self.pretty_name(value_type)\n return str(typ)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.emit_cast_Emitter.emit_cast._TODO_Verify_refcount_h": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.emit_cast_Emitter.emit_cast._TODO_Verify_refcount_h", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emit.py", "file_name": "emit.py", "file_type": "text/x-python", "category": "implementation", "start_line": 354, "end_line": 399, "span_ids": ["Emitter.emit_cast"], "tokens": 415}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Emitter:\n\n def emit_cast(self, src: str, dest: str, typ: RType, declare_dest: bool = False,\n custom_message: Optional[str] = None, optional: bool = False,\n src_type: Optional[RType] = None,\n likely: bool = True) -> None:\n \"\"\"Emit code for casting a value of given type.\n\n Somewhat strangely, this supports unboxed types but only\n operates on boxed versions. This is necessary to properly\n handle types such as Optional[int] in compatibility glue.\n\n Assign NULL (error value) to dest if the value has an incompatible type.\n\n Always copy/steal the reference in src.\n\n Args:\n src: Name of source C variable\n dest: Name of target C variable\n typ: Type of value\n declare_dest: If True, also declare the variable 'dest'\n likely: If the cast is likely to succeed (can be False for unions)\n \"\"\"\n if custom_message is not None:\n err = custom_message\n else:\n err = 'CPy_TypeError(\"{}\", {});'.format(self.pretty_name(typ), src)\n\n # Special case casting *from* optional\n if src_type and is_optional_type(src_type) and not is_object_rprimitive(typ):\n value_type = optional_value_type(src_type)\n assert value_type is not None\n if is_same_type(value_type, typ):\n if declare_dest:\n self.emit_line('PyObject *{};'.format(dest))\n check = '({} != Py_None)'\n if likely:\n check = '(likely{})'.format(check)\n self.emit_arg_check(src, dest, typ, check.format(src), optional)\n self.emit_lines(\n ' {} = {};'.format(dest, src),\n 'else {',\n err,\n '{} = NULL;'.format(dest),\n '}')\n return\n\n # TODO: Verify refcount handling.\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.emit_cast.if_is_list_rprimitive_ty_Emitter.emit_cast.if_is_list_rprimitive_ty.else_.assert_False_Cast_not_i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.emit_cast.if_is_list_rprimitive_ty_Emitter.emit_cast.if_is_list_rprimitive_ty.else_.assert_False_Cast_not_i", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emit.py", "file_name": "emit.py", "file_type": "text/x-python", "category": "implementation", "start_line": 400, "end_line": 500, "span_ids": ["Emitter.emit_cast"], "tokens": 1005}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Emitter:\n\n def emit_cast(self, src: str, dest: str, typ: RType, declare_dest: bool = False,\n custom_message: Optional[str] = None, optional: bool = False,\n src_type: Optional[RType] = None,\n likely: bool = True) -> None:\n # ... other code\n if (is_list_rprimitive(typ) or is_dict_rprimitive(typ) or is_set_rprimitive(typ)\n or is_float_rprimitive(typ) or is_str_rprimitive(typ) or is_int_rprimitive(typ)\n or is_bool_rprimitive(typ)):\n if declare_dest:\n self.emit_line('PyObject *{};'.format(dest))\n if is_list_rprimitive(typ):\n prefix = 'PyList'\n elif is_dict_rprimitive(typ):\n prefix = 'PyDict'\n elif is_set_rprimitive(typ):\n prefix = 'PySet'\n elif is_float_rprimitive(typ):\n prefix = 'CPyFloat'\n elif is_str_rprimitive(typ):\n prefix = 'PyUnicode'\n elif is_int_rprimitive(typ):\n prefix = 'PyLong'\n elif is_bool_rprimitive(typ) or is_bit_rprimitive(typ):\n prefix = 'PyBool'\n else:\n assert False, 'unexpected primitive type'\n check = '({}_Check({}))'\n if likely:\n check = '(likely{})'.format(check)\n self.emit_arg_check(src, dest, typ, check.format(prefix, src), optional)\n self.emit_lines(\n ' {} = {};'.format(dest, src),\n 'else {',\n err,\n '{} = NULL;'.format(dest),\n '}')\n elif is_tuple_rprimitive(typ):\n if declare_dest:\n self.emit_line('{} {};'.format(self.ctype(typ), dest))\n check = '(PyTuple_Check({}))'\n if likely:\n check = '(likely{})'.format(check)\n self.emit_arg_check(src, dest, typ,\n check.format(src), optional)\n self.emit_lines(\n ' {} = {};'.format(dest, src),\n 'else {',\n err,\n '{} = NULL;'.format(dest),\n '}')\n elif isinstance(typ, RInstance):\n if declare_dest:\n self.emit_line('PyObject *{};'.format(dest))\n concrete = all_concrete_classes(typ.class_ir)\n # If there are too many concrete subclasses or we can't find any\n # (meaning the code ought to be dead or we aren't doing global opts),\n # fall back to a normal typecheck.\n # Otherwise check all the subclasses.\n if not concrete or len(concrete) > FAST_ISINSTANCE_MAX_SUBCLASSES + 1:\n check = '(PyObject_TypeCheck({}, {}))'.format(\n src, self.type_struct_name(typ.class_ir))\n else:\n full_str = '(Py_TYPE({src}) == {targets[0]})'\n for i in range(1, len(concrete)):\n full_str += ' || (Py_TYPE({src}) == {targets[%d]})' % i\n if len(concrete) > 1:\n full_str = '(%s)' % full_str\n check = full_str.format(\n src=src, targets=[self.type_struct_name(ir) for ir in concrete])\n if likely:\n check = '(likely{})'.format(check)\n self.emit_arg_check(src, dest, typ, check, optional)\n self.emit_lines(\n ' {} = {};'.format(dest, src),\n 'else {',\n err,\n '{} = NULL;'.format(dest),\n '}')\n elif is_none_rprimitive(typ):\n if declare_dest:\n self.emit_line('PyObject *{};'.format(dest))\n check = '({} == Py_None)'\n if likely:\n check = '(likely{})'.format(check)\n self.emit_arg_check(src, dest, typ,\n check.format(src), optional)\n self.emit_lines(\n ' {} = {};'.format(dest, src),\n 'else {',\n err,\n '{} = NULL;'.format(dest),\n '}')\n elif is_object_rprimitive(typ):\n if declare_dest:\n self.emit_line('PyObject *{};'.format(dest))\n self.emit_arg_check(src, dest, typ, '', optional)\n self.emit_line('{} = {};'.format(dest, src))\n if optional:\n self.emit_line('}')\n elif isinstance(typ, RUnion):\n self.emit_union_cast(src, dest, typ, declare_dest, err, optional, src_type)\n elif isinstance(typ, RTuple):\n assert not optional\n self.emit_tuple_cast(src, dest, typ, declare_dest, err, src_type)\n else:\n assert False, 'Cast not implemented: %s' % typ", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.emit_union_cast_Emitter.emit_union_cast.self_emit_label_good_labe": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.emit_union_cast_Emitter.emit_union_cast.self_emit_label_good_labe", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emit.py", "file_name": "emit.py", "file_type": "text/x-python", "category": "implementation", "start_line": 502, "end_line": 527, "span_ids": ["Emitter.emit_union_cast"], "tokens": 227}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Emitter:\n\n def emit_union_cast(self, src: str, dest: str, typ: RUnion, declare_dest: bool,\n err: str, optional: bool, src_type: Optional[RType]) -> None:\n \"\"\"Emit cast to a union type.\n\n The arguments are similar to emit_cast.\n \"\"\"\n if declare_dest:\n self.emit_line('PyObject *{};'.format(dest))\n good_label = self.new_label()\n if optional:\n self.emit_line('if ({} == NULL) {{'.format(src))\n self.emit_line('{} = {};'.format(dest, self.c_error_value(typ)))\n self.emit_line('goto {};'.format(good_label))\n self.emit_line('}')\n for item in typ.items:\n self.emit_cast(src,\n dest,\n item,\n declare_dest=False,\n custom_message='',\n optional=False,\n likely=False)\n self.emit_line('if ({} != NULL) goto {};'.format(dest, good_label))\n # Handle cast failure.\n self.emit_line(err)\n self.emit_label(good_label)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.emit_tuple_cast_Emitter.emit_tuple_cast.self_emit_label_out_label": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.emit_tuple_cast_Emitter.emit_tuple_cast.self_emit_label_out_label", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emit.py", "file_name": "emit.py", "file_type": "text/x-python", "category": "implementation", "start_line": 529, "end_line": 558, "span_ids": ["Emitter.emit_tuple_cast"], "tokens": 288}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Emitter:\n\n def emit_tuple_cast(self, src: str, dest: str, typ: RTuple, declare_dest: bool,\n err: str, src_type: Optional[RType]) -> None:\n \"\"\"Emit cast to a tuple type.\n\n The arguments are similar to emit_cast.\n \"\"\"\n if declare_dest:\n self.emit_line('PyObject *{};'.format(dest))\n # This reuse of the variable is super dodgy. We don't even\n # care about the values except to check whether they are\n # invalid.\n out_label = self.new_label()\n self.emit_lines(\n 'if (unlikely(!(PyTuple_Check({r}) && PyTuple_GET_SIZE({r}) == {size}))) {{'.format(\n r=src, size=len(typ.types)),\n '{} = NULL;'.format(dest),\n 'goto {};'.format(out_label),\n '}')\n for i, item in enumerate(typ.types):\n # Since we did the checks above this should never fail\n self.emit_cast('PyTuple_GET_ITEM({}, {})'.format(src, i),\n dest,\n item,\n declare_dest=False,\n custom_message='',\n optional=False)\n self.emit_line('if ({} == NULL) goto {};'.format(dest, out_label))\n\n self.emit_line('{} = {};'.format(dest, src))\n self.emit_label(out_label)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.emit_arg_check_Emitter.emit_unbox.if_custom_failure_is_not_.else_.failure._raise_exc_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.emit_arg_check_Emitter.emit_unbox.if_custom_failure_is_not_.else_.failure._raise_exc_", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emit.py", "file_name": "emit.py", "file_type": "text/x-python", "category": "implementation", "start_line": 560, "end_line": 593, "span_ids": ["Emitter.emit_unbox", "Emitter.emit_arg_check"], "tokens": 346}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Emitter:\n\n def emit_arg_check(self, src: str, dest: str, typ: RType, check: str, optional: bool) -> None:\n if optional:\n self.emit_line('if ({} == NULL) {{'.format(src))\n self.emit_line('{} = {};'.format(dest, self.c_error_value(typ)))\n if check != '':\n self.emit_line('{}if {}'.format('} else ' if optional else '', check))\n elif optional:\n self.emit_line('else {')\n\n def emit_unbox(self, src: str, dest: str, typ: RType, custom_failure: Optional[str] = None,\n declare_dest: bool = False, borrow: bool = False,\n optional: bool = False) -> None:\n \"\"\"Emit code for unboxing a value of given type (from PyObject *).\n\n Evaluate C code in 'failure' if the value has an incompatible type.\n\n Always generate a new reference.\n\n Args:\n src: Name of source C variable\n dest: Name of target C variable\n typ: Type of value\n failure: What happens on error\n declare_dest: If True, also declare the variable 'dest'\n borrow: If True, create a borrowed reference\n \"\"\"\n # TODO: Verify refcount handling.\n raise_exc = 'CPy_TypeError(\"{}\", {});'.format(self.pretty_name(typ), src)\n if custom_failure is not None:\n failure = [raise_exc,\n custom_failure]\n else:\n failure = [raise_exc,\n '%s = %s;' % (dest, self.c_error_value(typ))]\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.emit_unbox.if_is_int_rprimitive_typ__Emitter.emit_unbox.if_is_int_rprimitive_typ_.else_.assert_False_Unboxing_n": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.emit_unbox.if_is_int_rprimitive_typ__Emitter.emit_unbox.if_is_int_rprimitive_typ_.else_.assert_False_Unboxing_n", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emit.py", "file_name": "emit.py", "file_type": "text/x-python", "category": "implementation", "start_line": 594, "end_line": 667, "span_ids": ["Emitter.emit_unbox"], "tokens": 869}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Emitter:\n\n def emit_unbox(self, src: str, dest: str, typ: RType, custom_failure: Optional[str] = None,\n declare_dest: bool = False, borrow: bool = False,\n optional: bool = False) -> None:\n # ... other code\n if is_int_rprimitive(typ) or is_short_int_rprimitive(typ):\n if declare_dest:\n self.emit_line('CPyTagged {};'.format(dest))\n self.emit_arg_check(src, dest, typ, '(likely(PyLong_Check({})))'.format(src),\n optional)\n if borrow:\n self.emit_line(' {} = CPyTagged_BorrowFromObject({});'.format(dest, src))\n else:\n self.emit_line(' {} = CPyTagged_FromObject({});'.format(dest, src))\n self.emit_line('else {')\n self.emit_lines(*failure)\n self.emit_line('}')\n elif is_bool_rprimitive(typ) or is_bit_rprimitive(typ):\n # Whether we are borrowing or not makes no difference.\n if declare_dest:\n self.emit_line('char {};'.format(dest))\n self.emit_arg_check(src, dest, typ, '(unlikely(!PyBool_Check({}))) {{'.format(src),\n optional)\n self.emit_lines(*failure)\n self.emit_line('} else')\n conversion = '{} == Py_True'.format(src)\n self.emit_line(' {} = {};'.format(dest, conversion))\n elif is_none_rprimitive(typ):\n # Whether we are borrowing or not makes no difference.\n if declare_dest:\n self.emit_line('char {};'.format(dest))\n self.emit_arg_check(src, dest, typ, '(unlikely({} != Py_None)) {{'.format(src),\n optional)\n self.emit_lines(*failure)\n self.emit_line('} else')\n self.emit_line(' {} = 1;'.format(dest))\n elif isinstance(typ, RTuple):\n self.declare_tuple_struct(typ)\n if declare_dest:\n self.emit_line('{} {};'.format(self.ctype(typ), dest))\n # HACK: The error handling for unboxing tuples is busted\n # and instead of fixing it I am just wrapping it in the\n # cast code which I think is right. This is not good.\n if optional:\n self.emit_line('if ({} == NULL) {{'.format(src))\n self.emit_line('{} = {};'.format(dest, self.c_error_value(typ)))\n self.emit_line('} else {')\n\n cast_temp = self.temp_name()\n self.emit_tuple_cast(src, cast_temp, typ, declare_dest=True, err='', src_type=None)\n self.emit_line('if (unlikely({} == NULL)) {{'.format(cast_temp))\n\n # self.emit_arg_check(src, dest, typ,\n # '(!PyTuple_Check({}) || PyTuple_Size({}) != {}) {{'.format(\n # src, src, len(typ.types)), optional)\n self.emit_lines(*failure) # TODO: Decrease refcount?\n self.emit_line('} else {')\n if not typ.types:\n self.emit_line('{}.empty_struct_error_flag = 0;'.format(dest))\n for i, item_type in enumerate(typ.types):\n temp = self.temp_name()\n # emit_tuple_cast above checks the size, so this should not fail\n self.emit_line('PyObject *{} = PyTuple_GET_ITEM({}, {});'.format(temp, src, i))\n temp2 = self.temp_name()\n # Unbox or check the item.\n if item_type.is_unboxed:\n self.emit_unbox(temp, temp2, item_type, custom_failure, declare_dest=True,\n borrow=borrow)\n else:\n if not borrow:\n self.emit_inc_ref(temp, object_rprimitive)\n self.emit_cast(temp, temp2, item_type, declare_dest=True)\n self.emit_line('{}.f{} = {};'.format(dest, i, temp2))\n self.emit_line('}')\n if optional:\n self.emit_line('}')\n\n else:\n assert False, 'Unboxing not implemented: %s' % typ", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.emit_box_Emitter.emit_box.if_is_int_rprimitive_typ_.else_.self_emit_line_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.emit_box_Emitter.emit_box.if_is_int_rprimitive_typ_.else_.self_emit_line_", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emit.py", "file_name": "emit.py", "file_type": "text/x-python", "category": "implementation", "start_line": 669, "end_line": 720, "span_ids": ["Emitter.emit_box"], "tokens": 643}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Emitter:\n\n def emit_box(self, src: str, dest: str, typ: RType, declare_dest: bool = False,\n can_borrow: bool = False) -> None:\n \"\"\"Emit code for boxing a value of given type.\n\n Generate a simple assignment if no boxing is needed.\n\n The source reference count is stolen for the result (no need to decref afterwards).\n \"\"\"\n # TODO: Always generate a new reference (if a reference type)\n if declare_dest:\n declaration = 'PyObject *'\n else:\n declaration = ''\n if is_int_rprimitive(typ) or is_short_int_rprimitive(typ):\n # Steal the existing reference if it exists.\n self.emit_line('{}{} = CPyTagged_StealAsObject({});'.format(declaration, dest, src))\n elif is_bool_rprimitive(typ) or is_bit_rprimitive(typ):\n # N.B: bool is special cased to produce a borrowed value\n # after boxing, so we don't need to increment the refcount\n # when this comes directly from a Box op.\n self.emit_lines('{}{} = {} ? Py_True : Py_False;'.format(declaration, dest, src))\n if not can_borrow:\n self.emit_inc_ref(dest, object_rprimitive)\n elif is_none_rprimitive(typ):\n # N.B: None is special cased to produce a borrowed value\n # after boxing, so we don't need to increment the refcount\n # when this comes directly from a Box op.\n self.emit_lines('{}{} = Py_None;'.format(declaration, dest))\n if not can_borrow:\n self.emit_inc_ref(dest, object_rprimitive)\n elif is_int32_rprimitive(typ):\n self.emit_line('{}{} = PyLong_FromLong({});'.format(declaration, dest, src))\n elif is_int64_rprimitive(typ):\n self.emit_line('{}{} = PyLong_FromLongLong({});'.format(declaration, dest, src))\n elif isinstance(typ, RTuple):\n self.declare_tuple_struct(typ)\n self.emit_line('{}{} = PyTuple_New({});'.format(declaration, dest, len(typ.types)))\n self.emit_line('if (unlikely({} == NULL))'.format(dest))\n self.emit_line(' CPyError_OutOfMemory();')\n # TODO: Fail if dest is None\n for i in range(0, len(typ.types)):\n if not typ.is_unboxed:\n self.emit_line('PyTuple_SET_ITEM({}, {}, {}.f{}'.format(dest, i, src, i))\n else:\n inner_name = self.temp_name()\n self.emit_box('{}.f{}'.format(src, i), inner_name, typ.types[i],\n declare_dest=True)\n self.emit_line('PyTuple_SET_ITEM({}, {}, {});'.format(dest, i, inner_name))\n else:\n assert not typ.is_unboxed\n # Type is boxed -- trivially just assign.\n self.emit_line('{}{} = {};'.format(declaration, dest, src))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.emit_error_check_Emitter.emit_error_check.self_emit_lines_failure_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.emit_error_check_Emitter.emit_error_check.self_emit_lines_failure_", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emit.py", "file_name": "emit.py", "file_type": "text/x-python", "category": "implementation", "start_line": 722, "end_line": 732, "span_ids": ["Emitter.emit_error_check"], "tokens": 149}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Emitter:\n\n def emit_error_check(self, value: str, rtype: RType, failure: str) -> None:\n \"\"\"Emit code for checking a native function return value for uncaught exception.\"\"\"\n if not isinstance(rtype, RTuple):\n self.emit_line('if ({} == {}) {{'.format(value, self.c_error_value(rtype)))\n else:\n if len(rtype.types) == 0:\n return # empty tuples can't fail.\n else:\n cond = self.tuple_undefined_check_cond(rtype, value, self.c_error_value, '==')\n self.emit_line('if ({}) {{'.format(cond))\n self.emit_lines(failure, '}')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.emit_gc_visit_Emitter.emit_gc_visit.if_not_rtype_is_refcounte.else_.assert_False_emit_gc_vi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.emit_gc_visit_Emitter.emit_gc_visit.if_not_rtype_is_refcounte.else_.assert_False_emit_gc_vi", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emit.py", "file_name": "emit.py", "file_type": "text/x-python", "category": "implementation", "start_line": 734, "end_line": 754, "span_ids": ["Emitter.emit_gc_visit"], "tokens": 253}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Emitter:\n\n def emit_gc_visit(self, target: str, rtype: RType) -> None:\n \"\"\"Emit code for GC visiting a C variable reference.\n\n Assume that 'target' represents a C expression that refers to a\n struct member, such as 'self->x'.\n \"\"\"\n if not rtype.is_refcounted:\n # Not refcounted -> no pointers -> no GC interaction.\n return\n elif isinstance(rtype, RPrimitive) and rtype.name == 'builtins.int':\n self.emit_line('if (CPyTagged_CheckLong({})) {{'.format(target))\n self.emit_line('Py_VISIT(CPyTagged_LongAsObject({}));'.format(target))\n self.emit_line('}')\n elif isinstance(rtype, RTuple):\n for i, item_type in enumerate(rtype.types):\n self.emit_gc_visit('{}.f{}'.format(target, i), item_type)\n elif self.ctype(rtype) == 'PyObject *':\n # The simplest case.\n self.emit_line('Py_VISIT({});'.format(target))\n else:\n assert False, 'emit_gc_visit() not implemented for %s' % repr(rtype)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.emit_gc_clear_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.emit_gc_clear_", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emit.py", "file_name": "emit.py", "file_type": "text/x-python", "category": "implementation", "start_line": 756, "end_line": 779, "span_ids": ["Emitter.emit_gc_clear"], "tokens": 298}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Emitter:\n\n def emit_gc_clear(self, target: str, rtype: RType) -> None:\n \"\"\"Emit code for clearing a C attribute reference for GC.\n\n Assume that 'target' represents a C expression that refers to a\n struct member, such as 'self->x'.\n \"\"\"\n if not rtype.is_refcounted:\n # Not refcounted -> no pointers -> no GC interaction.\n return\n elif isinstance(rtype, RPrimitive) and rtype.name == 'builtins.int':\n self.emit_line('if (CPyTagged_CheckLong({})) {{'.format(target))\n self.emit_line('CPyTagged __tmp = {};'.format(target))\n self.emit_line('{} = {};'.format(target, self.c_undefined_value(rtype)))\n self.emit_line('Py_XDECREF(CPyTagged_LongAsObject(__tmp));')\n self.emit_line('}')\n elif isinstance(rtype, RTuple):\n for i, item_type in enumerate(rtype.types):\n self.emit_gc_clear('{}.f{}'.format(target, i), item_type)\n elif self.ctype(rtype) == 'PyObject *' and self.c_undefined_value(rtype) == 'NULL':\n # The simplest case.\n self.emit_line('Py_CLEAR({});'.format(target))\n else:\n assert False, 'emit_gc_clear() not implemented for %s' % repr(rtype)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_slots_generate_slots.return.fields": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_slots_generate_slots.return.fields", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitclass.py", "file_name": "emitclass.py", "file_type": "text/x-python", "category": "implementation", "start_line": 74, "end_line": 82, "span_ids": ["generate_slots"], "tokens": 113}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_slots(cl: ClassIR, table: SlotTable, emitter: Emitter) -> Dict[str, str]:\n fields = OrderedDict() # type: Dict[str, str]\n # Sort for determinism on Python 3.5\n for name, (slot, generator) in sorted(table.items()):\n method_cls = cl.get_method_and_class(name)\n if method_cls and (method_cls[1] == cl or name in ALWAYS_FILL):\n fields[slot] = generator(cl, method_cls[0], emitter)\n\n return fields", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_class_type_decl_generate_class_type_decl.if_generate_full_.context_declarations_emit": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_class_type_decl_generate_class_type_decl.if_generate_full_.context_declarations_emit", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitclass.py", "file_name": "emitclass.py", "file_type": "text/x-python", "category": "implementation", "start_line": 85, "end_line": 104, "span_ids": ["generate_class_type_decl"], "tokens": 183}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_class_type_decl(cl: ClassIR, c_emitter: Emitter,\n external_emitter: Emitter,\n emitter: Emitter) -> None:\n context = c_emitter.context\n name = emitter.type_struct_name(cl)\n context.declarations[name] = HeaderDeclaration(\n 'PyTypeObject *{};'.format(emitter.type_struct_name(cl)),\n needs_export=True)\n\n # If this is a non-extension class, all we want is the type object decl.\n if not cl.is_ext_class:\n return\n\n generate_object_struct(cl, external_emitter)\n generate_full = not cl.is_trait and not cl.builtin_base\n if generate_full:\n context.declarations[emitter.native_function_name(cl.ctor)] = HeaderDeclaration(\n '{};'.format(native_function_header(cl.ctor, emitter)),\n needs_export=True,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_class_generate_class._XXX_there_is_no_reason": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_class_generate_class._XXX_there_is_no_reason", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitclass.py", "file_name": "emitclass.py", "file_type": "text/x-python", "category": "implementation", "start_line": 107, "end_line": 182, "span_ids": ["generate_class"], "tokens": 750}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_class(cl: ClassIR, module: str, emitter: Emitter) -> None:\n \"\"\"Generate C code for a class.\n\n This is the main entry point to the module.\n \"\"\"\n name = cl.name\n name_prefix = cl.name_prefix(emitter.names)\n\n setup_name = '{}_setup'.format(name_prefix)\n new_name = '{}_new'.format(name_prefix)\n members_name = '{}_members'.format(name_prefix)\n getseters_name = '{}_getseters'.format(name_prefix)\n vtable_name = '{}_vtable'.format(name_prefix)\n traverse_name = '{}_traverse'.format(name_prefix)\n clear_name = '{}_clear'.format(name_prefix)\n dealloc_name = '{}_dealloc'.format(name_prefix)\n methods_name = '{}_methods'.format(name_prefix)\n vtable_setup_name = '{}_trait_vtable_setup'.format(name_prefix)\n\n fields = OrderedDict() # type: Dict[str, str]\n fields['tp_name'] = '\"{}\"'.format(name)\n\n generate_full = not cl.is_trait and not cl.builtin_base\n needs_getseters = not cl.is_generated\n\n if not cl.builtin_base:\n fields['tp_new'] = new_name\n\n if generate_full:\n fields['tp_dealloc'] = '(destructor){}_dealloc'.format(name_prefix)\n fields['tp_traverse'] = '(traverseproc){}_traverse'.format(name_prefix)\n fields['tp_clear'] = '(inquiry){}_clear'.format(name_prefix)\n if needs_getseters:\n fields['tp_getset'] = getseters_name\n fields['tp_methods'] = methods_name\n\n def emit_line() -> None:\n emitter.emit_line()\n\n emit_line()\n\n # If the class has a method to initialize default attribute\n # values, we need to call it during initialization.\n defaults_fn = cl.get_method('__mypyc_defaults_setup')\n\n # If there is a __init__ method, we'll use it in the native constructor.\n init_fn = cl.get_method('__init__')\n\n # Fill out slots in the type object from dunder methods.\n fields.update(generate_slots(cl, SLOT_DEFS, emitter))\n\n # Fill out dunder methods that live in tables hanging off the side.\n for table_name, type, slot_defs in SIDE_TABLES:\n slots = generate_slots(cl, slot_defs, emitter)\n if slots:\n table_struct_name = generate_side_table_for_class(cl, table_name, type, slots, emitter)\n fields['tp_{}'.format(table_name)] = '&{}'.format(table_struct_name)\n\n richcompare_name = generate_richcompare_wrapper(cl, emitter)\n if richcompare_name:\n fields['tp_richcompare'] = richcompare_name\n\n # If the class inherits from python, make space for a __dict__\n struct_name = cl.struct_name(emitter.names)\n if cl.builtin_base:\n base_size = 'sizeof({})'.format(cl.builtin_base)\n elif cl.is_trait:\n base_size = 'sizeof(PyObject)'\n else:\n base_size = 'sizeof({})'.format(struct_name)\n # Since our types aren't allocated using type() we need to\n # populate these fields ourselves if we want them to have correct\n # values. PyType_Ready will inherit the offsets from tp_base but\n # that isn't what we want.\n\n # XXX: there is no reason for the __weakref__ stuff to be mixed up with __dict__\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_getter_name_generate_object_struct.emitter_context_declarati": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_getter_name_generate_object_struct.emitter_context_declarati", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitclass.py", "file_name": "emitclass.py", "file_type": "text/x-python", "category": "implementation", "start_line": 279, "end_line": 311, "span_ids": ["getter_name", "setter_name", "generate_object_struct"], "tokens": 312}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def getter_name(cl: ClassIR, attribute: str, names: NameGenerator) -> str:\n return names.private_name(cl.module_name, '{}_get{}'.format(cl.name, attribute))\n\n\ndef setter_name(cl: ClassIR, attribute: str, names: NameGenerator) -> str:\n return names.private_name(cl.module_name, '{}_set{}'.format(cl.name, attribute))\n\n\ndef generate_object_struct(cl: ClassIR, emitter: Emitter) -> None:\n seen_attrs = set() # type: Set[Tuple[str, RType]]\n lines = [] # type: List[str]\n lines += ['typedef struct {',\n 'PyObject_HEAD',\n 'CPyVTableItem *vtable;']\n if cl.has_method('__call__') and emitter.use_vectorcall():\n lines.append('vectorcallfunc vectorcall;')\n for base in reversed(cl.base_mro):\n if not base.is_trait:\n for attr, rtype in base.attributes.items():\n if (attr, rtype) not in seen_attrs:\n lines.append('{}{};'.format(emitter.ctype_spaced(rtype),\n emitter.attr(attr)))\n seen_attrs.add((attr, rtype))\n\n if isinstance(rtype, RTuple):\n emitter.declare_tuple_struct(rtype)\n\n lines.append('}} {};'.format(cl.struct_name(emitter.names)))\n lines.append('')\n emitter.context.declarations[cl.struct_name(emitter.names)] = HeaderDeclaration(\n lines,\n is_type=True\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_vtables_generate_vtables.return.vtable_name_if_not_subtab": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_vtables_generate_vtables.return.vtable_name_if_not_subtab", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitclass.py", "file_name": "emitclass.py", "file_type": "text/x-python", "category": "implementation", "start_line": 299, "end_line": 379, "span_ids": ["generate_vtables"], "tokens": 789}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_vtables(base: ClassIR,\n vtable_setup_name: str,\n vtable_name: str,\n emitter: Emitter,\n shadow: bool) -> str:\n \"\"\"Emit the vtables and vtable setup functions for a class.\n\n This includes both the primary vtable and any trait implementation vtables.\n The trait vtables go before the main vtable, and have the following layout:\n {\n CPyType_T1, // pointer to type object\n C_T1_trait_vtable, // pointer to array of method pointers\n C_T1_offset_table, // pointer to array of attribute offsets\n CPyType_T2,\n C_T2_trait_vtable,\n C_T2_offset_table,\n ...\n }\n The method implementations are calculated at the end of IR pass, attribute\n offsets are {offsetof(native__C, _x1), offsetof(native__C, _y1), ...}.\n\n To account for both dynamic loading and dynamic class creation,\n vtables are populated dynamically at class creation time, so we\n emit empty array definitions to store the vtables and a function to\n populate them.\n\n If shadow is True, generate \"shadow vtables\" that point to the\n shadow glue methods (which should dispatch via the Python C-API).\n\n Returns the expression to use to refer to the vtable, which might be\n different than the name, if there are trait vtables.\n \"\"\"\n\n def trait_vtable_name(trait: ClassIR) -> str:\n return '{}_{}_trait_vtable{}'.format(\n base.name_prefix(emitter.names), trait.name_prefix(emitter.names),\n '_shadow' if shadow else '')\n\n def trait_offset_table_name(trait: ClassIR) -> str:\n return '{}_{}_offset_table'.format(\n base.name_prefix(emitter.names), trait.name_prefix(emitter.names)\n )\n\n # Emit array definitions with enough space for all the entries\n emitter.emit_line('static CPyVTableItem {}[{}];'.format(\n vtable_name,\n max(1, len(base.vtable_entries) + 3 * len(base.trait_vtables))))\n\n for trait, vtable in base.trait_vtables.items():\n # Trait methods entry (vtable index -> method implementation).\n emitter.emit_line('static CPyVTableItem {}[{}];'.format(\n trait_vtable_name(trait),\n max(1, len(vtable))))\n # Trait attributes entry (attribute number in trait -> offset in actual struct).\n emitter.emit_line('static size_t {}[{}];'.format(\n trait_offset_table_name(trait),\n max(1, len(trait.attributes)))\n )\n\n # Emit vtable setup function\n emitter.emit_line('static bool')\n emitter.emit_line('{}{}(void)'.format(NATIVE_PREFIX, vtable_setup_name))\n emitter.emit_line('{')\n\n if base.allow_interpreted_subclasses and not shadow:\n emitter.emit_line('{}{}_shadow();'.format(NATIVE_PREFIX, vtable_setup_name))\n\n subtables = []\n for trait, vtable in base.trait_vtables.items():\n name = trait_vtable_name(trait)\n offset_name = trait_offset_table_name(trait)\n generate_vtable(vtable, name, emitter, [], shadow)\n generate_offset_table(offset_name, emitter, trait, base)\n subtables.append((trait, name, offset_name))\n\n generate_vtable(base.vtable_entries, vtable_name, emitter, subtables, shadow)\n\n emitter.emit_line('return 1;')\n emitter.emit_line('}')\n\n return vtable_name if not subtables else \"{} + {}\".format(vtable_name, len(subtables) * 3)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_offset_table_generate_offset_table.emitter_emit_line_memcpy": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_offset_table_generate_offset_table.emitter_emit_line_memcpy", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitclass.py", "file_name": "emitclass.py", "file_type": "text/x-python", "category": "implementation", "start_line": 382, "end_line": 398, "span_ids": ["generate_offset_table"], "tokens": 159}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_offset_table(trait_offset_table_name: str,\n emitter: Emitter,\n trait: ClassIR,\n cl: ClassIR) -> None:\n \"\"\"Generate attribute offset row of a trait vtable.\"\"\"\n emitter.emit_line('size_t {}_scratch[] = {{'.format(trait_offset_table_name))\n for attr in trait.attributes:\n emitter.emit_line('offsetof({}, {}),'.format(\n cl.struct_name(emitter.names), emitter.attr(attr)\n ))\n if not trait.attributes:\n # This is for msvc.\n emitter.emit_line('0')\n emitter.emit_line('};')\n emitter.emit_line('memcpy({name}, {name}_scratch, sizeof({name}));'.format(\n name=trait_offset_table_name)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_vtable_generate_vtable.emitter_emit_line_memcpy": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_vtable_generate_vtable.emitter_emit_line_memcpy", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitclass.py", "file_name": "emitclass.py", "file_type": "text/x-python", "category": "implementation", "start_line": 401, "end_line": 426, "span_ids": ["generate_vtable"], "tokens": 283}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_vtable(entries: VTableEntries,\n vtable_name: str,\n emitter: Emitter,\n subtables: List[Tuple[ClassIR, str, str]],\n shadow: bool) -> None:\n emitter.emit_line('CPyVTableItem {}_scratch[] = {{'.format(vtable_name))\n if subtables:\n emitter.emit_line('/* Array of trait vtables */')\n for trait, table, offset_table in subtables:\n emitter.emit_line(\n '(CPyVTableItem){}, (CPyVTableItem){}, (CPyVTableItem){},'.format(\n emitter.type_struct_name(trait), table, offset_table))\n emitter.emit_line('/* Start of real vtable */')\n\n for entry in entries:\n method = entry.shadow_method if shadow and entry.shadow_method else entry.method\n emitter.emit_line('(CPyVTableItem){}{}{},'.format(\n emitter.get_group_prefix(entry.method.decl),\n NATIVE_PREFIX,\n method.cname(emitter.names)))\n\n # msvc doesn't allow empty arrays; maybe allowing them at all is an extension?\n if not entries:\n emitter.emit_line('NULL')\n emitter.emit_line('};')\n emitter.emit_line('memcpy({name}, {name}_scratch, sizeof({name}));'.format(name=vtable_name))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_setup_for_class_generate_setup_for_class.None_8": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_setup_for_class_generate_setup_for_class.None_8", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitclass.py", "file_name": "emitclass.py", "file_type": "text/x-python", "category": "implementation", "start_line": 444, "end_line": 488, "span_ids": ["generate_setup_for_class"], "tokens": 452}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_setup_for_class(cl: ClassIR,\n func_name: str,\n defaults_fn: Optional[FuncIR],\n vtable_name: str,\n shadow_vtable_name: Optional[str],\n emitter: Emitter) -> None:\n \"\"\"Generate a native function that allocates an instance of a class.\"\"\"\n emitter.emit_line('static PyObject *')\n emitter.emit_line('{}(PyTypeObject *type)'.format(func_name))\n emitter.emit_line('{')\n emitter.emit_line('{} *self;'.format(cl.struct_name(emitter.names)))\n emitter.emit_line('self = ({struct} *)type->tp_alloc(type, 0);'.format(\n struct=cl.struct_name(emitter.names)))\n emitter.emit_line('if (self == NULL)')\n emitter.emit_line(' return NULL;')\n\n if shadow_vtable_name:\n emitter.emit_line('if (type != {}) {{'.format(emitter.type_struct_name(cl)))\n emitter.emit_line('self->vtable = {};'.format(shadow_vtable_name))\n emitter.emit_line('} else {')\n emitter.emit_line('self->vtable = {};'.format(vtable_name))\n emitter.emit_line('}')\n else:\n emitter.emit_line('self->vtable = {};'.format(vtable_name))\n\n if cl.has_method('__call__') and emitter.use_vectorcall():\n name = cl.method_decl('__call__').cname(emitter.names)\n emitter.emit_line('self->vectorcall = {}{};'.format(PREFIX, name))\n\n for base in reversed(cl.base_mro):\n for attr, rtype in base.attributes.items():\n emitter.emit_line('self->{} = {};'.format(\n emitter.attr(attr), emitter.c_undefined_value(rtype)))\n\n # Initialize attributes to default values, if necessary\n if defaults_fn is not None:\n emitter.emit_lines(\n 'if ({}{}((PyObject *)self) == 0) {{'.format(\n NATIVE_PREFIX, defaults_fn.cname(emitter.names)),\n 'Py_DECREF(self);',\n 'return NULL;',\n '}')\n\n emitter.emit_line('return (PyObject *)self;')\n emitter.emit_line('}')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_constructor_for_class_generate_constructor_for_class.None_6": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_constructor_for_class_generate_constructor_for_class.None_6", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitclass.py", "file_name": "emitclass.py", "file_type": "text/x-python", "category": "implementation", "start_line": 472, "end_line": 507, "span_ids": ["generate_constructor_for_class"], "tokens": 357}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_constructor_for_class(cl: ClassIR,\n fn: FuncDecl,\n init_fn: Optional[FuncIR],\n setup_name: str,\n vtable_name: str,\n emitter: Emitter) -> None:\n \"\"\"Generate a native function that allocates and initializes an instance of a class.\"\"\"\n emitter.emit_line('{}'.format(native_function_header(fn, emitter)))\n emitter.emit_line('{')\n emitter.emit_line('PyObject *self = {}({});'.format(setup_name, emitter.type_struct_name(cl)))\n emitter.emit_line('if (self == NULL)')\n emitter.emit_line(' return NULL;')\n args = ', '.join(['self'] + [REG_PREFIX + arg.name for arg in fn.sig.args])\n if init_fn is not None:\n emitter.emit_line('char res = {}{}{}({});'.format(\n emitter.get_group_prefix(init_fn.decl),\n NATIVE_PREFIX, init_fn.cname(emitter.names), args))\n emitter.emit_line('if (res == 2) {')\n emitter.emit_line('Py_DECREF(self);')\n emitter.emit_line('return NULL;')\n emitter.emit_line('}')\n\n # If there is a nontrivial ctor that we didn't define, invoke it via tp_init\n elif len(fn.sig.args) > 1:\n emitter.emit_line(\n 'int res = {}->tp_init({});'.format(\n emitter.type_struct_name(cl),\n args))\n\n emitter.emit_line('if (res < 0) {')\n emitter.emit_line('Py_DECREF(self);')\n emitter.emit_line('return NULL;')\n emitter.emit_line('}')\n\n emitter.emit_line('return self;')\n emitter.emit_line('}')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_init_for_class_generate_init_for_class.return.func_name": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_init_for_class_generate_init_for_class.return.func_name", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitclass.py", "file_name": "emitclass.py", "file_type": "text/x-python", "category": "implementation", "start_line": 510, "end_line": 529, "span_ids": ["generate_init_for_class"], "tokens": 184}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_init_for_class(cl: ClassIR,\n init_fn: FuncIR,\n emitter: Emitter) -> str:\n \"\"\"Generate an init function suitable for use as tp_init.\n\n tp_init needs to be a function that returns an int, and our\n __init__ methods return a PyObject. Translate NULL to -1,\n everything else to 0.\n \"\"\"\n func_name = '{}_init'.format(cl.name_prefix(emitter.names))\n\n emitter.emit_line('static int')\n emitter.emit_line(\n '{}(PyObject *self, PyObject *args, PyObject *kwds)'.format(func_name))\n emitter.emit_line('{')\n emitter.emit_line('return {}{}(self, args, kwds) != NULL ? 0 : -1;'.format(\n PREFIX, init_fn.cname(emitter.names)))\n emitter.emit_line('}')\n\n return func_name", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_new_for_class_generate_new_for_class.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_new_for_class_generate_new_for_class.None_4", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitclass.py", "file_name": "emitclass.py", "file_type": "text/x-python", "category": "implementation", "start_line": 532, "end_line": 551, "span_ids": ["generate_new_for_class"], "tokens": 186}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_new_for_class(cl: ClassIR,\n func_name: str,\n vtable_name: str,\n setup_name: str,\n emitter: Emitter) -> None:\n emitter.emit_line('static PyObject *')\n emitter.emit_line(\n '{}(PyTypeObject *type, PyObject *args, PyObject *kwds)'.format(func_name))\n emitter.emit_line('{')\n # TODO: Check and unbox arguments\n if not cl.allow_interpreted_subclasses:\n emitter.emit_line('if (type != {}) {{'.format(emitter.type_struct_name(cl)))\n emitter.emit_line(\n 'PyErr_SetString(PyExc_TypeError, \"interpreted classes cannot inherit from compiled\");'\n )\n emitter.emit_line('return NULL;')\n emitter.emit_line('}')\n\n emitter.emit_line('return {}(type);'.format(setup_name))\n emitter.emit_line('}')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_new_for_trait_generate_new_for_trait.None_9": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_new_for_trait_generate_new_for_trait.None_9", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitclass.py", "file_name": "emitclass.py", "file_type": "text/x-python", "category": "implementation", "start_line": 554, "end_line": 572, "span_ids": ["generate_new_for_trait"], "tokens": 175}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_new_for_trait(cl: ClassIR,\n func_name: str,\n emitter: Emitter) -> None:\n emitter.emit_line('static PyObject *')\n emitter.emit_line(\n '{}(PyTypeObject *type, PyObject *args, PyObject *kwds)'.format(func_name))\n emitter.emit_line('{')\n emitter.emit_line('if (type != {}) {{'.format(emitter.type_struct_name(cl)))\n emitter.emit_line(\n 'PyErr_SetString(PyExc_TypeError, '\n '\"interpreted classes cannot inherit from compiled traits\");'\n )\n emitter.emit_line('} else {')\n emitter.emit_line(\n 'PyErr_SetString(PyExc_TypeError, \"traits may not be directly created\");'\n )\n emitter.emit_line('}')\n emitter.emit_line('return NULL;')\n emitter.emit_line('}')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_traverse_for_class_generate_traverse_for_class.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_traverse_for_class_generate_traverse_for_class.None_4", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitclass.py", "file_name": "emitclass.py", "file_type": "text/x-python", "category": "implementation", "start_line": 575, "end_line": 597, "span_ids": ["generate_traverse_for_class"], "tokens": 244}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_traverse_for_class(cl: ClassIR,\n func_name: str,\n emitter: Emitter) -> None:\n \"\"\"Emit function that performs cycle GC traversal of an instance.\"\"\"\n emitter.emit_line('static int')\n emitter.emit_line('{}({} *self, visitproc visit, void *arg)'.format(\n func_name,\n cl.struct_name(emitter.names)))\n emitter.emit_line('{')\n for base in reversed(cl.base_mro):\n for attr, rtype in base.attributes.items():\n emitter.emit_gc_visit('self->{}'.format(emitter.attr(attr)), rtype)\n if cl.has_dict:\n struct_name = cl.struct_name(emitter.names)\n # __dict__ lives right after the struct and __weakref__ lives right after that\n emitter.emit_gc_visit('*((PyObject **)((char *)self + sizeof({})))'.format(\n struct_name), object_rprimitive)\n emitter.emit_gc_visit(\n '*((PyObject **)((char *)self + sizeof(PyObject *) + sizeof({})))'.format(\n struct_name),\n object_rprimitive)\n emitter.emit_line('return 0;')\n emitter.emit_line('}')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_clear_for_class_generate_clear_for_class.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_clear_for_class_generate_clear_for_class.None_4", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitclass.py", "file_name": "emitclass.py", "file_type": "text/x-python", "category": "implementation", "start_line": 600, "end_line": 619, "span_ids": ["generate_clear_for_class"], "tokens": 218}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_clear_for_class(cl: ClassIR,\n func_name: str,\n emitter: Emitter) -> None:\n emitter.emit_line('static int')\n emitter.emit_line('{}({} *self)'.format(func_name, cl.struct_name(emitter.names)))\n emitter.emit_line('{')\n for base in reversed(cl.base_mro):\n for attr, rtype in base.attributes.items():\n emitter.emit_gc_clear('self->{}'.format(emitter.attr(attr)), rtype)\n if cl.has_dict:\n struct_name = cl.struct_name(emitter.names)\n # __dict__ lives right after the struct and __weakref__ lives right after that\n emitter.emit_gc_clear('*((PyObject **)((char *)self + sizeof({})))'.format(\n struct_name), object_rprimitive)\n emitter.emit_gc_clear(\n '*((PyObject **)((char *)self + sizeof(PyObject *) + sizeof({})))'.format(\n struct_name),\n object_rprimitive)\n emitter.emit_line('return 0;')\n emitter.emit_line('}')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_methods_table_generate_methods_table.emitter_emit_line_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_methods_table_generate_methods_table.emitter_emit_line_", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitclass.py", "file_name": "emitclass.py", "file_type": "text/x-python", "category": "implementation", "start_line": 657, "end_line": 686, "span_ids": ["generate_methods_table"], "tokens": 312}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_methods_table(cl: ClassIR,\n name: str,\n emitter: Emitter) -> None:\n emitter.emit_line('static PyMethodDef {}[] = {{'.format(name))\n for fn in cl.methods.values():\n if fn.decl.is_prop_setter or fn.decl.is_prop_getter:\n continue\n emitter.emit_line('{{\"{}\",'.format(fn.name))\n emitter.emit_line(' (PyCFunction){}{},'.format(PREFIX, fn.cname(emitter.names)))\n if use_fastcall(emitter.capi_version):\n flags = ['METH_FASTCALL']\n else:\n flags = ['METH_VARARGS']\n flags.append('METH_KEYWORDS')\n if fn.decl.kind == FUNC_STATICMETHOD:\n flags.append('METH_STATIC')\n elif fn.decl.kind == FUNC_CLASSMETHOD:\n flags.append('METH_CLASS')\n\n emitter.emit_line(' {}, NULL}},'.format(' | '.join(flags)))\n\n # Provide a default __getstate__ and __setstate__\n if not cl.has_method('__setstate__') and not cl.has_method('__getstate__'):\n emitter.emit_lines(\n '{\"__setstate__\", (PyCFunction)CPyPickle_SetState, METH_O, NULL},',\n '{\"__getstate__\", (PyCFunction)CPyPickle_GetState, METH_NOARGS, NULL},',\n )\n\n emitter.emit_line('{NULL} /* Sentinel */')\n emitter.emit_line('};')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_side_table_for_class_generate_side_table_for_class.return.name": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_side_table_for_class_generate_side_table_for_class.return.name", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitclass.py", "file_name": "emitclass.py", "file_type": "text/x-python", "category": "implementation", "start_line": 663, "end_line": 673, "span_ids": ["generate_side_table_for_class"], "tokens": 105}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_side_table_for_class(cl: ClassIR,\n name: str,\n type: str,\n slots: Dict[str, str],\n emitter: Emitter) -> Optional[str]:\n name = '{}_{}'.format(cl.name_prefix(emitter.names), name)\n emitter.emit_line('static {} {} = {{'.format(type, name))\n for field, value in slots.items():\n emitter.emit_line(\".{} = {},\".format(field, value))\n emitter.emit_line(\"};\")\n return name", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_getseter_declarations_generate_getseter_declarations.for_prop_in_cl_properties.if_cl_properties_prop_1_.emitter_emit_line_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_getseter_declarations_generate_getseter_declarations.for_prop_in_cl_properties.if_cl_properties_prop_1_.emitter_emit_line_", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitclass.py", "file_name": "emitclass.py", "file_type": "text/x-python", "category": "implementation", "start_line": 676, "end_line": 700, "span_ids": ["generate_getseter_declarations"], "tokens": 248}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_getseter_declarations(cl: ClassIR, emitter: Emitter) -> None:\n if not cl.is_trait:\n for attr in cl.attributes:\n emitter.emit_line('static PyObject *')\n emitter.emit_line('{}({} *self, void *closure);'.format(\n getter_name(cl, attr, emitter.names),\n cl.struct_name(emitter.names)))\n emitter.emit_line('static int')\n emitter.emit_line('{}({} *self, PyObject *value, void *closure);'.format(\n setter_name(cl, attr, emitter.names),\n cl.struct_name(emitter.names)))\n\n for prop in cl.properties:\n # Generate getter declaration\n emitter.emit_line('static PyObject *')\n emitter.emit_line('{}({} *self, void *closure);'.format(\n getter_name(cl, prop, emitter.names),\n cl.struct_name(emitter.names)))\n\n # Generate property setter declaration if a setter exists\n if cl.properties[prop][1]:\n emitter.emit_line('static int')\n emitter.emit_line('{}({} *self, PyObject *value, void *closure);'.format(\n setter_name(cl, prop, emitter.names),\n cl.struct_name(emitter.names)))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_getseters_table_generate_getseters_table.emitter_emit_line_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_getseters_table_generate_getseters_table.emitter_emit_line_", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitclass.py", "file_name": "emitclass.py", "file_type": "text/x-python", "category": "implementation", "start_line": 703, "end_line": 725, "span_ids": ["generate_getseters_table"], "tokens": 230}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_getseters_table(cl: ClassIR,\n name: str,\n emitter: Emitter) -> None:\n emitter.emit_line('static PyGetSetDef {}[] = {{'.format(name))\n if not cl.is_trait:\n for attr in cl.attributes:\n emitter.emit_line('{{\"{}\",'.format(attr))\n emitter.emit_line(' (getter){}, (setter){},'.format(\n getter_name(cl, attr, emitter.names), setter_name(cl, attr, emitter.names)))\n emitter.emit_line(' NULL, NULL},')\n for prop in cl.properties:\n emitter.emit_line('{{\"{}\",'.format(prop))\n emitter.emit_line(' (getter){},'.format(getter_name(cl, prop, emitter.names)))\n\n setter = cl.properties[prop][1]\n if setter:\n emitter.emit_line(' (setter){},'.format(setter_name(cl, prop, emitter.names)))\n emitter.emit_line('NULL, NULL},')\n else:\n emitter.emit_line('NULL, NULL, NULL},')\n\n emitter.emit_line('{NULL} /* Sentinel */')\n emitter.emit_line('};')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_getseters_generate_getseters.for_prop_getter_setter.if_setter_.generate_property_setter_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_getseters_generate_getseters.for_prop_getter_setter.if_setter_.generate_property_setter_", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitclass.py", "file_name": "emitclass.py", "file_type": "text/x-python", "category": "implementation", "start_line": 728, "end_line": 743, "span_ids": ["generate_getseters"], "tokens": 171}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_getseters(cl: ClassIR, emitter: Emitter) -> None:\n if not cl.is_trait:\n for i, (attr, rtype) in enumerate(cl.attributes.items()):\n generate_getter(cl, attr, rtype, emitter)\n emitter.emit_line('')\n generate_setter(cl, attr, rtype, emitter)\n if i < len(cl.attributes) - 1:\n emitter.emit_line('')\n for prop, (getter, setter) in cl.properties.items():\n rtype = getter.sig.ret_type\n emitter.emit_line('')\n generate_readonly_getter(cl, prop, rtype, getter, emitter)\n if setter:\n arg_type = setter.sig.args[1].type\n emitter.emit_line('')\n generate_property_setter(cl, prop, arg_type, setter, emitter)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_getter_generate_getter.None_11": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_getter_generate_getter.None_11", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitclass.py", "file_name": "emitclass.py", "file_type": "text/x-python", "category": "implementation", "start_line": 746, "end_line": 765, "span_ids": ["generate_getter"], "tokens": 226}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_getter(cl: ClassIR,\n attr: str,\n rtype: RType,\n emitter: Emitter) -> None:\n attr_field = emitter.attr(attr)\n emitter.emit_line('static PyObject *')\n emitter.emit_line('{}({} *self, void *closure)'.format(getter_name(cl, attr, emitter.names),\n cl.struct_name(emitter.names)))\n emitter.emit_line('{')\n attr_expr = 'self->{}'.format(attr_field)\n emitter.emit_undefined_attr_check(rtype, attr_expr, '==', unlikely=True)\n emitter.emit_line('PyErr_SetString(PyExc_AttributeError,')\n emitter.emit_line(' \"attribute {} of {} undefined\");'.format(repr(attr),\n repr(cl.name)))\n emitter.emit_line('return NULL;')\n emitter.emit_line('}')\n emitter.emit_inc_ref('self->{}'.format(attr_field), rtype)\n emitter.emit_box('self->{}'.format(attr_field), 'retval', rtype, declare_dest=True)\n emitter.emit_line('return retval;')\n emitter.emit_line('}')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_setter_generate_setter.None_9": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_setter_generate_setter.None_9", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitclass.py", "file_name": "emitclass.py", "file_type": "text/x-python", "category": "implementation", "start_line": 768, "end_line": 797, "span_ids": ["generate_setter"], "tokens": 332}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_setter(cl: ClassIR,\n attr: str,\n rtype: RType,\n emitter: Emitter) -> None:\n attr_field = emitter.attr(attr)\n emitter.emit_line('static int')\n emitter.emit_line('{}({} *self, PyObject *value, void *closure)'.format(\n setter_name(cl, attr, emitter.names),\n cl.struct_name(emitter.names)))\n emitter.emit_line('{')\n if rtype.is_refcounted:\n attr_expr = 'self->{}'.format(attr_field)\n emitter.emit_undefined_attr_check(rtype, attr_expr, '!=')\n emitter.emit_dec_ref('self->{}'.format(attr_field), rtype)\n emitter.emit_line('}')\n emitter.emit_line('if (value != NULL) {')\n if rtype.is_unboxed:\n emitter.emit_unbox('value', 'tmp', rtype, custom_failure='return -1;', declare_dest=True)\n elif is_same_type(rtype, object_rprimitive):\n emitter.emit_line('PyObject *tmp = value;')\n else:\n emitter.emit_cast('value', 'tmp', rtype, declare_dest=True)\n emitter.emit_lines('if (!tmp)',\n ' return -1;')\n emitter.emit_inc_ref('tmp', rtype)\n emitter.emit_line('self->{} = tmp;'.format(attr_field))\n emitter.emit_line('} else')\n emitter.emit_line(' self->{} = {};'.format(attr_field, emitter.c_undefined_value(rtype)))\n emitter.emit_line('return 0;')\n emitter.emit_line('}')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_readonly_getter_generate_readonly_getter.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_readonly_getter_generate_readonly_getter.None_3", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitclass.py", "file_name": "emitclass.py", "file_type": "text/x-python", "category": "implementation", "start_line": 800, "end_line": 817, "span_ids": ["generate_readonly_getter"], "tokens": 199}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_readonly_getter(cl: ClassIR,\n attr: str,\n rtype: RType,\n func_ir: FuncIR,\n emitter: Emitter) -> None:\n emitter.emit_line('static PyObject *')\n emitter.emit_line('{}({} *self, void *closure)'.format(getter_name(cl, attr, emitter.names),\n cl.struct_name(emitter.names)))\n emitter.emit_line('{')\n if rtype.is_unboxed:\n emitter.emit_line('{}retval = {}{}((PyObject *) self);'.format(\n emitter.ctype_spaced(rtype), NATIVE_PREFIX, func_ir.cname(emitter.names)))\n emitter.emit_box('retval', 'retbox', rtype, declare_dest=True)\n emitter.emit_line('return retbox;')\n else:\n emitter.emit_line('return {}{}((PyObject *) self);'.format(NATIVE_PREFIX,\n func_ir.cname(emitter.names)))\n emitter.emit_line('}')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_property_setter_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_property_setter_", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitclass.py", "file_name": "emitclass.py", "file_type": "text/x-python", "category": "implementation", "start_line": 820, "end_line": 843, "span_ids": ["generate_property_setter"], "tokens": 204}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_property_setter(cl: ClassIR,\n attr: str,\n arg_type: RType,\n func_ir: FuncIR,\n emitter: Emitter) -> None:\n\n emitter.emit_line('static int')\n emitter.emit_line('{}({} *self, PyObject *value, void *closure)'.format(\n setter_name(cl, attr, emitter.names),\n cl.struct_name(emitter.names)))\n emitter.emit_line('{')\n if arg_type.is_unboxed:\n emitter.emit_unbox('value', 'tmp', arg_type, custom_failure='return -1;',\n declare_dest=True)\n emitter.emit_line('{}{}((PyObject *) self, tmp);'.format(\n NATIVE_PREFIX,\n func_ir.cname(emitter.names)))\n else:\n emitter.emit_line('{}{}((PyObject *) self, value);'.format(\n NATIVE_PREFIX,\n func_ir.cname(emitter.names)))\n emitter.emit_line('return 0;')\n emitter.emit_line('}')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py__Code_generation_for_na_native_function_header.return._ret_type_name_args_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py__Code_generation_for_na_native_function_header.return._ret_type_name_args_", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitfunc.py", "file_name": "emitfunc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 44, "span_ids": ["native_function_header", "native_function_type", "docstring"], "tokens": 478}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Code generation for native function bodies.\"\"\"\n\nfrom typing import Union, Optional\nfrom typing_extensions import Final\n\nfrom mypyc.common import (\n REG_PREFIX, NATIVE_PREFIX, STATIC_PREFIX, TYPE_PREFIX, MODULE_PREFIX,\n)\nfrom mypyc.codegen.emit import Emitter\nfrom mypyc.ir.ops import (\n OpVisitor, Goto, Branch, Return, Assign, Integer, LoadErrorValue, GetAttr, SetAttr,\n LoadStatic, InitStatic, TupleGet, TupleSet, Call, IncRef, DecRef, Box, Cast, Unbox,\n BasicBlock, Value, MethodCall, Unreachable, NAMESPACE_STATIC, NAMESPACE_TYPE, NAMESPACE_MODULE,\n RaiseStandardError, CallC, LoadGlobal, Truncate, IntOp, LoadMem, GetElementPtr,\n LoadAddress, ComparisonOp, SetMem, Register, LoadLiteral, AssignMulti, KeepAlive\n)\nfrom mypyc.ir.rtypes import (\n RType, RTuple, RArray, is_tagged, is_int32_rprimitive, is_int64_rprimitive, RStruct,\n is_pointer_rprimitive, is_int_rprimitive\n)\nfrom mypyc.ir.func_ir import FuncIR, FuncDecl, FUNC_STATICMETHOD, FUNC_CLASSMETHOD, all_values\nfrom mypyc.ir.class_ir import ClassIR\nfrom mypyc.ir.pprint import generate_names_for_ir\n\n# Whether to insert debug asserts for all error handling, to quickly\n# catch errors propagating without exceptions set.\nDEBUG_ERRORS = False\n\n\ndef native_function_type(fn: FuncIR, emitter: Emitter) -> str:\n args = ', '.join(emitter.ctype(arg.type) for arg in fn.args) or 'void'\n ret = emitter.ctype(fn.ret_type)\n return '{} (*)({})'.format(ret, args)\n\n\ndef native_function_header(fn: FuncDecl, emitter: Emitter) -> str:\n args = []\n for arg in fn.sig.args:\n args.append('{}{}{}'.format(emitter.ctype_spaced(arg.type), REG_PREFIX, arg.name))\n\n return '{ret_type}{name}({args})'.format(\n ret_type=emitter.ctype_spaced(fn.sig.ret_type),\n name=emitter.native_function_name(fn),\n args=', '.join(args) or 'void')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_generate_native_function_generate_native_function.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_generate_native_function_generate_native_function.None_4", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitfunc.py", "file_name": "emitfunc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 47, "end_line": 93, "span_ids": ["generate_native_function"], "tokens": 345}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_native_function(fn: FuncIR,\n emitter: Emitter,\n source_path: str,\n module_name: str) -> None:\n declarations = Emitter(emitter.context)\n names = generate_names_for_ir(fn.arg_regs, fn.blocks)\n body = Emitter(emitter.context, names)\n visitor = FunctionEmitterVisitor(body, declarations, source_path, module_name)\n\n declarations.emit_line('{} {{'.format(native_function_header(fn.decl, emitter)))\n body.indent()\n\n for r in all_values(fn.arg_regs, fn.blocks):\n if isinstance(r.type, RTuple):\n emitter.declare_tuple_struct(r.type)\n if isinstance(r.type, RArray):\n continue # Special: declared on first assignment\n\n if r in fn.arg_regs:\n continue # Skip the arguments\n\n ctype = emitter.ctype_spaced(r.type)\n init = ''\n declarations.emit_line('{ctype}{prefix}{name}{init};'.format(ctype=ctype,\n prefix=REG_PREFIX,\n name=names[r],\n init=init))\n\n # Before we emit the blocks, give them all labels\n blocks = fn.blocks\n for i, block in enumerate(blocks):\n block.label = i\n\n for i in range(len(blocks)):\n block = blocks[i]\n next_block = None\n if i + 1 < len(blocks):\n next_block = blocks[i + 1]\n body.emit_label(block)\n visitor.next_block = next_block\n for op in block.ops:\n op.accept(visitor)\n\n body.emit_line('}')\n\n emitter.emit_from_emitter(declarations)\n emitter.emit_from_emitter(body)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.get_attr_expr_FunctionEmitterVisitor.get_attr_expr.if_decl_cl_is_trait_and_o.else_.return._format_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.get_attr_expr_FunctionEmitterVisitor.get_attr_expr.if_decl_cl_is_trait_and_o.else_.return._format_", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitfunc.py", "file_name": "emitfunc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 176, "end_line": 210, "span_ids": ["FunctionEmitterVisitor.get_attr_expr"], "tokens": 423}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FunctionEmitterVisitor(OpVisitor[None]):\n\n def get_attr_expr(self, obj: str, op: Union[GetAttr, SetAttr], decl_cl: ClassIR) -> str:\n \"\"\"Generate attribute accessor for normal (non-property) access.\n\n This either has a form like obj->attr_name for attributes defined in non-trait\n classes, and *(obj + attr_offset) for attributes defined by traits. We also\n insert all necessary C casts here.\n \"\"\"\n cast = '({} *)'.format(op.class_type.struct_name(self.emitter.names))\n if decl_cl.is_trait and op.class_type.class_ir.is_trait:\n # For pure trait access find the offset first, offsets\n # are ordered by attribute position in the cl.attributes dict.\n # TODO: pre-calculate the mapping to make this faster.\n trait_attr_index = list(decl_cl.attributes).index(op.attr)\n # TODO: reuse these names somehow?\n offset = self.emitter.temp_name()\n self.declarations.emit_line('size_t {};'.format(offset))\n self.emitter.emit_line('{} = {};'.format(\n offset,\n 'CPy_FindAttrOffset({}, {}, {})'.format(\n self.emitter.type_struct_name(decl_cl),\n '({}{})->vtable'.format(cast, obj),\n trait_attr_index,\n )\n ))\n attr_cast = '({} *)'.format(self.ctype(op.class_type.attr_type(op.attr)))\n return '*{}((char *){} + {})'.format(attr_cast, obj, offset)\n else:\n # Cast to something non-trait. Note: for this to work, all struct\n # members for non-trait classes must obey monotonic linear growth.\n if op.class_type.class_ir.is_trait:\n assert not decl_cl.is_trait\n cast = '({} *)'.format(decl_cl.struct_name(self.emitter.names))\n return '({}{})->{}'.format(\n cast, obj, self.emitter.attr(op.attr)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.visit_get_attr_FunctionEmitterVisitor.visit_get_attr.if_cl_get_method_op_attr_.else_.if_attr_rtype_is_refcount.self_emitter_emit_line_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.visit_get_attr_FunctionEmitterVisitor.visit_get_attr.if_cl_get_method_op_attr_.else_.if_attr_rtype_is_refcount.self_emitter_emit_line_", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitfunc.py", "file_name": "emitfunc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 212, "end_line": 244, "span_ids": ["FunctionEmitterVisitor.visit_get_attr"], "tokens": 348}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FunctionEmitterVisitor(OpVisitor[None]):\n\n def visit_get_attr(self, op: GetAttr) -> None:\n dest = self.reg(op)\n obj = self.reg(op.obj)\n rtype = op.class_type\n cl = rtype.class_ir\n attr_rtype, decl_cl = cl.attr_details(op.attr)\n if cl.get_method(op.attr):\n # Properties are essentially methods, so use vtable access for them.\n version = '_TRAIT' if cl.is_trait else ''\n self.emit_line('%s = CPY_GET_ATTR%s(%s, %s, %d, %s, %s); /* %s */' % (\n dest,\n version,\n obj,\n self.emitter.type_struct_name(rtype.class_ir),\n rtype.getter_index(op.attr),\n rtype.struct_name(self.names),\n self.ctype(rtype.attr_type(op.attr)),\n op.attr))\n else:\n # Otherwise, use direct or offset struct access.\n attr_expr = self.get_attr_expr(obj, op, decl_cl)\n self.emitter.emit_line('{} = {};'.format(dest, attr_expr))\n if attr_rtype.is_refcounted:\n self.emitter.emit_undefined_attr_check(\n attr_rtype, attr_expr, '==', unlikely=True\n )\n exc_class = 'PyExc_AttributeError'\n self.emitter.emit_lines(\n 'PyErr_SetString({}, \"attribute {} of {} undefined\");'.format(\n exc_class, repr(op.attr), repr(cl.name)),\n '} else {')\n self.emitter.emit_inc_ref(attr_expr, attr_rtype)\n self.emitter.emit_line('}')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.visit_set_attr_FunctionEmitterVisitor.visit_set_attr.if_cl_get_method_op_attr_.else_.self_emitter_emit_lines_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.visit_set_attr_FunctionEmitterVisitor.visit_set_attr.if_cl_get_method_op_attr_.else_.self_emitter_emit_lines_", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitfunc.py", "file_name": "emitfunc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 246, "end_line": 277, "span_ids": ["FunctionEmitterVisitor.visit_set_attr"], "tokens": 330}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FunctionEmitterVisitor(OpVisitor[None]):\n\n def visit_set_attr(self, op: SetAttr) -> None:\n dest = self.reg(op)\n obj = self.reg(op.obj)\n src = self.reg(op.src)\n rtype = op.class_type\n cl = rtype.class_ir\n attr_rtype, decl_cl = cl.attr_details(op.attr)\n if cl.get_method(op.attr):\n # Again, use vtable access for properties...\n version = '_TRAIT' if cl.is_trait else ''\n self.emit_line('%s = CPY_SET_ATTR%s(%s, %s, %d, %s, %s, %s); /* %s */' % (\n dest,\n version,\n obj,\n self.emitter.type_struct_name(rtype.class_ir),\n rtype.setter_index(op.attr),\n src,\n rtype.struct_name(self.names),\n self.ctype(rtype.attr_type(op.attr)),\n op.attr))\n else:\n # ...and struct access for normal attributes.\n attr_expr = self.get_attr_expr(obj, op, decl_cl)\n if attr_rtype.is_refcounted:\n self.emitter.emit_undefined_attr_check(attr_rtype, attr_expr, '!=')\n self.emitter.emit_dec_ref(attr_expr, attr_rtype)\n self.emitter.emit_line('}')\n # This steal the reference to src, so we don't need to increment the arg\n self.emitter.emit_lines(\n '{} = {};'.format(attr_expr, src),\n '{} = 1;'.format(dest),\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.PREFIX_MAP_FunctionEmitterVisitor.visit_load_static.self_emit_line_s_s_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.PREFIX_MAP_FunctionEmitterVisitor.visit_load_static.self_emit_line_s_s_", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitfunc.py", "file_name": "emitfunc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 279, "end_line": 296, "span_ids": ["FunctionEmitterVisitor.visit_load_static", "FunctionEmitterVisitor:2"], "tokens": 186}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FunctionEmitterVisitor(OpVisitor[None]):\n\n PREFIX_MAP = {\n NAMESPACE_STATIC: STATIC_PREFIX,\n NAMESPACE_TYPE: TYPE_PREFIX,\n NAMESPACE_MODULE: MODULE_PREFIX,\n } # type: Final\n\n def visit_load_static(self, op: LoadStatic) -> None:\n dest = self.reg(op)\n prefix = self.PREFIX_MAP[op.namespace]\n name = self.emitter.static_name(op.identifier, op.module_name, prefix)\n if op.namespace == NAMESPACE_TYPE:\n name = '(PyObject *)%s' % name\n ann = ''\n if op.ann:\n s = repr(op.ann)\n if not any(x in s for x in ('/*', '*/', '\\0')):\n ann = ' /* %s */' % s\n self.emit_line('%s = %s;%s' % (dest, name, ann))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.visit_init_static_FunctionEmitterVisitor.visit_call.self_emit_line_s_s_s_s_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.visit_init_static_FunctionEmitterVisitor.visit_call.self_emit_line_s_s_s_s_", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitfunc.py", "file_name": "emitfunc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 298, "end_line": 325, "span_ids": ["FunctionEmitterVisitor.get_dest_assign", "FunctionEmitterVisitor.visit_call", "FunctionEmitterVisitor.visit_init_static", "FunctionEmitterVisitor.visit_tuple_get"], "tokens": 299}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FunctionEmitterVisitor(OpVisitor[None]):\n\n def visit_init_static(self, op: InitStatic) -> None:\n value = self.reg(op.value)\n prefix = self.PREFIX_MAP[op.namespace]\n name = self.emitter.static_name(op.identifier, op.module_name, prefix)\n if op.namespace == NAMESPACE_TYPE:\n value = '(PyTypeObject *)%s' % value\n self.emit_line('%s = %s;' % (name, value))\n self.emit_inc_ref(name, op.value.type)\n\n def visit_tuple_get(self, op: TupleGet) -> None:\n dest = self.reg(op)\n src = self.reg(op.src)\n self.emit_line('{} = {}.f{};'.format(dest, src, op.index))\n self.emit_inc_ref(dest, op.type)\n\n def get_dest_assign(self, dest: Value) -> str:\n if not dest.is_void:\n return self.reg(dest) + ' = '\n else:\n return ''\n\n def visit_call(self, op: Call) -> None:\n \"\"\"Call native function.\"\"\"\n dest = self.get_dest_assign(op)\n args = ', '.join(self.reg(arg) for arg in op.args)\n lib = self.emitter.get_group_prefix(op.fn)\n cname = op.fn.cname(self.names)\n self.emit_line('%s%s%s%s(%s);' % (dest, lib, NATIVE_PREFIX, cname, args))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.visit_method_call_FunctionEmitterVisitor.visit_method_call.if_is_direct_.else_.self_emit_line_CPY_GET": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.visit_method_call_FunctionEmitterVisitor.visit_method_call.if_is_direct_.else_.self_emit_line_CPY_GET", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitfunc.py", "file_name": "emitfunc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 378, "end_line": 411, "span_ids": ["FunctionEmitterVisitor.visit_method_call"], "tokens": 373}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FunctionEmitterVisitor(OpVisitor[None]):\n\n def visit_method_call(self, op: MethodCall) -> None:\n \"\"\"Call native method.\"\"\"\n dest = self.get_dest_assign(op)\n obj = self.reg(op.obj)\n\n rtype = op.receiver_type\n class_ir = rtype.class_ir\n name = op.method\n method = rtype.class_ir.get_method(name)\n assert method is not None\n\n # Can we call the method directly, bypassing vtable?\n is_direct = class_ir.is_method_final(name)\n\n # The first argument gets omitted for static methods and\n # turned into the class for class methods\n obj_args = (\n [] if method.decl.kind == FUNC_STATICMETHOD else\n ['(PyObject *)Py_TYPE({})'.format(obj)] if method.decl.kind == FUNC_CLASSMETHOD else\n [obj])\n args = ', '.join(obj_args + [self.reg(arg) for arg in op.args])\n mtype = native_function_type(method, self.emitter)\n version = '_TRAIT' if rtype.class_ir.is_trait else ''\n if is_direct:\n # Directly call method, without going through the vtable.\n lib = self.emitter.get_group_prefix(method.decl)\n self.emit_line('{}{}{}{}({});'.format(\n dest, lib, NATIVE_PREFIX, method.cname(self.names), args))\n else:\n # Call using vtable.\n method_idx = rtype.method_index(name)\n self.emit_line('{}CPY_GET_METHOD{}({}, {}, {}, {}, {})({}); /* {} */'.format(\n dest, version, obj, self.emitter.type_struct_name(rtype.class_ir),\n method_idx, rtype.struct_name(self.names), mtype, args, op.method))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.visit_inc_ref_FunctionEmitterVisitor.visit_unreachable.self_emitter_emit_line_C": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.visit_inc_ref_FunctionEmitterVisitor.visit_unreachable.self_emitter_emit_line_C", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitfunc.py", "file_name": "emitfunc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 362, "end_line": 381, "span_ids": ["FunctionEmitterVisitor.visit_unbox", "FunctionEmitterVisitor.visit_dec_ref", "FunctionEmitterVisitor.visit_unreachable", "FunctionEmitterVisitor.visit_inc_ref", "FunctionEmitterVisitor.visit_cast", "FunctionEmitterVisitor.visit_box"], "tokens": 221}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FunctionEmitterVisitor(OpVisitor[None]):\n\n def visit_inc_ref(self, op: IncRef) -> None:\n src = self.reg(op.src)\n self.emit_inc_ref(src, op.src.type)\n\n def visit_dec_ref(self, op: DecRef) -> None:\n src = self.reg(op.src)\n self.emit_dec_ref(src, op.src.type, op.is_xdec)\n\n def visit_box(self, op: Box) -> None:\n self.emitter.emit_box(self.reg(op.src), self.reg(op), op.src.type, can_borrow=True)\n\n def visit_cast(self, op: Cast) -> None:\n self.emitter.emit_cast(self.reg(op.src), self.reg(op), op.type,\n src_type=op.src.type)\n\n def visit_unbox(self, op: Unbox) -> None:\n self.emitter.emit_unbox(self.reg(op.src), self.reg(op), op.type)\n\n def visit_unreachable(self, op: Unreachable) -> None:\n self.emitter.emit_line('CPy_Unreachable();')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.visit_raise_standard_error_FunctionEmitterVisitor.visit_raise_standard_error.self_emitter_emit_line_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.visit_raise_standard_error_FunctionEmitterVisitor.visit_raise_standard_error.self_emitter_emit_line_", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitfunc.py", "file_name": "emitfunc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 383, "end_line": 398, "span_ids": ["FunctionEmitterVisitor.visit_raise_standard_error"], "tokens": 194}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FunctionEmitterVisitor(OpVisitor[None]):\n\n def visit_raise_standard_error(self, op: RaiseStandardError) -> None:\n # TODO: Better escaping of backspaces and such\n if op.value is not None:\n if isinstance(op.value, str):\n message = op.value.replace('\"', '\\\\\"')\n self.emitter.emit_line(\n 'PyErr_SetString(PyExc_{}, \"{}\");'.format(op.class_name, message))\n elif isinstance(op.value, Value):\n self.emitter.emit_line(\n 'PyErr_SetObject(PyExc_{}, {});'.format(op.class_name,\n self.emitter.reg(op.value)))\n else:\n assert False, 'op value type must be either str or Value'\n else:\n self.emitter.emit_line('PyErr_SetNone(PyExc_{});'.format(op.class_name))\n self.emitter.emit_line('{} = 0;'.format(self.reg(op)))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.visit_comparison_op_FunctionEmitterVisitor.visit_comparison_op.self_emit_line_s_s_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.visit_comparison_op_FunctionEmitterVisitor.visit_comparison_op.self_emit_line_s_s_s", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitfunc.py", "file_name": "emitfunc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 429, "end_line": 444, "span_ids": ["FunctionEmitterVisitor.visit_comparison_op"], "tokens": 220}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FunctionEmitterVisitor(OpVisitor[None]):\n\n def visit_comparison_op(self, op: ComparisonOp) -> None:\n dest = self.reg(op)\n lhs = self.reg(op.lhs)\n rhs = self.reg(op.rhs)\n lhs_cast = \"\"\n rhs_cast = \"\"\n signed_op = {ComparisonOp.SLT, ComparisonOp.SGT, ComparisonOp.SLE, ComparisonOp.SGE}\n unsigned_op = {ComparisonOp.ULT, ComparisonOp.UGT, ComparisonOp.ULE, ComparisonOp.UGE}\n if op.op in signed_op:\n lhs_cast = self.emit_signed_int_cast(op.lhs.type)\n rhs_cast = self.emit_signed_int_cast(op.rhs.type)\n elif op.op in unsigned_op:\n lhs_cast = self.emit_unsigned_int_cast(op.lhs.type)\n rhs_cast = self.emit_unsigned_int_cast(op.rhs.type)\n self.emit_line('%s = %s%s %s %s%s;' % (dest, lhs_cast, lhs,\n op.op_str[op.op], rhs_cast, rhs))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.visit_load_mem_FunctionEmitterVisitor.emit_declaration.self_declarations_emit_li": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.visit_load_mem_FunctionEmitterVisitor.emit_declaration.self_declarations_emit_li", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitfunc.py", "file_name": "emitfunc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 497, "end_line": 572, "span_ids": ["FunctionEmitterVisitor.visit_get_element_ptr", "FunctionEmitterVisitor.ctype", "FunctionEmitterVisitor.emit_inc_ref", "FunctionEmitterVisitor.visit_load_address", "FunctionEmitterVisitor.emit_declaration", "FunctionEmitterVisitor.label", "FunctionEmitterVisitor.emit_line", "FunctionEmitterVisitor.visit_load_mem", "FunctionEmitterVisitor.emit_lines", "FunctionEmitterVisitor.reg", "FunctionEmitterVisitor.visit_keep_alive", "FunctionEmitterVisitor.c_error_value", "FunctionEmitterVisitor.c_undefined_value", "FunctionEmitterVisitor.emit_dec_ref", "FunctionEmitterVisitor.visit_set_mem"], "tokens": 723}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FunctionEmitterVisitor(OpVisitor[None]):\n\n def visit_load_mem(self, op: LoadMem) -> None:\n dest = self.reg(op)\n src = self.reg(op.src)\n # TODO: we shouldn't dereference to type that are pointer type so far\n type = self.ctype(op.type)\n self.emit_line('%s = *(%s *)%s;' % (dest, type, src))\n\n def visit_set_mem(self, op: SetMem) -> None:\n dest = self.reg(op.dest)\n src = self.reg(op.src)\n dest_type = self.ctype(op.dest_type)\n # clang whines about self assignment (which we might generate\n # for some casts), so don't emit it.\n if dest != src:\n self.emit_line('*(%s *)%s = %s;' % (dest_type, dest, src))\n\n def visit_get_element_ptr(self, op: GetElementPtr) -> None:\n dest = self.reg(op)\n src = self.reg(op.src)\n # TODO: support tuple type\n assert isinstance(op.src_type, RStruct)\n assert op.field in op.src_type.names, \"Invalid field name.\"\n self.emit_line('%s = (%s)&((%s *)%s)->%s;' % (dest, op.type._ctype, op.src_type.name,\n src, op.field))\n\n def visit_load_address(self, op: LoadAddress) -> None:\n typ = op.type\n dest = self.reg(op)\n src = self.reg(op.src) if isinstance(op.src, Register) else op.src\n self.emit_line('%s = (%s)&%s;' % (dest, typ._ctype, src))\n\n def visit_keep_alive(self, op: KeepAlive) -> None:\n # This is a no-op.\n pass\n\n # Helpers\n\n def label(self, label: BasicBlock) -> str:\n return self.emitter.label(label)\n\n def reg(self, reg: Value) -> str:\n if isinstance(reg, Integer):\n val = reg.value\n if val == 0 and is_pointer_rprimitive(reg.type):\n return \"NULL\"\n s = str(val)\n if val >= (1 << 31):\n # Avoid overflowing signed 32-bit int\n s += 'U'\n return s\n else:\n return self.emitter.reg(reg)\n\n def ctype(self, rtype: RType) -> str:\n return self.emitter.ctype(rtype)\n\n def c_error_value(self, rtype: RType) -> str:\n return self.emitter.c_error_value(rtype)\n\n def c_undefined_value(self, rtype: RType) -> str:\n return self.emitter.c_undefined_value(rtype)\n\n def emit_line(self, line: str) -> None:\n self.emitter.emit_line(line)\n\n def emit_lines(self, *lines: str) -> None:\n self.emitter.emit_lines(*lines)\n\n def emit_inc_ref(self, dest: str, rtype: RType) -> None:\n self.emitter.emit_inc_ref(dest, rtype)\n\n def emit_dec_ref(self, dest: str, rtype: RType, is_xdec: bool) -> None:\n self.emitter.emit_dec_ref(dest, rtype, is_xdec)\n\n def emit_declaration(self, line: str) -> None:\n self.declarations.emit_line(line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.emit_traceback_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.emit_traceback_", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitfunc.py", "file_name": "emitfunc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 515, "end_line": 539, "span_ids": ["FunctionEmitterVisitor.emit_unsigned_int_cast", "FunctionEmitterVisitor.emit_traceback", "FunctionEmitterVisitor.emit_signed_int_cast"], "tokens": 223}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FunctionEmitterVisitor(OpVisitor[None]):\n\n def emit_traceback(self, op: Branch) -> None:\n if op.traceback_entry is not None:\n globals_static = self.emitter.static_name('globals', self.module_name)\n self.emit_line('CPy_AddTraceback(\"%s\", \"%s\", %d, %s);' % (\n self.source_path.replace(\"\\\\\", \"\\\\\\\\\"),\n op.traceback_entry[0],\n op.traceback_entry[1],\n globals_static))\n if DEBUG_ERRORS:\n self.emit_line('assert(PyErr_Occurred() != NULL && \"failure w/o err!\");')\n\n def emit_signed_int_cast(self, type: RType) -> str:\n if is_tagged(type):\n return '(Py_ssize_t)'\n else:\n return ''\n\n def emit_unsigned_int_cast(self, type: RType) -> str:\n if is_int32_rprimitive(type):\n return '(uint32_t)'\n elif is_int64_rprimitive(type):\n return '(uint64_t)'\n else:\n return ''", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_MypycPlugin.report_config_data_MypycPlugin.get_additional_deps.return._10_id_1_for_id_in_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_MypycPlugin.report_config_data_MypycPlugin.get_additional_deps.return._10_id_1_for_id_in_s", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitmodule.py", "file_name": "emitmodule.py", "file_type": "text/x-python", "category": "implementation", "start_line": 106, "end_line": 158, "span_ids": ["MypycPlugin.get_additional_deps", "MypycPlugin.report_config_data"], "tokens": 505}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MypycPlugin(Plugin):\n\n def report_config_data(\n self, ctx: ReportConfigContext) -> Optional[Tuple[Optional[str], List[str]]]:\n # The config data we report is the group map entry for the module.\n # If the data is being used to check validity, we do additional checks\n # that the IR cache exists and matches the metadata cache and all\n # output source files exist and are up to date.\n\n id, path, is_check = ctx.id, ctx.path, ctx.is_check\n\n if id not in self.group_map:\n return None\n\n # If we aren't doing validity checks, just return the cache data\n if not is_check:\n return self.group_map[id]\n\n # Load the metadata and IR cache\n meta_path, _, _ = get_cache_names(id, path, self.options)\n ir_path = get_ir_cache_name(id, path, self.options)\n try:\n meta_json = self.metastore.read(meta_path)\n ir_json = self.metastore.read(ir_path)\n except FileNotFoundError:\n # This could happen if mypyc failed after mypy succeeded\n # in the previous run or if some cache files got\n # deleted. No big deal, just fail to load the cache.\n return None\n\n ir_data = json.loads(ir_json)\n\n # Check that the IR cache matches the metadata cache\n if compute_hash(meta_json) != ir_data['meta_hash']:\n return None\n\n # Check that all of the source files are present and as\n # expected. The main situation where this would come up is the\n # user deleting the build directory without deleting\n # .mypy_cache, which we should handle gracefully.\n for path, hash in ir_data['src_hashes'].items():\n try:\n with open(os.path.join(self.compiler_options.target_dir, path), 'rb') as f:\n contents = f.read()\n except FileNotFoundError:\n return None\n real_hash = hash_digest(contents)\n if hash != real_hash:\n return None\n\n return self.group_map[id]\n\n def get_additional_deps(self, file: MypyFile) -> List[Tuple[int, str, int]]:\n # Report dependency on modules in the module's group\n return [(10, id, -1) for id in self.group_map.get(file.fullname, (None, []))[1]]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_parse_and_typecheck_parse_and_typecheck.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_parse_and_typecheck_parse_and_typecheck.return.result", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitmodule.py", "file_name": "emitmodule.py", "file_type": "text/x-python", "category": "implementation", "start_line": 161, "end_line": 177, "span_ids": ["parse_and_typecheck"], "tokens": 134}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def parse_and_typecheck(\n sources: List[BuildSource],\n options: Options,\n compiler_options: CompilerOptions,\n groups: Groups,\n fscache: Optional[FileSystemCache] = None,\n alt_lib_path: Optional[str] = None\n) -> BuildResult:\n assert options.strict_optional, 'strict_optional must be turned on'\n result = build(sources=sources,\n options=options,\n alt_lib_path=alt_lib_path,\n fscache=fscache,\n extra_plugins=[MypycPlugin(options, compiler_options, groups)])\n if result.errors:\n raise CompileError(result.errors)\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_compile_scc_to_ir_compile_scc_to_ir.return.modules": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_compile_scc_to_ir_compile_scc_to_ir.return.modules", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitmodule.py", "file_name": "emitmodule.py", "file_type": "text/x-python", "category": "implementation", "start_line": 180, "end_line": 225, "span_ids": ["compile_scc_to_ir"], "tokens": 314}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def compile_scc_to_ir(\n scc: List[MypyFile],\n result: BuildResult,\n mapper: Mapper,\n compiler_options: CompilerOptions,\n errors: Errors,\n) -> ModuleIRs:\n \"\"\"Compile an SCC into ModuleIRs.\n\n Any modules that this SCC depends on must have either compiled or\n loaded from a cache into mapper.\n\n Arguments:\n scc: The list of MypyFiles to compile\n result: The BuildResult from the mypy front-end\n mapper: The Mapper object mapping mypy ASTs to class and func IRs\n compiler_options: The compilation options\n errors: Where to report any errors encountered\n\n Returns the IR of the modules.\n \"\"\"\n\n if compiler_options.verbose:\n print(\"Compiling {}\".format(\", \".join(x.name for x in scc)))\n\n # Generate basic IR, with missing exception and refcount handling.\n modules = build_ir(\n scc, result.graph, result.types, mapper, compiler_options, errors\n )\n if errors.num_errors > 0:\n return modules\n\n # Insert uninit checks.\n for module in modules.values():\n for fn in module.functions:\n insert_uninit_checks(fn)\n # Insert exception handling.\n for module in modules.values():\n for fn in module.functions:\n insert_exception_handling(fn)\n # Insert refcount handling.\n for module in modules.values():\n for fn in module.functions:\n insert_ref_count_opcodes(fn)\n\n return modules", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_compile_modules_to_ir_compile_modules_to_ir.return.modules": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_compile_modules_to_ir_compile_modules_to_ir.return.modules", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitmodule.py", "file_name": "emitmodule.py", "file_type": "text/x-python", "category": "implementation", "start_line": 228, "end_line": 258, "span_ids": ["compile_modules_to_ir"], "tokens": 235}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def compile_modules_to_ir(\n result: BuildResult,\n mapper: Mapper,\n compiler_options: CompilerOptions,\n errors: Errors,\n) -> ModuleIRs:\n \"\"\"Compile a collection of modules into ModuleIRs.\n\n The modules to compile are specified as part of mapper's group_map.\n\n Returns the IR of the modules.\n \"\"\"\n deser_ctx = DeserMaps({}, {})\n modules = {}\n\n # Process the graph by SCC in topological order, like we do in mypy.build\n for scc in sorted_components(result.graph):\n scc_states = [result.graph[id] for id in scc]\n trees = [st.tree for st in scc_states if st.id in mapper.group_map and st.tree]\n\n if not trees:\n continue\n\n fresh = all(id not in result.manager.rechecked_modules for id in scc)\n if fresh:\n load_scc_from_cache(trees, result, mapper, deser_ctx)\n else:\n scc_ir = compile_scc_to_ir(trees, result, mapper, compiler_options, errors)\n modules.update(scc_ir)\n\n return modules", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_compile_ir_to_c_get_state_ir_cache_name.return.get_ir_cache_name_state_i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_compile_ir_to_c_get_state_ir_cache_name.return.get_ir_cache_name_state_i", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitmodule.py", "file_name": "emitmodule.py", "file_type": "text/x-python", "category": "implementation", "start_line": 264, "end_line": 306, "span_ids": ["get_state_ir_cache_name", "get_ir_cache_name", "compile_ir_to_c"], "tokens": 357}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def compile_ir_to_c(\n groups: Groups,\n modules: ModuleIRs,\n result: BuildResult,\n mapper: Mapper,\n compiler_options: CompilerOptions,\n) -> Dict[Optional[str], List[Tuple[str, str]]]:\n \"\"\"Compile a collection of ModuleIRs to C source text.\n\n Returns a dictionary mapping group names to a list of (file name,\n file text) pairs.\n \"\"\"\n source_paths = {source.module: result.graph[source.module].xpath\n for sources, _ in groups for source in sources}\n\n names = NameGenerator([[source.module for source in sources] for sources, _ in groups])\n\n # Generate C code for each compilation group. Each group will be\n # compiled into a separate extension module.\n ctext = {} # type: Dict[Optional[str], List[Tuple[str, str]]]\n for group_sources, group_name in groups:\n group_modules = [(source.module, modules[source.module]) for source in group_sources\n if source.module in modules]\n if not group_modules:\n ctext[group_name] = []\n continue\n generator = GroupGenerator(\n group_modules, source_paths,\n group_name, mapper.group_map, names,\n compiler_options\n )\n ctext[group_name] = generator.generate_c_for_modules()\n\n return ctext\n\n\ndef get_ir_cache_name(id: str, path: str, options: Options) -> str:\n meta_path, _, _ = get_cache_names(id, path, options)\n return meta_path.replace('.meta.json', '.ir.json')\n\n\ndef get_state_ir_cache_name(state: State) -> str:\n return get_ir_cache_name(state.id, state.xpath, state.options)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_write_cache_write_cache.result_manager_metastore_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_write_cache_write_cache.result_manager_metastore_", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitmodule.py", "file_name": "emitmodule.py", "file_type": "text/x-python", "category": "implementation", "start_line": 307, "end_line": 357, "span_ids": ["write_cache"], "tokens": 455}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def write_cache(\n modules: ModuleIRs,\n result: BuildResult,\n group_map: Dict[str, Optional[str]],\n ctext: Dict[Optional[str], List[Tuple[str, str]]],\n) -> None:\n \"\"\"Write out the cache information for modules.\n\n Each module has the following cache information written (which is\n in addition to the cache information written by mypy itself):\n * A serialized version of its mypyc IR, minus the bodies of\n functions. This allows code that depends on it to use\n these serialized data structures when compiling against it\n instead of needing to recompile it. (Compiling against a\n module requires access to both its mypy and mypyc data\n structures.)\n * The hash of the mypy metadata cache file for the module.\n This is used to ensure that the mypyc cache and the mypy\n cache are in sync and refer to the same version of the code.\n This is particularly important if mypyc crashes/errors/is\n stopped after mypy has written its cache but before mypyc has.\n * The hashes of all of the source file outputs for the group\n the module is in. This is so that the module will be\n recompiled if the source outputs are missing.\n \"\"\"\n\n hashes = {}\n for name, files in ctext.items():\n hashes[name] = {file: compute_hash(data) for file, data in files}\n\n # Write out cache data\n for id, module in modules.items():\n st = result.graph[id]\n\n meta_path, _, _ = get_cache_names(id, st.xpath, result.manager.options)\n # If the metadata isn't there, skip writing the cache.\n try:\n meta_data = result.manager.metastore.read(meta_path)\n except IOError:\n continue\n\n newpath = get_state_ir_cache_name(st)\n ir_data = {\n 'ir': module.serialize(),\n 'meta_hash': compute_hash(meta_data),\n 'src_hashes': hashes[group_map[id]],\n }\n\n result.manager.metastore.write(newpath, json.dumps(ir_data))\n\n result.manager.metastore.commit()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_load_scc_from_cache_load_scc_from_cache.return.modules": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_load_scc_from_cache_load_scc_from_cache.return.modules", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitmodule.py", "file_name": "emitmodule.py", "file_type": "text/x-python", "category": "implementation", "start_line": 360, "end_line": 377, "span_ids": ["load_scc_from_cache"], "tokens": 136}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def load_scc_from_cache(\n scc: List[MypyFile],\n result: BuildResult,\n mapper: Mapper,\n ctx: DeserMaps,\n) -> ModuleIRs:\n \"\"\"Load IR for an SCC of modules from the cache.\n\n Arguments and return are as compile_scc_to_ir.\n \"\"\"\n cache_data = {\n k.fullname: json.loads(\n result.manager.metastore.read(get_state_ir_cache_name(result.graph[k.fullname]))\n )['ir'] for k in scc\n }\n modules = deserialize_modules(cache_data, ctx)\n load_type_map(mapper, scc, ctx)\n return modules", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_compile_modules_to_c_compile_modules_to_c.return.modules_ctext_name_for": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_compile_modules_to_c_compile_modules_to_c.return.modules_ctext_name_for", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitmodule.py", "file_name": "emitmodule.py", "file_type": "text/x-python", "category": "implementation", "start_line": 380, "end_line": 414, "span_ids": ["compile_modules_to_c"], "tokens": 339}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def compile_modules_to_c(\n result: BuildResult,\n compiler_options: CompilerOptions,\n errors: Errors,\n groups: Groups,\n) -> Tuple[ModuleIRs, List[FileContents]]:\n \"\"\"Compile Python module(s) to the source of Python C extension modules.\n\n This generates the source code for the \"shared library\" module\n for each group. The shim modules are generated in mypyc.build.\n Each shared library module provides, for each module in its group,\n a PyCapsule containing an initialization function.\n Additionally, it provides a capsule containing an export table of\n pointers to all of the group's functions and static variables.\n\n Arguments:\n result: The BuildResult from the mypy front-end\n compiler_options: The compilation options\n errors: Where to report any errors encountered\n groups: The groups that we are compiling. See documentation of Groups type above.\n ops: Optionally, where to dump stringified ops for debugging.\n\n Returns the IR of the modules and a list containing the generated files for each group.\n \"\"\"\n # Construct a map from modules to what group they belong to\n group_map = {source.module: lib_name for group, lib_name in groups for source in group}\n mapper = Mapper(group_map)\n\n modules = compile_modules_to_ir(result, mapper, compiler_options, errors)\n ctext = compile_ir_to_c(groups, modules, result, mapper, compiler_options)\n\n if errors.num_errors == 0:\n write_cache(modules, result, group_map, ctext)\n\n return modules, [ctext[name] for _, name in groups]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_GroupGenerator_GroupGenerator.short_group_suffix.return.___exported_name_self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_GroupGenerator_GroupGenerator.short_group_suffix.return.___exported_name_self_", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitmodule.py", "file_name": "emitmodule.py", "file_type": "text/x-python", "category": "implementation", "start_line": 448, "end_line": 489, "span_ids": ["GroupGenerator.short_group_suffix", "GroupGenerator.__init__", "GroupGenerator", "GroupGenerator.group_suffix"], "tokens": 396}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GroupGenerator:\n def __init__(self,\n modules: List[Tuple[str, ModuleIR]],\n source_paths: Dict[str, str],\n group_name: Optional[str],\n group_map: Dict[str, Optional[str]],\n names: NameGenerator,\n compiler_options: CompilerOptions) -> None:\n \"\"\"Generator for C source for a compilation group.\n\n The code for a compilation group contains an internal and an\n external .h file, and then one .c if not in multi_file mode or\n one .c file per module if in multi_file mode.)\n\n Arguments:\n modules: (name, ir) pairs for each module in the group\n source_paths: Map from module names to source file paths\n group_name: The name of the group (or None if this is single-module compilation)\n group_map: A map of modules to their group names\n names: The name generator for the compilation\n multi_file: Whether to put each module in its own source file regardless\n of group structure.\n \"\"\"\n self.modules = modules\n self.source_paths = source_paths\n self.context = EmitterContext(names, group_name, group_map)\n self.names = names\n # Initializations of globals to simple values that we can't\n # do statically because the windows loader is bad.\n self.simple_inits = [] # type: List[Tuple[str, str]]\n self.group_name = group_name\n self.use_shared_lib = group_name is not None\n self.compiler_options = compiler_options\n self.multi_file = compiler_options.multi_file\n\n @property\n def group_suffix(self) -> str:\n return '_' + exported_name(self.group_name) if self.group_name else ''\n\n @property\n def short_group_suffix(self) -> str:\n return '_' + exported_name(self.group_name.split('.')[-1]) if self.group_name else ''", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_GroupGenerator.generate_c_for_modules_GroupGenerator.generate_c_for_modules.None_3.for_fn_in_module_function.generate_function_declara": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_GroupGenerator.generate_c_for_modules_GroupGenerator.generate_c_for_modules.None_3.for_fn_in_module_function.generate_function_declara", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitmodule.py", "file_name": "emitmodule.py", "file_type": "text/x-python", "category": "implementation", "start_line": 491, "end_line": 570, "span_ids": ["GroupGenerator.generate_c_for_modules"], "tokens": 767}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GroupGenerator:\n\n def generate_c_for_modules(self) -> List[Tuple[str, str]]:\n file_contents = []\n multi_file = self.use_shared_lib and self.multi_file\n\n # Collect all literal refs in IR.\n for _, module in self.modules:\n for fn in module.functions:\n collect_literals(fn, self.context.literals)\n\n base_emitter = Emitter(self.context)\n # Optionally just include the runtime library c files to\n # reduce the number of compiler invocations needed\n if self.compiler_options.include_runtime_files:\n for name in RUNTIME_C_FILES:\n base_emitter.emit_line('#include \"{}\"'.format(name))\n base_emitter.emit_line('#include \"__native{}.h\"'.format(self.short_group_suffix))\n base_emitter.emit_line('#include \"__native_internal{}.h\"'.format(self.short_group_suffix))\n emitter = base_emitter\n\n self.generate_literal_tables()\n\n for module_name, module in self.modules:\n if multi_file:\n emitter = Emitter(self.context)\n emitter.emit_line('#include \"__native{}.h\"'.format(self.short_group_suffix))\n emitter.emit_line(\n '#include \"__native_internal{}.h\"'.format(self.short_group_suffix))\n\n self.declare_module(module_name, emitter)\n self.declare_internal_globals(module_name, emitter)\n self.declare_imports(module.imports, emitter)\n\n for cl in module.classes:\n if cl.is_ext_class:\n generate_class(cl, module_name, emitter)\n\n # Generate Python extension module definitions and module initialization functions.\n self.generate_module_def(emitter, module_name, module)\n\n for fn in module.functions:\n emitter.emit_line()\n generate_native_function(fn, emitter, self.source_paths[module_name], module_name)\n if fn.name != TOP_LEVEL_NAME:\n emitter.emit_line()\n if is_fastcall_supported(fn, emitter.capi_version):\n generate_wrapper_function(\n fn, emitter, self.source_paths[module_name], module_name)\n else:\n generate_legacy_wrapper_function(\n fn, emitter, self.source_paths[module_name], module_name)\n if multi_file:\n name = ('__native_{}.c'.format(emitter.names.private_name(module_name)))\n file_contents.append((name, ''.join(emitter.fragments)))\n\n # The external header file contains type declarations while\n # the internal contains declarations of functions and objects\n # (which are shared between shared libraries via dynamic\n # exports tables and not accessed directly.)\n ext_declarations = Emitter(self.context)\n ext_declarations.emit_line('#ifndef MYPYC_NATIVE{}_H'.format(self.group_suffix))\n ext_declarations.emit_line('#define MYPYC_NATIVE{}_H'.format(self.group_suffix))\n ext_declarations.emit_line('#include ')\n ext_declarations.emit_line('#include ')\n\n declarations = Emitter(self.context)\n declarations.emit_line('#ifndef MYPYC_NATIVE_INTERNAL{}_H'.format(self.group_suffix))\n declarations.emit_line('#define MYPYC_NATIVE_INTERNAL{}_H'.format(self.group_suffix))\n declarations.emit_line('#include ')\n declarations.emit_line('#include ')\n declarations.emit_line('#include \"__native{}.h\"'.format(self.short_group_suffix))\n declarations.emit_line()\n declarations.emit_line('int CPyGlobalsInit(void);')\n declarations.emit_line()\n\n for module_name, module in self.modules:\n self.declare_finals(module_name, module.final_names, declarations)\n for cl in module.classes:\n generate_class_type_decl(cl, emitter, ext_declarations, declarations)\n for fn in module.functions:\n generate_function_declaration(fn, declarations)\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_GroupGenerator.generate_c_for_modules.for_lib_in_sorted_self_co_GroupGenerator.generate_c_for_modules.return.file_contents_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_GroupGenerator.generate_c_for_modules.for_lib_in_sorted_self_co_GroupGenerator.generate_c_for_modules.return.file_contents_", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitmodule.py", "file_name": "emitmodule.py", "file_type": "text/x-python", "category": "implementation", "start_line": 566, "end_line": 613, "span_ids": ["GroupGenerator.generate_c_for_modules"], "tokens": 406}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GroupGenerator:\n\n def generate_c_for_modules(self) -> List[Tuple[str, str]]:\n # ... other code\n\n for lib in sorted(self.context.group_deps):\n elib = exported_name(lib)\n short_lib = exported_name(lib.split('.')[-1])\n declarations.emit_lines(\n '#include <{}>'.format(\n os.path.join(group_dir(lib), \"__native_{}.h\".format(short_lib))\n ),\n 'struct export_table_{} exports_{};'.format(elib, elib)\n )\n\n sorted_decls = self.toposort_declarations()\n\n emitter = base_emitter\n self.generate_globals_init(emitter)\n\n emitter.emit_line()\n\n for declaration in sorted_decls:\n decls = ext_declarations if declaration.is_type else declarations\n if not declaration.is_type:\n decls.emit_lines(\n 'extern {}'.format(declaration.decl[0]), *declaration.decl[1:])\n # If there is a definition, emit it. Otherwise repeat the declaration\n # (without an extern).\n if declaration.defn:\n emitter.emit_lines(*declaration.defn)\n else:\n emitter.emit_lines(*declaration.decl)\n else:\n decls.emit_lines(*declaration.decl)\n\n if self.group_name:\n self.generate_export_table(ext_declarations, emitter)\n\n self.generate_shared_lib_init(emitter)\n\n ext_declarations.emit_line('#endif')\n declarations.emit_line('#endif')\n\n output_dir = group_dir(self.group_name) if self.group_name else ''\n return file_contents + [\n (os.path.join(output_dir, '__native{}.c'.format(self.short_group_suffix)),\n ''.join(emitter.fragments)),\n (os.path.join(output_dir, '__native_internal{}.h'.format(self.short_group_suffix)),\n ''.join(declarations.fragments)),\n (os.path.join(output_dir, '__native{}.h'.format(self.short_group_suffix)),\n ''.join(ext_declarations.fragments)),\n ]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_GroupGenerator.generate_export_table_GroupGenerator.generate_export_table.code_emitter_emit_line_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_GroupGenerator.generate_export_table_GroupGenerator.generate_export_table.code_emitter_emit_line_", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitmodule.py", "file_name": "emitmodule.py", "file_type": "text/x-python", "category": "implementation", "start_line": 615, "end_line": 679, "span_ids": ["GroupGenerator.generate_export_table"], "tokens": 592}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GroupGenerator:\n\n def generate_export_table(self, decl_emitter: Emitter, code_emitter: Emitter) -> None:\n \"\"\"Generate the declaration and definition of the group's export struct.\n\n To avoid needing to deal with deeply platform specific issues\n involving dynamic library linking (and some possibly\n insurmountable issues involving cyclic dependencies), compiled\n code accesses functions and data in other compilation groups\n via an explicit \"export struct\".\n\n Each group declares a struct type that contains a pointer to\n every function and static variable it exports. It then\n populates this struct and stores a pointer to it in a capsule\n stored as an attribute named 'exports' on the group's shared\n library's python module.\n\n On load, a group's init function will import all of its\n dependencies' exports tables using the capsule mechanism and\n copy the contents into a local copy of the table (to eliminate\n the need for a pointer indirection when accessing it).\n\n Then, all calls to functions in another group and accesses to statics\n from another group are done indirectly via the export table.\n\n For example, a group containing a module b, where b contains a class B\n and a function bar, would declare an export table like:\n struct export_table_b {\n PyTypeObject **CPyType_B;\n PyObject *(*CPyDef_B)(CPyTagged cpy_r_x);\n CPyTagged (*CPyDef_B___foo)(PyObject *cpy_r_self, CPyTagged cpy_r_y);\n tuple_T2OI (*CPyDef_bar)(PyObject *cpy_r_x);\n char (*CPyDef___top_level__)(void);\n };\n that would be initialized with:\n static struct export_table_b exports = {\n &CPyType_B,\n &CPyDef_B,\n &CPyDef_B___foo,\n &CPyDef_bar,\n &CPyDef___top_level__,\n };\n To call `b.foo`, then, a function in another group would do\n `exports_b.CPyDef_bar(...)`.\n \"\"\"\n\n decls = decl_emitter.context.declarations\n\n decl_emitter.emit_lines(\n '',\n 'struct export_table{} {{'.format(self.group_suffix),\n )\n for name, decl in decls.items():\n if decl.needs_export:\n decl_emitter.emit_line(pointerize('\\n'.join(decl.decl), name))\n\n decl_emitter.emit_line('};')\n\n code_emitter.emit_lines(\n '',\n 'static struct export_table{} exports = {{'.format(self.group_suffix),\n )\n for name, decl in decls.items():\n if decl.needs_export:\n code_emitter.emit_line('&{},'.format(name))\n\n code_emitter.emit_line('};')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_GroupGenerator.generate_shared_lib_init_GroupGenerator.generate_shared_lib_init.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_GroupGenerator.generate_shared_lib_init_GroupGenerator.generate_shared_lib_init.None_3", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitmodule.py", "file_name": "emitmodule.py", "file_type": "text/x-python", "category": "implementation", "start_line": 681, "end_line": 771, "span_ids": ["GroupGenerator.generate_shared_lib_init"], "tokens": 710}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GroupGenerator:\n\n def generate_shared_lib_init(self, emitter: Emitter) -> None:\n \"\"\"Generate the init function for a shared library.\n\n A shared library contains all of the actual code for a\n compilation group.\n\n The init function is responsible for creating Capsules that\n wrap pointers to the initialization function of all the real\n init functions for modules in this shared library as well as\n the export table containing all of the exported functions and\n values from all the modules.\n\n These capsules are stored in attributes of the shared library.\n \"\"\"\n assert self.group_name is not None\n\n emitter.emit_line()\n emitter.emit_lines(\n 'PyMODINIT_FUNC PyInit_{}(void)'.format(\n shared_lib_name(self.group_name).split('.')[-1]),\n '{',\n ('static PyModuleDef def = {{ PyModuleDef_HEAD_INIT, \"{}\", NULL, -1, NULL, NULL }};'\n .format(shared_lib_name(self.group_name))),\n 'int res;',\n 'PyObject *capsule;',\n 'PyObject *tmp;',\n 'static PyObject *module;',\n 'if (module) {',\n 'Py_INCREF(module);',\n 'return module;',\n '}',\n 'module = PyModule_Create(&def);',\n 'if (!module) {',\n 'goto fail;',\n '}',\n '',\n )\n\n emitter.emit_lines(\n 'capsule = PyCapsule_New(&exports, \"{}.exports\", NULL);'.format(\n shared_lib_name(self.group_name)),\n 'if (!capsule) {',\n 'goto fail;',\n '}',\n 'res = PyObject_SetAttrString(module, \"exports\", capsule);',\n 'Py_DECREF(capsule);',\n 'if (res < 0) {',\n 'goto fail;',\n '}',\n '',\n )\n\n for mod, _ in self.modules:\n name = exported_name(mod)\n emitter.emit_lines(\n 'extern PyObject *CPyInit_{}(void);'.format(name),\n 'capsule = PyCapsule_New((void *)CPyInit_{}, \"{}.init_{}\", NULL);'.format(\n name, shared_lib_name(self.group_name), name),\n 'if (!capsule) {',\n 'goto fail;',\n '}',\n 'res = PyObject_SetAttrString(module, \"init_{}\", capsule);'.format(name),\n 'Py_DECREF(capsule);',\n 'if (res < 0) {',\n 'goto fail;',\n '}',\n '',\n )\n\n for group in sorted(self.context.group_deps):\n egroup = exported_name(group)\n emitter.emit_lines(\n 'tmp = PyImport_ImportModule(\"{}\"); if (!tmp) goto fail; Py_DECREF(tmp);'.format(\n shared_lib_name(group)),\n 'struct export_table_{} *pexports_{} = PyCapsule_Import(\"{}.exports\", 0);'.format(\n egroup, egroup, shared_lib_name(group)),\n 'if (!pexports_{}) {{'.format(egroup),\n 'goto fail;',\n '}',\n 'memcpy(&exports_{group}, pexports_{group}, sizeof(exports_{group}));'.format(\n group=egroup),\n '',\n )\n\n emitter.emit_lines(\n 'return module;',\n 'fail:',\n 'Py_XDECREF(module);',\n 'return NULL;',\n '}',\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_GroupGenerator.generate_module_def_GroupGenerator.generate_module_def._HACK_Manually_instanti": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_GroupGenerator.generate_module_def_GroupGenerator.generate_module_def._HACK_Manually_instanti", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitmodule.py", "file_name": "emitmodule.py", "file_type": "text/x-python", "category": "implementation", "start_line": 833, "end_line": 901, "span_ids": ["GroupGenerator.generate_module_def"], "tokens": 761}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GroupGenerator:\n\n def generate_module_def(self, emitter: Emitter, module_name: str, module: ModuleIR) -> None:\n \"\"\"Emit the PyModuleDef struct for a module and the module init function.\"\"\"\n # Emit module methods\n module_prefix = emitter.names.private_name(module_name)\n emitter.emit_line('static PyMethodDef {}module_methods[] = {{'.format(module_prefix))\n for fn in module.functions:\n if fn.class_name is not None or fn.name == TOP_LEVEL_NAME:\n continue\n if is_fastcall_supported(fn, emitter.capi_version):\n flag = 'METH_FASTCALL'\n else:\n flag = 'METH_VARARGS'\n emitter.emit_line(\n ('{{\"{name}\", (PyCFunction){prefix}{cname}, {flag} | METH_KEYWORDS, '\n 'NULL /* docstring */}},').format(\n name=fn.name,\n cname=fn.cname(emitter.names),\n prefix=PREFIX,\n flag=flag))\n emitter.emit_line('{NULL, NULL, 0, NULL}')\n emitter.emit_line('};')\n emitter.emit_line()\n\n # Emit module definition struct\n emitter.emit_lines('static struct PyModuleDef {}module = {{'.format(module_prefix),\n 'PyModuleDef_HEAD_INIT,',\n '\"{}\",'.format(module_name),\n 'NULL, /* docstring */',\n '-1, /* size of per-interpreter state of the module,',\n ' or -1 if the module keeps state in global variables. */',\n '{}module_methods'.format(module_prefix),\n '};')\n emitter.emit_line()\n # Emit module init function. If we are compiling just one module, this\n # will be the C API init function. If we are compiling 2+ modules, we\n # generate a shared library for the modules and shims that call into\n # the shared library, and in this case we use an internal module\n # initialized function that will be called by the shim.\n if not self.use_shared_lib:\n declaration = 'PyMODINIT_FUNC PyInit_{}(void)'.format(module_name)\n else:\n declaration = 'PyObject *CPyInit_{}(void)'.format(exported_name(module_name))\n emitter.emit_lines(declaration,\n '{')\n # Store the module reference in a static and return it when necessary.\n # This is separate from the *global* reference to the module that will\n # be populated when it is imported by a compiled module. We want that\n # reference to only be populated when the module has been successfully\n # imported, whereas this we want to have to stop a circular import.\n module_static = self.module_internal_static_name(module_name, emitter)\n\n emitter.emit_lines('if ({}) {{'.format(module_static),\n 'Py_INCREF({});'.format(module_static),\n 'return {};'.format(module_static),\n '}')\n\n emitter.emit_lines('{} = PyModule_Create(&{}module);'.format(module_static, module_prefix),\n 'if (unlikely({} == NULL))'.format(module_static),\n ' return NULL;')\n emitter.emit_line(\n 'PyObject *modname = PyObject_GetAttrString((PyObject *){}, \"__name__\");'.format(\n module_static))\n\n module_globals = emitter.static_name('globals', module_name)\n emitter.emit_lines('{} = PyModule_GetDict({});'.format(module_globals, module_static),\n 'if (unlikely({} == NULL))'.format(module_globals),\n ' return NULL;')\n\n # HACK: Manually instantiate generated classes here\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_GroupGenerator.generate_module_def.for_cl_in_module_classes__GroupGenerator.generate_module_def.None_15": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_GroupGenerator.generate_module_def.for_cl_in_module_classes__GroupGenerator.generate_module_def.None_15", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitmodule.py", "file_name": "emitmodule.py", "file_type": "text/x-python", "category": "implementation", "start_line": 896, "end_line": 914, "span_ids": ["GroupGenerator.generate_module_def"], "tokens": 188}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GroupGenerator:\n\n def generate_module_def(self, emitter: Emitter, module_name: str, module: ModuleIR) -> None:\n # ... other code\n for cl in module.classes:\n if cl.is_generated:\n type_struct = emitter.type_struct_name(cl)\n emitter.emit_lines(\n '{t} = (PyTypeObject *)CPyType_FromTemplate('\n '(PyObject *){t}_template, NULL, modname);'\n .format(t=type_struct))\n emitter.emit_lines('if (unlikely(!{}))'.format(type_struct),\n ' return NULL;')\n\n emitter.emit_lines('if (CPyGlobalsInit() < 0)',\n ' return NULL;')\n\n self.generate_top_level_call(module, emitter)\n\n emitter.emit_lines('Py_DECREF(modname);')\n\n emitter.emit_line('return {};'.format(module_static))\n emitter.emit_line('}')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_GroupGenerator.generate_top_level_call_GroupGenerator.generate_top_level_call.for_fn_in_reversed_module.if_fn_name_TOP_LEVEL_N.break": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_GroupGenerator.generate_top_level_call_GroupGenerator.generate_top_level_call.for_fn_in_reversed_module.if_fn_name_TOP_LEVEL_N.break", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitmodule.py", "file_name": "emitmodule.py", "file_type": "text/x-python", "category": "implementation", "start_line": 916, "end_line": 926, "span_ids": ["GroupGenerator.generate_top_level_call"], "tokens": 112}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GroupGenerator:\n\n def generate_top_level_call(self, module: ModuleIR, emitter: Emitter) -> None:\n \"\"\"Generate call to function representing module top level.\"\"\"\n # Optimization: we tend to put the top level last, so reverse iterate\n for fn in reversed(module.functions):\n if fn.name == TOP_LEVEL_NAME:\n emitter.emit_lines(\n 'char result = {}();'.format(emitter.native_function_name(fn.decl)),\n 'if (result == 2)',\n ' return NULL;',\n )\n break", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_GroupGenerator.toposort_declarations_GroupGenerator.toposort_declarations.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_GroupGenerator.toposort_declarations_GroupGenerator.toposort_declarations.return.result", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitmodule.py", "file_name": "emitmodule.py", "file_type": "text/x-python", "category": "implementation", "start_line": 928, "end_line": 956, "span_ids": ["GroupGenerator.toposort_declarations"], "tokens": 224}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GroupGenerator:\n\n def toposort_declarations(self) -> List[HeaderDeclaration]:\n \"\"\"Topologically sort the declaration dict by dependencies.\n\n Declarations can require other declarations to come prior in C (such as declaring structs).\n In order to guarantee that the C output will compile the declarations will thus need to\n be properly ordered. This simple DFS guarantees that we have a proper ordering.\n\n This runs in O(V + E).\n \"\"\"\n result = []\n marked_declarations = OrderedDict() # type: Dict[str, MarkedDeclaration]\n for k, v in self.context.declarations.items():\n marked_declarations[k] = MarkedDeclaration(v, False)\n\n def _toposort_visit(name: str) -> None:\n decl = marked_declarations[name]\n if decl.mark:\n return\n\n for child in decl.declaration.dependencies:\n _toposort_visit(child)\n\n result.append(decl.declaration)\n decl.mark = True\n\n for name, marked_declaration in marked_declarations.items():\n _toposort_visit(name)\n\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_GroupGenerator.declare_imports_GroupGenerator.declare_finals.for_name_typ_in_final_na.emitter_context_declarati": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_GroupGenerator.declare_imports_GroupGenerator.declare_finals.for_name_typ_in_final_na.emitter_context_declarati", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitmodule.py", "file_name": "emitmodule.py", "file_type": "text/x-python", "category": "implementation", "start_line": 989, "end_line": 1000, "span_ids": ["GroupGenerator.declare_imports", "GroupGenerator.declare_finals"], "tokens": 142}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GroupGenerator:\n\n def declare_imports(self, imps: Iterable[str], emitter: Emitter) -> None:\n for imp in imps:\n self.declare_module(imp, emitter)\n\n def declare_finals(\n self, module: str, final_names: Iterable[Tuple[str, RType]], emitter: Emitter) -> None:\n for name, typ in final_names:\n static_name = emitter.static_name(name, module)\n emitter.context.declarations[static_name] = HeaderDeclaration(\n '{}{};'.format(emitter.ctype_spaced(typ), static_name),\n [self.final_definition(module, name, typ, emitter)],\n needs_export=True)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_GroupGenerator.final_definition_GroupGenerator.declare_static_pyobject.self_declare_global_PyOb": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_GroupGenerator.final_definition_GroupGenerator.declare_static_pyobject.self_declare_global_PyOb", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitmodule.py", "file_name": "emitmodule.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1002, "end_line": 1015, "span_ids": ["GroupGenerator.declare_static_pyobject", "GroupGenerator.final_definition"], "tokens": 179}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GroupGenerator:\n\n def final_definition(\n self, module: str, name: str, typ: RType, emitter: Emitter) -> str:\n static_name = emitter.static_name(name, module)\n # Here we rely on the fact that undefined value and error value are always the same\n if isinstance(typ, RTuple):\n # We need to inline because initializer must be static\n undefined = '{{ {} }}'.format(''.join(emitter.tuple_undefined_value_helper(typ)))\n else:\n undefined = emitter.c_undefined_value(typ)\n return '{}{} = {};'.format(emitter.ctype_spaced(typ), static_name, undefined)\n\n def declare_static_pyobject(self, identifier: str, emitter: Emitter) -> None:\n symbol = emitter.static_name(identifier, None)\n self.declare_global('PyObject *', symbol)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_sort_classes_sort_classes.return._mod_name_ir_ir_for_i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_sort_classes_sort_classes.return._mod_name_ir_ir_for_i", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitmodule.py", "file_name": "emitmodule.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1018, "end_line": 1029, "span_ids": ["sort_classes"], "tokens": 142}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def sort_classes(classes: List[Tuple[str, ClassIR]]) -> List[Tuple[str, ClassIR]]:\n mod_name = {ir: name for name, ir in classes}\n irs = [ir for _, ir in classes]\n deps = OrderedDict() # type: Dict[ClassIR, Set[ClassIR]]\n for ir in irs:\n if ir not in deps:\n deps[ir] = set()\n if ir.base:\n deps[ir].add(ir.base)\n deps[ir].update(ir.traits)\n sorted_irs = toposort(deps)\n return [(mod_name[ir], ir) for ir in sorted_irs]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitwrapper.py_generate_richcompare_wrapper_generate_richcompare_wrapper.return.name": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitwrapper.py_generate_richcompare_wrapper_generate_richcompare_wrapper.return.name", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitwrapper.py", "file_name": "emitwrapper.py", "file_type": "text/x-python", "category": "implementation", "start_line": 128, "end_line": 154, "span_ids": ["generate_richcompare_wrapper"], "tokens": 242}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_richcompare_wrapper(cl: ClassIR, emitter: Emitter) -> Optional[str]:\n \"\"\"Generates a wrapper for richcompare dunder methods.\"\"\"\n # Sort for determinism on Python 3.5\n matches = sorted([name for name in RICHCOMPARE_OPS if cl.has_method(name)])\n if not matches:\n return None\n\n name = '{}_RichCompare_{}'.format(DUNDER_PREFIX, cl.name_prefix(emitter.names))\n emitter.emit_line(\n 'static PyObject *{name}(PyObject *obj_lhs, PyObject *obj_rhs, int op) {{'.format(\n name=name)\n )\n emitter.emit_line('switch (op) {')\n for func in matches:\n emitter.emit_line('case {}: {{'.format(RICHCOMPARE_OPS[func]))\n method = cl.get_method(func)\n assert method is not None\n generate_wrapper_core(method, emitter, arg_names=['lhs', 'rhs'])\n emitter.emit_line('}')\n emitter.emit_line('}')\n\n emitter.emit_line('Py_INCREF(Py_NotImplemented);')\n emitter.emit_line('return Py_NotImplemented;')\n\n emitter.emit_line('}')\n\n return name", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitwrapper.py_generate_get_wrapper_generate_get_wrapper.return.name": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitwrapper.py_generate_get_wrapper_generate_get_wrapper.return.name", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitwrapper.py", "file_name": "emitwrapper.py", "file_type": "text/x-python", "category": "implementation", "start_line": 157, "end_line": 169, "span_ids": ["generate_get_wrapper"], "tokens": 143}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_get_wrapper(cl: ClassIR, fn: FuncIR, emitter: Emitter) -> str:\n \"\"\"Generates a wrapper for native __get__ methods.\"\"\"\n name = '{}{}{}'.format(DUNDER_PREFIX, fn.name, cl.name_prefix(emitter.names))\n emitter.emit_line(\n 'static PyObject *{name}(PyObject *self, PyObject *instance, PyObject *owner) {{'.\n format(name=name))\n emitter.emit_line('instance = instance ? instance : Py_None;')\n emitter.emit_line('return {}{}(self, instance, owner);'.format(\n NATIVE_PREFIX,\n fn.cname(emitter.names)))\n emitter.emit_line('}')\n\n return name", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitwrapper.py_generate_hash_wrapper_generate_hash_wrapper.return.name": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitwrapper.py_generate_hash_wrapper_generate_hash_wrapper.return.name", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitwrapper.py", "file_name": "emitwrapper.py", "file_type": "text/x-python", "category": "implementation", "start_line": 172, "end_line": 194, "span_ids": ["generate_hash_wrapper"], "tokens": 281}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_hash_wrapper(cl: ClassIR, fn: FuncIR, emitter: Emitter) -> str:\n \"\"\"Generates a wrapper for native __hash__ methods.\"\"\"\n name = '{}{}{}'.format(DUNDER_PREFIX, fn.name, cl.name_prefix(emitter.names))\n emitter.emit_line('static Py_ssize_t {name}(PyObject *self) {{'.format(\n name=name\n ))\n emitter.emit_line('{}retval = {}{}{}(self);'.format(emitter.ctype_spaced(fn.ret_type),\n emitter.get_group_prefix(fn.decl),\n NATIVE_PREFIX,\n fn.cname(emitter.names)))\n emitter.emit_error_check('retval', fn.ret_type, 'return -1;')\n if is_int_rprimitive(fn.ret_type):\n emitter.emit_line('Py_ssize_t val = CPyTagged_AsSsize_t(retval);')\n else:\n emitter.emit_line('Py_ssize_t val = PyLong_AsSsize_t(retval);')\n emitter.emit_dec_ref('retval', fn.ret_type)\n emitter.emit_line('if (PyErr_Occurred()) return -1;')\n # We can't return -1 from a hash function..\n emitter.emit_line('if (val == -1) return -2;')\n emitter.emit_line('return val;')\n emitter.emit_line('}')\n\n return name", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitwrapper.py_generate_bool_wrapper_generate_bool_wrapper.return.name": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitwrapper.py_generate_bool_wrapper_generate_bool_wrapper.return.name", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitwrapper.py", "file_name": "emitwrapper.py", "file_type": "text/x-python", "category": "implementation", "start_line": 197, "end_line": 214, "span_ids": ["generate_bool_wrapper"], "tokens": 217}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_bool_wrapper(cl: ClassIR, fn: FuncIR, emitter: Emitter) -> str:\n \"\"\"Generates a wrapper for native __bool__ methods.\"\"\"\n name = '{}{}{}'.format(DUNDER_PREFIX, fn.name, cl.name_prefix(emitter.names))\n emitter.emit_line('static int {name}(PyObject *self) {{'.format(\n name=name\n ))\n emitter.emit_line('{}val = {}{}(self);'.format(emitter.ctype_spaced(fn.ret_type),\n NATIVE_PREFIX,\n fn.cname(emitter.names)))\n emitter.emit_error_check('val', fn.ret_type, 'return -1;')\n # This wouldn't be that hard to fix but it seems unimportant and\n # getting error handling and unboxing right would be fiddly. (And\n # way easier to do in IR!)\n assert is_bool_rprimitive(fn.ret_type), \"Only bool return supported for __bool__\"\n emitter.emit_line('return val;')\n emitter.emit_line('}')\n\n return name", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitwrapper.py_generate_arg_check_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitwrapper.py_generate_arg_check_", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitwrapper.py", "file_name": "emitwrapper.py", "file_type": "text/x-python", "category": "implementation", "start_line": 266, "end_line": 295, "span_ids": ["generate_arg_check"], "tokens": 362}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_arg_check(name: str, typ: RType, emitter: Emitter,\n error_code: str, optional: bool = False) -> None:\n \"\"\"Insert a runtime check for argument and unbox if necessary.\n\n The object is named PyObject *obj_{}. This is expected to generate\n a value of name arg_{} (unboxed if necessary). For each primitive a runtime\n check ensures the correct type.\n \"\"\"\n if typ.is_unboxed:\n # Borrow when unboxing to avoid reference count manipulation.\n emitter.emit_unbox('obj_{}'.format(name), 'arg_{}'.format(name), typ,\n error_code, declare_dest=True, borrow=True, optional=optional)\n elif is_object_rprimitive(typ):\n # Object is trivial since any object is valid\n if optional:\n emitter.emit_line('PyObject *arg_{};'.format(name))\n emitter.emit_line('if (obj_{} == NULL) {{'.format(name))\n emitter.emit_line('arg_{} = {};'.format(name, emitter.c_error_value(typ)))\n emitter.emit_lines('} else {', 'arg_{} = obj_{}; '.format(name, name), '}')\n else:\n emitter.emit_line('PyObject *arg_{} = obj_{};'.format(name, name))\n else:\n emitter.emit_cast('obj_{}'.format(name), 'arg_{}'.format(name), typ,\n declare_dest=True, optional=optional)\n if optional:\n emitter.emit_line('if (obj_{} != NULL && arg_{} == NULL) {}'.format(\n name, name, error_code))\n else:\n emitter.emit_line('if (arg_{} == NULL) {}'.format(name, error_code))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/crash.py_from_typing_import_Iterat_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/crash.py_from_typing_import_Iterat_", "embedding": null, "metadata": {"file_path": "mypyc/crash.py", "file_name": "crash.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 32, "span_ids": ["imports", "crash_report", "catch_errors"], "tokens": 229}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from typing import Iterator\nfrom typing_extensions import NoReturn\n\nimport sys\nimport traceback\nfrom contextlib import contextmanager\n\n\n@contextmanager\ndef catch_errors(module_path: str, line: int) -> Iterator[None]:\n try:\n yield\n except Exception:\n crash_report(module_path, line)\n\n\ndef crash_report(module_path: str, line: int) -> 'NoReturn':\n # Adapted from report_internal_error in mypy\n err = sys.exc_info()[1]\n tb = traceback.extract_stack()[:-4]\n # Excise all the traceback from the test runner\n for i, x in enumerate(tb):\n if x.name == 'pytest_runtest_call':\n tb = tb[i + 1:]\n break\n tb2 = traceback.extract_tb(sys.exc_info()[2])[1:]\n print('Traceback (most recent call last):')\n for s in traceback.format_list(tb + tb2):\n print(s.rstrip('\\n'))\n print('{}:{}: {}: {}'.format(module_path, line, type(err).__name__, err))\n raise SystemExit(2)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/doc/conf.py__Configuration_file_for__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/doc/conf.py__Configuration_file_for__", "embedding": null, "metadata": {"file_path": "mypyc/doc/conf.py", "file_name": "conf.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 65, "span_ids": ["docstring"], "tokens": 505}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Configuration file for the Sphinx documentation builder.\n#\n# This file only contains a selection of the most common options. For a full\n# list see the documentation:\n# https://www.sphinx-doc.org/en/master/usage/configuration.html\n\nimport sys\nimport os\n\n# If extensions (or modules to document with autodoc) are in another directory,\n# add these directories to sys.path here. If the directory is relative to the\n# documentation root, use os.path.abspath to make it absolute, like shown here.\nsys.path.insert(0, os.path.abspath('../..'))\n\nfrom mypy.version import __version__ as mypy_version\n\n# -- Project information -----------------------------------------------------\n\nproject = 'mypyc'\ncopyright = '2020, mypyc team'\nauthor = 'mypyc team'\n\n# The version info for the project you're documenting, acts as replacement for\n# |version| and |release|, also used in various other places throughout the\n# built documents.\n#\n# The short X.Y version.\nversion = mypy_version.split('-')[0]\n# The full version, including alpha/beta/rc tags.\nrelease = mypy_version\n\n# -- General configuration ---------------------------------------------------\n\n# Add any Sphinx extension module names here, as strings. They can be\n# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom\n# ones.\nextensions = [ # type: ignore\n]\n\n# Add any paths that contain templates here, relative to this directory.\ntemplates_path = ['_templates']\n\n# List of patterns, relative to source directory, that match files and\n# directories to ignore when looking for source files.\n# This pattern also affects html_static_path and html_extra_path.\nexclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']\n\n\n# -- Options for HTML output -------------------------------------------------\n\n# The theme to use for HTML and HTML Help pages. See the documentation for\n# a list of builtin themes.\ntry:\n import sphinx_rtd_theme # type: ignore\nexcept:\n html_theme = 'default'\nelse:\n html_theme = 'sphinx_rtd_theme'\n html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]\n\n# Add any paths that contain custom static files (such as style sheets) here,\n# relative to this directory. They are copied after the builtin static files,\n# so a file named \"default.css\" will overwrite the builtin \"default.css\".\nhtml_static_path = ['_static']", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/errors.py_from_typing_import_List_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/errors.py_from_typing_import_List_", "embedding": null, "metadata": {"file_path": "mypyc/errors.py", "file_name": "errors.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 26, "span_ids": ["Errors.__init__", "Errors.flush_errors", "imports", "Errors.warning", "Errors.error", "Errors", "Errors.new_messages"], "tokens": 180}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from typing import List\n\nimport mypy.errors\n\n\nclass Errors:\n def __init__(self) -> None:\n self.num_errors = 0\n self.num_warnings = 0\n self._errors = mypy.errors.Errors()\n\n def error(self, msg: str, path: str, line: int) -> None:\n self._errors.report(line, None, msg, severity='error', file=path)\n self.num_errors += 1\n\n def warning(self, msg: str, path: str, line: int) -> None:\n self._errors.report(line, None, msg, severity='warning', file=path)\n self.num_warnings += 1\n\n def new_messages(self) -> List[str]:\n return self._errors.new_messages()\n\n def flush_errors(self) -> None:\n for error in self.new_messages():\n print(error)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/class_ir.py__Intermediate_represent_VTableMethod.NamedTuple_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/class_ir.py__Intermediate_represent_VTableMethod.NamedTuple_", "embedding": null, "metadata": {"file_path": "mypyc/ir/class_ir.py", "file_name": "class_ir.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 76, "span_ids": ["docstring:35", "docstring"], "tokens": 820}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Intermediate representation of classes.\"\"\"\n\nfrom typing import List, Optional, Set, Tuple, Dict, NamedTuple\nfrom mypy.ordered_dict import OrderedDict\n\nfrom mypyc.common import JsonDict\nfrom mypyc.ir.ops import Value, DeserMaps\nfrom mypyc.ir.rtypes import RType, RInstance, deserialize_type\nfrom mypyc.ir.func_ir import FuncIR, FuncDecl, FuncSignature\nfrom mypyc.namegen import NameGenerator, exported_name\nfrom mypyc.common import PROPSET_PREFIX\n\n\n# Some notes on the vtable layout: Each concrete class has a vtable\n# that contains function pointers for its methods. So that subclasses\n# may be efficiently used when their parent class is expected, the\n# layout of child vtables must be an extension of their base class's\n# vtable.\n#\n# This makes multiple inheritance tricky, since obviously we cannot be\n# an extension of multiple parent classes. We solve this by requriing\n# all but one parent to be \"traits\", which we can operate on in a\n# somewhat less efficient way. For each trait implemented by a class,\n# we generate a separate vtable for the methods in that trait.\n# We then store an array of (trait type, trait vtable) pointers alongside\n# a class's main vtable. When we want to call a trait method, we\n# (at runtime!) search the array of trait vtables to find the correct one,\n# then call through it.\n# Trait vtables additionally need entries for attribute getters and setters,\n# since they can't always be in the same location.\n#\n# To keep down the number of indirections necessary, we store the\n# array of trait vtables in the memory *before* the class vtable, and\n# search it backwards. (This is a trick we can only do once---there\n# are only two directions to store data in---but I don't think we'll\n# need it again.)\n# There are some tricks we could try in the future to store the trait\n# vtables inline in the trait table (which would cut down one indirection),\n# but this seems good enough for now.\n#\n# As an example:\n# Imagine that we have a class B that inherits from a concrete class A\n# and traits T1 and T2, and that A has methods foo() and\n# bar() and B overrides bar() with a more specific type.\n# Then B's vtable will look something like:\n#\n# T1 type object\n# ptr to B's T1 trait vtable\n# T2 type object\n# ptr to B's T2 trait vtable\n# -> | A.foo\n# | Glue function that converts between A.bar's type and B.bar\n# B.bar\n# B.baz\n#\n# The arrow points to the \"start\" of the vtable (what vtable pointers\n# point to) and the bars indicate which parts correspond to the parent\n# class A's vtable layout.\n#\n# Classes that allow interpreted code to subclass them also have a\n# \"shadow vtable\" that contains implementations that delegate to\n# making a pycall, so that overridden methods in interpreted children\n# will be called. (A better strategy could dynamically generate these\n# vtables based on which methods are overridden in the children.)\n\n# Descriptions of method and attribute entries in class vtables.\n# The 'cls' field is the class that the method/attr was defined in,\n# which might be a parent class.\n# The 'shadow_method', if present, contains the method that should be\n# placed in the class's shadow vtable (if it has one).\n\nVTableMethod = NamedTuple(\n 'VTableMethod', [('cls', 'ClassIR'),\n ('name', str),\n ('method', FuncIR),\n ('shadow_method', Optional[FuncIR])])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/class_ir.py_VTableEntries_ClassIR.__init__._type_Optional_List_Cla": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/class_ir.py_VTableEntries_ClassIR.__init__._type_Optional_List_Cla", "embedding": null, "metadata": {"file_path": "mypyc/ir/class_ir.py", "file_name": "class_ir.py", "file_type": "text/x-python", "category": "implementation", "start_line": 78, "end_line": 148, "span_ids": ["ClassIR.__init__", "ClassIR", "docstring:35"], "tokens": 869}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "VTableEntries = List[VTableMethod]\n\n\nclass ClassIR:\n \"\"\"Intermediate representation of a class.\n\n This also describes the runtime structure of native instances.\n \"\"\"\n\n def __init__(self, name: str, module_name: str, is_trait: bool = False,\n is_generated: bool = False, is_abstract: bool = False,\n is_ext_class: bool = True) -> None:\n self.name = name\n self.module_name = module_name\n self.is_trait = is_trait\n self.is_generated = is_generated\n self.is_abstract = is_abstract\n self.is_ext_class = is_ext_class\n # An augmented class has additional methods separate from what mypyc generates.\n # Right now the only one is dataclasses.\n self.is_augmented = False\n # Does this inherit from a Python class?\n self.inherits_python = False\n # Do instances of this class have __dict__?\n self.has_dict = False\n # Do we allow interpreted subclasses? Derived from a mypyc_attr.\n self.allow_interpreted_subclasses = False\n # If this a subclass of some built-in python class, the name\n # of the object for that class. We currently only support this\n # in a few ad-hoc cases.\n self.builtin_base = None # type: Optional[str]\n # Default empty constructor\n self.ctor = FuncDecl(name, None, module_name, FuncSignature([], RInstance(self)))\n\n self.attributes = OrderedDict() # type: OrderedDict[str, RType]\n # We populate method_types with the signatures of every method before\n # we generate methods, and we rely on this information being present.\n self.method_decls = OrderedDict() # type: OrderedDict[str, FuncDecl]\n # Map of methods that are actually present in an extension class\n self.methods = OrderedDict() # type: OrderedDict[str, FuncIR]\n # Glue methods for boxing/unboxing when a class changes the type\n # while overriding a method. Maps from (parent class overrided, method)\n # to IR of glue method.\n self.glue_methods = OrderedDict() # type: Dict[Tuple[ClassIR, str], FuncIR]\n\n # Properties are accessed like attributes, but have behavior like method calls.\n # They don't belong in the methods dictionary, since we don't want to expose them to\n # Python's method API. But we want to put them into our own vtable as methods, so that\n # they are properly handled and overridden. The property dictionary values are a tuple\n # containing a property getter and an optional property setter.\n self.properties = OrderedDict() # type: OrderedDict[str, Tuple[FuncIR, Optional[FuncIR]]]\n # We generate these in prepare_class_def so that we have access to them when generating\n # other methods and properties that rely on these types.\n self.property_types = OrderedDict() # type: OrderedDict[str, RType]\n\n self.vtable = None # type: Optional[Dict[str, int]]\n self.vtable_entries = [] # type: VTableEntries\n self.trait_vtables = OrderedDict() # type: OrderedDict[ClassIR, VTableEntries]\n # N.B: base might not actually quite be the direct base.\n # It is the nearest concrete base, but we allow a trait in between.\n self.base = None # type: Optional[ClassIR]\n self.traits = [] # type: List[ClassIR]\n # Supply a working mro for most generated classes. Real classes will need to\n # fix it up.\n self.mro = [self] # type: List[ClassIR]\n # base_mro is the chain of concrete (non-trait) ancestors\n self.base_mro = [self] # type: List[ClassIR]\n\n # Direct subclasses of this class (use subclasses() to also incude non-direct ones)\n # None if separate compilation prevents this from working\n self.children = [] # type: Optional[List[ClassIR]]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/class_ir.py_ClassIR.fullname_ClassIR.get_method.return.res_0_if_res_else_None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/class_ir.py_ClassIR.fullname_ClassIR.get_method.return.res_0_if_res_else_None", "embedding": null, "metadata": {"file_path": "mypyc/ir/class_ir.py", "file_name": "class_ir.py", "file_type": "text/x-python", "category": "implementation", "start_line": 150, "end_line": 229, "span_ids": ["ClassIR.name_prefix", "ClassIR.real_base", "ClassIR.method_decl", "ClassIR.method_sig", "ClassIR.get_method", "ClassIR.has_attr", "ClassIR.is_method_final", "ClassIR.attr_type", "ClassIR.struct_name", "ClassIR.fullname", "ClassIR.attr_details", "ClassIR.vtable_entry", "ClassIR.get_method_and_class", "ClassIR.has_method"], "tokens": 641}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ClassIR:\n\n @property\n def fullname(self) -> str:\n return \"{}.{}\".format(self.module_name, self.name)\n\n def real_base(self) -> Optional['ClassIR']:\n \"\"\"Return the actual concrete base class, if there is one.\"\"\"\n if len(self.mro) > 1 and not self.mro[1].is_trait:\n return self.mro[1]\n return None\n\n def vtable_entry(self, name: str) -> int:\n assert self.vtable is not None, \"vtable not computed yet\"\n assert name in self.vtable, '%r has no attribute %r' % (self.name, name)\n return self.vtable[name]\n\n def attr_details(self, name: str) -> Tuple[RType, 'ClassIR']:\n for ir in self.mro:\n if name in ir.attributes:\n return ir.attributes[name], ir\n if name in ir.property_types:\n return ir.property_types[name], ir\n raise KeyError('%r has no attribute %r' % (self.name, name))\n\n def attr_type(self, name: str) -> RType:\n return self.attr_details(name)[0]\n\n def method_decl(self, name: str) -> FuncDecl:\n for ir in self.mro:\n if name in ir.method_decls:\n return ir.method_decls[name]\n raise KeyError('%r has no attribute %r' % (self.name, name))\n\n def method_sig(self, name: str) -> FuncSignature:\n return self.method_decl(name).sig\n\n def has_method(self, name: str) -> bool:\n try:\n self.method_decl(name)\n except KeyError:\n return False\n return True\n\n def is_method_final(self, name: str) -> bool:\n subs = self.subclasses()\n if subs is None:\n # TODO: Look at the final attribute!\n return False\n\n if self.has_method(name):\n method_decl = self.method_decl(name)\n for subc in subs:\n if subc.method_decl(name) != method_decl:\n return False\n return True\n else:\n return not any(subc.has_method(name) for subc in subs)\n\n def has_attr(self, name: str) -> bool:\n try:\n self.attr_type(name)\n except KeyError:\n return False\n return True\n\n def name_prefix(self, names: NameGenerator) -> str:\n return names.private_name(self.module_name, self.name)\n\n def struct_name(self, names: NameGenerator) -> str:\n return '{}Object'.format(exported_name(self.fullname))\n\n def get_method_and_class(self, name: str) -> Optional[Tuple[FuncIR, 'ClassIR']]:\n for ir in self.mro:\n if name in ir.methods:\n return ir.methods[name], ir\n\n return None\n\n def get_method(self, name: str) -> Optional[FuncIR]:\n res = self.get_method_and_class(name)\n return res[0] if res else None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/class_ir.py_ClassIR.subclasses_ClassIR.subclasses.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/class_ir.py_ClassIR.subclasses_ClassIR.subclasses.return.result", "embedding": null, "metadata": {"file_path": "mypyc/ir/class_ir.py", "file_name": "class_ir.py", "file_type": "text/x-python", "category": "implementation", "start_line": 231, "end_line": 246, "span_ids": ["ClassIR.subclasses"], "tokens": 124}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ClassIR:\n\n def subclasses(self) -> Optional[Set['ClassIR']]:\n \"\"\"Return all subclassses of this class, both direct and indirect.\n\n Return None if it is impossible to identify all subclasses, for example\n because we are performing separate compilation.\n \"\"\"\n if self.children is None or self.allow_interpreted_subclasses:\n return None\n result = set(self.children)\n for child in self.children:\n if child.children:\n child_subs = child.subclasses()\n if child_subs is None:\n return None\n result.update(child_subs)\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/class_ir.py_ClassIR.concrete_subclasses_ClassIR.concrete_subclasses.return.sorted_concrete_key_lamb": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/class_ir.py_ClassIR.concrete_subclasses_ClassIR.concrete_subclasses.return.sorted_concrete_key_lamb", "embedding": null, "metadata": {"file_path": "mypyc/ir/class_ir.py", "file_name": "class_ir.py", "file_type": "text/x-python", "category": "implementation", "start_line": 248, "end_line": 260, "span_ids": ["ClassIR.concrete_subclasses"], "tokens": 152}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ClassIR:\n\n def concrete_subclasses(self) -> Optional[List['ClassIR']]:\n \"\"\"Return all concrete (i.e. non-trait and non-abstract) subclasses.\n\n Include both direct and indirect subclasses. Place classes with no children first.\n \"\"\"\n subs = self.subclasses()\n if subs is None:\n return None\n concrete = {c for c in subs if not (c.is_trait or c.is_abstract)}\n # We place classes with no children first because they are more likely\n # to appear in various isinstance() checks. We then sort leafs by name\n # to get stable order.\n return sorted(concrete, key=lambda c: (len(c.children or []), c.name))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/class_ir.py_ClassIR.serialize_ClassIR.serialize.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/class_ir.py_ClassIR.serialize_ClassIR.serialize.return._", "embedding": null, "metadata": {"file_path": "mypyc/ir/class_ir.py", "file_name": "class_ir.py", "file_type": "text/x-python", "category": "implementation", "start_line": 262, "end_line": 308, "span_ids": ["ClassIR.serialize"], "tokens": 520}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ClassIR:\n\n def serialize(self) -> JsonDict:\n return {\n 'name': self.name,\n 'module_name': self.module_name,\n 'is_trait': self.is_trait,\n 'is_ext_class': self.is_ext_class,\n 'is_abstract': self.is_abstract,\n 'is_generated': self.is_generated,\n 'is_augmented': self.is_augmented,\n 'inherits_python': self.inherits_python,\n 'has_dict': self.has_dict,\n 'allow_interpreted_subclasses': self.allow_interpreted_subclasses,\n 'builtin_base': self.builtin_base,\n 'ctor': self.ctor.serialize(),\n # We serialize dicts as lists to ensure order is preserved\n 'attributes': [(k, t.serialize()) for k, t in self.attributes.items()],\n # We try to serialize a name reference, but if the decl isn't in methods\n # then we can't be sure that will work so we serialize the whole decl.\n 'method_decls': [(k, d.fullname if k in self.methods else d.serialize())\n for k, d in self.method_decls.items()],\n # We serialize method fullnames out and put methods in a separate dict\n 'methods': [(k, m.fullname) for k, m in self.methods.items()],\n 'glue_methods': [\n ((cir.fullname, k), m.fullname)\n for (cir, k), m in self.glue_methods.items()\n ],\n\n # We serialize properties and property_types separately out of an\n # abundance of caution about preserving dict ordering...\n 'property_types': [(k, t.serialize()) for k, t in self.property_types.items()],\n 'properties': list(self.properties),\n\n 'vtable': self.vtable,\n 'vtable_entries': serialize_vtable(self.vtable_entries),\n 'trait_vtables': [\n (cir.fullname, serialize_vtable(v)) for cir, v in self.trait_vtables.items()\n ],\n\n # References to class IRs are all just names\n 'base': self.base.fullname if self.base else None,\n 'traits': [cir.fullname for cir in self.traits],\n 'mro': [cir.fullname for cir in self.mro],\n 'base_mro': [cir.fullname for cir in self.base_mro],\n 'children': [\n cir.fullname for cir in self.children\n ] if self.children is not None else None,\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/class_ir.py_ClassIR.deserialize_ClassIR.deserialize.return.ir": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/class_ir.py_ClassIR.deserialize_ClassIR.deserialize.return.ir", "embedding": null, "metadata": {"file_path": "mypyc/ir/class_ir.py", "file_name": "class_ir.py", "file_type": "text/x-python", "category": "implementation", "start_line": 310, "end_line": 356, "span_ids": ["ClassIR.deserialize"], "tokens": 544}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ClassIR:\n\n @classmethod\n def deserialize(cls, data: JsonDict, ctx: 'DeserMaps') -> 'ClassIR':\n fullname = data['module_name'] + '.' + data['name']\n assert fullname in ctx.classes, \"Class %s not in deser class map\" % fullname\n ir = ctx.classes[fullname]\n\n ir.is_trait = data['is_trait']\n ir.is_generated = data['is_generated']\n ir.is_abstract = data['is_abstract']\n ir.is_ext_class = data['is_ext_class']\n ir.is_augmented = data['is_augmented']\n ir.inherits_python = data['inherits_python']\n ir.has_dict = data['has_dict']\n ir.allow_interpreted_subclasses = data['allow_interpreted_subclasses']\n ir.builtin_base = data['builtin_base']\n ir.ctor = FuncDecl.deserialize(data['ctor'], ctx)\n ir.attributes = OrderedDict(\n (k, deserialize_type(t, ctx)) for k, t in data['attributes']\n )\n ir.method_decls = OrderedDict((k, ctx.functions[v].decl\n if isinstance(v, str) else FuncDecl.deserialize(v, ctx))\n for k, v in data['method_decls'])\n ir.methods = OrderedDict((k, ctx.functions[v]) for k, v in data['methods'])\n ir.glue_methods = OrderedDict(\n ((ctx.classes[c], k), ctx.functions[v]) for (c, k), v in data['glue_methods']\n )\n ir.property_types = OrderedDict(\n (k, deserialize_type(t, ctx)) for k, t in data['property_types']\n )\n ir.properties = OrderedDict(\n (k, (ir.methods[k], ir.methods.get(PROPSET_PREFIX + k))) for k in data['properties']\n )\n\n ir.vtable = data['vtable']\n ir.vtable_entries = deserialize_vtable(data['vtable_entries'], ctx)\n ir.trait_vtables = OrderedDict(\n (ctx.classes[k], deserialize_vtable(v, ctx)) for k, v in data['trait_vtables']\n )\n\n base = data['base']\n ir.base = ctx.classes[base] if base else None\n ir.traits = [ctx.classes[s] for s in data['traits']]\n ir.mro = [ctx.classes[s] for s in data['mro']]\n ir.base_mro = [ctx.classes[s] for s in data['base_mro']]\n ir.children = data['children'] and [ctx.classes[s] for s in data['children']]\n\n return ir", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/class_ir.py_NonExtClassInfo_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/class_ir.py_NonExtClassInfo_", "embedding": null, "metadata": {"file_path": "mypyc/ir/class_ir.py", "file_name": "class_ir.py", "file_type": "text/x-python", "category": "implementation", "start_line": 359, "end_line": 407, "span_ids": ["deserialize_vtable", "deserialize_vtable_entry", "serialize_vtable", "serialize_vtable_entry", "NonExtClassInfo", "all_concrete_classes", "NonExtClassInfo.__init__"], "tokens": 421}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class NonExtClassInfo:\n \"\"\"Information needed to construct a non-extension class (Python class).\n\n Includes the class dictionary, a tuple of base classes,\n the class annotations dictionary, and the metaclass.\n \"\"\"\n\n def __init__(self, dict: Value, bases: Value, anns: Value, metaclass: Value) -> None:\n self.dict = dict\n self.bases = bases\n self.anns = anns\n self.metaclass = metaclass\n\n\ndef serialize_vtable_entry(entry: VTableMethod) -> JsonDict:\n return {\n '.class': 'VTableMethod',\n 'cls': entry.cls.fullname,\n 'name': entry.name,\n 'method': entry.method.decl.fullname,\n 'shadow_method': entry.shadow_method.decl.fullname if entry.shadow_method else None,\n }\n\n\ndef serialize_vtable(vtable: VTableEntries) -> List[JsonDict]:\n return [serialize_vtable_entry(v) for v in vtable]\n\n\ndef deserialize_vtable_entry(data: JsonDict, ctx: 'DeserMaps') -> VTableMethod:\n if data['.class'] == 'VTableMethod':\n return VTableMethod(\n ctx.classes[data['cls']], data['name'], ctx.functions[data['method']],\n ctx.functions[data['shadow_method']] if data['shadow_method'] else None)\n assert False, \"Bogus vtable .class: %s\" % data['.class']\n\n\ndef deserialize_vtable(data: List[JsonDict], ctx: 'DeserMaps') -> VTableEntries:\n return [deserialize_vtable_entry(x, ctx) for x in data]\n\n\ndef all_concrete_classes(class_ir: ClassIR) -> Optional[List[ClassIR]]:\n \"\"\"Return all concrete classes among the class itself and its subclasses.\"\"\"\n concrete = class_ir.concrete_subclasses()\n if concrete is None:\n return None\n if not (class_ir.is_abstract or class_ir.is_trait):\n concrete.append(class_ir)\n return concrete", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/func_ir.py_FuncSignature_FUNC_CLASSMETHOD.2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/func_ir.py_FuncSignature_FUNC_CLASSMETHOD.2", "embedding": null, "metadata": {"file_path": "mypyc/ir/func_ir.py", "file_name": "func_ir.py", "file_type": "text/x-python", "category": "implementation", "start_line": 48, "end_line": 73, "span_ids": ["FuncSignature.__repr__", "FuncSignature.serialize", "impl", "FuncSignature.__init__", "FuncSignature.deserialize", "FuncSignature"], "tokens": 212}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FuncSignature:\n \"\"\"Signature of a function in IR.\"\"\"\n\n # TODO: Track if method?\n\n def __init__(self, args: Sequence[RuntimeArg], ret_type: RType) -> None:\n self.args = tuple(args)\n self.ret_type = ret_type\n\n def __repr__(self) -> str:\n return 'FuncSignature(args=%r, ret=%r)' % (self.args, self.ret_type)\n\n def serialize(self) -> JsonDict:\n return {'args': [t.serialize() for t in self.args], 'ret_type': self.ret_type.serialize()}\n\n @classmethod\n def deserialize(cls, data: JsonDict, ctx: DeserMaps) -> 'FuncSignature':\n return FuncSignature(\n [RuntimeArg.deserialize(arg, ctx) for arg in data['args']],\n deserialize_type(data['ret_type'], ctx),\n )\n\n\nFUNC_NORMAL = 0 # type: Final\nFUNC_STATICMETHOD = 1 # type: Final\nFUNC_CLASSMETHOD = 2", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/func_ir.py_None_3_FuncDecl.deserialize.return.FuncDecl_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/func_ir.py_None_3_FuncDecl.deserialize.return.FuncDecl_", "embedding": null, "metadata": {"file_path": "mypyc/ir/func_ir.py", "file_name": "func_ir.py", "file_type": "text/x-python", "category": "implementation", "start_line": 73, "end_line": 146, "span_ids": ["FuncDecl.fullname", "impl", "FuncDecl.shortname", "FuncDecl.__init__", "FuncDecl.serialize", "FuncDecl.deserialize", "FuncDecl.get_name_from_json", "FuncDecl", "FuncDecl.cname", "FuncDecl.compute_shortname"], "tokens": 554}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": " # type: Final\n\n\nclass FuncDecl:\n \"\"\"Declaration of a function in IR (without body or implementation).\n\n A function can be a regular module-level function, a method, a\n static method, a class method, or a property getter/setter.\n \"\"\"\n\n def __init__(self,\n name: str,\n class_name: Optional[str],\n module_name: str,\n sig: FuncSignature,\n kind: int = FUNC_NORMAL,\n is_prop_setter: bool = False,\n is_prop_getter: bool = False) -> None:\n self.name = name\n self.class_name = class_name\n self.module_name = module_name\n self.sig = sig\n self.kind = kind\n self.is_prop_setter = is_prop_setter\n self.is_prop_getter = is_prop_getter\n if class_name is None:\n self.bound_sig = None # type: Optional[FuncSignature]\n else:\n if kind == FUNC_STATICMETHOD:\n self.bound_sig = sig\n else:\n self.bound_sig = FuncSignature(sig.args[1:], sig.ret_type)\n\n @staticmethod\n def compute_shortname(class_name: Optional[str], name: str) -> str:\n return class_name + '.' + name if class_name else name\n\n @property\n def shortname(self) -> str:\n return FuncDecl.compute_shortname(self.class_name, self.name)\n\n @property\n def fullname(self) -> str:\n return self.module_name + '.' + self.shortname\n\n def cname(self, names: NameGenerator) -> str:\n return names.private_name(self.module_name, self.shortname)\n\n def serialize(self) -> JsonDict:\n return {\n 'name': self.name,\n 'class_name': self.class_name,\n 'module_name': self.module_name,\n 'sig': self.sig.serialize(),\n 'kind': self.kind,\n 'is_prop_setter': self.is_prop_setter,\n 'is_prop_getter': self.is_prop_getter,\n }\n\n @staticmethod\n def get_name_from_json(f: JsonDict) -> str:\n return f['module_name'] + '.' + FuncDecl.compute_shortname(f['class_name'], f['name'])\n\n @classmethod\n def deserialize(cls, data: JsonDict, ctx: DeserMaps) -> 'FuncDecl':\n return FuncDecl(\n data['name'],\n data['class_name'],\n data['module_name'],\n FuncSignature.deserialize(data['sig'], ctx),\n data['kind'],\n data['is_prop_setter'],\n data['is_prop_getter'],\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/func_ir.py_FuncIR_FuncIR.deserialize.return.FuncIR_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/func_ir.py_FuncIR_FuncIR.deserialize.return.FuncIR_", "embedding": null, "metadata": {"file_path": "mypyc/ir/func_ir.py", "file_name": "func_ir.py", "file_type": "text/x-python", "category": "implementation", "start_line": 147, "end_line": 220, "span_ids": ["FuncIR", "FuncIR.cname", "FuncIR.__repr__", "FuncIR.ret_type", "FuncIR.name", "FuncIR.fullname", "FuncIR.args", "FuncIR.deserialize", "FuncIR.serialize", "FuncIR.sig", "FuncIR.class_name", "FuncIR.__init__"], "tokens": 486}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FuncIR:\n \"\"\"Intermediate representation of a function with contextual information.\n\n Unlike FuncDecl, this includes the IR of the body (basic blocks).\n \"\"\"\n\n def __init__(self,\n decl: FuncDecl,\n arg_regs: List[Register],\n blocks: List[BasicBlock],\n line: int = -1,\n traceback_name: Optional[str] = None) -> None:\n # Declaration of the function, including the signature\n self.decl = decl\n # Registers for all the arguments to the function\n self.arg_regs = arg_regs\n # Body of the function\n self.blocks = blocks\n self.line = line\n # The name that should be displayed for tracebacks that\n # include this function. Function will be omitted from\n # tracebacks if None.\n self.traceback_name = traceback_name\n\n @property\n def args(self) -> Sequence[RuntimeArg]:\n return self.decl.sig.args\n\n @property\n def ret_type(self) -> RType:\n return self.decl.sig.ret_type\n\n @property\n def class_name(self) -> Optional[str]:\n return self.decl.class_name\n\n @property\n def sig(self) -> FuncSignature:\n return self.decl.sig\n\n @property\n def name(self) -> str:\n return self.decl.name\n\n @property\n def fullname(self) -> str:\n return self.decl.fullname\n\n def cname(self, names: NameGenerator) -> str:\n return self.decl.cname(names)\n\n def __repr__(self) -> str:\n if self.class_name:\n return ''.format(self.class_name, self.name)\n else:\n return ''.format(self.name)\n\n def serialize(self) -> JsonDict:\n # We don't include blocks in the serialized version\n return {\n 'decl': self.decl.serialize(),\n 'line': self.line,\n 'traceback_name': self.traceback_name,\n }\n\n @classmethod\n def deserialize(cls, data: JsonDict, ctx: DeserMaps) -> 'FuncIR':\n return FuncIR(\n FuncDecl.deserialize(data['decl'], ctx),\n [],\n [],\n data['line'],\n data['traceback_name'],\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/module_ir.py__Intermediate_represent_ModuleIR.deserialize.return.ModuleIR_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/module_ir.py__Intermediate_represent_ModuleIR.deserialize.return.ModuleIR_", "embedding": null, "metadata": {"file_path": "mypyc/ir/module_ir.py", "file_name": "module_ir.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 45, "span_ids": ["ModuleIR", "ModuleIR.__init__", "ModuleIR.serialize", "ModuleIR.deserialize", "docstring"], "tokens": 349}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Intermediate representation of modules.\"\"\"\n\nfrom typing import List, Tuple, Dict\n\nfrom mypyc.common import JsonDict\nfrom mypyc.ir.ops import DeserMaps\nfrom mypyc.ir.rtypes import RType, deserialize_type\nfrom mypyc.ir.func_ir import FuncIR, FuncDecl\nfrom mypyc.ir.class_ir import ClassIR\n\n\nclass ModuleIR:\n \"\"\"Intermediate representation of a module.\"\"\"\n\n def __init__(\n self,\n fullname: str,\n imports: List[str],\n functions: List[FuncIR],\n classes: List[ClassIR],\n final_names: List[Tuple[str, RType]]) -> None:\n self.fullname = fullname\n self.imports = imports[:]\n self.functions = functions\n self.classes = classes\n self.final_names = final_names\n\n def serialize(self) -> JsonDict:\n return {\n 'fullname': self.fullname,\n 'imports': self.imports,\n 'functions': [f.serialize() for f in self.functions],\n 'classes': [c.serialize() for c in self.classes],\n 'final_names': [(k, t.serialize()) for k, t in self.final_names],\n }\n\n @classmethod\n def deserialize(cls, data: JsonDict, ctx: DeserMaps) -> 'ModuleIR':\n return ModuleIR(\n data['fullname'],\n data['imports'],\n [ctx.functions[FuncDecl.get_name_from_json(f['decl'])] for f in data['functions']],\n [ClassIR.deserialize(c, ctx) for c in data['classes']],\n [(k, deserialize_type(t, ctx)) for k, t in data['final_names']],\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/module_ir.py_deserialize_modules_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/module_ir.py_deserialize_modules_", "embedding": null, "metadata": {"file_path": "mypyc/ir/module_ir.py", "file_name": "module_ir.py", "file_type": "text/x-python", "category": "implementation", "start_line": 48, "end_line": 85, "span_ids": ["deserialize_modules", "impl"], "tokens": 362}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def deserialize_modules(data: Dict[str, JsonDict], ctx: DeserMaps) -> Dict[str, ModuleIR]:\n \"\"\"Deserialize a collection of modules.\n\n The modules can contain dependencies on each other.\n\n Arguments:\n data: A dict containing the modules to deserialize.\n ctx: The deserialization maps to use and to populate.\n They are populated with information from the deserialized\n modules and as a precondition must have been populated by\n deserializing any dependencies of the modules being deserialized\n (outside of dependencies between the modules themselves).\n\n Returns a map containing the deserialized modules.\n \"\"\"\n for mod in data.values():\n # First create ClassIRs for every class so that we can construct types and whatnot\n for cls in mod['classes']:\n ir = ClassIR(cls['name'], cls['module_name'])\n assert ir.fullname not in ctx.classes, \"Class %s already in map\" % ir.fullname\n ctx.classes[ir.fullname] = ir\n\n for mod in data.values():\n # Then deserialize all of the functions so that methods are available\n # to the class deserialization.\n for method in mod['functions']:\n func = FuncIR.deserialize(method, ctx)\n assert func.decl.fullname not in ctx.functions, (\n \"Method %s already in map\" % func.decl.fullname)\n ctx.functions[func.decl.fullname] = func\n\n return {k: ModuleIR.deserialize(v, ctx) for k, v in data.items()}\n\n\n# ModulesIRs should also always be an *OrderedDict*, but if we\n# declared it that way we would need to put it in quotes everywhere...\nModuleIRs = Dict[str, ModuleIR]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_BasicBlock_BasicBlock.terminated.return.bool_self_ops_and_isinst": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_BasicBlock_BasicBlock.terminated.return.bool_self_ops_and_isinst", "embedding": null, "metadata": {"file_path": "mypyc/ir/ops.py", "file_name": "ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 34, "end_line": 76, "span_ids": ["BasicBlock", "BasicBlock.terminated", "BasicBlock.__init__"], "tokens": 389}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BasicBlock:\n \"\"\"IR basic block.\n\n Contains a sequence of Ops and ends with a ControlOp (Goto,\n Branch, Return or Unreachable). Only the last op can be a\n ControlOp.\n\n All generated Ops live in basic blocks. Basic blocks determine the\n order of evaluation and control flow within a function. A basic\n block is always associated with a single function/method (FuncIR).\n\n When building the IR, ops that raise exceptions can be included in\n the middle of a basic block, but the exceptions aren't checked.\n Afterwards we perform a transform that inserts explicit checks for\n all error conditions and splits basic blocks accordingly to preserve\n the invariant that a jump, branch or return can only ever appear\n as the final op in a block. Manually inserting error checking ops\n would be boring and error-prone.\n\n BasicBlocks have an error_handler attribute that determines where\n to jump if an error occurs. If none is specified, an error will\n propagate up out of the function. This is compiled away by the\n `exceptions` module.\n\n Block labels are used for pretty printing and emitting C code, and\n get filled in by those passes.\n\n Ops that may terminate the program aren't treated as exits.\n \"\"\"\n\n def __init__(self, label: int = -1) -> None:\n self.label = label\n self.ops = [] # type: List[Op]\n self.error_handler = None # type: Optional[BasicBlock]\n\n @property\n def terminated(self) -> bool:\n \"\"\"Does the block end with a jump, branch or return?\n\n This should always be true after the basic block has been fully built, but\n this is false during construction.\n \"\"\"\n return bool(self.ops) and isinstance(self.ops[-1], ControlOp)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_Op_Op.accept.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_Op_Op.accept.pass", "embedding": null, "metadata": {"file_path": "mypyc/ir/ops.py", "file_name": "ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 168, "end_line": 206, "span_ids": ["Op.stolen", "Op", "Op.can_raise", "Op.sources", "Op.accept", "Op.__init__", "Op.unique_sources"], "tokens": 285}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Op(Value):\n \"\"\"Abstract base class for all IR operations.\n\n Each operation must be stored in a BasicBlock (in 'ops') to be\n active in the IR. This is different from non-Op values, including\n Register and Integer, where a reference from an active Op is\n sufficient to be considered active.\n\n In well-formed IR an active Op has no references to inactive ops\n or ops used in another function.\n \"\"\"\n\n def __init__(self, line: int) -> None:\n self.line = line\n\n def can_raise(self) -> bool:\n # Override this is if Op may raise an exception. Note that currently the fact that\n # only RegisterOps may raise an exception in hard coded in some places.\n return False\n\n @abstractmethod\n def sources(self) -> List[Value]:\n \"\"\"All the values the op may read.\"\"\"\n pass\n\n def stolen(self) -> List[Value]:\n \"\"\"Return arguments that have a reference count stolen by this op\"\"\"\n return []\n\n def unique_sources(self) -> List[Value]:\n result = [] # type: List[Value]\n for reg in self.sources():\n if reg not in result:\n result.append(reg)\n return result\n\n @abstractmethod\n def accept(self, visitor: 'OpVisitor[T]') -> T:\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_ControlOp_Goto.accept.return.visitor_visit_goto_self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_ControlOp_Goto.accept.return.visitor_visit_goto_self_", "embedding": null, "metadata": {"file_path": "mypyc/ir/ops.py", "file_name": "ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 229, "end_line": 254, "span_ids": ["Goto.sources", "Goto", "Goto.accept", "Goto.__repr__", "Goto.__init__", "ControlOp"], "tokens": 153}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ControlOp(Op):\n \"\"\"Control flow operation.\n\n This is Basically just for class hierarchy organization.\n\n We could plausibly have a targets() method if we wanted.\n \"\"\"\n\n\nclass Goto(ControlOp):\n \"\"\"Unconditional jump.\"\"\"\n\n error_kind = ERR_NEVER\n\n def __init__(self, label: BasicBlock, line: int = -1) -> None:\n super().__init__(line)\n self.label = label\n\n def __repr__(self) -> str:\n return '' % self.label.label\n\n def sources(self) -> List[Value]:\n return []\n\n def accept(self, visitor: 'OpVisitor[T]') -> T:\n return visitor.visit_goto(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_RegisterOp_RegisterOp.can_raise.return.self_error_kind_ERR_NE": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_RegisterOp_RegisterOp.can_raise.return.self_error_kind_ERR_NE", "embedding": null, "metadata": {"file_path": "mypyc/ir/ops.py", "file_name": "ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 354, "end_line": 376, "span_ids": ["RegisterOp.__init__", "RegisterOp", "RegisterOp.can_raise"], "tokens": 214}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RegisterOp(Op):\n \"\"\"Abstract base class for operations that can be written as r1 = f(r2, ..., rn).\n\n Takes some values, performs an operation, and generates an output\n (unless the 'type' attribute is void_rtype, which is the default).\n Other ops can refer to the result of the Op by referring to the Op\n instance. This doesn't do any explicit control flow, but can raise an\n error.\n\n Note that the operands can be arbitrary Values, not just Register\n instances, even though the naming may suggest otherwise.\n \"\"\"\n\n error_kind = -1 # Can this raise exception and how is it signalled; one of ERR_*\n\n _type = None # type: Optional[RType]\n\n def __init__(self, line: int) -> None:\n super().__init__(line)\n assert self.error_kind != -1, 'error_kind not defined'\n\n def can_raise(self) -> bool:\n return self.error_kind != ERR_NEVER", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_Call_Call.accept.return.visitor_visit_call_self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_Call_Call.accept.return.visitor_visit_call_self_", "embedding": null, "metadata": {"file_path": "mypyc/ir/ops.py", "file_name": "ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 421, "end_line": 439, "span_ids": ["Call.sources", "Call.__init__", "Call", "Call.accept"], "tokens": 132}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Call(RegisterOp):\n \"\"\"Native call f(arg, ...).\n\n The call target can be a module-level function or a class.\n \"\"\"\n\n error_kind = ERR_MAGIC\n\n def __init__(self, fn: 'FuncDecl', args: Sequence[Value], line: int) -> None:\n super().__init__(line)\n self.fn = fn\n self.args = list(args)\n self.type = fn.sig.ret_type\n\n def sources(self) -> List[Value]:\n return list(self.args[:])\n\n def accept(self, visitor: 'OpVisitor[T]') -> T:\n return visitor.visit_call(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_MethodCall_MethodCall.accept.return.visitor_visit_method_call": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_MethodCall_MethodCall.accept.return.visitor_visit_method_call", "embedding": null, "metadata": {"file_path": "mypyc/ir/ops.py", "file_name": "ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 442, "end_line": 467, "span_ids": ["MethodCall.__init__", "MethodCall", "MethodCall.sources", "MethodCall.accept"], "tokens": 200}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MethodCall(RegisterOp):\n \"\"\"Native method call obj.method(arg, ...)\"\"\"\n\n error_kind = ERR_MAGIC\n\n def __init__(self,\n obj: Value,\n method: str,\n args: List[Value],\n line: int = -1) -> None:\n super().__init__(line)\n self.obj = obj\n self.method = method\n self.args = args\n assert isinstance(obj.type, RInstance), \"Methods can only be called on instances\"\n self.receiver_type = obj.type\n method_ir = self.receiver_type.class_ir.method_sig(method)\n assert method_ir is not None, \"{} doesn't have method {}\".format(\n self.receiver_type.name, method)\n self.type = method_ir.ret_type\n\n def sources(self) -> List[Value]:\n return self.args[:] + [self.obj]\n\n def accept(self, visitor: 'OpVisitor[T]') -> T:\n return visitor.visit_method_call(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_Assign_Assign.accept.return.visitor_visit_assign_self": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_Assign_Assign.accept.return.visitor_visit_assign_self", "embedding": null, "metadata": {"file_path": "mypyc/ir/ops.py", "file_name": "ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 209, "end_line": 226, "span_ids": ["Assign.stolen", "Assign.accept", "Assign", "Assign.__init__", "Assign.sources"], "tokens": 125}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Assign(Op):\n \"\"\"Assign a value to a Register (dest = src).\"\"\"\n\n error_kind = ERR_NEVER\n\n def __init__(self, dest: Register, src: Value, line: int = -1) -> None:\n super().__init__(line)\n self.src = src\n self.dest = dest\n\n def sources(self) -> List[Value]:\n return [self.src]\n\n def stolen(self) -> List[Value]:\n return [self.src]\n\n def accept(self, visitor: 'OpVisitor[T]') -> T:\n return visitor.visit_assign(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_LoadErrorValue_LoadErrorValue.accept.return.visitor_visit_load_error_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_LoadErrorValue_LoadErrorValue.accept.return.visitor_visit_load_error_", "embedding": null, "metadata": {"file_path": "mypyc/ir/ops.py", "file_name": "ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 470, "end_line": 494, "span_ids": ["LoadErrorValue.sources", "LoadErrorValue.accept", "LoadErrorValue", "LoadErrorValue.__init__"], "tokens": 206}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LoadErrorValue(RegisterOp):\n \"\"\"Load an error value.\n\n Each type has one reserved value that signals an error (exception). This\n loads the error value for a specific type.\n \"\"\"\n\n error_kind = ERR_NEVER\n\n def __init__(self, rtype: RType, line: int = -1,\n is_borrowed: bool = False,\n undefines: bool = False) -> None:\n super().__init__(line)\n self.type = rtype\n self.is_borrowed = is_borrowed\n # Undefines is true if this should viewed by the definedness\n # analysis pass as making the register it is assigned to\n # undefined (and thus checks should be added on uses).\n self.undefines = undefines\n\n def sources(self) -> List[Value]:\n return []\n\n def accept(self, visitor: 'OpVisitor[T]') -> T:\n return visitor.visit_load_error_value(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_GetAttr_GetAttr.accept.return.visitor_visit_get_attr_se": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_GetAttr_GetAttr.accept.return.visitor_visit_get_attr_se", "embedding": null, "metadata": {"file_path": "mypyc/ir/ops.py", "file_name": "ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 497, "end_line": 514, "span_ids": ["GetAttr.__init__", "GetAttr.sources", "GetAttr", "GetAttr.accept"], "tokens": 145}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GetAttr(RegisterOp):\n \"\"\"obj.attr (for a native object)\"\"\"\n\n error_kind = ERR_MAGIC\n\n def __init__(self, obj: Value, attr: str, line: int) -> None:\n super().__init__(line)\n self.obj = obj\n self.attr = attr\n assert isinstance(obj.type, RInstance), 'Attribute access not supported: %s' % obj.type\n self.class_type = obj.type\n self.type = obj.type.attr_type(attr)\n\n def sources(self) -> List[Value]:\n return [self.obj]\n\n def accept(self, visitor: 'OpVisitor[T]') -> T:\n return visitor.visit_get_attr(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_SetAttr_NAMESPACE_MODULE._module_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_SetAttr_NAMESPACE_MODULE._module_", "embedding": null, "metadata": {"file_path": "mypyc/ir/ops.py", "file_name": "ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 517, "end_line": 551, "span_ids": ["SetAttr", "SetAttr.__init__", "impl:14", "SetAttr.accept", "SetAttr.stolen", "SetAttr.sources"], "tokens": 238}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SetAttr(RegisterOp):\n \"\"\"obj.attr = src (for a native object)\n\n Steals the reference to src.\n \"\"\"\n\n error_kind = ERR_FALSE\n\n def __init__(self, obj: Value, attr: str, src: Value, line: int) -> None:\n super().__init__(line)\n self.obj = obj\n self.attr = attr\n self.src = src\n assert isinstance(obj.type, RInstance), 'Attribute access not supported: %s' % obj.type\n self.class_type = obj.type\n self.type = bool_rprimitive\n\n def sources(self) -> List[Value]:\n return [self.obj, self.src]\n\n def stolen(self) -> List[Value]:\n return [self.src]\n\n def accept(self, visitor: 'OpVisitor[T]') -> T:\n return visitor.visit_set_attr(self)\n\n\n# Default name space for statics, variables\nNAMESPACE_STATIC = 'static' # type: Final\n\n# Static namespace for pointers to native type objects\nNAMESPACE_TYPE = 'type' # type: Final\n\n# Namespace for modules\nNAMESPACE_MODULE = 'module'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_InitStatic_InitStatic.accept.return.visitor_visit_init_static": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_InitStatic_InitStatic.accept.return.visitor_visit_init_static", "embedding": null, "metadata": {"file_path": "mypyc/ir/ops.py", "file_name": "ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 589, "end_line": 613, "span_ids": ["InitStatic", "InitStatic.__init__", "InitStatic.accept", "InitStatic.sources"], "tokens": 159}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class InitStatic(RegisterOp):\n \"\"\"static = value :: static\n\n Initialize a C static variable/pointer. See everything in LoadStatic.\n \"\"\"\n\n error_kind = ERR_NEVER\n\n def __init__(self,\n value: Value,\n identifier: str,\n module_name: Optional[str] = None,\n namespace: str = NAMESPACE_STATIC,\n line: int = -1) -> None:\n super().__init__(line)\n self.identifier = identifier\n self.module_name = module_name\n self.namespace = namespace\n self.value = value\n\n def sources(self) -> List[Value]:\n return [self.value]\n\n def accept(self, visitor: 'OpVisitor[T]') -> T:\n return visitor.visit_init_static(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_TupleSet_TupleSet.accept.return.visitor_visit_tuple_set_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_TupleSet_TupleSet.accept.return.visitor_visit_tuple_set_s", "embedding": null, "metadata": {"file_path": "mypyc/ir/ops.py", "file_name": "ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 616, "end_line": 636, "span_ids": ["TupleSet.sources", "TupleSet.__init__", "TupleSet", "TupleSet.accept"], "tokens": 185}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TupleSet(RegisterOp):\n \"\"\"dest = (reg, ...) (for fixed-length tuple)\"\"\"\n\n error_kind = ERR_NEVER\n\n def __init__(self, items: List[Value], line: int) -> None:\n super().__init__(line)\n self.items = items\n # Don't keep track of the fact that an int is short after it\n # is put into a tuple, since we don't properly implement\n # runtime subtyping for tuples.\n self.tuple_type = RTuple(\n [arg.type if not is_short_int_rprimitive(arg.type) else int_rprimitive\n for arg in items])\n self.type = self.tuple_type\n\n def sources(self) -> List[Value]:\n return self.items[:]\n\n def accept(self, visitor: 'OpVisitor[T]') -> T:\n return visitor.visit_tuple_set(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_TupleGet_TupleGet.accept.return.visitor_visit_tuple_get_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_TupleGet_TupleGet.accept.return.visitor_visit_tuple_get_s", "embedding": null, "metadata": {"file_path": "mypyc/ir/ops.py", "file_name": "ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 639, "end_line": 656, "span_ids": ["TupleGet", "TupleGet.__init__", "TupleGet.accept", "TupleGet.sources"], "tokens": 142}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TupleGet(RegisterOp):\n \"\"\"Get item of a fixed-length tuple (src[index]).\"\"\"\n\n error_kind = ERR_NEVER\n\n def __init__(self, src: Value, index: int, line: int) -> None:\n super().__init__(line)\n self.src = src\n self.index = index\n assert isinstance(src.type, RTuple), \"TupleGet only operates on tuples\"\n assert index >= 0\n self.type = src.type.types[index]\n\n def sources(self) -> List[Value]:\n return [self.src]\n\n def accept(self, visitor: 'OpVisitor[T]') -> T:\n return visitor.visit_tuple_get(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_Cast_Cast.accept.return.visitor_visit_cast_self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_Cast_Cast.accept.return.visitor_visit_cast_self_", "embedding": null, "metadata": {"file_path": "mypyc/ir/ops.py", "file_name": "ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 659, "end_line": 681, "span_ids": ["Cast", "Cast.sources", "Cast.__init__", "Cast.accept", "Cast.stolen"], "tokens": 138}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Cast(RegisterOp):\n \"\"\"cast(type, src)\n\n Perform a runtime type check (no representation or value conversion).\n\n DO NOT increment reference counts.\n \"\"\"\n\n error_kind = ERR_MAGIC\n\n def __init__(self, src: Value, typ: RType, line: int) -> None:\n super().__init__(line)\n self.src = src\n self.type = typ\n\n def sources(self) -> List[Value]:\n return [self.src]\n\n def stolen(self) -> List[Value]:\n return [self.src]\n\n def accept(self, visitor: 'OpVisitor[T]') -> T:\n return visitor.visit_cast(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_Box_Box.accept.return.visitor_visit_box_self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_Box_Box.accept.return.visitor_visit_box_self_", "embedding": null, "metadata": {"file_path": "mypyc/ir/ops.py", "file_name": "ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 684, "end_line": 710, "span_ids": ["Box.__init__", "Box.accept", "Box", "Box.sources", "Box.stolen"], "tokens": 201}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Box(RegisterOp):\n \"\"\"box(type, src)\n\n This converts from a potentially unboxed representation to a straight Python object.\n Only supported for types with an unboxed representation.\n \"\"\"\n\n error_kind = ERR_NEVER\n\n def __init__(self, src: Value, line: int = -1) -> None:\n super().__init__(line)\n self.src = src\n self.type = object_rprimitive\n # When we box None and bool values, we produce a borrowed result\n if (is_none_rprimitive(self.src.type)\n or is_bool_rprimitive(self.src.type)\n or is_bit_rprimitive(self.src.type)):\n self.is_borrowed = True\n\n def sources(self) -> List[Value]:\n return [self.src]\n\n def stolen(self) -> List[Value]:\n return [self.src]\n\n def accept(self, visitor: 'OpVisitor[T]') -> T:\n return visitor.visit_box(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_Unbox_Unbox.accept.return.visitor_visit_unbox_self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_Unbox_Unbox.accept.return.visitor_visit_unbox_self_", "embedding": null, "metadata": {"file_path": "mypyc/ir/ops.py", "file_name": "ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 713, "end_line": 731, "span_ids": ["Unbox.accept", "Unbox", "Unbox.sources", "Unbox.__init__"], "tokens": 140}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Unbox(RegisterOp):\n \"\"\"unbox(type, src)\n\n This is similar to a cast, but it also changes to a (potentially) unboxed runtime\n representation. Only supported for types with an unboxed representation.\n \"\"\"\n\n error_kind = ERR_MAGIC\n\n def __init__(self, src: Value, typ: RType, line: int) -> None:\n super().__init__(line)\n self.src = src\n self.type = typ\n\n def sources(self) -> List[Value]:\n return [self.src]\n\n def accept(self, visitor: 'OpVisitor[T]') -> T:\n return visitor.visit_unbox(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_CallC_CallC.accept.return.visitor_visit_call_c_self": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_CallC_CallC.accept.return.visitor_visit_call_c_self", "embedding": null, "metadata": {"file_path": "mypyc/ir/ops.py", "file_name": "ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 769, "end_line": 807, "span_ids": ["CallC", "CallC.sources", "CallC.stolen", "CallC.accept", "CallC.__init__"], "tokens": 312}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CallC(RegisterOp):\n \"\"\"result = function(arg0, arg1, ...)\n\n Call a C function that is not a compiled/native function (for\n example, a Python C API function). Use Call to call native\n functions.\n \"\"\"\n\n def __init__(self,\n function_name: str,\n args: List[Value],\n ret_type: RType,\n steals: StealsDescription,\n is_borrowed: bool,\n error_kind: int,\n line: int,\n var_arg_idx: int = -1) -> None:\n self.error_kind = error_kind\n super().__init__(line)\n self.function_name = function_name\n self.args = args\n self.type = ret_type\n self.steals = steals\n self.is_borrowed = is_borrowed\n # The position of the first variable argument in args (if >= 0)\n self.var_arg_idx = var_arg_idx\n\n def sources(self) -> List[Value]:\n return self.args\n\n def stolen(self) -> List[Value]:\n if isinstance(self.steals, list):\n assert len(self.steals) == len(self.args)\n return [arg for arg, steal in zip(self.args, self.steals) if steal]\n else:\n return [] if not self.steals else self.sources()\n\n def accept(self, visitor: 'OpVisitor[T]') -> T:\n return visitor.visit_call_c(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_Truncate_Truncate.accept.return.visitor_visit_truncate_se": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_Truncate_Truncate.accept.return.visitor_visit_truncate_se", "embedding": null, "metadata": {"file_path": "mypyc/ir/ops.py", "file_name": "ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 810, "end_line": 839, "span_ids": ["Truncate.accept", "Truncate.__init__", "Truncate", "Truncate.sources", "Truncate.stolen"], "tokens": 200}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Truncate(RegisterOp):\n \"\"\"result = truncate src from src_type to dst_type\n\n Truncate a value from type with more bits to type with less bits.\n\n Both src_type and dst_type should be non-reference counted integer\n types or bool. Note that int_rprimitive is reference counted so\n it should never be used here.\n \"\"\"\n\n error_kind = ERR_NEVER\n\n def __init__(self,\n src: Value,\n src_type: RType,\n dst_type: RType,\n line: int = -1) -> None:\n super().__init__(line)\n self.src = src\n self.src_type = src_type\n self.type = dst_type\n\n def sources(self) -> List[Value]:\n return [self.src]\n\n def stolen(self) -> List[Value]:\n return []\n\n def accept(self, visitor: 'OpVisitor[T]') -> T:\n return visitor.visit_truncate(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_LoadGlobal_LoadGlobal.accept.return.visitor_visit_load_global": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_LoadGlobal_LoadGlobal.accept.return.visitor_visit_load_global", "embedding": null, "metadata": {"file_path": "mypyc/ir/ops.py", "file_name": "ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 876, "end_line": 901, "span_ids": ["LoadGlobal.sources", "LoadGlobal", "LoadGlobal.__init__", "LoadGlobal.accept"], "tokens": 178}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LoadGlobal(RegisterOp):\n \"\"\"Load a low-level global variable/pointer.\n\n Note that can't be used to directly load Python module-level\n global variable, since they are stored in a globals dictionary\n and accessed using dictionary operations.\n \"\"\"\n\n error_kind = ERR_NEVER\n is_borrowed = True\n\n def __init__(self,\n type: RType,\n identifier: str,\n line: int = -1,\n ann: object = None) -> None:\n super().__init__(line)\n self.identifier = identifier\n self.type = type\n self.ann = ann # An object to pretty print with the load\n\n def sources(self) -> List[Value]:\n return []\n\n def accept(self, visitor: 'OpVisitor[T]') -> T:\n return visitor.visit_load_global(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_LoadMem_LoadMem.accept.return.visitor_visit_load_mem_se": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_LoadMem_LoadMem.accept.return.visitor_visit_load_mem_se", "embedding": null, "metadata": {"file_path": "mypyc/ir/ops.py", "file_name": "ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1048, "end_line": 1071, "span_ids": ["LoadMem.accept", "LoadMem", "LoadMem.sources", "LoadMem.__init__"], "tokens": 187}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LoadMem(RegisterOp):\n \"\"\"Read a memory location: result = *(type *)src.\n\n Attributes:\n type: Type of the read value\n src: Pointer to memory to read\n \"\"\"\n\n error_kind = ERR_NEVER\n\n def __init__(self, type: RType, src: Value, line: int = -1) -> None:\n super().__init__(line)\n self.type = type\n # TODO: for now we enforce that the src memory address should be Py_ssize_t\n # later we should also support same width unsigned int\n assert is_pointer_rprimitive(src.type)\n self.src = src\n self.is_borrowed = True\n\n def sources(self) -> List[Value]:\n return [self.src]\n\n def accept(self, visitor: 'OpVisitor[T]') -> T:\n return visitor.visit_load_mem(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_SetMem_SetMem.accept.return.visitor_visit_set_mem_sel": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_SetMem_SetMem.accept.return.visitor_visit_set_mem_sel", "embedding": null, "metadata": {"file_path": "mypyc/ir/ops.py", "file_name": "ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1074, "end_line": 1103, "span_ids": ["SetMem.__init__", "SetMem.stolen", "SetMem.sources", "SetMem", "SetMem.accept"], "tokens": 184}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SetMem(Op):\n \"\"\"Write to a memory location: *(type *)dest = src\n\n Attributes:\n type: Type of the written value\n dest: Pointer to memory to write\n src: Source value\n \"\"\"\n\n error_kind = ERR_NEVER\n\n def __init__(self,\n type: RType,\n dest: Value,\n src: Value,\n line: int = -1) -> None:\n super().__init__(line)\n self.type = void_rtype\n self.dest_type = type\n self.src = src\n self.dest = dest\n\n def sources(self) -> List[Value]:\n return [self.src, self.dest]\n\n def stolen(self) -> List[Value]:\n return [self.src]\n\n def accept(self, visitor: 'OpVisitor[T]') -> T:\n return visitor.visit_set_mem(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_GetElementPtr_GetElementPtr.accept.return.visitor_visit_get_element": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_GetElementPtr_GetElementPtr.accept.return.visitor_visit_get_element", "embedding": null, "metadata": {"file_path": "mypyc/ir/ops.py", "file_name": "ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1106, "end_line": 1126, "span_ids": ["GetElementPtr.sources", "GetElementPtr", "GetElementPtr.accept", "GetElementPtr.__init__"], "tokens": 164}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GetElementPtr(RegisterOp):\n \"\"\"Get the address of a struct element.\n\n Note that you may need to use KeepAlive to avoid the struct\n being freed, if it's reference counted, such as PyObject *.\n \"\"\"\n\n error_kind = ERR_NEVER\n\n def __init__(self, src: Value, src_type: RType, field: str, line: int = -1) -> None:\n super().__init__(line)\n self.type = pointer_rprimitive\n self.src = src\n self.src_type = src_type\n self.field = field\n\n def sources(self) -> List[Value]:\n return [self.src]\n\n def accept(self, visitor: 'OpVisitor[T]') -> T:\n return visitor.visit_get_element_ptr(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_LoadAddress_LoadAddress.accept.return.visitor_visit_load_addres": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_LoadAddress_LoadAddress.accept.return.visitor_visit_load_addres", "embedding": null, "metadata": {"file_path": "mypyc/ir/ops.py", "file_name": "ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1072, "end_line": 1096, "span_ids": ["LoadAddress.accept", "LoadAddress.__init__", "LoadAddress.sources", "LoadAddress"], "tokens": 183}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LoadAddress(RegisterOp):\n \"\"\"Get the address of a value: result = (type)&src\n\n Attributes:\n type: Type of the loaded address(e.g. ptr/object_ptr)\n src: Source value (str for globals like 'PyList_Type',\n Register for temporary values or locals)\n \"\"\"\n\n error_kind = ERR_NEVER\n is_borrowed = True\n\n def __init__(self, type: RType, src: Union[str, Register], line: int = -1) -> None:\n super().__init__(line)\n self.type = type\n self.src = src\n\n def sources(self) -> List[Value]:\n if isinstance(self.src, Register):\n return [self.src]\n else:\n return []\n\n def accept(self, visitor: 'OpVisitor[T]') -> T:\n return visitor.visit_load_address(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder_IRBuilder.accept_2._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder_IRBuilder.accept_2._", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/builder.py", "file_name": "builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 76, "end_line": 151, "span_ids": ["IRBuilder.__init__", "IRBuilder", "IRBuilder.accept_2", "IRBuilder.accept", "IRBuilder.set_module"], "tokens": 741}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRBuilder:\n def __init__(self,\n current_module: str,\n types: Dict[Expression, Type],\n graph: Graph,\n errors: Errors,\n mapper: Mapper,\n pbv: PreBuildVisitor,\n visitor: IRVisitor,\n options: CompilerOptions) -> None:\n self.builder = LowLevelIRBuilder(current_module, mapper, options)\n self.builders = [self.builder]\n self.symtables = [OrderedDict()] # type: List[OrderedDict[SymbolNode, SymbolTarget]]\n self.runtime_args = [[]] # type: List[List[RuntimeArg]]\n self.function_name_stack = [] # type: List[str]\n self.class_ir_stack = [] # type: List[ClassIR]\n\n self.current_module = current_module\n self.mapper = mapper\n self.types = types\n self.graph = graph\n self.ret_types = [] # type: List[RType]\n self.functions = [] # type: List[FuncIR]\n self.classes = [] # type: List[ClassIR]\n self.final_names = [] # type: List[Tuple[str, RType]]\n self.callable_class_names = set() # type: Set[str]\n self.options = options\n\n # These variables keep track of the number of lambdas, implicit indices, and implicit\n # iterators instantiated so we avoid name conflicts. The indices and iterators are\n # instantiated from for-loops.\n self.lambda_counter = 0\n self.temp_counter = 0\n\n # These variables are populated from the first-pass PreBuildVisitor.\n self.free_variables = pbv.free_variables\n self.prop_setters = pbv.prop_setters\n self.encapsulating_funcs = pbv.encapsulating_funcs\n self.nested_fitems = pbv.nested_funcs.keys()\n self.fdefs_to_decorators = pbv.funcs_to_decorators\n\n self.visitor = visitor\n\n # This list operates similarly to a function call stack for nested functions. Whenever a\n # function definition begins to be generated, a FuncInfo instance is added to the stack,\n # and information about that function (e.g. whether it is nested, its environment class to\n # be generated) is stored in that FuncInfo instance. When the function is done being\n # generated, its corresponding FuncInfo is popped off the stack.\n self.fn_info = FuncInfo(INVALID_FUNC_DEF, '', '')\n self.fn_infos = [self.fn_info] # type: List[FuncInfo]\n\n # This list operates as a stack of constructs that modify the\n # behavior of nonlocal control flow constructs.\n self.nonlocal_control = [] # type: List[NonlocalControl]\n\n self.errors = errors\n # Notionally a list of all of the modules imported by the\n # module being compiled, but stored as an OrderedDict so we\n # can also do quick lookups.\n self.imports = OrderedDict() # type: OrderedDict[str, None]\n\n # High-level control\n\n def set_module(self, module_name: str, module_path: str) -> None:\n \"\"\"Set the name and path of the current module.\n\n This must be called before transforming any AST nodes.\n \"\"\"\n self.module_name = module_name\n self.module_path = module_path\n\n @overload\n def accept(self, node: Expression) -> Value: ...\n\n @overload\n def accept(self, node: Statement) -> None: ...", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.accept_3_IRBuilder.accept_3.with_self_catch_errors_no.if_isinstance_node_Expre.else_.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.accept_3_IRBuilder.accept_3.with_self_catch_errors_no.if_isinstance_node_Expre.else_.return.None", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/builder.py", "file_name": "builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 153, "end_line": 172, "span_ids": ["IRBuilder.accept_3"], "tokens": 164}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRBuilder:\n\n def accept(self, node: Union[Statement, Expression]) -> Optional[Value]:\n \"\"\"Transform an expression or a statement.\"\"\"\n with self.catch_errors(node.line):\n if isinstance(node, Expression):\n try:\n res = node.accept(self.visitor)\n res = self.coerce(res, self.node_type(node), node.line)\n # If we hit an error during compilation, we want to\n # keep trying, so we can produce more error\n # messages. Generate a temp of the right type to keep\n # from causing more downstream trouble.\n except UnsupportedException:\n res = Register(self.node_type(node))\n return res\n else:\n try:\n node.accept(self.visitor)\n except UnsupportedException:\n pass\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.gen_import_IRBuilder.gen_import.self_goto_and_activate_ou": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.gen_import_IRBuilder.gen_import.self_goto_and_activate_ou", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/builder.py", "file_name": "builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 289, "end_line": 300, "span_ids": ["IRBuilder.gen_import"], "tokens": 131}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRBuilder:\n\n def gen_import(self, id: str, line: int) -> None:\n self.imports[id] = None\n\n needs_import, out = BasicBlock(), BasicBlock()\n first_load = self.load_module(id)\n comparison = self.translate_is_op(first_load, self.none_object(), 'is not', line)\n self.add_bool_branch(comparison, out, needs_import)\n\n self.activate_block(needs_import)\n value = self.call_c(import_op, [self.load_str(id)], line)\n self.add(InitStatic(value, id, namespace=NAMESPACE_MODULE))\n self.goto_and_activate(out)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.assign_if_null_IRBuilder.assign_if_null.self_activate_block_body_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.assign_if_null_IRBuilder.assign_if_null.self_activate_block_body_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/builder.py", "file_name": "builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 302, "end_line": 310, "span_ids": ["IRBuilder.assign_if_null"], "tokens": 117}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRBuilder:\n\n def assign_if_null(self, target: Register,\n get_val: Callable[[], Value], line: int) -> None:\n \"\"\"If target is NULL, assign value produced by get_val to it.\"\"\"\n error_block, body_block = BasicBlock(), BasicBlock()\n self.add(Branch(target, error_block, body_block, Branch.IS_ERROR))\n self.activate_block(error_block)\n self.add(Assign(target, self.coerce(get_val(), target.type, line)))\n self.goto(body_block)\n self.activate_block(body_block)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.maybe_add_implicit_return_IRBuilder.add_implicit_unreachable.if_not_block_terminated_.self_add_Unreachable_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.maybe_add_implicit_return_IRBuilder.add_implicit_unreachable.if_not_block_terminated_.self_add_Unreachable_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/builder.py", "file_name": "builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 310, "end_line": 325, "span_ids": ["IRBuilder.maybe_add_implicit_return", "IRBuilder.add_implicit_return", "IRBuilder.add_implicit_unreachable"], "tokens": 158}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRBuilder:\n\n def maybe_add_implicit_return(self) -> None:\n if is_none_rprimitive(self.ret_types[-1]) or is_object_rprimitive(self.ret_types[-1]):\n self.add_implicit_return()\n else:\n self.add_implicit_unreachable()\n\n def add_implicit_return(self) -> None:\n block = self.builder.blocks[-1]\n if not block.terminated:\n retval = self.coerce(self.builder.none(), self.ret_types[-1], -1)\n self.nonlocal_control[-1].gen_return(self, retval, self.fn_info.fitem.line)\n\n def add_implicit_unreachable(self) -> None:\n block = self.builder.blocks[-1]\n if not block.terminated:\n self.add(Unreachable())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.load_final_static_IRBuilder.load_final_literal_value.if_isinstance_val_bool_.else_.assert_False_Unsupporte": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.load_final_static_IRBuilder.load_final_literal_value.if_isinstance_val_bool_.else_.assert_False_Unsupporte", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/builder.py", "file_name": "builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 361, "end_line": 389, "span_ids": ["IRBuilder.load_final_static", "IRBuilder.load_final_literal_value"], "tokens": 264}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRBuilder:\n\n def load_final_static(self, fullname: str, typ: RType, line: int,\n error_name: Optional[str] = None) -> Value:\n split_name = split_target(self.graph, fullname)\n assert split_name is not None\n module, name = split_name\n return self.builder.load_static_checked(\n typ, name, module, line=line,\n error_msg='value for final name \"{}\" was not set'.format(error_name))\n\n def load_final_literal_value(self, val: Union[int, str, bytes, float, bool],\n line: int) -> Value:\n \"\"\"Load value of a final name or class-level attribute.\"\"\"\n if isinstance(val, bool):\n if val:\n return self.true()\n else:\n return self.false()\n elif isinstance(val, int):\n # TODO: take care of negative integer initializers\n # (probably easier to fix this in mypy itself).\n return self.builder.load_int(val)\n elif isinstance(val, float):\n return self.builder.load_float(val)\n elif isinstance(val, str):\n return self.builder.load_str(val)\n elif isinstance(val, bytes):\n return self.builder.load_bytes(val)\n else:\n assert False, \"Unsupported final literal value\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.get_assignment_target_IRBuilder.get_assignment_target.assert_False_Unsupporte": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.get_assignment_target_IRBuilder.get_assignment_target.assert_False_Unsupporte", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/builder.py", "file_name": "builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 391, "end_line": 452, "span_ids": ["IRBuilder.get_assignment_target"], "tokens": 581}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRBuilder:\n\n def get_assignment_target(self, lvalue: Lvalue,\n line: int = -1) -> AssignmentTarget:\n if isinstance(lvalue, NameExpr):\n # If we are visiting a decorator, then the SymbolNode we really want to be looking at\n # is the function that is decorated, not the entire Decorator node itself.\n symbol = lvalue.node\n if isinstance(symbol, Decorator):\n symbol = symbol.func\n if symbol is None:\n # New semantic analyzer doesn't create ad-hoc Vars for special forms.\n assert lvalue.is_special_form\n symbol = Var(lvalue.name)\n if lvalue.kind == LDEF:\n if symbol not in self.symtables[-1]:\n # If the function is a generator function, then first define a new variable\n # in the current function's environment class. Next, define a target that\n # refers to the newly defined variable in that environment class. Add the\n # target to the table containing class environment variables, as well as the\n # current environment.\n if self.fn_info.is_generator:\n return self.add_var_to_env_class(symbol, self.node_type(lvalue),\n self.fn_info.generator_class,\n reassign=False)\n\n # Otherwise define a new local variable.\n return self.add_local_reg(symbol, self.node_type(lvalue))\n else:\n # Assign to a previously defined variable.\n return self.lookup(symbol)\n elif lvalue.kind == GDEF:\n globals_dict = self.load_globals_dict()\n name = self.load_str(lvalue.name)\n return AssignmentTargetIndex(globals_dict, name)\n else:\n assert False, lvalue.kind\n elif isinstance(lvalue, IndexExpr):\n # Indexed assignment x[y] = e\n base = self.accept(lvalue.base)\n index = self.accept(lvalue.index)\n return AssignmentTargetIndex(base, index)\n elif isinstance(lvalue, MemberExpr):\n # Attribute assignment x.y = e\n obj = self.accept(lvalue.expr)\n return AssignmentTargetAttr(obj, lvalue.name)\n elif isinstance(lvalue, TupleExpr):\n # Multiple assignment a, ..., b = e\n star_idx = None # type: Optional[int]\n lvalues = []\n for idx, item in enumerate(lvalue.items):\n targ = self.get_assignment_target(item)\n lvalues.append(targ)\n if isinstance(item, StarExpr):\n if star_idx is not None:\n self.error(\"Two starred expressions in assignment\", line)\n star_idx = idx\n\n return AssignmentTargetTuple(lvalues, star_idx)\n\n elif isinstance(lvalue, StarExpr):\n return self.get_assignment_target(lvalue.expr)\n\n assert False, 'Unsupported lvalue: %r' % lvalue", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.read_IRBuilder.read.assert_False_Unsupporte": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.read_IRBuilder.read.assert_False_Unsupporte", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/builder.py", "file_name": "builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 452, "end_line": 469, "span_ids": ["IRBuilder.read"], "tokens": 179}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRBuilder:\n\n def read(self, target: Union[Value, AssignmentTarget], line: int = -1) -> Value:\n if isinstance(target, Value):\n return target\n if isinstance(target, AssignmentTargetRegister):\n return target.register\n if isinstance(target, AssignmentTargetIndex):\n reg = self.gen_method_call(\n target.base, '__getitem__', [target.index], target.type, line)\n if reg is not None:\n return reg\n assert False, target.base.type\n if isinstance(target, AssignmentTargetAttr):\n if isinstance(target.obj.type, RInstance) and target.obj.type.class_ir.is_ext_class:\n return self.add(GetAttr(target.obj, target.attr, line))\n else:\n return self.py_get_attr(target.obj, target.attr, line)\n\n assert False, 'Unsupported lvalue: %r' % target", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.assign_IRBuilder.assign.if_isinstance_target_Reg.else_.assert_False_Unsupporte": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.assign_IRBuilder.assign.if_isinstance_target_Reg.else_.assert_False_Unsupporte", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/builder.py", "file_name": "builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 473, "end_line": 507, "span_ids": ["IRBuilder.assign"], "tokens": 398}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRBuilder:\n\n def assign(self,\n target: Union[Register, AssignmentTarget],\n rvalue_reg: Value,\n line: int) -> None:\n if isinstance(target, Register):\n self.add(Assign(target, rvalue_reg))\n elif isinstance(target, AssignmentTargetRegister):\n rvalue_reg = self.coerce(rvalue_reg, target.type, line)\n self.add(Assign(target.register, rvalue_reg))\n elif isinstance(target, AssignmentTargetAttr):\n if isinstance(target.obj_type, RInstance):\n rvalue_reg = self.coerce(rvalue_reg, target.type, line)\n self.add(SetAttr(target.obj, target.attr, rvalue_reg, line))\n else:\n key = self.load_str(target.attr)\n boxed_reg = self.builder.box(rvalue_reg)\n self.call_c(py_setattr_op, [target.obj, key, boxed_reg], line)\n elif isinstance(target, AssignmentTargetIndex):\n target_reg2 = self.gen_method_call(\n target.base, '__setitem__', [target.index, rvalue_reg], None, line)\n assert target_reg2 is not None, target.base.type\n elif isinstance(target, AssignmentTargetTuple):\n if isinstance(rvalue_reg.type, RTuple) and target.star_idx is None:\n rtypes = rvalue_reg.type.types\n assert len(rtypes) == len(target.items)\n for i in range(len(rtypes)):\n item_value = self.add(TupleGet(rvalue_reg, i, line))\n self.assign(target.items[i], item_value, line)\n elif ((is_list_rprimitive(rvalue_reg.type) or is_tuple_rprimitive(rvalue_reg.type))\n and target.star_idx is None):\n self.process_sequence_assignment(target, rvalue_reg, line)\n else:\n self.process_iterator_tuple_assignment(target, rvalue_reg, line)\n else:\n assert False, 'Unsupported assignment target'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.process_iterator_tuple_assignment_helper_IRBuilder.process_iterator_tuple_assignment_helper.self_assign_litem_ritem_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.process_iterator_tuple_assignment_helper_IRBuilder.process_iterator_tuple_assignment_helper.self_assign_litem_ritem_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/builder.py", "file_name": "builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 502, "end_line": 514, "span_ids": ["IRBuilder.process_iterator_tuple_assignment_helper"], "tokens": 121}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRBuilder:\n\n def process_iterator_tuple_assignment_helper(self,\n litem: AssignmentTarget,\n ritem: Value, line: int) -> None:\n error_block, ok_block = BasicBlock(), BasicBlock()\n self.add(Branch(ritem, error_block, ok_block, Branch.IS_ERROR))\n\n self.activate_block(error_block)\n self.add(RaiseStandardError(RaiseStandardError.VALUE_ERROR,\n 'not enough values to unpack', line))\n self.add(Unreachable())\n\n self.activate_block(ok_block)\n self.assign(litem, ritem, line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.process_iterator_tuple_assignment_IRBuilder.process_iterator_tuple_assignment.if_target_star_idx_is_not.else_.self_activate_block_ok_bl": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.process_iterator_tuple_assignment_IRBuilder.process_iterator_tuple_assignment.if_target_star_idx_is_not.else_.self_activate_block_ok_bl", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/builder.py", "file_name": "builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 548, "end_line": 610, "span_ids": ["IRBuilder.process_iterator_tuple_assignment"], "tokens": 555}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRBuilder:\n\n def process_iterator_tuple_assignment(self,\n target: AssignmentTargetTuple,\n rvalue_reg: Value,\n line: int) -> None:\n\n iterator = self.call_c(iter_op, [rvalue_reg], line)\n\n # This may be the whole lvalue list if there is no starred value\n split_idx = target.star_idx if target.star_idx is not None else len(target.items)\n\n # Assign values before the first starred value\n for litem in target.items[:split_idx]:\n ritem = self.call_c(next_op, [iterator], line)\n error_block, ok_block = BasicBlock(), BasicBlock()\n self.add(Branch(ritem, error_block, ok_block, Branch.IS_ERROR))\n\n self.activate_block(error_block)\n self.add(RaiseStandardError(RaiseStandardError.VALUE_ERROR,\n 'not enough values to unpack', line))\n self.add(Unreachable())\n\n self.activate_block(ok_block)\n\n self.assign(litem, ritem, line)\n\n # Assign the starred value and all values after it\n if target.star_idx is not None:\n post_star_vals = target.items[split_idx + 1:]\n iter_list = self.call_c(to_list, [iterator], line)\n iter_list_len = self.builtin_len(iter_list, line)\n post_star_len = Integer(len(post_star_vals))\n condition = self.binary_op(post_star_len, iter_list_len, '<=', line)\n\n error_block, ok_block = BasicBlock(), BasicBlock()\n self.add(Branch(condition, ok_block, error_block, Branch.BOOL))\n\n self.activate_block(error_block)\n self.add(RaiseStandardError(RaiseStandardError.VALUE_ERROR,\n 'not enough values to unpack', line))\n self.add(Unreachable())\n\n self.activate_block(ok_block)\n\n for litem in reversed(post_star_vals):\n ritem = self.call_c(list_pop_last, [iter_list], line)\n self.assign(litem, ritem, line)\n\n # Assign the starred value\n self.assign(target.items[target.star_idx], iter_list, line)\n\n # There is no starred value, so check if there are extra values in rhs that\n # have not been assigned.\n else:\n extra = self.call_c(next_op, [iterator], line)\n error_block, ok_block = BasicBlock(), BasicBlock()\n self.add(Branch(extra, ok_block, error_block, Branch.IS_ERROR))\n\n self.activate_block(error_block)\n self.add(RaiseStandardError(RaiseStandardError.VALUE_ERROR,\n 'too many values to unpack', line))\n self.add(Unreachable())\n\n self.activate_block(ok_block)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.push_loop_stack_IRBuilder.maybe_spill.return.value": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.push_loop_stack_IRBuilder.maybe_spill.return.value", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/builder.py", "file_name": "builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 580, "end_line": 606, "span_ids": ["IRBuilder.push_loop_stack", "IRBuilder.spill", "IRBuilder.pop_loop_stack", "IRBuilder.maybe_spill"], "tokens": 265}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRBuilder:\n\n def push_loop_stack(self, continue_block: BasicBlock, break_block: BasicBlock) -> None:\n self.nonlocal_control.append(\n LoopNonlocalControl(self.nonlocal_control[-1], continue_block, break_block))\n\n def pop_loop_stack(self) -> None:\n self.nonlocal_control.pop()\n\n def spill(self, value: Value) -> AssignmentTarget:\n \"\"\"Moves a given Value instance into the generator class' environment class.\"\"\"\n name = '{}{}'.format(TEMP_ATTR_NAME, self.temp_counter)\n self.temp_counter += 1\n target = self.add_var_to_env_class(Var(name), value.type, self.fn_info.generator_class)\n # Shouldn't be able to fail, so -1 for line\n self.assign(target, value, -1)\n return target\n\n def maybe_spill(self, value: Value) -> Union[Value, AssignmentTarget]:\n \"\"\"\n Moves a given Value instance into the environment class for generator functions. For\n non-generator functions, leaves the Value instance as it is.\n\n Returns an AssignmentTarget associated with the Value for generator functions and the\n original Value itself for non-generator functions.\n \"\"\"\n if self.fn_info.is_generator:\n return self.spill(value)\n return value", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.maybe_spill_assignable_IRBuilder.maybe_spill_assignable.return.reg": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.maybe_spill_assignable_IRBuilder.maybe_spill_assignable.return.reg", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/builder.py", "file_name": "builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 640, "end_line": 657, "span_ids": ["IRBuilder.maybe_spill_assignable"], "tokens": 135}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRBuilder:\n\n def maybe_spill_assignable(self, value: Value) -> Union[Register, AssignmentTarget]:\n \"\"\"\n Moves a given Value instance into the environment class for generator functions. For\n non-generator functions, allocate a temporary Register.\n\n Returns an AssignmentTarget associated with the Value for generator functions and an\n assignable Register for non-generator functions.\n \"\"\"\n if self.fn_info.is_generator:\n return self.spill(value)\n\n if isinstance(value, Register):\n return value\n\n # Allocate a temporary register for the assignable value.\n reg = Register(value.type)\n self.assign(reg, value, -1)\n return reg", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.extract_int_IRBuilder.get_dict_item_type.return.RTuple_key_type_value_t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.extract_int_IRBuilder.get_dict_item_type.return.RTuple_key_type_value_t", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/builder.py", "file_name": "builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 627, "end_line": 665, "span_ids": ["IRBuilder.get_sequence_type", "IRBuilder.get_dict_value_type", "IRBuilder.extract_int", "IRBuilder.get_dict_key_type", "IRBuilder.get_dict_item_type", "IRBuilder.get_dict_base_type"], "tokens": 369}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRBuilder:\n\n def extract_int(self, e: Expression) -> Optional[int]:\n if isinstance(e, IntExpr):\n return e.value\n elif isinstance(e, UnaryExpr) and e.op == '-' and isinstance(e.expr, IntExpr):\n return -e.expr.value\n else:\n return None\n\n def get_sequence_type(self, expr: Expression) -> RType:\n target_type = get_proper_type(self.types[expr])\n assert isinstance(target_type, Instance)\n if target_type.type.fullname == 'builtins.str':\n return str_rprimitive\n else:\n return self.type_to_rtype(target_type.args[0])\n\n def get_dict_base_type(self, expr: Expression) -> Instance:\n \"\"\"Find dict type of a dict-like expression.\n\n This is useful for dict subclasses like SymbolTable.\n \"\"\"\n target_type = get_proper_type(self.types[expr])\n assert isinstance(target_type, Instance)\n dict_base = next(base for base in target_type.type.mro\n if base.fullname == 'builtins.dict')\n return map_instance_to_supertype(target_type, dict_base)\n\n def get_dict_key_type(self, expr: Expression) -> RType:\n dict_base_type = self.get_dict_base_type(expr)\n return self.type_to_rtype(dict_base_type.args[0])\n\n def get_dict_value_type(self, expr: Expression) -> RType:\n dict_base_type = self.get_dict_base_type(expr)\n return self.type_to_rtype(dict_base_type.args[1])\n\n def get_dict_item_type(self, expr: Expression) -> RType:\n key_type = self.get_dict_key_type(expr)\n value_type = self.get_dict_value_type(expr)\n return RTuple([key_type, value_type])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder._analyze_iterable_item_type_IRBuilder._analyze_iterable_item_type.if_isinstance_iterable_T.else_.return.echk_check_method_call_by": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder._analyze_iterable_item_type_IRBuilder._analyze_iterable_item_type.if_isinstance_iterable_T.else_.return.echk_check_method_call_by", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/builder.py", "file_name": "builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 667, "end_line": 682, "span_ids": ["IRBuilder._analyze_iterable_item_type"], "tokens": 189}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRBuilder:\n\n def _analyze_iterable_item_type(self, expr: Expression) -> Type:\n \"\"\"Return the item type given by 'expr' in an iterable context.\"\"\"\n # This logic is copied from mypy's TypeChecker.analyze_iterable_item_type.\n iterable = get_proper_type(self.types[expr])\n echk = self.graph[self.module_name].type_checker().expr_checker\n iterator = echk.check_method_call_by_name('__iter__', iterable, [], [], expr)[0]\n\n from mypy.join import join_types\n if isinstance(iterable, TupleType):\n joined = UninhabitedType() # type: Type\n for item in iterable.items:\n joined = join_types(joined, item)\n return joined\n else:\n # Non-tuple iterable.\n return echk.check_method_call_by_name('__next__', iterator, [], [], expr)[0]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.is_native_module_IRBuilder.is_synthetic_type.return.typ_is_named_tuple_or_typ": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.is_native_module_IRBuilder.is_synthetic_type.return.typ_is_named_tuple_or_typ", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/builder.py", "file_name": "builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 684, "end_line": 700, "span_ids": ["IRBuilder.is_native_ref_expr", "IRBuilder.is_native_module", "IRBuilder.is_native_module_ref_expr", "IRBuilder.is_synthetic_type"], "tokens": 180}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRBuilder:\n\n def is_native_module(self, module: str) -> bool:\n \"\"\"Is the given module one compiled by mypyc?\"\"\"\n return module in self.mapper.group_map\n\n def is_native_ref_expr(self, expr: RefExpr) -> bool:\n if expr.node is None:\n return False\n if '.' in expr.node.fullname:\n return self.is_native_module(expr.node.fullname.rpartition('.')[0])\n return True\n\n def is_native_module_ref_expr(self, expr: RefExpr) -> bool:\n return self.is_native_ref_expr(expr) and expr.kind == GDEF\n\n def is_synthetic_type(self, typ: TypeInfo) -> bool:\n \"\"\"Is a type something other than just a class we've created?\"\"\"\n return typ.is_named_tuple or typ.is_newtype or typ.typeddict_type is not None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.get_final_ref_IRBuilder.get_final_ref.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.get_final_ref_IRBuilder.get_final_ref.return.None", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/builder.py", "file_name": "builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 702, "end_line": 731, "span_ids": ["IRBuilder.get_final_ref"], "tokens": 327}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRBuilder:\n\n def get_final_ref(self, expr: MemberExpr) -> Optional[Tuple[str, Var, bool]]:\n \"\"\"Check if `expr` is a final attribute.\n\n This needs to be done differently for class and module attributes to\n correctly determine fully qualified name. Return a tuple that consists of\n the qualified name, the corresponding Var node, and a flag indicating whether\n the final name was defined in a compiled module. Return None if `expr` does not\n refer to a final attribute.\n \"\"\"\n final_var = None\n if isinstance(expr.expr, RefExpr) and isinstance(expr.expr.node, TypeInfo):\n # a class attribute\n sym = expr.expr.node.get(expr.name)\n if sym and isinstance(sym.node, Var):\n # Enum attribute are treated as final since they are added to the global cache\n expr_fullname = expr.expr.node.bases[0].type.fullname\n is_final = sym.node.is_final or expr_fullname == 'enum.Enum'\n if is_final:\n final_var = sym.node\n fullname = '{}.{}'.format(sym.node.info.fullname, final_var.name)\n native = self.is_native_module(expr.expr.node.module_name)\n elif self.is_module_member_expr(expr):\n # a module attribute\n if isinstance(expr.node, Var) and expr.node.is_final:\n final_var = expr.node\n fullname = expr.node.fullname\n native = self.is_native_ref_expr(expr)\n if final_var is not None:\n return fullname, final_var, native\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.emit_load_final_IRBuilder.is_module_member_expr.return.isinstance_expr_expr_Ref": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.emit_load_final_IRBuilder.is_module_member_expr.return.isinstance_expr_expr_Ref", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/builder.py", "file_name": "builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 733, "end_line": 754, "span_ids": ["IRBuilder.emit_load_final", "IRBuilder.is_module_member_expr"], "tokens": 222}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRBuilder:\n\n def emit_load_final(self, final_var: Var, fullname: str,\n name: str, native: bool, typ: Type, line: int) -> Optional[Value]:\n \"\"\"Emit code for loading value of a final name (if possible).\n\n Args:\n final_var: Var corresponding to the final name\n fullname: its qualified name\n name: shorter name to show in errors\n native: whether the name was defined in a compiled module\n typ: its type\n line: line number where loading occurs\n \"\"\"\n if final_var.final_value is not None: # this is safe even for non-native names\n return self.load_final_literal_value(final_var.final_value, line)\n elif native:\n return self.load_final_static(fullname, self.mapper.type_to_rtype(typ),\n line, name)\n else:\n return None\n\n def is_module_member_expr(self, expr: MemberExpr) -> bool:\n return isinstance(expr.expr, RefExpr) and isinstance(expr.expr.node, MypyFile)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.call_refexpr_with_args_IRBuilder.call_refexpr_with_args.return.self_py_call_function_ar": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.call_refexpr_with_args_IRBuilder.call_refexpr_with_args.return.self_py_call_function_ar", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/builder.py", "file_name": "builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 788, "end_line": 814, "span_ids": ["IRBuilder.call_refexpr_with_args"], "tokens": 300}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRBuilder:\n\n def call_refexpr_with_args(\n self, expr: CallExpr, callee: RefExpr, arg_values: List[Value]) -> Value:\n\n # Handle data-driven special-cased primitive call ops.\n if callee.fullname is not None and expr.arg_kinds == [ARG_POS] * len(arg_values):\n call_c_ops_candidates = function_ops.get(callee.fullname, [])\n target = self.builder.matching_call_c(call_c_ops_candidates, arg_values,\n expr.line, self.node_type(expr))\n if target:\n return target\n\n # Standard native call if signature and fullname are good and all arguments are positional\n # or named.\n callee_node = callee.node\n if isinstance(callee_node, OverloadedFuncDef):\n callee_node = callee_node.impl\n if (callee_node is not None\n and callee.fullname is not None\n and callee_node in self.mapper.func_to_decl\n and all(kind in (ARG_POS, ARG_NAMED) for kind in expr.arg_kinds)):\n decl = self.mapper.func_to_decl[callee_node]\n return self.builder.call(decl, arg_values, expr.arg_kinds, expr.arg_names, expr.line)\n\n # Fall back to a Python call\n function = self.accept(callee)\n return self.py_call(function, arg_values, expr.line,\n arg_kinds=expr.arg_kinds, arg_names=expr.arg_names)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.shortcircuit_expr_IRBuilder.process_conditional.if_isinstance_e_OpExpr_.else_.self_add_bool_branch_reg_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.shortcircuit_expr_IRBuilder.process_conditional.if_isinstance_e_OpExpr_.else_.self_add_bool_branch_reg_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/builder.py", "file_name": "builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 790, "end_line": 822, "span_ids": ["IRBuilder.process_conditional", "IRBuilder.shortcircuit_expr"], "tokens": 293}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRBuilder:\n\n def shortcircuit_expr(self, expr: OpExpr) -> Value:\n return self.builder.shortcircuit_helper(\n expr.op, self.node_type(expr),\n lambda: self.accept(expr.left),\n lambda: self.accept(expr.right),\n expr.line\n )\n\n # Conditional expressions\n\n def process_conditional(self, e: Expression, true: BasicBlock, false: BasicBlock) -> None:\n if isinstance(e, OpExpr) and e.op in ['and', 'or']:\n if e.op == 'and':\n # Short circuit 'and' in a conditional context.\n new = BasicBlock()\n self.process_conditional(e.left, new, false)\n self.activate_block(new)\n self.process_conditional(e.right, true, false)\n else:\n # Short circuit 'or' in a conditional context.\n new = BasicBlock()\n self.process_conditional(e.left, true, new)\n self.activate_block(new)\n self.process_conditional(e.right, true, false)\n elif isinstance(e, UnaryExpr) and e.op == 'not':\n self.process_conditional(e.expr, false, true)\n else:\n res = self.maybe_process_conditional_comparison(e, true, false)\n if res:\n return\n # Catch-all for arbitrary expressions.\n reg = self.accept(e)\n self.add_bool_branch(reg, true, false)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.maybe_process_conditional_comparison_IRBuilder.maybe_process_conditional_comparison.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.maybe_process_conditional_comparison_IRBuilder.maybe_process_conditional_comparison.return.True", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/builder.py", "file_name": "builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 824, "end_line": 851, "span_ids": ["IRBuilder.maybe_process_conditional_comparison"], "tokens": 258}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRBuilder:\n\n def maybe_process_conditional_comparison(self,\n e: Expression,\n true: BasicBlock,\n false: BasicBlock) -> bool:\n \"\"\"Transform simple tagged integer comparisons in a conditional context.\n\n Return True if the operation is supported (and was transformed). Otherwise,\n do nothing and return False.\n\n Args:\n e: Arbitrary expression\n true: Branch target if comparison is true\n false: Branch target if comparison is false\n \"\"\"\n if not isinstance(e, ComparisonExpr) or len(e.operands) != 2:\n return False\n ltype = self.node_type(e.operands[0])\n rtype = self.node_type(e.operands[1])\n if not is_tagged(ltype) or not is_tagged(rtype):\n return False\n op = e.operators[0]\n if op not in ('==', '!=', '<', '<=', '>', '>='):\n return False\n left = self.accept(e.operands[0])\n right = self.accept(e.operands[1])\n # \"left op right\" for two tagged integers\n self.builder.compare_tagged_condition(left, right, op, true, false, e.line)\n return True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder._Basic_helpers_IRBuilder.flatten_classes.if_isinstance_arg_RefExp.else_.return.res": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder._Basic_helpers_IRBuilder.flatten_classes.if_isinstance_arg_RefExp.else_.return.res", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/builder.py", "file_name": "builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 853, "end_line": 876, "span_ids": ["IRBuilder.maybe_process_conditional_comparison", "IRBuilder.flatten_classes"], "tokens": 191}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRBuilder:\n\n # Basic helpers\n\n def flatten_classes(self, arg: Union[RefExpr, TupleExpr]) -> Optional[List[ClassIR]]:\n \"\"\"Flatten classes in isinstance(obj, (A, (B, C))).\n\n If at least one item is not a reference to a native class, return None.\n \"\"\"\n if isinstance(arg, RefExpr):\n if isinstance(arg.node, TypeInfo) and self.is_native_module_ref_expr(arg):\n ir = self.mapper.type_to_ir.get(arg.node)\n if ir:\n return [ir]\n return None\n else:\n res = [] # type: List[ClassIR]\n for item in arg.items:\n if isinstance(item, (RefExpr, TupleExpr)):\n item_part = self.flatten_classes(item)\n if item_part is None:\n return None\n res.extend(item_part)\n else:\n return None\n return res", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.enter_IRBuilder.enter.self_activate_block_Basic": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.enter_IRBuilder.enter.self_activate_block_Basic", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/builder.py", "file_name": "builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 928, "end_line": 942, "span_ids": ["IRBuilder.enter"], "tokens": 151}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRBuilder:\n\n def enter(self, fn_info: Union[FuncInfo, str] = '') -> None:\n if isinstance(fn_info, str):\n fn_info = FuncInfo(name=fn_info)\n self.builder = LowLevelIRBuilder(self.current_module, self.mapper, self.options)\n self.builders.append(self.builder)\n self.symtables.append(OrderedDict())\n self.runtime_args.append([])\n self.fn_info = fn_info\n self.fn_infos.append(self.fn_info)\n self.ret_types.append(none_rprimitive)\n if fn_info.is_generator:\n self.nonlocal_control.append(GeneratorNonlocalControl())\n else:\n self.nonlocal_control.append(BaseNonlocalControl())\n self.activate_block(BasicBlock())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.is_builtin_ref_expr_IRBuilder.load_global.return.self_load_global_str_expr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.is_builtin_ref_expr_IRBuilder.load_global.return.self_load_global_str_expr", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/builder.py", "file_name": "builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 933, "end_line": 951, "span_ids": ["IRBuilder.load_global", "IRBuilder.is_builtin_ref_expr"], "tokens": 226}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRBuilder:\n\n def is_builtin_ref_expr(self, expr: RefExpr) -> bool:\n assert expr.node, \"RefExpr not resolved\"\n return '.' in expr.node.fullname and expr.node.fullname.split('.')[0] == 'builtins'\n\n def load_global(self, expr: NameExpr) -> Value:\n \"\"\"Loads a Python-level global.\n\n This takes a NameExpr and uses its name as a key to retrieve the corresponding PyObject *\n from the _globals dictionary in the C-generated code.\n \"\"\"\n # If the global is from 'builtins', turn it into a module attr load instead\n if self.is_builtin_ref_expr(expr):\n assert expr.node, \"RefExpr not resolved\"\n return self.load_module_attr_by_fullname(expr.node.fullname, expr.line)\n if (self.is_native_module_ref_expr(expr) and isinstance(expr.node, TypeInfo)\n and not self.is_synthetic_type(expr.node)):\n assert expr.fullname is not None\n return self.load_native_type_object(expr.fullname)\n return self.load_global_str(expr.name, expr.line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.load_global_str_IRBuilder.error.self_errors_error_msg_se": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.load_global_str_IRBuilder.error.self_errors_error_msg_se", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/builder.py", "file_name": "builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1075, "end_line": 1096, "span_ids": ["IRBuilder.load_globals_dict", "IRBuilder.error", "IRBuilder.catch_errors", "IRBuilder.warning", "IRBuilder.load_global_str", "IRBuilder.load_module_attr_by_fullname"], "tokens": 235}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRBuilder:\n\n def load_global_str(self, name: str, line: int) -> Value:\n _globals = self.load_globals_dict()\n reg = self.load_str(name)\n return self.call_c(dict_get_item_op, [_globals, reg], line)\n\n def load_globals_dict(self) -> Value:\n return self.add(LoadStatic(dict_rprimitive, 'globals', self.module_name))\n\n def load_module_attr_by_fullname(self, fullname: str, line: int) -> Value:\n module, _, name = fullname.rpartition('.')\n left = self.load_module(module)\n return self.py_get_attr(left, name, line)\n\n # Lacks a good type because there wasn't a reasonable type in 3.5 :(\n def catch_errors(self, line: int) -> Any:\n return catch_errors(self.module_path, line)\n\n def warning(self, msg: str, line: int) -> None:\n self.errors.warning(msg, self.module_path, line)\n\n def error(self, msg: str, line: int) -> None:\n self.errors.error(msg, self.module_path, line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_gen_arg_defaults_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_gen_arg_defaults_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/builder.py", "file_name": "builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1099, "end_line": 1130, "span_ids": ["gen_arg_defaults"], "tokens": 274}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def gen_arg_defaults(builder: IRBuilder) -> None:\n \"\"\"Generate blocks for arguments that have default values.\n\n If the passed value is an error value, then assign the default\n value to the argument.\n \"\"\"\n fitem = builder.fn_info.fitem\n for arg in fitem.arguments:\n if arg.initializer:\n target = builder.lookup(arg.variable)\n\n def get_default() -> Value:\n assert arg.initializer is not None\n\n # If it is constant, don't bother storing it\n if is_constant(arg.initializer):\n return builder.accept(arg.initializer)\n\n # Because gen_arg_defaults runs before calculate_arg_defaults, we\n # add the static/attribute to final_names/the class here.\n elif not builder.fn_info.is_nested:\n name = fitem.fullname + '.' + arg.variable.name\n builder.final_names.append((name, target.type))\n return builder.add(LoadStatic(target.type, name, builder.module_name))\n else:\n name = arg.variable.name\n builder.fn_info.callable_class.ir.attributes[name] = target.type\n return builder.add(\n GetAttr(builder.fn_info.callable_class.self_reg, name, arg.line))\n assert isinstance(target, AssignmentTargetRegister)\n builder.assign_if_null(target.register, get_default, arg.initializer.line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/callable_class.py__Generate_a_class_that__from_mypyc_primitives_mis": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/callable_class.py__Generate_a_class_that__from_mypyc_primitives_mis", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/callable_class.py", "file_name": "callable_class.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 16, "span_ids": ["docstring"], "tokens": 156}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Generate a class that represents a nested function.\n\nThe class defines __call__ for calling the function and allows access to\nnon-local variables defined in outer scopes.\n\"\"\"\n\nfrom typing import List\n\nfrom mypyc.common import SELF_NAME, ENV_ATTR_NAME\nfrom mypyc.ir.ops import BasicBlock, Return, Call, SetAttr, Value, Register\nfrom mypyc.ir.rtypes import RInstance, object_rprimitive\nfrom mypyc.ir.func_ir import FuncIR, FuncSignature, RuntimeArg, FuncDecl\nfrom mypyc.ir.class_ir import ClassIR\nfrom mypyc.irbuild.builder import IRBuilder\nfrom mypyc.irbuild.context import FuncInfo, ImplicitClass\nfrom mypyc.primitives.misc_ops import method_new_op", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/callable_class.py_setup_callable_class_setup_callable_class.builder.fn_info.callable_class.self_reg.builder_read_self_target_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/callable_class.py_setup_callable_class_setup_callable_class.builder.fn_info.callable_class.self_reg.builder_read_self_target_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/callable_class.py", "file_name": "callable_class.py", "file_type": "text/x-python", "category": "implementation", "start_line": 19, "end_line": 80, "span_ids": ["setup_callable_class"], "tokens": 615}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def setup_callable_class(builder: IRBuilder) -> None:\n \"\"\"Generate an (incomplete) callable class representing function.\n\n This can be a nested function or a function within a non-extension\n class. Also set up the 'self' variable for that class.\n\n This takes the most recently visited function and returns a\n ClassIR to represent that function. Each callable class contains\n an environment attribute which points to another ClassIR\n representing the environment class where some of its variables can\n be accessed.\n\n Note that some methods, such as '__call__', are not yet\n created here. Use additional functions, such as\n add_call_to_callable_class(), to add them.\n\n Return a newly constructed ClassIR representing the callable\n class for the nested function.\n \"\"\"\n # Check to see that the name has not already been taken. If so,\n # rename the class. We allow multiple uses of the same function\n # name because this is valid in if-else blocks. Example:\n #\n # if True:\n # def foo(): ----> foo_obj()\n # return True\n # else:\n # def foo(): ----> foo_obj_0()\n # return False\n name = base_name = '{}_obj'.format(builder.fn_info.namespaced_name())\n count = 0\n while name in builder.callable_class_names:\n name = base_name + '_' + str(count)\n count += 1\n builder.callable_class_names.add(name)\n\n # Define the actual callable class ClassIR, and set its\n # environment to point at the previously defined environment\n # class.\n callable_class_ir = ClassIR(name, builder.module_name, is_generated=True)\n\n # The functools @wraps decorator attempts to call setattr on\n # nested functions, so we create a dict for these nested\n # functions.\n # https://github.com/python/cpython/blob/3.7/Lib/functools.py#L58\n if builder.fn_info.is_nested:\n callable_class_ir.has_dict = True\n\n # If the enclosing class doesn't contain nested (which will happen if\n # this is a toplevel lambda), don't set up an environment.\n if builder.fn_infos[-2].contains_nested:\n callable_class_ir.attributes[ENV_ATTR_NAME] = RInstance(\n builder.fn_infos[-2].env_class\n )\n callable_class_ir.mro = [callable_class_ir]\n builder.fn_info.callable_class = ImplicitClass(callable_class_ir)\n builder.classes.append(callable_class_ir)\n\n # Add a 'self' variable to the environment of the callable class,\n # and store that variable in a register to be accessed later.\n self_target = builder.add_self_to_env(callable_class_ir)\n builder.fn_info.callable_class.self_reg = builder.read(self_target, builder.fn_info.fitem.line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/callable_class.py_add_call_to_callable_class_add_call_to_callable_class.return.call_fn_ir": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/callable_class.py_add_call_to_callable_class_add_call_to_callable_class.return.call_fn_ir", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/callable_class.py", "file_name": "callable_class.py", "file_type": "text/x-python", "category": "implementation", "start_line": 83, "end_line": 101, "span_ids": ["add_call_to_callable_class"], "tokens": 240}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_call_to_callable_class(builder: IRBuilder,\n args: List[Register],\n blocks: List[BasicBlock],\n sig: FuncSignature,\n fn_info: FuncInfo) -> FuncIR:\n \"\"\"Generate a '__call__' method for a callable class representing a nested function.\n\n This takes the blocks and signature associated with a function\n definition and uses those to build the '__call__' method of a\n given callable class, used to represent that function.\n \"\"\"\n # Since we create a method, we also add a 'self' parameter.\n sig = FuncSignature((RuntimeArg(SELF_NAME, object_rprimitive),) + sig.args, sig.ret_type)\n call_fn_decl = FuncDecl('__call__', fn_info.callable_class.ir.name, builder.module_name, sig)\n call_fn_ir = FuncIR(call_fn_decl, args, blocks,\n fn_info.fitem.line, traceback_name=fn_info.fitem.name)\n fn_info.callable_class.ir.methods['__call__'] = call_fn_ir\n fn_info.callable_class.ir.method_decls['__call__'] = call_fn_decl\n return call_fn_ir", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/callable_class.py_instantiate_callable_class_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/callable_class.py_instantiate_callable_class_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/callable_class.py", "file_name": "callable_class.py", "file_type": "text/x-python", "category": "implementation", "start_line": 145, "end_line": 180, "span_ids": ["instantiate_callable_class"], "tokens": 378}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def instantiate_callable_class(builder: IRBuilder, fn_info: FuncInfo) -> Value:\n \"\"\"Create an instance of a callable class for a function.\n\n Calls to the function will actually call this instance.\n\n Note that fn_info refers to the function being assigned, whereas\n builder.fn_info refers to the function encapsulating the function\n being turned into a callable class.\n \"\"\"\n fitem = fn_info.fitem\n func_reg = builder.add(Call(fn_info.callable_class.ir.ctor, [], fitem.line))\n\n # Set the environment attribute of the callable class to point at\n # the environment class defined in the callable class' immediate\n # outer scope. Note that there are three possible environment\n # class registers we may use. This depends on what the encapsulating\n # (parent) function is:\n #\n # - A nested function: the callable class is instantiated\n # from the current callable class' '__call__' function, and hence\n # the callable class' environment register is used.\n # - A generator function: the callable class is instantiated\n # from the '__next__' method of the generator class, and hence the\n # environment of the generator class is used.\n # - Regular function: we use the environment of the original function.\n curr_env_reg = None\n if builder.fn_info.is_generator:\n curr_env_reg = builder.fn_info.generator_class.curr_env_reg\n elif builder.fn_info.is_nested:\n curr_env_reg = builder.fn_info.callable_class.curr_env_reg\n elif builder.fn_info.contains_nested:\n curr_env_reg = builder.fn_info.curr_env_reg\n if curr_env_reg:\n builder.add(SetAttr(func_reg, ENV_ATTR_NAME, curr_env_reg, fitem.line))\n return func_reg", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/classdef.py__Transform_class_defini_from_mypyc_irbuild_functi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/classdef.py__Transform_class_defini_from_mypyc_irbuild_functi", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/classdef.py", "file_name": "classdef.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 30, "span_ids": ["docstring"], "tokens": 326}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Transform class definitions from the mypy AST form to IR.\"\"\"\n\nfrom typing import List, Optional, Tuple\nfrom typing_extensions import Final\n\nfrom mypy.nodes import (\n ClassDef, FuncDef, OverloadedFuncDef, PassStmt, AssignmentStmt, NameExpr, StrExpr,\n ExpressionStmt, TempNode, Decorator, Lvalue, RefExpr, is_class_var\n)\nfrom mypyc.ir.ops import (\n Value, Register, Call, LoadErrorValue, LoadStatic, InitStatic, TupleSet, SetAttr, Return,\n BasicBlock, Branch, MethodCall, NAMESPACE_TYPE, LoadAddress\n)\nfrom mypyc.ir.rtypes import (\n RType, object_rprimitive, bool_rprimitive, dict_rprimitive, is_optional_type,\n is_object_rprimitive, is_none_rprimitive\n)\nfrom mypyc.ir.func_ir import FuncDecl, FuncSignature\nfrom mypyc.ir.class_ir import ClassIR, NonExtClassInfo\nfrom mypyc.primitives.generic_ops import py_setattr_op, py_hasattr_op\nfrom mypyc.primitives.misc_ops import (\n dataclass_sleight_of_hand, pytype_from_template_op, py_calc_meta_op, type_object_op,\n not_implemented_op\n)\nfrom mypyc.primitives.dict_ops import dict_set_item_op, dict_new_op\nfrom mypyc.irbuild.util import (\n is_dataclass_decorator, get_func_def, is_dataclass, is_constant\n)\nfrom mypyc.irbuild.builder import IRBuilder\nfrom mypyc.irbuild.function import transform_method", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/classdef.py_transform_class_def.for_stmt_in_cdef_defs_bod_transform_class_def.if_not_non_ext_That_i.else_.cache_class_attrs_builder": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/classdef.py_transform_class_def.for_stmt_in_cdef_defs_bod_transform_class_def.if_not_non_ext_That_i.else_.cache_class_attrs_builder", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/classdef.py", "file_name": "classdef.py", "file_type": "text/x-python", "category": "implementation", "start_line": 81, "end_line": 158, "span_ids": ["transform_class_def"], "tokens": 761}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def transform_class_def(builder: IRBuilder, cdef: ClassDef) -> None:\n # ... other code\n\n for stmt in cdef.defs.body:\n if isinstance(stmt, OverloadedFuncDef) and stmt.is_property:\n if not ir.is_ext_class:\n # properties with both getters and setters in non_extension\n # classes not supported\n builder.error(\"Property setters not supported in non-extension classes\",\n stmt.line)\n for item in stmt.items:\n with builder.catch_errors(stmt.line):\n transform_method(builder, cdef, non_ext, get_func_def(item))\n elif isinstance(stmt, (FuncDef, Decorator, OverloadedFuncDef)):\n # Ignore plugin generated methods (since they have no\n # bodies to compile and will need to have the bodies\n # provided by some other mechanism.)\n if cdef.info.names[stmt.name].plugin_generated:\n continue\n with builder.catch_errors(stmt.line):\n transform_method(builder, cdef, non_ext, get_func_def(stmt))\n elif isinstance(stmt, PassStmt):\n continue\n elif isinstance(stmt, AssignmentStmt):\n if len(stmt.lvalues) != 1:\n builder.error(\"Multiple assignment in class bodies not supported\", stmt.line)\n continue\n lvalue = stmt.lvalues[0]\n if not isinstance(lvalue, NameExpr):\n builder.error(\"Only assignment to variables is supported in class bodies\",\n stmt.line)\n continue\n # We want to collect class variables in a dictionary for both real\n # non-extension classes and fake dataclass ones.\n var_non_ext = non_ext or dataclass_non_ext\n if var_non_ext:\n add_non_ext_class_attr(builder, var_non_ext, lvalue, stmt, cdef, attrs_to_cache)\n if non_ext:\n continue\n # Variable declaration with no body\n if isinstance(stmt.rvalue, TempNode):\n continue\n # Only treat marked class variables as class variables.\n if not (is_class_var(lvalue) or stmt.is_final_def):\n continue\n typ = builder.load_native_type_object(cdef.fullname)\n value = builder.accept(stmt.rvalue)\n builder.call_c(\n py_setattr_op, [typ, builder.load_str(lvalue.name), value], stmt.line)\n if builder.non_function_scope() and stmt.is_final_def:\n builder.init_final_static(lvalue, value, cdef.name)\n elif isinstance(stmt, ExpressionStmt) and isinstance(stmt.expr, StrExpr):\n # Docstring. Ignore\n pass\n else:\n builder.error(\"Unsupported statement in class body\", stmt.line)\n\n if not non_ext: # That is, an extension class\n generate_attr_defaults(builder, cdef)\n create_ne_from_eq(builder, cdef)\n if dataclass_non_ext:\n assert type_obj\n dataclass_finalize(builder, cdef, dataclass_non_ext, type_obj)\n else:\n # Dynamically create the class via the type constructor\n non_ext_class = load_non_ext_class(builder, ir, non_ext, cdef.line)\n non_ext_class = load_decorated_class(builder, cdef, non_ext_class)\n\n # Save the decorated class\n builder.add(InitStatic(non_ext_class, cdef.name, builder.module_name, NAMESPACE_TYPE))\n\n # Add the non-extension class to the dict\n builder.call_c(dict_set_item_op,\n [\n builder.load_globals_dict(),\n builder.load_str(cdef.name),\n non_ext_class\n ], cdef.line)\n\n # Cache any cachable class attributes\n cache_class_attrs(builder, attrs_to_cache, cdef)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/classdef.py_setup_non_ext_dict_setup_non_ext_dict.return.non_ext_dict": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/classdef.py_setup_non_ext_dict_setup_non_ext_dict.return.non_ext_dict", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/classdef.py", "file_name": "classdef.py", "file_type": "text/x-python", "category": "implementation", "start_line": 234, "end_line": 264, "span_ids": ["setup_non_ext_dict"], "tokens": 280}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def setup_non_ext_dict(builder: IRBuilder,\n cdef: ClassDef,\n metaclass: Value,\n bases: Value) -> Value:\n \"\"\"Initialize the class dictionary for a non-extension class.\n\n This class dictionary is passed to the metaclass constructor.\n \"\"\"\n # Check if the metaclass defines a __prepare__ method, and if so, call it.\n has_prepare = builder.call_c(py_hasattr_op,\n [metaclass,\n builder.load_str('__prepare__')], cdef.line)\n\n non_ext_dict = Register(dict_rprimitive)\n\n true_block, false_block, exit_block, = BasicBlock(), BasicBlock(), BasicBlock()\n builder.add_bool_branch(has_prepare, true_block, false_block)\n\n builder.activate_block(true_block)\n cls_name = builder.load_str(cdef.name)\n prepare_meth = builder.py_get_attr(metaclass, '__prepare__', cdef.line)\n prepare_dict = builder.py_call(prepare_meth, [cls_name, bases], cdef.line)\n builder.assign(non_ext_dict, prepare_dict, cdef.line)\n builder.goto(exit_block)\n\n builder.activate_block(false_block)\n builder.assign(non_ext_dict, builder.call_c(dict_new_op, [], cdef.line), cdef.line)\n builder.goto(exit_block)\n builder.activate_block(exit_block)\n\n return non_ext_dict", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/classdef.py_load_non_ext_class_load_decorated_class.return.dec_class": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/classdef.py_load_non_ext_class_load_decorated_class.return.dec_class", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/classdef.py", "file_name": "classdef.py", "file_type": "text/x-python", "category": "implementation", "start_line": 388, "end_line": 419, "span_ids": ["load_decorated_class", "load_non_ext_class"], "tokens": 253}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def load_non_ext_class(builder: IRBuilder,\n ir: ClassIR,\n non_ext: NonExtClassInfo,\n line: int) -> Value:\n cls_name = builder.load_str(ir.name)\n\n finish_non_ext_dict(builder, non_ext, line)\n\n class_type_obj = builder.py_call(\n non_ext.metaclass,\n [cls_name, non_ext.bases, non_ext.dict],\n line\n )\n return class_type_obj\n\n\ndef load_decorated_class(builder: IRBuilder, cdef: ClassDef, type_obj: Value) -> Value:\n \"\"\"Apply class decorators to create a decorated (non-extension) class object.\n\n Given a decorated ClassDef and a register containing a\n non-extension representation of the ClassDef created via the type\n constructor, applies the corresponding decorator functions on that\n decorated ClassDef and returns a register containing the decorated\n ClassDef.\n \"\"\"\n decorators = cdef.decorators\n dec_class = type_obj\n for d in reversed(decorators):\n decorator = d.accept(builder.visitor)\n assert isinstance(decorator, Value)\n dec_class = builder.py_call(decorator, [dec_class], dec_class.line)\n return dec_class", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/classdef.py_cache_class_attrs_create_mypyc_attrs_tuple.return.builder_new_tuple_items_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/classdef.py_cache_class_attrs_create_mypyc_attrs_tuple.return.builder_new_tuple_items_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/classdef.py", "file_name": "classdef.py", "file_type": "text/x-python", "category": "implementation", "start_line": 470, "end_line": 486, "span_ids": ["create_mypyc_attrs_tuple", "cache_class_attrs"], "tokens": 195}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def cache_class_attrs(builder: IRBuilder,\n attrs_to_cache: List[Tuple[Lvalue, RType]],\n cdef: ClassDef) -> None:\n \"\"\"Add class attributes to be cached to the global cache.\"\"\"\n typ = builder.load_native_type_object(cdef.info.fullname)\n for lval, rtype in attrs_to_cache:\n assert isinstance(lval, NameExpr)\n rval = builder.py_get_attr(typ, lval.name, cdef.line)\n builder.init_final_static(lval, rval, cdef.name, type_override=rtype)\n\n\ndef create_mypyc_attrs_tuple(builder: IRBuilder, ir: ClassIR, line: int) -> Value:\n attrs = [name for ancestor in ir.mro for name in ancestor.attributes]\n if ir.inherits_python:\n attrs.append('__dict__')\n items = [builder.load_str(attr) for attr in attrs]\n return builder.new_tuple(items, line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/classdef.py_finish_non_ext_dict_finish_non_ext_dict.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/classdef.py_finish_non_ext_dict_finish_non_ext_dict.None_2", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/classdef.py", "file_name": "classdef.py", "file_type": "text/x-python", "category": "implementation", "start_line": 439, "end_line": 452, "span_ids": ["finish_non_ext_dict"], "tokens": 191}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def finish_non_ext_dict(builder: IRBuilder, non_ext: NonExtClassInfo, line: int) -> None:\n # Add __annotations__ to the class dict.\n builder.call_c(dict_set_item_op,\n [non_ext.dict, builder.load_str('__annotations__'),\n non_ext.anns], -1)\n\n # We add a __doc__ attribute so if the non-extension class is decorated with the\n # dataclass decorator, dataclass will not try to look for __text_signature__.\n # https://github.com/python/cpython/blob/3.7/Lib/dataclasses.py#L957\n filler_doc_str = 'mypyc filler docstring'\n builder.add_to_non_ext_dict(\n non_ext, '__doc__', builder.load_str(filler_doc_str), line)\n builder.add_to_non_ext_dict(\n non_ext, '__module__', builder.load_str(builder.module_name), line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/classdef.py_dataclass_finalize_dataclass_finalize.builder_call_c_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/classdef.py_dataclass_finalize_dataclass_finalize.builder_call_c_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/classdef.py", "file_name": "classdef.py", "file_type": "text/x-python", "category": "implementation", "start_line": 487, "end_line": 509, "span_ids": ["dataclass_finalize"], "tokens": 274}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def dataclass_finalize(\n builder: IRBuilder, cdef: ClassDef, non_ext: NonExtClassInfo, type_obj: Value) -> None:\n \"\"\"Generate code to finish instantiating a dataclass.\n\n This works by replacing all of the attributes on the class\n (which will be descriptors) with whatever they would be in a\n non-extension class, calling dataclass, then switching them back.\n\n The resulting class is an extension class and instances of it do not\n have a __dict__ (unless something else requires it).\n All methods written explicitly in the source are compiled and\n may be called through the vtable while the methods generated\n by dataclasses are interpreted and may not be.\n\n (If we just called dataclass without doing this, it would think that all\n of the descriptors for our attributes are default values and generate an\n incorrect constructor. We need to do the switch so that dataclass gets the\n appropriate defaults.)\n \"\"\"\n finish_non_ext_dict(builder, non_ext, cdef.line)\n dec = builder.accept(next(d for d in cdef.decorators if is_dataclass_decorator(d)))\n builder.call_c(\n dataclass_sleight_of_hand, [dec, type_obj, non_ext.dict, non_ext.anns], cdef.line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/classdef.py_dataclass_non_ext_info_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/classdef.py_dataclass_non_ext_info_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/classdef.py", "file_name": "classdef.py", "file_type": "text/x-python", "category": "implementation", "start_line": 512, "end_line": 528, "span_ids": ["dataclass_non_ext_info"], "tokens": 162}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def dataclass_non_ext_info(builder: IRBuilder, cdef: ClassDef) -> Optional[NonExtClassInfo]:\n \"\"\"Set up a NonExtClassInfo to track dataclass attributes.\n\n In addition to setting up a normal extension class for dataclasses,\n we also collect its class attributes like a non-extension class so\n that we can hand them to the dataclass decorator.\n \"\"\"\n if is_dataclass(cdef):\n return NonExtClassInfo(\n builder.call_c(dict_new_op, [], cdef.line),\n builder.add(TupleSet([], cdef.line)),\n builder.call_c(dict_new_op, [], cdef.line),\n builder.add(LoadAddress(type_object_op.type, type_object_op.src, cdef.line))\n )\n else:\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/context.py__Helpers_that_store_inf_FuncInfo.curr_env_reg.return.self__curr_env_reg": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/context.py__Helpers_that_store_inf_FuncInfo.curr_env_reg.return.self__curr_env_reg", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/context.py", "file_name": "context.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 90, "span_ids": ["FuncInfo.is_generator", "FuncInfo.curr_env_reg", "FuncInfo.env_class", "FuncInfo.generator_class_7", "FuncInfo.__init__", "FuncInfo.generator_class", "FuncInfo.namespaced_name", "FuncInfo.callable_class_3", "docstring", "FuncInfo", "FuncInfo.env_class_5", "FuncInfo.callable_class"], "tokens": 776}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Helpers that store information about functions and the related classes.\"\"\"\n\nfrom typing import List, Optional, Tuple\n\nfrom mypy.nodes import FuncItem\n\nfrom mypyc.ir.ops import Value, BasicBlock\nfrom mypyc.ir.func_ir import INVALID_FUNC_DEF\nfrom mypyc.ir.class_ir import ClassIR\nfrom mypyc.common import decorator_helper_name\nfrom mypyc.irbuild.targets import AssignmentTarget\n\n\nclass FuncInfo:\n \"\"\"Contains information about functions as they are generated.\"\"\"\n\n def __init__(self,\n fitem: FuncItem = INVALID_FUNC_DEF,\n name: str = '',\n class_name: Optional[str] = None,\n namespace: str = '',\n is_nested: bool = False,\n contains_nested: bool = False,\n is_decorated: bool = False,\n in_non_ext: bool = False) -> None:\n self.fitem = fitem\n self.name = name if not is_decorated else decorator_helper_name(name)\n self.class_name = class_name\n self.ns = namespace\n # Callable classes implement the '__call__' method, and are used to represent functions\n # that are nested inside of other functions.\n self._callable_class = None # type: Optional[ImplicitClass]\n # Environment classes are ClassIR instances that contain attributes representing the\n # variables in the environment of the function they correspond to. Environment classes are\n # generated for functions that contain nested functions.\n self._env_class = None # type: Optional[ClassIR]\n # Generator classes implement the '__next__' method, and are used to represent generators\n # returned by generator functions.\n self._generator_class = None # type: Optional[GeneratorClass]\n # Environment class registers are the local registers associated with instances of an\n # environment class, used for getting and setting attributes. curr_env_reg is the register\n # associated with the current environment.\n self._curr_env_reg = None # type: Optional[Value]\n # These are flags denoting whether a given function is nested, contains a nested function,\n # is decorated, or is within a non-extension class.\n self.is_nested = is_nested\n self.contains_nested = contains_nested\n self.is_decorated = is_decorated\n self.in_non_ext = in_non_ext\n\n # TODO: add field for ret_type: RType = none_rprimitive\n\n def namespaced_name(self) -> str:\n return '_'.join(x for x in [self.name, self.class_name, self.ns] if x)\n\n @property\n def is_generator(self) -> bool:\n return self.fitem.is_generator or self.fitem.is_coroutine\n\n @property\n def callable_class(self) -> 'ImplicitClass':\n assert self._callable_class is not None\n return self._callable_class\n\n @callable_class.setter\n def callable_class(self, cls: 'ImplicitClass') -> None:\n self._callable_class = cls\n\n @property\n def env_class(self) -> ClassIR:\n assert self._env_class is not None\n return self._env_class\n\n @env_class.setter\n def env_class(self, ir: ClassIR) -> None:\n self._env_class = ir\n\n @property\n def generator_class(self) -> 'GeneratorClass':\n assert self._generator_class is not None\n return self._generator_class\n\n @generator_class.setter\n def generator_class(self, cls: 'GeneratorClass') -> None:\n self._generator_class = cls\n\n @property\n def curr_env_reg(self) -> Value:\n assert self._curr_env_reg is not None\n return self._curr_env_reg", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/context.py_ImplicitClass_ImplicitClass.prev_env_reg_5.self._prev_env_reg.reg": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/context.py_ImplicitClass_ImplicitClass.prev_env_reg_5.self._prev_env_reg.reg", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/context.py", "file_name": "context.py", "file_type": "text/x-python", "category": "implementation", "start_line": 92, "end_line": 138, "span_ids": ["ImplicitClass.prev_env_reg_5", "ImplicitClass.__init__", "ImplicitClass", "ImplicitClass.curr_env_reg_3", "ImplicitClass.self_reg", "ImplicitClass.self_reg_1", "ImplicitClass.curr_env_reg", "ImplicitClass.prev_env_reg"], "tokens": 395}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ImplicitClass:\n \"\"\"Contains information regarding implicitly generated classes.\n\n Implicit classes are generated for nested functions and generator\n functions. They are not explicitly defined in the source code.\n\n NOTE: This is both a concrete class and used as a base class.\n \"\"\"\n\n def __init__(self, ir: ClassIR) -> None:\n # The ClassIR instance associated with this class.\n self.ir = ir\n # The register associated with the 'self' instance for this generator class.\n self._self_reg = None # type: Optional[Value]\n # Environment class registers are the local registers associated with instances of an\n # environment class, used for getting and setting attributes. curr_env_reg is the register\n # associated with the current environment. prev_env_reg is the self.__mypyc_env__ field\n # associated with the previous environment.\n self._curr_env_reg = None # type: Optional[Value]\n self._prev_env_reg = None # type: Optional[Value]\n\n @property\n def self_reg(self) -> Value:\n assert self._self_reg is not None\n return self._self_reg\n\n @self_reg.setter\n def self_reg(self, reg: Value) -> None:\n self._self_reg = reg\n\n @property\n def curr_env_reg(self) -> Value:\n assert self._curr_env_reg is not None\n return self._curr_env_reg\n\n @curr_env_reg.setter\n def curr_env_reg(self, reg: Value) -> None:\n self._curr_env_reg = reg\n\n @property\n def prev_env_reg(self) -> Value:\n assert self._prev_env_reg is not None\n return self._prev_env_reg\n\n @prev_env_reg.setter\n def prev_env_reg(self, reg: Value) -> None:\n self._prev_env_reg = reg", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/context.py_GeneratorClass_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/context.py_GeneratorClass_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/context.py", "file_name": "context.py", "file_type": "text/x-python", "category": "implementation", "start_line": 141, "end_line": 180, "span_ids": ["GeneratorClass.next_label_target", "GeneratorClass.next_label_reg", "GeneratorClass", "GeneratorClass.next_label_target_3", "GeneratorClass.__init__", "GeneratorClass.next_label_reg_1"], "tokens": 350}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GeneratorClass(ImplicitClass):\n \"\"\"Contains information about implicit generator function classes.\"\"\"\n\n def __init__(self, ir: ClassIR) -> None:\n super().__init__(ir)\n # This register holds the label number that the '__next__' function should go to the next\n # time it is called.\n self._next_label_reg = None # type: Optional[Value]\n self._next_label_target = None # type: Optional[AssignmentTarget]\n\n # These registers hold the error values for the generator object for the case that the\n # 'throw' function is called.\n self.exc_regs = None # type: Optional[Tuple[Value, Value, Value]]\n\n # Holds the arg passed to send\n self.send_arg_reg = None # type: Optional[Value]\n\n # The switch block is used to decide which instruction to go using the value held in the\n # next-label register.\n self.switch_block = BasicBlock()\n self.continuation_blocks = [] # type: List[BasicBlock]\n\n @property\n def next_label_reg(self) -> Value:\n assert self._next_label_reg is not None\n return self._next_label_reg\n\n @next_label_reg.setter\n def next_label_reg(self, reg: Value) -> None:\n self._next_label_reg = reg\n\n @property\n def next_label_target(self) -> AssignmentTarget:\n assert self._next_label_target is not None\n return self._next_label_target\n\n @next_label_target.setter\n def next_label_target(self, target: AssignmentTarget) -> None:\n self._next_label_target = target", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/env_class.py__Generate_classes_repre_from_mypyc_irbuild_contex": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/env_class.py__Generate_classes_repre_from_mypyc_irbuild_contex", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/env_class.py", "file_name": "env_class.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 28, "span_ids": ["docstring"], "tokens": 238}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Generate classes representing function environments (+ related operations).\n\nIf we have a nested function that has non-local (free) variables, access to the\nnon-locals is via an instance of an environment class. Example:\n\n def f() -> int:\n x = 0 # Make 'x' an attribute of an environment class instance\n\n def g() -> int:\n # We have access to the environment class instance to\n # allow accessing 'x'\n return x + 2\n\n x = x + 1 # Modify the attribute\n return g()\n\"\"\"\n\nfrom typing import Dict, Optional, Union\n\nfrom mypy.nodes import FuncDef, SymbolNode\n\nfrom mypyc.common import SELF_NAME, ENV_ATTR_NAME\nfrom mypyc.ir.ops import Call, GetAttr, SetAttr, Value\nfrom mypyc.ir.rtypes import RInstance, object_rprimitive\nfrom mypyc.ir.class_ir import ClassIR\nfrom mypyc.irbuild.builder import IRBuilder, SymbolTarget\nfrom mypyc.irbuild.targets import AssignmentTargetAttr\nfrom mypyc.irbuild.context import FuncInfo, ImplicitClass, GeneratorClass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/env_class.py_setup_env_class_setup_env_class.return.env_class": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/env_class.py_setup_env_class_setup_env_class.return.env_class", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/env_class.py", "file_name": "env_class.py", "file_type": "text/x-python", "category": "implementation", "start_line": 30, "end_line": 55, "span_ids": ["setup_env_class"], "tokens": 269}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def setup_env_class(builder: IRBuilder) -> ClassIR:\n \"\"\"Generate a class representing a function environment.\n\n Note that the variables in the function environment are not\n actually populated here. This is because when the environment\n class is generated, the function environment has not yet been\n visited. This behavior is allowed so that when the compiler visits\n nested functions, it can use the returned ClassIR instance to\n figure out free variables it needs to access. The remaining\n attributes of the environment class are populated when the\n environment registers are loaded.\n\n Return a ClassIR representing an environment for a function\n containing a nested function.\n \"\"\"\n env_class = ClassIR('{}_env'.format(builder.fn_info.namespaced_name()),\n builder.module_name, is_generated=True)\n env_class.attributes[SELF_NAME] = RInstance(env_class)\n if builder.fn_info.is_nested:\n # If the function is nested, its environment class must contain an environment\n # attribute pointing to its encapsulating functions' environment class.\n env_class.attributes[ENV_ATTR_NAME] = RInstance(builder.fn_infos[-2].env_class)\n env_class.mro = [env_class]\n builder.fn_info.env_class = env_class\n builder.classes.append(env_class)\n return env_class", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/env_class.py_finalize_env_class_finalize_env_class.if_builder_fn_info_is_nes.else_.add_args_to_env_builder_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/env_class.py_finalize_env_class_finalize_env_class.if_builder_fn_info_is_nes.else_.add_args_to_env_builder_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/env_class.py", "file_name": "env_class.py", "file_type": "text/x-python", "category": "implementation", "start_line": 58, "end_line": 68, "span_ids": ["finalize_env_class"], "tokens": 116}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def finalize_env_class(builder: IRBuilder) -> None:\n \"\"\"Generate, instantiate, and set up the environment of an environment class.\"\"\"\n instantiate_env_class(builder)\n\n # Iterate through the function arguments and replace local definitions (using registers)\n # that were previously added to the environment with references to the function's\n # environment class.\n if builder.fn_info.is_nested:\n add_args_to_env(builder, local=False, base=builder.fn_info.callable_class)\n else:\n add_args_to_env(builder, local=False, base=builder.fn_info)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/env_class.py_instantiate_env_class_instantiate_env_class.return.curr_env_reg": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/env_class.py_instantiate_env_class_instantiate_env_class.return.curr_env_reg", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/env_class.py", "file_name": "env_class.py", "file_type": "text/x-python", "category": "implementation", "start_line": 71, "end_line": 86, "span_ids": ["instantiate_env_class"], "tokens": 134}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def instantiate_env_class(builder: IRBuilder) -> Value:\n \"\"\"Assign an environment class to a register named after the given function definition.\"\"\"\n curr_env_reg = builder.add(\n Call(builder.fn_info.env_class.ctor, [], builder.fn_info.fitem.line)\n )\n\n if builder.fn_info.is_nested:\n builder.fn_info.callable_class._curr_env_reg = curr_env_reg\n builder.add(SetAttr(curr_env_reg,\n ENV_ATTR_NAME,\n builder.fn_info.callable_class.prev_env_reg,\n builder.fn_info.fitem.line))\n else:\n builder.fn_info._curr_env_reg = curr_env_reg\n\n return curr_env_reg", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/env_class.py_load_env_registers_load_env_registers.if_fn_info_is_nested_.if_isinstance_fitem_Func.setup_func_for_recursive_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/env_class.py_load_env_registers_load_env_registers.if_fn_info_is_nested_.if_isinstance_fitem_Func.setup_func_for_recursive_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/env_class.py", "file_name": "env_class.py", "file_type": "text/x-python", "category": "implementation", "start_line": 89, "end_line": 106, "span_ids": ["load_env_registers"], "tokens": 189}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def load_env_registers(builder: IRBuilder) -> None:\n \"\"\"Load the registers for the current FuncItem being visited.\n\n Adds the arguments of the FuncItem to the environment. If the\n FuncItem is nested inside of another function, then this also\n loads all of the outer environments of the FuncItem into registers\n so that they can be used when accessing free variables.\n \"\"\"\n add_args_to_env(builder, local=True)\n\n fn_info = builder.fn_info\n fitem = fn_info.fitem\n if fn_info.is_nested:\n load_outer_envs(builder, fn_info.callable_class)\n # If this is a FuncDef, then make sure to load the FuncDef into its own environment\n # class so that the function can be called recursively.\n if isinstance(fitem, FuncDef):\n setup_func_for_recursive_call(builder, fitem, fn_info.callable_class)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/env_class.py_load_outer_env_load_outer_env.return.env": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/env_class.py_load_outer_env_load_outer_env.return.env", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/env_class.py", "file_name": "env_class.py", "file_type": "text/x-python", "category": "implementation", "start_line": 110, "end_line": 132, "span_ids": ["load_outer_env"], "tokens": 215}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def load_outer_env(builder: IRBuilder,\n base: Value,\n outer_env: Dict[SymbolNode, SymbolTarget]) -> Value:\n \"\"\"Load the environment class for a given base into a register.\n\n Additionally, iterates through all of the SymbolNode and\n AssignmentTarget instances of the environment at the given index's\n symtable, and adds those instances to the environment of the\n current environment. This is done so that the current environment\n can access outer environment variables without having to reload\n all of the environment registers.\n\n Returns the register where the environment class was loaded.\n \"\"\"\n env = builder.add(GetAttr(base, ENV_ATTR_NAME, builder.fn_info.fitem.line))\n assert isinstance(env.type, RInstance), '{} must be of type RInstance'.format(env)\n\n for symbol, target in outer_env.items():\n env.type.class_ir.attributes[symbol.name] = target.type\n symbol_target = AssignmentTargetAttr(env, symbol.name)\n builder.add_target(symbol, symbol_target)\n\n return env", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/env_class.py_load_outer_envs_load_outer_envs.while_index_1_.index_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/env_class.py_load_outer_envs_load_outer_envs.while_index_1_.index_1", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/env_class.py", "file_name": "env_class.py", "file_type": "text/x-python", "category": "implementation", "start_line": 135, "end_line": 155, "span_ids": ["load_outer_envs"], "tokens": 208}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def load_outer_envs(builder: IRBuilder, base: ImplicitClass) -> None:\n index = len(builder.builders) - 2\n\n # Load the first outer environment. This one is special because it gets saved in the\n # FuncInfo instance's prev_env_reg field.\n if index > 1:\n # outer_env = builder.fn_infos[index].environment\n outer_env = builder.symtables[index]\n if isinstance(base, GeneratorClass):\n base.prev_env_reg = load_outer_env(builder, base.curr_env_reg, outer_env)\n else:\n base.prev_env_reg = load_outer_env(builder, base.self_reg, outer_env)\n env_reg = base.prev_env_reg\n index -= 1\n\n # Load the remaining outer environments into registers.\n while index > 1:\n # outer_env = builder.fn_infos[index].environment\n outer_env = builder.symtables[index]\n env_reg = load_outer_env(builder, env_reg, outer_env)\n index -= 1", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/env_class.py_add_args_to_env_add_args_to_env.if_local_.else_.for_arg_in_fn_info_fitem_.if_is_free_variable_build.builder_add_var_to_env_cl": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/env_class.py_add_args_to_env_add_args_to_env.if_local_.else_.for_arg_in_fn_info_fitem_.if_is_free_variable_build.builder_add_var_to_env_cl", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/env_class.py", "file_name": "env_class.py", "file_type": "text/x-python", "category": "implementation", "start_line": 158, "end_line": 172, "span_ids": ["add_args_to_env"], "tokens": 174}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_args_to_env(builder: IRBuilder,\n local: bool = True,\n base: Optional[Union[FuncInfo, ImplicitClass]] = None,\n reassign: bool = True) -> None:\n fn_info = builder.fn_info\n if local:\n for arg in fn_info.fitem.arguments:\n rtype = builder.type_to_rtype(arg.variable.type)\n builder.add_local_reg(arg.variable, rtype, is_arg=True)\n else:\n for arg in fn_info.fitem.arguments:\n if is_free_variable(builder, arg.variable) or fn_info.is_generator:\n rtype = builder.type_to_rtype(arg.variable.type)\n assert base is not None, 'base cannot be None for adding nonlocal args'\n builder.add_var_to_env_class(arg.variable, rtype, base, reassign=reassign)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/env_class.py_setup_func_for_recursive_call_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/env_class.py_setup_func_for_recursive_call_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/env_class.py", "file_name": "env_class.py", "file_type": "text/x-python", "category": "implementation", "start_line": 175, "end_line": 208, "span_ids": ["setup_func_for_recursive_call", "is_free_variable"], "tokens": 339}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def setup_func_for_recursive_call(builder: IRBuilder, fdef: FuncDef, base: ImplicitClass) -> None:\n \"\"\"Enable calling a nested function (with a callable class) recursively.\n\n Adds the instance of the callable class representing the given\n FuncDef to a register in the environment so that the function can\n be called recursively. Note that this needs to be done only for\n nested functions.\n \"\"\"\n # First, set the attribute of the environment class so that GetAttr can be called on it.\n prev_env = builder.fn_infos[-2].env_class\n prev_env.attributes[fdef.name] = builder.type_to_rtype(fdef.type)\n\n if isinstance(base, GeneratorClass):\n # If we are dealing with a generator class, then we need to first get the register\n # holding the current environment class, and load the previous environment class from\n # there.\n prev_env_reg = builder.add(GetAttr(base.curr_env_reg, ENV_ATTR_NAME, -1))\n else:\n prev_env_reg = base.prev_env_reg\n\n # Obtain the instance of the callable class representing the FuncDef, and add it to the\n # current environment.\n val = builder.add(GetAttr(prev_env_reg, fdef.name, -1))\n target = builder.add_local_reg(fdef, object_rprimitive)\n builder.assign(target, val, -1)\n\n\ndef is_free_variable(builder: IRBuilder, symbol: SymbolNode) -> bool:\n fitem = builder.fn_info.fitem\n return (\n fitem in builder.free_variables\n and symbol in builder.free_variables[fitem]\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py__Transform_mypy_express_from_mypyc_irbuild_for_he": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py__Transform_mypy_express_from_mypyc_irbuild_for_he", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/expression.py", "file_name": "expression.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 41, "span_ids": ["docstring"], "tokens": 492}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Transform mypy expression ASTs to mypyc IR (Intermediate Representation).\n\nThe top-level AST transformation logic is implemented in mypyc.irbuild.visitor\nand mypyc.irbuild.builder.\n\"\"\"\n\nfrom typing import List, Optional, Union, Callable, cast\n\nfrom mypy.nodes import (\n Expression, NameExpr, MemberExpr, SuperExpr, CallExpr, UnaryExpr, OpExpr, IndexExpr,\n ConditionalExpr, ComparisonExpr, IntExpr, FloatExpr, ComplexExpr, StrExpr,\n BytesExpr, EllipsisExpr, ListExpr, TupleExpr, DictExpr, SetExpr, ListComprehension,\n SetComprehension, DictionaryComprehension, SliceExpr, GeneratorExpr, CastExpr, StarExpr,\n AssignmentExpr,\n Var, RefExpr, MypyFile, TypeInfo, TypeApplication, LDEF, ARG_POS\n)\nfrom mypy.types import TupleType, get_proper_type, Instance\n\nfrom mypyc.common import MAX_SHORT_INT\nfrom mypyc.ir.ops import (\n Value, Register, TupleGet, TupleSet, BasicBlock, Assign, LoadAddress, RaiseStandardError\n)\nfrom mypyc.ir.rtypes import (\n RTuple, object_rprimitive, is_none_rprimitive, int_rprimitive, is_int_rprimitive\n)\nfrom mypyc.ir.func_ir import FUNC_CLASSMETHOD, FUNC_STATICMETHOD\nfrom mypyc.primitives.registry import CFunctionDescription, builtin_names\nfrom mypyc.primitives.generic_ops import iter_op\nfrom mypyc.primitives.misc_ops import new_slice_op, ellipsis_op, type_op, get_module_dict_op\nfrom mypyc.primitives.list_ops import list_append_op, list_extend_op, list_slice_op\nfrom mypyc.primitives.tuple_ops import list_tuple_op, tuple_slice_op\nfrom mypyc.primitives.dict_ops import dict_new_op, dict_set_item_op, dict_get_item_op\nfrom mypyc.primitives.set_ops import set_add_op, set_update_op\nfrom mypyc.primitives.str_ops import str_slice_op\nfrom mypyc.primitives.int_ops import int_comparison_op_mapping\nfrom mypyc.irbuild.specialize import specializers\nfrom mypyc.irbuild.builder import IRBuilder\nfrom mypyc.irbuild.for_helpers import (\n translate_list_comprehension, translate_set_comprehension,\n comprehension_helper\n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py__Name_and_attribute_refe_transform_name_expr.return.builder_load_global_expr_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py__Name_and_attribute_refe_transform_name_expr.return.builder_load_global_expr_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/expression.py", "file_name": "expression.py", "file_type": "text/x-python", "category": "implementation", "start_line": 44, "end_line": 111, "span_ids": ["transform_name_expr", "docstring"], "tokens": 596}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Name and attribute references\n\n\ndef transform_name_expr(builder: IRBuilder, expr: NameExpr) -> Value:\n if expr.node is None:\n builder.add(RaiseStandardError(RaiseStandardError.RUNTIME_ERROR,\n \"mypyc internal error: should be unreachable\",\n expr.line))\n return builder.none()\n fullname = expr.node.fullname\n if fullname in builtin_names:\n typ, src = builtin_names[fullname]\n return builder.add(LoadAddress(typ, src, expr.line))\n # special cases\n if fullname == 'builtins.None':\n return builder.none()\n if fullname == 'builtins.True':\n return builder.true()\n if fullname == 'builtins.False':\n return builder.false()\n\n if isinstance(expr.node, Var) and expr.node.is_final:\n value = builder.emit_load_final(\n expr.node,\n fullname,\n expr.name,\n builder.is_native_ref_expr(expr),\n builder.types[expr],\n expr.line,\n )\n if value is not None:\n return value\n\n if isinstance(expr.node, MypyFile) and expr.node.fullname in builder.imports:\n return builder.load_module(expr.node.fullname)\n\n # If the expression is locally defined, then read the result from the corresponding\n # assignment target and return it. Otherwise if the expression is a global, load it from\n # the globals dictionary.\n # Except for imports, that currently always happens in the global namespace.\n if expr.kind == LDEF and not (isinstance(expr.node, Var)\n and expr.node.is_suppressed_import):\n # Try to detect and error when we hit the irritating mypy bug\n # where a local variable is cast to None. (#5423)\n if (isinstance(expr.node, Var) and is_none_rprimitive(builder.node_type(expr))\n and expr.node.is_inferred):\n builder.error(\n 'Local variable \"{}\" has inferred type None; add an annotation'.format(\n expr.node.name),\n expr.node.line)\n\n # TODO: Behavior currently only defined for Var, FuncDef and MypyFile node types.\n if isinstance(expr.node, MypyFile):\n # Load reference to a module imported inside function from\n # the modules dictionary. It would be closer to Python\n # semantics to access modules imported inside functions\n # via local variables, but this is tricky since the mypy\n # AST doesn't include a Var node for the module. We\n # instead load the module separately on each access.\n mod_dict = builder.call_c(get_module_dict_op, [], expr.line)\n obj = builder.call_c(dict_get_item_op,\n [mod_dict, builder.load_str(expr.node.fullname)],\n expr.line)\n return obj\n else:\n return builder.read(builder.get_assignment_target(expr), expr.line)\n\n return builder.load_global(expr)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py_transform_member_expr_transform_member_expr.return.builder_builder_get_attr_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py_transform_member_expr_transform_member_expr.return.builder_builder_get_attr_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/expression.py", "file_name": "expression.py", "file_type": "text/x-python", "category": "implementation", "start_line": 105, "end_line": 127, "span_ids": ["transform_member_expr"], "tokens": 258}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def transform_member_expr(builder: IRBuilder, expr: MemberExpr) -> Value:\n # First check if this is maybe a final attribute.\n final = builder.get_final_ref(expr)\n if final is not None:\n fullname, final_var, native = final\n value = builder.emit_load_final(final_var, fullname, final_var.name, native,\n builder.types[expr], expr.line)\n if value is not None:\n return value\n\n if isinstance(expr.node, MypyFile) and expr.node.fullname in builder.imports:\n return builder.load_module(expr.node.fullname)\n\n obj = builder.accept(expr.expr)\n rtype = builder.node_type(expr)\n # Special case: for named tuples transform attribute access to faster index access.\n typ = get_proper_type(builder.types.get(expr.expr))\n if isinstance(typ, TupleType) and typ.partial_fallback.type.is_named_tuple:\n fields = typ.partial_fallback.type.metadata['namedtuple']['fields']\n if expr.name in fields:\n index = builder.builder.load_int(fields.index(expr.name))\n return builder.gen_method_call(obj, '__getitem__', [index], rtype, expr.line)\n return builder.builder.get_attr(obj, expr.name, rtype, expr.line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py_transform_super_expr_transform_super_expr.return.builder_py_get_attr_res_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py_transform_super_expr_transform_super_expr.return.builder_py_get_attr_res_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/expression.py", "file_name": "expression.py", "file_type": "text/x-python", "category": "implementation", "start_line": 132, "end_line": 152, "span_ids": ["transform_super_expr"], "tokens": 257}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def transform_super_expr(builder: IRBuilder, o: SuperExpr) -> Value:\n # warning(builder, 'can not optimize super() expression', o.line)\n sup_val = builder.load_module_attr_by_fullname('builtins.super', o.line)\n if o.call.args:\n args = [builder.accept(arg) for arg in o.call.args]\n else:\n assert o.info is not None\n typ = builder.load_native_type_object(o.info.fullname)\n ir = builder.mapper.type_to_ir[o.info]\n iter_env = iter(builder.builder.args)\n # Grab first argument\n vself = next(iter_env) # type: Value\n if builder.fn_info.is_generator:\n # grab sixth argument (see comment in translate_super_method_call)\n self_targ = list(builder.symtables[-1].values())[6]\n vself = builder.read(self_targ, builder.fn_info.fitem.line)\n elif not ir.is_ext_class:\n vself = next(iter_env) # second argument is self if non_extension class\n args = [typ, vself]\n res = builder.py_call(sup_val, args, o.line)\n return builder.py_get_attr(res, o.name, o.line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py__Calls_translate_call.return.builder_py_call_function_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py__Calls_translate_call.return.builder_py_call_function_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/expression.py", "file_name": "expression.py", "file_type": "text/x-python", "category": "implementation", "start_line": 140, "end_line": 167, "span_ids": ["transform_super_expr", "translate_call", "transform_call_expr"], "tokens": 239}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Calls\n\n\ndef transform_call_expr(builder: IRBuilder, expr: CallExpr) -> Value:\n if isinstance(expr.analyzed, CastExpr):\n return translate_cast_expr(builder, expr.analyzed)\n\n callee = expr.callee\n if isinstance(callee, IndexExpr) and isinstance(callee.analyzed, TypeApplication):\n callee = callee.analyzed.expr # Unwrap type application\n\n if isinstance(callee, MemberExpr):\n return translate_method_call(builder, expr, callee)\n elif isinstance(callee, SuperExpr):\n return translate_super_method_call(builder, expr, callee)\n else:\n return translate_call(builder, expr, callee)\n\n\ndef translate_call(builder: IRBuilder, expr: CallExpr, callee: Expression) -> Value:\n # The common case of calls is refexprs\n if isinstance(callee, RefExpr):\n return translate_refexpr_call(builder, expr, callee)\n\n function = builder.accept(callee)\n args = [builder.accept(arg) for arg in expr.args]\n return builder.py_call(function, args, expr.line,\n arg_kinds=expr.arg_kinds, arg_names=expr.arg_names)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py_translate_refexpr_call_translate_refexpr_call.return.builder_call_refexpr_with": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py_translate_refexpr_call_translate_refexpr_call.return.builder_call_refexpr_with", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/expression.py", "file_name": "expression.py", "file_type": "text/x-python", "category": "implementation", "start_line": 170, "end_line": 185, "span_ids": ["translate_refexpr_call"], "tokens": 165}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def translate_refexpr_call(builder: IRBuilder, expr: CallExpr, callee: RefExpr) -> Value:\n \"\"\"Translate a non-method call.\"\"\"\n\n # TODO: Allow special cases to have default args or named args. Currently they don't since\n # they check that everything in arg_kinds is ARG_POS.\n\n # If there is a specializer for this function, try calling it.\n if callee.fullname and (callee.fullname, None) in specializers:\n val = specializers[callee.fullname, None](builder, expr, callee)\n if val is not None:\n return val\n\n # Gen the argument values\n arg_values = [builder.accept(arg) for arg in expr.args]\n\n return builder.call_refexpr_with_args(expr, callee, arg_values)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py_translate_method_call_translate_method_call.if_builder_is_native_ref_.else_.return.builder_gen_method_call_o": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py_translate_method_call_translate_method_call.if_builder_is_native_ref_.else_.return.builder_gen_method_call_o", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/expression.py", "file_name": "expression.py", "file_type": "text/x-python", "category": "implementation", "start_line": 188, "end_line": 250, "span_ids": ["translate_method_call"], "tokens": 559}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def translate_method_call(builder: IRBuilder, expr: CallExpr, callee: MemberExpr) -> Value:\n \"\"\"Generate IR for an arbitrary call of form e.m(...).\n\n This can also deal with calls to module-level functions.\n \"\"\"\n if builder.is_native_ref_expr(callee):\n # Call to module-level native function or such\n return translate_call(builder, expr, callee)\n elif (\n isinstance(callee.expr, RefExpr)\n and isinstance(callee.expr.node, TypeInfo)\n and callee.expr.node in builder.mapper.type_to_ir\n and builder.mapper.type_to_ir[callee.expr.node].has_method(callee.name)\n ):\n # Call a method via the *class*\n assert isinstance(callee.expr.node, TypeInfo)\n ir = builder.mapper.type_to_ir[callee.expr.node]\n decl = ir.method_decl(callee.name)\n args = []\n arg_kinds, arg_names = expr.arg_kinds[:], expr.arg_names[:]\n # Add the class argument for class methods in extension classes\n if decl.kind == FUNC_CLASSMETHOD and ir.is_ext_class:\n args.append(builder.load_native_type_object(callee.expr.node.fullname))\n arg_kinds.insert(0, ARG_POS)\n arg_names.insert(0, None)\n args += [builder.accept(arg) for arg in expr.args]\n\n if ir.is_ext_class:\n return builder.builder.call(decl, args, arg_kinds, arg_names, expr.line)\n else:\n obj = builder.accept(callee.expr)\n return builder.gen_method_call(obj,\n callee.name,\n args,\n builder.node_type(expr),\n expr.line,\n expr.arg_kinds,\n expr.arg_names)\n\n elif builder.is_module_member_expr(callee):\n # Fall back to a PyCall for non-native module calls\n function = builder.accept(callee)\n args = [builder.accept(arg) for arg in expr.args]\n return builder.py_call(function, args, expr.line,\n arg_kinds=expr.arg_kinds, arg_names=expr.arg_names)\n else:\n receiver_typ = builder.node_type(callee.expr)\n\n # If there is a specializer for this method name/type, try calling it.\n if (callee.name, receiver_typ) in specializers:\n val = specializers[callee.name, receiver_typ](builder, expr, callee)\n if val is not None:\n return val\n\n obj = builder.accept(callee.expr)\n args = [builder.accept(arg) for arg in expr.args]\n return builder.gen_method_call(obj,\n callee.name,\n args,\n builder.node_type(expr),\n expr.line,\n expr.arg_kinds,\n expr.arg_names)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py_translate_super_method_call_translate_super_method_call.return.builder_builder_call_decl": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py_translate_super_method_call_translate_super_method_call.return.builder_builder_call_decl", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/expression.py", "file_name": "expression.py", "file_type": "text/x-python", "category": "implementation", "start_line": 268, "end_line": 320, "span_ids": ["translate_super_method_call"], "tokens": 542}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def translate_super_method_call(builder: IRBuilder, expr: CallExpr, callee: SuperExpr) -> Value:\n if callee.info is None or (len(callee.call.args) != 0 and len(callee.call.args) != 2):\n return translate_call(builder, expr, callee)\n\n # We support two-argument super but only when it is super(CurrentClass, self)\n # TODO: We could support it when it is a parent class in many cases?\n if len(callee.call.args) == 2:\n self_arg = callee.call.args[1]\n if (\n not isinstance(self_arg, NameExpr)\n or not isinstance(self_arg.node, Var)\n or not self_arg.node.is_self\n ):\n return translate_call(builder, expr, callee)\n\n typ_arg = callee.call.args[0]\n if (\n not isinstance(typ_arg, NameExpr)\n or not isinstance(typ_arg.node, TypeInfo)\n or callee.info is not typ_arg.node\n ):\n return translate_call(builder, expr, callee)\n\n ir = builder.mapper.type_to_ir[callee.info]\n # Search for the method in the mro, skipping ourselves.\n for base in ir.mro[1:]:\n if callee.name in base.method_decls:\n break\n else:\n return translate_call(builder, expr, callee)\n\n decl = base.method_decl(callee.name)\n arg_values = [builder.accept(arg) for arg in expr.args]\n arg_kinds, arg_names = expr.arg_kinds[:], expr.arg_names[:]\n\n if decl.kind != FUNC_STATICMETHOD:\n # Grab first argument\n vself = builder.self() # type: Value\n if decl.kind == FUNC_CLASSMETHOD:\n vself = builder.call_c(type_op, [vself], expr.line)\n elif builder.fn_info.is_generator:\n # For generator classes, the self target is the 6th value\n # in the symbol table (which is an ordered dict). This is sort\n # of ugly, but we can't search by name since the 'self' parameter\n # could be named anything, and it doesn't get added to the\n # environment indexes.\n self_targ = list(builder.symtables[-1].values())[6]\n vself = builder.read(self_targ, builder.fn_info.fitem.line)\n arg_values.insert(0, vself)\n arg_kinds.insert(0, ARG_POS)\n arg_names.insert(0, None)\n\n return builder.builder.call(decl, arg_values, arg_kinds, arg_names, expr.line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py_translate_cast_expr_transform_op_expr.return.builder_binary_op_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py_translate_cast_expr_transform_op_expr.return.builder_binary_op_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/expression.py", "file_name": "expression.py", "file_type": "text/x-python", "category": "implementation", "start_line": 307, "end_line": 325, "span_ids": ["transform_op_expr", "transform_unary_expr", "translate_cast_expr"], "tokens": 150}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def translate_cast_expr(builder: IRBuilder, expr: CastExpr) -> Value:\n src = builder.accept(expr.expr)\n target_type = builder.type_to_rtype(expr.type)\n return builder.coerce(src, target_type, expr.line)\n\n\n# Operators\n\n\ndef transform_unary_expr(builder: IRBuilder, expr: UnaryExpr) -> Value:\n return builder.unary_op(builder.accept(expr.expr), expr.op, expr.line)\n\n\ndef transform_op_expr(builder: IRBuilder, expr: OpExpr) -> Value:\n if expr.op in ('and', 'or'):\n return builder.shortcircuit_expr(expr)\n return builder.binary_op(\n builder.accept(expr.left), builder.accept(expr.right), expr.op, expr.line\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py_transform_index_expr_transform_index_expr.return.builder_gen_method_call_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py_transform_index_expr_transform_index_expr.return.builder_gen_method_call_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/expression.py", "file_name": "expression.py", "file_type": "text/x-python", "category": "implementation", "start_line": 328, "end_line": 342, "span_ids": ["transform_index_expr"], "tokens": 125}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def transform_index_expr(builder: IRBuilder, expr: IndexExpr) -> Value:\n base = builder.accept(expr.base)\n index = expr.index\n\n if isinstance(base.type, RTuple) and isinstance(index, IntExpr):\n return builder.add(TupleGet(base, index.value, expr.line))\n\n if isinstance(index, SliceExpr):\n value = try_gen_slice_op(builder, base, index)\n if value:\n return value\n\n index_reg = builder.accept(expr.index)\n return builder.gen_method_call(\n base, '__getitem__', [index_reg], builder.node_type(expr), expr.line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py_try_gen_slice_op_try_gen_slice_op.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py_try_gen_slice_op_try_gen_slice_op.return.None", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/expression.py", "file_name": "expression.py", "file_type": "text/x-python", "category": "implementation", "start_line": 359, "end_line": 394, "span_ids": ["try_gen_slice_op"], "tokens": 294}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def try_gen_slice_op(builder: IRBuilder, base: Value, index: SliceExpr) -> Optional[Value]:\n \"\"\"Generate specialized slice op for some index expressions.\n\n Return None if a specialized op isn't available.\n\n This supports obj[x:y], obj[:x], and obj[x:] for a few types.\n \"\"\"\n if index.stride:\n # We can only handle the default stride of 1.\n return None\n\n if index.begin_index:\n begin_type = builder.node_type(index.begin_index)\n else:\n begin_type = int_rprimitive\n if index.end_index:\n end_type = builder.node_type(index.end_index)\n else:\n end_type = int_rprimitive\n\n # Both begin and end index must be int (or missing).\n if is_int_rprimitive(begin_type) and is_int_rprimitive(end_type):\n if index.begin_index:\n begin = builder.accept(index.begin_index)\n else:\n begin = builder.load_int(0)\n if index.end_index:\n end = builder.accept(index.end_index)\n else:\n # Replace missing end index with the largest short integer\n # (a sequence can't be longer).\n end = builder.load_int(MAX_SHORT_INT)\n candidates = [list_slice_op, tuple_slice_op, str_slice_op]\n return builder.builder.matching_call_c(candidates, [base, begin, end], index.line)\n\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py_transform_conditional_expr_transform_conditional_expr.return.target": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py_transform_conditional_expr_transform_conditional_expr.return.target", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/expression.py", "file_name": "expression.py", "file_type": "text/x-python", "category": "implementation", "start_line": 399, "end_line": 421, "span_ids": ["transform_conditional_expr"], "tokens": 187}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def transform_conditional_expr(builder: IRBuilder, expr: ConditionalExpr) -> Value:\n if_body, else_body, next = BasicBlock(), BasicBlock(), BasicBlock()\n\n builder.process_conditional(expr.cond, if_body, else_body)\n expr_type = builder.node_type(expr)\n # Having actual Phi nodes would be really nice here!\n target = Register(expr_type)\n\n builder.activate_block(if_body)\n true_value = builder.accept(expr.if_expr)\n true_value = builder.coerce(true_value, expr_type, expr.line)\n builder.add(Assign(target, true_value))\n builder.goto(next)\n\n builder.activate_block(else_body)\n false_value = builder.accept(expr.else_expr)\n false_value = builder.coerce(false_value, expr_type, expr.line)\n builder.add(Assign(target, false_value))\n builder.goto(next)\n\n builder.activate_block(next)\n\n return target", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py_transform_comparison_expr_transform_comparison_expr._assuming_that_prev_cont": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py_transform_comparison_expr_transform_comparison_expr._assuming_that_prev_cont", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/expression.py", "file_name": "expression.py", "file_type": "text/x-python", "category": "implementation", "start_line": 408, "end_line": 465, "span_ids": ["transform_comparison_expr"], "tokens": 634}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def transform_comparison_expr(builder: IRBuilder, e: ComparisonExpr) -> Value:\n # x in (...)/[...]\n # x not in (...)/[...]\n if (e.operators[0] in ['in', 'not in']\n and len(e.operators) == 1\n and isinstance(e.operands[1], (TupleExpr, ListExpr))):\n items = e.operands[1].items\n n_items = len(items)\n # x in y -> x == y[0] or ... or x == y[n]\n # x not in y -> x != y[0] and ... and x != y[n]\n # 16 is arbitrarily chosen to limit code size\n if 1 < n_items < 16:\n if e.operators[0] == 'in':\n bin_op = 'or'\n cmp_op = '=='\n else:\n bin_op = 'and'\n cmp_op = '!='\n lhs = e.operands[0]\n mypy_file = builder.graph['builtins'].tree\n assert mypy_file is not None\n bool_type = Instance(cast(TypeInfo, mypy_file.names['bool'].node), [])\n exprs = []\n for item in items:\n expr = ComparisonExpr([cmp_op], [lhs, item])\n builder.types[expr] = bool_type\n exprs.append(expr)\n\n or_expr = exprs.pop(0) # type: Expression\n for expr in exprs:\n or_expr = OpExpr(bin_op, or_expr, expr)\n builder.types[or_expr] = bool_type\n return builder.accept(or_expr)\n # x in [y]/(y) -> x == y\n # x not in [y]/(y) -> x != y\n elif n_items == 1:\n if e.operators[0] == 'in':\n cmp_op = '=='\n else:\n cmp_op = '!='\n e.operators = [cmp_op]\n e.operands[1] = items[0]\n # x in []/() -> False\n # x not in []/() -> True\n elif n_items == 0:\n if e.operators[0] == 'in':\n return builder.false()\n else:\n return builder.true()\n\n # TODO: Don't produce an expression when used in conditional context\n # All of the trickiness here is due to support for chained conditionals\n # (`e1 < e2 > e3`, etc). `e1 < e2 > e3` is approximately equivalent to\n # `e1 < e2 and e2 > e3` except that `e2` is only evaluated once.\n expr_type = builder.node_type(e)\n\n # go(i, prev) generates code for `ei opi e{i+1} op{i+1} ... en`,\n # assuming that prev contains the value of `ei`.\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py_transform_comparison_expr.go_transform_comparison_expr.return.go_0_builder_accept_e_op": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py_transform_comparison_expr.go_transform_comparison_expr.return.go_0_builder_accept_e_op", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/expression.py", "file_name": "expression.py", "file_type": "text/x-python", "category": "implementation", "start_line": 466, "end_line": 479, "span_ids": ["transform_comparison_expr"], "tokens": 157}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def transform_comparison_expr(builder: IRBuilder, e: ComparisonExpr) -> Value:\n # ... other code\n def go(i: int, prev: Value) -> Value:\n if i == len(e.operators) - 1:\n return transform_basic_comparison(builder,\n e.operators[i], prev, builder.accept(e.operands[i + 1]), e.line)\n\n next = builder.accept(e.operands[i + 1])\n return builder.builder.shortcircuit_helper(\n 'and', expr_type,\n lambda: transform_basic_comparison(builder,\n e.operators[i], prev, next, e.line),\n lambda: go(i + 1, next),\n e.line)\n\n return go(0, builder.accept(e.operands[0]))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py_transform_basic_comparison_transform_basic_comparison.return.target": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py_transform_basic_comparison_transform_basic_comparison.return.target", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/expression.py", "file_name": "expression.py", "file_type": "text/x-python", "category": "implementation", "start_line": 482, "end_line": 500, "span_ids": ["transform_basic_comparison"], "tokens": 150}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def transform_basic_comparison(builder: IRBuilder,\n op: str,\n left: Value,\n right: Value,\n line: int) -> Value:\n if (is_int_rprimitive(left.type) and is_int_rprimitive(right.type)\n and op in int_comparison_op_mapping.keys()):\n return builder.compare_tagged(left, right, op, line)\n negate = False\n if op == 'is not':\n op, negate = 'is', True\n elif op == 'not in':\n op, negate = 'in', True\n\n target = builder.binary_op(left, right, op, line)\n\n if negate:\n target = builder.unary_op(target, 'not', line)\n return target", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py__Literals__visit_list_display.return._visit_display_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py__Literals__visit_list_display.return._visit_display_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/expression.py", "file_name": "expression.py", "file_type": "text/x-python", "category": "implementation", "start_line": 517, "end_line": 561, "span_ids": ["transform_list_expr", "transform_basic_comparison", "transform_float_expr", "transform_complex_expr", "transform_ellipsis", "transform_str_expr", "transform_bytes_expr", "_visit_list_display", "transform_int_expr"], "tokens": 289}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Literals\n\n\ndef transform_int_expr(builder: IRBuilder, expr: IntExpr) -> Value:\n return builder.builder.load_int(expr.value)\n\n\ndef transform_float_expr(builder: IRBuilder, expr: FloatExpr) -> Value:\n return builder.builder.load_float(expr.value)\n\n\ndef transform_complex_expr(builder: IRBuilder, expr: ComplexExpr) -> Value:\n return builder.builder.load_complex(expr.value)\n\n\ndef transform_str_expr(builder: IRBuilder, expr: StrExpr) -> Value:\n return builder.load_str(expr.value)\n\n\ndef transform_bytes_expr(builder: IRBuilder, expr: BytesExpr) -> Value:\n value = bytes(expr.value, 'utf8').decode('unicode-escape').encode('raw-unicode-escape')\n return builder.builder.load_bytes(value)\n\n\ndef transform_ellipsis(builder: IRBuilder, o: EllipsisExpr) -> Value:\n return builder.add(LoadAddress(ellipsis_op.type, ellipsis_op.src, o.line))\n\n\n# Display expressions\n\n\ndef transform_list_expr(builder: IRBuilder, expr: ListExpr) -> Value:\n return _visit_list_display(builder, expr.items, expr.line)\n\n\ndef _visit_list_display(builder: IRBuilder, items: List[Expression], line: int) -> Value:\n return _visit_display(\n builder,\n items,\n builder.new_list_op,\n list_append_op,\n list_extend_op,\n line,\n True\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py_transform_tuple_expr_transform_tuple_expr.return.builder_add_TupleSet_item": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py_transform_tuple_expr_transform_tuple_expr.return.builder_add_TupleSet_item", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/expression.py", "file_name": "expression.py", "file_type": "text/x-python", "category": "implementation", "start_line": 550, "end_line": 566, "span_ids": ["transform_tuple_expr"], "tokens": 180}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def transform_tuple_expr(builder: IRBuilder, expr: TupleExpr) -> Value:\n if any(isinstance(item, StarExpr) for item in expr.items):\n # create a tuple of unknown length\n return _visit_tuple_display(builder, expr)\n\n # create a tuple of fixed length (RTuple)\n tuple_type = builder.node_type(expr)\n # When handling NamedTuple et. al we might not have proper type info,\n # so make some up if we need it.\n types = (tuple_type.types if isinstance(tuple_type, RTuple)\n else [object_rprimitive] * len(expr.items))\n\n items = []\n for item_expr, item_type in zip(expr.items, types):\n reg = builder.accept(item_expr)\n items.append(builder.coerce(reg, item_type, item_expr.line))\n return builder.add(TupleSet(items, expr.line))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py__visit_tuple_display_transform_set_expr.return._visit_display_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py__visit_tuple_display_transform_set_expr.return._visit_display_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/expression.py", "file_name": "expression.py", "file_type": "text/x-python", "category": "implementation", "start_line": 569, "end_line": 595, "span_ids": ["_visit_tuple_display", "transform_dict_expr", "transform_set_expr"], "tokens": 219}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _visit_tuple_display(builder: IRBuilder, expr: TupleExpr) -> Value:\n \"\"\"Create a list, then turn it into a tuple.\"\"\"\n val_as_list = _visit_list_display(builder, expr.items, expr.line)\n return builder.call_c(list_tuple_op, [val_as_list], expr.line)\n\n\ndef transform_dict_expr(builder: IRBuilder, expr: DictExpr) -> Value:\n \"\"\"First accepts all keys and values, then makes a dict out of them.\"\"\"\n key_value_pairs = []\n for key_expr, value_expr in expr.items:\n key = builder.accept(key_expr) if key_expr is not None else None\n value = builder.accept(value_expr)\n key_value_pairs.append((key, value))\n\n return builder.builder.make_dict(key_value_pairs, expr.line)\n\n\ndef transform_set_expr(builder: IRBuilder, expr: SetExpr) -> Value:\n return _visit_display(\n builder,\n expr.items,\n builder.new_set_op,\n set_add_op,\n set_update_op,\n expr.line,\n False\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py__visit_display__visit_display.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py__visit_display__visit_display.return.result", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/expression.py", "file_name": "expression.py", "file_type": "text/x-python", "category": "implementation", "start_line": 598, "end_line": 628, "span_ids": ["_visit_display"], "tokens": 211}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _visit_display(builder: IRBuilder,\n items: List[Expression],\n constructor_op: Callable[[List[Value], int], Value],\n append_op: CFunctionDescription,\n extend_op: CFunctionDescription,\n line: int,\n is_list: bool\n ) -> Value:\n accepted_items = []\n for item in items:\n if isinstance(item, StarExpr):\n accepted_items.append((True, builder.accept(item.expr)))\n else:\n accepted_items.append((False, builder.accept(item)))\n\n result = None # type: Union[Value, None]\n initial_items = []\n for starred, value in accepted_items:\n if result is None and not starred and is_list:\n initial_items.append(value)\n continue\n\n if result is None:\n result = constructor_op(initial_items, line)\n\n builder.call_c(extend_op if starred else append_op, [result, value], line)\n\n if result is None:\n result = constructor_op(initial_items, line)\n\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py__Misc_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py__Misc_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/expression.py", "file_name": "expression.py", "file_type": "text/x-python", "category": "implementation", "start_line": 665, "end_line": 693, "span_ids": ["transform_assignment_expr", "transform_generator_expr", "transform_slice_expr", "transform_dictionary_comprehension"], "tokens": 195}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Misc\n\n\ndef transform_slice_expr(builder: IRBuilder, expr: SliceExpr) -> Value:\n def get_arg(arg: Optional[Expression]) -> Value:\n if arg is None:\n return builder.none_object()\n else:\n return builder.accept(arg)\n\n args = [get_arg(expr.begin_index),\n get_arg(expr.end_index),\n get_arg(expr.stride)]\n return builder.call_c(new_slice_op, args, expr.line)\n\n\ndef transform_generator_expr(builder: IRBuilder, o: GeneratorExpr) -> Value:\n builder.warning('Treating generator comprehension as list', o.line)\n return builder.call_c(\n iter_op, [translate_list_comprehension(builder, o)], o.line\n )\n\n\ndef transform_assignment_expr(builder: IRBuilder, o: AssignmentExpr) -> Value:\n value = builder.accept(o.value)\n target = builder.get_assignment_target(o.target)\n builder.assign(target, value, o.line)\n return value", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py__Helpers_for_generating_GenFunc.Callable_None_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py__Helpers_for_generating_GenFunc.Callable_None_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/for_helpers.py", "file_name": "for_helpers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 34, "span_ids": ["docstring"], "tokens": 348}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Helpers for generating for loops and comprehensions.\n\nWe special case certain kinds for loops such as \"for x in range(...)\"\nfor better efficiency. Each for loop generator class below deals one\nsuch special case.\n\"\"\"\n\nfrom typing import Union, List, Optional, Tuple, Callable\nfrom typing_extensions import Type, ClassVar\n\nfrom mypy.nodes import (\n Lvalue, Expression, TupleExpr, CallExpr, RefExpr, GeneratorExpr, ARG_POS, MemberExpr, TypeAlias\n)\nfrom mypyc.ir.ops import (\n Value, BasicBlock, Integer, Branch, Register, TupleGet, TupleSet, IntOp\n)\nfrom mypyc.ir.rtypes import (\n RType, is_short_int_rprimitive, is_list_rprimitive, is_sequence_rprimitive,\n is_tuple_rprimitive, is_dict_rprimitive,\n RTuple, short_int_rprimitive, int_rprimitive\n)\nfrom mypyc.primitives.registry import CFunctionDescription\nfrom mypyc.primitives.dict_ops import (\n dict_next_key_op, dict_next_value_op, dict_next_item_op, dict_check_size_op,\n dict_key_iter_op, dict_value_iter_op, dict_item_iter_op\n)\nfrom mypyc.primitives.list_ops import list_append_op, list_get_item_unsafe_op, new_list_set_item_op\nfrom mypyc.primitives.set_ops import set_add_op\nfrom mypyc.primitives.generic_ops import iter_op, next_op\nfrom mypyc.primitives.exc_ops import no_err_occurred_op\nfrom mypyc.irbuild.builder import IRBuilder\nfrom mypyc.irbuild.targets import AssignmentTarget, AssignmentTargetTuple\n\nGenFunc = Callable[[], None]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_for_loop_helper_for_loop_helper.builder_activate_block_ex": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_for_loop_helper_for_loop_helper.builder_activate_block_ex", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/for_helpers.py", "file_name": "for_helpers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 35, "end_line": 86, "span_ids": ["for_loop_helper"], "tokens": 380}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def for_loop_helper(builder: IRBuilder, index: Lvalue, expr: Expression,\n body_insts: GenFunc, else_insts: Optional[GenFunc],\n line: int) -> None:\n \"\"\"Generate IR for a loop.\n\n Args:\n index: the loop index Lvalue\n expr: the expression to iterate over\n body_insts: a function that generates the body of the loop\n else_insts: a function that generates the else block instructions\n \"\"\"\n # Body of the loop\n body_block = BasicBlock()\n # Block that steps to the next item\n step_block = BasicBlock()\n # Block for the else clause, if we need it\n else_block = BasicBlock()\n # Block executed after the loop\n exit_block = BasicBlock()\n\n # Determine where we want to exit, if our condition check fails.\n normal_loop_exit = else_block if else_insts is not None else exit_block\n\n for_gen = make_for_loop_generator(builder, index, expr, body_block, normal_loop_exit, line)\n\n builder.push_loop_stack(step_block, exit_block)\n condition_block = BasicBlock()\n builder.goto_and_activate(condition_block)\n\n # Add loop condition check.\n for_gen.gen_condition()\n\n # Generate loop body.\n builder.activate_block(body_block)\n for_gen.begin_body()\n body_insts()\n\n # We generate a separate step block (which might be empty).\n builder.goto_and_activate(step_block)\n for_gen.gen_step()\n # Go back to loop condition.\n builder.goto(condition_block)\n\n for_gen.add_cleanup(normal_loop_exit)\n builder.pop_loop_stack()\n\n if else_insts is not None:\n builder.activate_block(else_block)\n else_insts()\n builder.goto(exit_block)\n\n builder.activate_block(exit_block)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_comprehension_helper.loop_contents_comprehension_helper.handle_loop_loop_params_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_comprehension_helper.loop_contents_comprehension_helper.handle_loop_loop_params_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/for_helpers.py", "file_name": "for_helpers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 126, "end_line": 156, "span_ids": ["comprehension_helper"], "tokens": 330}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def comprehension_helper(builder: IRBuilder,\n loop_params: List[Tuple[Lvalue, Expression, List[Expression]]],\n gen_inner_stmts: Callable[[], None],\n line: int) -> None:\n # ... other code\n\n def loop_contents(\n conds: List[Expression],\n remaining_loop_params: List[Tuple[Lvalue, Expression, List[Expression]]],\n ) -> None:\n \"\"\"Generate the body of the loop.\n\n Args:\n conds: a list of conditions to be evaluated (in order, with short circuiting)\n to gate the body of the loop\n remaining_loop_params: the parameters for any further nested loops; if it's empty\n we'll instead evaluate the \"gen_inner_stmts\" function\n \"\"\"\n # Check conditions, in order, short circuiting them.\n for cond in conds:\n cond_val = builder.accept(cond)\n cont_block, rest_block = BasicBlock(), BasicBlock()\n # If the condition is true we'll skip the continue.\n builder.add_bool_branch(cond_val, rest_block, cont_block)\n builder.activate_block(cont_block)\n builder.nonlocal_control[-1].gen_continue(builder, cond.line)\n builder.goto_and_activate(rest_block)\n\n if remaining_loop_params:\n # There's another nested level, so the body of this loop is another loop.\n return handle_loop(remaining_loop_params)\n else:\n # We finally reached the actual body of the generator.\n # Generate the IR for the inner loop body.\n gen_inner_stmts()\n\n handle_loop(loop_params)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_make_for_loop_generator.None_3_make_for_loop_generator.return.for_obj": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_make_for_loop_generator.None_3_make_for_loop_generator.return.for_obj", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/for_helpers.py", "file_name": "for_helpers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 253, "end_line": 281, "span_ids": ["make_for_loop_generator"], "tokens": 372}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def make_for_loop_generator(builder: IRBuilder,\n index: Lvalue,\n expr: Expression,\n body_block: BasicBlock,\n loop_exit: BasicBlock,\n line: int,\n nested: bool = False) -> 'ForGenerator':\n # ... other code\n if (isinstance(expr, CallExpr)\n and isinstance(expr.callee, MemberExpr)\n and not expr.args):\n # Special cases for dictionary iterator methods, like dict.items().\n rtype = builder.node_type(expr.callee.expr)\n if (is_dict_rprimitive(rtype)\n and expr.callee.name in ('keys', 'values', 'items')):\n expr_reg = builder.accept(expr.callee.expr)\n for_dict_type = None # type: Optional[Type[ForGenerator]]\n if expr.callee.name == 'keys':\n target_type = builder.get_dict_key_type(expr.callee.expr)\n for_dict_type = ForDictionaryKeys\n elif expr.callee.name == 'values':\n target_type = builder.get_dict_value_type(expr.callee.expr)\n for_dict_type = ForDictionaryValues\n else:\n target_type = builder.get_dict_item_type(expr.callee.expr)\n for_dict_type = ForDictionaryItems\n for_dict_gen = for_dict_type(builder, index, body_block, loop_exit, line, nested)\n for_dict_gen.init(expr_reg, target_type)\n return for_dict_gen\n\n # Default to a generic for loop.\n expr_reg = builder.accept(expr)\n for_obj = ForIterable(builder, index, body_block, loop_exit, line, nested)\n item_type = builder._analyze_iterable_item_type(expr)\n item_rtype = builder.type_to_rtype(item_type)\n for_obj.init(expr_reg, item_rtype)\n return for_obj", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForGenerator_ForGenerator.load_len.return.self_builder_builder_buil": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForGenerator_ForGenerator.load_len.return.self_builder_builder_buil", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/for_helpers.py", "file_name": "for_helpers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 284, "end_line": 335, "span_ids": ["ForGenerator.need_cleanup", "ForGenerator.begin_body", "ForGenerator.gen_cleanup", "ForGenerator.__init__", "ForGenerator.gen_step", "ForGenerator", "ForGenerator.add_cleanup", "ForGenerator.load_len", "ForGenerator.gen_condition"], "tokens": 438}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ForGenerator:\n \"\"\"Abstract base class for generating for loops.\"\"\"\n\n def __init__(self,\n builder: IRBuilder,\n index: Lvalue,\n body_block: BasicBlock,\n loop_exit: BasicBlock,\n line: int,\n nested: bool) -> None:\n self.builder = builder\n self.index = index\n self.body_block = body_block\n self.line = line\n # Some for loops need a cleanup block that we execute at exit. We\n # create a cleanup block if needed. However, if we are generating a for\n # loop for a nested iterator, such as \"e\" in \"enumerate(e)\", the\n # outermost generator should generate the cleanup block -- we don't\n # need to do it here.\n if self.need_cleanup() and not nested:\n # Create a new block to handle cleanup after loop exit.\n self.loop_exit = BasicBlock()\n else:\n # Just use the existing loop exit block.\n self.loop_exit = loop_exit\n\n def need_cleanup(self) -> bool:\n \"\"\"If this returns true, we need post-loop cleanup.\"\"\"\n return False\n\n def add_cleanup(self, exit_block: BasicBlock) -> None:\n \"\"\"Add post-loop cleanup, if needed.\"\"\"\n if self.need_cleanup():\n self.builder.activate_block(self.loop_exit)\n self.gen_cleanup()\n self.builder.goto(exit_block)\n\n def gen_condition(self) -> None:\n \"\"\"Generate check for loop exit (e.g. exhaustion of iteration).\"\"\"\n\n def begin_body(self) -> None:\n \"\"\"Generate ops at the beginning of the body (if needed).\"\"\"\n\n def gen_step(self) -> None:\n \"\"\"Generate stepping to the next item (if needed).\"\"\"\n\n def gen_cleanup(self) -> None:\n \"\"\"Generate post-loop cleanup (if needed).\"\"\"\n\n def load_len(self, expr: Union[Value, AssignmentTarget]) -> Value:\n \"\"\"A helper to get collection length, used by several subclasses.\"\"\"\n return self.builder.builder.builtin_len(self.builder.read(expr, self.line), self.line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForIterable_ForIterable.init.self.target_type.target_type": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForIterable_ForIterable.init.self.target_type.target_type", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/for_helpers.py", "file_name": "for_helpers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 338, "end_line": 353, "span_ids": ["ForIterable.need_cleanup", "ForIterable.init", "ForIterable"], "tokens": 167}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ForIterable(ForGenerator):\n \"\"\"Generate IR for a for loop over an arbitrary iterable (the normal case).\"\"\"\n\n def need_cleanup(self) -> bool:\n # Create a new cleanup block for when the loop is finished.\n return True\n\n def init(self, expr_reg: Value, target_type: RType) -> None:\n # Define targets to contain the expression, along with the iterator that will be used\n # for the for-loop. If we are inside of a generator function, spill these into the\n # environment class.\n builder = self.builder\n iter_reg = builder.call_c(iter_op, [expr_reg], self.line)\n builder.maybe_spill(expr_reg)\n self.iter_target = builder.maybe_spill(iter_reg)\n self.target_type = target_type", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForIterable.gen_condition_ForIterable.gen_condition.builder_add_Branch_self_n": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForIterable.gen_condition_ForIterable.gen_condition.builder_add_Branch_self_n", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/for_helpers.py", "file_name": "for_helpers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 355, "end_line": 363, "span_ids": ["ForIterable.gen_condition"], "tokens": 139}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ForIterable(ForGenerator):\n\n def gen_condition(self) -> None:\n # We call __next__ on the iterator and check to see if the return value\n # is NULL, which signals either the end of the Iterable being traversed\n # or an exception being raised. Note that Branch.IS_ERROR checks only\n # for NULL (an exception does not necessarily have to be raised).\n builder = self.builder\n line = self.line\n self.next_reg = builder.call_c(next_op, [builder.read(self.iter_target, line)], line)\n builder.add(Branch(self.next_reg, self.loop_exit, self.body_block, Branch.IS_ERROR))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForIterable.begin_body_ForIterable.gen_cleanup.self_builder_call_c_no_er": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForIterable.begin_body_ForIterable.gen_cleanup.self_builder_call_c_no_er", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/for_helpers.py", "file_name": "for_helpers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 365, "end_line": 384, "span_ids": ["ForIterable.begin_body", "ForIterable.gen_step", "ForIterable.gen_cleanup"], "tokens": 239}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ForIterable(ForGenerator):\n\n def begin_body(self) -> None:\n # Assign the value obtained from __next__ to the\n # lvalue so that it can be referenced by code in the body of the loop.\n builder = self.builder\n line = self.line\n # We unbox here so that iterating with tuple unpacking generates a tuple based\n # unpack instead of an iterator based one.\n next_reg = builder.coerce(self.next_reg, self.target_type, line)\n builder.assign(builder.get_assignment_target(self.index), next_reg, line)\n\n def gen_step(self) -> None:\n # Nothing to do here, since we get the next item as part of gen_condition().\n pass\n\n def gen_cleanup(self) -> None:\n # We set the branch to go here if the conditional evaluates to true. If\n # an exception was raised during the loop, then err_reg wil be set to\n # True. If no_err_occurred_op returns False, then the exception will be\n # propagated using the ERR_FALSE flag.\n self.builder.call_c(no_err_occurred_op, [], self.line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_unsafe_index_unsafe_index.if_is_list_rprimitive_tar.else_.return.builder_gen_method_call_t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_unsafe_index_unsafe_index.if_is_list_rprimitive_tar.else_.return.builder_gen_method_call_t", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/for_helpers.py", "file_name": "for_helpers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 387, "end_line": 397, "span_ids": ["unsafe_index"], "tokens": 130}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def unsafe_index(\n builder: IRBuilder, target: Value, index: Value, line: int\n) -> Value:\n \"\"\"Emit a potentially unsafe index into a target.\"\"\"\n # This doesn't really fit nicely into any of our data-driven frameworks\n # since we want to use __getitem__ if we don't have an unsafe version,\n # so we just check manually.\n if is_list_rprimitive(target.type):\n return builder.call_c(list_get_item_unsafe_op, [target, index], line)\n else:\n return builder.gen_method_call(target, '__getitem__', [index], None, line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForSequence_ForSequence.init.self.target_type.target_type": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForSequence_ForSequence.init.self.target_type.target_type", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/for_helpers.py", "file_name": "for_helpers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 405, "end_line": 424, "span_ids": ["ForSequence", "ForSequence.init"], "tokens": 190}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ForSequence(ForGenerator):\n \"\"\"Generate optimized IR for a for loop over a sequence.\n\n Supports iterating in both forward and reverse.\n \"\"\"\n\n def init(self, expr_reg: Value, target_type: RType, reverse: bool) -> None:\n builder = self.builder\n self.reverse = reverse\n # Define target to contain the expression, along with the index that will be used\n # for the for-loop. If we are inside of a generator function, spill these into the\n # environment class.\n self.expr_target = builder.maybe_spill(expr_reg)\n if not reverse:\n index_reg = Integer(0) # type: Value\n else:\n index_reg = builder.binary_op(self.load_len(self.expr_target),\n Integer(1), '-', self.line)\n self.index_target = builder.maybe_spill_assignable(index_reg)\n self.target_type = target_type", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForSequence.gen_condition_ForSequence.gen_condition.builder_add_bool_branch_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForSequence.gen_condition_ForSequence.gen_condition.builder_add_bool_branch_c", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/for_helpers.py", "file_name": "for_helpers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 426, "end_line": 444, "span_ids": ["ForSequence.gen_condition"], "tokens": 222}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ForSequence(ForGenerator):\n\n def gen_condition(self) -> None:\n builder = self.builder\n line = self.line\n # TODO: Don't reload the length each time when iterating an immutable sequence?\n if self.reverse:\n # If we are iterating in reverse order, we obviously need\n # to check that the index is still positive. Somewhat less\n # obviously we still need to check against the length,\n # since it could shrink out from under us.\n comparison = builder.binary_op(builder.read(self.index_target, line),\n Integer(0), '>=', line)\n second_check = BasicBlock()\n builder.add_bool_branch(comparison, second_check, self.loop_exit)\n builder.activate_block(second_check)\n # For compatibility with python semantics we recalculate the length\n # at every iteration.\n len_reg = self.load_len(self.expr_target)\n comparison = builder.binary_op(builder.read(self.index_target, line), len_reg, '<', line)\n builder.add_bool_branch(comparison, self.body_block, self.loop_exit)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForSequence.begin_body_ForSequence.gen_step.builder_assign_self_index": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForSequence.begin_body_ForSequence.gen_step.builder_assign_self_index", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/for_helpers.py", "file_name": "for_helpers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 446, "end_line": 471, "span_ids": ["ForSequence.gen_step", "ForSequence.begin_body"], "tokens": 218}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ForSequence(ForGenerator):\n\n def begin_body(self) -> None:\n builder = self.builder\n line = self.line\n # Read the next list item.\n value_box = unsafe_index(\n builder,\n builder.read(self.expr_target, line),\n builder.read(self.index_target, line),\n line\n )\n assert value_box\n # We coerce to the type of list elements here so that\n # iterating with tuple unpacking generates a tuple based\n # unpack instead of an iterator based one.\n builder.assign(builder.get_assignment_target(self.index),\n builder.coerce(value_box, self.target_type, line), line)\n\n def gen_step(self) -> None:\n # Step to the next item.\n builder = self.builder\n line = self.line\n step = 1 if not self.reverse else -1\n add = builder.int_op(short_int_rprimitive,\n builder.read(self.index_target, line),\n Integer(step), IntOp.ADD, line)\n builder.assign(self.index_target, add, line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForDictionaryCommon_ForDictionaryCommon.need_cleanup.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForDictionaryCommon_ForDictionaryCommon.need_cleanup.return.True", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/for_helpers.py", "file_name": "for_helpers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 469, "end_line": 490, "span_ids": ["ForDictionaryCommon", "ForDictionaryCommon.need_cleanup"], "tokens": 242}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ForDictionaryCommon(ForGenerator):\n \"\"\"Generate optimized IR for a for loop over dictionary keys/values.\n\n The logic is pretty straightforward, we use PyDict_Next() API wrapped in\n a tuple, so that we can modify only a single register. The layout of the tuple:\n * f0: are there more items (bool)\n * f1: current offset (int)\n * f2: next key (object)\n * f3: next value (object)\n For more info see https://docs.python.org/3/c-api/dict.html#c.PyDict_Next.\n\n Note that for subclasses we fall back to generic PyObject_GetIter() logic,\n since they may override some iteration methods in subtly incompatible manner.\n The fallback logic is implemented in CPy.h via dynamic type check.\n \"\"\"\n dict_next_op = None # type: ClassVar[CFunctionDescription]\n dict_iter_op = None # type: ClassVar[CFunctionDescription]\n\n def need_cleanup(self) -> bool:\n # Technically, a dict subclass can raise an unrelated exception\n # in __next__(), so we need this.\n return True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForDictionaryCommon.init_ForDictionaryCommon.init.self.iter_target.builder_maybe_spill_iter_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForDictionaryCommon.init_ForDictionaryCommon.init.self.iter_target.builder_maybe_spill_iter_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/for_helpers.py", "file_name": "for_helpers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 497, "end_line": 509, "span_ids": ["ForDictionaryCommon.init"], "tokens": 157}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ForDictionaryCommon(ForGenerator):\n\n def init(self, expr_reg: Value, target_type: RType) -> None:\n builder = self.builder\n self.target_type = target_type\n\n # We add some variables to environment class, so they can be read across yield.\n self.expr_target = builder.maybe_spill(expr_reg)\n offset = Integer(0)\n self.offset_target = builder.maybe_spill_assignable(offset)\n self.size = builder.maybe_spill(self.load_len(self.expr_target))\n\n # For dict class (not a subclass) this is the dictionary itself.\n iter_reg = builder.call_c(self.dict_iter_op, [expr_reg], self.line)\n self.iter_target = builder.maybe_spill(iter_reg)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForDictionaryCommon.gen_condition_ForDictionaryCommon.gen_condition.builder_add_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForDictionaryCommon.gen_condition_ForDictionaryCommon.gen_condition.builder_add_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/for_helpers.py", "file_name": "for_helpers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 506, "end_line": 521, "span_ids": ["ForDictionaryCommon.gen_condition"], "tokens": 173}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ForDictionaryCommon(ForGenerator):\n\n def gen_condition(self) -> None:\n \"\"\"Get next key/value pair, set new offset, and check if we should continue.\"\"\"\n builder = self.builder\n line = self.line\n self.next_tuple = self.builder.call_c(\n self.dict_next_op, [builder.read(self.iter_target, line),\n builder.read(self.offset_target, line)], line)\n\n # Do this here instead of in gen_step() to minimize variables in environment.\n new_offset = builder.add(TupleGet(self.next_tuple, 1, line))\n builder.assign(self.offset_target, new_offset, line)\n\n should_continue = builder.add(TupleGet(self.next_tuple, 0, line))\n builder.add(\n Branch(should_continue, self.body_block, self.loop_exit, Branch.BOOL)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForDictionaryCommon.gen_step_ForDictionaryCommon.gen_cleanup.self_builder_call_c_no_er": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForDictionaryCommon.gen_step_ForDictionaryCommon.gen_cleanup.self_builder_call_c_no_er", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/for_helpers.py", "file_name": "for_helpers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 523, "end_line": 537, "span_ids": ["ForDictionaryCommon.gen_step", "ForDictionaryCommon.gen_cleanup"], "tokens": 140}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ForDictionaryCommon(ForGenerator):\n\n def gen_step(self) -> None:\n \"\"\"Check that dictionary didn't change size during iteration.\n\n Raise RuntimeError if it is not the case to match CPython behavior.\n \"\"\"\n builder = self.builder\n line = self.line\n # Technically, we don't need a new primitive for this, but it is simpler.\n builder.call_c(dict_check_size_op,\n [builder.read(self.expr_target, line),\n builder.read(self.size, line)], line)\n\n def gen_cleanup(self) -> None:\n # Same as for generic ForIterable.\n self.builder.call_c(no_err_occurred_op, [], self.line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForDictionaryKeys_ForDictionaryKeys.begin_body.builder_assign_builder_ge": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForDictionaryKeys_ForDictionaryKeys.begin_body.builder_assign_builder_ge", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/for_helpers.py", "file_name": "for_helpers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 540, "end_line": 552, "span_ids": ["ForDictionaryKeys.begin_body", "ForDictionaryKeys"], "tokens": 117}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ForDictionaryKeys(ForDictionaryCommon):\n \"\"\"Generate optimized IR for a for loop over dictionary keys.\"\"\"\n dict_next_op = dict_next_key_op\n dict_iter_op = dict_key_iter_op\n\n def begin_body(self) -> None:\n builder = self.builder\n line = self.line\n\n # Key is stored at the third place in the tuple.\n key = builder.add(TupleGet(self.next_tuple, 2, line))\n builder.assign(builder.get_assignment_target(self.index),\n builder.coerce(key, self.target_type, line), line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForDictionaryValues_ForDictionaryValues.begin_body.builder_assign_builder_ge": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForDictionaryValues_ForDictionaryValues.begin_body.builder_assign_builder_ge", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/for_helpers.py", "file_name": "for_helpers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 555, "end_line": 567, "span_ids": ["ForDictionaryValues", "ForDictionaryValues.begin_body"], "tokens": 117}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ForDictionaryValues(ForDictionaryCommon):\n \"\"\"Generate optimized IR for a for loop over dictionary values.\"\"\"\n dict_next_op = dict_next_value_op\n dict_iter_op = dict_value_iter_op\n\n def begin_body(self) -> None:\n builder = self.builder\n line = self.line\n\n # Value is stored at the third place in the tuple.\n value = builder.add(TupleGet(self.next_tuple, 2, line))\n builder.assign(builder.get_assignment_target(self.index),\n builder.coerce(value, self.target_type, line), line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForDictionaryItems_ForDictionaryItems.begin_body.if_isinstance_target_Ass.else_.builder_assign_target_rv": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForDictionaryItems_ForDictionaryItems.begin_body.if_isinstance_target_Ass.else_.builder_assign_target_rv", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/for_helpers.py", "file_name": "for_helpers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 570, "end_line": 596, "span_ids": ["ForDictionaryItems.begin_body", "ForDictionaryItems"], "tokens": 274}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ForDictionaryItems(ForDictionaryCommon):\n \"\"\"Generate optimized IR for a for loop over dictionary items.\"\"\"\n dict_next_op = dict_next_item_op\n dict_iter_op = dict_item_iter_op\n\n def begin_body(self) -> None:\n builder = self.builder\n line = self.line\n\n key = builder.add(TupleGet(self.next_tuple, 2, line))\n value = builder.add(TupleGet(self.next_tuple, 3, line))\n\n # Coerce just in case e.g. key is itself a tuple to be unpacked.\n assert isinstance(self.target_type, RTuple)\n key = builder.coerce(key, self.target_type.types[0], line)\n value = builder.coerce(value, self.target_type.types[1], line)\n\n target = builder.get_assignment_target(self.index)\n if isinstance(target, AssignmentTargetTuple):\n # Simpler code for common case: for k, v in d.items().\n if len(target.items) != 2:\n builder.error(\"Expected a pair for dict item iteration\", line)\n builder.assign(target.items[0], key, line)\n builder.assign(target.items[1], value, line)\n else:\n rvalue = builder.add(TupleSet([key, value], line))\n builder.assign(target, rvalue, line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForRange_ForRange.init.builder_assign_self_index": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForRange_ForRange.init.builder_assign_self_index", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/for_helpers.py", "file_name": "for_helpers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 604, "end_line": 623, "span_ids": ["ForRange", "ForRange.init"], "tokens": 221}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ForRange(ForGenerator):\n \"\"\"Generate optimized IR for a for loop over an integer range.\"\"\"\n\n def init(self, start_reg: Value, end_reg: Value, step: int) -> None:\n builder = self.builder\n self.start_reg = start_reg\n self.end_reg = end_reg\n self.step = step\n self.end_target = builder.maybe_spill(end_reg)\n if is_short_int_rprimitive(start_reg.type) and is_short_int_rprimitive(end_reg.type):\n index_type = short_int_rprimitive\n else:\n index_type = int_rprimitive\n index_reg = Register(index_type)\n builder.assign(index_reg, start_reg, -1)\n self.index_reg = builder.maybe_spill_assignable(index_reg)\n # Initialize loop index to 0. Assert that the index target is assignable.\n self.index_target = builder.get_assignment_target(\n self.index) # type: Union[Register, AssignmentTarget]\n builder.assign(self.index_target, builder.read(self.index_reg, self.line), self.line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForRange.gen_condition_ForRange.gen_step.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForRange.gen_condition_ForRange.gen_step.None_1", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/for_helpers.py", "file_name": "for_helpers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 625, "end_line": 650, "span_ids": ["ForRange.gen_step", "ForRange.gen_condition"], "tokens": 246}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ForRange(ForGenerator):\n\n def gen_condition(self) -> None:\n builder = self.builder\n line = self.line\n # Add loop condition check.\n cmp = '<' if self.step > 0 else '>'\n comparison = builder.binary_op(builder.read(self.index_reg, line),\n builder.read(self.end_target, line), cmp, line)\n builder.add_bool_branch(comparison, self.body_block, self.loop_exit)\n\n def gen_step(self) -> None:\n builder = self.builder\n line = self.line\n\n # Increment index register. If the range is known to fit in short ints, use\n # short ints.\n if (is_short_int_rprimitive(self.start_reg.type)\n and is_short_int_rprimitive(self.end_reg.type)):\n new_val = builder.int_op(short_int_rprimitive,\n builder.read(self.index_reg, line),\n Integer(self.step), IntOp.ADD, line)\n\n else:\n new_val = builder.binary_op(\n builder.read(self.index_reg, line), Integer(self.step), '+', line)\n builder.assign(self.index_reg, new_val, line)\n builder.assign(self.index_target, new_val, line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForInfiniteCounter_ForInfiniteCounter.init.builder_assign_self_index": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForInfiniteCounter_ForInfiniteCounter.init.builder_assign_self_index", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/for_helpers.py", "file_name": "for_helpers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 653, "end_line": 664, "span_ids": ["ForInfiniteCounter.init", "ForInfiniteCounter"], "tokens": 127}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ForInfiniteCounter(ForGenerator):\n \"\"\"Generate optimized IR for a for loop counting from 0 to infinity.\"\"\"\n\n def init(self) -> None:\n builder = self.builder\n # Create a register to store the state of the loop index and\n # initialize this register along with the loop index to 0.\n zero = Integer(0)\n self.index_reg = builder.maybe_spill_assignable(zero)\n self.index_target = builder.get_assignment_target(\n self.index) # type: Union[Register, AssignmentTarget]\n builder.assign(self.index_target, zero, self.line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForInfiniteCounter.gen_step_ForInfiniteCounter.gen_step.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForInfiniteCounter.gen_step_ForInfiniteCounter.gen_step.None_1", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/for_helpers.py", "file_name": "for_helpers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 666, "end_line": 676, "span_ids": ["ForInfiniteCounter.gen_step"], "tokens": 132}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ForInfiniteCounter(ForGenerator):\n\n def gen_step(self) -> None:\n builder = self.builder\n line = self.line\n # We can safely assume that the integer is short, since we are not going to wrap\n # around a 63-bit integer.\n # NOTE: This would be questionable if short ints could be 32 bits.\n new_val = builder.int_op(short_int_rprimitive,\n builder.read(self.index_reg, line),\n Integer(1), IntOp.ADD, line)\n builder.assign(self.index_reg, new_val, line)\n builder.assign(self.index_target, new_val, line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForEnumerate_ForEnumerate.gen_cleanup.self_main_gen_gen_cleanup": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForEnumerate_ForEnumerate.gen_cleanup.self_main_gen_gen_cleanup", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/for_helpers.py", "file_name": "for_helpers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 670, "end_line": 710, "span_ids": ["ForEnumerate.gen_cleanup", "ForEnumerate.init", "ForEnumerate", "ForEnumerate.need_cleanup", "ForEnumerate.gen_condition", "ForEnumerate.begin_body", "ForEnumerate.gen_step"], "tokens": 296}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ForEnumerate(ForGenerator):\n \"\"\"Generate optimized IR for a for loop of form \"for i, x in enumerate(it)\".\"\"\"\n\n def need_cleanup(self) -> bool:\n # The wrapped for loop might need cleanup. This might generate a\n # redundant cleanup block, but that's okay.\n return True\n\n def init(self, index1: Lvalue, index2: Lvalue, expr: Expression) -> None:\n # Count from 0 to infinity (for the index lvalue).\n self.index_gen = ForInfiniteCounter(\n self.builder,\n index1,\n self.body_block,\n self.loop_exit,\n self.line, nested=True)\n self.index_gen.init()\n # Iterate over the actual iterable.\n self.main_gen = make_for_loop_generator(\n self.builder,\n index2,\n expr,\n self.body_block,\n self.loop_exit,\n self.line, nested=True)\n\n def gen_condition(self) -> None:\n # No need for a check for the index generator, since it's unconditional.\n self.main_gen.gen_condition()\n\n def begin_body(self) -> None:\n self.index_gen.begin_body()\n self.main_gen.begin_body()\n\n def gen_step(self) -> None:\n self.index_gen.gen_step()\n self.main_gen.gen_step()\n\n def gen_cleanup(self) -> None:\n self.index_gen.gen_cleanup()\n self.main_gen.gen_cleanup()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForZip_ForZip.init.for_index_expr_next_blo.self_gens_append_gen_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForZip_ForZip.init.for_index_expr_next_blo.self_gens_append_gen_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/for_helpers.py", "file_name": "for_helpers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 713, "end_line": 735, "span_ids": ["ForZip", "ForZip.init", "ForZip.need_cleanup"], "tokens": 225}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ForZip(ForGenerator):\n \"\"\"Generate IR for a for loop of form `for x, ... in zip(a, ...)`.\"\"\"\n\n def need_cleanup(self) -> bool:\n # The wrapped for loops might need cleanup. We might generate a\n # redundant cleanup block, but that's okay.\n return True\n\n def init(self, indexes: List[Lvalue], exprs: List[Expression]) -> None:\n assert len(indexes) == len(exprs)\n # Condition check will require multiple basic blocks, since there will be\n # multiple conditions to check.\n self.cond_blocks = [BasicBlock() for _ in range(len(indexes) - 1)] + [self.body_block]\n self.gens = [] # type: List[ForGenerator]\n for index, expr, next_block in zip(indexes, exprs, self.cond_blocks):\n gen = make_for_loop_generator(\n self.builder,\n index,\n expr,\n next_block,\n self.loop_exit,\n self.line, nested=True)\n self.gens.append(gen)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForZip.gen_condition_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_ForZip.gen_condition_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/for_helpers.py", "file_name": "for_helpers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 737, "end_line": 754, "span_ids": ["ForZip.begin_body", "ForZip.gen_condition", "ForZip.gen_cleanup", "ForZip.gen_step"], "tokens": 121}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ForZip(ForGenerator):\n\n def gen_condition(self) -> None:\n for i, gen in enumerate(self.gens):\n gen.gen_condition()\n if i < len(self.gens) - 1:\n self.builder.activate_block(self.cond_blocks[i])\n\n def begin_body(self) -> None:\n for gen in self.gens:\n gen.begin_body()\n\n def gen_step(self) -> None:\n for gen in self.gens:\n gen.gen_step()\n\n def gen_cleanup(self) -> None:\n for gen in self.gens:\n gen.gen_cleanup()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py__Transform_mypy_AST_fun_from_mypyc_irbuild_env_cl": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py__Transform_mypy_AST_fun_from_mypyc_irbuild_env_cl", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/function.py", "file_name": "function.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 52, "span_ids": ["imports:19", "docstring"], "tokens": 565}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Transform mypy AST functions to IR (and related things).\n\nNormal functions are translated into a list of basic blocks\ncontaining various IR ops (defined in mypyc.ir.ops).\n\nThis also deals with generators, async functions and nested\nfunctions. All of these are transformed into callable classes. These\nhave a custom __call__ method that implements the call, and state, such\nas an environment containing non-local variables, is stored in the\ninstance of the callable class.\n\"\"\"\n\nfrom typing import Optional, List, Tuple, Union, Dict\n\nfrom mypy.nodes import (\n ClassDef, FuncDef, OverloadedFuncDef, Decorator, Var, YieldFromExpr, AwaitExpr, YieldExpr,\n FuncItem, LambdaExpr, SymbolNode, ARG_NAMED, ARG_NAMED_OPT\n)\nfrom mypy.types import CallableType, get_proper_type\n\nfrom mypyc.ir.ops import (\n BasicBlock, Value, Register, Return, SetAttr, Integer, GetAttr, Branch, InitStatic,\n LoadAddress\n)\nfrom mypyc.ir.rtypes import object_rprimitive, RInstance, object_pointer_rprimitive\nfrom mypyc.ir.func_ir import (\n FuncIR, FuncSignature, RuntimeArg, FuncDecl, FUNC_CLASSMETHOD, FUNC_STATICMETHOD, FUNC_NORMAL\n)\nfrom mypyc.ir.class_ir import ClassIR, NonExtClassInfo\nfrom mypyc.primitives.generic_ops import py_setattr_op, next_raw_op, iter_op\nfrom mypyc.primitives.misc_ops import check_stop_op, yield_from_except_op, coro_op, send_op\nfrom mypyc.primitives.dict_ops import dict_set_item_op\nfrom mypyc.common import SELF_NAME, LAMBDA_NAME, decorator_helper_name\nfrom mypyc.sametype import is_same_method_signature\nfrom mypyc.irbuild.util import concrete_arg_kind, is_constant\nfrom mypyc.irbuild.context import FuncInfo, ImplicitClass\nfrom mypyc.irbuild.targets import AssignmentTarget\nfrom mypyc.irbuild.statement import transform_try_except\nfrom mypyc.irbuild.builder import IRBuilder, SymbolTarget, gen_arg_defaults\nfrom mypyc.irbuild.callable_class import (\n setup_callable_class, add_call_to_callable_class, add_get_to_callable_class,\n instantiate_callable_class\n)\nfrom mypyc.irbuild.generator import (\n gen_generator_func, setup_env_for_generator_class, create_switch_for_generator_class,\n add_raise_exception_blocks_to_generator_class, populate_switch_for_generator_class,\n add_methods_to_generator_class\n)\nfrom mypyc.irbuild.env_class import (\n setup_env_class, load_outer_envs, load_env_registers, finalize_env_class,\n setup_func_for_recursive_call\n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py__Top_level_transform_fun_transform_overloaded_func_def.builder_accept_o_impl_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py__Top_level_transform_fun_transform_overloaded_func_def.builder_accept_o_impl_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/function.py", "file_name": "function.py", "file_type": "text/x-python", "category": "implementation", "start_line": 54, "end_line": 70, "span_ids": ["transform_overloaded_func_def", "imports:19", "transform_func_def"], "tokens": 156}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Top-level transform functions\n\n\ndef transform_func_def(builder: IRBuilder, fdef: FuncDef) -> None:\n func_ir, func_reg = gen_func_item(builder, fdef, fdef.name, builder.mapper.fdef_to_sig(fdef))\n\n # If the function that was visited was a nested function, then either look it up in our\n # current environment or define it if it was not already defined.\n if func_reg:\n builder.assign(get_func_target(builder, fdef), func_reg, fdef.line)\n builder.functions.append(func_ir)\n\n\ndef transform_overloaded_func_def(builder: IRBuilder, o: OverloadedFuncDef) -> None:\n # Handle regular overload case\n assert o.impl\n builder.accept(o.impl)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_transform_decorator_transform_decorator.builder_functions_append_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_transform_decorator_transform_decorator.builder_functions_append_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/function.py", "file_name": "function.py", "file_type": "text/x-python", "category": "implementation", "start_line": 74, "end_line": 102, "span_ids": ["transform_decorator"], "tokens": 254}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def transform_decorator(builder: IRBuilder, dec: Decorator) -> None:\n func_ir, func_reg = gen_func_item(\n builder,\n dec.func,\n dec.func.name,\n builder.mapper.fdef_to_sig(dec.func)\n )\n\n if dec.func in builder.nested_fitems:\n assert func_reg is not None\n decorated_func = load_decorated_func(builder, dec.func, func_reg)\n builder.assign(get_func_target(builder, dec.func), decorated_func, dec.func.line)\n func_reg = decorated_func\n else:\n # Obtain the the function name in order to construct the name of the helper function.\n name = dec.func.fullname.split('.')[-1]\n helper_name = decorator_helper_name(name)\n\n # Load the callable object representing the non-decorated function, and decorate it.\n orig_func = builder.load_global_str(helper_name, dec.line)\n decorated_func = load_decorated_func(builder, dec.func, orig_func)\n\n # Set the callable object representing the decorated function as a global.\n builder.call_c(dict_set_item_op,\n [builder.load_globals_dict(),\n builder.load_str(dec.func.name), decorated_func],\n decorated_func.line)\n\n builder.functions.append(func_ir)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_transform_method_transform_lambda_expr.return.func_reg": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_transform_method_transform_lambda_expr.return.func_reg", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/function.py", "file_name": "function.py", "file_type": "text/x-python", "category": "implementation", "start_line": 104, "end_line": 133, "span_ids": ["transform_method", "transform_lambda_expr"], "tokens": 246}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def transform_method(builder: IRBuilder,\n cdef: ClassDef,\n non_ext: Optional[NonExtClassInfo],\n fdef: FuncDef) -> None:\n if non_ext:\n handle_non_ext_method(builder, non_ext, cdef, fdef)\n else:\n handle_ext_method(builder, cdef, fdef)\n\n\ndef transform_lambda_expr(builder: IRBuilder, expr: LambdaExpr) -> Value:\n typ = get_proper_type(builder.types[expr])\n assert isinstance(typ, CallableType)\n\n runtime_args = []\n for arg, arg_type in zip(expr.arguments, typ.arg_types):\n arg.variable.type = arg_type\n runtime_args.append(\n RuntimeArg(arg.variable.name, builder.type_to_rtype(arg_type), arg.kind))\n ret_type = builder.type_to_rtype(typ.ret_type)\n\n fsig = FuncSignature(runtime_args, ret_type)\n\n fname = '{}{}'.format(LAMBDA_NAME, builder.lambda_counter)\n builder.lambda_counter += 1\n func_ir, func_reg = gen_func_item(builder, expr, fname, fsig)\n assert func_reg is not None\n\n builder.functions.append(func_ir)\n return func_reg", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_transform_yield_expr_transform_await_expr.return.handle_yield_from_and_awa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_transform_yield_expr_transform_await_expr.return.handle_yield_from_and_awa", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/function.py", "file_name": "function.py", "file_type": "text/x-python", "category": "implementation", "start_line": 136, "end_line": 149, "span_ids": ["transform_await_expr", "transform_yield_expr", "transform_yield_from_expr"], "tokens": 112}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def transform_yield_expr(builder: IRBuilder, expr: YieldExpr) -> Value:\n if expr.expr:\n retval = builder.accept(expr.expr)\n else:\n retval = builder.builder.none()\n return emit_yield(builder, retval, expr.line)\n\n\ndef transform_yield_from_expr(builder: IRBuilder, o: YieldFromExpr) -> Value:\n return handle_yield_from_and_await(builder, o)\n\n\ndef transform_await_expr(builder: IRBuilder, o: AwaitExpr) -> Value:\n return handle_yield_from_and_await(builder, o)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_gen_func_ir_gen_func_ir.return._func_ir_func_reg_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_gen_func_ir_gen_func_ir.return._func_ir_func_reg_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/function.py", "file_name": "function.py", "file_type": "text/x-python", "category": "implementation", "start_line": 306, "end_line": 337, "span_ids": ["gen_func_ir"], "tokens": 340}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def gen_func_ir(builder: IRBuilder,\n args: List[Register],\n blocks: List[BasicBlock],\n sig: FuncSignature,\n fn_info: FuncInfo,\n cdef: Optional[ClassDef]) -> Tuple[FuncIR, Optional[Value]]:\n \"\"\"Generate the FuncIR for a function.\n\n This takes the basic blocks and function info of a particular\n function and returns the IR. If the function is nested,\n also returns the register containing the instance of the\n corresponding callable class.\n \"\"\"\n func_reg = None # type: Optional[Value]\n if fn_info.is_nested or fn_info.in_non_ext:\n func_ir = add_call_to_callable_class(builder, args, blocks, sig, fn_info)\n add_get_to_callable_class(builder, fn_info)\n func_reg = instantiate_callable_class(builder, fn_info)\n else:\n assert isinstance(fn_info.fitem, FuncDef)\n func_decl = builder.mapper.func_to_decl[fn_info.fitem]\n if fn_info.is_decorated:\n class_name = None if cdef is None else cdef.name\n func_decl = FuncDecl(fn_info.name, class_name, builder.module_name, sig,\n func_decl.kind,\n func_decl.is_prop_getter, func_decl.is_prop_setter)\n func_ir = FuncIR(func_decl, args, blocks, fn_info.fitem.line,\n traceback_name=fn_info.fitem.name)\n else:\n func_ir = FuncIR(func_decl, args, blocks,\n fn_info.fitem.line, traceback_name=fn_info.fitem.name)\n return (func_ir, func_reg)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_handle_ext_method_handle_ext_method.if_class_ir_allow_interpr.builder_functions_append_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_handle_ext_method_handle_ext_method.if_class_ir_allow_interpr.builder_functions_append_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/function.py", "file_name": "function.py", "file_type": "text/x-python", "category": "implementation", "start_line": 340, "end_line": 405, "span_ids": ["handle_ext_method"], "tokens": 685}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def handle_ext_method(builder: IRBuilder, cdef: ClassDef, fdef: FuncDef) -> None:\n # Perform the function of visit_method for methods inside extension classes.\n name = fdef.name\n class_ir = builder.mapper.type_to_ir[cdef.info]\n func_ir, func_reg = gen_func_item(builder, fdef, name, builder.mapper.fdef_to_sig(fdef), cdef)\n builder.functions.append(func_ir)\n\n if is_decorated(builder, fdef):\n # Obtain the the function name in order to construct the name of the helper function.\n _, _, name = fdef.fullname.rpartition('.')\n helper_name = decorator_helper_name(name)\n # Read the PyTypeObject representing the class, get the callable object\n # representing the non-decorated method\n typ = builder.load_native_type_object(cdef.fullname)\n orig_func = builder.py_get_attr(typ, helper_name, fdef.line)\n\n # Decorate the non-decorated method\n decorated_func = load_decorated_func(builder, fdef, orig_func)\n\n # Set the callable object representing the decorated method as an attribute of the\n # extension class.\n builder.call_c(py_setattr_op,\n [\n typ,\n builder.load_str(name),\n decorated_func\n ],\n fdef.line)\n\n if fdef.is_property:\n # If there is a property setter, it will be processed after the getter,\n # We populate the optional setter field with none for now.\n assert name not in class_ir.properties\n class_ir.properties[name] = (func_ir, None)\n\n elif fdef in builder.prop_setters:\n # The respective property getter must have been processed already\n assert name in class_ir.properties\n getter_ir, _ = class_ir.properties[name]\n class_ir.properties[name] = (getter_ir, func_ir)\n\n class_ir.methods[func_ir.decl.name] = func_ir\n\n # If this overrides a parent class method with a different type, we need\n # to generate a glue method to mediate between them.\n for base in class_ir.mro[1:]:\n if (name in base.method_decls and name != '__init__'\n and not is_same_method_signature(class_ir.method_decls[name].sig,\n base.method_decls[name].sig)):\n\n # TODO: Support contravariant subtyping in the input argument for\n # property setters. Need to make a special glue method for handling this,\n # similar to gen_glue_property.\n\n f = gen_glue(builder, base.method_decls[name].sig, func_ir, class_ir, base, fdef)\n class_ir.glue_methods[(base, name)] = f\n builder.functions.append(f)\n\n # If the class allows interpreted children, create glue\n # methods that dispatch via the Python API. These will go in a\n # \"shadow vtable\" that will be assigned to interpreted\n # children.\n if class_ir.allow_interpreted_subclasses:\n f = gen_glue(builder, func_ir.sig, func_ir, class_ir, class_ir, fdef, do_py_ops=True)\n class_ir.glue_methods[(class_ir, name)] = f\n builder.functions.append(f)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_handle_non_ext_method_handle_non_ext_method.builder_add_to_non_ext_di": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_handle_non_ext_method_handle_non_ext_method.builder_add_to_non_ext_di", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/function.py", "file_name": "function.py", "file_type": "text/x-python", "category": "implementation", "start_line": 400, "end_line": 428, "span_ids": ["handle_non_ext_method"], "tokens": 340}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def handle_non_ext_method(\n builder: IRBuilder, non_ext: NonExtClassInfo, cdef: ClassDef, fdef: FuncDef) -> None:\n # Perform the function of visit_method for methods inside non-extension classes.\n name = fdef.name\n func_ir, func_reg = gen_func_item(builder, fdef, name, builder.mapper.fdef_to_sig(fdef), cdef)\n assert func_reg is not None\n builder.functions.append(func_ir)\n\n if is_decorated(builder, fdef):\n # The undecorated method is a generated callable class\n orig_func = func_reg\n func_reg = load_decorated_func(builder, fdef, orig_func)\n\n # TODO: Support property setters in non-extension classes\n if fdef.is_property:\n prop = builder.load_module_attr_by_fullname('builtins.property', fdef.line)\n func_reg = builder.py_call(prop, [func_reg], fdef.line)\n\n elif builder.mapper.func_to_decl[fdef].kind == FUNC_CLASSMETHOD:\n cls_meth = builder.load_module_attr_by_fullname('builtins.classmethod', fdef.line)\n func_reg = builder.py_call(cls_meth, [func_reg], fdef.line)\n\n elif builder.mapper.func_to_decl[fdef].kind == FUNC_STATICMETHOD:\n stat_meth = builder.load_module_attr_by_fullname(\n 'builtins.staticmethod', fdef.line\n )\n func_reg = builder.py_call(stat_meth, [func_reg], fdef.line)\n\n builder.add_to_non_ext_dict(non_ext, name, func_reg, fdef.line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_calculate_arg_defaults_calculate_arg_defaults.for_arg_in_fitem_argument.if_arg_initializer_and_no.if_not_fn_info_is_nested_.else_.builder_add_SetAttr_func_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_calculate_arg_defaults_calculate_arg_defaults.for_arg_in_fitem_argument.if_arg_initializer_and_no.if_not_fn_info_is_nested_.else_.builder_add_SetAttr_func_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/function.py", "file_name": "function.py", "file_type": "text/x-python", "category": "implementation", "start_line": 439, "end_line": 463, "span_ids": ["calculate_arg_defaults"], "tokens": 219}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def calculate_arg_defaults(builder: IRBuilder,\n fn_info: FuncInfo,\n func_reg: Optional[Value],\n symtable: Dict[SymbolNode, SymbolTarget]) -> None:\n \"\"\"Calculate default argument values and store them.\n\n They are stored in statics for top level functions and in\n the function objects for nested functions (while constants are\n still stored computed on demand).\n \"\"\"\n fitem = fn_info.fitem\n for arg in fitem.arguments:\n # Constant values don't get stored but just recomputed\n if arg.initializer and not is_constant(arg.initializer):\n value = builder.coerce(\n builder.accept(arg.initializer),\n symtable[arg.variable].type,\n arg.line\n )\n if not fn_info.is_nested:\n name = fitem.fullname + '.' + arg.variable.name\n builder.add(InitStatic(value, name, builder.module_name))\n else:\n assert func_reg is not None\n builder.add(SetAttr(func_reg, arg.variable.name, value, arg.line))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_gen_func_ns_emit_yield.return.cls_send_arg_reg": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_gen_func_ns_emit_yield.return.cls_send_arg_reg", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/function.py", "file_name": "function.py", "file_type": "text/x-python", "category": "implementation", "start_line": 466, "end_line": 490, "span_ids": ["gen_func_ns", "emit_yield"], "tokens": 246}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def gen_func_ns(builder: IRBuilder) -> str:\n \"\"\"Generate a namespace for a nested function using its outer function names.\"\"\"\n return '_'.join(info.name + ('' if not info.class_name else '_' + info.class_name)\n for info in builder.fn_infos\n if info.name and info.name != '')\n\n\ndef emit_yield(builder: IRBuilder, val: Value, line: int) -> Value:\n retval = builder.coerce(val, builder.ret_types[-1], line)\n\n cls = builder.fn_info.generator_class\n # Create a new block for the instructions immediately following the yield expression, and\n # set the next label so that the next time '__next__' is called on the generator object,\n # the function continues at the new block.\n next_block = BasicBlock()\n next_label = len(cls.continuation_blocks)\n cls.continuation_blocks.append(next_block)\n builder.assign(cls.next_label_target, Integer(next_label), line)\n builder.add(Return(retval))\n builder.activate_block(next_block)\n\n add_raise_exception_blocks_to_generator_class(builder, line)\n\n assert cls.send_arg_reg is not None\n return cls.send_arg_reg", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_handle_yield_from_and_await_handle_yield_from_and_await.try_body.builder_assign_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_handle_yield_from_and_await_handle_yield_from_and_await.try_body.builder_assign_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/function.py", "file_name": "function.py", "file_type": "text/x-python", "category": "implementation", "start_line": 493, "end_line": 528, "span_ids": ["handle_yield_from_and_await"], "tokens": 352}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def handle_yield_from_and_await(builder: IRBuilder, o: Union[YieldFromExpr, AwaitExpr]) -> Value:\n # This is basically an implementation of the code in PEP 380.\n\n # TODO: do we want to use the right types here?\n result = Register(object_rprimitive)\n to_yield_reg = Register(object_rprimitive)\n received_reg = Register(object_rprimitive)\n\n if isinstance(o, YieldFromExpr):\n iter_val = builder.call_c(iter_op, [builder.accept(o.expr)], o.line)\n else:\n iter_val = builder.call_c(coro_op, [builder.accept(o.expr)], o.line)\n\n iter_reg = builder.maybe_spill_assignable(iter_val)\n\n stop_block, main_block, done_block = BasicBlock(), BasicBlock(), BasicBlock()\n _y_init = builder.call_c(next_raw_op, [builder.read(iter_reg)], o.line)\n builder.add(Branch(_y_init, stop_block, main_block, Branch.IS_ERROR))\n\n # Try extracting a return value from a StopIteration and return it.\n # If it wasn't, this reraises the exception.\n builder.activate_block(stop_block)\n builder.assign(result, builder.call_c(check_stop_op, [], o.line), o.line)\n builder.goto(done_block)\n\n builder.activate_block(main_block)\n builder.assign(to_yield_reg, _y_init, o.line)\n\n # OK Now the main loop!\n loop_block = BasicBlock()\n builder.goto_and_activate(loop_block)\n\n def try_body() -> None:\n builder.assign(\n received_reg, emit_yield(builder, builder.read(to_yield_reg), o.line), o.line\n )\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_handle_yield_from_and_await.except_body_handle_yield_from_and_await.except_body.None_6": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_handle_yield_from_and_await.except_body_handle_yield_from_and_await.except_body.None_6", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/function.py", "file_name": "function.py", "file_type": "text/x-python", "category": "implementation", "start_line": 530, "end_line": 550, "span_ids": ["handle_yield_from_and_await"], "tokens": 259}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def handle_yield_from_and_await(builder: IRBuilder, o: Union[YieldFromExpr, AwaitExpr]) -> Value:\n # ... other code\n\n def except_body() -> None:\n # The body of the except is all implemented in a C function to\n # reduce how much code we need to generate. It returns a value\n # indicating whether to break or yield (or raise an exception).\n val = Register(object_rprimitive)\n val_address = builder.add(LoadAddress(object_pointer_rprimitive, val))\n to_stop = builder.call_c(yield_from_except_op,\n [builder.read(iter_reg), val_address], o.line)\n\n ok, stop = BasicBlock(), BasicBlock()\n builder.add(Branch(to_stop, stop, ok, Branch.BOOL))\n\n # The exception got swallowed. Continue, yielding the returned value\n builder.activate_block(ok)\n builder.assign(to_yield_reg, val, o.line)\n builder.nonlocal_control[-1].gen_continue(builder, o.line)\n\n # The exception was a StopIteration. Stop iterating.\n builder.activate_block(stop)\n builder.assign(result, val, o.line)\n builder.nonlocal_control[-1].gen_break(builder, o.line)\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_handle_yield_from_and_await.else_body_handle_yield_from_and_await.return.builder_read_result_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_handle_yield_from_and_await.else_body_handle_yield_from_and_await.return.builder_read_result_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/function.py", "file_name": "function.py", "file_type": "text/x-python", "category": "implementation", "start_line": 543, "end_line": 570, "span_ids": ["handle_yield_from_and_await"], "tokens": 294}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def handle_yield_from_and_await(builder: IRBuilder, o: Union[YieldFromExpr, AwaitExpr]) -> Value:\n # ... other code\n\n def else_body() -> None:\n # Do a next() or a .send(). It will return NULL on exception\n # but it won't automatically propagate.\n _y = builder.call_c(\n send_op, [builder.read(iter_reg), builder.read(received_reg)], o.line\n )\n ok, stop = BasicBlock(), BasicBlock()\n builder.add(Branch(_y, stop, ok, Branch.IS_ERROR))\n\n # Everything's fine. Yield it.\n builder.activate_block(ok)\n builder.assign(to_yield_reg, _y, o.line)\n builder.nonlocal_control[-1].gen_continue(builder, o.line)\n\n # Try extracting a return value from a StopIteration and return it.\n # If it wasn't, this rereaises the exception.\n builder.activate_block(stop)\n builder.assign(result, builder.call_c(check_stop_op, [], o.line), o.line)\n builder.nonlocal_control[-1].gen_break(builder, o.line)\n\n builder.push_loop_stack(loop_block, done_block)\n transform_try_except(\n builder, try_body, [(None, None, except_body)], else_body, o.line\n )\n builder.pop_loop_stack()\n\n builder.goto_and_activate(done_block)\n return builder.read(result)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_load_decorated_func_is_decorated.return.fdef_in_builder_fdefs_to_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_load_decorated_func_is_decorated.return.fdef_in_builder_fdefs_to_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/function.py", "file_name": "function.py", "file_type": "text/x-python", "category": "implementation", "start_line": 573, "end_line": 596, "span_ids": ["load_decorated_func", "is_decorated"], "tokens": 214}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def load_decorated_func(builder: IRBuilder, fdef: FuncDef, orig_func_reg: Value) -> Value:\n \"\"\"Apply decorators to a function.\n\n Given a decorated FuncDef and an instance of the callable class\n representing that FuncDef, apply the corresponding decorator\n functions on that decorated FuncDef and return the decorated\n function.\n \"\"\"\n if not is_decorated(builder, fdef):\n # If there are no decorators associated with the function, then just return the\n # original function.\n return orig_func_reg\n\n decorators = builder.fdefs_to_decorators[fdef]\n func_reg = orig_func_reg\n for d in reversed(decorators):\n decorator = d.accept(builder.visitor)\n assert isinstance(decorator, Value)\n func_reg = builder.py_call(decorator, [func_reg], func_reg.line)\n return func_reg\n\n\ndef is_decorated(builder: IRBuilder, fdef: FuncDef) -> bool:\n return fdef in builder.fdefs_to_decorators", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_gen_glue_gen_glue.if_fdef_is_property_.else_.return.gen_glue_method_builder_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_gen_glue_gen_glue.if_fdef_is_property_.else_.return.gen_glue_method_builder_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/function.py", "file_name": "function.py", "file_type": "text/x-python", "category": "implementation", "start_line": 599, "end_line": 616, "span_ids": ["gen_glue"], "tokens": 189}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def gen_glue(builder: IRBuilder, sig: FuncSignature, target: FuncIR,\n cls: ClassIR, base: ClassIR, fdef: FuncItem,\n *,\n do_py_ops: bool = False\n ) -> FuncIR:\n \"\"\"Generate glue methods that mediate between different method types in subclasses.\n\n Works on both properties and methods. See gen_glue_methods below\n for more details.\n\n If do_py_ops is True, then the glue methods should use generic\n C API operations instead of direct calls, to enable generating\n \"shadow\" glue methods that work with interpreted subclasses.\n \"\"\"\n if fdef.is_property:\n return gen_glue_property(builder, sig, target, cls, base, fdef.line, do_py_ops)\n else:\n return gen_glue_method(builder, sig, target, cls, base, fdef.line, do_py_ops)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_gen_glue_method_gen_glue_method.return.FuncIR_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_gen_glue_method_gen_glue_method.return.FuncIR_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/function.py", "file_name": "function.py", "file_type": "text/x-python", "category": "implementation", "start_line": 628, "end_line": 686, "span_ids": ["gen_glue_method"], "tokens": 569}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def gen_glue_method(builder: IRBuilder, sig: FuncSignature, target: FuncIR,\n cls: ClassIR, base: ClassIR, line: int,\n do_pycall: bool,\n ) -> FuncIR:\n \"\"\"Generate glue methods that mediate between different method types in subclasses.\n\n For example, if we have:\n\n class A:\n def f(builder: IRBuilder, x: int) -> object: ...\n\n then it is totally permissible to have a subclass\n\n class B(A):\n def f(builder: IRBuilder, x: object) -> int: ...\n\n since '(object) -> int' is a subtype of '(int) -> object' by the usual\n contra/co-variant function subtyping rules.\n\n The trickiness here is that int and object have different\n runtime representations in mypyc, so A.f and B.f have\n different signatures at the native C level. To deal with this,\n we need to generate glue methods that mediate between the\n different versions by coercing the arguments and return\n values.\n\n If do_pycall is True, then make the call using the C API\n instead of a native call.\n \"\"\"\n builder.enter()\n builder.ret_types[-1] = sig.ret_type\n\n rt_args = list(sig.args)\n if target.decl.kind == FUNC_NORMAL:\n rt_args[0] = RuntimeArg(sig.args[0].name, RInstance(cls))\n\n # The environment operates on Vars, so we make some up\n fake_vars = [(Var(arg.name), arg.type) for arg in rt_args]\n args = [builder.read(builder.add_local_reg(var, type, is_arg=True), line)\n for var, type in fake_vars]\n arg_names = [arg.name if arg.kind in (ARG_NAMED, ARG_NAMED_OPT) else None\n for arg in rt_args]\n arg_kinds = [concrete_arg_kind(arg.kind) for arg in rt_args]\n\n if do_pycall:\n retval = builder.builder.py_method_call(\n args[0], target.name, args[1:], line, arg_kinds[1:], arg_names[1:])\n else:\n retval = builder.builder.call(target.decl, args, arg_kinds, arg_names, line)\n retval = builder.coerce(retval, sig.ret_type, line)\n builder.add(Return(retval))\n\n arg_regs, _, blocks, ret_type, _ = builder.leave()\n return FuncIR(\n FuncDecl(target.name + '__' + base.name + '_glue',\n cls.name, builder.module_name,\n FuncSignature(rt_args, ret_type),\n target.decl.kind),\n arg_regs, blocks)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_gen_glue_property_gen_glue_property.return.FuncIR_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_gen_glue_property_gen_glue_property.return.FuncIR_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/function.py", "file_name": "function.py", "file_type": "text/x-python", "category": "implementation", "start_line": 688, "end_line": 721, "span_ids": ["gen_glue_property"], "tokens": 310}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def gen_glue_property(builder: IRBuilder,\n sig: FuncSignature,\n target: FuncIR,\n cls: ClassIR,\n base: ClassIR,\n line: int,\n do_pygetattr: bool) -> FuncIR:\n \"\"\"Generate glue methods for properties that mediate between different subclass types.\n\n Similarly to methods, properties of derived types can be covariantly subtyped. Thus,\n properties also require glue. However, this only requires the return type to change.\n Further, instead of a method call, an attribute get is performed.\n\n If do_pygetattr is True, then get the attribute using the Python C\n API instead of a native call.\n \"\"\"\n builder.enter()\n\n rt_arg = RuntimeArg(SELF_NAME, RInstance(cls))\n self_target = builder.add_self_to_env(cls)\n arg = builder.read(self_target, line)\n builder.ret_types[-1] = sig.ret_type\n if do_pygetattr:\n retval = builder.py_get_attr(arg, target.name, line)\n else:\n retval = builder.add(GetAttr(arg, target.name, line))\n retbox = builder.coerce(retval, sig.ret_type, line)\n builder.add(Return(retbox))\n\n args, _, blocks, return_type, _ = builder.leave()\n return FuncIR(\n FuncDecl(target.name + '__' + base.name + '_glue',\n cls.name, builder.module_name, FuncSignature([rt_arg], return_type)),\n args, blocks)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_get_func_target_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_get_func_target_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/function.py", "file_name": "function.py", "file_type": "text/x-python", "category": "implementation", "start_line": 724, "end_line": 738, "span_ids": ["get_func_target"], "tokens": 125}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_func_target(builder: IRBuilder, fdef: FuncDef) -> AssignmentTarget:\n \"\"\"Given a FuncDef, return the target for the instance of its callable class.\n\n If the function was not already defined somewhere, then define it\n and add it to the current environment.\n \"\"\"\n if fdef.original_def:\n # Get the target associated with the previously defined FuncDef.\n return builder.lookup(fdef.original_def)\n\n if builder.fn_info.is_generator or builder.fn_info.contains_nested:\n return builder.lookup(fdef)\n\n return builder.add_local_reg(fdef, object_rprimitive)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/generator.py__Generate_IR_for_genera_gen_generator_func.builder_add_Return_instan": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/generator.py__Generate_IR_for_genera_gen_generator_func.builder_add_Return_instan", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/generator.py", "file_name": "generator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 36, "span_ids": ["gen_generator_func", "docstring"], "tokens": 292}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Generate IR for generator functions.\n\nA generator function is represented by a class that implements the\ngenerator protocol and keeps track of the generator state, including\nlocal variables.\n\nThe top-level logic for dealing with generator functions is in\nmypyc.irbuild.function.\n\"\"\"\n\nfrom typing import List\n\nfrom mypy.nodes import Var, ARG_OPT\n\nfrom mypyc.common import SELF_NAME, NEXT_LABEL_ATTR_NAME, ENV_ATTR_NAME\nfrom mypyc.ir.ops import (\n BasicBlock, Call, Return, Goto, Integer, SetAttr, Unreachable, RaiseStandardError,\n Value, Register\n)\nfrom mypyc.ir.rtypes import RInstance, int_rprimitive, object_rprimitive\nfrom mypyc.ir.func_ir import FuncIR, FuncDecl, FuncSignature, RuntimeArg\nfrom mypyc.ir.class_ir import ClassIR\nfrom mypyc.primitives.exc_ops import raise_exception_with_tb_op\nfrom mypyc.irbuild.env_class import (\n add_args_to_env, load_outer_env, load_env_registers, finalize_env_class\n)\nfrom mypyc.irbuild.builder import IRBuilder, gen_arg_defaults\nfrom mypyc.irbuild.context import FuncInfo, GeneratorClass\n\n\ndef gen_generator_func(builder: IRBuilder) -> None:\n setup_generator_class(builder)\n load_env_registers(builder)\n gen_arg_defaults(builder)\n finalize_env_class(builder)\n builder.add(Return(instantiate_generator_class(builder)))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/generator.py_instantiate_generator_class_instantiate_generator_class.return.generator_reg": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/generator.py_instantiate_generator_class_instantiate_generator_class.return.generator_reg", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/generator.py", "file_name": "generator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 39, "end_line": 59, "span_ids": ["instantiate_generator_class"], "tokens": 238}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def instantiate_generator_class(builder: IRBuilder) -> Value:\n fitem = builder.fn_info.fitem\n generator_reg = builder.add(Call(builder.fn_info.generator_class.ir.ctor, [], fitem.line))\n\n # Get the current environment register. If the current function is nested, then the\n # generator class gets instantiated from the callable class' '__call__' method, and hence\n # we use the callable class' environment register. Otherwise, we use the original\n # function's environment register.\n if builder.fn_info.is_nested:\n curr_env_reg = builder.fn_info.callable_class.curr_env_reg\n else:\n curr_env_reg = builder.fn_info.curr_env_reg\n\n # Set the generator class' environment attribute to point at the environment class\n # defined in the current scope.\n builder.add(SetAttr(generator_reg, ENV_ATTR_NAME, curr_env_reg, fitem.line))\n\n # Set the generator class' environment class' NEXT_LABEL_ATTR_NAME attribute to 0.\n zero = Integer(0)\n builder.add(SetAttr(curr_env_reg, NEXT_LABEL_ATTR_NAME, zero, fitem.line))\n return generator_reg", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/generator.py_setup_generator_class_create_switch_for_generator_class.builder_activate_block_bl": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/generator.py_setup_generator_class_create_switch_for_generator_class.builder_activate_block_bl", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/generator.py", "file_name": "generator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 63, "end_line": 79, "span_ids": ["setup_generator_class", "create_switch_for_generator_class"], "tokens": 155}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def setup_generator_class(builder: IRBuilder) -> ClassIR:\n name = '{}_gen'.format(builder.fn_info.namespaced_name())\n\n generator_class_ir = ClassIR(name, builder.module_name, is_generated=True)\n generator_class_ir.attributes[ENV_ATTR_NAME] = RInstance(builder.fn_info.env_class)\n generator_class_ir.mro = [generator_class_ir]\n\n builder.classes.append(generator_class_ir)\n builder.fn_info.generator_class = GeneratorClass(generator_class_ir)\n return generator_class_ir\n\n\ndef create_switch_for_generator_class(builder: IRBuilder) -> None:\n builder.add(Goto(builder.fn_info.generator_class.switch_block))\n block = BasicBlock()\n builder.fn_info.generator_class.continuation_blocks.append(block)\n builder.activate_block(block)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/generator.py_populate_switch_for_generator_class_populate_switch_for_generator_class.builder_add_Unreachable_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/generator.py_populate_switch_for_generator_class_populate_switch_for_generator_class.builder_add_Unreachable_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/generator.py", "file_name": "generator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 81, "end_line": 95, "span_ids": ["populate_switch_for_generator_class"], "tokens": 132}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def populate_switch_for_generator_class(builder: IRBuilder) -> None:\n cls = builder.fn_info.generator_class\n line = builder.fn_info.fitem.line\n\n builder.activate_block(cls.switch_block)\n for label, true_block in enumerate(cls.continuation_blocks):\n false_block = BasicBlock()\n comparison = builder.binary_op(\n cls.next_label_reg, Integer(label), '==', line\n )\n builder.add_bool_branch(comparison, true_block, false_block)\n builder.activate_block(false_block)\n\n builder.add(RaiseStandardError(RaiseStandardError.STOP_ITERATION, None, line))\n builder.add(Unreachable())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/generator.py_add_raise_exception_blocks_to_generator_class_add_raise_exception_blocks_to_generator_class.builder_goto_and_activate": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/generator.py_add_raise_exception_blocks_to_generator_class_add_raise_exception_blocks_to_generator_class.builder_goto_and_activate", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/generator.py", "file_name": "generator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 99, "end_line": 119, "span_ids": ["add_raise_exception_blocks_to_generator_class"], "tokens": 201}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_raise_exception_blocks_to_generator_class(builder: IRBuilder, line: int) -> None:\n \"\"\"Add error handling blocks to a generator class.\n\n Generates blocks to check if error flags are set while calling the\n helper method for generator functions, and raises an exception if\n those flags are set.\n \"\"\"\n cls = builder.fn_info.generator_class\n assert cls.exc_regs is not None\n exc_type, exc_val, exc_tb = cls.exc_regs\n\n # Check to see if an exception was raised.\n error_block = BasicBlock()\n ok_block = BasicBlock()\n comparison = builder.translate_is_op(exc_type, builder.none_object(), 'is not', line)\n builder.add_bool_branch(comparison, error_block, ok_block)\n\n builder.activate_block(error_block)\n builder.call_c(raise_exception_with_tb_op, [exc_type, exc_val, exc_tb], line)\n builder.add(Unreachable())\n builder.goto_and_activate(ok_block)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/generator.py_add_methods_to_generator_class_add_methods_to_generator_class.if_is_coroutine_.add_await_to_generator_cl": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/generator.py_add_methods_to_generator_class_add_methods_to_generator_class.if_is_coroutine_.add_await_to_generator_cl", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/generator.py", "file_name": "generator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 121, "end_line": 134, "span_ids": ["add_methods_to_generator_class"], "tokens": 163}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_methods_to_generator_class(builder: IRBuilder,\n fn_info: FuncInfo,\n sig: FuncSignature,\n arg_regs: List[Register],\n blocks: List[BasicBlock],\n is_coroutine: bool) -> None:\n helper_fn_decl = add_helper_to_generator_class(builder, arg_regs, blocks, sig, fn_info)\n add_next_to_generator_class(builder, fn_info, helper_fn_decl, sig)\n add_send_to_generator_class(builder, fn_info, helper_fn_decl, sig)\n add_iter_to_generator_class(builder, fn_info)\n add_throw_to_generator_class(builder, fn_info, helper_fn_decl, sig)\n add_close_to_generator_class(builder, fn_info)\n if is_coroutine:\n add_await_to_generator_class(builder, fn_info)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/generator.py_add_helper_to_generator_class_add_helper_to_generator_class.return.helper_fn_decl": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/generator.py_add_helper_to_generator_class_add_helper_to_generator_class.return.helper_fn_decl", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/generator.py", "file_name": "generator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 137, "end_line": 155, "span_ids": ["add_helper_to_generator_class"], "tokens": 221}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_helper_to_generator_class(builder: IRBuilder,\n arg_regs: List[Register],\n blocks: List[BasicBlock],\n sig: FuncSignature,\n fn_info: FuncInfo) -> FuncDecl:\n \"\"\"Generates a helper method for a generator class, called by '__next__' and 'throw'.\"\"\"\n sig = FuncSignature((RuntimeArg(SELF_NAME, object_rprimitive),\n RuntimeArg('type', object_rprimitive),\n RuntimeArg('value', object_rprimitive),\n RuntimeArg('traceback', object_rprimitive),\n RuntimeArg('arg', object_rprimitive)\n ), sig.ret_type)\n helper_fn_decl = FuncDecl('__mypyc_generator_helper__', fn_info.generator_class.ir.name,\n builder.module_name, sig)\n helper_fn_ir = FuncIR(helper_fn_decl, arg_regs, blocks,\n fn_info.fitem.line, traceback_name=fn_info.fitem.name)\n fn_info.generator_class.ir.methods['__mypyc_generator_helper__'] = helper_fn_ir\n builder.functions.append(helper_fn_ir)\n return helper_fn_decl", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/generator.py_setup_env_for_generator_class_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/generator.py_setup_env_for_generator_class_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/generator.py", "file_name": "generator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 244, "end_line": 279, "span_ids": ["setup_env_for_generator_class"], "tokens": 370}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def setup_env_for_generator_class(builder: IRBuilder) -> None:\n \"\"\"Populates the environment for a generator class.\"\"\"\n fitem = builder.fn_info.fitem\n cls = builder.fn_info.generator_class\n self_target = builder.add_self_to_env(cls.ir)\n\n # Add the type, value, and traceback variables to the environment.\n exc_type = builder.add_local(Var('type'), object_rprimitive, is_arg=True)\n exc_val = builder.add_local(Var('value'), object_rprimitive, is_arg=True)\n exc_tb = builder.add_local(Var('traceback'), object_rprimitive, is_arg=True)\n # TODO: Use the right type here instead of object?\n exc_arg = builder.add_local(Var('arg'), object_rprimitive, is_arg=True)\n\n cls.exc_regs = (exc_type, exc_val, exc_tb)\n cls.send_arg_reg = exc_arg\n\n cls.self_reg = builder.read(self_target, fitem.line)\n cls.curr_env_reg = load_outer_env(builder, cls.self_reg, builder.symtables[-1])\n\n # Define a variable representing the label to go to the next time\n # the '__next__' function of the generator is called, and add it\n # as an attribute to the environment class.\n cls.next_label_target = builder.add_var_to_env_class(\n Var(NEXT_LABEL_ATTR_NAME),\n int_rprimitive,\n cls,\n reassign=False\n )\n\n # Add arguments from the original generator function to the\n # environment of the generator class.\n add_args_to_env(builder, local=False, base=cls, reassign=False)\n\n # Set the next label register for the generator class.\n cls.next_label_reg = builder.read(cls.next_label_target, fitem.line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.coerce_LowLevelIRBuilder.coerce.return.src": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.coerce_LowLevelIRBuilder.coerce.return.src", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/ll_builder.py", "file_name": "ll_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 136, "end_line": 162, "span_ids": ["LowLevelIRBuilder.coerce"], "tokens": 300}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LowLevelIRBuilder:\n\n def coerce(self, src: Value, target_type: RType, line: int, force: bool = False) -> Value:\n \"\"\"Generate a coercion/cast from one type to other (only if needed).\n\n For example, int -> object boxes the source int; int -> int emits nothing;\n object -> int unboxes the object. All conversions preserve object value.\n\n If force is true, always generate an op (even if it is just an assignment) so\n that the result will have exactly target_type as the type.\n\n Returns the register with the converted value (may be same as src).\n \"\"\"\n if src.type.is_unboxed and not target_type.is_unboxed:\n return self.box(src)\n if ((src.type.is_unboxed and target_type.is_unboxed)\n and not is_runtime_subtype(src.type, target_type)):\n # To go from one unboxed type to another, we go through a boxed\n # in-between value, for simplicity.\n tmp = self.box(src)\n return self.unbox_or_cast(tmp, target_type, line)\n if ((not src.type.is_unboxed and target_type.is_unboxed)\n or not is_subtype(src.type, target_type)):\n return self.unbox_or_cast(src, target_type, line)\n elif force:\n tmp = Register(target_type)\n self.add(Assign(tmp, src))\n return tmp\n return src", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder._Attribute_access_LowLevelIRBuilder.get_attr.if_isinstance_obj_type_.else_.return.self_py_get_attr_obj_att": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder._Attribute_access_LowLevelIRBuilder.get_attr.if_isinstance_obj_type_.else_.return.self_py_get_attr_obj_att", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/ll_builder.py", "file_name": "ll_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 164, "end_line": 174, "span_ids": ["LowLevelIRBuilder.get_attr", "LowLevelIRBuilder.coerce"], "tokens": 134}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LowLevelIRBuilder:\n\n # Attribute access\n\n def get_attr(self, obj: Value, attr: str, result_type: RType, line: int) -> Value:\n \"\"\"Get a native or Python attribute of an object.\"\"\"\n if (isinstance(obj.type, RInstance) and obj.type.class_ir.is_ext_class\n and obj.type.class_ir.has_attr(attr)):\n return self.add(GetAttr(obj, attr, line))\n elif isinstance(obj.type, RUnion):\n return self.union_get_attr(obj, obj.type, attr, result_type, line)\n else:\n return self.py_get_attr(obj, attr, line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.union_get_attr_LowLevelIRBuilder._isinstance_checks": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.union_get_attr_LowLevelIRBuilder._isinstance_checks", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/ll_builder.py", "file_name": "ll_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 175, "end_line": 196, "span_ids": ["LowLevelIRBuilder.union_get_attr", "LowLevelIRBuilder.py_get_attr"], "tokens": 181}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LowLevelIRBuilder:\n\n def union_get_attr(self,\n obj: Value,\n rtype: RUnion,\n attr: str,\n result_type: RType,\n line: int) -> Value:\n \"\"\"Get an attribute of an object with a union type.\"\"\"\n\n def get_item_attr(value: Value) -> Value:\n return self.get_attr(value, attr, result_type, line)\n\n return self.decompose_union_helper(obj, rtype, result_type, get_item_attr, line)\n\n def py_get_attr(self, obj: Value, attr: str, line: int) -> Value:\n \"\"\"Get a Python attribute (slow).\n\n Prefer get_attr() which generates optimized code for native classes.\n \"\"\"\n key = self.load_str(attr)\n return self.call_c(py_getattr_op, [obj, key], line)\n\n # isinstance() checks", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.isinstance_helper_LowLevelIRBuilder.type_is_op.return.self_add_ComparisonOp_ob_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.isinstance_helper_LowLevelIRBuilder.type_is_op.return.self_add_ComparisonOp_ob_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/ll_builder.py", "file_name": "ll_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 213, "end_line": 228, "span_ids": ["LowLevelIRBuilder.type_is_op", "LowLevelIRBuilder.isinstance_helper"], "tokens": 224}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LowLevelIRBuilder:\n\n def isinstance_helper(self, obj: Value, class_irs: List[ClassIR], line: int) -> Value:\n \"\"\"Fast path for isinstance() that checks against a list of native classes.\"\"\"\n if not class_irs:\n return self.false()\n ret = self.isinstance_native(obj, class_irs[0], line)\n for class_ir in class_irs[1:]:\n def other() -> Value:\n return self.isinstance_native(obj, class_ir, line)\n ret = self.shortcircuit_helper('or', bool_rprimitive, lambda: ret, other, line)\n return ret\n\n def type_is_op(self, obj: Value, type_obj: Value, line: int) -> Value:\n ob_type_address = self.add(GetElementPtr(obj, PyObject, 'ob_type', line))\n ob_type = self.add(LoadMem(object_rprimitive, ob_type_address))\n self.add(KeepAlive([obj]))\n return self.add(ComparisonOp(ob_type, type_obj, ComparisonOp.EQ, line))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.isinstance_native_LowLevelIRBuilder._Calls": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.isinstance_native_LowLevelIRBuilder._Calls", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/ll_builder.py", "file_name": "ll_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 215, "end_line": 238, "span_ids": ["LowLevelIRBuilder.isinstance_native"], "tokens": 248}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LowLevelIRBuilder:\n\n def isinstance_native(self, obj: Value, class_ir: ClassIR, line: int) -> Value:\n \"\"\"Fast isinstance() check for a native class.\n\n If there are three or fewer concrete (non-trait) classes among the class\n and all its children, use even faster type comparison checks `type(obj)\n is typ`.\n \"\"\"\n concrete = all_concrete_classes(class_ir)\n if concrete is None or len(concrete) > FAST_ISINSTANCE_MAX_SUBCLASSES + 1:\n return self.call_c(fast_isinstance_op,\n [obj, self.get_native_type(class_ir)],\n line)\n if not concrete:\n # There can't be any concrete instance that matches this.\n return self.false()\n type_obj = self.get_native_type(concrete[0])\n ret = self.type_is_op(obj, type_obj, line)\n for c in concrete[1:]:\n def other() -> Value:\n return self.type_is_op(obj, self.get_native_type(c), line)\n ret = self.shortcircuit_helper('or', bool_rprimitive, lambda: ret, other, line)\n return ret\n\n # Calls", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.py_call_LowLevelIRBuilder.py_call.return.self_call_c_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.py_call_LowLevelIRBuilder.py_call.return.self_call_c_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/ll_builder.py", "file_name": "ll_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 255, "end_line": 311, "span_ids": ["LowLevelIRBuilder.py_call"], "tokens": 577}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LowLevelIRBuilder:\n\n def py_call(self,\n function: Value,\n arg_values: List[Value],\n line: int,\n arg_kinds: Optional[List[int]] = None,\n arg_names: Optional[Sequence[Optional[str]]] = None) -> Value:\n \"\"\"Call a Python function (non-native and slow).\n\n Use py_call_op or py_call_with_kwargs_op for Python function call.\n \"\"\"\n if use_vectorcall(self.options.capi_version):\n # More recent Python versions support faster vectorcalls.\n result = self._py_vector_call(function, arg_values, line, arg_kinds, arg_names)\n if result is not None:\n return result\n\n # If all arguments are positional, we can use py_call_op.\n if arg_kinds is None or all(kind == ARG_POS for kind in arg_kinds):\n return self.call_c(py_call_op, [function] + arg_values, line)\n\n # Otherwise fallback to py_call_with_kwargs_op.\n assert arg_names is not None\n\n pos_arg_values = []\n kw_arg_key_value_pairs = [] # type: List[DictEntry]\n star_arg_values = []\n for value, kind, name in zip(arg_values, arg_kinds, arg_names):\n if kind == ARG_POS:\n pos_arg_values.append(value)\n elif kind == ARG_NAMED:\n assert name is not None\n key = self.load_str(name)\n kw_arg_key_value_pairs.append((key, value))\n elif kind == ARG_STAR:\n star_arg_values.append(value)\n elif kind == ARG_STAR2:\n # NOTE: mypy currently only supports a single ** arg, but python supports multiple.\n # This code supports multiple primarily to make the logic easier to follow.\n kw_arg_key_value_pairs.append((None, value))\n else:\n assert False, (\"Argument kind should not be possible:\", kind)\n\n if len(star_arg_values) == 0:\n # We can directly construct a tuple if there are no star args.\n pos_args_tuple = self.new_tuple(pos_arg_values, line)\n else:\n # Otherwise we construct a list and call extend it with the star args, since tuples\n # don't have an extend method.\n pos_args_list = self.new_list_op(pos_arg_values, line)\n for star_arg_value in star_arg_values:\n self.call_c(list_extend_op, [pos_args_list, star_arg_value], line)\n pos_args_tuple = self.call_c(list_tuple_op, [pos_args_list], line)\n\n kw_args_dict = self.make_dict(kw_arg_key_value_pairs, line)\n\n return self.call_c(\n py_call_with_kwargs_op, [function, pos_args_tuple, kw_args_dict], line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.native_args_to_positional_LowLevelIRBuilder.native_args_to_positional.return.output_args": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.native_args_to_positional_LowLevelIRBuilder.native_args_to_positional.return.output_args", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/ll_builder.py", "file_name": "ll_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 318, "end_line": 360, "span_ids": ["LowLevelIRBuilder.native_args_to_positional"], "tokens": 399}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LowLevelIRBuilder:\n\n def native_args_to_positional(self,\n args: Sequence[Value],\n arg_kinds: List[int],\n arg_names: Sequence[Optional[str]],\n sig: FuncSignature,\n line: int) -> List[Value]:\n \"\"\"Prepare arguments for a native call.\n\n Given args/kinds/names and a target signature for a native call, map\n keyword arguments to their appropriate place in the argument list,\n fill in error values for unspecified default arguments,\n package arguments that will go into *args/**kwargs into a tuple/dict,\n and coerce arguments to the appropriate type.\n \"\"\"\n\n sig_arg_kinds = [arg.kind for arg in sig.args]\n sig_arg_names = [arg.name for arg in sig.args]\n formal_to_actual = map_actuals_to_formals(arg_kinds,\n arg_names,\n sig_arg_kinds,\n sig_arg_names,\n lambda n: AnyType(TypeOfAny.special_form))\n\n # Flatten out the arguments, loading error values for default\n # arguments, constructing tuples/dicts for star args, and\n # coercing everything to the expected type.\n output_args = []\n for lst, arg in zip(formal_to_actual, sig.args):\n output_arg = None\n if arg.kind == ARG_STAR:\n items = [args[i] for i in lst]\n output_arg = self.new_tuple(items, line)\n elif arg.kind == ARG_STAR2:\n dict_entries = [(self.load_str(cast(str, arg_names[i])), args[i])\n for i in lst]\n output_arg = self.make_dict(dict_entries, line)\n elif not lst:\n output_arg = self.add(LoadErrorValue(arg.type, is_borrowed=True))\n else:\n output_arg = args[lst[0]]\n output_args.append(self.coerce(output_arg, arg.type, line))\n\n return output_args", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.gen_method_call_LowLevelIRBuilder.gen_method_call.return.self_py_method_call_base_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.gen_method_call_LowLevelIRBuilder.gen_method_call.return.self_py_method_call_base_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/ll_builder.py", "file_name": "ll_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 363, "end_line": 411, "span_ids": ["LowLevelIRBuilder.gen_method_call"], "tokens": 544}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LowLevelIRBuilder:\n\n def gen_method_call(self,\n base: Value,\n name: str,\n arg_values: List[Value],\n result_type: Optional[RType],\n line: int,\n arg_kinds: Optional[List[int]] = None,\n arg_names: Optional[List[Optional[str]]] = None) -> Value:\n \"\"\"Generate either a native or Python method call.\"\"\"\n # If arg_kinds contains values other than arg_pos and arg_named, then fallback to\n # Python method call.\n if (arg_kinds is not None\n and not all(kind in (ARG_POS, ARG_NAMED) for kind in arg_kinds)):\n return self.py_method_call(base, name, arg_values, base.line, arg_kinds, arg_names)\n\n # If the base type is one of ours, do a MethodCall\n if (isinstance(base.type, RInstance) and base.type.class_ir.is_ext_class\n and not base.type.class_ir.builtin_base):\n if base.type.class_ir.has_method(name):\n decl = base.type.class_ir.method_decl(name)\n if arg_kinds is None:\n assert arg_names is None, \"arg_kinds not present but arg_names is\"\n arg_kinds = [ARG_POS for _ in arg_values]\n arg_names = [None for _ in arg_values]\n else:\n assert arg_names is not None, \"arg_kinds present but arg_names is not\"\n\n # Normalize args to positionals.\n assert decl.bound_sig\n arg_values = self.native_args_to_positional(\n arg_values, arg_kinds, arg_names, decl.bound_sig, line)\n return self.add(MethodCall(base, name, arg_values, line))\n elif base.type.class_ir.has_attr(name):\n function = self.add(GetAttr(base, name, line))\n return self.py_call(function, arg_values, line,\n arg_kinds=arg_kinds, arg_names=arg_names)\n\n elif isinstance(base.type, RUnion):\n return self.union_method_call(base, base.type, name, arg_values, result_type, line,\n arg_kinds, arg_names)\n\n # Try to do a special-cased method call\n if not arg_kinds or arg_kinds == [ARG_POS] * len(arg_values):\n target = self.translate_special_method_call(base, name, arg_values, result_type, line)\n if target:\n return target\n\n # Fall back to Python method call\n return self.py_method_call(base, name, arg_values, line, arg_kinds, arg_names)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.union_method_call_LowLevelIRBuilder.union_method_call.return.self_decompose_union_help": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.union_method_call_LowLevelIRBuilder.union_method_call.return.self_decompose_union_help", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/ll_builder.py", "file_name": "ll_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 413, "end_line": 431, "span_ids": ["LowLevelIRBuilder.union_method_call"], "tokens": 195}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LowLevelIRBuilder:\n\n def union_method_call(self,\n base: Value,\n obj_type: RUnion,\n name: str,\n arg_values: List[Value],\n return_rtype: Optional[RType],\n line: int,\n arg_kinds: Optional[List[int]],\n arg_names: Optional[List[Optional[str]]]) -> Value:\n \"\"\"Generate a method call with a union type for the object.\"\"\"\n # Union method call needs a return_rtype for the type of the output register.\n # If we don't have one, use object_rprimitive.\n return_rtype = return_rtype or object_rprimitive\n\n def call_union_item(value: Value) -> Value:\n return self.gen_method_call(value, name, arg_values, return_rtype, line,\n arg_kinds, arg_names)\n\n return self.decompose_union_helper(base, obj_type, return_rtype, call_union_item, line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.load_static_checked_LowLevelIRBuilder.load_static_checked.return.value": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.load_static_checked_LowLevelIRBuilder.load_static_checked.return.value", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/ll_builder.py", "file_name": "ll_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 591, "end_line": 606, "span_ids": ["LowLevelIRBuilder.load_static_checked"], "tokens": 181}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LowLevelIRBuilder:\n\n def load_static_checked(self, typ: RType, identifier: str, module_name: Optional[str] = None,\n namespace: str = NAMESPACE_STATIC,\n line: int = -1,\n error_msg: Optional[str] = None) -> Value:\n if error_msg is None:\n error_msg = 'name \"{}\" is not defined'.format(identifier)\n ok_block, error_block = BasicBlock(), BasicBlock()\n value = self.add(LoadStatic(typ, identifier, module_name, namespace, line=line))\n self.add(Branch(value, error_block, ok_block, Branch.IS_ERROR, rare=True))\n self.activate_block(error_block)\n self.add(RaiseStandardError(RaiseStandardError.NAME_ERROR,\n error_msg,\n line))\n self.add(Unreachable())\n self.activate_block(ok_block)\n return value", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.binary_op_LowLevelIRBuilder.binary_op.return.target": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.binary_op_LowLevelIRBuilder.binary_op.return.target", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/ll_builder.py", "file_name": "ll_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 516, "end_line": 548, "span_ids": ["LowLevelIRBuilder.binary_op"], "tokens": 383}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LowLevelIRBuilder:\n def binary_op(self,\n lreg: Value,\n rreg: Value,\n op: str,\n line: int) -> Value:\n ltype = lreg.type\n rtype = rreg.type\n\n # Special case tuple comparison here so that nested tuples can be supported\n if isinstance(ltype, RTuple) and isinstance(rtype, RTuple) and op in ('==', '!='):\n return self.compare_tuples(lreg, rreg, op, line)\n\n # Special case == and != when we can resolve the method call statically\n if op in ('==', '!='):\n value = self.translate_eq_cmp(lreg, rreg, op, line)\n if value is not None:\n return value\n\n # Special case various ops\n if op in ('is', 'is not'):\n return self.translate_is_op(lreg, rreg, op, line)\n if is_str_rprimitive(ltype) and is_str_rprimitive(rtype) and op in ('==', '!='):\n return self.compare_strings(lreg, rreg, op, line)\n if is_tagged(ltype) and is_tagged(rtype) and op in int_comparison_op_mapping:\n return self.compare_tagged(lreg, rreg, op, line)\n if is_bool_rprimitive(ltype) and is_bool_rprimitive(rtype) and op in (\n '&', '&=', '|', '|=', '^', '^='):\n return self.bool_bitwise_op(lreg, rreg, op[0], line)\n\n call_c_ops_candidates = binary_ops.get(op, [])\n target = self.matching_call_c(call_c_ops_candidates, [lreg, rreg], line)\n assert target, 'Unsupported binary operation: %s' % op\n return target", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.check_tagged_short_int_LowLevelIRBuilder.check_tagged_short_int.return.check": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.check_tagged_short_int_LowLevelIRBuilder.check_tagged_short_int.return.check", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/ll_builder.py", "file_name": "ll_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 550, "end_line": 560, "span_ids": ["LowLevelIRBuilder.check_tagged_short_int"], "tokens": 156}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LowLevelIRBuilder:\n\n def check_tagged_short_int(self, val: Value, line: int, negated: bool = False) -> Value:\n \"\"\"Check if a tagged integer is a short integer.\n\n Return the result of the check (value of type 'bit').\n \"\"\"\n int_tag = Integer(1, c_pyssize_t_rprimitive, line)\n bitwise_and = self.int_op(c_pyssize_t_rprimitive, val, int_tag, IntOp.AND, line)\n zero = Integer(0, c_pyssize_t_rprimitive, line)\n op = ComparisonOp.NEQ if negated else ComparisonOp.EQ\n check = self.comparison_op(bitwise_and, zero, op, line)\n return check", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.compare_tagged_LowLevelIRBuilder.compare_tagged.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.compare_tagged_LowLevelIRBuilder.compare_tagged.return.result", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/ll_builder.py", "file_name": "ll_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 562, "end_line": 595, "span_ids": ["LowLevelIRBuilder.compare_tagged"], "tokens": 401}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LowLevelIRBuilder:\n\n def compare_tagged(self, lhs: Value, rhs: Value, op: str, line: int) -> Value:\n \"\"\"Compare two tagged integers using given operator (value context).\"\"\"\n # generate fast binary logic ops on short ints\n if is_short_int_rprimitive(lhs.type) and is_short_int_rprimitive(rhs.type):\n return self.comparison_op(lhs, rhs, int_comparison_op_mapping[op][0], line)\n op_type, c_func_desc, negate_result, swap_op = int_comparison_op_mapping[op]\n result = Register(bool_rprimitive)\n short_int_block, int_block, out = BasicBlock(), BasicBlock(), BasicBlock()\n check_lhs = self.check_tagged_short_int(lhs, line)\n if op in (\"==\", \"!=\"):\n check = check_lhs\n else:\n # for non-equality logical ops (less/greater than, etc.), need to check both sides\n check_rhs = self.check_tagged_short_int(rhs, line)\n check = self.int_op(bit_rprimitive, check_lhs, check_rhs, IntOp.AND, line)\n self.add(Branch(check, short_int_block, int_block, Branch.BOOL))\n self.activate_block(short_int_block)\n eq = self.comparison_op(lhs, rhs, op_type, line)\n self.add(Assign(result, eq, line))\n self.goto(out)\n self.activate_block(int_block)\n if swap_op:\n args = [rhs, lhs]\n else:\n args = [lhs, rhs]\n call = self.call_c(c_func_desc, args, line)\n if negate_result:\n # TODO: introduce UnaryIntOp?\n call_result = self.unary_op(call, \"not\", line)\n else:\n call_result = call\n self.add(Assign(result, call_result, line))\n self.goto_and_activate(out)\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.compare_tagged_condition_LowLevelIRBuilder.compare_tagged_condition.self_add_Branch_eq_true_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.compare_tagged_condition_LowLevelIRBuilder.compare_tagged_condition.self_add_Branch_eq_true_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/ll_builder.py", "file_name": "ll_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 641, "end_line": 693, "span_ids": ["LowLevelIRBuilder.compare_tagged_condition"], "tokens": 561}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LowLevelIRBuilder:\n\n def compare_tagged_condition(self,\n lhs: Value,\n rhs: Value,\n op: str,\n true: BasicBlock,\n false: BasicBlock,\n line: int) -> None:\n \"\"\"Compare two tagged integers using given operator (conditional context).\n\n Assume lhs and and rhs are tagged integers.\n\n Args:\n lhs: Left operand\n rhs: Right operand\n op: Operation, one of '==', '!=', '<', '<=', '>', '<='\n true: Branch target if comparison is true\n false: Branch target if comparison is false\n \"\"\"\n is_eq = op in (\"==\", \"!=\")\n if ((is_short_int_rprimitive(lhs.type) and is_short_int_rprimitive(rhs.type))\n or (is_eq and (is_short_int_rprimitive(lhs.type) or\n is_short_int_rprimitive(rhs.type)))):\n # We can skip the tag check\n check = self.comparison_op(lhs, rhs, int_comparison_op_mapping[op][0], line)\n self.add(Branch(check, true, false, Branch.BOOL))\n return\n op_type, c_func_desc, negate_result, swap_op = int_comparison_op_mapping[op]\n int_block, short_int_block = BasicBlock(), BasicBlock()\n check_lhs = self.check_tagged_short_int(lhs, line, negated=True)\n if is_eq or is_short_int_rprimitive(rhs.type):\n self.add(Branch(check_lhs, int_block, short_int_block, Branch.BOOL))\n else:\n # For non-equality logical ops (less/greater than, etc.), need to check both sides\n rhs_block = BasicBlock()\n self.add(Branch(check_lhs, int_block, rhs_block, Branch.BOOL))\n self.activate_block(rhs_block)\n check_rhs = self.check_tagged_short_int(rhs, line, negated=True)\n self.add(Branch(check_rhs, int_block, short_int_block, Branch.BOOL))\n # Arbitrary integers (slow path)\n self.activate_block(int_block)\n if swap_op:\n args = [rhs, lhs]\n else:\n args = [lhs, rhs]\n call = self.call_c(c_func_desc, args, line)\n if negate_result:\n self.add(Branch(call, false, true, Branch.BOOL))\n else:\n self.add(Branch(call, true, false, Branch.BOOL))\n # Short integers (fast path)\n self.activate_block(short_int_block)\n eq = self.comparison_op(lhs, rhs, op_type, line)\n self.add(Branch(eq, true, false, Branch.BOOL))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.compare_strings_LowLevelIRBuilder.compare_strings.return.self_add_ComparisonOp_com": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.compare_strings_LowLevelIRBuilder.compare_strings.return.self_add_ComparisonOp_com", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/ll_builder.py", "file_name": "ll_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 651, "end_line": 675, "span_ids": ["LowLevelIRBuilder.compare_strings"], "tokens": 309}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LowLevelIRBuilder:\n\n def compare_strings(self, lhs: Value, rhs: Value, op: str, line: int) -> Value:\n \"\"\"Compare two strings\"\"\"\n compare_result = self.call_c(unicode_compare, [lhs, rhs], line)\n error_constant = Integer(-1, c_int_rprimitive, line)\n compare_error_check = self.add(ComparisonOp(compare_result,\n error_constant, ComparisonOp.EQ, line))\n exception_check, propagate, final_compare = BasicBlock(), BasicBlock(), BasicBlock()\n branch = Branch(compare_error_check, exception_check, final_compare, Branch.BOOL)\n branch.negated = False\n self.add(branch)\n self.activate_block(exception_check)\n check_error_result = self.call_c(err_occurred_op, [], line)\n null = Integer(0, pointer_rprimitive, line)\n compare_error_check = self.add(ComparisonOp(check_error_result,\n null, ComparisonOp.NEQ, line))\n branch = Branch(compare_error_check, propagate, final_compare, Branch.BOOL)\n branch.negated = False\n self.add(branch)\n self.activate_block(propagate)\n self.call_c(keep_propagating_op, [], line)\n self.goto(final_compare)\n self.activate_block(final_compare)\n op_type = ComparisonOp.EQ if op == '==' else ComparisonOp.NEQ\n return self.add(ComparisonOp(compare_result,\n Integer(0, c_int_rprimitive), op_type, line))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.compare_tuples_LowLevelIRBuilder.compare_tuples.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.compare_tuples_LowLevelIRBuilder.compare_tuples.return.result", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/ll_builder.py", "file_name": "ll_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 677, "end_line": 725, "span_ids": ["LowLevelIRBuilder.compare_tuples"], "tokens": 500}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LowLevelIRBuilder:\n\n def compare_tuples(self,\n lhs: Value,\n rhs: Value,\n op: str,\n line: int = -1) -> Value:\n \"\"\"Compare two tuples item by item\"\"\"\n # type cast to pass mypy check\n assert isinstance(lhs.type, RTuple) and isinstance(rhs.type, RTuple)\n equal = True if op == '==' else False\n result = Register(bool_rprimitive)\n # empty tuples\n if len(lhs.type.types) == 0 and len(rhs.type.types) == 0:\n self.add(Assign(result, self.true() if equal else self.false(), line))\n return result\n length = len(lhs.type.types)\n false_assign, true_assign, out = BasicBlock(), BasicBlock(), BasicBlock()\n check_blocks = [BasicBlock() for i in range(length)]\n lhs_items = [self.add(TupleGet(lhs, i, line)) for i in range(length)]\n rhs_items = [self.add(TupleGet(rhs, i, line)) for i in range(length)]\n\n if equal:\n early_stop, final = false_assign, true_assign\n else:\n early_stop, final = true_assign, false_assign\n\n for i in range(len(lhs.type.types)):\n if i != 0:\n self.activate_block(check_blocks[i])\n lhs_item = lhs_items[i]\n rhs_item = rhs_items[i]\n compare = self.binary_op(lhs_item, rhs_item, op, line)\n # Cast to bool if necessary since most types uses comparison returning a object type\n # See generic_ops.py for more information\n if not is_bool_rprimitive(compare.type):\n compare = self.call_c(bool_op, [compare], line)\n if i < len(lhs.type.types) - 1:\n branch = Branch(compare, early_stop, check_blocks[i + 1], Branch.BOOL)\n else:\n branch = Branch(compare, early_stop, final, Branch.BOOL)\n # if op is ==, we branch on false, else branch on true\n branch.negated = equal\n self.add(branch)\n self.activate_block(false_assign)\n self.add(Assign(result, self.false(), line))\n self.goto(out)\n self.activate_block(true_assign)\n self.add(Assign(result, self.true(), line))\n self.goto_and_activate(out)\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.unary_op_LowLevelIRBuilder.unary_op.return.target": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.unary_op_LowLevelIRBuilder.unary_op.return.target", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/ll_builder.py", "file_name": "ll_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 744, "end_line": 753, "span_ids": ["LowLevelIRBuilder.unary_op"], "tokens": 121}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LowLevelIRBuilder:\n\n def unary_op(self,\n lreg: Value,\n expr_op: str,\n line: int) -> Value:\n if (is_bool_rprimitive(lreg.type) or is_bit_rprimitive(lreg.type)) and expr_op == 'not':\n return self.unary_not(lreg, line)\n call_c_ops_candidates = unary_ops.get(expr_op, [])\n target = self.matching_call_c(call_c_ops_candidates, [lreg], line)\n assert target, 'Unsupported unary operation: %s' % expr_op\n return target", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.make_dict_LowLevelIRBuilder.make_dict.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.make_dict_LowLevelIRBuilder.make_dict.return.result", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/ll_builder.py", "file_name": "ll_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 799, "end_line": 831, "span_ids": ["LowLevelIRBuilder.make_dict"], "tokens": 211}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LowLevelIRBuilder:\n\n def make_dict(self, key_value_pairs: Sequence[DictEntry], line: int) -> Value:\n result = None # type: Union[Value, None]\n keys = [] # type: List[Value]\n values = [] # type: List[Value]\n for key, value in key_value_pairs:\n if key is not None:\n # key:value\n if result is None:\n keys.append(key)\n values.append(value)\n continue\n\n self.translate_special_method_call(\n result,\n '__setitem__',\n [key, value],\n result_type=None,\n line=line)\n else:\n # **value\n if result is None:\n result = self._create_dict(keys, values, line)\n\n self.call_c(\n dict_update_in_display_op,\n [result, value],\n line=line\n )\n\n if result is None:\n result = self._create_dict(keys, values, line)\n\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.new_list_op_LowLevelIRBuilder.new_list_op.return.result_list": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.new_list_op_LowLevelIRBuilder.new_list_op.return.result_list", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/ll_builder.py", "file_name": "ll_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 894, "end_line": 911, "span_ids": ["LowLevelIRBuilder.new_list_op"], "tokens": 236}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LowLevelIRBuilder:\n\n def new_list_op(self, values: List[Value], line: int) -> Value:\n length = Integer(len(values), c_pyssize_t_rprimitive, line)\n result_list = self.call_c(new_list_op, [length], line)\n if len(values) == 0:\n return result_list\n args = [self.coerce(item, object_rprimitive, line) for item in values]\n ob_item_ptr = self.add(GetElementPtr(result_list, PyListObject, 'ob_item', line))\n ob_item_base = self.add(LoadMem(pointer_rprimitive, ob_item_ptr, line))\n for i in range(len(values)):\n if i == 0:\n item_address = ob_item_base\n else:\n offset = Integer(PLATFORM_SIZE * i, c_pyssize_t_rprimitive, line)\n item_address = self.add(IntOp(pointer_rprimitive, ob_item_base, offset,\n IntOp.ADD, line))\n self.add(SetMem(object_rprimitive, item_address, args[i], line))\n self.add(KeepAlive([result_list]))\n return result_list", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.new_set_op_LowLevelIRBuilder.builtin_call.return.target": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.new_set_op_LowLevelIRBuilder.builtin_call.return.target", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/ll_builder.py", "file_name": "ll_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 807, "end_line": 817, "span_ids": ["LowLevelIRBuilder.builtin_call", "LowLevelIRBuilder.new_set_op"], "tokens": 115}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LowLevelIRBuilder:\n\n def new_set_op(self, values: List[Value], line: int) -> Value:\n return self.call_c(new_set_op, values, line)\n\n def builtin_call(self,\n args: List[Value],\n fn_op: str,\n line: int) -> Value:\n call_c_ops_candidates = function_ops.get(fn_op, [])\n target = self.matching_call_c(call_c_ops_candidates, args, line)\n assert target, 'Unsupported builtin function: %s' % fn_op\n return target", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.shortcircuit_helper_LowLevelIRBuilder.shortcircuit_helper.return.target": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.shortcircuit_helper_LowLevelIRBuilder.shortcircuit_helper.return.target", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/ll_builder.py", "file_name": "ll_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 819, "end_line": 848, "span_ids": ["LowLevelIRBuilder.shortcircuit_helper"], "tokens": 306}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LowLevelIRBuilder:\n\n def shortcircuit_helper(self, op: str,\n expr_type: RType,\n left: Callable[[], Value],\n right: Callable[[], Value], line: int) -> Value:\n # Having actual Phi nodes would be really nice here!\n target = Register(expr_type)\n # left_body takes the value of the left side, right_body the right\n left_body, right_body, next = BasicBlock(), BasicBlock(), BasicBlock()\n # true_body is taken if the left is true, false_body if it is false.\n # For 'and' the value is the right side if the left is true, and for 'or'\n # it is the right side if the left is false.\n true_body, false_body = (\n (right_body, left_body) if op == 'and' else (left_body, right_body))\n\n left_value = left()\n self.add_bool_branch(left_value, true_body, false_body)\n\n self.activate_block(left_body)\n left_coerced = self.coerce(left_value, expr_type, line)\n self.add(Assign(target, left_coerced))\n self.goto(next)\n\n self.activate_block(right_body)\n right_value = right()\n right_coerced = self.coerce(right_value, expr_type, line)\n self.add(Assign(target, right_coerced))\n self.goto(next)\n\n self.activate_block(next)\n return target", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.add_bool_branch_LowLevelIRBuilder.add_bool_branch.self_add_Branch_value_tr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.add_bool_branch_LowLevelIRBuilder.add_bool_branch.self_add_Branch_value_tr", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/ll_builder.py", "file_name": "ll_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 970, "end_line": 1010, "span_ids": ["LowLevelIRBuilder.add_bool_branch"], "tokens": 508}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LowLevelIRBuilder:\n\n def add_bool_branch(self, value: Value, true: BasicBlock, false: BasicBlock) -> None:\n if is_runtime_subtype(value.type, int_rprimitive):\n zero = Integer(0, short_int_rprimitive)\n self.compare_tagged_condition(value, zero, '!=', true, false, value.line)\n return\n elif is_same_type(value.type, str_rprimitive):\n value = self.call_c(str_check_if_true, [value], value.line)\n elif (is_same_type(value.type, list_rprimitive)\n or is_same_type(value.type, dict_rprimitive)):\n length = self.builtin_len(value, value.line)\n zero = Integer(0)\n value = self.binary_op(length, zero, '!=', value.line)\n elif (isinstance(value.type, RInstance) and value.type.class_ir.is_ext_class\n and value.type.class_ir.has_method('__bool__')):\n # Directly call the __bool__ method on classes that have it.\n value = self.gen_method_call(value, '__bool__', [], bool_rprimitive, value.line)\n else:\n value_type = optional_value_type(value.type)\n if value_type is not None:\n is_none = self.translate_is_op(value, self.none_object(), 'is not', value.line)\n branch = Branch(is_none, true, false, Branch.BOOL)\n self.add(branch)\n always_truthy = False\n if isinstance(value_type, RInstance):\n # check whether X.__bool__ is always just the default (object.__bool__)\n if (not value_type.class_ir.has_method('__bool__')\n and value_type.class_ir.is_method_final('__bool__')):\n always_truthy = True\n\n if not always_truthy:\n # Optional[X] where X may be falsey and requires a check\n branch.true = BasicBlock()\n self.activate_block(branch.true)\n # unbox_or_cast instead of coerce because we want the\n # type to change even if it is a subtype.\n remaining = self.unbox_or_cast(value, value_type, value.line)\n self.add_bool_branch(remaining, true, false)\n return\n elif not is_bool_rprimitive(value.type) and not is_bit_rprimitive(value.type):\n value = self.call_c(bool_op, [value], value.line)\n self.add(Branch(value, true, false, Branch.BOOL))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.call_c_LowLevelIRBuilder.call_c.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.call_c_LowLevelIRBuilder.call_c.return.result", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/ll_builder.py", "file_name": "ll_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 889, "end_line": 946, "span_ids": ["LowLevelIRBuilder.call_c"], "tokens": 538}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LowLevelIRBuilder:\n\n def call_c(self,\n desc: CFunctionDescription,\n args: List[Value],\n line: int,\n result_type: Optional[RType] = None) -> Value:\n \"\"\"Call function using C/native calling convention (not a Python callable).\"\"\"\n # Handle void function via singleton RVoid instance\n coerced = []\n # Coerce fixed number arguments\n for i in range(min(len(args), len(desc.arg_types))):\n formal_type = desc.arg_types[i]\n arg = args[i]\n arg = self.coerce(arg, formal_type, line)\n coerced.append(arg)\n # Reorder args if necessary\n if desc.ordering is not None:\n assert desc.var_arg_type is None\n coerced = [coerced[i] for i in desc.ordering]\n # Coerce any var_arg\n var_arg_idx = -1\n if desc.var_arg_type is not None:\n var_arg_idx = len(desc.arg_types)\n for i in range(len(desc.arg_types), len(args)):\n arg = args[i]\n arg = self.coerce(arg, desc.var_arg_type, line)\n coerced.append(arg)\n # Add extra integer constant if any\n for item in desc.extra_int_constants:\n val, typ = item\n extra_int_constant = Integer(val, typ, line)\n coerced.append(extra_int_constant)\n error_kind = desc.error_kind\n if error_kind == ERR_NEG_INT:\n # Handled with an explicit comparison\n error_kind = ERR_NEVER\n target = self.add(CallC(desc.c_function_name, coerced, desc.return_type, desc.steals,\n desc.is_borrowed, error_kind, line, var_arg_idx))\n if desc.error_kind == ERR_NEG_INT:\n comp = ComparisonOp(target,\n Integer(0, desc.return_type, line),\n ComparisonOp.SGE,\n line)\n comp.error_kind = ERR_FALSE\n self.add(comp)\n\n if desc.truncated_type is None:\n result = target\n else:\n truncate = self.add(Truncate(target, desc.return_type, desc.truncated_type))\n result = truncate\n if result_type and not is_runtime_subtype(result.type, result_type):\n if is_none_rprimitive(result_type):\n # Special case None return. The actual result may actually be a bool\n # and so we can't just coerce it.\n result = self.none()\n else:\n result = self.coerce(target, result_type, line)\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.matching_call_c_LowLevelIRBuilder.comparison_op.return.self_add_ComparisonOp_lhs": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.matching_call_c_LowLevelIRBuilder.comparison_op.return.self_add_ComparisonOp_lhs", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/ll_builder.py", "file_name": "ll_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 948, "end_line": 977, "span_ids": ["LowLevelIRBuilder.int_op", "LowLevelIRBuilder.comparison_op", "LowLevelIRBuilder.matching_call_c"], "tokens": 307}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LowLevelIRBuilder:\n\n def matching_call_c(self,\n candidates: List[CFunctionDescription],\n args: List[Value],\n line: int,\n result_type: Optional[RType] = None) -> Optional[Value]:\n # TODO: this function is very similar to matching_primitive_op\n # we should remove the old one or refactor both them into only as we move forward\n matching = None # type: Optional[CFunctionDescription]\n for desc in candidates:\n if len(desc.arg_types) != len(args):\n continue\n if all(is_subtype(actual.type, formal)\n for actual, formal in zip(args, desc.arg_types)):\n if matching:\n assert matching.priority != desc.priority, 'Ambiguous:\\n1) %s\\n2) %s' % (\n matching, desc)\n if desc.priority > matching.priority:\n matching = desc\n else:\n matching = desc\n if matching:\n target = self.call_c(matching, args, line, result_type)\n return target\n return None\n\n def int_op(self, type: RType, lhs: Value, rhs: Value, op: int, line: int) -> Value:\n return self.add(IntOp(type, lhs, rhs, op, line))\n\n def comparison_op(self, lhs: Value, rhs: Value, op: int, line: int) -> Value:\n return self.add(ComparisonOp(lhs, rhs, op, line))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.decompose_union_helper_LowLevelIRBuilder.decompose_union_helper.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.decompose_union_helper_LowLevelIRBuilder.decompose_union_helper.return.result", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/ll_builder.py", "file_name": "ll_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1008, "end_line": 1067, "span_ids": ["LowLevelIRBuilder.decompose_union_helper"], "tokens": 541}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LowLevelIRBuilder:\n\n def decompose_union_helper(self,\n obj: Value,\n rtype: RUnion,\n result_type: RType,\n process_item: Callable[[Value], Value],\n line: int) -> Value:\n \"\"\"Generate isinstance() + specialized operations for union items.\n\n Say, for Union[A, B] generate ops resembling this (pseudocode):\n\n if isinstance(obj, A):\n result = \n else:\n result = \n\n Args:\n obj: value with a union type\n rtype: the union type\n result_type: result of the operation\n process_item: callback to generate op for a single union item (arg is coerced\n to union item type)\n line: line number\n \"\"\"\n # TODO: Optimize cases where a single operation can handle multiple union items\n # (say a method is implemented in a common base class)\n fast_items = []\n rest_items = []\n for item in rtype.items:\n if isinstance(item, RInstance):\n fast_items.append(item)\n else:\n # For everything but RInstance we fall back to C API\n rest_items.append(item)\n exit_block = BasicBlock()\n result = Register(result_type)\n for i, item in enumerate(fast_items):\n more_types = i < len(fast_items) - 1 or rest_items\n if more_types:\n # We are not at the final item so we need one more branch\n op = self.isinstance_native(obj, item.class_ir, line)\n true_block, false_block = BasicBlock(), BasicBlock()\n self.add_bool_branch(op, true_block, false_block)\n self.activate_block(true_block)\n coerced = self.coerce(obj, item, line)\n temp = process_item(coerced)\n temp2 = self.coerce(temp, result_type, line)\n self.add(Assign(result, temp2))\n self.goto(exit_block)\n if more_types:\n self.activate_block(false_block)\n if rest_items:\n # For everything else we use generic operation. Use force=True to drop the\n # union type.\n coerced = self.coerce(obj, object_rprimitive, line, force=True)\n temp = process_item(coerced)\n temp2 = self.coerce(temp, result_type, line)\n self.add(Assign(result, temp2))\n self.goto(exit_block)\n self.activate_block(exit_block)\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.translate_eq_cmp_LowLevelIRBuilder.translate_eq_cmp.return.self_gen_method_call_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.translate_eq_cmp_LowLevelIRBuilder.translate_eq_cmp.return.self_gen_method_call_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/ll_builder.py", "file_name": "ll_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1141, "end_line": 1183, "span_ids": ["LowLevelIRBuilder.translate_eq_cmp"], "tokens": 336}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LowLevelIRBuilder:\n\n def translate_eq_cmp(self,\n lreg: Value,\n rreg: Value,\n expr_op: str,\n line: int) -> Optional[Value]:\n \"\"\"Add a equality comparison operation.\n\n Args:\n expr_op: either '==' or '!='\n \"\"\"\n ltype = lreg.type\n rtype = rreg.type\n if not (isinstance(ltype, RInstance) and ltype == rtype):\n return None\n\n class_ir = ltype.class_ir\n # Check whether any subclasses of the operand redefines __eq__\n # or it might be redefined in a Python parent class or by\n # dataclasses\n cmp_varies_at_runtime = (\n not class_ir.is_method_final('__eq__')\n or not class_ir.is_method_final('__ne__')\n or class_ir.inherits_python\n or class_ir.is_augmented\n )\n\n if cmp_varies_at_runtime:\n # We might need to call left.__eq__(right) or right.__eq__(left)\n # depending on which is the more specific type.\n return None\n\n if not class_ir.has_method('__eq__'):\n # There's no __eq__ defined, so just use object identity.\n identity_ref_op = 'is' if expr_op == '==' else 'is not'\n return self.translate_is_op(lreg, rreg, identity_ref_op, line)\n\n return self.gen_method_call(\n lreg,\n op_methods[expr_op],\n [rreg],\n ltype,\n line\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.translate_is_op_LowLevelIRBuilder.translate_is_op.return.self_add_ComparisonOp_lhs": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.translate_is_op_LowLevelIRBuilder.translate_is_op.return.self_add_ComparisonOp_lhs", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/ll_builder.py", "file_name": "ll_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1185, "end_line": 1198, "span_ids": ["LowLevelIRBuilder.translate_is_op"], "tokens": 132}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LowLevelIRBuilder:\n\n def translate_is_op(self,\n lreg: Value,\n rreg: Value,\n expr_op: str,\n line: int) -> Value:\n \"\"\"Create equality comparison operation between object identities\n\n Args:\n expr_op: either 'is' or 'is not'\n \"\"\"\n op = ComparisonOp.EQ if expr_op == 'is' else ComparisonOp.NEQ\n lhs = self.coerce(lreg, object_rprimitive, line)\n rhs = self.coerce(rreg, object_rprimitive, line)\n return self.add(ComparisonOp(lhs, rhs, op, line))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder._create_dict_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder._create_dict_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/ll_builder.py", "file_name": "ll_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1276, "end_line": 1300, "span_ids": ["LowLevelIRBuilder._create_dict", "num_positional_args"], "tokens": 224}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LowLevelIRBuilder:\n\n def _create_dict(self,\n keys: List[Value],\n values: List[Value],\n line: int) -> Value:\n \"\"\"Create a dictionary(possibly empty) using keys and values\"\"\"\n # keys and values should have the same number of items\n size = len(keys)\n if size > 0:\n size_value = Integer(size, c_pyssize_t_rprimitive) # type: Value\n # merge keys and values\n items = [i for t in list(zip(keys, values)) for i in t]\n return self.call_c(dict_build_op, [size_value] + items, line)\n else:\n return self.call_c(dict_new_op, [], line)\n\n\ndef num_positional_args(arg_values: List[Value], arg_kinds: Optional[List[int]]) -> int:\n if arg_kinds is None:\n return len(arg_values)\n num_pos = 0\n for kind in arg_kinds:\n if kind == ARG_POS:\n num_pos += 1\n return num_pos", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/main.py__Transform_a_mypy_AST_t_strict_optional_dec.cast_Callable_F_F_st": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/main.py__Transform_a_mypy_AST_t_strict_optional_dec.cast_Callable_F_F_st", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 48, "span_ids": ["docstring"], "tokens": 417}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Transform a mypy AST to the IR form (Intermediate Representation).\n\nFor example, consider a function like this:\n\n def f(x: int) -> int:\n return x * 2 + 1\n\nIt would be translated to something that conceptually looks like this:\n\n r0 = 2\n r1 = 1\n r2 = x * r0 :: int\n r3 = r2 + r1 :: int\n return r3\n\nThis module deals with the module-level IR transformation logic and\nputting it all together. The actual IR is implemented in mypyc.ir.\n\nFor the core of the IR transform implementation, look at build_ir()\nbelow, mypyc.irbuild.builder, and mypyc.irbuild.visitor.\n\"\"\"\n\nfrom mypy.ordered_dict import OrderedDict\nfrom typing import List, Dict, Callable, Any, TypeVar, cast\n\nfrom mypy.nodes import MypyFile, Expression, ClassDef\nfrom mypy.types import Type\nfrom mypy.state import strict_optional_set\nfrom mypy.build import Graph\n\nfrom mypyc.common import TOP_LEVEL_NAME\nfrom mypyc.errors import Errors\nfrom mypyc.options import CompilerOptions\nfrom mypyc.ir.rtypes import none_rprimitive\nfrom mypyc.ir.module_ir import ModuleIR, ModuleIRs\nfrom mypyc.ir.func_ir import FuncIR, FuncDecl, FuncSignature\nfrom mypyc.irbuild.prebuildvisitor import PreBuildVisitor\nfrom mypyc.irbuild.vtable import compute_vtable\nfrom mypyc.irbuild.prepare import build_type_map\nfrom mypyc.irbuild.builder import IRBuilder\nfrom mypyc.irbuild.visitor import IRBuilderVisitor\nfrom mypyc.irbuild.mapper import Mapper\n\n\n# The stubs for callable contextmanagers are busted so cast it to the\n# right type...\nF = TypeVar('F', bound=Callable[..., Any])\nstrict_optional_dec = cast(Callable[[F], F], strict_optional_set(True))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/main.py_build_ir_build_ir.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/main.py_build_ir_build_ir.return.result", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 51, "end_line": 96, "span_ids": ["build_ir"], "tokens": 313}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@strict_optional_dec # Turn on strict optional for any type manipulations we do\ndef build_ir(modules: List[MypyFile],\n graph: Graph,\n types: Dict[Expression, Type],\n mapper: 'Mapper',\n options: CompilerOptions,\n errors: Errors) -> ModuleIRs:\n \"\"\"Build IR for a set of modules that have been type-checked by mypy.\"\"\"\n\n build_type_map(mapper, modules, graph, types, options, errors)\n\n result = OrderedDict() # type: ModuleIRs\n\n # Generate IR for all modules.\n class_irs = []\n\n for module in modules:\n # First pass to determine free symbols.\n pbv = PreBuildVisitor()\n module.accept(pbv)\n\n # Construct and configure builder objects (cyclic runtime dependency).\n visitor = IRBuilderVisitor()\n builder = IRBuilder(\n module.fullname, types, graph, errors, mapper, pbv, visitor, options\n )\n visitor.builder = builder\n\n # Second pass does the bulk of the work.\n transform_mypy_file(builder, module)\n module_ir = ModuleIR(\n module.fullname,\n list(builder.imports),\n builder.functions,\n builder.classes,\n builder.final_names\n )\n result[module.fullname] = module_ir\n class_irs.extend(builder.classes)\n\n # Compute vtables.\n for cir in class_irs:\n if cir.is_ext_class:\n compute_vtable(cir)\n\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/main.py_transform_mypy_file_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/main.py_transform_mypy_file_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 99, "end_line": 132, "span_ids": ["transform_mypy_file"], "tokens": 262}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def transform_mypy_file(builder: IRBuilder, mypyfile: MypyFile) -> None:\n \"\"\"Generate IR for a single module.\"\"\"\n\n if mypyfile.fullname in ('typing', 'abc'):\n # These module are special; their contents are currently all\n # built-in primitives.\n return\n\n builder.set_module(mypyfile.fullname, mypyfile.path)\n\n classes = [node for node in mypyfile.defs if isinstance(node, ClassDef)]\n\n # Collect all classes.\n for cls in classes:\n ir = builder.mapper.type_to_ir[cls.info]\n builder.classes.append(ir)\n\n builder.enter('')\n\n # Make sure we have a builtins import\n builder.gen_import('builtins', -1)\n\n # Generate ops.\n for node in mypyfile.defs:\n builder.accept(node)\n builder.maybe_add_implicit_return()\n\n # Generate special function representing module top level.\n args, _, blocks, ret_type, _ = builder.leave()\n sig = FuncSignature([], none_rprimitive)\n func_ir = FuncIR(FuncDecl(TOP_LEVEL_NAME, None, builder.module_name, sig), args, blocks,\n traceback_name=\"\")\n builder.functions.append(func_ir)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/mapper.py__Maintain_a_mapping_fro_from_mypyc_ir_class_ir_im": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/mapper.py__Maintain_a_mapping_fro_from_mypyc_ir_class_ir_im", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/mapper.py", "file_name": "mapper.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 18, "span_ids": ["docstring"], "tokens": 198}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Maintain a mapping from mypy concepts to IR/compiled concepts.\"\"\"\n\nfrom typing import Dict, Optional\n\nfrom mypy.nodes import FuncDef, TypeInfo, SymbolNode, ARG_STAR, ARG_STAR2\nfrom mypy.types import (\n Instance, Type, CallableType, LiteralType, TypedDictType, UnboundType, PartialType,\n UninhabitedType, Overloaded, UnionType, TypeType, AnyType, NoneTyp, TupleType, TypeVarType,\n get_proper_type\n)\n\nfrom mypyc.ir.rtypes import (\n RType, RUnion, RTuple, RInstance, object_rprimitive, dict_rprimitive, tuple_rprimitive,\n none_rprimitive, int_rprimitive, float_rprimitive, str_rprimitive, bool_rprimitive,\n list_rprimitive, set_rprimitive\n)\nfrom mypyc.ir.func_ir import FuncSignature, FuncDecl, RuntimeArg\nfrom mypyc.ir.class_ir import ClassIR", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/mapper.py_Mapper.type_to_rtype_Mapper.type_to_rtype.assert_False_unexpected": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/mapper.py_Mapper.type_to_rtype_Mapper.type_to_rtype.assert_False_unexpected", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/mapper.py", "file_name": "mapper.py", "file_type": "text/x-python", "category": "implementation", "start_line": 44, "end_line": 117, "span_ids": ["Mapper.type_to_rtype"], "tokens": 690}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Mapper:\n\n def type_to_rtype(self, typ: Optional[Type]) -> RType:\n if typ is None:\n return object_rprimitive\n\n typ = get_proper_type(typ)\n if isinstance(typ, Instance):\n if typ.type.fullname == 'builtins.int':\n return int_rprimitive\n elif typ.type.fullname == 'builtins.float':\n return float_rprimitive\n elif typ.type.fullname == 'builtins.str':\n return str_rprimitive\n elif typ.type.fullname == 'builtins.bool':\n return bool_rprimitive\n elif typ.type.fullname == 'builtins.list':\n return list_rprimitive\n # Dict subclasses are at least somewhat common and we\n # specifically support them, so make sure that dict operations\n # get optimized on them.\n elif any(cls.fullname == 'builtins.dict' for cls in typ.type.mro):\n return dict_rprimitive\n elif typ.type.fullname == 'builtins.set':\n return set_rprimitive\n elif typ.type.fullname == 'builtins.tuple':\n return tuple_rprimitive # Varying-length tuple\n elif typ.type in self.type_to_ir:\n inst = RInstance(self.type_to_ir[typ.type])\n # Treat protocols as Union[protocol, object], so that we can do fast\n # method calls in the cases where the protocol is explicitly inherited from\n # and fall back to generic operations when it isn't.\n if typ.type.is_protocol:\n return RUnion([inst, object_rprimitive])\n else:\n return inst\n else:\n return object_rprimitive\n elif isinstance(typ, TupleType):\n # Use our unboxed tuples for raw tuples but fall back to\n # being boxed for NamedTuple.\n if typ.partial_fallback.type.fullname == 'builtins.tuple':\n return RTuple([self.type_to_rtype(t) for t in typ.items])\n else:\n return tuple_rprimitive\n elif isinstance(typ, CallableType):\n return object_rprimitive\n elif isinstance(typ, NoneTyp):\n return none_rprimitive\n elif isinstance(typ, UnionType):\n return RUnion([self.type_to_rtype(item)\n for item in typ.items])\n elif isinstance(typ, AnyType):\n return object_rprimitive\n elif isinstance(typ, TypeType):\n return object_rprimitive\n elif isinstance(typ, TypeVarType):\n # Erase type variable to upper bound.\n # TODO: Erase to union if object has value restriction?\n return self.type_to_rtype(typ.upper_bound)\n elif isinstance(typ, PartialType):\n assert typ.var.type is not None\n return self.type_to_rtype(typ.var.type)\n elif isinstance(typ, Overloaded):\n return object_rprimitive\n elif isinstance(typ, TypedDictType):\n return dict_rprimitive\n elif isinstance(typ, LiteralType):\n return self.type_to_rtype(typ.fallback)\n elif isinstance(typ, (UninhabitedType, UnboundType)):\n # Sure, whatever!\n return object_rprimitive\n\n # I think we've covered everything that is supposed to\n # actually show up, so anything else is a bug somewhere.\n assert False, 'unexpected type %s' % type(typ)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/nonlocalcontrol.py__Helpers_for_dealing_wi_if_TYPE_CHECKING_.from_mypyc_irbuild_builde": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/nonlocalcontrol.py__Helpers_for_dealing_wi_if_TYPE_CHECKING_.from_mypyc_irbuild_builde", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/nonlocalcontrol.py", "file_name": "nonlocalcontrol.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 18, "span_ids": ["docstring"], "tokens": 132}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Helpers for dealing with nonlocal control such as 'break' and 'return'.\n\nModel how these behave differently in different contexts.\n\"\"\"\n\nfrom abc import abstractmethod\nfrom typing import Optional, Union\nfrom typing_extensions import TYPE_CHECKING\n\nfrom mypyc.ir.ops import (\n Branch, BasicBlock, Unreachable, Value, Goto, Integer, Assign, Register, Return,\n NO_TRACEBACK_LINE_NO\n)\nfrom mypyc.primitives.exc_ops import set_stop_iteration_value, restore_exc_info_op\nfrom mypyc.irbuild.targets import AssignmentTarget\n\nif TYPE_CHECKING:\n from mypyc.irbuild.builder import IRBuilder", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/nonlocalcontrol.py_NonlocalControl_NonlocalControl.gen_return.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/nonlocalcontrol.py_NonlocalControl_NonlocalControl.gen_return.pass", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/nonlocalcontrol.py", "file_name": "nonlocalcontrol.py", "file_type": "text/x-python", "category": "implementation", "start_line": 20, "end_line": 39, "span_ids": ["NonlocalControl.gen_return", "NonlocalControl.gen_continue", "NonlocalControl.gen_break", "NonlocalControl"], "tokens": 198}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class NonlocalControl:\n \"\"\"ABC representing a stack frame of constructs that modify nonlocal control flow.\n\n The nonlocal control flow constructs are break, continue, and\n return, and their behavior is modified by a number of other\n constructs. The most obvious is loop, which override where break\n and continue jump to, but also `except` (which needs to clear\n exc_info when left) and (eventually) finally blocks (which need to\n ensure that the finally block is always executed when leaving the\n try/except blocks).\n \"\"\"\n\n @abstractmethod\n def gen_break(self, builder: 'IRBuilder', line: int) -> None: pass\n\n @abstractmethod\n def gen_continue(self, builder: 'IRBuilder', line: int) -> None: pass\n\n @abstractmethod\n def gen_return(self, builder: 'IRBuilder', value: Value, line: int) -> None: pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/nonlocalcontrol.py_BaseNonlocalControl_BaseNonlocalControl.gen_return.builder_add_Return_value_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/nonlocalcontrol.py_BaseNonlocalControl_BaseNonlocalControl.gen_return.builder_add_Return_value_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/nonlocalcontrol.py", "file_name": "nonlocalcontrol.py", "file_type": "text/x-python", "category": "implementation", "start_line": 42, "end_line": 52, "span_ids": ["BaseNonlocalControl.gen_break", "BaseNonlocalControl.gen_return", "BaseNonlocalControl", "BaseNonlocalControl.gen_continue"], "tokens": 110}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseNonlocalControl(NonlocalControl):\n \"\"\"Default nonlocal control outside any statements that affect it.\"\"\"\n\n def gen_break(self, builder: 'IRBuilder', line: int) -> None:\n assert False, \"break outside of loop\"\n\n def gen_continue(self, builder: 'IRBuilder', line: int) -> None:\n assert False, \"continue outside of loop\"\n\n def gen_return(self, builder: 'IRBuilder', value: Value, line: int) -> None:\n builder.add(Return(value))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/nonlocalcontrol.py_LoopNonlocalControl_LoopNonlocalControl.gen_return.self_outer_gen_return_bui": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/nonlocalcontrol.py_LoopNonlocalControl_LoopNonlocalControl.gen_return.self_outer_gen_return_bui", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/nonlocalcontrol.py", "file_name": "nonlocalcontrol.py", "file_type": "text/x-python", "category": "implementation", "start_line": 55, "end_line": 73, "span_ids": ["LoopNonlocalControl.gen_break", "LoopNonlocalControl.gen_continue", "LoopNonlocalControl.__init__", "LoopNonlocalControl.gen_return", "LoopNonlocalControl"], "tokens": 164}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LoopNonlocalControl(NonlocalControl):\n \"\"\"Nonlocal control within a loop.\"\"\"\n\n def __init__(self,\n outer: NonlocalControl,\n continue_block: BasicBlock,\n break_block: BasicBlock) -> None:\n self.outer = outer\n self.continue_block = continue_block\n self.break_block = break_block\n\n def gen_break(self, builder: 'IRBuilder', line: int) -> None:\n builder.add(Goto(self.break_block))\n\n def gen_continue(self, builder: 'IRBuilder', line: int) -> None:\n builder.add(Goto(self.continue_block))\n\n def gen_return(self, builder: 'IRBuilder', value: Value, line: int) -> None:\n self.outer.gen_return(builder, value, line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/nonlocalcontrol.py_GeneratorNonlocalControl_GeneratorNonlocalControl.gen_return.builder_builder_pop_error": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/nonlocalcontrol.py_GeneratorNonlocalControl_GeneratorNonlocalControl.gen_return.builder_builder_pop_error", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/nonlocalcontrol.py", "file_name": "nonlocalcontrol.py", "file_type": "text/x-python", "category": "implementation", "start_line": 77, "end_line": 105, "span_ids": ["GeneratorNonlocalControl.gen_return", "GeneratorNonlocalControl"], "tokens": 301}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GeneratorNonlocalControl(BaseNonlocalControl):\n \"\"\"Default nonlocal control in a generator function outside statements.\"\"\"\n\n def gen_return(self, builder: 'IRBuilder', value: Value, line: int) -> None:\n # Assign an invalid next label number so that the next time\n # __next__ is called, we jump to the case in which\n # StopIteration is raised.\n builder.assign(builder.fn_info.generator_class.next_label_target,\n Integer(-1),\n line)\n\n # Raise a StopIteration containing a field for the value that\n # should be returned. Before doing so, create a new block\n # without an error handler set so that the implicitly thrown\n # StopIteration isn't caught by except blocks inside of the\n # generator function.\n builder.builder.push_error_handler(None)\n builder.goto_and_activate(BasicBlock())\n\n # Skip creating a traceback frame when we raise here, because\n # we don't care about the traceback frame and it is kind of\n # expensive since raising StopIteration is an extremely common\n # case. Also we call a special internal function to set\n # StopIteration instead of using RaiseStandardError because\n # the obvious thing doesn't work if the value is a tuple\n # (???).\n builder.call_c(set_stop_iteration_value, [value], NO_TRACEBACK_LINE_NO)\n builder.add(Unreachable())\n builder.builder.pop_error_handler()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/nonlocalcontrol.py_CleanupNonlocalControl_CleanupNonlocalControl.gen_return.self_outer_gen_return_bui": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/nonlocalcontrol.py_CleanupNonlocalControl_CleanupNonlocalControl.gen_return.self_outer_gen_return_bui", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/nonlocalcontrol.py", "file_name": "nonlocalcontrol.py", "file_type": "text/x-python", "category": "implementation", "start_line": 107, "end_line": 126, "span_ids": ["CleanupNonlocalControl.gen_continue", "CleanupNonlocalControl.__init__", "CleanupNonlocalControl.gen_break", "CleanupNonlocalControl.gen_cleanup", "CleanupNonlocalControl.gen_return", "CleanupNonlocalControl"], "tokens": 183}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CleanupNonlocalControl(NonlocalControl):\n \"\"\"Abstract nonlocal control that runs some cleanup code. \"\"\"\n\n def __init__(self, outer: NonlocalControl) -> None:\n self.outer = outer\n\n @abstractmethod\n def gen_cleanup(self, builder: 'IRBuilder', line: int) -> None: ...\n\n def gen_break(self, builder: 'IRBuilder', line: int) -> None:\n self.gen_cleanup(builder, line)\n self.outer.gen_break(builder, line)\n\n def gen_continue(self, builder: 'IRBuilder', line: int) -> None:\n self.gen_cleanup(builder, line)\n self.outer.gen_continue(builder, line)\n\n def gen_return(self, builder: 'IRBuilder', value: Value, line: int) -> None:\n self.gen_cleanup(builder, line)\n self.outer.gen_return(builder, value, line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/nonlocalcontrol.py_TryFinallyNonlocalControl_TryFinallyNonlocalControl.gen_return.builder_add_Goto_self_tar": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/nonlocalcontrol.py_TryFinallyNonlocalControl_TryFinallyNonlocalControl.gen_return.builder_add_Goto_self_tar", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/nonlocalcontrol.py", "file_name": "nonlocalcontrol.py", "file_type": "text/x-python", "category": "implementation", "start_line": 130, "end_line": 148, "span_ids": ["TryFinallyNonlocalControl.__init__", "TryFinallyNonlocalControl.gen_continue", "TryFinallyNonlocalControl.gen_break", "TryFinallyNonlocalControl.gen_return", "TryFinallyNonlocalControl"], "tokens": 189}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TryFinallyNonlocalControl(NonlocalControl):\n \"\"\"Nonlocal control within try/finally.\"\"\"\n\n def __init__(self, target: BasicBlock) -> None:\n self.target = target\n self.ret_reg = None # type: Optional[Register]\n\n def gen_break(self, builder: 'IRBuilder', line: int) -> None:\n builder.error(\"break inside try/finally block is unimplemented\", line)\n\n def gen_continue(self, builder: 'IRBuilder', line: int) -> None:\n builder.error(\"continue inside try/finally block is unimplemented\", line)\n\n def gen_return(self, builder: 'IRBuilder', value: Value, line: int) -> None:\n if self.ret_reg is None:\n self.ret_reg = Register(builder.ret_types[-1])\n\n builder.add(Assign(self.ret_reg, value))\n builder.add(Goto(self.target))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/nonlocalcontrol.py_ExceptNonlocalControl_ExceptNonlocalControl.gen_cleanup.builder_call_c_restore_ex": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/nonlocalcontrol.py_ExceptNonlocalControl_ExceptNonlocalControl.gen_cleanup.builder_call_c_restore_ex", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/nonlocalcontrol.py", "file_name": "nonlocalcontrol.py", "file_type": "text/x-python", "category": "implementation", "start_line": 150, "end_line": 162, "span_ids": ["ExceptNonlocalControl.gen_cleanup", "ExceptNonlocalControl.__init__", "ExceptNonlocalControl"], "tokens": 118}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExceptNonlocalControl(CleanupNonlocalControl):\n \"\"\"Nonlocal control for except blocks.\n\n Just makes sure that sys.exc_info always gets restored when we leave.\n This is super annoying.\n \"\"\"\n\n def __init__(self, outer: NonlocalControl, saved: Union[Value, AssignmentTarget]) -> None:\n super().__init__(outer)\n self.saved = saved\n\n def gen_cleanup(self, builder: 'IRBuilder', line: int) -> None:\n builder.call_c(restore_exc_info_op, [builder.read(self.saved)], line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/nonlocalcontrol.py_FinallyNonlocalControl_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/nonlocalcontrol.py_FinallyNonlocalControl_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/nonlocalcontrol.py", "file_name": "nonlocalcontrol.py", "file_type": "text/x-python", "category": "implementation", "start_line": 165, "end_line": 192, "span_ids": ["FinallyNonlocalControl", "FinallyNonlocalControl.gen_cleanup", "FinallyNonlocalControl.__init__"], "tokens": 265}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FinallyNonlocalControl(CleanupNonlocalControl):\n \"\"\"Nonlocal control for finally blocks.\n\n Just makes sure that sys.exc_info always gets restored when we\n leave and the return register is decrefed if it isn't null.\n \"\"\"\n\n def __init__(self, outer: NonlocalControl, ret_reg: Optional[Value], saved: Value) -> None:\n super().__init__(outer)\n self.ret_reg = ret_reg\n self.saved = saved\n\n def gen_cleanup(self, builder: 'IRBuilder', line: int) -> None:\n # Do an error branch on the return value register, which\n # may be undefined. This will allow it to be properly\n # decrefed if it is not null. This is kind of a hack.\n if self.ret_reg:\n target = BasicBlock()\n builder.add(Branch(self.ret_reg, target, target, Branch.IS_ERROR))\n builder.activate_block(target)\n\n # Restore the old exc_info\n target, cleanup = BasicBlock(), BasicBlock()\n builder.add(Branch(self.saved, target, cleanup, Branch.IS_ERROR))\n builder.activate_block(cleanup)\n builder.call_c(restore_exc_info_op, [self.saved], line)\n builder.goto_and_activate(target)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/prebuildvisitor.py_from_typing_import_Dict__PreBuildVisitor.__init__._type_Dict_FuncDef_Lis": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/prebuildvisitor.py_from_typing_import_Dict__PreBuildVisitor.__init__._type_Dict_FuncDef_Lis", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/prebuildvisitor.py", "file_name": "prebuildvisitor.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 51, "span_ids": ["imports", "PreBuildVisitor.__init__", "PreBuildVisitor"], "tokens": 446}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from typing import Dict, List, Set\n\nfrom mypy.nodes import (\n Decorator, Expression, FuncDef, FuncItem, LambdaExpr, NameExpr, SymbolNode, Var, MemberExpr\n)\nfrom mypy.traverser import TraverserVisitor\n\n\nclass PreBuildVisitor(TraverserVisitor):\n \"\"\"Mypy file AST visitor run before building the IR.\n\n This collects various things, including:\n\n * Determine relationships between nested functions and functions that\n contain nested functions\n * Find non-local variables (free variables)\n * Find property setters\n * Find decorators of functions\n\n The main IR build pass uses this information.\n \"\"\"\n\n def __init__(self) -> None:\n super().__init__()\n # Dict from a function to symbols defined directly in the\n # function that are used as non-local (free) variables within a\n # nested function.\n self.free_variables = {} # type: Dict[FuncItem, Set[SymbolNode]]\n\n # Intermediate data structure used to find the function where\n # a SymbolNode is declared. Initially this may point to a\n # function nested inside the function with the declaration,\n # but we'll eventually update this to refer to the function\n # with the declaration.\n self.symbols_to_funcs = {} # type: Dict[SymbolNode, FuncItem]\n\n # Stack representing current function nesting.\n self.funcs = [] # type: List[FuncItem]\n\n # All property setters encountered so far.\n self.prop_setters = set() # type: Set[FuncDef]\n\n # A map from any function that contains nested functions to\n # a set of all the functions that are nested within it.\n self.encapsulating_funcs = {} # type: Dict[FuncItem, List[FuncItem]]\n\n # Map nested function to its parent/encapsulating function.\n self.nested_funcs = {} # type: Dict[FuncItem, FuncItem]\n\n # Map function to its non-special decorators.\n self.funcs_to_decorators = {} # type: Dict[FuncDef, List[Expression]]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/prebuildvisitor.py_PreBuildVisitor.visit_decorator_PreBuildVisitor.visit_decorator.super_visit_decorator_d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/prebuildvisitor.py_PreBuildVisitor.visit_decorator_PreBuildVisitor.visit_decorator.super_visit_decorator_d", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/prebuildvisitor.py", "file_name": "prebuildvisitor.py", "file_type": "text/x-python", "category": "implementation", "start_line": 53, "end_line": 67, "span_ids": ["PreBuildVisitor.visit_decorator"], "tokens": 180}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PreBuildVisitor(TraverserVisitor):\n\n def visit_decorator(self, dec: Decorator) -> None:\n if dec.decorators:\n # Only add the function being decorated if there exist\n # (ordinary) decorators in the decorator list. Certain\n # decorators (such as @property, @abstractmethod) are\n # special cased and removed from this list by\n # mypy. Functions decorated only by special decorators\n # (and property setters) are not treated as decorated\n # functions by the IR builder.\n if isinstance(dec.decorators[0], MemberExpr) and dec.decorators[0].name == 'setter':\n # Property setters are not treated as decorated methods.\n self.prop_setters.add(dec.func)\n else:\n self.funcs_to_decorators[dec.func] = dec.decorators\n super().visit_decorator(dec)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/prebuildvisitor.py_PreBuildVisitor.visit_func_def_PreBuildVisitor.visit_var.self_visit_symbol_node_va": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/prebuildvisitor.py_PreBuildVisitor.visit_func_def_PreBuildVisitor.visit_var.self_visit_symbol_node_va", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/prebuildvisitor.py", "file_name": "prebuildvisitor.py", "file_type": "text/x-python", "category": "implementation", "start_line": 69, "end_line": 98, "span_ids": ["PreBuildVisitor.visit_func_def", "PreBuildVisitor.visit_func", "PreBuildVisitor.visit_lambda_expr", "PreBuildVisitor.visit_name_expr", "PreBuildVisitor.visit_var"], "tokens": 283}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PreBuildVisitor(TraverserVisitor):\n\n def visit_func_def(self, fdef: FuncItem) -> None:\n # TODO: What about overloaded functions?\n self.visit_func(fdef)\n\n def visit_lambda_expr(self, expr: LambdaExpr) -> None:\n self.visit_func(expr)\n\n def visit_func(self, func: FuncItem) -> None:\n # If there were already functions or lambda expressions\n # defined in the function stack, then note the previous\n # FuncItem as containing a nested function and the current\n # FuncItem as being a nested function.\n if self.funcs:\n # Add the new func to the set of nested funcs within the\n # func at top of the func stack.\n self.encapsulating_funcs.setdefault(self.funcs[-1], []).append(func)\n # Add the func at top of the func stack as the parent of\n # new func.\n self.nested_funcs[func] = self.funcs[-1]\n\n self.funcs.append(func)\n super().visit_func(func)\n self.funcs.pop()\n\n def visit_name_expr(self, expr: NameExpr) -> None:\n if isinstance(expr.node, (Var, FuncDef)):\n self.visit_symbol_node(expr.node)\n\n def visit_var(self, var: Var) -> None:\n self.visit_symbol_node(var)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/prebuildvisitor.py_PreBuildVisitor.visit_symbol_node_PreBuildVisitor.visit_symbol_node.if_symbol_in_self_symbols.else_.self_symbols_to_funcs_sym": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/prebuildvisitor.py_PreBuildVisitor.visit_symbol_node_PreBuildVisitor.visit_symbol_node.if_symbol_in_self_symbols.else_.self_symbols_to_funcs_sym", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/prebuildvisitor.py", "file_name": "prebuildvisitor.py", "file_type": "text/x-python", "category": "implementation", "start_line": 100, "end_line": 127, "span_ids": ["PreBuildVisitor.visit_symbol_node"], "tokens": 291}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PreBuildVisitor(TraverserVisitor):\n\n def visit_symbol_node(self, symbol: SymbolNode) -> None:\n if not self.funcs:\n # We are not inside a function and hence do not need to do\n # anything regarding free variables.\n return\n\n if symbol in self.symbols_to_funcs:\n orig_func = self.symbols_to_funcs[symbol]\n if self.is_parent(self.funcs[-1], orig_func):\n # The function in which the symbol was previously seen is\n # nested within the function currently being visited. Thus\n # the current function is a better candidate to contain the\n # declaration.\n self.symbols_to_funcs[symbol] = self.funcs[-1]\n # TODO: Remove from the orig_func free_variables set?\n self.free_variables.setdefault(self.funcs[-1], set()).add(symbol)\n\n elif self.is_parent(orig_func, self.funcs[-1]):\n # The SymbolNode instance has already been visited\n # before in a parent function, thus it's a non-local\n # symbol.\n self.add_free_variable(symbol)\n\n else:\n # This is the first time the SymbolNode is being\n # visited. We map the SymbolNode to the current FuncDef\n # being visited to note where it was first visited.\n self.symbols_to_funcs[symbol] = self.funcs[-1]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/prebuildvisitor.py_PreBuildVisitor.is_parent_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/prebuildvisitor.py_PreBuildVisitor.is_parent_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/prebuildvisitor.py", "file_name": "prebuildvisitor.py", "file_type": "text/x-python", "category": "implementation", "start_line": 129, "end_line": 144, "span_ids": ["PreBuildVisitor.add_free_variable", "PreBuildVisitor.is_parent"], "tokens": 161}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PreBuildVisitor(TraverserVisitor):\n\n def is_parent(self, fitem: FuncItem, child: FuncItem) -> bool:\n # Check if child is nested within fdef (possibly indirectly\n # within multiple nested functions).\n if child in self.nested_funcs:\n parent = self.nested_funcs[child]\n if parent == fitem:\n return True\n return self.is_parent(fitem, parent)\n return False\n\n def add_free_variable(self, symbol: SymbolNode) -> None:\n # Find the function where the symbol was (likely) first declared,\n # and mark is as a non-local symbol within that function.\n func = self.symbols_to_funcs[symbol]\n self.free_variables.setdefault(func, set()).add(symbol)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/specialize.py__Special_case_IR_genera_translate_globals.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/specialize.py__Special_case_IR_genera_translate_globals.return.None", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/specialize.py", "file_name": "specialize.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 67, "span_ids": ["specialize_function", "translate_globals", "docstring"], "tokens": 616}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Special case IR generation of calls to specific builtin functions.\n\nMost special cases should be handled using the data driven \"primitive\nops\" system, but certain operations require special handling that has\naccess to the AST/IR directly and can make decisions/optimizations\nbased on it. These special cases can be implemented here.\n\nFor example, we use specializers to statically emit the length of a\nfixed length tuple and to emit optimized code for any()/all() calls with\ngenerator comprehensions as the argument.\n\nSee comment below for more documentation.\n\"\"\"\n\nfrom typing import Callable, Optional, Dict, Tuple\n\nfrom mypy.nodes import CallExpr, RefExpr, MemberExpr, TupleExpr, GeneratorExpr, ARG_POS\nfrom mypy.types import AnyType, TypeOfAny\n\nfrom mypyc.ir.ops import (\n Value, Register, BasicBlock, Integer, RaiseStandardError, Unreachable\n)\nfrom mypyc.ir.rtypes import (\n RType, RTuple, str_rprimitive, list_rprimitive, dict_rprimitive, set_rprimitive,\n bool_rprimitive, is_dict_rprimitive\n)\nfrom mypyc.primitives.dict_ops import dict_keys_op, dict_values_op, dict_items_op\nfrom mypyc.primitives.list_ops import new_list_set_item_op\nfrom mypyc.primitives.tuple_ops import new_tuple_set_item_op\nfrom mypyc.irbuild.builder import IRBuilder\nfrom mypyc.irbuild.for_helpers import (\n translate_list_comprehension, translate_set_comprehension,\n comprehension_helper, sequence_from_generator_preallocate_helper\n)\n\n\n# Specializers are attempted before compiling the arguments to the\n# function. Specializers can return None to indicate that they failed\n# and the call should be compiled normally. Otherwise they should emit\n# code for the call and return a Value containing the result.\n#\n# Specializers take three arguments: the IRBuilder, the CallExpr being\n# compiled, and the RefExpr that is the left hand side of the call.\nSpecializer = Callable[['IRBuilder', CallExpr, RefExpr], Optional[Value]]\n\n# Dictionary containing all configured specializers.\n#\n# Specializers can operate on methods as well, and are keyed on the\n# name and RType in that case.\nspecializers = {} # type: Dict[Tuple[str, Optional[RType]], Specializer]\n\n\ndef specialize_function(\n name: str, typ: Optional[RType] = None) -> Callable[[Specializer], Specializer]:\n \"\"\"Decorator to register a function as being a specializer.\"\"\"\n def wrapper(f: Specializer) -> Specializer:\n specializers[name, typ] = f\n return f\n return wrapper\n\n\n@specialize_function('builtins.globals')\ndef translate_globals(builder: IRBuilder, expr: CallExpr, callee: RefExpr) -> Optional[Value]:\n # Special case builtins.globals\n if len(expr.args) == 0:\n return builder.load_globals_dict()\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/specialize.py_translate_len_translate_len.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/specialize.py_translate_len_translate_len.return.None", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/specialize.py", "file_name": "specialize.py", "file_type": "text/x-python", "category": "implementation", "start_line": 65, "end_line": 80, "span_ids": ["translate_len"], "tokens": 156}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@specialize_function('builtins.len')\ndef translate_len(\n builder: IRBuilder, expr: CallExpr, callee: RefExpr) -> Optional[Value]:\n # Special case builtins.len\n if (len(expr.args) == 1\n and expr.arg_kinds == [ARG_POS]):\n expr_rtype = builder.node_type(expr.args[0])\n if isinstance(expr_rtype, RTuple):\n # len() of fixed-length tuple can be trivially determined statically,\n # though we still need to evaluate it.\n builder.accept(expr.args[0])\n return Integer(len(expr_rtype.types))\n else:\n obj = builder.accept(expr.args[0])\n return builder.builtin_len(obj, -1)\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/specialize.py_dict_methods_fast_path_dict_methods_fast_path.if_attr_keys_.else_.return.builder_call_c_dict_items": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/specialize.py_dict_methods_fast_path_dict_methods_fast_path.if_attr_keys_.else_.return.builder_call_c_dict_items", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/specialize.py", "file_name": "specialize.py", "file_type": "text/x-python", "category": "implementation", "start_line": 88, "end_line": 126, "span_ids": ["dict_methods_fast_path"], "tokens": 401}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@specialize_function('builtins.list')\ndef dict_methods_fast_path(\n builder: IRBuilder, expr: CallExpr, callee: RefExpr) -> Optional[Value]:\n # Specialize a common case when list() is called on a dictionary view\n # method call, for example foo = list(bar.keys()).\n if not (len(expr.args) == 1 and expr.arg_kinds == [ARG_POS]):\n return None\n arg = expr.args[0]\n\n # Special case for simplest list comprehension, for example\n # list(x for x in tmp_list)\n # TODO: The following code should be moved to a new function after\n # supporting multiple specialize functions\n if not isinstance(callee, MemberExpr) and isinstance(arg, GeneratorExpr):\n val = sequence_from_generator_preallocate_helper(\n builder, arg,\n empty_op_llbuilder=builder.builder.new_list_op_with_length,\n set_item_op=new_list_set_item_op)\n if val is not None:\n return val\n\n if not (isinstance(arg, CallExpr) and not arg.args\n and isinstance(arg.callee, MemberExpr)):\n return None\n base = arg.callee.expr\n attr = arg.callee.name\n rtype = builder.node_type(base)\n if not (is_dict_rprimitive(rtype) and attr in ('keys', 'values', 'items')):\n return None\n\n obj = builder.accept(base)\n # Note that it is not safe to use fast methods on dict subclasses, so\n # the corresponding helpers in CPy.h fallback to (inlined) generic logic.\n if attr == 'keys':\n return builder.call_c(dict_keys_op, [obj], expr.line)\n elif attr == 'values':\n return builder.call_c(dict_values_op, [obj], expr.line)\n else:\n return builder.call_c(dict_items_op, [obj], expr.line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/specialize.py_translate_safe_generator_call_translate_safe_generator_call.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/specialize.py_translate_safe_generator_call_translate_safe_generator_call.return.None", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/specialize.py", "file_name": "specialize.py", "file_type": "text/x-python", "category": "implementation", "start_line": 141, "end_line": 179, "span_ids": ["translate_safe_generator_call"], "tokens": 406}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@specialize_function('builtins.tuple')\n@specialize_function('builtins.frozenset')\n@specialize_function('builtins.dict')\n@specialize_function('builtins.sum')\n@specialize_function('builtins.min')\n@specialize_function('builtins.max')\n@specialize_function('builtins.sorted')\n@specialize_function('collections.OrderedDict')\n@specialize_function('join', str_rprimitive)\n@specialize_function('extend', list_rprimitive)\n@specialize_function('update', dict_rprimitive)\n@specialize_function('update', set_rprimitive)\ndef translate_safe_generator_call(\n builder: IRBuilder, expr: CallExpr, callee: RefExpr) -> Optional[Value]:\n # Special cases for things that consume iterators where we know we\n # can safely compile a generator into a list.\n if (len(expr.args) > 0\n and expr.arg_kinds[0] == ARG_POS\n and isinstance(expr.args[0], GeneratorExpr)):\n if isinstance(callee, MemberExpr):\n return builder.gen_method_call(\n builder.accept(callee.expr), callee.name,\n ([translate_list_comprehension(builder, expr.args[0])]\n + [builder.accept(arg) for arg in expr.args[1:]]),\n builder.node_type(expr), expr.line, expr.arg_kinds, expr.arg_names)\n else:\n if len(expr.args) == 1 and callee.fullname == \"builtins.tuple\":\n val = sequence_from_generator_preallocate_helper(\n builder, expr.args[0],\n empty_op_llbuilder=builder.builder.new_tuple_with_length,\n set_item_op=new_tuple_set_item_op)\n if val is not None:\n return val\n\n return builder.call_refexpr_with_args(\n expr, callee,\n ([translate_list_comprehension(builder, expr.args[0])]\n + [builder.accept(arg) for arg in expr.args[1:]]))\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/specialize.py_translate_any_call_translate_all_call.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/specialize.py_translate_any_call_translate_all_call.return.None", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/specialize.py", "file_name": "specialize.py", "file_type": "text/x-python", "category": "implementation", "start_line": 144, "end_line": 164, "span_ids": ["translate_all_call", "translate_any_call"], "tokens": 202}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@specialize_function('builtins.any')\ndef translate_any_call(builder: IRBuilder, expr: CallExpr, callee: RefExpr) -> Optional[Value]:\n if (len(expr.args) == 1\n and expr.arg_kinds == [ARG_POS]\n and isinstance(expr.args[0], GeneratorExpr)):\n return any_all_helper(builder, expr.args[0], builder.false, lambda x: x, builder.true)\n return None\n\n\n@specialize_function('builtins.all')\ndef translate_all_call(builder: IRBuilder, expr: CallExpr, callee: RefExpr) -> Optional[Value]:\n if (len(expr.args) == 1\n and expr.arg_kinds == [ARG_POS]\n and isinstance(expr.args[0], GeneratorExpr)):\n return any_all_helper(\n builder, expr.args[0],\n builder.true,\n lambda x: builder.unary_op(x, 'not', expr.line),\n builder.false\n )\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/specialize.py_any_all_helper_any_all_helper.return.retval": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/specialize.py_any_all_helper_any_all_helper.return.retval", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/specialize.py", "file_name": "specialize.py", "file_type": "text/x-python", "category": "implementation", "start_line": 168, "end_line": 189, "span_ids": ["any_all_helper"], "tokens": 192}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def any_all_helper(builder: IRBuilder,\n gen: GeneratorExpr,\n initial_value: Callable[[], Value],\n modify: Callable[[Value], Value],\n new_value: Callable[[], Value]) -> Value:\n retval = Register(bool_rprimitive)\n builder.assign(retval, initial_value(), -1)\n loop_params = list(zip(gen.indices, gen.sequences, gen.condlists))\n true_block, false_block, exit_block = BasicBlock(), BasicBlock(), BasicBlock()\n\n def gen_inner_stmts() -> None:\n comparison = modify(builder.accept(gen.left_expr))\n builder.add_bool_branch(comparison, true_block, false_block)\n builder.activate_block(true_block)\n builder.assign(retval, new_value(), -1)\n builder.goto(exit_block)\n builder.activate_block(false_block)\n\n comprehension_helper(builder, loop_params, gen_inner_stmts, gen.line)\n builder.goto_and_activate(exit_block)\n\n return retval", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/specialize.py_translate_dataclasses_field_call_translate_dataclasses_field_call.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/specialize.py_translate_dataclasses_field_call_translate_dataclasses_field_call.return.None", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/specialize.py", "file_name": "specialize.py", "file_type": "text/x-python", "category": "implementation", "start_line": 191, "end_line": 200, "span_ids": ["translate_dataclasses_field_call"], "tokens": 127}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@specialize_function('dataclasses.field')\n@specialize_function('attr.Factory')\ndef translate_dataclasses_field_call(\n builder: IRBuilder, expr: CallExpr, callee: RefExpr) -> Optional[Value]:\n # Special case for 'dataclasses.field' and 'attr.Factory' function calls\n # because the results of such calls are typechecked by mypy using the types\n # of the arguments to their respective functions, resulting in attempted\n # coercions by mypyc that throw a runtime error.\n builder.types[expr] = AnyType(TypeOfAny.from_error)\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/specialize.py_translate_next_call_translate_next_call.return.retval": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/specialize.py_translate_next_call_translate_next_call.return.retval", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/specialize.py", "file_name": "specialize.py", "file_type": "text/x-python", "category": "implementation", "start_line": 204, "end_line": 246, "span_ids": ["translate_next_call"], "tokens": 397}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@specialize_function('builtins.next')\ndef translate_next_call(builder: IRBuilder, expr: CallExpr, callee: RefExpr) -> Optional[Value]:\n # Special case for calling next() on a generator expression, an\n # idiom that shows up some in mypy.\n #\n # For example, next(x for x in l if x.id == 12, None) will\n # generate code that searches l for an element where x.id == 12\n # and produce the first such object, or None if no such element\n # exists.\n if not (expr.arg_kinds in ([ARG_POS], [ARG_POS, ARG_POS])\n and isinstance(expr.args[0], GeneratorExpr)):\n return None\n\n gen = expr.args[0]\n\n retval = Register(builder.node_type(expr))\n default_val = None\n if len(expr.args) > 1:\n default_val = builder.accept(expr.args[1])\n\n exit_block = BasicBlock()\n\n def gen_inner_stmts() -> None:\n # next takes the first element of the generator, so if\n # something gets produced, we are done.\n builder.assign(retval, builder.accept(gen.left_expr), gen.left_expr.line)\n builder.goto(exit_block)\n\n loop_params = list(zip(gen.indices, gen.sequences, gen.condlists))\n comprehension_helper(builder, loop_params, gen_inner_stmts, gen.line)\n\n # Now we need the case for when nothing got hit. If there was\n # a default value, we produce it, and otherwise we raise\n # StopIteration.\n if default_val:\n builder.assign(retval, default_val, gen.left_expr.line)\n builder.goto(exit_block)\n else:\n builder.add(RaiseStandardError(RaiseStandardError.STOP_ITERATION, None, expr.line))\n builder.add(Unreachable())\n\n builder.activate_block(exit_block)\n return retval", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/specialize.py_translate_isinstance_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/specialize.py_translate_isinstance_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/specialize.py", "file_name": "specialize.py", "file_type": "text/x-python", "category": "implementation", "start_line": 291, "end_line": 306, "span_ids": ["translate_isinstance"], "tokens": 192}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@specialize_function('builtins.isinstance')\ndef translate_isinstance(builder: IRBuilder, expr: CallExpr, callee: RefExpr) -> Optional[Value]:\n if (len(expr.args) == 2\n and expr.arg_kinds == [ARG_POS, ARG_POS]\n and isinstance(expr.args[1], (RefExpr, TupleExpr))):\n # Special case for builtins.isinstance\n # Prevent coercions on the thing we are checking the instance of - there is no need to\n # coerce something to a new type before checking what type it is, and the coercion could\n # lead to bugs.\n builder.types[expr.args[0]] = AnyType(TypeOfAny.from_error)\n\n irs = builder.flatten_classes(expr.args[1])\n if irs is not None:\n return builder.builder.isinstance_helper(builder.accept(expr.args[0]), irs, expr.line)\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py__Transform_mypy_stateme_GenFunc.Callable_None_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py__Transform_mypy_stateme_GenFunc.Callable_None_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/statement.py", "file_name": "statement.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 40, "span_ids": ["docstring"], "tokens": 387}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Transform mypy statement ASTs to mypyc IR (Intermediate Representation).\n\nThe top-level AST transformation logic is implemented in mypyc.irbuild.visitor\nand mypyc.irbuild.builder.\n\nA few statements are transformed in mypyc.irbuild.function (yield, for example).\n\"\"\"\n\nfrom typing import Optional, List, Tuple, Sequence, Callable\nimport importlib.util\n\nfrom mypy.nodes import (\n Block, ExpressionStmt, ReturnStmt, AssignmentStmt, OperatorAssignmentStmt, IfStmt, WhileStmt,\n ForStmt, BreakStmt, ContinueStmt, RaiseStmt, TryStmt, WithStmt, AssertStmt, DelStmt,\n Expression, StrExpr, TempNode, Lvalue, Import, ImportFrom, ImportAll, TupleExpr, ListExpr,\n StarExpr\n)\n\nfrom mypyc.ir.ops import (\n Assign, Unreachable, RaiseStandardError, LoadErrorValue, BasicBlock, TupleGet, Value, Register,\n Branch, NO_TRACEBACK_LINE_NO\n)\nfrom mypyc.ir.rtypes import exc_rtuple\nfrom mypyc.primitives.generic_ops import py_delattr_op\nfrom mypyc.primitives.misc_ops import type_op\nfrom mypyc.primitives.exc_ops import (\n raise_exception_op, reraise_exception_op, error_catch_op, exc_matches_op, restore_exc_info_op,\n get_exc_value_op, keep_propagating_op, get_exc_info_op\n)\nfrom mypyc.irbuild.targets import (\n AssignmentTarget, AssignmentTargetRegister, AssignmentTargetIndex, AssignmentTargetAttr,\n AssignmentTargetTuple\n)\nfrom mypyc.irbuild.nonlocalcontrol import (\n ExceptNonlocalControl, FinallyNonlocalControl, TryFinallyNonlocalControl\n)\nfrom mypyc.irbuild.for_helpers import for_loop_helper\nfrom mypyc.irbuild.builder import IRBuilder\n\nGenFunc = Callable[[], None]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_block_transform_block.if_not_block_is_unreachab.elif_block_body_.builder_add_Unreachable_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_block_transform_block.if_not_block_is_unreachab.elif_block_body_.builder_add_Unreachable_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/statement.py", "file_name": "statement.py", "file_type": "text/x-python", "category": "implementation", "start_line": 40, "end_line": 51, "span_ids": ["transform_block"], "tokens": 111}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def transform_block(builder: IRBuilder, block: Block) -> None:\n if not block.is_unreachable:\n for stmt in block.body:\n builder.accept(stmt)\n # Raise a RuntimeError if we hit a non-empty unreachable block.\n # Don't complain about empty unreachable blocks, since mypy inserts\n # those after `if MYPY`.\n elif block.body:\n builder.add(RaiseStandardError(RaiseStandardError.RUNTIME_ERROR,\n 'Reached allegedly unreachable code!',\n block.line))\n builder.add(Unreachable())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_expression_stmt_transform_return_stmt.builder_nonlocal_control_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_expression_stmt_transform_return_stmt.builder_nonlocal_control_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/statement.py", "file_name": "statement.py", "file_type": "text/x-python", "category": "implementation", "start_line": 54, "end_line": 68, "span_ids": ["transform_return_stmt", "transform_expression_stmt"], "tokens": 135}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def transform_expression_stmt(builder: IRBuilder, stmt: ExpressionStmt) -> None:\n if isinstance(stmt.expr, StrExpr):\n # Docstring. Ignore\n return\n # ExpressionStmts do not need to be coerced like other Expressions.\n stmt.expr.accept(builder.visitor)\n\n\ndef transform_return_stmt(builder: IRBuilder, stmt: ReturnStmt) -> None:\n if stmt.expr:\n retval = builder.accept(stmt.expr)\n else:\n retval = builder.builder.none()\n retval = builder.coerce(retval, builder.ret_types[-1], stmt.line)\n builder.nonlocal_control[-1].gen_return(builder, retval, stmt.line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_import_transform_import.for_node_id_as_name_in_n.builder_gen_method_call_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_import_transform_import.for_node_id_as_name_in_n.builder_gen_method_call_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/statement.py", "file_name": "statement.py", "file_type": "text/x-python", "category": "implementation", "start_line": 130, "end_line": 158, "span_ids": ["transform_import"], "tokens": 264}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def transform_import(builder: IRBuilder, node: Import) -> None:\n if node.is_mypy_only:\n return\n globals = builder.load_globals_dict()\n for node_id, as_name in node.ids:\n builder.gen_import(node_id, node.line)\n\n # Update the globals dict with the appropriate module:\n # * For 'import foo.bar as baz' we add 'foo.bar' with the name 'baz'\n # * For 'import foo.bar' we add 'foo' with the name 'foo'\n # Typically we then ignore these entries and access things directly\n # via the module static, but we will use the globals version for modules\n # that mypy couldn't find, since it doesn't analyze module references\n # from those properly.\n\n # TODO: Don't add local imports to the global namespace\n\n # Miscompiling imports inside of functions, like below in import from.\n if as_name:\n name = as_name\n base = node_id\n else:\n base = name = node_id.split('.')[0]\n\n obj = builder.get_module(base, node.line)\n\n builder.gen_method_call(\n globals, '__setitem__', [builder.load_str(name), obj],\n result_type=None, line=node.line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_import_from_transform_import_from.for_name_maybe_as_name_i.builder_gen_method_call_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_import_from_transform_import_from.for_name_maybe_as_name_i.builder_gen_method_call_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/statement.py", "file_name": "statement.py", "file_type": "text/x-python", "category": "implementation", "start_line": 166, "end_line": 197, "span_ids": ["transform_import_from"], "tokens": 301}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def transform_import_from(builder: IRBuilder, node: ImportFrom) -> None:\n if node.is_mypy_only:\n return\n\n module_state = builder.graph[builder.module_name]\n if module_state.ancestors is not None and module_state.ancestors:\n module_package = module_state.ancestors[0]\n else:\n module_package = ''\n\n id = importlib.util.resolve_name('.' * node.relative + node.id, module_package)\n\n builder.gen_import(id, node.line)\n module = builder.load_module(id)\n\n # Copy everything into our module's dict.\n # Note that we miscompile import from inside of functions here,\n # since that case *shouldn't* load it into the globals dict.\n # This probably doesn't matter much and the code runs basically right.\n globals = builder.load_globals_dict()\n for name, maybe_as_name in node.names:\n # If one of the things we are importing is a module,\n # import it as a module also.\n fullname = id + '.' + name\n if fullname in builder.graph or fullname in module_state.suppressed:\n builder.gen_import(fullname, node.line)\n\n as_name = maybe_as_name or name\n obj = builder.py_get_attr(module, name, node.line)\n builder.gen_method_call(\n globals, '__setitem__', [builder.load_str(as_name), obj],\n result_type=None, line=node.line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_import_all_transform_if_stmt.builder_activate_block_ne": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_import_all_transform_if_stmt.builder_activate_block_ne", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/statement.py", "file_name": "statement.py", "file_type": "text/x-python", "category": "implementation", "start_line": 184, "end_line": 205, "span_ids": ["transform_import_all", "transform_if_stmt"], "tokens": 169}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def transform_import_all(builder: IRBuilder, node: ImportAll) -> None:\n if node.is_mypy_only:\n return\n builder.gen_import(node.id, node.line)\n\n\ndef transform_if_stmt(builder: IRBuilder, stmt: IfStmt) -> None:\n if_body, next = BasicBlock(), BasicBlock()\n else_body = BasicBlock() if stmt.else_body else next\n\n # If statements are normalized\n assert len(stmt.expr) == 1\n\n builder.process_conditional(stmt.expr[0], if_body, else_body)\n builder.activate_block(if_body)\n builder.accept(stmt.body[0])\n builder.goto(next)\n if stmt.else_body:\n builder.activate_block(else_body)\n builder.accept(stmt.else_body)\n builder.goto(next)\n builder.activate_block(next)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_while_stmt_transform_while_stmt.builder_activate_block_ne": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_while_stmt_transform_while_stmt.builder_activate_block_ne", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/statement.py", "file_name": "statement.py", "file_type": "text/x-python", "category": "implementation", "start_line": 208, "end_line": 230, "span_ids": ["transform_while_stmt"], "tokens": 178}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def transform_while_stmt(builder: IRBuilder, s: WhileStmt) -> None:\n body, next, top, else_block = BasicBlock(), BasicBlock(), BasicBlock(), BasicBlock()\n normal_loop_exit = else_block if s.else_body is not None else next\n\n builder.push_loop_stack(top, next)\n\n # Split block so that we get a handle to the top of the loop.\n builder.goto_and_activate(top)\n builder.process_conditional(s.expr, body, normal_loop_exit)\n\n builder.activate_block(body)\n builder.accept(s.body)\n # Add branch to the top at the end of the body.\n builder.goto(top)\n\n builder.pop_loop_stack()\n\n if s.else_body is not None:\n builder.activate_block(else_block)\n builder.accept(s.else_body)\n builder.goto(next)\n\n builder.activate_block(next)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_for_stmt_transform_raise_stmt.builder_add_Unreachable_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_for_stmt_transform_raise_stmt.builder_add_Unreachable_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/statement.py", "file_name": "statement.py", "file_type": "text/x-python", "category": "implementation", "start_line": 233, "end_line": 261, "span_ids": ["transform_break_stmt", "transform_for_stmt", "transform_continue_stmt", "transform_raise_stmt"], "tokens": 227}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def transform_for_stmt(builder: IRBuilder, s: ForStmt) -> None:\n def body() -> None:\n builder.accept(s.body)\n\n def else_block() -> None:\n assert s.else_body is not None\n builder.accept(s.else_body)\n\n for_loop_helper(builder, s.index, s.expr, body,\n else_block if s.else_body else None, s.line)\n\n\ndef transform_break_stmt(builder: IRBuilder, node: BreakStmt) -> None:\n builder.nonlocal_control[-1].gen_break(builder, node.line)\n\n\ndef transform_continue_stmt(builder: IRBuilder, node: ContinueStmt) -> None:\n builder.nonlocal_control[-1].gen_continue(builder, node.line)\n\n\ndef transform_raise_stmt(builder: IRBuilder, s: RaiseStmt) -> None:\n if s.expr is None:\n builder.call_c(reraise_exception_op, [], NO_TRACEBACK_LINE_NO)\n builder.add(Unreachable())\n return\n\n exc = builder.accept(s.expr)\n builder.call_c(raise_exception_op, [exc], s.line)\n builder.add(Unreachable())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_try_except_transform_try_except.None_17": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_try_except_transform_try_except.None_17", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/statement.py", "file_name": "statement.py", "file_type": "text/x-python", "category": "implementation", "start_line": 264, "end_line": 351, "span_ids": ["transform_try_except"], "tokens": 748}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def transform_try_except(builder: IRBuilder,\n body: GenFunc,\n handlers: Sequence[\n Tuple[Optional[Expression], Optional[Expression], GenFunc]],\n else_body: Optional[GenFunc],\n line: int) -> None:\n \"\"\"Generalized try/except/else handling that takes functions to gen the bodies.\n\n The point of this is to also be able to support with.\"\"\"\n assert handlers, \"try needs except\"\n\n except_entry, exit_block, cleanup_block = BasicBlock(), BasicBlock(), BasicBlock()\n double_except_block = BasicBlock()\n # If there is an else block, jump there after the try, otherwise just leave\n else_block = BasicBlock() if else_body else exit_block\n\n # Compile the try block with an error handler\n builder.builder.push_error_handler(except_entry)\n builder.goto_and_activate(BasicBlock())\n body()\n builder.goto(else_block)\n builder.builder.pop_error_handler()\n\n # The error handler catches the error and then checks it\n # against the except clauses. We compile the error handler\n # itself with an error handler so that it can properly restore\n # the *old* exc_info if an exception occurs.\n # The exception chaining will be done automatically when the\n # exception is raised, based on the exception in exc_info.\n builder.builder.push_error_handler(double_except_block)\n builder.activate_block(except_entry)\n old_exc = builder.maybe_spill(builder.call_c(error_catch_op, [], line))\n # Compile the except blocks with the nonlocal control flow overridden to clear exc_info\n builder.nonlocal_control.append(\n ExceptNonlocalControl(builder.nonlocal_control[-1], old_exc))\n\n # Process the bodies\n for type, var, handler_body in handlers:\n next_block = None\n if type:\n next_block, body_block = BasicBlock(), BasicBlock()\n matches = builder.call_c(\n exc_matches_op, [builder.accept(type)], type.line\n )\n builder.add(Branch(matches, body_block, next_block, Branch.BOOL))\n builder.activate_block(body_block)\n if var:\n target = builder.get_assignment_target(var)\n builder.assign(\n target,\n builder.call_c(get_exc_value_op, [], var.line),\n var.line\n )\n handler_body()\n builder.goto(cleanup_block)\n if next_block:\n builder.activate_block(next_block)\n\n # Reraise the exception if needed\n if next_block:\n builder.call_c(reraise_exception_op, [], NO_TRACEBACK_LINE_NO)\n builder.add(Unreachable())\n\n builder.nonlocal_control.pop()\n builder.builder.pop_error_handler()\n\n # Cleanup for if we leave except through normal control flow:\n # restore the saved exc_info information and continue propagating\n # the exception if it exists.\n builder.activate_block(cleanup_block)\n builder.call_c(restore_exc_info_op, [builder.read(old_exc)], line)\n builder.goto(exit_block)\n\n # Cleanup for if we leave except through a raised exception:\n # restore the saved exc_info information and continue propagating\n # the exception.\n builder.activate_block(double_except_block)\n builder.call_c(restore_exc_info_op, [builder.read(old_exc)], line)\n builder.call_c(keep_propagating_op, [], NO_TRACEBACK_LINE_NO)\n builder.add(Unreachable())\n\n # If present, compile the else body in the obvious way\n if else_body:\n builder.activate_block(else_block)\n else_body()\n builder.goto(exit_block)\n\n builder.activate_block(exit_block)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_try_except_stmt_transform_try_except_stmt.transform_try_except_buil": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_try_except_stmt_transform_try_except_stmt.transform_try_except_buil", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/statement.py", "file_name": "statement.py", "file_type": "text/x-python", "category": "implementation", "start_line": 354, "end_line": 365, "span_ids": ["transform_try_except_stmt"], "tokens": 127}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def transform_try_except_stmt(builder: IRBuilder, t: TryStmt) -> None:\n def body() -> None:\n builder.accept(t.body)\n\n # Work around scoping woes\n def make_handler(body: Block) -> GenFunc:\n return lambda: builder.accept(body)\n\n handlers = [(type, var, make_handler(body))\n for type, var, body in zip(t.types, t.vars, t.handlers)]\n else_body = (lambda: builder.accept(t.else_body)) if t.else_body else None\n transform_try_except(builder, body, handlers, else_body, t.line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_try_finally_try_try_finally_try.return.control_ret_reg": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_try_finally_try_try_finally_try.return.control_ret_reg", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/statement.py", "file_name": "statement.py", "file_type": "text/x-python", "category": "implementation", "start_line": 368, "end_line": 384, "span_ids": ["try_finally_try"], "tokens": 120}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def try_finally_try(builder: IRBuilder,\n err_handler: BasicBlock,\n return_entry: BasicBlock,\n main_entry: BasicBlock,\n try_body: GenFunc) -> Optional[Register]:\n # Compile the try block with an error handler\n control = TryFinallyNonlocalControl(return_entry)\n builder.builder.push_error_handler(err_handler)\n\n builder.nonlocal_control.append(control)\n builder.goto_and_activate(BasicBlock())\n try_body()\n builder.goto(main_entry)\n builder.nonlocal_control.pop()\n builder.builder.pop_error_handler()\n\n return control.ret_reg", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_try_finally_entry_blocks_try_finally_entry_blocks.return.old_exc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_try_finally_entry_blocks_try_finally_entry_blocks.return.old_exc", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/statement.py", "file_name": "statement.py", "file_type": "text/x-python", "category": "implementation", "start_line": 403, "end_line": 438, "span_ids": ["try_finally_entry_blocks"], "tokens": 228}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def try_finally_entry_blocks(builder: IRBuilder,\n err_handler: BasicBlock,\n return_entry: BasicBlock,\n main_entry: BasicBlock,\n finally_block: BasicBlock,\n ret_reg: Optional[Register]) -> Value:\n old_exc = Register(exc_rtuple)\n\n # Entry block for non-exceptional flow\n builder.activate_block(main_entry)\n if ret_reg:\n builder.add(\n Assign(\n ret_reg,\n builder.add(LoadErrorValue(builder.ret_types[-1]))\n )\n )\n builder.goto(return_entry)\n\n builder.activate_block(return_entry)\n builder.add(Assign(old_exc, builder.add(LoadErrorValue(exc_rtuple))))\n builder.goto(finally_block)\n\n # Entry block for errors\n builder.activate_block(err_handler)\n if ret_reg:\n builder.add(\n Assign(\n ret_reg,\n builder.add(LoadErrorValue(builder.ret_types[-1]))\n )\n )\n builder.add(Assign(old_exc, builder.call_c(error_catch_op, [], -1)))\n builder.goto(finally_block)\n\n return old_exc", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_try_finally_body_try_finally_body.return.cleanup_block_finally_co": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_try_finally_body_try_finally_body.return.cleanup_block_finally_co", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/statement.py", "file_name": "statement.py", "file_type": "text/x-python", "category": "implementation", "start_line": 425, "end_line": 441, "span_ids": ["try_finally_body"], "tokens": 145}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def try_finally_body(\n builder: IRBuilder,\n finally_block: BasicBlock,\n finally_body: GenFunc,\n ret_reg: Optional[Value],\n old_exc: Value) -> Tuple[BasicBlock, FinallyNonlocalControl]:\n cleanup_block = BasicBlock()\n # Compile the finally block with the nonlocal control flow overridden to restore exc_info\n builder.builder.push_error_handler(cleanup_block)\n finally_control = FinallyNonlocalControl(\n builder.nonlocal_control[-1], ret_reg, old_exc)\n builder.nonlocal_control.append(finally_control)\n builder.activate_block(finally_block)\n finally_body()\n builder.nonlocal_control.pop()\n\n return cleanup_block, finally_control", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_try_finally_resolve_control_try_finally_resolve_control.return.out_block": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_try_finally_resolve_control_try_finally_resolve_control.return.out_block", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/statement.py", "file_name": "statement.py", "file_type": "text/x-python", "category": "implementation", "start_line": 444, "end_line": 483, "span_ids": ["try_finally_resolve_control"], "tokens": 330}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def try_finally_resolve_control(builder: IRBuilder,\n cleanup_block: BasicBlock,\n finally_control: FinallyNonlocalControl,\n old_exc: Value,\n ret_reg: Optional[Value]) -> BasicBlock:\n \"\"\"Resolve the control flow out of a finally block.\n\n This means returning if there was a return, propagating\n exceptions, break/continue (soon), or just continuing on.\n \"\"\"\n reraise, rest = BasicBlock(), BasicBlock()\n builder.add(Branch(old_exc, rest, reraise, Branch.IS_ERROR))\n\n # Reraise the exception if there was one\n builder.activate_block(reraise)\n builder.call_c(reraise_exception_op, [], NO_TRACEBACK_LINE_NO)\n builder.add(Unreachable())\n builder.builder.pop_error_handler()\n\n # If there was a return, keep returning\n if ret_reg:\n builder.activate_block(rest)\n return_block, rest = BasicBlock(), BasicBlock()\n builder.add(Branch(ret_reg, rest, return_block, Branch.IS_ERROR))\n\n builder.activate_block(return_block)\n builder.nonlocal_control[-1].gen_return(builder, ret_reg, -1)\n\n # TODO: handle break/continue\n builder.activate_block(rest)\n out_block = BasicBlock()\n builder.goto(out_block)\n\n # If there was an exception, restore again\n builder.activate_block(cleanup_block)\n finally_control.gen_cleanup(builder, -1)\n builder.call_c(keep_propagating_op, [], NO_TRACEBACK_LINE_NO)\n builder.add(Unreachable())\n\n return out_block", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_try_finally_stmt_transform_try_finally_stmt.builder_activate_block_ou": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_try_finally_stmt_transform_try_finally_stmt.builder_activate_block_ou", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/statement.py", "file_name": "statement.py", "file_type": "text/x-python", "category": "implementation", "start_line": 486, "end_line": 514, "span_ids": ["transform_try_finally_stmt"], "tokens": 271}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def transform_try_finally_stmt(builder: IRBuilder,\n try_body: GenFunc,\n finally_body: GenFunc) -> None:\n \"\"\"Generalized try/finally handling that takes functions to gen the bodies.\n\n The point of this is to also be able to support with.\"\"\"\n # Finally is a big pain, because there are so many ways that\n # exits can occur. We emit 10+ basic blocks for every finally!\n\n err_handler, main_entry, return_entry, finally_block = (\n BasicBlock(), BasicBlock(), BasicBlock(), BasicBlock())\n\n # Compile the body of the try\n ret_reg = try_finally_try(\n builder, err_handler, return_entry, main_entry, try_body)\n\n # Set up the entry blocks for the finally statement\n old_exc = try_finally_entry_blocks(\n builder, err_handler, return_entry, main_entry, finally_block, ret_reg)\n\n # Compile the body of the finally\n cleanup_block, finally_control = try_finally_body(\n builder, finally_block, finally_body, ret_reg, old_exc)\n\n # Resolve the control flow out of the finally block\n out_block = try_finally_resolve_control(\n builder, cleanup_block, finally_control, old_exc, ret_reg)\n\n builder.activate_block(out_block)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_try_stmt_get_sys_exc_info.return._builder_add_TupleGet_exc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_try_stmt_get_sys_exc_info.return._builder_add_TupleGet_exc", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/statement.py", "file_name": "statement.py", "file_type": "text/x-python", "category": "implementation", "start_line": 517, "end_line": 538, "span_ids": ["transform_try_stmt", "get_sys_exc_info"], "tokens": 224}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def transform_try_stmt(builder: IRBuilder, t: TryStmt) -> None:\n # Our compilation strategy for try/except/else/finally is to\n # treat try/except/else and try/finally as separate language\n # constructs that we compile separately. When we have a\n # try/except/else/finally, we treat the try/except/else as the\n # body of a try/finally block.\n if t.finally_body:\n def transform_try_body() -> None:\n if t.handlers:\n transform_try_except_stmt(builder, t)\n else:\n builder.accept(t.body)\n body = t.finally_body\n\n transform_try_finally_stmt(builder, transform_try_body, lambda: builder.accept(body))\n else:\n transform_try_except_stmt(builder, t)\n\n\ndef get_sys_exc_info(builder: IRBuilder) -> List[Value]:\n exc_info = builder.call_c(get_exc_info_op, [], -1)\n return [builder.add(TupleGet(exc_info, i, -1)) for i in range(3)]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_with_transform_with.try_body.body_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_with_transform_with.try_body.body_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/statement.py", "file_name": "statement.py", "file_type": "text/x-python", "category": "implementation", "start_line": 541, "end_line": 562, "span_ids": ["transform_with"], "tokens": 228}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def transform_with(builder: IRBuilder,\n expr: Expression,\n target: Optional[Lvalue],\n body: GenFunc,\n line: int) -> None:\n # This is basically a straight transcription of the Python code in PEP 343.\n # I don't actually understand why a bunch of it is the way it is.\n # We could probably optimize the case where the manager is compiled by us,\n # but that is not our common case at all, so.\n mgr_v = builder.accept(expr)\n typ = builder.call_c(type_op, [mgr_v], line)\n exit_ = builder.maybe_spill(builder.py_get_attr(typ, '__exit__', line))\n value = builder.py_call(\n builder.py_get_attr(typ, '__enter__', line), [mgr_v], line\n )\n mgr = builder.maybe_spill(mgr_v)\n exc = builder.maybe_spill_assignable(builder.true())\n\n def try_body() -> None:\n if target:\n builder.assign(builder.get_assignment_target(target), value, line)\n body()\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_with.except_body_transform_with.except_body.builder_activate_block_ou": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_with.except_body_transform_with.except_body.builder_activate_block_ou", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/statement.py", "file_name": "statement.py", "file_type": "text/x-python", "category": "implementation", "start_line": 564, "end_line": 576, "span_ids": ["transform_with"], "tokens": 160}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def transform_with(builder: IRBuilder,\n expr: Expression,\n target: Optional[Lvalue],\n body: GenFunc,\n line: int) -> None:\n # ... other code\n\n def except_body() -> None:\n builder.assign(exc, builder.false(), line)\n out_block, reraise_block = BasicBlock(), BasicBlock()\n builder.add_bool_branch(\n builder.py_call(builder.read(exit_),\n [builder.read(mgr)] + get_sys_exc_info(builder), line),\n out_block,\n reraise_block\n )\n builder.activate_block(reraise_block)\n builder.call_c(reraise_exception_op, [], NO_TRACEBACK_LINE_NO)\n builder.add(Unreachable())\n builder.activate_block(out_block)\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_with.finally_body_transform_with_stmt.generate_0_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_with.finally_body_transform_with_stmt.generate_0_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/statement.py", "file_name": "statement.py", "file_type": "text/x-python", "category": "implementation", "start_line": 578, "end_line": 609, "span_ids": ["transform_with", "transform_with_stmt"], "tokens": 262}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def transform_with(builder: IRBuilder,\n expr: Expression,\n target: Optional[Lvalue],\n body: GenFunc,\n line: int) -> None:\n # ... other code\n\n def finally_body() -> None:\n out_block, exit_block = BasicBlock(), BasicBlock()\n builder.add(\n Branch(builder.read(exc), exit_block, out_block, Branch.BOOL)\n )\n builder.activate_block(exit_block)\n none = builder.none_object()\n builder.py_call(\n builder.read(exit_), [builder.read(mgr), none, none, none], line\n )\n builder.goto_and_activate(out_block)\n\n transform_try_finally_stmt(\n builder,\n lambda: transform_try_except(builder,\n try_body,\n [(None, None, except_body)],\n None,\n line),\n finally_body\n )\n\n\ndef transform_with_stmt(builder: IRBuilder, o: WithStmt) -> None:\n # Generate separate logic for each expr in it, left to right\n def generate(i: int) -> None:\n if i >= len(o.expr):\n builder.accept(o.body)\n else:\n transform_with(builder, o.expr[i], o.target[i], lambda: generate(i + 1), o.line)\n\n generate(0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_assert_stmt_transform_assert_stmt.builder_activate_block_ok": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_assert_stmt_transform_assert_stmt.builder_activate_block_ok", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/statement.py", "file_name": "statement.py", "file_type": "text/x-python", "category": "implementation", "start_line": 612, "end_line": 633, "span_ids": ["transform_assert_stmt"], "tokens": 233}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def transform_assert_stmt(builder: IRBuilder, a: AssertStmt) -> None:\n if builder.options.strip_asserts:\n return\n cond = builder.accept(a.expr)\n ok_block, error_block = BasicBlock(), BasicBlock()\n builder.add_bool_branch(cond, ok_block, error_block)\n builder.activate_block(error_block)\n if a.msg is None:\n # Special case (for simpler generated code)\n builder.add(RaiseStandardError(RaiseStandardError.ASSERTION_ERROR, None, a.line))\n elif isinstance(a.msg, StrExpr):\n # Another special case\n builder.add(RaiseStandardError(RaiseStandardError.ASSERTION_ERROR, a.msg.value,\n a.line))\n else:\n # The general case -- explicitly construct an exception instance\n message = builder.accept(a.msg)\n exc_type = builder.load_module_attr_by_fullname('builtins.AssertionError', a.line)\n exc = builder.py_call(exc_type, [message], a.line)\n builder.call_c(raise_exception_op, [exc], a.line)\n builder.add(Unreachable())\n builder.activate_block(ok_block)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_del_stmt_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_del_stmt_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/statement.py", "file_name": "statement.py", "file_type": "text/x-python", "category": "implementation", "start_line": 652, "end_line": 676, "span_ids": ["transform_del_stmt", "transform_del_item"], "tokens": 216}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def transform_del_stmt(builder: IRBuilder, o: DelStmt) -> None:\n transform_del_item(builder, builder.get_assignment_target(o.expr), o.line)\n\n\ndef transform_del_item(builder: IRBuilder, target: AssignmentTarget, line: int) -> None:\n if isinstance(target, AssignmentTargetIndex):\n builder.gen_method_call(\n target.base,\n '__delitem__',\n [target.index],\n result_type=None,\n line=line\n )\n elif isinstance(target, AssignmentTargetAttr):\n key = builder.load_str(target.attr)\n builder.call_c(py_delattr_op, [target.obj, key], line)\n elif isinstance(target, AssignmentTargetRegister):\n # Delete a local by assigning an error value to it, which will\n # prompt the insertion of uninit checks.\n builder.add(Assign(target.register,\n builder.add(LoadErrorValue(target.type, undefines=True))))\n elif isinstance(target, AssignmentTargetTuple):\n for subtarget in target.items:\n transform_del_item(builder, subtarget, line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/util.py__Various_utilities_that_is_dataclass.return.any_is_dataclass_decorato": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/util.py__Various_utilities_that_is_dataclass.return.any_is_dataclass_decorato", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/util.py", "file_name": "util.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 32, "span_ids": ["is_trait_decorator", "is_dataclass_decorator", "is_dataclass", "docstring", "is_trait"], "tokens": 265}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Various utilities that don't depend on other modules in mypyc.irbuild.\"\"\"\n\nfrom typing import Dict, Any, Union, Optional\n\nfrom mypy.nodes import (\n ClassDef, FuncDef, Decorator, OverloadedFuncDef, StrExpr, CallExpr, RefExpr, Expression,\n IntExpr, FloatExpr, Var, TupleExpr, UnaryExpr, BytesExpr, ARG_NAMED, ARG_NAMED_OPT, ARG_POS,\n ARG_OPT, GDEF\n)\n\n\ndef is_trait_decorator(d: Expression) -> bool:\n return isinstance(d, RefExpr) and d.fullname == 'mypy_extensions.trait'\n\n\ndef is_trait(cdef: ClassDef) -> bool:\n return any(is_trait_decorator(d) for d in cdef.decorators) or cdef.info.is_protocol\n\n\ndef is_dataclass_decorator(d: Expression) -> bool:\n return (\n (isinstance(d, RefExpr) and d.fullname == 'dataclasses.dataclass')\n or (\n isinstance(d, CallExpr)\n and isinstance(d.callee, RefExpr)\n and d.callee.fullname == 'dataclasses.dataclass'\n )\n )\n\n\ndef is_dataclass(cdef: ClassDef) -> bool:\n return any(is_dataclass_decorator(d) for d in cdef.decorators)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/util.py_get_mypyc_attr_literal_get_mypyc_attr_call.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/util.py_get_mypyc_attr_literal_get_mypyc_attr_call.return.None", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/util.py", "file_name": "util.py", "file_type": "text/x-python", "category": "implementation", "start_line": 40, "end_line": 63, "span_ids": ["get_mypyc_attr_call", "get_mypyc_attr_literal"], "tokens": 210}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_mypyc_attr_literal(e: Expression) -> Any:\n \"\"\"Convert an expression from a mypyc_attr decorator to a value.\n\n Supports a pretty limited range.\"\"\"\n if isinstance(e, (StrExpr, IntExpr, FloatExpr)):\n return e.value\n elif isinstance(e, RefExpr) and e.fullname == 'builtins.True':\n return True\n elif isinstance(e, RefExpr) and e.fullname == 'builtins.False':\n return False\n elif isinstance(e, RefExpr) and e.fullname == 'builtins.None':\n return None\n return NotImplemented\n\n\ndef get_mypyc_attr_call(d: Expression) -> Optional[CallExpr]:\n \"\"\"Check if an expression is a call to mypyc_attr and return it if so.\"\"\"\n if (\n isinstance(d, CallExpr)\n and isinstance(d.callee, RefExpr)\n and d.callee.fullname == 'mypy_extensions.mypyc_attr'\n ):\n return d\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/util.py_get_mypyc_attrs_get_mypyc_attrs.return.attrs": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/util.py_get_mypyc_attrs_get_mypyc_attrs.return.attrs", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/util.py", "file_name": "util.py", "file_type": "text/x-python", "category": "implementation", "start_line": 66, "end_line": 79, "span_ids": ["get_mypyc_attrs"], "tokens": 130}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_mypyc_attrs(stmt: Union[ClassDef, Decorator]) -> Dict[str, Any]:\n \"\"\"Collect all the mypyc_attr attributes on a class definition or a function.\"\"\"\n attrs = {} # type: Dict[str, Any]\n for dec in stmt.decorators:\n d = get_mypyc_attr_call(dec)\n if d:\n for name, arg in zip(d.arg_names, d.args):\n if name is None:\n if isinstance(arg, StrExpr):\n attrs[arg.value] = True\n else:\n attrs[name] = get_mypyc_attr_literal(arg)\n\n return attrs", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/util.py_is_constant_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/util.py_is_constant_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/util.py", "file_name": "util.py", "file_type": "text/x-python", "category": "implementation", "start_line": 110, "end_line": 127, "span_ids": ["is_constant"], "tokens": 206}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_constant(e: Expression) -> bool:\n \"\"\"Check whether we allow an expression to appear as a default value.\n\n We don't currently properly support storing the evaluated\n values for default arguments and default attribute values, so\n we restrict what expressions we allow. We allow literals of\n primitives types, None, and references to Final global\n variables.\n \"\"\"\n return (isinstance(e, (StrExpr, BytesExpr, IntExpr, FloatExpr))\n or (isinstance(e, UnaryExpr) and e.op == '-'\n and isinstance(e.expr, (IntExpr, FloatExpr)))\n or (isinstance(e, TupleExpr)\n and all(is_constant(e) for e in e.items))\n or (isinstance(e, RefExpr) and e.kind == GDEF\n and (e.fullname in ('builtins.True', 'builtins.False', 'builtins.None')\n or (isinstance(e.node, Var) and e.node.is_final))))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/visitor.py__Dispatcher_used_when_t_from_mypyc_irbuild_expres": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/visitor.py__Dispatcher_used_when_t_from_mypyc_irbuild_expres", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/visitor.py", "file_name": "visitor.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 80, "span_ids": ["imports:8", "docstring"], "tokens": 625}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Dispatcher used when transforming a mypy AST to the IR form.\n\nmypyc.irbuild.builder and mypyc.irbuild.main are closely related.\n\"\"\"\n\nfrom typing_extensions import NoReturn\n\nfrom mypy.nodes import (\n MypyFile, FuncDef, ReturnStmt, AssignmentStmt, OpExpr,\n IntExpr, NameExpr, Var, IfStmt, UnaryExpr, ComparisonExpr, WhileStmt, CallExpr,\n IndexExpr, Block, ListExpr, ExpressionStmt, MemberExpr, ForStmt,\n BreakStmt, ContinueStmt, ConditionalExpr, OperatorAssignmentStmt, TupleExpr, ClassDef,\n Import, ImportFrom, ImportAll, DictExpr, StrExpr, CastExpr, TempNode,\n PassStmt, PromoteExpr, AssignmentExpr, AwaitExpr, BackquoteExpr, AssertStmt, BytesExpr,\n ComplexExpr, Decorator, DelStmt, DictionaryComprehension, EllipsisExpr, EnumCallExpr, ExecStmt,\n FloatExpr, GeneratorExpr, GlobalDecl, LambdaExpr, ListComprehension, SetComprehension,\n NamedTupleExpr, NewTypeExpr, NonlocalDecl, OverloadedFuncDef, PrintStmt, RaiseStmt,\n RevealExpr, SetExpr, SliceExpr, StarExpr, SuperExpr, TryStmt, TypeAliasExpr, TypeApplication,\n TypeVarExpr, TypedDictExpr, UnicodeExpr, WithStmt, YieldFromExpr, YieldExpr, ParamSpecExpr\n)\n\nfrom mypyc.ir.ops import Value\nfrom mypyc.irbuild.builder import IRVisitor, IRBuilder, UnsupportedException\nfrom mypyc.irbuild.classdef import transform_class_def\nfrom mypyc.irbuild.function import (\n transform_func_def,\n transform_overloaded_func_def,\n transform_decorator,\n transform_lambda_expr,\n transform_yield_expr,\n transform_yield_from_expr,\n transform_await_expr,\n)\nfrom mypyc.irbuild.statement import (\n transform_block,\n transform_expression_stmt,\n transform_return_stmt,\n transform_assignment_stmt,\n transform_operator_assignment_stmt,\n transform_import,\n transform_import_from,\n transform_import_all,\n transform_if_stmt,\n transform_while_stmt,\n transform_for_stmt,\n transform_break_stmt,\n transform_continue_stmt,\n transform_raise_stmt,\n transform_try_stmt,\n transform_with_stmt,\n transform_assert_stmt,\n transform_del_stmt,\n)\nfrom mypyc.irbuild.expression import (\n transform_name_expr,\n transform_member_expr,\n transform_super_expr,\n transform_call_expr,\n transform_unary_expr,\n transform_op_expr,\n transform_index_expr,\n transform_conditional_expr,\n transform_int_expr,\n transform_float_expr,\n transform_complex_expr,\n transform_comparison_expr,\n transform_str_expr,\n transform_bytes_expr,\n transform_ellipsis,\n transform_list_expr,\n transform_tuple_expr,\n transform_dict_expr,\n transform_set_expr,\n transform_list_comprehension,\n transform_set_comprehension,\n transform_dictionary_comprehension,\n transform_slice_expr,\n transform_generator_expr,\n transform_assignment_expr,\n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/visitor.py_IRBuilderVisitor_IRBuilderVisitor.visit_name_expr.return.transform_name_expr_self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/visitor.py_IRBuilderVisitor_IRBuilderVisitor.visit_name_expr.return.transform_name_expr_self_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/visitor.py", "file_name": "visitor.py", "file_type": "text/x-python", "category": "implementation", "start_line": 82, "end_line": 184, "span_ids": ["IRBuilderVisitor.visit_del_stmt", "IRBuilderVisitor.visit_with_stmt", "IRBuilderVisitor.visit_return_stmt", "IRBuilderVisitor.visit_assert_stmt", "IRBuilderVisitor.visit_raise_stmt", "IRBuilderVisitor", "IRBuilderVisitor.visit_try_stmt", "IRBuilderVisitor.visit_pass_stmt", "IRBuilderVisitor.visit_expression_stmt", "IRBuilderVisitor.visit_class_def", "IRBuilderVisitor.visit_import_from", "IRBuilderVisitor.visit_block", "IRBuilderVisitor.visit_global_decl", "IRBuilderVisitor.visit_decorator", "IRBuilderVisitor.visit_overloaded_func_def", "IRBuilderVisitor.visit_import", "IRBuilderVisitor.visit_while_stmt", "IRBuilderVisitor.visit_for_stmt", "IRBuilderVisitor.visit_nonlocal_decl", "IRBuilderVisitor.visit_operator_assignment_stmt", "IRBuilderVisitor.visit_func_def", "IRBuilderVisitor.visit_name_expr", "IRBuilderVisitor.visit_assignment_stmt", "IRBuilderVisitor.visit_continue_stmt", "IRBuilderVisitor.visit_if_stmt", "IRBuilderVisitor.visit_import_all", "IRBuilderVisitor.visit_mypy_file", "IRBuilderVisitor.visit_break_stmt"], "tokens": 802}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRBuilderVisitor(IRVisitor):\n \"\"\"Mypy node visitor that dispatches to node transform implementations.\n\n This class should have no non-trivial logic.\n\n This visitor is separated from the rest of code to improve modularity and\n to avoid import cycles.\n\n This is based on the visitor pattern\n (https://en.wikipedia.org/wiki/Visitor_pattern).\n \"\"\"\n\n # This gets passed to all the implementations and contains all the\n # state and many helpers. The attribute is initialized outside\n # this class since this class and IRBuilder form a reference loop.\n builder = None # type: IRBuilder\n\n def visit_mypy_file(self, mypyfile: MypyFile) -> None:\n assert False, \"use transform_mypy_file instead\"\n\n def visit_class_def(self, cdef: ClassDef) -> None:\n transform_class_def(self.builder, cdef)\n\n def visit_import(self, node: Import) -> None:\n transform_import(self.builder, node)\n\n def visit_import_from(self, node: ImportFrom) -> None:\n transform_import_from(self.builder, node)\n\n def visit_import_all(self, node: ImportAll) -> None:\n transform_import_all(self.builder, node)\n\n def visit_func_def(self, fdef: FuncDef) -> None:\n transform_func_def(self.builder, fdef)\n\n def visit_overloaded_func_def(self, o: OverloadedFuncDef) -> None:\n transform_overloaded_func_def(self.builder, o)\n\n def visit_decorator(self, dec: Decorator) -> None:\n transform_decorator(self.builder, dec)\n\n def visit_block(self, block: Block) -> None:\n transform_block(self.builder, block)\n\n # Statements\n\n def visit_expression_stmt(self, stmt: ExpressionStmt) -> None:\n transform_expression_stmt(self.builder, stmt)\n\n def visit_return_stmt(self, stmt: ReturnStmt) -> None:\n transform_return_stmt(self.builder, stmt)\n\n def visit_assignment_stmt(self, stmt: AssignmentStmt) -> None:\n transform_assignment_stmt(self.builder, stmt)\n\n def visit_operator_assignment_stmt(self, stmt: OperatorAssignmentStmt) -> None:\n transform_operator_assignment_stmt(self.builder, stmt)\n\n def visit_if_stmt(self, stmt: IfStmt) -> None:\n transform_if_stmt(self.builder, stmt)\n\n def visit_while_stmt(self, stmt: WhileStmt) -> None:\n transform_while_stmt(self.builder, stmt)\n\n def visit_for_stmt(self, stmt: ForStmt) -> None:\n transform_for_stmt(self.builder, stmt)\n\n def visit_break_stmt(self, stmt: BreakStmt) -> None:\n transform_break_stmt(self.builder, stmt)\n\n def visit_continue_stmt(self, stmt: ContinueStmt) -> None:\n transform_continue_stmt(self.builder, stmt)\n\n def visit_raise_stmt(self, stmt: RaiseStmt) -> None:\n transform_raise_stmt(self.builder, stmt)\n\n def visit_try_stmt(self, stmt: TryStmt) -> None:\n transform_try_stmt(self.builder, stmt)\n\n def visit_with_stmt(self, stmt: WithStmt) -> None:\n transform_with_stmt(self.builder, stmt)\n\n def visit_pass_stmt(self, stmt: PassStmt) -> None:\n pass\n\n def visit_assert_stmt(self, stmt: AssertStmt) -> None:\n transform_assert_stmt(self.builder, stmt)\n\n def visit_del_stmt(self, stmt: DelStmt) -> None:\n transform_del_stmt(self.builder, stmt)\n\n def visit_global_decl(self, stmt: GlobalDecl) -> None:\n # Pure declaration -- no runtime effect\n pass\n\n def visit_nonlocal_decl(self, stmt: NonlocalDecl) -> None:\n # Pure declaration -- no runtime effect\n pass\n\n # Expressions\n\n def visit_name_expr(self, expr: NameExpr) -> Value:\n return transform_name_expr(self.builder, expr)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/visitor.py_IRBuilderVisitor.visit_member_expr_IRBuilderVisitor.visit_backquote_expr.self_bail_Python_2_featu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/visitor.py_IRBuilderVisitor.visit_member_expr_IRBuilderVisitor.visit_backquote_expr.self_bail_Python_2_featu", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/visitor.py", "file_name": "visitor.py", "file_type": "text/x-python", "category": "implementation", "start_line": 187, "end_line": 274, "span_ids": ["IRBuilderVisitor.visit_call_expr", "IRBuilderVisitor.visit_slice_expr", "IRBuilderVisitor.visit_dictionary_comprehension", "IRBuilderVisitor.visit_conditional_expr", "IRBuilderVisitor.visit_index_expr", "IRBuilderVisitor.visit_list_expr", "IRBuilderVisitor.visit_str_expr", "IRBuilderVisitor.visit_comparison_expr", "IRBuilderVisitor.visit_ellipsis", "IRBuilderVisitor.visit_set_expr", "IRBuilderVisitor.visit_yield_expr", "IRBuilderVisitor.visit_int_expr", "IRBuilderVisitor.visit_generator_expr", "IRBuilderVisitor.visit_complex_expr", "IRBuilderVisitor.visit_set_comprehension", "IRBuilderVisitor.visit_lambda_expr", "IRBuilderVisitor.visit_bytes_expr", "IRBuilderVisitor.visit_dict_expr", "IRBuilderVisitor.visit_tuple_expr", "IRBuilderVisitor.visit_member_expr", "IRBuilderVisitor.visit_list_comprehension", "IRBuilderVisitor.visit_unary_expr", "IRBuilderVisitor.visit_float_expr", "IRBuilderVisitor.visit_backquote_expr", "IRBuilderVisitor.visit_super_expr", "IRBuilderVisitor.visit_op_expr", "IRBuilderVisitor.visit_await_expr", "IRBuilderVisitor.visit_yield_from_expr", "IRBuilderVisitor.visit_assignment_expr"], "tokens": 784}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRBuilderVisitor(IRVisitor):\n\n def visit_member_expr(self, expr: MemberExpr) -> Value:\n return transform_member_expr(self.builder, expr)\n\n def visit_super_expr(self, expr: SuperExpr) -> Value:\n return transform_super_expr(self.builder, expr)\n\n def visit_call_expr(self, expr: CallExpr) -> Value:\n return transform_call_expr(self.builder, expr)\n\n def visit_unary_expr(self, expr: UnaryExpr) -> Value:\n return transform_unary_expr(self.builder, expr)\n\n def visit_op_expr(self, expr: OpExpr) -> Value:\n return transform_op_expr(self.builder, expr)\n\n def visit_index_expr(self, expr: IndexExpr) -> Value:\n return transform_index_expr(self.builder, expr)\n\n def visit_conditional_expr(self, expr: ConditionalExpr) -> Value:\n return transform_conditional_expr(self.builder, expr)\n\n def visit_comparison_expr(self, expr: ComparisonExpr) -> Value:\n return transform_comparison_expr(self.builder, expr)\n\n def visit_int_expr(self, expr: IntExpr) -> Value:\n return transform_int_expr(self.builder, expr)\n\n def visit_float_expr(self, expr: FloatExpr) -> Value:\n return transform_float_expr(self.builder, expr)\n\n def visit_complex_expr(self, expr: ComplexExpr) -> Value:\n return transform_complex_expr(self.builder, expr)\n\n def visit_str_expr(self, expr: StrExpr) -> Value:\n return transform_str_expr(self.builder, expr)\n\n def visit_bytes_expr(self, expr: BytesExpr) -> Value:\n return transform_bytes_expr(self.builder, expr)\n\n def visit_ellipsis(self, expr: EllipsisExpr) -> Value:\n return transform_ellipsis(self.builder, expr)\n\n def visit_list_expr(self, expr: ListExpr) -> Value:\n return transform_list_expr(self.builder, expr)\n\n def visit_tuple_expr(self, expr: TupleExpr) -> Value:\n return transform_tuple_expr(self.builder, expr)\n\n def visit_dict_expr(self, expr: DictExpr) -> Value:\n return transform_dict_expr(self.builder, expr)\n\n def visit_set_expr(self, expr: SetExpr) -> Value:\n return transform_set_expr(self.builder, expr)\n\n def visit_list_comprehension(self, expr: ListComprehension) -> Value:\n return transform_list_comprehension(self.builder, expr)\n\n def visit_set_comprehension(self, expr: SetComprehension) -> Value:\n return transform_set_comprehension(self.builder, expr)\n\n def visit_dictionary_comprehension(self, expr: DictionaryComprehension) -> Value:\n return transform_dictionary_comprehension(self.builder, expr)\n\n def visit_slice_expr(self, expr: SliceExpr) -> Value:\n return transform_slice_expr(self.builder, expr)\n\n def visit_generator_expr(self, expr: GeneratorExpr) -> Value:\n return transform_generator_expr(self.builder, expr)\n\n def visit_lambda_expr(self, expr: LambdaExpr) -> Value:\n return transform_lambda_expr(self.builder, expr)\n\n def visit_yield_expr(self, expr: YieldExpr) -> Value:\n return transform_yield_expr(self.builder, expr)\n\n def visit_yield_from_expr(self, o: YieldFromExpr) -> Value:\n return transform_yield_from_expr(self.builder, o)\n\n def visit_await_expr(self, o: AwaitExpr) -> Value:\n return transform_await_expr(self.builder, o)\n\n def visit_assignment_expr(self, o: AssignmentExpr) -> Value:\n return transform_assignment_expr(self.builder, o)\n\n # Unimplemented constructs that shouldn't come up because they are py2 only\n\n def visit_backquote_expr(self, o: BackquoteExpr) -> Value:\n self.bail(\"Python 2 features are unsupported\", o.line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/visitor.py_IRBuilderVisitor.visit_exec_stmt_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/visitor.py_IRBuilderVisitor.visit_exec_stmt_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/visitor.py", "file_name": "visitor.py", "file_type": "text/x-python", "category": "implementation", "start_line": 277, "end_line": 341, "span_ids": ["IRBuilderVisitor.visit_reveal_expr", "IRBuilderVisitor.bail", "IRBuilderVisitor.visit_enum_call_expr", "IRBuilderVisitor.visit_paramspec_expr", "IRBuilderVisitor.visit_namedtuple_expr", "IRBuilderVisitor.visit_cast_expr", "IRBuilderVisitor.visit__promote_expr", "IRBuilderVisitor.visit_print_stmt", "IRBuilderVisitor.visit_type_application", "IRBuilderVisitor.visit_unicode_expr", "IRBuilderVisitor.visit_temp_node", "IRBuilderVisitor.visit_newtype_expr", "IRBuilderVisitor.visit_exec_stmt", "IRBuilderVisitor.visit_typeddict_expr", "IRBuilderVisitor.visit_star_expr", "IRBuilderVisitor.visit_var", "IRBuilderVisitor.visit_type_var_expr", "IRBuilderVisitor.visit_type_alias_expr"], "tokens": 604}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRBuilderVisitor(IRVisitor):\n\n def visit_exec_stmt(self, o: ExecStmt) -> None:\n self.bail(\"Python 2 features are unsupported\", o.line)\n\n def visit_print_stmt(self, o: PrintStmt) -> None:\n self.bail(\"Python 2 features are unsupported\", o.line)\n\n def visit_unicode_expr(self, o: UnicodeExpr) -> Value:\n self.bail(\"Python 2 features are unsupported\", o.line)\n\n # Constructs that shouldn't ever show up\n\n def visit_enum_call_expr(self, o: EnumCallExpr) -> Value:\n assert False, \"can't compile analysis-only expressions\"\n\n def visit__promote_expr(self, o: PromoteExpr) -> Value:\n assert False, \"can't compile analysis-only expressions\"\n\n def visit_namedtuple_expr(self, o: NamedTupleExpr) -> Value:\n assert False, \"can't compile analysis-only expressions\"\n\n def visit_newtype_expr(self, o: NewTypeExpr) -> Value:\n assert False, \"can't compile analysis-only expressions\"\n\n def visit_temp_node(self, o: TempNode) -> Value:\n assert False, \"can't compile analysis-only expressions\"\n\n def visit_type_alias_expr(self, o: TypeAliasExpr) -> Value:\n assert False, \"can't compile analysis-only expressions\"\n\n def visit_type_application(self, o: TypeApplication) -> Value:\n assert False, \"can't compile analysis-only expressions\"\n\n def visit_type_var_expr(self, o: TypeVarExpr) -> Value:\n assert False, \"can't compile analysis-only expressions\"\n\n def visit_paramspec_expr(self, o: ParamSpecExpr) -> Value:\n assert False, \"can't compile analysis-only expressions\"\n\n def visit_typeddict_expr(self, o: TypedDictExpr) -> Value:\n assert False, \"can't compile analysis-only expressions\"\n\n def visit_reveal_expr(self, o: RevealExpr) -> Value:\n assert False, \"can't compile analysis-only expressions\"\n\n def visit_var(self, o: Var) -> None:\n assert False, \"can't compile Var; should have been handled already?\"\n\n def visit_cast_expr(self, o: CastExpr) -> Value:\n assert False, \"CastExpr should have been handled in CallExpr\"\n\n def visit_star_expr(self, o: StarExpr) -> Value:\n assert False, \"should have been handled in Tuple/List/Set/DictExpr or CallExpr\"\n\n # Helpers\n\n def bail(self, msg: str, line: int) -> NoReturn:\n \"\"\"Reports an error and aborts compilation up until the last accept() call\n\n (accept() catches the UnsupportedException and keeps on\n processing. This allows errors to be non-blocking without always\n needing to write handling for them.\n \"\"\"\n self.builder.error(msg, line)\n raise UnsupportedException()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/vtable.py__Compute_vtables_of_nat_compute_vtable.if_not_cls_is_trait_.for_trait_in_all_traits_.cls_trait_vtables_trait_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/vtable.py__Compute_vtables_of_nat_compute_vtable.if_not_cls_is_trait_.for_trait_in_all_traits_.cls_trait_vtables_trait_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/vtable.py", "file_name": "vtable.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 51, "span_ids": ["compute_vtable", "docstring"], "tokens": 447}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Compute vtables of native (extension) classes.\"\"\"\n\nimport itertools\n\nfrom mypyc.ir.class_ir import ClassIR, VTableEntries, VTableMethod\nfrom mypyc.sametype import is_same_method_signature\n\n\ndef compute_vtable(cls: ClassIR) -> None:\n \"\"\"Compute the vtable structure for a class.\"\"\"\n if cls.vtable is not None: return\n\n if not cls.is_generated:\n cls.has_dict = any(x.inherits_python for x in cls.mro)\n\n for t in cls.mro[1:]:\n # Make sure all ancestors are processed first\n compute_vtable(t)\n # Merge attributes from traits into the class\n if not t.is_trait:\n continue\n for name, typ in t.attributes.items():\n if not cls.is_trait and not any(name in b.attributes for b in cls.base_mro):\n cls.attributes[name] = typ\n\n cls.vtable = {}\n if cls.base:\n assert cls.base.vtable is not None\n cls.vtable.update(cls.base.vtable)\n cls.vtable_entries = specialize_parent_vtable(cls, cls.base)\n\n # Include the vtable from the parent classes, but handle method overrides.\n entries = cls.vtable_entries\n\n all_traits = [t for t in cls.mro if t.is_trait]\n\n for t in [cls] + cls.traits:\n for fn in itertools.chain(t.methods.values()):\n # TODO: don't generate a new entry when we overload without changing the type\n if fn == cls.get_method(fn.name):\n cls.vtable[fn.name] = len(entries)\n # If the class contains a glue method referring to itself, that is a\n # shadow glue method to support interpreted subclasses.\n shadow = cls.glue_methods.get((cls, fn.name))\n entries.append(VTableMethod(t, fn.name, fn, shadow))\n\n # Compute vtables for all of the traits that the class implements\n if not cls.is_trait:\n for trait in all_traits:\n compute_vtable(trait)\n cls.trait_vtables[trait] = specialize_parent_vtable(cls, trait)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/vtable.py_specialize_parent_vtable_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/vtable.py_specialize_parent_vtable_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/vtable.py", "file_name": "vtable.py", "file_type": "text/x-python", "category": "implementation", "start_line": 54, "end_line": 75, "span_ids": ["specialize_parent_vtable"], "tokens": 229}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def specialize_parent_vtable(cls: ClassIR, parent: ClassIR) -> VTableEntries:\n \"\"\"Generate the part of a vtable corresponding to a parent class or trait\"\"\"\n updated = []\n for entry in parent.vtable_entries:\n # Find the original method corresponding to this vtable entry.\n # (This may not be the method in the entry, if it was overridden.)\n orig_parent_method = entry.cls.get_method(entry.name)\n assert orig_parent_method\n method_cls = cls.get_method_and_class(entry.name)\n if method_cls:\n child_method, defining_cls = method_cls\n # TODO: emit a wrapper for __init__ that raises or something\n if (is_same_method_signature(orig_parent_method.sig, child_method.sig)\n or orig_parent_method.name == '__init__'):\n entry = VTableMethod(entry.cls, entry.name, child_method, entry.shadow_method)\n else:\n entry = VTableMethod(entry.cls, entry.name,\n defining_cls.glue_methods[(entry.cls, entry.name)],\n entry.shadow_method)\n updated.append(entry)\n return updated", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/lib-rt/setup.py__Build_script_for_mypyc_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/lib-rt/setup.py__Build_script_for_mypyc_", "embedding": null, "metadata": {"file_path": "mypyc/lib-rt/setup.py", "file_name": "setup.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 28, "span_ids": ["docstring"], "tokens": 228}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Build script for mypyc C runtime library unit tests.\n\nThe tests are written in C++ and use the Google Test framework.\n\"\"\"\n\nfrom distutils.core import setup, Extension\nimport sys\n\nif sys.platform == 'darwin':\n kwargs = {'language': 'c++'}\n compile_args = []\nelse:\n kwargs = {} # type: ignore\n compile_args = ['--std=c++11']\n\nsetup(name='test_capi',\n version='0.1',\n ext_modules=[Extension(\n 'test_capi',\n ['test_capi.cc', 'init.c', 'int_ops.c', 'list_ops.c', 'exc_ops.c', 'generic_ops.c'],\n depends=['CPy.h', 'mypyc_util.h', 'pythonsupport.h'],\n extra_compile_args=['-Wno-unused-function', '-Wno-sign-compare'] + compile_args,\n library_dirs=['../external/googletest/make'],\n libraries=['gtest'],\n include_dirs=['../external/googletest', '../external/googletest/include'],\n **kwargs\n )])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/namegen.py_from_typing_import_List__NameGenerator.__init__._type_Set_str_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/namegen.py_from_typing_import_List__NameGenerator.__init__._type_Set_str_", "embedding": null, "metadata": {"file_path": "mypyc/namegen.py", "file_name": "namegen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 50, "span_ids": ["NameGenerator.__init__", "imports", "NameGenerator"], "tokens": 492}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from typing import List, Dict, Tuple, Set, Optional, Iterable\n\n\nclass NameGenerator:\n \"\"\"Utility for generating distinct C names from Python names.\n\n Since C names can't use '.' (or unicode), some care is required to\n make C names generated from Python names unique. Also, we want to\n avoid generating overly long C names since they make the generated\n code harder to read.\n\n Note that we don't restrict ourselves to a 32-character distinguishing\n prefix guaranteed by the C standard since all the compilers we care\n about at the moment support longer names without issues.\n\n For names that are exported in a shared library (not static) use\n exported_name() instead.\n\n Summary of the approach:\n\n * Generate a unique name prefix from suffix of fully-qualified\n module name used for static names. If only compiling a single\n module, this can be empty. For example, if the modules are\n 'foo.bar' and 'foo.baz', the prefixes can be 'bar_' and 'baz_',\n respectively. If the modules are 'bar.foo' and 'baz.foo', the\n prefixes will be 'bar_foo_' and 'baz_foo_'.\n\n * Replace '.' in the Python name with '___' in the C name. (And\n replace the unlikely but possible '___' with '___3_'. This\n collides '___' with '.3_', but this is OK because names\n may not start with a digit.)\n\n The generated should be internal to a build and thus the mapping is\n arbitrary. Just generating names '1', '2', ... would be correct,\n though not very usable.\n \"\"\"\n\n def __init__(self, groups: Iterable[List[str]]) -> None:\n \"\"\"Initialize with a list of modules in each compilation group.\n\n The names of modules are used to shorten names referring to\n modules, for convenience. Arbitrary module\n names are supported for generated names, but uncompiled modules\n will use long names.\n \"\"\"\n self.module_map = {} # type: Dict[str, str]\n for names in groups:\n self.module_map.update(make_module_translation_map(names))\n self.translations = {} # type: Dict[Tuple[str, str], str]\n self.used_names = set() # type: Set[str]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/namegen.py_NameGenerator.private_name_NameGenerator.private_name.return.actual": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/namegen.py_NameGenerator.private_name_NameGenerator.private_name.return.actual", "embedding": null, "metadata": {"file_path": "mypyc/namegen.py", "file_name": "namegen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 52, "end_line": 78, "span_ids": ["NameGenerator.private_name"], "tokens": 242}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class NameGenerator:\n\n def private_name(self, module: str, partial_name: Optional[str] = None) -> str:\n \"\"\"Return a C name usable for a static definition.\n\n Return a distinct result for each (module, partial_name) pair.\n\n The caller should add a suitable prefix to the name to avoid\n conflicts with other C names. Only ensure that the results of\n this function are unique, not that they aren't overlapping with\n arbitrary names.\n\n If a name is not specific to any module, the module argument can\n be an empty string.\n \"\"\"\n # TODO: Support unicode\n if partial_name is None:\n return exported_name(self.module_map[module].rstrip('.'))\n if (module, partial_name) in self.translations:\n return self.translations[module, partial_name]\n if module in self.module_map:\n module_prefix = self.module_map[module]\n elif module:\n module_prefix = module + '.'\n else:\n module_prefix = ''\n actual = exported_name('{}{}'.format(module_prefix, partial_name))\n self.translations[module, partial_name] = actual\n return actual", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/namegen.py_exported_name_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/namegen.py_exported_name_", "embedding": null, "metadata": {"file_path": "mypyc/namegen.py", "file_name": "namegen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 81, "end_line": 114, "span_ids": ["candidate_suffixes", "make_module_translation_map", "exported_name"], "tokens": 249}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def exported_name(fullname: str) -> str:\n \"\"\"Return a C name usable for an exported definition.\n\n This is like private_name(), but the output only depends on the\n 'fullname' argument, so the names are distinct across multiple\n builds.\n \"\"\"\n # TODO: Support unicode\n return fullname.replace('___', '___3_').replace('.', '___')\n\n\ndef make_module_translation_map(names: List[str]) -> Dict[str, str]:\n num_instances = {} # type: Dict[str, int]\n for name in names:\n for suffix in candidate_suffixes(name):\n num_instances[suffix] = num_instances.get(suffix, 0) + 1\n result = {}\n for name in names:\n for suffix in candidate_suffixes(name):\n if num_instances[suffix] == 1:\n result[name] = suffix\n break\n else:\n assert False, names\n return result\n\n\ndef candidate_suffixes(fullname: str) -> List[str]:\n components = fullname.split('.')\n result = ['']\n for i in range(len(components)):\n result.append('.'.join(components[-i - 1:]) + '.')\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/options.py_from_typing_import_Option_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/options.py_from_typing_import_Option_", "embedding": null, "metadata": {"file_path": "mypyc/options.py", "file_name": "options.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 28, "span_ids": ["imports", "CompilerOptions", "CompilerOptions.__init__"], "tokens": 230}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from typing import Optional, Tuple\nimport sys\n\n\nclass CompilerOptions:\n def __init__(self,\n strip_asserts: bool = False,\n multi_file: bool = False,\n verbose: bool = False,\n separate: bool = False,\n target_dir: Optional[str] = None,\n include_runtime_files: Optional[bool] = None,\n capi_version: Optional[Tuple[int, int]] = None) -> None:\n self.strip_asserts = strip_asserts\n self.multi_file = multi_file\n self.verbose = verbose\n self.separate = separate\n self.global_opts = not separate\n self.target_dir = target_dir or 'build'\n self.include_runtime_files = (\n include_runtime_files if include_runtime_files is not None else not multi_file\n )\n # The target Python C API version. Overriding this is mostly\n # useful in IR tests, since there's no guarantee that\n # binaries are backward compatible even if no recent API\n # features are used.\n self.capi_version = capi_version or sys.version_info[:2]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/exc_ops.py__Exception_related_prim_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/exc_ops.py__Exception_related_prim_", "embedding": null, "metadata": {"file_path": "mypyc/primitives/exc_ops.py", "file_name": "exc_ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 97, "span_ids": ["docstring:12", "docstring"], "tokens": 797}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Exception-related primitive ops.\"\"\"\n\nfrom mypyc.ir.ops import ERR_NEVER, ERR_FALSE, ERR_ALWAYS\nfrom mypyc.ir.rtypes import object_rprimitive, void_rtype, exc_rtuple, bit_rprimitive\nfrom mypyc.primitives.registry import custom_op\n\n# If the argument is a class, raise an instance of the class. Otherwise, assume\n# that the argument is an exception object, and raise it.\nraise_exception_op = custom_op(\n arg_types=[object_rprimitive],\n return_type=void_rtype,\n c_function_name='CPy_Raise',\n error_kind=ERR_ALWAYS)\n\n# Raise StopIteration exception with the specified value (which can be NULL).\nset_stop_iteration_value = custom_op(\n arg_types=[object_rprimitive],\n return_type=void_rtype,\n c_function_name='CPyGen_SetStopIterationValue',\n error_kind=ERR_ALWAYS)\n\n# Raise exception with traceback.\n# Arguments are (exception type, exception value, traceback).\nraise_exception_with_tb_op = custom_op(\n arg_types=[object_rprimitive, object_rprimitive, object_rprimitive],\n return_type=void_rtype,\n c_function_name='CPyErr_SetObjectAndTraceback',\n error_kind=ERR_ALWAYS)\n\n# Reraise the currently raised exception.\nreraise_exception_op = custom_op(\n arg_types=[],\n return_type=void_rtype,\n c_function_name='CPy_Reraise',\n error_kind=ERR_ALWAYS)\n\n# Propagate exception if the CPython error indicator is set (an exception was raised).\nno_err_occurred_op = custom_op(\n arg_types=[],\n return_type=bit_rprimitive,\n c_function_name='CPy_NoErrOccured',\n error_kind=ERR_FALSE)\n\nerr_occurred_op = custom_op(\n arg_types=[],\n return_type=object_rprimitive,\n c_function_name='PyErr_Occurred',\n error_kind=ERR_NEVER,\n is_borrowed=True)\n\n# Keep propagating a raised exception by unconditionally giving an error value.\n# This doesn't actually raise an exception.\nkeep_propagating_op = custom_op(\n arg_types=[],\n return_type=bit_rprimitive,\n c_function_name='CPy_KeepPropagating',\n error_kind=ERR_FALSE)\n\n# Catches a propagating exception and makes it the \"currently\n# handled exception\" (by sticking it into sys.exc_info()). Returns the\n# exception that was previously being handled, which must be restored\n# later.\nerror_catch_op = custom_op(\n arg_types=[],\n return_type=exc_rtuple,\n c_function_name='CPy_CatchError',\n error_kind=ERR_NEVER)\n\n# Restore an old \"currently handled exception\" returned from.\n# error_catch (by sticking it into sys.exc_info())\nrestore_exc_info_op = custom_op(\n arg_types=[exc_rtuple],\n return_type=void_rtype,\n c_function_name='CPy_RestoreExcInfo',\n error_kind=ERR_NEVER)\n\n# Checks whether the exception currently being handled matches a particular type.\nexc_matches_op = custom_op(\n arg_types=[object_rprimitive],\n return_type=bit_rprimitive,\n c_function_name='CPy_ExceptionMatches',\n error_kind=ERR_NEVER)\n\n# Get the value of the exception currently being handled.\nget_exc_value_op = custom_op(\n arg_types=[],\n return_type=object_rprimitive,\n c_function_name='CPy_GetExcValue',\n error_kind=ERR_NEVER)\n\n# Get exception info (exception type, exception instance, traceback object).\nget_exc_info_op = custom_op(\n arg_types=[],\n return_type=exc_rtuple,\n c_function_name='CPy_GetExcInfo',\n error_kind=ERR_NEVER)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/misc_ops.py__Miscellaneous_primitiv__Arguments_are_metaclas": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/misc_ops.py__Miscellaneous_primitiv__Arguments_are_metaclas", "embedding": null, "metadata": {"file_path": "mypyc/primitives/misc_ops.py", "file_name": "misc_ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 94, "span_ids": ["docstring:15", "docstring"], "tokens": 795}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Miscellaneous primitive ops.\"\"\"\n\nfrom mypyc.ir.ops import ERR_NEVER, ERR_MAGIC, ERR_FALSE\nfrom mypyc.ir.rtypes import (\n bool_rprimitive, object_rprimitive, str_rprimitive, object_pointer_rprimitive,\n int_rprimitive, dict_rprimitive, c_int_rprimitive, bit_rprimitive, c_pyssize_t_rprimitive\n)\nfrom mypyc.primitives.registry import (\n function_op, custom_op, load_address_op, ERR_NEG_INT\n)\n\n# Get the 'bool' type object.\nload_address_op(\n name='builtins.bool',\n type=object_rprimitive,\n src='PyBool_Type')\n\n# Get the boxed Python 'None' object\nnone_object_op = load_address_op(\n name='Py_None',\n type=object_rprimitive,\n src='_Py_NoneStruct')\n\n# Get the boxed object '...'\nellipsis_op = load_address_op(\n name='...',\n type=object_rprimitive,\n src='_Py_EllipsisObject')\n\n# Get the boxed NotImplemented object\nnot_implemented_op = load_address_op(\n name='builtins.NotImplemented',\n type=object_rprimitive,\n src='_Py_NotImplementedStruct')\n\n# id(obj)\nfunction_op(\n name='builtins.id',\n arg_types=[object_rprimitive],\n return_type=int_rprimitive,\n c_function_name='CPyTagged_Id',\n error_kind=ERR_NEVER)\n\n# Return the result of obj.__await()__ or obj.__iter__() (if no __await__ exists)\ncoro_op = custom_op(\n arg_types=[object_rprimitive],\n return_type=object_rprimitive,\n c_function_name='CPy_GetCoro',\n error_kind=ERR_MAGIC)\n\n# Do obj.send(value), or a next(obj) if second arg is None.\n# (This behavior is to match the PEP 380 spec for yield from.)\n# Like next_raw_op, don't swallow StopIteration,\n# but also don't propagate an error.\n# Can return NULL: see next_op.\nsend_op = custom_op(\n arg_types=[object_rprimitive, object_rprimitive],\n return_type=object_rprimitive,\n c_function_name='CPyIter_Send',\n error_kind=ERR_NEVER)\n\n# This is sort of unfortunate but oh well: yield_from_except performs most of the\n# error handling logic in `yield from` operations. It returns a bool and passes\n# a value by address.\n# If the bool is true, then a StopIteration was received and we should return.\n# If the bool is false, then the value should be yielded.\n# The normal case is probably that it signals an exception, which gets\n# propagated.\n# Op used for \"yield from\" error handling.\n# See comment in CPy_YieldFromErrorHandle for more information.\nyield_from_except_op = custom_op(\n arg_types=[object_rprimitive, object_pointer_rprimitive],\n return_type=bool_rprimitive,\n c_function_name='CPy_YieldFromErrorHandle',\n error_kind=ERR_MAGIC)\n\n# Create method object from a callable object and self.\nmethod_new_op = custom_op(\n arg_types=[object_rprimitive, object_rprimitive],\n return_type=object_rprimitive,\n c_function_name='PyMethod_New',\n error_kind=ERR_MAGIC)\n\n# Check if the current exception is a StopIteration and return its value if so.\n# Treats \"no exception\" as StopIteration with a None value.\n# If it is a different exception, re-reraise it.\ncheck_stop_op = custom_op(\n arg_types=[],\n return_type=object_rprimitive,\n c_function_name='CPy_FetchStopIterationValue',\n error_kind=ERR_MAGIC)\n\n# Determine the most derived metaclass and check for metaclass conflicts.\n# Arguments are (metaclass, bases).", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/misc_ops.py_py_calc_meta_op_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/misc_ops.py_py_calc_meta_op_", "embedding": null, "metadata": {"file_path": "mypyc/primitives/misc_ops.py", "file_name": "misc_ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 95, "end_line": 192, "span_ids": ["impl:41", "impl:25", "docstring:15"], "tokens": 758}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "py_calc_meta_op = custom_op(\n arg_types=[object_rprimitive, object_rprimitive],\n return_type=object_rprimitive,\n c_function_name='CPy_CalculateMetaclass',\n error_kind=ERR_MAGIC,\n is_borrowed=True\n)\n\n# Import a module\nimport_op = custom_op(\n arg_types=[str_rprimitive],\n return_type=object_rprimitive,\n c_function_name='PyImport_Import',\n error_kind=ERR_MAGIC)\n\n# Get the sys.modules dictionary\nget_module_dict_op = custom_op(\n arg_types=[],\n return_type=dict_rprimitive,\n c_function_name='PyImport_GetModuleDict',\n error_kind=ERR_NEVER,\n is_borrowed=True)\n\n# isinstance(obj, cls)\nfunction_op(\n name='builtins.isinstance',\n arg_types=[object_rprimitive, object_rprimitive],\n return_type=c_int_rprimitive,\n c_function_name='PyObject_IsInstance',\n error_kind=ERR_NEG_INT,\n truncated_type=bool_rprimitive\n)\n\n# Faster isinstance(obj, cls) that only works with native classes and doesn't perform\n# type checking of the type argument.\nfast_isinstance_op = function_op(\n 'builtins.isinstance',\n arg_types=[object_rprimitive, object_rprimitive],\n return_type=bool_rprimitive,\n c_function_name='CPy_TypeCheck',\n error_kind=ERR_NEVER,\n priority=0)\n\n# bool(obj) with unboxed result\nbool_op = function_op(\n name='builtins.bool',\n arg_types=[object_rprimitive],\n return_type=c_int_rprimitive,\n c_function_name='PyObject_IsTrue',\n error_kind=ERR_NEG_INT,\n truncated_type=bool_rprimitive)\n\n# slice(start, stop, step)\nnew_slice_op = function_op(\n name='builtins.slice',\n arg_types=[object_rprimitive, object_rprimitive, object_rprimitive],\n c_function_name='PySlice_New',\n return_type=object_rprimitive,\n error_kind=ERR_MAGIC)\n\n# type(obj)\ntype_op = function_op(\n name='builtins.type',\n arg_types=[object_rprimitive],\n c_function_name='PyObject_Type',\n return_type=object_rprimitive,\n error_kind=ERR_NEVER)\n\n# Get 'builtins.type' (base class of all classes)\ntype_object_op = load_address_op(\n name='builtins.type',\n type=object_rprimitive,\n src='PyType_Type')\n\n# Create a heap type based on a template non-heap type.\n# See CPyType_FromTemplate for more docs.\npytype_from_template_op = custom_op(\n arg_types=[object_rprimitive, object_rprimitive, str_rprimitive],\n return_type=object_rprimitive,\n c_function_name='CPyType_FromTemplate',\n error_kind=ERR_MAGIC)\n\n# Create a dataclass from an extension class. See\n# CPyDataclass_SleightOfHand for more docs.\ndataclass_sleight_of_hand = custom_op(\n arg_types=[object_rprimitive, object_rprimitive, dict_rprimitive, dict_rprimitive],\n return_type=bit_rprimitive,\n c_function_name='CPyDataclass_SleightOfHand',\n error_kind=ERR_FALSE)\n\n# Raise ValueError if length of first argument is not equal to the second argument.\n# The first argument must be a list or a variable-length tuple.\ncheck_unpack_count_op = custom_op(\n arg_types=[object_rprimitive, c_pyssize_t_rprimitive],\n return_type=c_int_rprimitive,\n c_function_name='CPySequence_CheckUnpackCount',\n error_kind=ERR_NEG_INT)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/set_ops.py__Primitive_set_and_fro_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/set_ops.py__Primitive_set_and_fro_", "embedding": null, "metadata": {"file_path": "mypyc/primitives/set_ops.py", "file_name": "set_ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 95, "span_ids": ["docstring:12", "docstring"], "tokens": 621}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Primitive set (and frozenset) ops.\"\"\"\n\nfrom mypyc.primitives.registry import function_op, method_op, binary_op, ERR_NEG_INT\nfrom mypyc.ir.ops import ERR_MAGIC, ERR_FALSE\nfrom mypyc.ir.rtypes import (\n object_rprimitive, bool_rprimitive, set_rprimitive, c_int_rprimitive, pointer_rprimitive,\n bit_rprimitive\n)\n\n\n# Construct an empty set.\nnew_set_op = function_op(\n name='builtins.set',\n arg_types=[],\n return_type=set_rprimitive,\n c_function_name='PySet_New',\n error_kind=ERR_MAGIC,\n extra_int_constants=[(0, pointer_rprimitive)])\n\n# set(obj)\nfunction_op(\n name='builtins.set',\n arg_types=[object_rprimitive],\n return_type=set_rprimitive,\n c_function_name='PySet_New',\n error_kind=ERR_MAGIC)\n\n# frozenset(obj)\nfunction_op(\n name='builtins.frozenset',\n arg_types=[object_rprimitive],\n return_type=object_rprimitive,\n c_function_name='PyFrozenSet_New',\n error_kind=ERR_MAGIC)\n\n# item in set\nbinary_op(\n name='in',\n arg_types=[object_rprimitive, set_rprimitive],\n return_type=c_int_rprimitive,\n c_function_name='PySet_Contains',\n error_kind=ERR_NEG_INT,\n truncated_type=bool_rprimitive,\n ordering=[1, 0])\n\n# set.remove(obj)\nmethod_op(\n name='remove',\n arg_types=[set_rprimitive, object_rprimitive],\n return_type=bit_rprimitive,\n c_function_name='CPySet_Remove',\n error_kind=ERR_FALSE)\n\n# set.discard(obj)\nmethod_op(\n name='discard',\n arg_types=[set_rprimitive, object_rprimitive],\n return_type=c_int_rprimitive,\n c_function_name='PySet_Discard',\n error_kind=ERR_NEG_INT)\n\n# set.add(obj)\nset_add_op = method_op(\n name='add',\n arg_types=[set_rprimitive, object_rprimitive],\n return_type=c_int_rprimitive,\n c_function_name='PySet_Add',\n error_kind=ERR_NEG_INT)\n\n# set.update(obj)\n#\n# This is not a public API but looks like it should be fine.\nset_update_op = method_op(\n name='update',\n arg_types=[set_rprimitive, object_rprimitive],\n return_type=c_int_rprimitive,\n c_function_name='_PySet_Update',\n error_kind=ERR_NEG_INT)\n\n# set.clear()\nmethod_op(\n name='clear',\n arg_types=[set_rprimitive],\n return_type=c_int_rprimitive,\n c_function_name='PySet_Clear',\n error_kind=ERR_NEG_INT)\n\n# set.pop()\nmethod_op(\n name='pop',\n arg_types=[set_rprimitive],\n return_type=object_rprimitive,\n c_function_name='PySet_Pop',\n error_kind=ERR_MAGIC)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/tuple_ops.py__Primitive_tuple_ops_fo_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/tuple_ops.py__Primitive_tuple_ops_fo_", "embedding": null, "metadata": {"file_path": "mypyc/primitives/tuple_ops.py", "file_name": "tuple_ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 69, "span_ids": ["docstring"], "tokens": 543}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Primitive tuple ops for *variable-length* tuples.\n\nNote: Varying-length tuples are represented as boxed Python tuple\nobjects, i.e. tuple_rprimitive (RPrimitive), not RTuple.\n\"\"\"\n\nfrom mypyc.ir.ops import ERR_MAGIC, ERR_FALSE\nfrom mypyc.ir.rtypes import (\n tuple_rprimitive, int_rprimitive, list_rprimitive, object_rprimitive,\n c_pyssize_t_rprimitive, bit_rprimitive\n)\nfrom mypyc.primitives.registry import method_op, function_op, custom_op\n\n\n# tuple[index] (for an int index)\ntuple_get_item_op = method_op(\n name='__getitem__',\n arg_types=[tuple_rprimitive, int_rprimitive],\n return_type=object_rprimitive,\n c_function_name='CPySequenceTuple_GetItem',\n error_kind=ERR_MAGIC)\n\n# Construct a boxed tuple from items: (item1, item2, ...)\nnew_tuple_op = custom_op(\n arg_types=[c_pyssize_t_rprimitive],\n return_type=tuple_rprimitive,\n c_function_name='PyTuple_Pack',\n error_kind=ERR_MAGIC,\n var_arg_type=object_rprimitive)\n\nnew_tuple_with_length_op = custom_op(\n arg_types=[c_pyssize_t_rprimitive],\n return_type=tuple_rprimitive,\n c_function_name='PyTuple_New',\n error_kind=ERR_MAGIC)\n\n# PyTuple_SET_ITEM does no error checking,\n# and should only be used to fill in brand new tuples.\nnew_tuple_set_item_op = custom_op(\n arg_types=[tuple_rprimitive, int_rprimitive, object_rprimitive],\n return_type=bit_rprimitive,\n c_function_name='CPySequenceTuple_SetItemUnsafe',\n error_kind=ERR_FALSE,\n steals=[False, False, True])\n\n# Construct tuple from a list.\nlist_tuple_op = function_op(\n name='builtins.tuple',\n arg_types=[list_rprimitive],\n return_type=tuple_rprimitive,\n c_function_name='PyList_AsTuple',\n error_kind=ERR_MAGIC,\n priority=2)\n\n# Construct tuple from an arbitrary (iterable) object.\nfunction_op(\n name='builtins.tuple',\n arg_types=[object_rprimitive],\n return_type=tuple_rprimitive,\n c_function_name='PySequence_Tuple',\n error_kind=ERR_MAGIC)\n\n# tuple[begin:end]\ntuple_slice_op = custom_op(\n arg_types=[tuple_rprimitive, int_rprimitive, int_rprimitive],\n return_type=object_rprimitive,\n c_function_name='CPySequenceTuple_GetSlice',\n error_kind=ERR_MAGIC)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/rt_subtype.py__Runtime_subtype_chec_is_runtime_subtype.return.left_accept_RTSubtypeVisi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/rt_subtype.py__Runtime_subtype_chec_is_runtime_subtype.return.left_accept_RTSubtypeVisi", "embedding": null, "metadata": {"file_path": "mypyc/rt_subtype.py", "file_name": "rt_subtype.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 24, "span_ids": ["is_runtime_subtype", "docstring"], "tokens": 236}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"'Runtime subtype' check for RTypes.\n\nA type S is a runtime subtype of T if a value of type S can be used at runtime\nwhen a value of type T is expected without requiring any runtime conversions.\n\nFor boxed types, runtime subtyping is the same as regular subtyping.\nUnboxed subtypes, on the other hand, are not runtime subtypes of object\n(since they require boxing to be used as an object), but short ints\nare runtime subtypes of int.\n\nSubtyping is used to determine whether an object can be in a\nparticular place and runtime subtyping is used to determine whether a\ncoercion is necessary first.\n\"\"\"\n\nfrom mypyc.ir.rtypes import (\n RType, RUnion, RInstance, RPrimitive, RTuple, RVoid, RTypeVisitor, RStruct, RArray,\n is_int_rprimitive, is_short_int_rprimitive, is_bool_rprimitive, is_bit_rprimitive\n)\nfrom mypyc.subtype import is_subtype\n\n\ndef is_runtime_subtype(left: RType, right: RType) -> bool:\n return left.accept(RTSubtypeVisitor(right))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/rt_subtype.py_RTSubtypeVisitor_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/rt_subtype.py_RTSubtypeVisitor_", "embedding": null, "metadata": {"file_path": "mypyc/rt_subtype.py", "file_name": "rt_subtype.py", "file_type": "text/x-python", "category": "implementation", "start_line": 27, "end_line": 64, "span_ids": ["RTSubtypeVisitor", "RTSubtypeVisitor.visit_rvoid", "RTSubtypeVisitor.visit_rprimitive", "RTSubtypeVisitor.__init__", "RTSubtypeVisitor.visit_runion", "RTSubtypeVisitor.visit_rstruct", "RTSubtypeVisitor.visit_rtuple", "RTSubtypeVisitor.visit_rinstance", "RTSubtypeVisitor.visit_rarray"], "tokens": 330}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RTSubtypeVisitor(RTypeVisitor[bool]):\n \"\"\"Is left a runtime subtype of right?\n\n A few special cases such as right being 'object' are handled in\n is_runtime_subtype and don't need to be covered here.\n \"\"\"\n\n def __init__(self, right: RType) -> None:\n self.right = right\n\n def visit_rinstance(self, left: RInstance) -> bool:\n return is_subtype(left, self.right)\n\n def visit_runion(self, left: RUnion) -> bool:\n return is_subtype(left, self.right)\n\n def visit_rprimitive(self, left: RPrimitive) -> bool:\n if is_short_int_rprimitive(left) and is_int_rprimitive(self.right):\n return True\n if is_bit_rprimitive(left) and is_bool_rprimitive(self.right):\n return True\n return left is self.right\n\n def visit_rtuple(self, left: RTuple) -> bool:\n if isinstance(self.right, RTuple):\n return len(self.right.types) == len(left.types) and all(\n is_runtime_subtype(t1, t2) for t1, t2 in zip(left.types, self.right.types))\n return False\n\n def visit_rstruct(self, left: RStruct) -> bool:\n return isinstance(self.right, RStruct) and self.right.name == left.name\n\n def visit_rarray(self, left: RArray) -> bool:\n return left == self.right\n\n def visit_rvoid(self, left: RVoid) -> bool:\n return isinstance(self.right, RVoid)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/sametype.py__Same_type_check_for_RT_is_same_method_signature.return._len_a_args_len_b_arg": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/sametype.py__Same_type_check_for_RT_is_same_method_signature.return._len_a_args_len_b_arg", "embedding": null, "metadata": {"file_path": "mypyc/sametype.py", "file_name": "sametype.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 24, "span_ids": ["is_same_type", "is_same_signature", "is_same_method_signature", "docstring"], "tokens": 251}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Same type check for RTypes.\"\"\"\n\nfrom mypyc.ir.rtypes import (\n RType, RTypeVisitor, RInstance, RPrimitive, RTuple, RVoid, RUnion, RStruct, RArray\n)\nfrom mypyc.ir.func_ir import FuncSignature\n\n\ndef is_same_type(a: RType, b: RType) -> bool:\n return a.accept(SameTypeVisitor(b))\n\n\ndef is_same_signature(a: FuncSignature, b: FuncSignature) -> bool:\n return (len(a.args) == len(b.args)\n and is_same_type(a.ret_type, b.ret_type)\n and all(is_same_type(t1.type, t2.type) and t1.name == t2.name\n for t1, t2 in zip(a.args, b.args)))\n\n\ndef is_same_method_signature(a: FuncSignature, b: FuncSignature) -> bool:\n return (len(a.args) == len(b.args)\n and is_same_type(a.ret_type, b.ret_type)\n and all(is_same_type(t1.type, t2.type) and t1.name == t2.name\n for t1, t2 in zip(a.args[1:], b.args[1:])))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/sametype.py_SameTypeVisitor_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/sametype.py_SameTypeVisitor_", "embedding": null, "metadata": {"file_path": "mypyc/sametype.py", "file_name": "sametype.py", "file_type": "text/x-python", "category": "implementation", "start_line": 27, "end_line": 63, "span_ids": ["SameTypeVisitor.visit_rprimitive", "SameTypeVisitor", "SameTypeVisitor.visit_runion", "SameTypeVisitor.visit_rarray", "SameTypeVisitor.visit_rinstance", "SameTypeVisitor.visit_rstruct", "SameTypeVisitor.__init__", "SameTypeVisitor.visit_rvoid", "SameTypeVisitor.visit_rtuple"], "tokens": 313}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SameTypeVisitor(RTypeVisitor[bool]):\n def __init__(self, right: RType) -> None:\n self.right = right\n\n def visit_rinstance(self, left: RInstance) -> bool:\n return isinstance(self.right, RInstance) and left.name == self.right.name\n\n def visit_runion(self, left: RUnion) -> bool:\n if isinstance(self.right, RUnion):\n items = list(self.right.items)\n for left_item in left.items:\n for j, right_item in enumerate(items):\n if is_same_type(left_item, right_item):\n del items[j]\n break\n else:\n return False\n return not items\n return False\n\n def visit_rprimitive(self, left: RPrimitive) -> bool:\n return left is self.right\n\n def visit_rtuple(self, left: RTuple) -> bool:\n return (isinstance(self.right, RTuple)\n and len(self.right.types) == len(left.types)\n and all(is_same_type(t1, t2) for t1, t2 in zip(left.types, self.right.types)))\n\n def visit_rstruct(self, left: RStruct) -> bool:\n return isinstance(self.right, RStruct) and self.right.name == left.name\n\n def visit_rarray(self, left: RArray) -> bool:\n return left == self.right\n\n def visit_rvoid(self, left: RVoid) -> bool:\n return isinstance(self.right, RVoid)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/subtype.py__Subtype_check_for_RTyp_is_subtype.return.left_accept_SubtypeVisito": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/subtype.py__Subtype_check_for_RTyp_is_subtype.return.left_accept_SubtypeVisito", "embedding": null, "metadata": {"file_path": "mypyc/subtype.py", "file_name": "subtype.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 23, "span_ids": ["is_subtype", "docstring"], "tokens": 188}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Subtype check for RTypes.\"\"\"\n\nfrom mypyc.ir.rtypes import (\n RType, RInstance, RPrimitive, RTuple, RVoid, RTypeVisitor, RUnion, RStruct, RArray,\n is_bool_rprimitive, is_int_rprimitive, is_tuple_rprimitive, is_short_int_rprimitive,\n is_object_rprimitive, is_bit_rprimitive\n)\n\n\ndef is_subtype(left: RType, right: RType) -> bool:\n if is_object_rprimitive(right):\n return True\n elif isinstance(right, RUnion):\n if isinstance(left, RUnion):\n for left_item in left.items:\n if not any(is_subtype(left_item, right_item)\n for right_item in right.items):\n return False\n return True\n else:\n return any(is_subtype(left, item)\n for item in right.items)\n return left.accept(SubtypeVisitor(right))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/subtype.py_SubtypeVisitor_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/subtype.py_SubtypeVisitor_", "embedding": null, "metadata": {"file_path": "mypyc/subtype.py", "file_name": "subtype.py", "file_type": "text/x-python", "category": "implementation", "start_line": 26, "end_line": 72, "span_ids": ["SubtypeVisitor", "SubtypeVisitor.visit_runion", "SubtypeVisitor.visit_rstruct", "SubtypeVisitor.visit_rprimitive", "SubtypeVisitor.visit_rinstance", "SubtypeVisitor.visit_rvoid", "SubtypeVisitor.__init__", "SubtypeVisitor.visit_rarray", "SubtypeVisitor.visit_rtuple"], "tokens": 391}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SubtypeVisitor(RTypeVisitor[bool]):\n \"\"\"Is left a subtype of right?\n\n A few special cases such as right being 'object' are handled in\n is_subtype and don't need to be covered here.\n \"\"\"\n\n def __init__(self, right: RType) -> None:\n self.right = right\n\n def visit_rinstance(self, left: RInstance) -> bool:\n return isinstance(self.right, RInstance) and self.right.class_ir in left.class_ir.mro\n\n def visit_runion(self, left: RUnion) -> bool:\n return all(is_subtype(item, self.right)\n for item in left.items)\n\n def visit_rprimitive(self, left: RPrimitive) -> bool:\n right = self.right\n if is_bool_rprimitive(left):\n if is_int_rprimitive(right):\n return True\n elif is_bit_rprimitive(left):\n if is_bool_rprimitive(right) or is_int_rprimitive(right):\n return True\n elif is_short_int_rprimitive(left):\n if is_int_rprimitive(right):\n return True\n return left is right\n\n def visit_rtuple(self, left: RTuple) -> bool:\n if is_tuple_rprimitive(self.right):\n return True\n if isinstance(self.right, RTuple):\n return len(self.right.types) == len(left.types) and all(\n is_subtype(t1, t2) for t1, t2 in zip(left.types, self.right.types))\n return False\n\n def visit_rstruct(self, left: RStruct) -> bool:\n return isinstance(self.right, RStruct) and self.right.name == left.name\n\n def visit_rarray(self, left: RArray) -> bool:\n return left == self.right\n\n def visit_rvoid(self, left: RVoid) -> bool:\n return isinstance(self.right, RVoid)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/config.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/config.py__", "embedding": null, "metadata": {"file_path": "mypyc/test/config.py", "file_name": "config.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 8, "span_ids": ["imports"], "tokens": 59}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\n\nthis_file_dir = os.path.dirname(os.path.realpath(__file__))\nprefix = os.path.dirname(os.path.dirname(this_file_dir))\n\n# Locations of test data files such as test case descriptions (.test).\ntest_data_prefix = os.path.join(prefix, 'mypyc', 'test-data')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_analysis.py__Test_runner_for_data_f_files._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_analysis.py__Test_runner_for_data_f_files._", "embedding": null, "metadata": {"file_path": "mypyc/test/test_analysis.py", "file_name": "test_analysis.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 23, "span_ids": ["docstring"], "tokens": 164}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Test runner for data-flow analysis test cases.\"\"\"\n\nimport os.path\nfrom typing import Set\n\nfrom mypy.test.data import DataDrivenTestCase\nfrom mypy.test.config import test_temp_dir\nfrom mypy.errors import CompileError\n\nfrom mypyc.common import TOP_LEVEL_NAME\nfrom mypyc.analysis import dataflow\nfrom mypyc.transform import exceptions\nfrom mypyc.ir.pprint import format_func, generate_names_for_ir\nfrom mypyc.ir.ops import Value\nfrom mypyc.ir.func_ir import all_values\nfrom mypyc.test.testutil import (\n ICODE_GEN_BUILTINS, use_custom_builtins, MypycDataSuite, build_ir_for_single_file,\n assert_test_output, replace_native_int\n)\n\nfiles = [\n 'analysis.test'\n]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_analysis.py_TestAnalysis_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_analysis.py_TestAnalysis_", "embedding": null, "metadata": {"file_path": "mypyc/test/test_analysis.py", "file_name": "test_analysis.py", "file_type": "text/x-python", "category": "test", "start_line": 26, "end_line": 79, "span_ids": ["TestAnalysis.run_case", "TestAnalysis"], "tokens": 495}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestAnalysis(MypycDataSuite):\n files = files\n base_path = test_temp_dir\n optional_out = True\n\n def run_case(self, testcase: DataDrivenTestCase) -> None:\n \"\"\"Perform a data-flow analysis test case.\"\"\"\n\n with use_custom_builtins(os.path.join(self.data_prefix, ICODE_GEN_BUILTINS), testcase):\n testcase.output = replace_native_int(testcase.output)\n try:\n ir = build_ir_for_single_file(testcase.input)\n except CompileError as e:\n actual = e.messages\n else:\n actual = []\n for fn in ir:\n if (fn.name == TOP_LEVEL_NAME\n and not testcase.name.endswith('_toplevel')):\n continue\n exceptions.insert_exception_handling(fn)\n actual.extend(format_func(fn))\n cfg = dataflow.get_cfg(fn.blocks)\n args = set(fn.arg_regs) # type: Set[Value]\n name = testcase.name\n if name.endswith('_MaybeDefined'):\n # Forward, maybe\n analysis_result = dataflow.analyze_maybe_defined_regs(fn.blocks, cfg, args)\n elif name.endswith('_Liveness'):\n # Backward, maybe\n analysis_result = dataflow.analyze_live_regs(fn.blocks, cfg)\n elif name.endswith('_MustDefined'):\n # Forward, must\n analysis_result = dataflow.analyze_must_defined_regs(\n fn.blocks, cfg, args,\n regs=all_values(fn.arg_regs, fn.blocks))\n elif name.endswith('_BorrowedArgument'):\n # Forward, must\n analysis_result = dataflow.analyze_borrowed_arguments(fn.blocks, cfg, args)\n else:\n assert False, 'No recognized _AnalysisName suffix in test case'\n\n names = generate_names_for_ir(fn.arg_regs, fn.blocks)\n\n for key in sorted(analysis_result.before.keys(),\n key=lambda x: (x[0].label, x[1])):\n pre = ', '.join(sorted(names[reg]\n for reg in analysis_result.before[key]))\n post = ', '.join(sorted(names[reg]\n for reg in analysis_result.after[key]))\n actual.append('%-8s %-23s %s' % ((key[0].label, key[1]),\n '{%s}' % pre, '{%s}' % post))\n assert_test_output(testcase, actual, 'Invalid source code output')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_commandline.py__Test_cases_for_invokin_python3_path.sys_executable": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_commandline.py__Test_cases_for_invokin_python3_path.sys_executable", "embedding": null, "metadata": {"file_path": "mypyc/test/test_commandline.py", "file_name": "test_commandline.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 26, "span_ids": ["docstring"], "tokens": 133}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Test cases for invoking mypyc on the command line.\n\nThese are slow -- do not add test cases unless you have a very good reason to do so.\n\"\"\"\n\nimport glob\nimport os\nimport os.path\nimport re\nimport subprocess\nimport sys\n\nfrom mypy.test.data import DataDrivenTestCase\nfrom mypy.test.config import test_temp_dir\nfrom mypy.test.helpers import normalize_error_messages\n\nfrom mypyc.test.testutil import MypycDataSuite, assert_test_output\n\nfiles = [\n 'commandline.test',\n]\n\n\nbase_path = os.path.join(os.path.dirname(__file__), '..', '..')\n\npython3_path = sys.executable", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_commandline.py_TestCommandLine_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_commandline.py_TestCommandLine_", "embedding": null, "metadata": {"file_path": "mypyc/test/test_commandline.py", "file_name": "test_commandline.py", "file_type": "text/x-python", "category": "test", "start_line": 29, "end_line": 74, "span_ids": ["TestCommandLine.run_case", "TestCommandLine"], "tokens": 411}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCommandLine(MypycDataSuite):\n files = files\n base_path = test_temp_dir\n optional_out = True\n\n def run_case(self, testcase: DataDrivenTestCase) -> None:\n # Parse options from test case description (arguments must not have spaces)\n text = '\\n'.join(testcase.input)\n m = re.search(r'# *cmd: *(.*)', text)\n assert m is not None, 'Test case missing \"# cmd: \" section'\n args = m.group(1).split()\n\n # Write main program to run (not compiled)\n program = '_%s.py' % testcase.name\n program_path = os.path.join(test_temp_dir, program)\n with open(program_path, 'w') as f:\n f.write(text)\n\n out = b''\n try:\n # Compile program\n cmd = subprocess.run([sys.executable,\n os.path.join(base_path, 'scripts', 'mypyc')] + args,\n stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cwd='tmp')\n if 'ErrorOutput' in testcase.name or cmd.returncode != 0:\n out += cmd.stdout\n\n if cmd.returncode == 0:\n # Run main program\n out += subprocess.check_output(\n [python3_path, program],\n cwd='tmp')\n finally:\n suffix = 'pyd' if sys.platform == 'win32' else 'so'\n so_paths = glob.glob('tmp/**/*.{}'.format(suffix), recursive=True)\n for path in so_paths:\n os.remove(path)\n\n # Strip out 'tmp/' from error message paths in the testcase output,\n # due to a mismatch between this test and mypy's test suite.\n expected = [x.replace('tmp/', '') for x in testcase.output]\n\n # Verify output\n actual = normalize_error_messages(out.decode().splitlines())\n assert_test_output(testcase, actual, 'Invalid output', expected=expected)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emit.py_unittest_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emit.py_unittest_", "embedding": null, "metadata": {"file_path": "mypyc/test/test_emit.py", "file_name": "test_emit.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 34, "span_ids": ["TestEmitter.test_reg", "TestEmitter.test_label", "imports", "TestEmitter.test_emit_line", "TestEmitter.setUp", "TestEmitter"], "tokens": 264}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import unittest\nfrom typing import Dict\n\nfrom mypyc.codegen.emit import Emitter, EmitterContext\nfrom mypyc.ir.ops import BasicBlock, Value, Register\nfrom mypyc.ir.rtypes import int_rprimitive\nfrom mypyc.namegen import NameGenerator\n\n\nclass TestEmitter(unittest.TestCase):\n def setUp(self) -> None:\n self.n = Register(int_rprimitive, 'n')\n self.context = EmitterContext(NameGenerator([['mod']]))\n\n def test_label(self) -> None:\n emitter = Emitter(self.context, {})\n assert emitter.label(BasicBlock(4)) == 'CPyL4'\n\n def test_reg(self) -> None:\n names = {self.n: 'n'} # type: Dict[Value, str]\n emitter = Emitter(self.context, names)\n assert emitter.reg(self.n) == 'cpy_r_n'\n\n def test_emit_line(self) -> None:\n emitter = Emitter(self.context, {})\n emitter.emit_line('line;')\n emitter.emit_line('a {')\n emitter.emit_line('f();')\n emitter.emit_line('}')\n assert emitter.fragments == ['line;\\n',\n 'a {\\n',\n ' f();\\n',\n '}\\n']", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_unittest_from_mypyc_namegen_import": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_unittest_from_mypyc_namegen_import", "embedding": null, "metadata": {"file_path": "mypyc/test/test_emitfunc.py", "file_name": "test_emitfunc.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 33, "span_ids": ["imports"], "tokens": 379}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import unittest\n\nfrom typing import List, Optional\n\nfrom mypy.ordered_dict import OrderedDict\n\nfrom mypy.test.helpers import assert_string_arrays_equal\n\nfrom mypyc.ir.ops import (\n BasicBlock, Goto, Return, Integer, Assign, AssignMulti, IncRef, DecRef, Branch,\n Call, Unbox, Box, TupleGet, GetAttr, SetAttr, Op, Value, CallC, IntOp, LoadMem,\n GetElementPtr, LoadAddress, ComparisonOp, SetMem, Register\n)\nfrom mypyc.ir.rtypes import (\n RTuple, RInstance, RType, RArray, int_rprimitive, bool_rprimitive, list_rprimitive,\n dict_rprimitive, object_rprimitive, c_int_rprimitive, short_int_rprimitive, int32_rprimitive,\n int64_rprimitive, RStruct, pointer_rprimitive\n)\nfrom mypyc.ir.func_ir import FuncIR, FuncDecl, RuntimeArg, FuncSignature\nfrom mypyc.ir.class_ir import ClassIR\nfrom mypyc.ir.pprint import generate_names_for_ir\nfrom mypyc.irbuild.vtable import compute_vtable\nfrom mypyc.codegen.emit import Emitter, EmitterContext\nfrom mypyc.codegen.emitfunc import generate_native_function, FunctionEmitterVisitor\nfrom mypyc.primitives.registry import binary_ops\nfrom mypyc.primitives.misc_ops import none_object_op\nfrom mypyc.primitives.list_ops import list_get_item_op, list_set_item_op, list_append_op\nfrom mypyc.primitives.dict_ops import (\n dict_new_op, dict_update_op, dict_get_item_op, dict_set_item_op\n)\nfrom mypyc.primitives.int_ops import int_neg_op\nfrom mypyc.subtype import is_subtype\nfrom mypyc.namegen import NameGenerator", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor.test_goto_TestFunctionEmitterVisitor.test_int_neg.self_assert_emit_CallC_in": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor.test_goto_TestFunctionEmitterVisitor.test_int_neg.self_assert_emit_CallC_in", "embedding": null, "metadata": {"file_path": "mypyc/test/test_emitfunc.py", "file_name": "test_emitfunc.py", "file_type": "text/x-python", "category": "test", "start_line": 74, "end_line": 117, "span_ids": ["TestFunctionEmitterVisitor.test_int_sub", "TestFunctionEmitterVisitor.test_integer", "TestFunctionEmitterVisitor.test_int_add", "TestFunctionEmitterVisitor.test_assign_int", "TestFunctionEmitterVisitor.test_int_neg", "TestFunctionEmitterVisitor.test_return", "TestFunctionEmitterVisitor.test_tuple_get", "TestFunctionEmitterVisitor.test_goto", "TestFunctionEmitterVisitor.test_goto_next_block", "TestFunctionEmitterVisitor.test_load_None"], "tokens": 476}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestFunctionEmitterVisitor(unittest.TestCase):\n\n def test_goto(self) -> None:\n self.assert_emit(Goto(BasicBlock(2)),\n \"goto CPyL2;\")\n\n def test_goto_next_block(self) -> None:\n next_block = BasicBlock(2)\n self.assert_emit(Goto(next_block), \"\", next_block=next_block)\n\n def test_return(self) -> None:\n self.assert_emit(Return(self.m),\n \"return cpy_r_m;\")\n\n def test_integer(self) -> None:\n self.assert_emit(Assign(self.n, Integer(5)),\n \"cpy_r_n = 10;\")\n self.assert_emit(Assign(self.i32, Integer(5, c_int_rprimitive)),\n \"cpy_r_i32 = 5;\")\n\n def test_tuple_get(self) -> None:\n self.assert_emit(TupleGet(self.t, 1, 0), 'cpy_r_r0 = cpy_r_t.f1;')\n\n def test_load_None(self) -> None:\n self.assert_emit(LoadAddress(none_object_op.type, none_object_op.src, 0),\n \"cpy_r_r0 = (PyObject *)&_Py_NoneStruct;\")\n\n def test_assign_int(self) -> None:\n self.assert_emit(Assign(self.m, self.n),\n \"cpy_r_m = cpy_r_n;\")\n\n def test_int_add(self) -> None:\n self.assert_emit_binary_op(\n '+', self.n, self.m, self.k,\n \"cpy_r_r0 = CPyTagged_Add(cpy_r_m, cpy_r_k);\")\n\n def test_int_sub(self) -> None:\n self.assert_emit_binary_op(\n '-', self.n, self.m, self.k,\n \"cpy_r_r0 = CPyTagged_Subtract(cpy_r_m, cpy_r_k);\")\n\n def test_int_neg(self) -> None:\n self.assert_emit(CallC(int_neg_op.c_function_name, [self.m], int_neg_op.return_type,\n int_neg_op.steals, int_neg_op.is_borrowed, int_neg_op.is_borrowed,\n int_neg_op.error_kind, 55),\n \"cpy_r_r0 = CPyTagged_Negate(cpy_r_m);\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor.test_branch_TestFunctionEmitterVisitor.test_branch.self_assert_emit_b_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor.test_branch_TestFunctionEmitterVisitor.test_branch.self_assert_emit_b_", "embedding": null, "metadata": {"file_path": "mypyc/test/test_emitfunc.py", "file_name": "test_emitfunc.py", "file_type": "text/x-python", "category": "test", "start_line": 117, "end_line": 131, "span_ids": ["TestFunctionEmitterVisitor.test_branch"], "tokens": 135}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestFunctionEmitterVisitor(unittest.TestCase):\n\n def test_branch(self) -> None:\n self.assert_emit(Branch(self.b, BasicBlock(8), BasicBlock(9), Branch.BOOL),\n \"\"\"if (cpy_r_b) {\n goto CPyL8;\n } else\n goto CPyL9;\n \"\"\")\n b = Branch(self.b, BasicBlock(8), BasicBlock(9), Branch.BOOL)\n b.negated = True\n self.assert_emit(b,\n \"\"\"if (!cpy_r_b) {\n goto CPyL8;\n } else\n goto CPyL9;\n \"\"\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor.test_call_TestFunctionEmitterVisitor.test_list_append.self_assert_emit_CallC_li": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor.test_call_TestFunctionEmitterVisitor.test_list_append.self_assert_emit_CallC_li", "embedding": null, "metadata": {"file_path": "mypyc/test/test_emitfunc.py", "file_name": "test_emitfunc.py", "file_type": "text/x-python", "category": "test", "start_line": 133, "end_line": 191, "span_ids": ["TestFunctionEmitterVisitor.test_dec_ref_tuple_nested", "TestFunctionEmitterVisitor.test_box", "TestFunctionEmitterVisitor.test_list_append", "TestFunctionEmitterVisitor.test_unbox", "TestFunctionEmitterVisitor.test_list_get_item", "TestFunctionEmitterVisitor.test_dec_ref_tuple", "TestFunctionEmitterVisitor.test_inc_ref", "TestFunctionEmitterVisitor.test_call_two_args", "TestFunctionEmitterVisitor.test_call", "TestFunctionEmitterVisitor.test_list_set_item", "TestFunctionEmitterVisitor.test_dec_ref"], "tokens": 726}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestFunctionEmitterVisitor(unittest.TestCase):\n\n def test_call(self) -> None:\n decl = FuncDecl('myfn', None, 'mod',\n FuncSignature([RuntimeArg('m', int_rprimitive)], int_rprimitive))\n self.assert_emit(Call(decl, [self.m], 55),\n \"cpy_r_r0 = CPyDef_myfn(cpy_r_m);\")\n\n def test_call_two_args(self) -> None:\n decl = FuncDecl('myfn', None, 'mod',\n FuncSignature([RuntimeArg('m', int_rprimitive),\n RuntimeArg('n', int_rprimitive)],\n int_rprimitive))\n self.assert_emit(Call(decl, [self.m, self.k], 55),\n \"cpy_r_r0 = CPyDef_myfn(cpy_r_m, cpy_r_k);\")\n\n def test_inc_ref(self) -> None:\n self.assert_emit(IncRef(self.m),\n \"CPyTagged_IncRef(cpy_r_m);\")\n\n def test_dec_ref(self) -> None:\n self.assert_emit(DecRef(self.m),\n \"CPyTagged_DecRef(cpy_r_m);\")\n\n def test_dec_ref_tuple(self) -> None:\n self.assert_emit(DecRef(self.t), 'CPyTagged_DecRef(cpy_r_t.f0);')\n\n def test_dec_ref_tuple_nested(self) -> None:\n self.assert_emit(DecRef(self.tt), 'CPyTagged_DecRef(cpy_r_tt.f0.f0);')\n\n def test_list_get_item(self) -> None:\n self.assert_emit(CallC(list_get_item_op.c_function_name, [self.m, self.k],\n list_get_item_op.return_type, list_get_item_op.steals,\n list_get_item_op.is_borrowed, list_get_item_op.error_kind, 55),\n \"\"\"cpy_r_r0 = CPyList_GetItem(cpy_r_m, cpy_r_k);\"\"\")\n\n def test_list_set_item(self) -> None:\n self.assert_emit(CallC(list_set_item_op.c_function_name, [self.l, self.n, self.o],\n list_set_item_op.return_type, list_set_item_op.steals,\n list_set_item_op.is_borrowed, list_set_item_op.error_kind, 55),\n \"\"\"cpy_r_r0 = CPyList_SetItem(cpy_r_l, cpy_r_n, cpy_r_o);\"\"\")\n\n def test_box(self) -> None:\n self.assert_emit(Box(self.n),\n \"\"\"cpy_r_r0 = CPyTagged_StealAsObject(cpy_r_n);\"\"\")\n\n def test_unbox(self) -> None:\n self.assert_emit(Unbox(self.m, int_rprimitive, 55),\n \"\"\"if (likely(PyLong_Check(cpy_r_m)))\n cpy_r_r0 = CPyTagged_FromObject(cpy_r_m);\n else {\n CPy_TypeError(\"int\", cpy_r_m);\n cpy_r_r0 = CPY_INT_TAG;\n }\n \"\"\")\n\n def test_list_append(self) -> None:\n self.assert_emit(CallC(list_append_op.c_function_name, [self.l, self.o],\n list_append_op.return_type, list_append_op.steals,\n list_append_op.is_borrowed, list_append_op.error_kind, 1),\n \"\"\"cpy_r_r0 = PyList_Append(cpy_r_l, cpy_r_o);\"\"\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor.test_get_attr_TestFunctionEmitterVisitor.test_get_attr.self_assert_emit_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor.test_get_attr_TestFunctionEmitterVisitor.test_get_attr.self_assert_emit_", "embedding": null, "metadata": {"file_path": "mypyc/test/test_emitfunc.py", "file_name": "test_emitfunc.py", "file_type": "text/x-python", "category": "test", "start_line": 193, "end_line": 202, "span_ids": ["TestFunctionEmitterVisitor.test_get_attr"], "tokens": 129}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestFunctionEmitterVisitor(unittest.TestCase):\n\n def test_get_attr(self) -> None:\n self.assert_emit(\n GetAttr(self.r, 'y', 1),\n \"\"\"cpy_r_r0 = ((mod___AObject *)cpy_r_r)->_y;\n if (unlikely(((mod___AObject *)cpy_r_r)->_y == CPY_INT_TAG)) {\n PyErr_SetString(PyExc_AttributeError, \"attribute 'y' of 'A' undefined\");\n } else {\n CPyTagged_IncRef(((mod___AObject *)cpy_r_r)->_y);\n }\n \"\"\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor.test_set_attr_TestFunctionEmitterVisitor.test_set_attr.self_assert_emit_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor.test_set_attr_TestFunctionEmitterVisitor.test_set_attr.self_assert_emit_", "embedding": null, "metadata": {"file_path": "mypyc/test/test_emitfunc.py", "file_name": "test_emitfunc.py", "file_type": "text/x-python", "category": "test", "start_line": 204, "end_line": 212, "span_ids": ["TestFunctionEmitterVisitor.test_set_attr"], "tokens": 114}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestFunctionEmitterVisitor(unittest.TestCase):\n\n def test_set_attr(self) -> None:\n self.assert_emit(\n SetAttr(self.r, 'y', self.m, 1),\n \"\"\"if (((mod___AObject *)cpy_r_r)->_y != CPY_INT_TAG) {\n CPyTagged_DecRef(((mod___AObject *)cpy_r_r)->_y);\n }\n ((mod___AObject *)cpy_r_r)->_y = cpy_r_m;\n cpy_r_r0 = 1;\n \"\"\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor.test_dict_get_item_TestFunctionEmitterVisitor.test_dict_contains.self_assert_emit_binary_o": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor.test_dict_get_item_TestFunctionEmitterVisitor.test_dict_contains.self_assert_emit_binary_o", "embedding": null, "metadata": {"file_path": "mypyc/test/test_emitfunc.py", "file_name": "test_emitfunc.py", "file_type": "text/x-python", "category": "test", "start_line": 214, "end_line": 241, "span_ids": ["TestFunctionEmitterVisitor.test_new_dict", "TestFunctionEmitterVisitor.test_dict_get_item", "TestFunctionEmitterVisitor.test_dict_update", "TestFunctionEmitterVisitor.test_dict_set_item", "TestFunctionEmitterVisitor.test_dict_contains"], "tokens": 411}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestFunctionEmitterVisitor(unittest.TestCase):\n\n def test_dict_get_item(self) -> None:\n self.assert_emit(CallC(dict_get_item_op.c_function_name, [self.d, self.o2],\n dict_get_item_op.return_type, dict_get_item_op.steals,\n dict_get_item_op.is_borrowed, dict_get_item_op.error_kind, 1),\n \"\"\"cpy_r_r0 = CPyDict_GetItem(cpy_r_d, cpy_r_o2);\"\"\")\n\n def test_dict_set_item(self) -> None:\n self.assert_emit(CallC(dict_set_item_op.c_function_name, [self.d, self.o, self.o2],\n dict_set_item_op.return_type, dict_set_item_op.steals,\n dict_set_item_op.is_borrowed, dict_set_item_op.error_kind, 1),\n \"\"\"cpy_r_r0 = CPyDict_SetItem(cpy_r_d, cpy_r_o, cpy_r_o2);\"\"\")\n\n def test_dict_update(self) -> None:\n self.assert_emit(CallC(dict_update_op.c_function_name, [self.d, self.o],\n dict_update_op.return_type, dict_update_op.steals,\n dict_update_op.is_borrowed, dict_update_op.error_kind, 1),\n \"\"\"cpy_r_r0 = CPyDict_Update(cpy_r_d, cpy_r_o);\"\"\")\n\n def test_new_dict(self) -> None:\n self.assert_emit(CallC(dict_new_op.c_function_name, [], dict_new_op.return_type,\n dict_new_op.steals, dict_new_op.is_borrowed,\n dict_new_op.error_kind, 1),\n \"\"\"cpy_r_r0 = PyDict_New();\"\"\")\n\n def test_dict_contains(self) -> None:\n self.assert_emit_binary_op(\n 'in', self.b, self.o, self.d,\n \"\"\"cpy_r_r0 = PyDict_Contains(cpy_r_d, cpy_r_o);\"\"\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor.test_comparison_op_TestFunctionEmitterVisitor.test_comparison_op.None_7": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor.test_comparison_op_TestFunctionEmitterVisitor.test_comparison_op.None_7", "embedding": null, "metadata": {"file_path": "mypyc/test/test_emitfunc.py", "file_name": "test_emitfunc.py", "file_type": "text/x-python", "category": "test", "start_line": 263, "end_line": 283, "span_ids": ["TestFunctionEmitterVisitor.test_comparison_op"], "tokens": 415}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestFunctionEmitterVisitor(unittest.TestCase):\n\n def test_comparison_op(self) -> None:\n # signed\n self.assert_emit(ComparisonOp(self.s1, self.s2, ComparisonOp.SLT, 1),\n \"\"\"cpy_r_r0 = (Py_ssize_t)cpy_r_s1 < (Py_ssize_t)cpy_r_s2;\"\"\")\n self.assert_emit(ComparisonOp(self.i32, self.i32_1, ComparisonOp.SLT, 1),\n \"\"\"cpy_r_r0 = cpy_r_i32 < cpy_r_i32_1;\"\"\")\n self.assert_emit(ComparisonOp(self.i64, self.i64_1, ComparisonOp.SLT, 1),\n \"\"\"cpy_r_r0 = cpy_r_i64 < cpy_r_i64_1;\"\"\")\n # unsigned\n self.assert_emit(ComparisonOp(self.s1, self.s2, ComparisonOp.ULT, 1),\n \"\"\"cpy_r_r0 = cpy_r_s1 < cpy_r_s2;\"\"\")\n self.assert_emit(ComparisonOp(self.i32, self.i32_1, ComparisonOp.ULT, 1),\n \"\"\"cpy_r_r0 = (uint32_t)cpy_r_i32 < (uint32_t)cpy_r_i32_1;\"\"\")\n self.assert_emit(ComparisonOp(self.i64, self.i64_1, ComparisonOp.ULT, 1),\n \"\"\"cpy_r_r0 = (uint64_t)cpy_r_i64 < (uint64_t)cpy_r_i64_1;\"\"\")\n\n # object type\n self.assert_emit(ComparisonOp(self.o, self.o2, ComparisonOp.EQ, 1),\n \"\"\"cpy_r_r0 = cpy_r_o == cpy_r_o2;\"\"\")\n self.assert_emit(ComparisonOp(self.o, self.o2, ComparisonOp.NEQ, 1),\n \"\"\"cpy_r_r0 = cpy_r_o != cpy_r_o2;\"\"\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestGenerateFunction_TestGenerateFunction.test_simple.assert_string_arrays_equa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestGenerateFunction_TestGenerateFunction.test_simple.assert_string_arrays_equa", "embedding": null, "metadata": {"file_path": "mypyc/test/test_emitfunc.py", "file_name": "test_emitfunc.py", "file_type": "text/x-python", "category": "test", "start_line": 352, "end_line": 374, "span_ids": ["TestGenerateFunction.setUp", "TestGenerateFunction.test_simple", "TestGenerateFunction"], "tokens": 226}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestGenerateFunction(unittest.TestCase):\n def setUp(self) -> None:\n self.arg = RuntimeArg('arg', int_rprimitive)\n self.reg = Register(int_rprimitive, 'arg')\n self.block = BasicBlock(0)\n\n def test_simple(self) -> None:\n self.block.ops.append(Return(self.reg))\n fn = FuncIR(FuncDecl('myfunc', None, 'mod', FuncSignature([self.arg], int_rprimitive)),\n [self.reg],\n [self.block])\n value_names = generate_names_for_ir(fn.arg_regs, fn.blocks)\n emitter = Emitter(EmitterContext(NameGenerator([['mod']])), value_names)\n generate_native_function(fn, emitter, 'prog.py', 'prog')\n result = emitter.fragments\n assert_string_arrays_equal(\n [\n 'CPyTagged CPyDef_myfunc(CPyTagged cpy_r_arg) {\\n',\n 'CPyL0: ;\\n',\n ' return cpy_r_arg;\\n',\n '}\\n',\n ],\n result, msg='Generated code invalid')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestGenerateFunction.test_register_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestGenerateFunction.test_register_", "embedding": null, "metadata": {"file_path": "mypyc/test/test_emitfunc.py", "file_name": "test_emitfunc.py", "file_type": "text/x-python", "category": "test", "start_line": 376, "end_line": 396, "span_ids": ["TestGenerateFunction.test_register"], "tokens": 216}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestGenerateFunction(unittest.TestCase):\n\n def test_register(self) -> None:\n reg = Register(int_rprimitive)\n op = Assign(reg, Integer(5))\n self.block.ops.append(op)\n fn = FuncIR(FuncDecl('myfunc', None, 'mod', FuncSignature([self.arg], list_rprimitive)),\n [self.reg],\n [self.block])\n value_names = generate_names_for_ir(fn.arg_regs, fn.blocks)\n emitter = Emitter(EmitterContext(NameGenerator([['mod']])), value_names)\n generate_native_function(fn, emitter, 'prog.py', 'prog')\n result = emitter.fragments\n assert_string_arrays_equal(\n [\n 'PyObject *CPyDef_myfunc(CPyTagged cpy_r_arg) {\\n',\n ' CPyTagged cpy_r_r0;\\n',\n 'CPyL0: ;\\n',\n ' cpy_r_r0 = 10;\\n',\n '}\\n',\n ],\n result, msg='Generated code invalid')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitwrapper.py_unittest_TestArgCheck.test_check_list.self_assert_lines_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitwrapper.py_unittest_TestArgCheck.test_check_list.self_assert_lines_", "embedding": null, "metadata": {"file_path": "mypyc/test/test_emitwrapper.py", "file_name": "test_emitwrapper.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 29, "span_ids": ["TestArgCheck", "imports", "TestArgCheck.setUp", "TestArgCheck.test_check_list"], "tokens": 223}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import unittest\nfrom typing import List\n\nfrom mypy.test.helpers import assert_string_arrays_equal\n\nfrom mypyc.codegen.emit import Emitter, EmitterContext\nfrom mypyc.codegen.emitwrapper import generate_arg_check\nfrom mypyc.ir.rtypes import list_rprimitive, int_rprimitive\nfrom mypyc.namegen import NameGenerator\n\n\nclass TestArgCheck(unittest.TestCase):\n def setUp(self) -> None:\n self.context = EmitterContext(NameGenerator([['mod']]))\n\n def test_check_list(self) -> None:\n emitter = Emitter(self.context)\n generate_arg_check('x', list_rprimitive, emitter, 'return NULL;')\n lines = emitter.fragments\n self.assert_lines([\n 'PyObject *arg_x;',\n 'if (likely(PyList_Check(obj_x)))',\n ' arg_x = obj_x;',\n 'else {',\n ' CPy_TypeError(\"list\", obj_x);',\n ' arg_x = NULL;',\n '}',\n 'if (arg_x == NULL) return NULL;',\n ], lines)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitwrapper.py_TestArgCheck.test_check_int_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitwrapper.py_TestArgCheck.test_check_int_", "embedding": null, "metadata": {"file_path": "mypyc/test/test_emitwrapper.py", "file_name": "test_emitwrapper.py", "file_type": "text/x-python", "category": "test", "start_line": 31, "end_line": 58, "span_ids": ["TestArgCheck.assert_lines", "TestArgCheck.test_check_int"], "tokens": 280}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestArgCheck(unittest.TestCase):\n\n def test_check_int(self) -> None:\n emitter = Emitter(self.context)\n generate_arg_check('x', int_rprimitive, emitter, 'return NULL;')\n generate_arg_check('y', int_rprimitive, emitter, 'return NULL;', True)\n lines = emitter.fragments\n self.assert_lines([\n 'CPyTagged arg_x;',\n 'if (likely(PyLong_Check(obj_x)))',\n ' arg_x = CPyTagged_BorrowFromObject(obj_x);',\n 'else {',\n ' CPy_TypeError(\"int\", obj_x);',\n ' return NULL;',\n '}',\n 'CPyTagged arg_y;',\n 'if (obj_y == NULL) {',\n ' arg_y = CPY_INT_TAG;',\n '} else if (likely(PyLong_Check(obj_y)))',\n ' arg_y = CPyTagged_BorrowFromObject(obj_y);',\n 'else {',\n ' CPy_TypeError(\"int\", obj_y);',\n ' return NULL;',\n '}',\n ], lines)\n\n def assert_lines(self, expected: List[str], actual: List[str]) -> None:\n actual = [line.rstrip('\\n') for line in actual]\n assert_string_arrays_equal(expected, actual, 'Invalid output')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_exceptions.py__Test_runner_for_except_files._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_exceptions.py__Test_runner_for_except_files._", "embedding": null, "metadata": {"file_path": "mypyc/test/test_exceptions.py", "file_name": "test_exceptions.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 24, "span_ids": ["docstring"], "tokens": 170}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Test runner for exception handling transform test cases.\n\nThe transform inserts exception handling branch operations to IR.\n\"\"\"\n\nimport os.path\n\nfrom mypy.test.config import test_temp_dir\nfrom mypy.test.data import DataDrivenTestCase\nfrom mypy.errors import CompileError\n\nfrom mypyc.common import TOP_LEVEL_NAME\nfrom mypyc.ir.pprint import format_func\nfrom mypyc.transform.uninit import insert_uninit_checks\nfrom mypyc.transform.exceptions import insert_exception_handling\nfrom mypyc.transform.refcount import insert_ref_count_opcodes\nfrom mypyc.test.testutil import (\n ICODE_GEN_BUILTINS, use_custom_builtins, MypycDataSuite, build_ir_for_single_file,\n assert_test_output, remove_comment_lines, replace_native_int\n)\n\nfiles = [\n 'exceptions.test'\n]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_exceptions.py_TestExceptionTransform_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_exceptions.py_TestExceptionTransform_", "embedding": null, "metadata": {"file_path": "mypyc/test/test_exceptions.py", "file_name": "test_exceptions.py", "file_type": "text/x-python", "category": "test", "start_line": 27, "end_line": 53, "span_ids": ["TestExceptionTransform.run_case", "TestExceptionTransform"], "tokens": 203}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestExceptionTransform(MypycDataSuite):\n files = files\n base_path = test_temp_dir\n\n def run_case(self, testcase: DataDrivenTestCase) -> None:\n \"\"\"Perform a runtime checking transformation test case.\"\"\"\n with use_custom_builtins(os.path.join(self.data_prefix, ICODE_GEN_BUILTINS), testcase):\n expected_output = remove_comment_lines(testcase.output)\n expected_output = replace_native_int(expected_output)\n try:\n ir = build_ir_for_single_file(testcase.input)\n except CompileError as e:\n actual = e.messages\n else:\n actual = []\n for fn in ir:\n if (fn.name == TOP_LEVEL_NAME\n and not testcase.name.endswith('_toplevel')):\n continue\n insert_uninit_checks(fn)\n insert_exception_handling(fn)\n insert_ref_count_opcodes(fn)\n actual.extend(format_func(fn))\n\n assert_test_output(testcase, actual, 'Invalid source code output',\n expected_output)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_external.py__Test_cases_that_run_te_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_external.py__Test_cases_that_run_te_", "embedding": null, "metadata": {"file_path": "mypyc/test/test_external.py", "file_name": "test_external.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 48, "span_ids": ["TestExternal.test_c_unit_test", "TestExternal", "docstring"], "tokens": 445}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Test cases that run tests as subprocesses.\"\"\"\n\nfrom typing import List\n\nimport os\nimport subprocess\nimport sys\nimport unittest\n\n\nbase_dir = os.path.join(os.path.dirname(__file__), '..', '..')\n\n\nclass TestExternal(unittest.TestCase):\n # TODO: Get this to work on Windows.\n # (Or don't. It is probably not a good use of time.)\n @unittest.skipIf(sys.platform.startswith(\"win\"), \"rt tests don't work on windows\")\n def test_c_unit_test(self) -> None:\n \"\"\"Run C unit tests in a subprocess.\"\"\"\n # Build Google Test, the C++ framework we use for testing C code.\n # The source code for Google Test is copied to this repository.\n cppflags = [] # type: List[str]\n env = os.environ.copy()\n if sys.platform == 'darwin':\n cppflags += ['-mmacosx-version-min=10.10', '-stdlib=libc++']\n env['CPPFLAGS'] = ' '.join(cppflags)\n subprocess.check_call(\n ['make', 'libgtest.a'],\n env=env,\n cwd=os.path.join(base_dir, 'mypyc', 'external', 'googletest', 'make'))\n # Build Python wrapper for C unit tests.\n env = os.environ.copy()\n env['CPPFLAGS'] = ' '.join(cppflags)\n status = subprocess.check_call(\n [sys.executable, 'setup.py', 'build_ext', '--inplace'],\n env=env,\n cwd=os.path.join(base_dir, 'mypyc', 'lib-rt'))\n # Run C unit tests.\n env = os.environ.copy()\n if 'GTEST_COLOR' not in os.environ:\n env['GTEST_COLOR'] = 'yes' # Use fancy colors\n status = subprocess.call([sys.executable, '-c',\n 'import sys, test_capi; sys.exit(test_capi.run_tests())'],\n env=env,\n cwd=os.path.join(base_dir, 'mypyc', 'lib-rt'))\n if status != 0:\n raise AssertionError(\"make test: C unit test failure\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_irbuild.py__Test_cases_for_IR_gene_files._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_irbuild.py__Test_cases_for_IR_gene_files._", "embedding": null, "metadata": {"file_path": "mypyc/test/test_irbuild.py", "file_name": "test_irbuild.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 36, "span_ids": ["docstring"], "tokens": 268}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Test cases for IR generation.\"\"\"\n\nimport os.path\n\nfrom mypy.test.config import test_temp_dir\nfrom mypy.test.data import DataDrivenTestCase\nfrom mypy.errors import CompileError\n\nfrom mypyc.common import TOP_LEVEL_NAME\nfrom mypyc.ir.pprint import format_func\nfrom mypyc.test.testutil import (\n ICODE_GEN_BUILTINS, use_custom_builtins, MypycDataSuite, build_ir_for_single_file,\n assert_test_output, remove_comment_lines, replace_native_int, replace_word_size,\n infer_ir_build_options_from_test_name\n)\n\nfiles = [\n 'irbuild-basic.test',\n 'irbuild-lists.test',\n 'irbuild-dict.test',\n 'irbuild-statements.test',\n 'irbuild-nested.test',\n 'irbuild-classes.test',\n 'irbuild-optional.test',\n 'irbuild-tuple.test',\n 'irbuild-any.test',\n 'irbuild-generics.test',\n 'irbuild-try.test',\n 'irbuild-set.test',\n 'irbuild-str.test',\n 'irbuild-strip-asserts.test',\n 'irbuild-int.test',\n 'irbuild-vectorcall.test',\n 'irbuild-unreachable.test',\n 'irbuild-isinstance.test',\n]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_irbuild.py_TestGenOps_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_irbuild.py_TestGenOps_", "embedding": null, "metadata": {"file_path": "mypyc/test/test_irbuild.py", "file_name": "test_irbuild.py", "file_type": "text/x-python", "category": "test", "start_line": 39, "end_line": 69, "span_ids": ["TestGenOps", "TestGenOps.run_case"], "tokens": 235}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestGenOps(MypycDataSuite):\n files = files\n base_path = test_temp_dir\n optional_out = True\n\n def run_case(self, testcase: DataDrivenTestCase) -> None:\n \"\"\"Perform a runtime checking transformation test case.\"\"\"\n options = infer_ir_build_options_from_test_name(testcase.name)\n if options is None:\n # Skipped test case\n return\n with use_custom_builtins(os.path.join(self.data_prefix, ICODE_GEN_BUILTINS), testcase):\n expected_output = remove_comment_lines(testcase.output)\n expected_output = replace_native_int(expected_output)\n expected_output = replace_word_size(expected_output)\n name = testcase.name\n try:\n ir = build_ir_for_single_file(testcase.input, options)\n except CompileError as e:\n actual = e.messages\n else:\n actual = []\n for fn in ir:\n if (fn.name == TOP_LEVEL_NAME\n and not name.endswith('_toplevel')):\n continue\n actual.extend(format_func(fn))\n\n assert_test_output(testcase, actual, 'Invalid source code output',\n expected_output)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_namegen.py_unittest_TestNameGen.test_make_module_translation_map.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_namegen.py_unittest_TestNameGen.test_make_module_translation_map.None_3", "embedding": null, "metadata": {"file_path": "mypyc/test/test_namegen.py", "file_name": "test_namegen.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 29, "span_ids": ["TestNameGen.test_exported_name", "imports", "TestNameGen", "TestNameGen.test_candidate_suffixes", "TestNameGen.test_make_module_translation_map"], "tokens": 283}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import unittest\n\nfrom mypyc.namegen import (\n NameGenerator, exported_name, candidate_suffixes, make_module_translation_map\n)\n\n\nclass TestNameGen(unittest.TestCase):\n def test_candidate_suffixes(self) -> None:\n assert candidate_suffixes('foo') == ['', 'foo.']\n assert candidate_suffixes('foo.bar') == ['', 'bar.', 'foo.bar.']\n\n def test_exported_name(self) -> None:\n assert exported_name('foo') == 'foo'\n assert exported_name('foo.bar') == 'foo___bar'\n\n def test_make_module_translation_map(self) -> None:\n assert make_module_translation_map(\n ['foo', 'bar']) == {'foo': 'foo.', 'bar': 'bar.'}\n assert make_module_translation_map(\n ['foo.bar', 'foo.baz']) == {'foo.bar': 'bar.', 'foo.baz': 'baz.'}\n assert make_module_translation_map(\n ['zar', 'foo.bar', 'foo.baz']) == {'foo.bar': 'bar.',\n 'foo.baz': 'baz.',\n 'zar': 'zar.'}\n assert make_module_translation_map(\n ['foo.bar', 'fu.bar', 'foo.baz']) == {'foo.bar': 'foo.bar.',\n 'fu.bar': 'fu.bar.',\n 'foo.baz': 'baz.'}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_namegen.py_TestNameGen.test_name_generator_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_namegen.py_TestNameGen.test_name_generator_", "embedding": null, "metadata": {"file_path": "mypyc/test/test_namegen.py", "file_name": "test_namegen.py", "file_type": "text/x-python", "category": "test", "start_line": 31, "end_line": 41, "span_ids": ["TestNameGen.test_name_generator"], "tokens": 201}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestNameGen(unittest.TestCase):\n\n def test_name_generator(self) -> None:\n g = NameGenerator([['foo', 'foo.zar']])\n assert g.private_name('foo', 'f') == 'foo___f'\n assert g.private_name('foo', 'C.x.y') == 'foo___C___x___y'\n assert g.private_name('foo', 'C.x.y') == 'foo___C___x___y'\n assert g.private_name('foo.zar', 'C.x.y') == 'zar___C___x___y'\n assert g.private_name('foo', 'C.x_y') == 'foo___C___x_y'\n assert g.private_name('foo', 'C_x_y') == 'foo___C_x_y'\n assert g.private_name('foo', 'C_x_y') == 'foo___C_x_y'\n assert g.private_name('foo', '___') == 'foo______3_'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_refcount.py__Test_runner_for_refere_files._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_refcount.py__Test_runner_for_refere_files._", "embedding": null, "metadata": {"file_path": "mypyc/test/test_refcount.py", "file_name": "test_refcount.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 25, "span_ids": ["docstring"], "tokens": 179}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Test runner for reference count opcode insertion transform test cases.\n\nThe transform inserts needed reference count increment/decrement\noperations to IR.\n\"\"\"\n\nimport os.path\n\nfrom mypy.test.config import test_temp_dir\nfrom mypy.test.data import DataDrivenTestCase\nfrom mypy.errors import CompileError\n\nfrom mypyc.common import TOP_LEVEL_NAME\nfrom mypyc.ir.pprint import format_func\nfrom mypyc.transform.refcount import insert_ref_count_opcodes\nfrom mypyc.transform.uninit import insert_uninit_checks\nfrom mypyc.test.testutil import (\n ICODE_GEN_BUILTINS, use_custom_builtins, MypycDataSuite, build_ir_for_single_file,\n assert_test_output, remove_comment_lines, replace_native_int, replace_word_size,\n infer_ir_build_options_from_test_name\n)\n\nfiles = [\n 'refcount.test'\n]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_refcount.py_TestRefCountTransform_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_refcount.py_TestRefCountTransform_", "embedding": null, "metadata": {"file_path": "mypyc/test/test_refcount.py", "file_name": "test_refcount.py", "file_type": "text/x-python", "category": "test", "start_line": 28, "end_line": 59, "span_ids": ["TestRefCountTransform.run_case", "TestRefCountTransform"], "tokens": 245}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRefCountTransform(MypycDataSuite):\n files = files\n base_path = test_temp_dir\n optional_out = True\n\n def run_case(self, testcase: DataDrivenTestCase) -> None:\n \"\"\"Perform a runtime checking transformation test case.\"\"\"\n options = infer_ir_build_options_from_test_name(testcase.name)\n if options is None:\n # Skipped test case\n return\n with use_custom_builtins(os.path.join(self.data_prefix, ICODE_GEN_BUILTINS), testcase):\n expected_output = remove_comment_lines(testcase.output)\n expected_output = replace_native_int(expected_output)\n expected_output = replace_word_size(expected_output)\n try:\n ir = build_ir_for_single_file(testcase.input, options)\n except CompileError as e:\n actual = e.messages\n else:\n actual = []\n for fn in ir:\n if (fn.name == TOP_LEVEL_NAME\n and not testcase.name.endswith('_toplevel')):\n continue\n insert_uninit_checks(fn)\n insert_ref_count_opcodes(fn)\n actual.extend(format_func(fn))\n\n assert_test_output(testcase, actual, 'Invalid source code output',\n expected_output)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_run.py__Test_cases_for_buildin_WORKDIR._build_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_run.py__Test_cases_for_buildin_WORKDIR._build_", "embedding": null, "metadata": {"file_path": "mypyc/test/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 69, "span_ids": ["docstring"], "tokens": 469}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Test cases for building an C extension and running it.\"\"\"\n\nimport ast\nimport glob\nimport os.path\nimport platform\nimport re\nimport subprocess\nimport contextlib\nimport shutil\nimport sys\nfrom typing import Any, Iterator, List, cast\n\nfrom mypy import build\nfrom mypy.test.data import DataDrivenTestCase, UpdateFile\nfrom mypy.test.config import test_temp_dir\nfrom mypy.errors import CompileError\nfrom mypy.options import Options\nfrom mypy.test.helpers import copy_and_fudge_mtime, assert_module_equivalence\n\nfrom mypyc.codegen import emitmodule\nfrom mypyc.options import CompilerOptions\nfrom mypyc.errors import Errors\nfrom mypyc.build import construct_groups\nfrom mypyc.test.testutil import (\n ICODE_GEN_BUILTINS, TESTUTIL_PATH,\n use_custom_builtins, MypycDataSuite, assert_test_output,\n show_c, fudge_dir_mtimes,\n)\nfrom mypyc.test.test_serialization import check_serialization_roundtrip\n\nfiles = [\n 'run-misc.test',\n 'run-functions.test',\n 'run-integers.test',\n 'run-floats.test',\n 'run-bools.test',\n 'run-strings.test',\n 'run-tuples.test',\n 'run-lists.test',\n 'run-dicts.test',\n 'run-sets.test',\n 'run-primitives.test',\n 'run-loops.test',\n 'run-exceptions.test',\n 'run-imports.test',\n 'run-classes.test',\n 'run-traits.test',\n 'run-generators.test',\n 'run-multimodule.test',\n 'run-bench.test',\n 'run-mypy-sim.test',\n]\nif sys.version_info >= (3, 7):\n files.append('run-python37.test')\nif sys.version_info >= (3, 8):\n files.append('run-python38.test')\n\nsetup_format = \"\"\"\\\nfrom setuptools import setup\nfrom mypyc.build import mypycify\n\nsetup(name='test_run_output',\n ext_modules=mypycify({}, separate={}, skip_cgen_input={!r}, strip_asserts=False,\n multi_file={}, opt_level='{}'),\n)\n\"\"\"\n\nWORKDIR = 'build'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_run.py_run_setup_run_setup.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_run.py_run_setup_run_setup.return.True", "embedding": null, "metadata": {"file_path": "mypyc/test/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 67, "end_line": 101, "span_ids": ["run_setup"], "tokens": 291}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def run_setup(script_name: str, script_args: List[str]) -> bool:\n \"\"\"Run a setup script in a somewhat controlled environment.\n\n This is adapted from code in distutils and our goal here is that is\n faster to not need to spin up a python interpreter to run it.\n\n We had to fork it because the real run_setup swallows errors\n and KeyboardInterrupt with no way to recover them (!).\n The real version has some extra features that we removed since\n we weren't using them.\n\n Returns whether the setup succeeded.\n \"\"\"\n save_argv = sys.argv.copy()\n g = {'__file__': script_name}\n try:\n try:\n sys.argv[0] = script_name\n sys.argv[1:] = script_args\n with open(script_name, 'rb') as f:\n exec(f.read(), g)\n finally:\n sys.argv = save_argv\n except SystemExit as e:\n # typeshed reports code as being an int but that is wrong\n code = cast(Any, e).code\n # distutils converts KeyboardInterrupt into a SystemExit with\n # \"interrupted\" as the argument. Convert it back so that\n # pytest will exit instead of just failing the test.\n if code == \"interrupted\":\n raise KeyboardInterrupt from e\n\n return code == 0 or code is None\n\n return True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_run.py_chdir_manager_TestRun.run_case.with_use_custom_builtins_.self_run_case_inner_testc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_run.py_chdir_manager_TestRun.run_case.with_use_custom_builtins_.self_run_case_inner_testc", "embedding": null, "metadata": {"file_path": "mypyc/test/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 104, "end_line": 127, "span_ids": ["TestRun.run_case", "chdir_manager", "TestRun"], "tokens": 179}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@contextlib.contextmanager\ndef chdir_manager(target: str) -> Iterator[None]:\n dir = os.getcwd()\n os.chdir(target)\n try:\n yield\n finally:\n os.chdir(dir)\n\n\nclass TestRun(MypycDataSuite):\n \"\"\"Test cases that build a C extension and run code.\"\"\"\n files = files\n base_path = test_temp_dir\n optional_out = True\n multi_file = False\n separate = False\n\n def run_case(self, testcase: DataDrivenTestCase) -> None:\n # setup.py wants to be run from the root directory of the package, which we accommodate\n # by chdiring into tmp/\n with use_custom_builtins(os.path.join(self.data_prefix, ICODE_GEN_BUILTINS), testcase), (\n chdir_manager('tmp')):\n self.run_case_inner(testcase)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_run.py_TestRun.run_case_inner_TestRun.run_case_inner.for_operations_in_steps_.self_run_case_step_testca": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_run.py_TestRun.run_case_inner_TestRun.run_case_inner.for_operations_in_steps_.self_run_case_step_testca", "embedding": null, "metadata": {"file_path": "mypyc/test/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 129, "end_line": 166, "span_ids": ["TestRun.run_case_inner"], "tokens": 278}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRun(MypycDataSuite):\n\n def run_case_inner(self, testcase: DataDrivenTestCase) -> None:\n os.mkdir(WORKDIR)\n\n text = '\\n'.join(testcase.input)\n\n with open('native.py', 'w', encoding='utf-8') as f:\n f.write(text)\n with open('interpreted.py', 'w', encoding='utf-8') as f:\n f.write(text)\n\n shutil.copyfile(TESTUTIL_PATH, 'testutil.py')\n\n step = 1\n self.run_case_step(testcase, step)\n\n steps = testcase.find_steps()\n if steps == [[]]:\n steps = []\n\n for operations in steps:\n # To make sure that any new changes get picked up as being\n # new by distutils, shift the mtime of all of the\n # generated artifacts back by a second.\n fudge_dir_mtimes(WORKDIR, -1)\n\n step += 1\n with chdir_manager('..'):\n for op in operations:\n if isinstance(op, UpdateFile):\n # Modify/create file\n copy_and_fudge_mtime(op.source_path, op.target_path)\n else:\n # Delete file\n try:\n os.remove(op.path)\n except FileNotFoundError:\n pass\n self.run_case_step(testcase, step)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_run.py_TestRun.run_case_step_TestRun.run_case_step._Assert_that_an_output_f": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_run.py_TestRun.run_case_step_TestRun.run_case_step._Assert_that_an_output_f", "embedding": null, "metadata": {"file_path": "mypyc/test/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 168, "end_line": 260, "span_ids": ["TestRun.run_case_step"], "tokens": 820}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRun(MypycDataSuite):\n\n def run_case_step(self, testcase: DataDrivenTestCase, incremental_step: int) -> None:\n bench = testcase.config.getoption('--bench', False) and 'Benchmark' in testcase.name\n\n options = Options()\n options.use_builtins_fixtures = True\n options.show_traceback = True\n options.strict_optional = True\n # N.B: We try to (and ought to!) run with the current\n # version of python, since we are going to link and run\n # against the current version of python.\n # But a lot of the tests use type annotations so we can't say it is 3.5.\n options.python_version = max(sys.version_info[:2], (3, 6))\n options.export_types = True\n options.preserve_asts = True\n options.incremental = self.separate\n\n # Avoid checking modules/packages named 'unchecked', to provide a way\n # to test interacting with code we don't have types for.\n options.per_module_options['unchecked.*'] = {'follow_imports': 'error'}\n\n source = build.BuildSource('native.py', 'native', None)\n sources = [source]\n module_names = ['native']\n module_paths = ['native.py']\n\n # Hard code another module name to compile in the same compilation unit.\n to_delete = []\n for fn, text in testcase.files:\n fn = os.path.relpath(fn, test_temp_dir)\n\n if os.path.basename(fn).startswith('other') and fn.endswith('.py'):\n name = fn.split('.')[0].replace(os.sep, '.')\n module_names.append(name)\n sources.append(build.BuildSource(fn, name, None))\n to_delete.append(fn)\n module_paths.append(fn)\n\n shutil.copyfile(fn,\n os.path.join(os.path.dirname(fn), name + '_interpreted.py'))\n\n for source in sources:\n options.per_module_options.setdefault(source.module, {})['mypyc'] = True\n\n separate = (self.get_separate('\\n'.join(testcase.input), incremental_step) if self.separate\n else False)\n\n groups = construct_groups(sources, separate, len(module_names) > 1)\n\n try:\n compiler_options = CompilerOptions(multi_file=self.multi_file, separate=self.separate)\n result = emitmodule.parse_and_typecheck(\n sources=sources,\n options=options,\n compiler_options=compiler_options,\n groups=groups,\n alt_lib_path='.')\n errors = Errors()\n ir, cfiles = emitmodule.compile_modules_to_c(\n result,\n compiler_options=compiler_options,\n errors=errors,\n groups=groups,\n )\n if errors.num_errors:\n errors.flush_errors()\n assert False, \"Compile error\"\n except CompileError as e:\n for line in e.messages:\n print(fix_native_line_number(line, testcase.file, testcase.line))\n assert False, 'Compile error'\n\n # Check that serialization works on this IR. (Only on the first\n # step because the the returned ir only includes updated code.)\n if incremental_step == 1:\n check_serialization_roundtrip(ir)\n\n opt_level = int(os.environ.get('MYPYC_OPT_LEVEL', 0))\n\n setup_file = os.path.abspath(os.path.join(WORKDIR, 'setup.py'))\n # We pass the C file information to the build script via setup.py unfortunately\n with open(setup_file, 'w', encoding='utf-8') as f:\n f.write(setup_format.format(module_paths,\n separate,\n cfiles,\n self.multi_file,\n opt_level))\n\n if not run_setup(setup_file, ['build_ext', '--inplace']):\n if testcase.config.getoption('--mypyc-showc'):\n show_c(cfiles)\n assert False, \"Compilation failed\"\n\n # Assert that an output file got created\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_run.py_TestRun.run_case_step.suffix_TestRun.get_separate.if_m_.else_.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_run.py_TestRun.run_case_step.suffix_TestRun.get_separate.if_m_.else_.return.True", "embedding": null, "metadata": {"file_path": "mypyc/test/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 261, "end_line": 342, "span_ids": ["TestRun.run_case_step", "TestRun.get_separate"], "tokens": 818}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRun(MypycDataSuite):\n\n def run_case_step(self, testcase: DataDrivenTestCase, incremental_step: int) -> None:\n # ... other code\n suffix = 'pyd' if sys.platform == 'win32' else 'so'\n assert glob.glob('native.*.{}'.format(suffix))\n\n driver_path = 'driver.py'\n if not os.path.isfile(driver_path):\n # No driver.py provided by test case. Use the default one\n # (mypyc/test-data/driver/driver.py) that calls each\n # function named test_*.\n default_driver = os.path.join(\n os.path.dirname(__file__), '..', 'test-data', 'driver', 'driver.py')\n shutil.copy(default_driver, driver_path)\n env = os.environ.copy()\n env['MYPYC_RUN_BENCH'] = '1' if bench else '0'\n\n # XXX: This is an ugly hack.\n if 'MYPYC_RUN_GDB' in os.environ:\n if platform.system() == 'Darwin':\n subprocess.check_call(['lldb', '--', sys.executable, driver_path], env=env)\n assert False, (\"Test can't pass in lldb mode. (And remember to pass -s to \"\n \"pytest)\")\n elif platform.system() == 'Linux':\n subprocess.check_call(['gdb', '--args', sys.executable, driver_path], env=env)\n assert False, (\"Test can't pass in gdb mode. (And remember to pass -s to \"\n \"pytest)\")\n else:\n assert False, 'Unsupported OS'\n\n proc = subprocess.Popen([sys.executable, driver_path], stdout=subprocess.PIPE,\n stderr=subprocess.STDOUT, env=env)\n output = proc.communicate()[0].decode('utf8')\n outlines = output.splitlines()\n\n if testcase.config.getoption('--mypyc-showc'):\n show_c(cfiles)\n if proc.returncode != 0:\n print()\n print('*** Exit status: %d' % proc.returncode)\n\n # Verify output.\n if bench:\n print('Test output:')\n print(output)\n else:\n if incremental_step == 1:\n msg = 'Invalid output'\n expected = testcase.output\n else:\n msg = 'Invalid output (step {})'.format(incremental_step)\n expected = testcase.output2.get(incremental_step, [])\n\n if not expected:\n # Tweak some line numbers, but only if the expected output is empty,\n # as tweaked output might not match expected output.\n outlines = [fix_native_line_number(line, testcase.file, testcase.line)\n for line in outlines]\n assert_test_output(testcase, outlines, msg, expected)\n\n if incremental_step > 1 and options.incremental:\n suffix = '' if incremental_step == 2 else str(incremental_step - 1)\n expected_rechecked = testcase.expected_rechecked_modules.get(incremental_step - 1)\n if expected_rechecked is not None:\n assert_module_equivalence(\n 'rechecked' + suffix,\n expected_rechecked, result.manager.rechecked_modules)\n expected_stale = testcase.expected_stale_modules.get(incremental_step - 1)\n if expected_stale is not None:\n assert_module_equivalence(\n 'stale' + suffix,\n expected_stale, result.manager.stale_modules)\n\n assert proc.returncode == 0\n\n def get_separate(self, program_text: str,\n incremental_step: int) -> Any:\n template = r'# separate{}: (\\[.*\\])$'\n m = re.search(template.format(incremental_step), program_text, flags=re.MULTILINE)\n if not m:\n m = re.search(template.format(''), program_text, flags=re.MULTILINE)\n if m:\n return ast.literal_eval(m.group(1))\n else:\n return True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_run.py_TestRunMultiFile_TestRunSeparate.files._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_run.py_TestRunMultiFile_TestRunSeparate.files._", "embedding": null, "metadata": {"file_path": "mypyc/test/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 345, "end_line": 364, "span_ids": ["TestRunMultiFile", "TestRunSeparate"], "tokens": 117}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestRunMultiFile(TestRun):\n \"\"\"Run the main multi-module tests in multi-file compilation mode.\"\"\"\n\n multi_file = True\n test_name_suffix = '_multi'\n files = [\n 'run-multimodule.test',\n 'run-mypy-sim.test',\n ]\n\n\nclass TestRunSeparate(TestRun):\n \"\"\"Run the main multi-module tests in separate compilation mode.\"\"\"\n\n separate = True\n test_name_suffix = '_separate'\n files = [\n 'run-multimodule.test',\n 'run-mypy-sim.test',\n ]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_run.py_fix_native_line_number_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_run.py_fix_native_line_number_", "embedding": null, "metadata": {"file_path": "mypyc/test/test_run.py", "file_name": "test_run.py", "file_type": "text/x-python", "category": "test", "start_line": 367, "end_line": 390, "span_ids": ["fix_native_line_number"], "tokens": 264}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def fix_native_line_number(message: str, fnam: str, delta: int) -> str:\n \"\"\"Update code locations in test case output to point to the .test file.\n\n The description of the test case is written to native.py, and line numbers\n in test case output often are relative to native.py. This translates the\n line numbers to be relative to the .test file that contains the test case\n description, and also updates the file name to the .test file name.\n\n Args:\n message: message to update\n fnam: path of the .test file\n delta: line number of the beginning of the test case in the .test file\n\n Returns updated message (or original message if we couldn't find anything).\n \"\"\"\n fnam = os.path.basename(fnam)\n message = re.sub(r'native\\.py:([0-9]+):',\n lambda m: '%s:%d:' % (fnam, int(m.group(1)) + delta),\n message)\n message = re.sub(r'\"native.py\", line ([0-9]+),',\n lambda m: '\"%s\", line %d,' % (fnam, int(m.group(1)) + delta),\n message)\n return message", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_serialization.py__Functions_to_check_tha_get_function_dict.return.d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_serialization.py__Functions_to_check_tha_get_function_dict.return.d", "embedding": null, "metadata": {"file_path": "mypyc/test/test_serialization.py", "file_name": "test_serialization.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 30, "span_ids": ["get_dict", "get_function_dict", "docstring"], "tokens": 257}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Functions to check that serialization round-tripped properly.\"\"\"\n\n# This file is named test_serialization.py even though it doesn't\n# contain its own tests so that pytest will rewrite the asserts...\n\nfrom typing import Any, Dict, Tuple\nfrom mypy.ordered_dict import OrderedDict\nfrom collections.abc import Iterable\n\nfrom mypyc.ir.ops import DeserMaps\nfrom mypyc.ir.rtypes import RType\nfrom mypyc.ir.func_ir import FuncDecl, FuncIR, FuncSignature\nfrom mypyc.ir.class_ir import ClassIR\nfrom mypyc.ir.module_ir import ModuleIR, deserialize_modules\nfrom mypyc.sametype import is_same_type, is_same_signature\n\n\ndef get_dict(x: Any) -> Dict[str, Any]:\n if hasattr(x, '__mypyc_attrs__'):\n return {k: getattr(x, k) for k in x.__mypyc_attrs__ if hasattr(x, k)}\n else:\n return dict(x.__dict__)\n\n\ndef get_function_dict(x: FuncIR) -> Dict[str, Any]:\n \"\"\"Get a dict of function attributes safe to compare across serialization\"\"\"\n d = get_dict(x)\n d.pop('blocks', None)\n d.pop('env', None)\n return d", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_serialization.py_assert_blobs_same_assert_blobs_same.if_isinstance_x_FuncDec.else_.assert_x_y_Value_mis": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_serialization.py_assert_blobs_same_assert_blobs_same.if_isinstance_x_FuncDec.else_.assert_x_y_Value_mis", "embedding": null, "metadata": {"file_path": "mypyc/test/test_serialization.py", "file_name": "test_serialization.py", "file_type": "text/x-python", "category": "test", "start_line": 33, "end_line": 69, "span_ids": ["assert_blobs_same"], "tokens": 418}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def assert_blobs_same(x: Any, y: Any, trail: Tuple[Any, ...]) -> None:\n \"\"\"Compare two blobs of IR as best we can.\n\n FuncDecls, FuncIRs, and ClassIRs are compared by fullname to avoid\n infinite recursion.\n (More detailed comparisons should be done manually.)\n\n Types and signatures are compared using mypyc.sametype.\n\n Containers are compared recursively.\n\n Anything else is compared with ==.\n\n The `trail` argument is used in error messages.\n \"\"\"\n\n assert type(x) is type(y), (\"Type mismatch at {}\".format(trail), type(x), type(y))\n if isinstance(x, (FuncDecl, FuncIR, ClassIR)):\n assert x.fullname == y.fullname, \"Name mismatch at {}\".format(trail)\n elif isinstance(x, OrderedDict):\n assert len(x.keys()) == len(y.keys()), \"Keys mismatch at {}\".format(trail)\n for (xk, xv), (yk, yv) in zip(x.items(), y.items()):\n assert_blobs_same(xk, yk, trail + (\"keys\",))\n assert_blobs_same(xv, yv, trail + (xk,))\n elif isinstance(x, dict):\n assert x.keys() == y.keys(), \"Keys mismatch at {}\".format(trail)\n for k in x.keys():\n assert_blobs_same(x[k], y[k], trail + (k,))\n elif isinstance(x, Iterable) and not isinstance(x, str):\n for i, (xv, yv) in enumerate(zip(x, y)):\n assert_blobs_same(xv, yv, trail + (i,))\n elif isinstance(x, RType):\n assert is_same_type(x, y), \"RType mismatch at {}\".format(trail)\n elif isinstance(x, FuncSignature):\n assert is_same_signature(x, y), \"Signature mismatch at {}\".format(trail)\n else:\n assert x == y, \"Value mismatch at {}\".format(trail)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_serialization.py_assert_modules_same_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_serialization.py_assert_modules_same_", "embedding": null, "metadata": {"file_path": "mypyc/test/test_serialization.py", "file_name": "test_serialization.py", "file_type": "text/x-python", "category": "test", "start_line": 72, "end_line": 105, "span_ids": ["assert_modules_same", "check_serialization_roundtrip"], "tokens": 344}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def assert_modules_same(ir1: ModuleIR, ir2: ModuleIR) -> None:\n \"\"\"Assert that two module IRs are the same (*).\n\n * Or rather, as much as we care about preserving across\n serialization. We drop the actual IR bodies of functions but try\n to preserve everything else.\n \"\"\"\n assert ir1.fullname == ir2.fullname\n\n assert ir1.imports == ir2.imports\n\n for cls1, cls2 in zip(ir1.classes, ir2.classes):\n assert_blobs_same(get_dict(cls1), get_dict(cls2), (ir1.fullname, cls1.fullname))\n\n for fn1, fn2 in zip(ir1.functions, ir2.functions):\n assert_blobs_same(get_function_dict(fn1), get_function_dict(fn2),\n (ir1.fullname, fn1.fullname))\n assert_blobs_same(get_dict(fn1.decl), get_dict(fn2.decl),\n (ir1.fullname, fn1.fullname))\n\n assert_blobs_same(ir1.final_names, ir2.final_names, (ir1.fullname, 'final_names'))\n\n\ndef check_serialization_roundtrip(irs: Dict[str, ModuleIR]) -> None:\n \"\"\"Check that we can serialize modules out and deserialize them to the same thing.\"\"\"\n serialized = {k: ir.serialize() for k, ir in irs.items()}\n\n ctx = DeserMaps({}, {})\n irs2 = deserialize_modules(serialized, ctx)\n assert irs.keys() == irs2.keys()\n\n for k in irs:\n assert_modules_same(irs[k], irs2[k])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_struct.py_unittest_TestStruct.test_struct_offsets.assert_r7_size_12": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_struct.py_unittest_TestStruct.test_struct_offsets.assert_r7_size_12", "embedding": null, "metadata": {"file_path": "mypyc/test/test_struct.py", "file_name": "test_struct.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 43, "span_ids": ["imports", "TestStruct.test_struct_offsets", "TestStruct"], "tokens": 430}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import unittest\n\nfrom mypyc.ir.rtypes import (\n RStruct, bool_rprimitive, int64_rprimitive, int32_rprimitive, object_rprimitive,\n int_rprimitive\n)\nfrom mypyc.rt_subtype import is_runtime_subtype\n\n\nclass TestStruct(unittest.TestCase):\n def test_struct_offsets(self) -> None:\n # test per-member alignment\n r = RStruct(\"\", [], [bool_rprimitive, int32_rprimitive, int64_rprimitive])\n assert r.size == 16\n assert r.offsets == [0, 4, 8]\n\n # test final alignment\n r1 = RStruct(\"\", [], [bool_rprimitive, bool_rprimitive])\n assert r1.size == 2\n assert r1.offsets == [0, 1]\n r2 = RStruct(\"\", [], [int32_rprimitive, bool_rprimitive])\n r3 = RStruct(\"\", [], [int64_rprimitive, bool_rprimitive])\n assert r2.offsets == [0, 4]\n assert r3.offsets == [0, 8]\n assert r2.size == 8\n assert r3.size == 16\n\n r4 = RStruct(\"\", [], [bool_rprimitive, bool_rprimitive,\n bool_rprimitive, int32_rprimitive])\n assert r4.size == 8\n assert r4.offsets == [0, 1, 2, 4]\n\n # test nested struct\n r5 = RStruct(\"\", [], [bool_rprimitive, r])\n assert r5.offsets == [0, 8]\n assert r5.size == 24\n r6 = RStruct(\"\", [], [int32_rprimitive, r5])\n assert r6.offsets == [0, 8]\n assert r6.size == 32\n # test nested struct with alignment less than 8\n r7 = RStruct(\"\", [], [bool_rprimitive, r4])\n assert r7.offsets == [0, 4]\n assert r7.size == 12", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_struct.py_TestStruct.test_struct_str_TestStruct.test_struct_str.assert_repr_r2_RStr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_struct.py_TestStruct.test_struct_str_TestStruct.test_struct_str.assert_repr_r2_RStr", "embedding": null, "metadata": {"file_path": "mypyc/test/test_struct.py", "file_name": "test_struct.py", "file_type": "text/x-python", "category": "test", "start_line": 45, "end_line": 56, "span_ids": ["TestStruct.test_struct_str"], "tokens": 180}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestStruct(unittest.TestCase):\n\n def test_struct_str(self) -> None:\n r = RStruct(\"Foo\", [\"a\", \"b\"],\n [bool_rprimitive, object_rprimitive])\n assert str(r) == \"Foo{a:bool, b:object}\"\n assert repr(r) == \", \" \\\n \"b:}>\"\n r1 = RStruct(\"Bar\", [\"c\"], [int32_rprimitive])\n assert str(r1) == \"Bar{c:int32}\"\n assert repr(r1) == \"}>\"\n r2 = RStruct(\"Baz\", [], [])\n assert str(r2) == \"Baz{}\"\n assert repr(r2) == \"\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_struct.py_TestStruct.test_runtime_subtype_TestStruct.test_runtime_subtype.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_struct.py_TestStruct.test_runtime_subtype_TestStruct.test_runtime_subtype.None_4", "embedding": null, "metadata": {"file_path": "mypyc/test/test_struct.py", "file_name": "test_struct.py", "file_type": "text/x-python", "category": "test", "start_line": 58, "end_line": 87, "span_ids": ["TestStruct.test_runtime_subtype"], "tokens": 280}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestStruct(unittest.TestCase):\n\n def test_runtime_subtype(self) -> None:\n # right type to check with\n r = RStruct(\"Foo\", [\"a\", \"b\"],\n [bool_rprimitive, int_rprimitive])\n\n # using the exact same fields\n r1 = RStruct(\"Foo\", [\"a\", \"b\"],\n [bool_rprimitive, int_rprimitive])\n\n # names different\n r2 = RStruct(\"Bar\", [\"c\", \"b\"],\n [bool_rprimitive, int_rprimitive])\n\n # name different\n r3 = RStruct(\"Baz\", [\"a\", \"b\"],\n [bool_rprimitive, int_rprimitive])\n\n # type different\n r4 = RStruct(\"FooBar\", [\"a\", \"b\"],\n [bool_rprimitive, int32_rprimitive])\n\n # number of types different\n r5 = RStruct(\"FooBarBaz\", [\"a\", \"b\", \"c\"],\n [bool_rprimitive, int_rprimitive, bool_rprimitive])\n\n assert is_runtime_subtype(r1, r) is True\n assert is_runtime_subtype(r2, r) is False\n assert is_runtime_subtype(r3, r) is False\n assert is_runtime_subtype(r4, r) is False\n assert is_runtime_subtype(r5, r) is False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_struct.py_TestStruct.test_eq_and_hash_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_struct.py_TestStruct.test_eq_and_hash_", "embedding": null, "metadata": {"file_path": "mypyc/test/test_struct.py", "file_name": "test_struct.py", "file_type": "text/x-python", "category": "test", "start_line": 89, "end_line": 116, "span_ids": ["TestStruct.test_eq_and_hash"], "tokens": 236}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestStruct(unittest.TestCase):\n\n def test_eq_and_hash(self) -> None:\n r = RStruct(\"Foo\", [\"a\", \"b\"],\n [bool_rprimitive, int_rprimitive])\n\n # using the exact same fields\n r1 = RStruct(\"Foo\", [\"a\", \"b\"],\n [bool_rprimitive, int_rprimitive])\n assert hash(r) == hash(r1)\n assert r == r1\n\n # different name\n r2 = RStruct(\"Foq\", [\"a\", \"b\"],\n [bool_rprimitive, int_rprimitive])\n assert hash(r) != hash(r2)\n assert r != r2\n\n # different names\n r3 = RStruct(\"Foo\", [\"a\", \"c\"],\n [bool_rprimitive, int_rprimitive])\n assert hash(r) != hash(r3)\n assert r != r3\n\n # different type\n r4 = RStruct(\"Foo\", [\"a\", \"b\"],\n [bool_rprimitive, int_rprimitive, bool_rprimitive])\n assert hash(r) != hash(r4)\n assert r != r4", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_subtype.py__Test_cases_for_is_subt_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_subtype.py__Test_cases_for_is_subt_", "embedding": null, "metadata": {"file_path": "mypyc/test/test_subtype.py", "file_name": "test_subtype.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 28, "span_ids": ["TestSubtype", "TestRuntimeSubtype.test_bool", "docstring", "TestSubtype.test_bool", "TestRuntimeSubtype", "TestSubtype.test_bit", "TestRuntimeSubtype.test_bit"], "tokens": 210}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Test cases for is_subtype and is_runtime_subtype.\"\"\"\n\nimport unittest\n\nfrom mypyc.ir.rtypes import bit_rprimitive, bool_rprimitive, int_rprimitive\nfrom mypyc.subtype import is_subtype\nfrom mypyc.rt_subtype import is_runtime_subtype\n\n\nclass TestSubtype(unittest.TestCase):\n def test_bit(self) -> None:\n assert is_subtype(bit_rprimitive, bool_rprimitive)\n assert is_subtype(bit_rprimitive, int_rprimitive)\n\n def test_bool(self) -> None:\n assert not is_subtype(bool_rprimitive, bit_rprimitive)\n assert is_subtype(bool_rprimitive, int_rprimitive)\n\n\nclass TestRuntimeSubtype(unittest.TestCase):\n def test_bit(self) -> None:\n assert is_runtime_subtype(bit_rprimitive, bool_rprimitive)\n assert not is_runtime_subtype(bit_rprimitive, int_rprimitive)\n\n def test_bool(self) -> None:\n assert not is_runtime_subtype(bool_rprimitive, bit_rprimitive)\n assert not is_runtime_subtype(bool_rprimitive, int_rprimitive)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_tuplename.py_unittest_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_tuplename.py_unittest_", "embedding": null, "metadata": {"file_path": "mypyc/test/test_tuplename.py", "file_name": "test_tuplename.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 24, "span_ids": ["TestTupleNames.setUp", "imports", "TestTupleNames", "TestTupleNames.test_names"], "tokens": 257}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import unittest\n\nfrom mypyc.ir.rtypes import (\n RTuple, object_rprimitive, int_rprimitive, bool_rprimitive, list_rprimitive,\n RInstance, RUnion,\n)\nfrom mypyc.ir.class_ir import ClassIR\n\n\nclass TestTupleNames(unittest.TestCase):\n def setUp(self) -> None:\n self.inst_a = RInstance(ClassIR('A', '__main__'))\n self.inst_b = RInstance(ClassIR('B', '__main__'))\n\n def test_names(self) -> None:\n assert RTuple([int_rprimitive, int_rprimitive]).unique_id == \"T2II\"\n assert RTuple([list_rprimitive, object_rprimitive, self.inst_a]).unique_id == \"T3OOO\"\n assert RTuple([list_rprimitive, object_rprimitive, self.inst_b]).unique_id == \"T3OOO\"\n assert RTuple([]).unique_id == \"T0\"\n assert RTuple([RTuple([]),\n RTuple([int_rprimitive, int_rprimitive])]).unique_id == \"T2T0T2II\"\n assert RTuple([bool_rprimitive,\n RUnion([bool_rprimitive, int_rprimitive])]).unique_id == \"T2CO\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/testutil.py__Helpers_for_writing_te_builtins_wrapper.return.lambda_testcase_perform_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/testutil.py__Helpers_for_writing_te_builtins_wrapper.return.lambda_testcase_perform_", "embedding": null, "metadata": {"file_path": "mypyc/test/testutil.py", "file_name": "testutil.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 45, "span_ids": ["builtins_wrapper", "MypycDataSuite", "docstring"], "tokens": 357}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Helpers for writing tests\"\"\"\n\nimport contextlib\nimport os\nimport os.path\nimport re\nimport shutil\nfrom typing import List, Callable, Iterator, Optional, Tuple\n\nimport pytest\n\nfrom mypy import build\nfrom mypy.errors import CompileError\nfrom mypy.options import Options\nfrom mypy.test.data import DataSuite, DataDrivenTestCase\nfrom mypy.test.config import test_temp_dir\nfrom mypy.test.helpers import assert_string_arrays_equal\n\nfrom mypyc.options import CompilerOptions\nfrom mypyc.ir.func_ir import FuncIR\nfrom mypyc.errors import Errors\nfrom mypyc.irbuild.main import build_ir\nfrom mypyc.irbuild.mapper import Mapper\nfrom mypyc.test.config import test_data_prefix\nfrom mypyc.common import IS_32_BIT_PLATFORM, PLATFORM_SIZE\n\n# The builtins stub used during icode generation test cases.\nICODE_GEN_BUILTINS = os.path.join(test_data_prefix, 'fixtures/ir.py')\n# The testutil support library\nTESTUTIL_PATH = os.path.join(test_data_prefix, 'fixtures/testutil.py')\n\n\nclass MypycDataSuite(DataSuite):\n # Need to list no files, since this will be picked up as a suite of tests\n files = [] # type: List[str]\n data_prefix = test_data_prefix\n\n\ndef builtins_wrapper(func: Callable[[DataDrivenTestCase], None],\n path: str) -> Callable[[DataDrivenTestCase], None]:\n \"\"\"Decorate a function that implements a data-driven test case to copy an\n alternative builtins module implementation in place before performing the\n test case. Clean up after executing the test case.\n \"\"\"\n return lambda testcase: perform_test(func, path, testcase)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/testutil.py_use_custom_builtins_use_custom_builtins.if_default_builtins_.os_remove_builtins_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/testutil.py_use_custom_builtins_use_custom_builtins.if_default_builtins_.os_remove_builtins_", "embedding": null, "metadata": {"file_path": "mypyc/test/testutil.py", "file_name": "testutil.py", "file_type": "text/x-python", "category": "test", "start_line": 48, "end_line": 65, "span_ids": ["use_custom_builtins"], "tokens": 146}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@contextlib.contextmanager\ndef use_custom_builtins(builtins_path: str, testcase: DataDrivenTestCase) -> Iterator[None]:\n for path, _ in testcase.files:\n if os.path.basename(path) == 'builtins.pyi':\n default_builtins = False\n break\n else:\n # Use default builtins.\n builtins = os.path.abspath(os.path.join(test_temp_dir, 'builtins.pyi'))\n shutil.copyfile(builtins_path, builtins)\n default_builtins = True\n\n # Actually peform the test case.\n yield None\n\n if default_builtins:\n # Clean up.\n os.remove(builtins)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/testutil.py_perform_test_perform_test.if_default_builtins_.os_remove_builtins_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/testutil.py_perform_test_perform_test.if_default_builtins_.os_remove_builtins_", "embedding": null, "metadata": {"file_path": "mypyc/test/testutil.py", "file_name": "testutil.py", "file_type": "text/x-python", "category": "test", "start_line": 68, "end_line": 85, "span_ids": ["perform_test"], "tokens": 141}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def perform_test(func: Callable[[DataDrivenTestCase], None],\n builtins_path: str, testcase: DataDrivenTestCase) -> None:\n for path, _ in testcase.files:\n if os.path.basename(path) == 'builtins.py':\n default_builtins = False\n break\n else:\n # Use default builtins.\n builtins = os.path.join(test_temp_dir, 'builtins.py')\n shutil.copyfile(builtins_path, builtins)\n default_builtins = True\n\n # Actually peform the test case.\n func(testcase)\n\n if default_builtins:\n # Clean up.\n os.remove(builtins)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/testutil.py_build_ir_for_single_file_build_ir_for_single_file.return.module_functions": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/testutil.py_build_ir_for_single_file_build_ir_for_single_file.return.module_functions", "embedding": null, "metadata": {"file_path": "mypyc/test/testutil.py", "file_name": "testutil.py", "file_type": "text/x-python", "category": "test", "start_line": 88, "end_line": 123, "span_ids": ["build_ir_for_single_file"], "tokens": 306}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def build_ir_for_single_file(input_lines: List[str],\n compiler_options: Optional[CompilerOptions] = None) -> List[FuncIR]:\n program_text = '\\n'.join(input_lines)\n\n # By default generate IR compatible with the earliest supported Python C API.\n # If a test needs more recent API features, this should be overridden.\n compiler_options = compiler_options or CompilerOptions(capi_version=(3, 5))\n options = Options()\n options.show_traceback = True\n options.use_builtins_fixtures = True\n options.strict_optional = True\n options.python_version = (3, 6)\n options.export_types = True\n options.preserve_asts = True\n options.per_module_options['__main__'] = {'mypyc': True}\n\n source = build.BuildSource('main', '__main__', program_text)\n # Construct input as a single single.\n # Parse and type check the input program.\n result = build.build(sources=[source],\n options=options,\n alt_lib_path=test_temp_dir)\n if result.errors:\n raise CompileError(result.errors)\n\n errors = Errors()\n modules = build_ir(\n [result.files['__main__']], result.graph, result.types,\n Mapper({'__main__': None}),\n compiler_options, errors)\n if errors.num_errors:\n errors.flush_errors()\n pytest.fail('Errors while building IR')\n\n module = list(modules.values())[0]\n return module.functions", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/testutil.py_update_testcase_output_update_testcase_output.None_3.print_data_file_f_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/testutil.py_update_testcase_output_update_testcase_output.None_3.print_data_file_f_", "embedding": null, "metadata": {"file_path": "mypyc/test/testutil.py", "file_name": "testutil.py", "file_type": "text/x-python", "category": "test", "start_line": 124, "end_line": 149, "span_ids": ["update_testcase_output"], "tokens": 292}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def update_testcase_output(testcase: DataDrivenTestCase, output: List[str]) -> None:\n # TODO: backport this to mypy\n assert testcase.old_cwd is not None, \"test was not properly set up\"\n testcase_path = os.path.join(testcase.old_cwd, testcase.file)\n with open(testcase_path) as f:\n data_lines = f.read().splitlines()\n\n # We can't rely on the test line numbers to *find* the test, since\n # we might fix multiple tests in a run. So find it by the case\n # header. Give up if there are multiple tests with the same name.\n test_slug = '[case {}]'.format(testcase.name)\n if data_lines.count(test_slug) != 1:\n return\n start_idx = data_lines.index(test_slug)\n stop_idx = start_idx + 11\n while stop_idx < len(data_lines) and not data_lines[stop_idx].startswith('[case '):\n stop_idx += 1\n\n test = data_lines[start_idx:stop_idx]\n out_start = test.index('[out]')\n test[out_start + 1:] = output\n data_lines[start_idx:stop_idx] = test + ['']\n data = '\\n'.join(data_lines)\n\n with open(testcase_path, 'w') as f:\n print(data, file=f)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/testutil.py_assert_test_output_assert_test_output.assert_string_arrays_equa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/testutil.py_assert_test_output_assert_test_output.assert_string_arrays_equa", "embedding": null, "metadata": {"file_path": "mypyc/test/testutil.py", "file_name": "testutil.py", "file_type": "text/x-python", "category": "test", "start_line": 152, "end_line": 163, "span_ids": ["assert_test_output"], "tokens": 114}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def assert_test_output(testcase: DataDrivenTestCase,\n actual: List[str],\n message: str,\n expected: Optional[List[str]] = None,\n formatted: Optional[List[str]] = None) -> None:\n expected_output = expected if expected is not None else testcase.output\n if expected_output != actual and testcase.config.getoption('--update-data', False):\n update_testcase_output(testcase, actual)\n\n assert_string_arrays_equal(\n expected_output, actual,\n '{} ({}, line {})'.format(message, testcase.file, testcase.line))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/testutil.py_get_func_names_replace_native_int.return._s_replace_native_int_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/testutil.py_get_func_names_replace_native_int.return._s_replace_native_int_", "embedding": null, "metadata": {"file_path": "mypyc/test/testutil.py", "file_name": "testutil.py", "file_type": "text/x-python", "category": "test", "start_line": 166, "end_line": 219, "span_ids": ["print_with_line_numbers", "show_c", "remove_comment_lines", "get_func_names", "heading", "fudge_dir_mtimes", "replace_native_int"], "tokens": 421}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_func_names(expected: List[str]) -> List[str]:\n res = []\n for s in expected:\n m = re.match(r'def ([_a-zA-Z0-9.*$]+)\\(', s)\n if m:\n res.append(m.group(1))\n return res\n\n\ndef remove_comment_lines(a: List[str]) -> List[str]:\n \"\"\"Return a copy of array with comments removed.\n\n Lines starting with '--' (but not with '---') are removed.\n \"\"\"\n r = []\n for s in a:\n if s.strip().startswith('--') and not s.strip().startswith('---'):\n pass\n else:\n r.append(s)\n return r\n\n\ndef print_with_line_numbers(s: str) -> None:\n lines = s.splitlines()\n for i, line in enumerate(lines):\n print('%-4d %s' % (i + 1, line))\n\n\ndef heading(text: str) -> None:\n print('=' * 20 + ' ' + text + ' ' + '=' * 20)\n\n\ndef show_c(cfiles: List[List[Tuple[str, str]]]) -> None:\n heading('Generated C')\n for group in cfiles:\n for cfile, ctext in group:\n print('== {} =='.format(cfile))\n print_with_line_numbers(ctext)\n heading('End C')\n\n\ndef fudge_dir_mtimes(dir: str, delta: int) -> None:\n for dirpath, _, filenames in os.walk(dir):\n for name in filenames:\n path = os.path.join(dirpath, name)\n new_mtime = os.stat(path).st_mtime + delta\n os.utime(path, times=(new_mtime, new_mtime))\n\n\ndef replace_native_int(text: List[str]) -> List[str]:\n \"\"\"Replace native_int with platform specific ints\"\"\"\n int_format_str = 'int32' if IS_32_BIT_PLATFORM else 'int64'\n return [s.replace('native_int', int_format_str) for s in text]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test-data/driver/driver.py__Default_driver_for_run_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test-data/driver/driver.py__Default_driver_for_run_", "embedding": null, "metadata": {"file_path": "mypyc/test-data/driver/driver.py", "file_name": "driver.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 42, "span_ids": ["docstring"], "tokens": 264}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Default driver for run tests (run-*.test).\n\nThis imports the 'native' module (containing the compiled test cases)\nand calls each function starting with test_, and reports any\nexceptions as failures.\n\nTest cases can provide a custom driver.py that overrides this file.\n\"\"\"\n\nimport sys\nimport native\n\nfailures = []\n\nfor name in dir(native):\n if name.startswith('test_'):\n test_func = getattr(native, name)\n try:\n test_func()\n except Exception as e:\n failures.append(sys.exc_info())\n\nif failures:\n from traceback import print_exception, format_tb\n import re\n\n def extract_line(tb):\n formatted = '\\n'.join(format_tb(tb))\n m = re.search('File \"native.py\", line ([0-9]+), in test_', formatted)\n return m.group(1)\n\n # Sort failures by line number of test function.\n failures = sorted(failures, key=lambda e: extract_line(e[2]))\n\n # If there are multiple failures, print stack traces of all but the final failure.\n for e in failures[:-1]:\n print_exception(*e)\n print()\n\n # Raise exception for the last failure. Test runner will show the traceback.\n raise failures[-1][1]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test-data/fixtures/ir.py__These_builtins_stubs_ar_ellipsis.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test-data/fixtures/ir.py__These_builtins_stubs_ar_ellipsis.pass", "embedding": null, "metadata": {"file_path": "mypyc/test-data/fixtures/ir.py", "file_name": "ir.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 25, "span_ids": ["object.__ne__", "object.__eq__", "type", "type:2", "docstring", "type.__init__", "object.__init__", "object", "ellipsis"], "tokens": 196}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# These builtins stubs are used implicitly in AST to IR generation\n# test cases.\n\nfrom typing import (\n TypeVar, Generic, List, Iterator, Iterable, Dict, Optional, Tuple, Any, Set,\n overload, Mapping, Union, Callable, Sequence,\n)\n\nT = TypeVar('T')\nT_co = TypeVar('T_co', covariant=True)\nS = TypeVar('S')\nK = TypeVar('K') # for keys in mapping\nV = TypeVar('V') # for values in mapping\n\nclass object:\n def __init__(self) -> None: pass\n def __eq__(self, x: object) -> bool: pass\n def __ne__(self, x: object) -> bool: pass\n\nclass type:\n def __init__(self, o: object) -> None: ...\n __name__ : str\n __annotations__: Dict[str, Any]\n\nclass ellipsis: pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test-data/fixtures/ir.py__Primitive_types_are_spe_int.__ge__.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test-data/fixtures/ir.py__Primitive_types_are_spe_int.__ge__.pass", "embedding": null, "metadata": {"file_path": "mypyc/test-data/fixtures/ir.py", "file_name": "ir.py", "file_type": "text/x-python", "category": "implementation", "start_line": 26, "end_line": 51, "span_ids": ["int.__invert__", "int.__ne__", "int.__le__", "int.__or__", "int.__neg__", "ellipsis", "int.__eq__", "int.__and__", "int", "int.__mul__", "int.__rshift__", "int.__xor__", "int.__mod__", "int.__gt__", "int.__add__", "int.__ge__", "int.__init__", "int.__floordiv__", "int.__pos__", "int.__init___1", "int.__lt__", "int.__sub__", "int.__lshift__"], "tokens": 352}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Primitive types are special in generated code.\n\nclass int:\n @overload\n def __init__(self) -> None: pass\n @overload\n def __init__(self, x: object, base: int = 10) -> None: pass\n def __add__(self, n: int) -> int: pass\n def __sub__(self, n: int) -> int: pass\n def __mul__(self, n: int) -> int: pass\n def __floordiv__(self, x: int) -> int: pass\n def __mod__(self, x: int) -> int: pass\n def __neg__(self) -> int: pass\n def __pos__(self) -> int: pass\n def __invert__(self) -> int: pass\n def __and__(self, n: int) -> int: pass\n def __or__(self, n: int) -> int: pass\n def __xor__(self, n: int) -> int: pass\n def __lshift__(self, x: int) -> int: pass\n def __rshift__(self, x: int) -> int: pass\n def __eq__(self, n: object) -> bool: pass\n def __ne__(self, n: object) -> bool: pass\n def __lt__(self, n: int) -> bool: pass\n def __gt__(self, n: int) -> bool: pass\n def __le__(self, n: int) -> bool: pass\n def __ge__(self, n: int) -> bool: pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test-data/fixtures/ir.py_float_bytes.join.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test-data/fixtures/ir.py_float_bytes.join.pass", "embedding": null, "metadata": {"file_path": "mypyc/test-data/fixtures/ir.py", "file_name": "ir.py", "file_type": "text/x-python", "category": "implementation", "start_line": 80, "end_line": 101, "span_ids": ["float.__mul__", "bytes", "bytes.__ne__", "float.__init__", "complex.__mul__", "float.__truediv__", "complex.__sub__", "bytes.join", "complex.__neg__", "complex.__truediv__", "complex.__add__", "float.__sub__", "float.__neg__", "float", "complex.__init__", "complex", "bytes.__init__", "bytes.__eq__", "bytes.__add__", "float.__add__"], "tokens": 282}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class float:\n def __init__(self, x: object) -> None: pass\n def __add__(self, n: float) -> float: pass\n def __sub__(self, n: float) -> float: pass\n def __mul__(self, n: float) -> float: pass\n def __truediv__(self, n: float) -> float: pass\n def __neg__(self) -> float: pass\n\nclass complex:\n def __init__(self, x: object, y: object = None) -> None: pass\n def __add__(self, n: complex) -> complex: pass\n def __sub__(self, n: complex) -> complex: pass\n def __mul__(self, n: complex) -> complex: pass\n def __truediv__(self, n: complex) -> complex: pass\n def __neg__(self) -> complex: pass\n\nclass bytes:\n def __init__(self, x: object) -> None: pass\n def __add__(self, x: object) -> bytes: pass\n def __eq__(self, x:object) -> bool:pass\n def __ne__(self, x: object) -> bool: pass\n def join(self, x: Iterable[object]) -> bytes: pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test-data/fixtures/ir.py_bool_bool.__xor___5._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test-data/fixtures/ir.py_bool_bool.__xor___5._", "embedding": null, "metadata": {"file_path": "mypyc/test-data/fixtures/ir.py", "file_name": "ir.py", "file_type": "text/x-python", "category": "implementation", "start_line": 100, "end_line": 113, "span_ids": ["bool.__xor__", "bool.__and__", "bool.__or__", "bool", "bool.__and___1", "bool.__xor___5", "bool.__init__", "bool.__or___3"], "tokens": 140}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class bool(int):\n def __init__(self, o: object = ...) -> None: ...\n @overload\n def __and__(self, n: bool) -> bool: ...\n @overload\n def __and__(self, n: int) -> int: ...\n @overload\n def __or__(self, n: bool) -> bool: ...\n @overload\n def __or__(self, n: int) -> int: ...\n @overload\n def __xor__(self, n: bool) -> bool: ...\n @overload\n def __xor__(self, n: int) -> int: ...", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test-data/fixtures/ir.py_tuple_function.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test-data/fixtures/ir.py_tuple_function.pass", "embedding": null, "metadata": {"file_path": "mypyc/test-data/fixtures/ir.py", "file_name": "ir.py", "file_type": "text/x-python", "category": "implementation", "start_line": 115, "end_line": 125, "span_ids": ["tuple.__getitem__", "tuple.__iter__", "tuple.__contains__", "tuple.__init__", "tuple.__getitem___1", "function", "tuple.__len__", "tuple"], "tokens": 124}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class tuple(Generic[T_co], Sequence[T_co], Iterable[T_co]):\n def __init__(self, i: Iterable[T_co]) -> None: pass\n @overload\n def __getitem__(self, i: int) -> T_co: pass\n @overload\n def __getitem__(self, i: slice) -> Tuple[T_co, ...]: pass\n def __len__(self) -> int: pass\n def __iter__(self) -> Iterator[T_co]: ...\n def __contains__(self, item: object) -> int: ...\n\nclass function: pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test-data/fixtures/ir.py_set_slice.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test-data/fixtures/ir.py_set_slice.pass", "embedding": null, "metadata": {"file_path": "mypyc/test-data/fixtures/ir.py", "file_name": "ir.py", "file_type": "text/x-python", "category": "implementation", "start_line": 172, "end_line": 184, "span_ids": ["set.clear", "set.pop", "slice", "set.__iter__", "set", "set.add", "set.__init__", "set.remove", "set.discard", "set.__len__", "set.__or__", "set.update"], "tokens": 156}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class set(Generic[T]):\n def __init__(self, i: Optional[Iterable[T]] = None) -> None: pass\n def __iter__(self) -> Iterator[T]: pass\n def __len__(self) -> int: pass\n def add(self, x: T) -> None: pass\n def remove(self, x: T) -> None: pass\n def discard(self, x: T) -> None: pass\n def clear(self) -> None: pass\n def pop(self) -> T: pass\n def update(self, x: Iterable[S]) -> None: pass\n def __or__(self, s: Set[S]) -> Set[Union[T, S]]: ...\n\nclass slice: pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test-data/fixtures/ir.py_property_property.fdel._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test-data/fixtures/ir.py_property_property.fdel._", "embedding": null, "metadata": {"file_path": "mypyc/test-data/fixtures/ir.py", "file_name": "ir.py", "file_type": "text/x-python", "category": "implementation", "start_line": 186, "end_line": 199, "span_ids": ["property.__delete__", "property.__init__", "property.fset", "property.fdel", "property.fget", "property.setter", "property.__get__", "property.getter", "property", "property.deleter", "property.__set__"], "tokens": 215}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class property:\n def __init__(self, fget: Optional[Callable[[Any], Any]] = ...,\n fset: Optional[Callable[[Any, Any], None]] = ...,\n fdel: Optional[Callable[[Any], None]] = ...,\n doc: Optional[str] = ...) -> None: ...\n def getter(self, fget: Callable[[Any], Any]) -> property: ...\n def setter(self, fset: Callable[[Any, Any], None]) -> property: ...\n def deleter(self, fdel: Callable[[Any], None]) -> property: ...\n def __get__(self, obj: Any, type: Optional[type] = ...) -> Any: ...\n def __set__(self, obj: Any, value: Any) -> None: ...\n def __delete__(self, obj: Any) -> None: ...\n def fget(self) -> Any: ...\n def fset(self, value: Any) -> None: ...\n def fdel(self) -> None: ...", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test-data/fixtures/ir.py_BaseException_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test-data/fixtures/ir.py_BaseException_", "embedding": null, "metadata": {"file_path": "mypyc/test-data/fixtures/ir.py", "file_name": "ir.py", "file_type": "text/x-python", "category": "implementation", "start_line": 210, "end_line": 271, "span_ids": ["TypeError", "any", "impl:11", "NotImplementedError", "len", "next_10", "enumerate", "next", "Exception", "UserWarning", "staticmethod", "LookupError", "AttributeError", "ValueError", "all", "exit", "hash", "zip_16", "RuntimeError", "KeyError", "eval", "id", "iter", "zip", "BaseException", "Exception.__init__", "range", "print", "Warning", "classmethod", "globals", "IndexError", "abs", "reversed", "NameError", "isinstance", "StopIteration", "setattr"], "tokens": 455}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseException: pass\n\nclass Exception(BaseException):\n def __init__(self, message: Optional[str] = None) -> None: pass\n\nclass Warning(Exception): pass\n\nclass UserWarning(Warning): pass\n\nclass TypeError(Exception): pass\n\nclass ValueError(Exception): pass\n\nclass AttributeError(Exception): pass\n\nclass NameError(Exception): pass\n\nclass LookupError(Exception): pass\n\nclass KeyError(LookupError): pass\n\nclass IndexError(LookupError): pass\n\nclass RuntimeError(Exception): pass\n\nclass NotImplementedError(RuntimeError): pass\n\nclass StopIteration(Exception):\n value: Any\n\ndef any(i: Iterable[T]) -> bool: pass\ndef all(i: Iterable[T]) -> bool: pass\ndef reversed(object: Sequence[T]) -> Iterator[T]: ...\ndef id(o: object) -> int: pass\n# This type is obviously wrong but the test stubs don't have Sized anymore\ndef len(o: object) -> int: pass\ndef print(*object) -> None: pass\ndef range(x: int, y: int = ..., z: int = ...) -> Iterator[int]: pass\ndef isinstance(x: object, t: object) -> bool: pass\ndef iter(i: Iterable[T]) -> Iterator[T]: pass\n@overload\ndef next(i: Iterator[T]) -> T: pass\n@overload\ndef next(i: Iterator[T], default: T) -> T: pass\ndef hash(o: object) -> int: ...\ndef globals() -> Dict[str, Any]: ...\ndef setattr(object: Any, name: str, value: Any) -> None: ...\ndef enumerate(x: Iterable[T]) -> Iterator[Tuple[int, T]]: ...\n@overload\ndef zip(x: Iterable[T], y: Iterable[S]) -> Iterator[Tuple[T, S]]: ...\n@overload\ndef zip(x: Iterable[T], y: Iterable[S], z: Iterable[V]) -> Iterator[Tuple[T, S, V]]: ...\ndef eval(e: str) -> Any: ...\ndef abs(x: float) -> float: ...\ndef exit() -> None: ...\n\n# Dummy definitions.\nclass classmethod: pass\nclass staticmethod: pass\n\nNotImplemented = ... # type: Any", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test-data/fixtures/testutil.py__Simple_support_library__V.TypeVar_V_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test-data/fixtures/testutil.py__Simple_support_library__V.TypeVar_V_", "embedding": null, "metadata": {"file_path": "mypyc/test-data/fixtures/testutil.py", "file_name": "testutil.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 18, "span_ids": ["assertRaises", "impl", "docstring"], "tokens": 151}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Simple support library for our run tests.\n\nfrom contextlib import contextmanager\nfrom typing import Iterator, TypeVar, Generator, Optional, List, Tuple, Sequence, Union\n\n@contextmanager\ndef assertRaises(typ: type, msg: str = '') -> Iterator[None]:\n try:\n yield\n except Exception as e:\n assert isinstance(e, typ), \"{} is not a {}\".format(e, typ.__name__)\n assert msg in str(e), 'Message \"{}\" does not match \"{}\"'.format(e, msg)\n else:\n assert False, \"Expected {} but got no exception\".format(typ.__name__)\n\nT = TypeVar('T')\nU = TypeVar('U')\nV = TypeVar('V')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test-data/fixtures/testutil.py_run_generator_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test-data/fixtures/testutil.py_run_generator_", "embedding": null, "metadata": {"file_path": "mypyc/test-data/fixtures/testutil.py", "file_name": "testutil.py", "file_type": "text/x-python", "category": "implementation", "start_line": 20, "end_line": 40, "span_ids": ["run_generator"], "tokens": 154}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def run_generator(gen: Generator[T, V, U],\n inputs: Optional[List[V]] = None,\n p: bool = False) -> Tuple[Sequence[T], Union[U, str]]:\n res = [] # type: List[T]\n i = -1\n while True:\n try:\n if i >= 0 and inputs:\n # ... fixtures don't have send\n val = gen.send(inputs[i]) # type: ignore\n else:\n val = next(gen)\n except StopIteration as e:\n return (tuple(res), e.value)\n except Exception as e:\n return (tuple(res), str(e))\n if p:\n print(val)\n res.append(val)\n i += 1", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/transform/exceptions.py__Transform_that_inserts_from_mypyc_ir_rtypes_impo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/transform/exceptions.py__Transform_that_inserts_from_mypyc_ir_rtypes_impo", "embedding": null, "metadata": {"file_path": "mypyc/transform/exceptions.py", "file_name": "exceptions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 19, "span_ids": ["docstring"], "tokens": 159}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Transform that inserts error checks after opcodes.\n\nWhen initially building the IR, the code doesn't perform error checks\nfor exceptions. This module is used to insert all required error checks\nafterwards. Each Op describes how it indicates an error condition (if\nat all).\n\nWe need to split basic blocks on each error check since branches can\nonly be placed at the end of a basic block.\n\"\"\"\n\nfrom typing import List, Optional\n\nfrom mypyc.ir.ops import (\n Value, BasicBlock, LoadErrorValue, Return, Branch, RegisterOp, Integer, ERR_NEVER, ERR_MAGIC,\n ERR_FALSE, ERR_ALWAYS, NO_TRACEBACK_LINE_NO\n)\nfrom mypyc.ir.func_ir import FuncIR\nfrom mypyc.ir.rtypes import bool_rprimitive", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/transform/exceptions.py_insert_exception_handling_add_handler_block.return.block": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/transform/exceptions.py_insert_exception_handling_add_handler_block.return.block", "embedding": null, "metadata": {"file_path": "mypyc/transform/exceptions.py", "file_name": "exceptions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 22, "end_line": 42, "span_ids": ["insert_exception_handling", "add_handler_block"], "tokens": 176}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def insert_exception_handling(ir: FuncIR) -> None:\n # Generate error block if any ops may raise an exception. If an op\n # fails without its own error handler, we'll branch to this\n # block. The block just returns an error value.\n error_label = None\n for block in ir.blocks:\n can_raise = any(op.can_raise() for op in block.ops)\n if can_raise:\n error_label = add_handler_block(ir)\n break\n if error_label:\n ir.blocks = split_blocks_at_errors(ir.blocks, error_label, ir.traceback_name)\n\n\ndef add_handler_block(ir: FuncIR) -> BasicBlock:\n block = BasicBlock()\n ir.blocks.append(block)\n op = LoadErrorValue(ir.ret_type)\n block.ops.append(op)\n block.ops.append(Return(op))\n return block", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/transform/exceptions.py_split_blocks_at_errors_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/transform/exceptions.py_split_blocks_at_errors_", "embedding": null, "metadata": {"file_path": "mypyc/transform/exceptions.py", "file_name": "exceptions.py", "file_type": "text/x-python", "category": "implementation", "start_line": 45, "end_line": 104, "span_ids": ["split_blocks_at_errors"], "tokens": 469}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def split_blocks_at_errors(blocks: List[BasicBlock],\n default_error_handler: BasicBlock,\n func_name: Optional[str]) -> List[BasicBlock]:\n new_blocks = [] # type: List[BasicBlock]\n\n # First split blocks on ops that may raise.\n for block in blocks:\n ops = block.ops\n block.ops = []\n cur_block = block\n new_blocks.append(cur_block)\n\n # If the block has an error handler specified, use it. Otherwise\n # fall back to the default.\n error_label = block.error_handler or default_error_handler\n block.error_handler = None\n\n for op in ops:\n target = op # type: Value\n cur_block.ops.append(op)\n if isinstance(op, RegisterOp) and op.error_kind != ERR_NEVER:\n # Split\n new_block = BasicBlock()\n new_blocks.append(new_block)\n\n if op.error_kind == ERR_MAGIC:\n # Op returns an error value on error that depends on result RType.\n variant = Branch.IS_ERROR\n negated = False\n elif op.error_kind == ERR_FALSE:\n # Op returns a C false value on error.\n variant = Branch.BOOL\n negated = True\n elif op.error_kind == ERR_ALWAYS:\n variant = Branch.BOOL\n negated = True\n # this is a hack to represent the always fail\n # semantics, using a temporary bool with value false\n target = Integer(0, bool_rprimitive)\n else:\n assert False, 'unknown error kind %d' % op.error_kind\n\n # Void ops can't generate errors since error is always\n # indicated by a special value stored in a register.\n if op.error_kind != ERR_ALWAYS:\n assert not op.is_void, \"void op generating errors?\"\n\n branch = Branch(target,\n true_label=error_label,\n false_label=new_block,\n op=variant,\n line=op.line)\n branch.negated = negated\n if op.line != NO_TRACEBACK_LINE_NO and func_name is not None:\n branch.traceback_entry = (func_name, op.line)\n cur_block.ops.append(branch)\n cur_block = new_block\n\n return new_blocks", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/transform/refcount.py__Transformation_for_ins_BlockCache.Dict_Tuple_BasicBlock_De": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/transform/refcount.py__Transformation_for_ins_BlockCache.Dict_Tuple_BasicBlock_De", "embedding": null, "metadata": {"file_path": "mypyc/transform/refcount.py", "file_name": "refcount.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 41, "span_ids": ["docstring"], "tokens": 367}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Transformation for inserting refrecence count inc/dec opcodes.\n\nThis transformation happens towards the end of compilation. Before this\ntransformation, reference count management is not explicitly handled at all.\nBy postponing this pass, the previous passes are simpler as they don't have\nto update reference count opcodes.\n\nThe approach is to decrement reference counts soon after a value is no\nlonger live, to quickly free memory (and call __del__ methods), though\nthere are no strict guarantees -- other than that local variables are\nfreed before return from a function.\n\nFunction arguments are a little special. They are initially considered\n'borrowed' from the caller and their reference counts don't need to be\ndecremented before returning. An assignment to a borrowed value turns it\ninto a regular, owned reference that needs to freed before return.\n\"\"\"\n\nfrom typing import Dict, Iterable, List, Set, Tuple\n\nfrom mypyc.analysis.dataflow import (\n get_cfg,\n analyze_must_defined_regs,\n analyze_live_regs,\n analyze_borrowed_arguments,\n cleanup_cfg,\n AnalysisDict\n)\nfrom mypyc.ir.ops import (\n BasicBlock, Assign, RegisterOp, DecRef, IncRef, Branch, Goto, Op, ControlOp, Value, Register,\n LoadAddress, Integer, KeepAlive\n)\nfrom mypyc.ir.func_ir import FuncIR, all_values\n\n\nDecIncs = Tuple[Tuple[Tuple[Value, bool], ...], Tuple[Value, ...]]\n\n# A of basic blocks that decrement and increment specific values and\n# then jump to some target block. This lets us cut down on how much\n# code we generate in some circumstances.\nBlockCache = Dict[Tuple[BasicBlock, DecIncs], BasicBlock]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/transform/refcount.py_insert_ref_count_opcodes_insert_ref_count_opcodes.cleanup_cfg_ir_blocks_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/transform/refcount.py_insert_ref_count_opcodes_insert_ref_count_opcodes.cleanup_cfg_ir_blocks_", "embedding": null, "metadata": {"file_path": "mypyc/transform/refcount.py", "file_name": "refcount.py", "file_type": "text/x-python", "category": "implementation", "start_line": 44, "end_line": 71, "span_ids": ["insert_ref_count_opcodes"], "tokens": 236}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def insert_ref_count_opcodes(ir: FuncIR) -> None:\n \"\"\"Insert reference count inc/dec opcodes to a function.\n\n This is the entry point to this module.\n \"\"\"\n cfg = get_cfg(ir.blocks)\n values = all_values(ir.arg_regs, ir.blocks)\n\n borrowed = {value for value in values if value.is_borrowed}\n args = set(ir.arg_regs) # type: Set[Value]\n live = analyze_live_regs(ir.blocks, cfg)\n borrow = analyze_borrowed_arguments(ir.blocks, cfg, borrowed)\n defined = analyze_must_defined_regs(ir.blocks, cfg, args, values)\n ordering = make_value_ordering(ir)\n cache = {} # type: BlockCache\n for block in ir.blocks[:]:\n if isinstance(block.ops[-1], (Branch, Goto)):\n insert_branch_inc_and_decrefs(block,\n cache,\n ir.blocks,\n live.before,\n borrow.before,\n borrow.after,\n defined.after,\n ordering)\n transform_block(block, live.before, live.after, borrow.before, defined.after)\n\n cleanup_cfg(ir.blocks)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/transform/refcount.py_is_maybe_undefined_maybe_append_inc_ref.if_dest_type_is_refcounte.ops_append_IncRef_dest_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/transform/refcount.py_is_maybe_undefined_maybe_append_inc_ref.if_dest_type_is_refcounte.ops_append_IncRef_dest_", "embedding": null, "metadata": {"file_path": "mypyc/transform/refcount.py", "file_name": "refcount.py", "file_type": "text/x-python", "category": "implementation", "start_line": 74, "end_line": 86, "span_ids": ["is_maybe_undefined", "maybe_append_dec_ref", "maybe_append_inc_ref"], "tokens": 148}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_maybe_undefined(post_must_defined: Set[Value], src: Value) -> bool:\n return isinstance(src, Register) and src not in post_must_defined\n\n\ndef maybe_append_dec_ref(ops: List[Op], dest: Value,\n defined: 'AnalysisDict[Value]', key: Tuple[BasicBlock, int]) -> None:\n if dest.type.is_refcounted and not isinstance(dest, Integer):\n ops.append(DecRef(dest, is_xdec=is_maybe_undefined(defined[key], dest)))\n\n\ndef maybe_append_inc_ref(ops: List[Op], dest: Value) -> None:\n if dest.type.is_refcounted:\n ops.append(IncRef(dest))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/transform/refcount.py_transform_block_transform_block.block.ops.ops": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/transform/refcount.py_transform_block_transform_block.block.ops.ops", "embedding": null, "metadata": {"file_path": "mypyc/transform/refcount.py", "file_name": "refcount.py", "file_type": "text/x-python", "category": "implementation", "start_line": 89, "end_line": 132, "span_ids": ["transform_block"], "tokens": 471}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def transform_block(block: BasicBlock,\n pre_live: 'AnalysisDict[Value]',\n post_live: 'AnalysisDict[Value]',\n pre_borrow: 'AnalysisDict[Value]',\n post_must_defined: 'AnalysisDict[Value]') -> None:\n old_ops = block.ops\n ops = [] # type: List[Op]\n for i, op in enumerate(old_ops):\n key = (block, i)\n\n assert op not in pre_live[key]\n dest = op.dest if isinstance(op, Assign) else op\n stolen = op.stolen()\n\n # Incref any references that are being stolen that stay live, were borrowed,\n # or are stolen more than once by this operation.\n for i, src in enumerate(stolen):\n if src in post_live[key] or src in pre_borrow[key] or src in stolen[:i]:\n maybe_append_inc_ref(ops, src)\n # For assignments to registers that were already live,\n # decref the old value.\n if (dest not in pre_borrow[key] and dest in pre_live[key]):\n assert isinstance(op, Assign)\n maybe_append_dec_ref(ops, dest, post_must_defined, key)\n\n # Strip KeepAlive. Its only purpose is to help with this transform.\n if not isinstance(op, KeepAlive):\n ops.append(op)\n\n # Control ops don't have any space to insert ops after them, so\n # their inc/decrefs get inserted by insert_branch_inc_and_decrefs.\n if isinstance(op, ControlOp):\n continue\n\n for src in op.unique_sources():\n # Decrement source that won't be live afterwards.\n if src not in post_live[key] and src not in pre_borrow[key] and src not in stolen:\n maybe_append_dec_ref(ops, src, post_must_defined, key)\n # Decrement the destination if it is dead after the op and\n # wasn't a borrowed RegisterOp\n if (not dest.is_void and dest not in post_live[key]\n and not (isinstance(op, RegisterOp) and dest.is_borrowed)):\n maybe_append_dec_ref(ops, dest, post_must_defined, key)\n block.ops = ops", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/transform/refcount.py_insert_branch_inc_and_decrefs_insert_branch_inc_and_decrefs.if_isinstance_block_ops_.elif_isinstance_block_ops.goto.label.add_block_new_decincs_ca": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/transform/refcount.py_insert_branch_inc_and_decrefs_insert_branch_inc_and_decrefs.if_isinstance_block_ops_.elif_isinstance_block_ops.goto.label.add_block_new_decincs_ca", "embedding": null, "metadata": {"file_path": "mypyc/transform/refcount.py", "file_name": "refcount.py", "file_type": "text/x-python", "category": "implementation", "start_line": 133, "end_line": 191, "span_ids": ["insert_branch_inc_and_decrefs"], "tokens": 610}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def insert_branch_inc_and_decrefs(\n block: BasicBlock,\n cache: BlockCache,\n blocks: List[BasicBlock],\n pre_live: 'AnalysisDict[Value]',\n pre_borrow: 'AnalysisDict[Value]',\n post_borrow: 'AnalysisDict[Value]',\n post_must_defined: 'AnalysisDict[Value]',\n ordering: Dict[Value, int]) -> None:\n \"\"\"Insert inc_refs and/or dec_refs after a branch/goto.\n\n Add dec_refs for registers that become dead after a branch.\n Add inc_refs for registers that become unborrowed after a branch or goto.\n\n Branches are special as the true and false targets may have a different\n live and borrowed register sets. Add new blocks before the true/false target\n blocks that tweak reference counts.\n\n Example where we need to add an inc_ref:\n\n def f(a: int) -> None\n if a:\n a = 1\n return a # a is borrowed if condition is false and unborrowed if true\n \"\"\"\n prev_key = (block, len(block.ops) - 1)\n source_live_regs = pre_live[prev_key]\n source_borrowed = post_borrow[prev_key]\n source_defined = post_must_defined[prev_key]\n if isinstance(block.ops[-1], Branch):\n branch = block.ops[-1]\n # HAX: After we've checked against an error value the value we must not touch the\n # refcount since it will be a null pointer. The correct way to do this would be\n # to perform data flow analysis on whether a value can be null (or is always\n # null).\n if branch.op == Branch.IS_ERROR:\n omitted = {branch.value}\n else:\n omitted = set()\n true_decincs = (\n after_branch_decrefs(\n branch.true, pre_live, source_defined,\n source_borrowed, source_live_regs, ordering, omitted),\n after_branch_increfs(\n branch.true, pre_live, pre_borrow, source_borrowed, ordering))\n branch.true = add_block(true_decincs, cache, blocks, branch.true)\n\n false_decincs = (\n after_branch_decrefs(\n branch.false, pre_live, source_defined, source_borrowed, source_live_regs,\n ordering),\n after_branch_increfs(\n branch.false, pre_live, pre_borrow, source_borrowed, ordering))\n branch.false = add_block(false_decincs, cache, blocks, branch.false)\n elif isinstance(block.ops[-1], Goto):\n goto = block.ops[-1]\n new_decincs = ((), after_branch_increfs(\n goto.label, pre_live, pre_borrow, source_borrowed, ordering))\n goto.label = add_block(new_decincs, cache, blocks, goto.label)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/transform/refcount.py_after_branch_decrefs_after_branch_decrefs.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/transform/refcount.py_after_branch_decrefs_after_branch_decrefs.return._", "embedding": null, "metadata": {"file_path": "mypyc/transform/refcount.py", "file_name": "refcount.py", "file_type": "text/x-python", "category": "implementation", "start_line": 194, "end_line": 207, "span_ids": ["after_branch_decrefs"], "tokens": 160}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def after_branch_decrefs(label: BasicBlock,\n pre_live: 'AnalysisDict[Value]',\n source_defined: Set[Value],\n source_borrowed: Set[Value],\n source_live_regs: Set[Value],\n ordering: Dict[Value, int],\n omitted: Iterable[Value] = ()) -> Tuple[Tuple[Value, bool], ...]:\n target_pre_live = pre_live[label, 0]\n decref = source_live_regs - target_pre_live - source_borrowed\n if decref:\n return tuple((reg, is_maybe_undefined(source_defined, reg))\n for reg in sorted(decref, key=lambda r: ordering[r])\n if reg.type.is_refcounted and reg not in omitted)\n return ()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/transform/refcount.py_after_branch_increfs_after_branch_increfs.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/transform/refcount.py_after_branch_increfs_after_branch_increfs.return._", "embedding": null, "metadata": {"file_path": "mypyc/transform/refcount.py", "file_name": "refcount.py", "file_type": "text/x-python", "category": "implementation", "start_line": 210, "end_line": 222, "span_ids": ["after_branch_increfs"], "tokens": 142}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def after_branch_increfs(label: BasicBlock,\n pre_live: 'AnalysisDict[Value]',\n pre_borrow: 'AnalysisDict[Value]',\n source_borrowed: Set[Value],\n ordering: Dict[Value, int]) -> Tuple[Value, ...]:\n target_pre_live = pre_live[label, 0]\n target_borrowed = pre_borrow[label, 0]\n incref = (source_borrowed - target_borrowed) & target_pre_live\n if incref:\n return tuple(reg\n for reg in sorted(incref, key=lambda r: ordering[r])\n if reg.type.is_refcounted)\n return ()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/transform/uninit.py__Insert_checks_for_unin_insert_uninit_checks.ir.blocks.split_blocks_at_uninits_i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/transform/uninit.py__Insert_checks_for_unin_insert_uninit_checks.ir.blocks.split_blocks_at_uninits_i", "embedding": null, "metadata": {"file_path": "mypyc/transform/uninit.py", "file_name": "uninit.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 30, "span_ids": ["insert_uninit_checks", "docstring"], "tokens": 195}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Insert checks for uninitialized values.\"\"\"\n\nfrom typing import List\n\nfrom mypyc.analysis.dataflow import (\n get_cfg,\n cleanup_cfg,\n analyze_must_defined_regs,\n AnalysisDict\n)\nfrom mypyc.ir.ops import (\n BasicBlock, Op, Branch, Value, RaiseStandardError, Unreachable, Register,\n LoadAddress, Assign, LoadErrorValue\n)\nfrom mypyc.ir.func_ir import FuncIR, all_values\n\n\ndef insert_uninit_checks(ir: FuncIR) -> None:\n # Remove dead blocks from the CFG, which helps avoid spurious\n # checks due to unused error handling blocks.\n cleanup_cfg(ir.blocks)\n\n cfg = get_cfg(ir.blocks)\n must_defined = analyze_must_defined_regs(\n ir.blocks,\n cfg,\n set(ir.arg_regs),\n all_values(ir.arg_regs, ir.blocks))\n\n ir.blocks = split_blocks_at_uninits(ir.blocks, must_defined.before)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/transform/uninit.py_split_blocks_at_uninits_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/transform/uninit.py_split_blocks_at_uninits_", "embedding": null, "metadata": {"file_path": "mypyc/transform/uninit.py", "file_name": "uninit.py", "file_type": "text/x-python", "category": "implementation", "start_line": 33, "end_line": 91, "span_ids": ["split_blocks_at_uninits"], "tokens": 485}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def split_blocks_at_uninits(blocks: List[BasicBlock],\n pre_must_defined: 'AnalysisDict[Value]') -> List[BasicBlock]:\n new_blocks = [] # type: List[BasicBlock]\n\n init_registers = []\n init_registers_set = set()\n\n # First split blocks on ops that may raise.\n for block in blocks:\n ops = block.ops\n block.ops = []\n cur_block = block\n new_blocks.append(cur_block)\n\n for i, op in enumerate(ops):\n defined = pre_must_defined[block, i]\n for src in op.unique_sources():\n # If a register operand is not guaranteed to be\n # initialized is an operand to something other than a\n # check that it is defined, insert a check.\n\n # Note that for register operand in a LoadAddress op,\n # we should be able to use it without initialization\n # as we may need to use its address to update itself\n if (isinstance(src, Register) and src not in defined\n and not (isinstance(op, Branch) and op.op == Branch.IS_ERROR)\n and not isinstance(op, LoadAddress)):\n new_block, error_block = BasicBlock(), BasicBlock()\n new_block.error_handler = error_block.error_handler = cur_block.error_handler\n new_blocks += [error_block, new_block]\n\n if src not in init_registers_set:\n init_registers.append(src)\n init_registers_set.add(src)\n\n cur_block.ops.append(Branch(src,\n true_label=error_block,\n false_label=new_block,\n op=Branch.IS_ERROR,\n line=op.line))\n raise_std = RaiseStandardError(\n RaiseStandardError.UNBOUND_LOCAL_ERROR,\n 'local variable \"{}\" referenced before assignment'.format(src.name),\n op.line)\n error_block.ops.append(raise_std)\n error_block.ops.append(Unreachable())\n cur_block = new_block\n cur_block.ops.append(op)\n\n if init_registers:\n new_ops = [] # type: List[Op]\n for reg in init_registers:\n err = LoadErrorValue(reg.type, undefines=True)\n new_ops.append(err)\n new_ops.append(Assign(reg, err))\n new_blocks[0].ops[0:0] = new_ops\n\n return new_blocks", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/runtests.py_main_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/runtests.py_main_", "embedding": null, "metadata": {"file_path": "runtests.py", "file_name": "runtests.py", "file_type": "text/x-python", "category": "implementation", "start_line": 117, "end_line": 152, "span_ids": ["impl:38", "main"], "tokens": 235}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def main() -> None:\n prog, *args = argv\n\n if not set(args).issubset(cmds):\n print(\"usage:\", prog, \" \".join('[%s]' % k for k in cmds))\n print()\n print('Run the given tests. If given no arguments, run everything except mypyc-extra.')\n exit(1)\n\n if not args:\n args = DEFAULT_COMMANDS[:]\n\n status = 0\n\n if 'self' in args and 'lint' in args:\n # Perform lint and self check in parallel as it's faster.\n proc = start_background_cmd('lint')\n cmd_status = run_cmd('self')\n if cmd_status:\n status = cmd_status\n cmd_status = wait_background_cmd('lint', proc)\n if cmd_status:\n status = cmd_status\n args = [arg for arg in args if arg not in ('self', 'lint')]\n\n for arg in args:\n cmd_status = run_cmd(arg)\n if cmd_status:\n status = cmd_status\n\n exit(status)\n\n\nif __name__ == '__main__':\n main()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/scripts/find_type.py__usr_bin_env_python3_process_output._finding_no_reveal_type_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/scripts/find_type.py__usr_bin_env_python3_process_output._finding_no_reveal_type_", "embedding": null, "metadata": {"file_path": "scripts/find_type.py", "file_name": "find_type.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 61, "span_ids": ["run_mypy", "process_output", "update_line", "docstring", "get_revealed_type"], "tokens": 676}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "#!/usr/bin/env python3\n# Usage: find_type.py FILENAME START_LINE START_COL END_LINE END_COL MYPY_AND_ARGS\n# Prints out the type of the expression in the given location if the mypy run\n# succeeds cleanly. Otherwise, prints out the errors encountered.\n# Note: this only works on expressions, and not assignment targets.\n# Note: MYPY_AND_ARGS is should be the remainder of argv, not a single\n# spaces-included argument.\n# NOTE: Line numbers are 1-based; column numbers are 0-based.\n#\n#\n# Example vim usage:\n# function RevealType()\n# \" Set this to the command you use to run mypy on your project. Include the mypy invocation.\n# let mypycmd = 'python3 -m mypy mypy --incremental'\n# let [startline, startcol] = getpos(\"'<\")[1:2]\n# let [endline, endcol] = getpos(\"'>\")[1:2]\n# \" Convert to 0-based column offsets\n# let startcol = startcol - 1\n# \" Change this line to point to the find_type.py script.\n# execute '!python3 /path/to/mypy/scripts/find_type.py % ' . startline . ' ' . startcol . ' ' . endline . ' ' . endcol . ' ' . mypycmd\n# endfunction\n# vnoremap t :call RevealType()\n#\n# For an Emacs example, see misc/macs.el.\n\nfrom typing import List, Tuple, Optional\nimport subprocess\nimport sys\nimport tempfile\nimport os.path\nimport re\n\nREVEAL_TYPE_START = 'reveal_type('\nREVEAL_TYPE_END = ')'\n\ndef update_line(line: str, s: str, pos: int) -> str:\n return line[:pos] + s + line[pos:]\n\ndef run_mypy(mypy_and_args: List[str], filename: str, tmp_name: str) -> str:\n proc = subprocess.run(mypy_and_args + ['--shadow-file', filename, tmp_name], stdout=subprocess.PIPE)\n assert(isinstance(proc.stdout, bytes)) # Guaranteed to be true because we called run with universal_newlines=False\n return proc.stdout.decode(encoding=\"utf-8\")\n\ndef get_revealed_type(line: str, relevant_file: str, relevant_line: int) -> Optional[str]:\n m = re.match(r'(.+?):(\\d+): note: Revealed type is \"(.*)\"$', line)\n if (m and\n int(m.group(2)) == relevant_line and\n os.path.samefile(relevant_file, m.group(1))):\n return m.group(3)\n else:\n return None\n\ndef process_output(output: str, filename: str, start_line: int) -> Tuple[Optional[str], bool]:\n error_found = False\n for line in output.splitlines():\n t = get_revealed_type(line, filename, start_line)\n if t:\n return t, error_found\n elif 'error:' in line:\n error_found = True\n return None, True # finding no reveal_type is an error", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/scripts/find_type.py_main_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/scripts/find_type.py_main_", "embedding": null, "metadata": {"file_path": "scripts/find_type.py", "file_name": "find_type.py", "file_type": "text/x-python", "category": "implementation", "start_line": 63, "end_line": 88, "span_ids": ["impl:5", "main"], "tokens": 246}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def main():\n filename, start_line_str, start_col_str, end_line_str, end_col_str, *mypy_and_args = sys.argv[1:]\n start_line = int(start_line_str)\n start_col = int(start_col_str)\n end_line = int(end_line_str)\n end_col = int(end_col_str)\n with open(filename, 'r') as f:\n lines = f.readlines()\n lines[end_line - 1] = update_line(lines[end_line - 1], REVEAL_TYPE_END, end_col) # insert after end_col\n lines[start_line - 1] = update_line(lines[start_line - 1], REVEAL_TYPE_START, start_col)\n with tempfile.NamedTemporaryFile(mode='w', prefix='mypy') as tmp_f:\n tmp_f.writelines(lines)\n tmp_f.flush()\n\n output = run_mypy(mypy_and_args, filename, tmp_f.name)\n revealed_type, error = process_output(output, filename, start_line)\n if revealed_type:\n print(revealed_type)\n if error:\n print(output)\n exit(int(error))\n\n\nif __name__ == \"__main__\":\n main()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/setup.py__usr_bin_env_python_long_description._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/setup.py__usr_bin_env_python_long_description._", "embedding": null, "metadata": {"file_path": "setup.py", "file_name": "setup.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 33, "span_ids": ["docstring"], "tokens": 270}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "#!/usr/bin/env python\n\nimport glob\nimport os\nimport os.path\nimport sys\n\nif sys.version_info < (3, 5, 0):\n sys.stderr.write(\"ERROR: You need Python 3.5 or later to use mypy.\\n\")\n exit(1)\n\n# we'll import stuff from the source tree, let's ensure is on the sys path\nsys.path.insert(0, os.path.dirname(os.path.realpath(__file__)))\n\n# This requires setuptools when building; setuptools is not needed\n# when installing from a wheel file (though it is still needed for\n# alternative forms of installing, as suggested by README.md).\nfrom setuptools import setup, find_packages\nfrom setuptools.command.build_py import build_py\nfrom mypy.version import __version__ as version\n\ndescription = 'Optional static typing for Python'\nlong_description = '''\nMypy -- Optional Static Typing for Python\n=========================================\n\nAdd type annotations to your Python programs, and use mypy to type\ncheck them. Mypy is essentially a Python linter on steroids, and it\ncan catch many programming errors by analyzing your program, without\nactually having to run it. Mypy has a powerful type system with\nfeatures such as type inference, gradual typing, generics and union\ntypes.\n'''.lstrip()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/setup.py_find_package_data_find_package_data.return.rv": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/setup.py_find_package_data_find_package_data.return.rv", "embedding": null, "metadata": {"file_path": "setup.py", "file_name": "setup.py", "file_type": "text/x-python", "category": "implementation", "start_line": 39, "end_line": 56, "span_ids": ["find_package_data"], "tokens": 137}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def find_package_data(base, globs, root='mypy'):\n \"\"\"Find all interesting data files, for setup(package_data=)\n\n Arguments:\n root: The directory to search in.\n globs: A list of glob patterns to accept files.\n \"\"\"\n\n rv_dirs = [root for root, dirs, files in os.walk(base)]\n rv = []\n for rv_dir in rv_dirs:\n files = []\n for pat in globs:\n files += glob.glob(os.path.join(rv_dir, pat))\n if not files:\n continue\n rv.extend([os.path.relpath(f, root) for f in files])\n return rv", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/setup.py_CustomPythonBuild_if_os_getenv_MYPY_USE_MY.USE_MYPYC.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/setup.py_CustomPythonBuild_if_os_getenv_MYPY_USE_MY.USE_MYPYC.True", "embedding": null, "metadata": {"file_path": "setup.py", "file_name": "setup.py", "file_type": "text/x-python", "category": "implementation", "start_line": 56, "end_line": 83, "span_ids": ["impl:9", "CustomPythonBuild.pin_version", "CustomPythonBuild", "CustomPythonBuild.run"], "tokens": 267}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CustomPythonBuild(build_py):\n def pin_version(self):\n path = os.path.join(self.build_lib, 'mypy')\n self.mkpath(path)\n with open(os.path.join(path, 'version.py'), 'w') as stream:\n stream.write('__version__ = \"{}\"\\n'.format(version))\n\n def run(self):\n self.execute(self.pin_version, ())\n build_py.run(self)\n\n\ncmdclass = {'build_py': CustomPythonBuild}\n\npackage_data = ['py.typed']\n\npackage_data += find_package_data(os.path.join('mypy', 'typeshed'), ['*.py', '*.pyi'])\npackage_data += [os.path.join('mypy', 'typeshed', 'stdlib', 'VERSIONS')]\n\npackage_data += find_package_data(os.path.join('mypy', 'xml'), ['*.xsd', '*.xslt', '*.css'])\n\nUSE_MYPYC = False\n# To compile with mypyc, a mypyc checkout must be present on the PYTHONPATH\nif len(sys.argv) > 1 and sys.argv[1] == '--use-mypyc':\n sys.argv.pop(1)\n USE_MYPYC = True\nif os.getenv('MYPY_USE_MYPYC', None) == '1':\n USE_MYPYC = True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/setup.py_if_USE_MYPYC__if_USE_MYPYC_.else_.ext_modules._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/setup.py_if_USE_MYPYC__if_USE_MYPYC_.else_.ext_modules._", "embedding": null, "metadata": {"file_path": "setup.py", "file_name": "setup.py", "file_type": "text/x-python", "category": "implementation", "start_line": 85, "end_line": 156, "span_ids": ["impl:9"], "tokens": 764}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "if USE_MYPYC:\n MYPYC_BLACKLIST = tuple(os.path.join('mypy', x) for x in (\n # Need to be runnable as scripts\n '__main__.py',\n 'sitepkgs.py',\n os.path.join('dmypy', '__main__.py'),\n\n # Uses __getattr__/__setattr__\n 'split_namespace.py',\n\n # Lies to mypy about code reachability\n 'bogus_type.py',\n\n # We don't populate __file__ properly at the top level or something?\n # Also I think there would be problems with how we generate version.py.\n 'version.py',\n\n # Skip these to reduce the size of the build\n 'stubtest.py',\n 'stubgenc.py',\n 'stubdoc.py',\n 'stubutil.py',\n )) + (\n # Don't want to grab this accidentally\n os.path.join('mypyc', 'lib-rt', 'setup.py'),\n )\n\n everything = (\n [os.path.join('mypy', x) for x in find_package_data('mypy', ['*.py'])] +\n [os.path.join('mypyc', x) for x in find_package_data('mypyc', ['*.py'], root='mypyc')])\n # Start with all the .py files\n all_real_pys = [x for x in everything\n if not x.startswith(os.path.join('mypy', 'typeshed') + os.sep)]\n # Strip out anything in our blacklist\n mypyc_targets = [x for x in all_real_pys if x not in MYPYC_BLACKLIST]\n # Strip out any test code\n mypyc_targets = [x for x in mypyc_targets\n if not x.startswith((os.path.join('mypy', 'test') + os.sep,\n os.path.join('mypyc', 'test') + os.sep,\n os.path.join('mypyc', 'doc') + os.sep,\n os.path.join('mypyc', 'test-data') + os.sep,\n ))]\n # ... and add back in the one test module we need\n mypyc_targets.append(os.path.join('mypy', 'test', 'visitors.py'))\n\n # The targets come out of file system apis in an unspecified\n # order. Sort them so that the mypyc output is deterministic.\n mypyc_targets.sort()\n\n use_other_mypyc = os.getenv('ALTERNATE_MYPYC_PATH', None)\n if use_other_mypyc:\n # This bit is super unfortunate: we want to use a different\n # mypy/mypyc version, but we've already imported parts, so we\n # remove the modules that we've imported already, which will\n # let the right versions be imported by mypyc.\n del sys.modules['mypy']\n del sys.modules['mypy.version']\n del sys.modules['mypy.git']\n sys.path.insert(0, use_other_mypyc)\n\n from mypyc.build import mypycify\n opt_level = os.getenv('MYPYC_OPT_LEVEL', '3')\n force_multifile = os.getenv('MYPYC_MULTI_FILE', '') == '1'\n ext_modules = mypycify(\n mypyc_targets + ['--config-file=mypy_bootstrap.ini'],\n opt_level=opt_level,\n # Use multi-file compilation mode on windows because without it\n # our Appveyor builds run out of memory sometimes.\n multi_file=sys.platform == 'win32' or force_multifile,\n )\nelse:\n ext_modules = []", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/setup.py_classifiers_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/setup.py_classifiers_", "embedding": null, "metadata": {"file_path": "setup.py", "file_name": "setup.py", "file_type": "text/x-python", "category": "implementation", "start_line": 159, "end_line": 208, "span_ids": ["impl:55"], "tokens": 463}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "classifiers = [\n 'Development Status :: 4 - Beta',\n 'Environment :: Console',\n 'Intended Audience :: Developers',\n 'License :: OSI Approved :: MIT License',\n 'Programming Language :: Python :: 3',\n 'Programming Language :: Python :: 3.5',\n 'Programming Language :: Python :: 3.6',\n 'Programming Language :: Python :: 3.7',\n 'Programming Language :: Python :: 3.8',\n 'Programming Language :: Python :: 3.9',\n 'Topic :: Software Development',\n]\n\nsetup(name='mypy',\n version=version,\n description=description,\n long_description=long_description,\n author='Jukka Lehtosalo',\n author_email='jukka.lehtosalo@iki.fi',\n url='http://www.mypy-lang.org/',\n license='MIT License',\n py_modules=[],\n ext_modules=ext_modules,\n packages=find_packages(),\n package_data={'mypy': package_data},\n scripts=['scripts/mypyc'],\n entry_points={'console_scripts': ['mypy=mypy.__main__:console_entry',\n 'stubgen=mypy.stubgen:main',\n 'stubtest=mypy.stubtest:main',\n 'dmypy=mypy.dmypy.client:console_entry',\n ]},\n classifiers=classifiers,\n cmdclass=cmdclass,\n # When changing this, also update mypy-requirements.txt.\n install_requires=[\"typed_ast >= 1.4.0, < 1.5.0; python_version<'3.8'\",\n 'typing_extensions>=3.7.4',\n 'mypy_extensions >= 0.4.3, < 0.5.0',\n 'types-mypy-extensions>=0.4.0',\n 'toml',\n ],\n # Same here.\n extras_require={'dmypy': 'psutil >= 4.0', 'python2': 'typed_ast >= 1.4.0, < 1.5.0'},\n python_requires=\">=3.5\",\n include_package_data=True,\n project_urls={\n 'News': 'http://mypy-lang.org/news.html',\n },\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/modulefinder-site-packages/foo/bar.py__bar_var._bar_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/modulefinder-site-packages/foo/bar.py__bar_var._bar_", "embedding": null, "metadata": {"file_path": "test-data/packages/modulefinder-site-packages/foo/bar.py", "file_name": "bar.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 1, "span_ids": ["impl"], "tokens": 6}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "bar_var = \"bar\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/modulefinder-site-packages/ns_pkg_typed/a.py__a_var._a_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/modulefinder-site-packages/ns_pkg_typed/a.py__a_var._a_", "embedding": null, "metadata": {"file_path": "test-data/packages/modulefinder-site-packages/ns_pkg_typed/a.py", "file_name": "a.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 1, "span_ids": ["impl"], "tokens": 6}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "a_var = \"a\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/modulefinder-site-packages/ns_pkg_typed/b/c.py__c_var._c_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/modulefinder-site-packages/ns_pkg_typed/b/c.py__c_var._c_", "embedding": null, "metadata": {"file_path": "test-data/packages/modulefinder-site-packages/ns_pkg_typed/b/c.py", "file_name": "c.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 1, "span_ids": ["impl"], "tokens": 6}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "c_var = \"c\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/modulefinder-site-packages/ns_pkg_untyped/a.py__a_var._a_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/modulefinder-site-packages/ns_pkg_untyped/a.py__a_var._a_", "embedding": null, "metadata": {"file_path": "test-data/packages/modulefinder-site-packages/ns_pkg_untyped/a.py", "file_name": "a.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 1, "span_ids": ["impl"], "tokens": 6}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "a_var = \"a\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/modulefinder-site-packages/ns_pkg_untyped/b/c.py__c_var._c_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/modulefinder-site-packages/ns_pkg_untyped/b/c.py__c_var._c_", "embedding": null, "metadata": {"file_path": "test-data/packages/modulefinder-site-packages/ns_pkg_untyped/b/c.py", "file_name": "c.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 1, "span_ids": ["impl"], "tokens": 6}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "c_var = \"c\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/modulefinder-site-packages/pkg_typed/__init__.py__pkg_typed_var._pkg_typed_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/modulefinder-site-packages/pkg_typed/__init__.py__pkg_typed_var._pkg_typed_", "embedding": null, "metadata": {"file_path": "test-data/packages/modulefinder-site-packages/pkg_typed/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 1, "span_ids": ["impl"], "tokens": 10}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "pkg_typed_var = \"pkg_typed\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/modulefinder-site-packages/pkg_typed/a.py__a_var._a_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/modulefinder-site-packages/pkg_typed/a.py__a_var._a_", "embedding": null, "metadata": {"file_path": "test-data/packages/modulefinder-site-packages/pkg_typed/a.py", "file_name": "a.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 1, "span_ids": ["impl"], "tokens": 6}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "a_var = \"a\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/modulefinder-site-packages/pkg_typed/b/__init__.py__b_var._b_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/modulefinder-site-packages/pkg_typed/b/__init__.py__b_var._b_", "embedding": null, "metadata": {"file_path": "test-data/packages/modulefinder-site-packages/pkg_typed/b/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 1, "span_ids": ["impl"], "tokens": 6}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "b_var = \"b\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/modulefinder-site-packages/pkg_typed/b/c.py__c_var._c_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/modulefinder-site-packages/pkg_typed/b/c.py__c_var._c_", "embedding": null, "metadata": {"file_path": "test-data/packages/modulefinder-site-packages/pkg_typed/b/c.py", "file_name": "c.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 1, "span_ids": ["impl"], "tokens": 6}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "c_var = \"c\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/modulefinder-site-packages/pkg_untyped/__init__.py__pkg_untyped_var._pkg_untyped_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/modulefinder-site-packages/pkg_untyped/__init__.py__pkg_untyped_var._pkg_untyped_", "embedding": null, "metadata": {"file_path": "test-data/packages/modulefinder-site-packages/pkg_untyped/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 1, "span_ids": ["impl"], "tokens": 10}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "pkg_untyped_var = \"pkg_untyped\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/modulefinder-site-packages/pkg_untyped/a.py__a_var._a_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/modulefinder-site-packages/pkg_untyped/a.py__a_var._a_", "embedding": null, "metadata": {"file_path": "test-data/packages/modulefinder-site-packages/pkg_untyped/a.py", "file_name": "a.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 1, "span_ids": ["impl"], "tokens": 6}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "a_var = \"a\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/modulefinder-site-packages/pkg_untyped/b/__init__.py__b_var._b_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/modulefinder-site-packages/pkg_untyped/b/__init__.py__b_var._b_", "embedding": null, "metadata": {"file_path": "test-data/packages/modulefinder-site-packages/pkg_untyped/b/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 1, "span_ids": ["impl"], "tokens": 6}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "b_var = \"b\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/modulefinder-site-packages/pkg_untyped/b/c.py__c_var._c_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/modulefinder-site-packages/pkg_untyped/b/c.py__c_var._c_", "embedding": null, "metadata": {"file_path": "test-data/packages/modulefinder-site-packages/pkg_untyped/b/c.py", "file_name": "c.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 1, "span_ids": ["impl"], "tokens": 6}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "c_var = \"c\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/modulefinder-site-packages/standalone.py__standalone_var._standalone_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/modulefinder-site-packages/standalone.py__standalone_var._standalone_", "embedding": null, "metadata": {"file_path": "test-data/packages/modulefinder-site-packages/standalone.py", "file_name": "standalone.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 1, "span_ids": ["impl"], "tokens": 8}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "standalone_var = \"standalone\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/typedpkg/setup.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/typedpkg/setup.py__", "embedding": null, "metadata": {"file_path": "test-data/packages/typedpkg/setup.py", "file_name": "setup.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 16, "span_ids": ["docstring"], "tokens": 81}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"\nThis setup file installs packages to test mypy's PEP 561 implementation\n\"\"\"\n\nfrom setuptools import setup\n\nsetup(\n name='typedpkg',\n author=\"The mypy team\",\n version='0.1',\n package_data={'typedpkg': ['py.typed']},\n packages=['typedpkg', 'typedpkg.pkg'],\n include_package_data=True,\n zip_safe=False,\n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/typedpkg/typedpkg/pkg/aaa.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/typedpkg/typedpkg/pkg/aaa.py__", "embedding": null, "metadata": {"file_path": "test-data/packages/typedpkg/typedpkg/pkg/aaa.py", "file_name": "aaa.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 3, "span_ids": ["af"], "tokens": 16}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def af(a: str) -> str:\n return a + \" nested\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/typedpkg/typedpkg/sample.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/typedpkg/typedpkg/sample.py__", "embedding": null, "metadata": {"file_path": "test-data/packages/typedpkg/typedpkg/sample.py", "file_name": "sample.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 8, "span_ids": ["imports", "ex"], "tokens": 36}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from typing import Iterable, Tuple\n\n\ndef ex(a):\n # type: (Iterable[str]) -> Tuple[str, ...]\n \"\"\"Example typed package.\"\"\"\n return list(a)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/typedpkg-stubs/setup.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/typedpkg-stubs/setup.py__", "embedding": null, "metadata": {"file_path": "test-data/packages/typedpkg-stubs/setup.py", "file_name": "setup.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 14, "span_ids": ["docstring"], "tokens": 84}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"\nThis setup file installs packages to test mypy's PEP 561 implementation\n\"\"\"\n\nfrom distutils.core import setup\n\nsetup(\n name='typedpkg-stubs',\n author=\"The mypy team\",\n version='0.1',\n package_data={'typedpkg-stubs': ['sample.pyi', '__init__.pyi', 'py.typed']},\n packages=['typedpkg-stubs'],\n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/typedpkg_ns/setup.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/typedpkg_ns/setup.py__", "embedding": null, "metadata": {"file_path": "test-data/packages/typedpkg_ns/setup.py", "file_name": "setup.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 11, "span_ids": ["imports"], "tokens": 60}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from setuptools import setup, find_packages\n\nsetup(\n name='typedpkg_namespace.alpha',\n version='1.0.0',\n packages=find_packages(),\n namespace_packages=['typedpkg_ns'],\n zip_safe=False,\n package_data={'typedpkg_ns.ns': ['py.typed']}\n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/typedpkg_ns/typedpkg_ns/__init__.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/typedpkg_ns/typedpkg_ns/__init__.py__", "embedding": null, "metadata": {"file_path": "test-data/packages/typedpkg_ns/typedpkg_ns/__init__.py", "file_name": "__init__.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 3, "span_ids": ["docstring"], "tokens": 15}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# namespace pkg\n__import__(\"pkg_resources\").declare_namespace(__name__)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/typedpkg_ns/typedpkg_ns/ns/bbb.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/packages/typedpkg_ns/typedpkg_ns/ns/bbb.py__", "embedding": null, "metadata": {"file_path": "test-data/packages/typedpkg_ns/typedpkg_ns/ns/bbb.py", "file_name": "bbb.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 3, "span_ids": ["bf"], "tokens": 13}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def bf(a: bool) -> bool:\n return not a", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/bottles.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/bottles.py__", "embedding": null, "metadata": {"file_path": "test-data/samples/bottles.py", "file_name": "bottles.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 14, "span_ids": ["imports"], "tokens": 92}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import typing\n\nREFRAIN = '''\n%d bottles of beer on the wall,\n%d bottles of beer,\ntake one down, pass it around,\n%d bottles of beer on the wall!\n'''\nbottles_of_beer = 99\nwhile bottles_of_beer > 1:\n print(REFRAIN % (bottles_of_beer, bottles_of_beer,\n bottles_of_beer - 1))\n bottles_of_beer -= 1", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/class.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/class.py__", "embedding": null, "metadata": {"file_path": "test-data/samples/class.py", "file_name": "class.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 19, "span_ids": ["BankAccount.withdraw", "impl", "imports", "BankAccount", "BankAccount.deposit", "BankAccount.__init__", "BankAccount.overdrawn"], "tokens": 107}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import typing\n\n\nclass BankAccount(object):\n def __init__(self, initial_balance: int = 0) -> None:\n self.balance = initial_balance\n\n def deposit(self, amount: int) -> None:\n self.balance += amount\n\n def withdraw(self, amount: int) -> None:\n self.balance -= amount\n\n def overdrawn(self) -> bool:\n return self.balance < 0\nmy_account = BankAccount(15)\nmy_account.withdraw(5)\nprint(my_account.balance)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/cmdline.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/cmdline.py__", "embedding": null, "metadata": {"file_path": "test-data/samples/cmdline.py", "file_name": "cmdline.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 9, "span_ids": ["docstring"], "tokens": 53}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# This program adds up integers in the command line\nimport sys\nimport typing\ntry:\n total = sum(int(arg) for arg in sys.argv[1:])\n print('sum =', total)\nexcept ValueError:\n print('Please supply integer arguments')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py__usr_bin_env_python3_4_fix_url.return.url": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py__usr_bin_env_python3_4_fix_url.return.url", "embedding": null, "metadata": {"file_path": "test-data/samples/crawl2.py", "file_name": "crawl2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 83, "span_ids": ["unescape", "fix_url", "impl:14", "docstring"], "tokens": 649}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "#!/usr/bin/env python3.4\n\n\"\"\"A simple web crawler.\"\"\"\n\n# This is cloned from /examples/crawl.py,\n# with type annotations added (PEP 484).\n#\n# This version (crawl2.) has also been converted to use `async def` +\n# `await` (PEP 492).\n\nimport argparse\nimport asyncio\nimport cgi\nfrom http.client import BadStatusLine\nimport logging\nimport re\nimport sys\nimport time\nimport urllib.parse\nfrom typing import Any, Awaitable, IO, Optional, Sequence, Set, Tuple, List, Dict\n\n\nARGS = argparse.ArgumentParser(description=\"Web crawler\")\nARGS.add_argument(\n '--iocp', action='store_true', dest='iocp',\n default=False, help='Use IOCP event loop (Windows only)')\nARGS.add_argument(\n '--select', action='store_true', dest='select',\n default=False, help='Use Select event loop instead of default')\nARGS.add_argument(\n 'roots', nargs='*',\n default=[], help='Root URL (may be repeated)')\nARGS.add_argument(\n '--max_redirect', action='store', type=int, metavar='N',\n default=10, help='Limit redirection chains (for 301, 302 etc.)')\nARGS.add_argument(\n '--max_tries', action='store', type=int, metavar='N',\n default=4, help='Limit retries on network errors')\nARGS.add_argument(\n '--max_tasks', action='store', type=int, metavar='N',\n default=100, help='Limit concurrent connections')\nARGS.add_argument(\n '--max_pool', action='store', type=int, metavar='N',\n default=100, help='Limit connection pool size')\nARGS.add_argument(\n '--exclude', action='store', metavar='REGEX',\n help='Exclude matching URLs')\nARGS.add_argument(\n '--strict', action='store_true',\n default=True, help='Strict host matching (default)')\nARGS.add_argument(\n '--lenient', action='store_false', dest='strict',\n default=False, help='Lenient host matching')\nARGS.add_argument(\n '-v', '--verbose', action='count', dest='level',\n default=1, help='Verbose logging (repeat for more verbose)')\nARGS.add_argument(\n '-q', '--quiet', action='store_const', const=0, dest='level',\n default=1, help='Quiet logging (opposite of --verbose)')\n\n\nESCAPES = [('quot', '\"'),\n ('gt', '>'),\n ('lt', '<'),\n ('amp', '&') # Must be last.\n ]\n\n\ndef unescape(url: str) -> str:\n \"\"\"Turn & into &, and so on.\n\n This is the inverse of cgi.escape().\n \"\"\"\n for name, char in ESCAPES:\n url = url.replace('&' + name + ';', char)\n return url\n\n\ndef fix_url(url: str) -> str:\n \"\"\"Prefix a schema-less URL with http://.\"\"\"\n if '://' not in url:\n url = 'http://' + url\n return url", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Logger_KeyTuple.Tuple_str_int_bool_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Logger_KeyTuple.Tuple_str_int_bool_", "embedding": null, "metadata": {"file_path": "test-data/samples/crawl2.py", "file_name": "crawl2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 86, "end_line": 102, "span_ids": ["Logger.__init__", "impl:17", "Logger.__call__", "Logger.log", "Logger._log", "Logger"], "tokens": 122}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Logger:\n\n def __init__(self, level: int) -> None:\n self.level = level\n\n def _log(self, n: int, args: Sequence[Any]) -> None:\n if self.level >= n:\n print(*args, file=sys.stderr, flush=True)\n\n def log(self, n: int, *args: Any) -> None:\n self._log(n, args)\n\n def __call__(self, n: int, *args: Any) -> None:\n self._log(n, args)\n\n\nKeyTuple = Tuple[str, int, bool]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_ConnectionPool_ConnectionPool.close.self_queue_clear_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_ConnectionPool_ConnectionPool.close.self_queue_clear_", "embedding": null, "metadata": {"file_path": "test-data/samples/crawl2.py", "file_name": "crawl2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 105, "end_line": 133, "span_ids": ["ConnectionPool.__init__", "ConnectionPool.close", "ConnectionPool"], "tokens": 266}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ConnectionPool:\n \"\"\"A connection pool.\n\n To open a connection, use reserve(). To recycle it, use unreserve().\n\n The pool is mostly just a mapping from (host, port, ssl) tuples to\n lists of Connections. The currently active connections are *not*\n in the data structure; get_connection() takes the connection out,\n and recycle_connection() puts it back in. To recycle a\n connection, call conn.close(recycle=True).\n\n There are limits to both the overall pool and the per-key pool.\n \"\"\"\n\n def __init__(self, log: Logger, max_pool: int = 10, max_tasks: int = 5) -> None:\n self.log = log\n self.max_pool = max_pool # Overall limit.\n self.max_tasks = max_tasks # Per-key limit.\n self.loop = asyncio.get_event_loop()\n self.connections = {} # type: Dict[KeyTuple, List[Connection]]\n self.queue = [] # type: List[Connection]\n\n def close(self) -> None:\n \"\"\"Close all connections available for reuse.\"\"\"\n for conns in self.connections.values():\n for conn in conns:\n conn.close()\n self.connections.clear()\n self.queue.clear()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_ConnectionPool.get_connection_ConnectionPool.get_connection.return.conn": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_ConnectionPool.get_connection_ConnectionPool.get_connection.return.conn", "embedding": null, "metadata": {"file_path": "test-data/samples/crawl2.py", "file_name": "crawl2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 135, "end_line": 168, "span_ids": ["ConnectionPool.get_connection"], "tokens": 336}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ConnectionPool:\n\n async def get_connection(self, host: str, port: int, ssl: bool) -> 'Connection':\n \"\"\"Create or reuse a connection.\"\"\"\n port = port or (443 if ssl else 80)\n try:\n ipaddrs = await self.loop.getaddrinfo(host, port)\n except Exception as exc:\n self.log(0, 'Exception %r for (%r, %r)' % (exc, host, port))\n raise\n self.log(1, '* %s resolves to %s' %\n (host, ', '.join(ip[4][0] for ip in ipaddrs)))\n\n # Look for a reusable connection.\n for _1, _2, _3, _4, (h, p, *_5) in ipaddrs:\n key = h, p, ssl\n conn = None\n conns = self.connections.get(key)\n while conns:\n conn = conns.pop(0)\n self.queue.remove(conn)\n if not conns:\n del self.connections[key]\n if conn.stale():\n self.log(1, 'closing stale connection for', key)\n conn.close() # Just in case.\n else:\n self.log(1, '* Reusing pooled connection', key,\n 'FD =', conn.fileno())\n return conn\n\n # Create a new connection.\n conn = Connection(self.log, self, host, port, ssl)\n await conn.connect()\n self.log(1, '* New connection', conn.key, 'FD =', conn.fileno())\n return conn", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_ConnectionPool.recycle_connection_ConnectionPool.recycle_connection.while_len_self_queue_s.conn_close_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_ConnectionPool.recycle_connection_ConnectionPool.recycle_connection.while_len_self_queue_s.conn_close_", "embedding": null, "metadata": {"file_path": "test-data/samples/crawl2.py", "file_name": "crawl2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 170, "end_line": 227, "span_ids": ["ConnectionPool.recycle_connection"], "tokens": 423}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ConnectionPool:\n\n def recycle_connection(self, conn: 'Connection') -> None:\n \"\"\"Make a connection available for reuse.\n\n This also prunes the pool if it exceeds the size limits.\n \"\"\"\n if conn.stale():\n conn.close()\n return\n\n key = conn.key\n conns = self.connections.setdefault(key, [])\n conns.append(conn)\n self.queue.append(conn)\n\n if len(conns) <= self.max_tasks and len(self.queue) <= self.max_pool:\n return\n\n # Prune the queue.\n\n # Close stale connections for this key first.\n stale = [conn for conn in conns if conn.stale()]\n if stale:\n for conn in stale:\n conns.remove(conn)\n self.queue.remove(conn)\n self.log(1, 'closing stale connection for', key)\n conn.close()\n if not conns:\n del self.connections[key]\n\n # Close oldest connection(s) for this key if limit reached.\n while len(conns) > self.max_tasks:\n conn = conns.pop(0)\n self.queue.remove(conn)\n self.log(1, 'closing oldest connection for', key)\n conn.close()\n\n if len(self.queue) <= self.max_pool:\n return\n\n # Close overall stale connections.\n stale = [conn for conn in self.queue if conn.stale()]\n if stale:\n for conn in stale:\n conns = self.connections.get(conn.key)\n conns.remove(conn)\n self.queue.remove(conn)\n self.log(1, 'closing stale connection for', key)\n conn.close()\n\n # Close oldest overall connection(s) if limit reached.\n while len(self.queue) > self.max_pool:\n conn = self.queue.pop(0)\n conns = self.connections.get(conn.key)\n c = conns.pop(0)\n assert conn == c, (conn.key, conn, c, conns)\n self.log(1, 'closing overall oldest connection for', conn.key)\n conn.close()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Connection_Connection.close.if_recycle_and_not_self_s.else_.self.pool.self.reader.self.writer.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Connection_Connection.close.if_recycle_and_not_self_s.else_.self.pool.self.reader.self.writer.None", "embedding": null, "metadata": {"file_path": "test-data/samples/crawl2.py", "file_name": "crawl2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 230, "end_line": 270, "span_ids": ["Connection", "Connection.fileno", "Connection.__init__", "Connection.stale", "Connection.close", "Connection.connect"], "tokens": 334}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Connection:\n\n def __init__(self, log: Logger, pool: ConnectionPool, host: str, port: int, ssl: bool) -> None:\n self.log = log\n self.pool = pool\n self.host = host\n self.port = port\n self.ssl = ssl\n self.reader = None # type: asyncio.StreamReader\n self.writer = None # type: asyncio.StreamWriter\n self.key = None # type: KeyTuple\n\n def stale(self) -> bool:\n return self.reader is None or self.reader.at_eof()\n\n def fileno(self) -> Optional[int]:\n writer = self.writer\n if writer is not None:\n transport = writer.transport\n if transport is not None:\n sock = transport.get_extra_info('socket')\n if sock is not None:\n return sock.fileno()\n return None\n\n async def connect(self) -> None:\n self.reader, self.writer = await asyncio.open_connection(\n self.host, self.port, ssl=self.ssl)\n peername = self.writer.get_extra_info('peername')\n if peername:\n self.host, self.port = peername[:2]\n else:\n self.log(1, 'NO PEERNAME???', self.host, self.port, self.ssl)\n self.key = self.host, self.port, self.ssl\n\n def close(self, recycle: bool = False) -> None:\n if recycle and not self.stale():\n self.pool.recycle_connection(self)\n else:\n self.writer.close()\n self.pool = self.reader = self.writer = None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Request_Request.putline.self_conn_writer_write_li": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Request_Request.putline.self_conn_writer_write_li", "embedding": null, "metadata": {"file_path": "test-data/samples/crawl2.py", "file_name": "crawl2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 273, "end_line": 325, "span_ids": ["Request.close", "Request", "Request.putline", "Request.connect", "Request.__init__"], "tokens": 465}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Request:\n \"\"\"HTTP request.\n\n Use connect() to open a connection; send_request() to send the\n request; get_response() to receive the response headers.\n \"\"\"\n\n def __init__(self, log: Logger, url: str, pool: ConnectionPool) -> None:\n self.log = log\n self.url = url\n self.pool = pool\n self.parts = urllib.parse.urlparse(self.url)\n self.scheme = self.parts.scheme\n assert self.scheme in ('http', 'https'), repr(url)\n self.ssl = self.parts.scheme == 'https'\n self.netloc = self.parts.netloc\n self.hostname = self.parts.hostname\n self.port = self.parts.port or (443 if self.ssl else 80)\n self.path = (self.parts.path or '/')\n self.query = self.parts.query\n if self.query:\n self.full_path = '%s?%s' % (self.path, self.query)\n else:\n self.full_path = self.path\n self.http_version = 'HTTP/1.1'\n self.method = 'GET'\n self.headers = [] # type: List[Tuple[str, str]]\n self.conn = None # type: Connection\n\n async def connect(self) -> None:\n \"\"\"Open a connection to the server.\"\"\"\n self.log(1, '* Connecting to %s:%s using %s for %s' %\n (self.hostname, self.port,\n 'ssl' if self.ssl else 'tcp',\n self.url))\n self.conn = await self.pool.get_connection(self.hostname,\n self.port, self.ssl)\n\n def close(self, recycle: bool = False) -> None:\n \"\"\"Close the connection, recycle if requested.\"\"\"\n if self.conn is not None:\n if not recycle:\n self.log(1, 'closing connection for', self.conn.key)\n self.conn.close(recycle)\n self.conn = None\n\n async def putline(self, line: str) -> None:\n \"\"\"Write a line to the connection.\n\n Used for the request line and headers.\n \"\"\"\n self.log(2, '>', line)\n self.conn.writer.write(line.encode('latin-1') + b'\\r\\n')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Request.send_request_Request.get_response.return.response": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Request.send_request_Request.get_response.return.response", "embedding": null, "metadata": {"file_path": "test-data/samples/crawl2.py", "file_name": "crawl2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 327, "end_line": 346, "span_ids": ["Request.get_response", "Request.send_request"], "tokens": 191}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Request:\n\n async def send_request(self) -> None:\n \"\"\"Send the request.\"\"\"\n request_line = '%s %s %s' % (self.method, self.full_path,\n self.http_version)\n await self.putline(request_line)\n # TODO: What if a header is already set?\n self.headers.append(('User-Agent', 'asyncio-example-crawl/0.0'))\n self.headers.append(('Host', self.netloc))\n self.headers.append(('Accept', '*/*'))\n # self.headers.append(('Accept-Encoding', 'gzip'))\n for key, value in self.headers:\n line = '%s: %s' % (key, value)\n await self.putline(line)\n await self.putline('')\n\n async def get_response(self) -> 'Response':\n \"\"\"Receive the response.\"\"\"\n response = Response(self.log, self.conn.reader)\n await response.read_headers()\n return response", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Response_Response.getline.return.line": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Response_Response.getline.return.line", "embedding": null, "metadata": {"file_path": "test-data/samples/crawl2.py", "file_name": "crawl2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 349, "end_line": 369, "span_ids": ["Response.getline", "Response.__init__", "Response"], "tokens": 206}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Response:\n \"\"\"HTTP response.\n\n Call read_headers() to receive the request headers. Then check\n the status attribute and call get_header() to inspect the headers.\n Finally call read() to receive the body.\n \"\"\"\n\n def __init__(self, log: Logger, reader: asyncio.StreamReader) -> None:\n self.log = log\n self.reader = reader\n self.http_version = None # type: str # 'HTTP/1.1'\n self.status = None # type: int # 200\n self.reason = None # type: str # 'Ok'\n self.headers = [] # type: List[Tuple[str, str]] # [('Content-Type', 'text/html')]\n\n async def getline(self) -> str:\n \"\"\"Read one line from the connection.\"\"\"\n line = (await self.reader.readline()).decode('latin-1').rstrip()\n self.log(2, '<', line)\n return line", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Response.read_headers_Response.read_headers.while_True_.self_headers_append_key_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Response.read_headers_Response.read_headers.while_True_.self_headers_append_key_", "embedding": null, "metadata": {"file_path": "test-data/samples/crawl2.py", "file_name": "crawl2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 371, "end_line": 386, "span_ids": ["Response.read_headers"], "tokens": 150}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Response:\n\n async def read_headers(self) -> None:\n \"\"\"Read the response status and the request headers.\"\"\"\n status_line = await self.getline()\n status_parts = status_line.split(None, 2)\n if len(status_parts) != 3:\n self.log(0, 'bad status_line', repr(status_line))\n raise BadStatusLine(status_line)\n self.http_version, status, self.reason = status_parts\n self.status = int(status)\n while True:\n header_line = await self.getline()\n if not header_line:\n break\n # TODO: Continuation lines.\n key, value = header_line.split(':', 1)\n self.headers.append((key, value.strip()))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Response.get_redirect_url_Response.get_header.return.default": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Response.get_redirect_url_Response.get_header.return.default", "embedding": null, "metadata": {"file_path": "test-data/samples/crawl2.py", "file_name": "crawl2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 388, "end_line": 400, "span_ids": ["Response.get_redirect_url", "Response.get_header"], "tokens": 128}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Response:\n\n def get_redirect_url(self, default: str = '') -> str:\n \"\"\"Inspect the status and return the redirect url if appropriate.\"\"\"\n if self.status not in (300, 301, 302, 303, 307):\n return default\n return self.get_header('Location', default)\n\n def get_header(self, key: str, default: str = '') -> str:\n \"\"\"Get one header value, using a case insensitive header name.\"\"\"\n key = key.lower()\n for k, v in self.headers:\n if k.lower() == key:\n return v\n return default", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Response.read_Response.read.return.body": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Response.read_Response.read.return.body", "embedding": null, "metadata": {"file_path": "test-data/samples/crawl2.py", "file_name": "crawl2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 402, "end_line": 443, "span_ids": ["Response.read"], "tokens": 354}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Response:\n\n async def read(self) -> bytes:\n \"\"\"Read the response body.\n\n This honors Content-Length and Transfer-Encoding: chunked.\n \"\"\"\n nbytes = None\n for key, value in self.headers:\n if key.lower() == 'content-length':\n nbytes = int(value)\n break\n if nbytes is None:\n if self.get_header('transfer-encoding').lower() == 'chunked':\n self.log(2, 'parsing chunked response')\n blocks = []\n while True:\n size_header = await self.reader.readline()\n if not size_header:\n self.log(0, 'premature end of chunked response')\n break\n self.log(3, 'size_header =', repr(size_header))\n parts = size_header.split(b';')\n size = int(parts[0], 16)\n if size:\n self.log(3, 'reading chunk of', size, 'bytes')\n block = await self.reader.readexactly(size)\n assert len(block) == size, (len(block), size)\n blocks.append(block)\n crlf = await self.reader.readline()\n assert crlf == b'\\r\\n', repr(crlf)\n if not size:\n break\n body = b''.join(blocks)\n self.log(1, 'chunked response had', len(body),\n 'bytes in', len(blocks), 'blocks')\n else:\n self.log(3, 'reading until EOF')\n body = await self.reader.read()\n # TODO: Should make sure not to recycle the connection\n # in this case.\n else:\n body = await self.reader.readexactly(nbytes)\n return body", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Fetcher_Fetcher.__init__.None_14": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Fetcher_Fetcher.__init__.None_14", "embedding": null, "metadata": {"file_path": "test-data/samples/crawl2.py", "file_name": "crawl2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 446, "end_line": 482, "span_ids": ["Fetcher.__init__", "Fetcher"], "tokens": 379}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Fetcher:\n \"\"\"Logic and state for one URL.\n\n When found in crawler.busy, this represents a URL to be fetched or\n in the process of being fetched; when found in crawler.done, this\n holds the results from fetching it.\n\n This is usually associated with a task. This references the\n crawler for the connection pool and to add more URLs to its todo\n list.\n\n Call fetch() to do the fetching, then report() to print the results.\n \"\"\"\n\n def __init__(self, log: Logger, url: str, crawler: 'Crawler',\n max_redirect: int = 10, max_tries: int = 4) -> None:\n self.log = log\n self.url = url\n self.crawler = crawler\n # We don't loop resolving redirects here -- we just use this\n # to decide whether to add the redirect URL to crawler.todo.\n self.max_redirect = max_redirect\n # But we do loop to retry on errors a few times.\n self.max_tries = max_tries\n # Everything we collect from the response goes here.\n self.task = None # type: asyncio.Task\n self.exceptions = [] # type: List[Exception]\n self.tries = 0\n self.request = None # type: Request\n self.response = None # type: Response\n self.body = None # type: bytes\n self.next_url = None # type: str\n self.ctype = None # type: str\n self.pdict = None # type: Dict[str, str]\n self.encoding = None # type: str\n self.urls = None # type: Set[str]\n self.new_urls = None # type: Set[str]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Fetcher.fetch_Fetcher.fetch.if_next_url_.else_.if_self_response_status_.if_self_ctype_text_ht.for_url_in_self_urls_.if_self_crawler_add_url_u.self_new_urls_add_url_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Fetcher.fetch_Fetcher.fetch.if_next_url_.else_.if_self_response_status_.if_self_ctype_text_ht.for_url_in_self_urls_.if_self_crawler_add_url_u.self_new_urls_add_url_", "embedding": null, "metadata": {"file_path": "test-data/samples/crawl2.py", "file_name": "crawl2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 484, "end_line": 550, "span_ids": ["Fetcher.fetch"], "tokens": 657}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Fetcher:\n\n async def fetch(self) -> None:\n \"\"\"Attempt to fetch the contents of the URL.\n\n If successful, and the data is HTML, extract further links and\n add them to the crawler. Redirects are also added back there.\n \"\"\"\n while self.tries < self.max_tries:\n self.tries += 1\n self.request = None\n try:\n self.request = Request(self.log, self.url, self.crawler.pool)\n await self.request.connect()\n await self.request.send_request()\n self.response = await self.request.get_response()\n self.body = await self.response.read()\n h_conn = self.response.get_header('connection').lower()\n if h_conn != 'close':\n self.request.close(recycle=True)\n self.request = None\n if self.tries > 1:\n self.log(1, 'try', self.tries, 'for', self.url, 'success')\n break\n except (BadStatusLine, OSError) as exc:\n self.exceptions.append(exc)\n self.log(1, 'try', self.tries, 'for', self.url,\n 'raised', repr(exc))\n # import pdb; pdb.set_trace()\n # Don't reuse the connection in this case.\n finally:\n if self.request is not None:\n self.request.close()\n else:\n # We never broke out of the while loop, i.e. all tries failed.\n self.log(0, 'no success for', self.url,\n 'in', self.max_tries, 'tries')\n return\n next_url = self.response.get_redirect_url()\n if next_url:\n self.next_url = urllib.parse.urljoin(self.url, next_url)\n if self.max_redirect > 0:\n self.log(1, 'redirect to', self.next_url, 'from', self.url)\n self.crawler.add_url(self.next_url, self.max_redirect - 1)\n else:\n self.log(0, 'redirect limit reached for', self.next_url,\n 'from', self.url)\n else:\n if self.response.status == 200:\n self.ctype = self.response.get_header('content-type')\n self.pdict = {}\n if self.ctype:\n self.ctype, self.pdict = cgi.parse_header(self.ctype)\n self.encoding = self.pdict.get('charset', 'utf-8')\n if self.ctype == 'text/html':\n body = self.body.decode(self.encoding, 'replace')\n # Replace href with (?:href|src) to follow image links.\n self.urls = set(re.findall(r'(?i)href=[\"\\']?([^\\s\"\\'<>]+)',\n body))\n if self.urls:\n self.log(1, 'got', len(self.urls),\n 'distinct urls from', self.url)\n self.new_urls = set()\n for url in self.urls:\n url = unescape(url)\n url = urllib.parse.urljoin(self.url, url)\n url, frag = urllib.parse.urldefrag(url)\n if self.crawler.add_url(url):\n self.new_urls.add(url)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Fetcher.report_Fetcher.report.if_len_self_exceptions_.else_.print_self_url_self_resp": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Fetcher.report_Fetcher.report.if_len_self_exceptions_.else_.print_self_url_self_resp", "embedding": null, "metadata": {"file_path": "test-data/samples/crawl2.py", "file_name": "crawl2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 552, "end_line": 605, "span_ids": ["Fetcher.report"], "tokens": 432}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Fetcher:\n\n def report(self, stats: 'Stats', file: IO[str] = None) -> None:\n \"\"\"Print a report on the state for this URL.\n\n Also update the Stats instance.\n \"\"\"\n if self.task is not None:\n if not self.task.done():\n stats.add('pending')\n print(self.url, 'pending', file=file)\n return\n elif self.task.cancelled():\n stats.add('cancelled')\n print(self.url, 'cancelled', file=file)\n return\n elif self.task.exception():\n stats.add('exception')\n exc = self.task.exception()\n stats.add('exception_' + exc.__class__.__name__)\n print(self.url, exc, file=file)\n return\n if len(self.exceptions) == self.tries:\n stats.add('fail')\n exc = self.exceptions[-1]\n stats.add('fail_' + str(exc.__class__.__name__))\n print(self.url, 'error', exc, file=file)\n elif self.next_url:\n stats.add('redirect')\n print(self.url, self.response.status, 'redirect', self.next_url,\n file=file)\n elif self.ctype == 'text/html':\n stats.add('html')\n size = len(self.body or b'')\n stats.add('html_bytes', size)\n if self.log.level:\n print(self.url, self.response.status,\n self.ctype, self.encoding,\n size,\n '%d/%d' % (len(self.new_urls or ()), len(self.urls or ())),\n file=file)\n elif self.response is None:\n print(self.url, 'no response object')\n else:\n size = len(self.body or b'')\n if self.response.status == 200:\n stats.add('other')\n stats.add('other_bytes', size)\n else:\n stats.add('error')\n stats.add('error_bytes', size)\n stats.add('status_%s' % self.response.status)\n print(self.url, self.response.status,\n self.ctype, self.encoding,\n size,\n file=file)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Stats_Stats.report.for_key_count_in_sorted_.print_10d_count_key": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Stats_Stats.report.for_key_count_in_sorted_.print_10d_count_key", "embedding": null, "metadata": {"file_path": "test-data/samples/crawl2.py", "file_name": "crawl2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 608, "end_line": 619, "span_ids": ["Stats.report", "Stats.__init__", "Stats", "Stats.add"], "tokens": 112}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Stats:\n \"\"\"Record stats of various sorts.\"\"\"\n\n def __init__(self) -> None:\n self.stats = {} # type: Dict[str, int]\n\n def add(self, key: str, count: int = 1) -> None:\n self.stats[key] = self.stats.get(key, 0) + count\n\n def report(self, file: IO[str] = None) -> None:\n for key, count in sorted(self.stats.items()):\n print('%10d' % count, key, file=file)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Crawler_Crawler.close.self_pool_close_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Crawler_Crawler.close.self_pool_close_", "embedding": null, "metadata": {"file_path": "test-data/samples/crawl2.py", "file_name": "crawl2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 622, "end_line": 676, "span_ids": ["Crawler", "Crawler.__init__", "Crawler.close"], "tokens": 497}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Crawler:\n \"\"\"Crawl a set of URLs.\n\n This manages three disjoint sets of URLs (todo, busy, done). The\n data structures actually store dicts -- the values in todo give\n the redirect limit, while the values in busy and done are Fetcher\n instances.\n \"\"\"\n def __init__(self, log: Logger,\n roots: Set[str], exclude: str = None, strict: bool = True, # What to crawl.\n max_redirect: int = 10, max_tries: int = 4, # Per-url limits.\n max_tasks: int = 10, max_pool: int = 10, # Global limits.\n ) -> None:\n self.log = log\n self.roots = roots\n self.exclude = exclude\n self.strict = strict\n self.max_redirect = max_redirect\n self.max_tries = max_tries\n self.max_tasks = max_tasks\n self.max_pool = max_pool\n self.todo = {} # type: Dict[str, int]\n self.busy = {} # type: Dict[str, Fetcher]\n self.done = {} # type: Dict[str, Fetcher]\n self.pool = ConnectionPool(self.log, max_pool, max_tasks)\n self.root_domains = set() # type: Set[str]\n for root in roots:\n host = urllib.parse.urlparse(root).hostname\n if not host:\n continue\n if re.match(r'\\A[\\d\\.]*\\Z', host):\n self.root_domains.add(host)\n else:\n host = host.lower()\n if self.strict:\n self.root_domains.add(host)\n if host.startswith('www.'):\n self.root_domains.add(host[4:])\n else:\n self.root_domains.add('www.' + host)\n else:\n parts = host.split('.')\n if len(parts) > 2:\n host = '.'.join(parts[-2:])\n self.root_domains.add(host)\n for root in roots:\n self.add_url(root)\n self.governor = asyncio.Semaphore(max_tasks)\n self.termination = asyncio.Condition()\n self.t0 = time.time()\n self.t1 = None # type: Optional[float]\n\n def close(self) -> None:\n \"\"\"Close resources (currently only the pool).\"\"\"\n self.pool.close()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Crawler.host_okay_Crawler.host_okay.if_self_strict_.else_.return.self__host_okay_lenient_h": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Crawler.host_okay_Crawler.host_okay.if_self_strict_.else_.return.self__host_okay_lenient_h", "embedding": null, "metadata": {"file_path": "test-data/samples/crawl2.py", "file_name": "crawl2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 678, "end_line": 693, "span_ids": ["Crawler.host_okay"], "tokens": 139}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Crawler:\n\n def host_okay(self, host: str) -> bool:\n \"\"\"Check if a host should be crawled.\n\n A literal match (after lowercasing) is always good. For hosts\n that don't look like IP addresses, some approximate matches\n are okay depending on the strict flag.\n \"\"\"\n host = host.lower()\n if host in self.root_domains:\n return True\n if re.match(r'\\A[\\d\\.]*\\Z', host):\n return False\n if self.strict:\n return self._host_okay_strictish(host)\n else:\n return self._host_okay_lenient(host)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Crawler._host_okay_strictish_Crawler._host_okay_lenient.return.host_in_self_root_domains": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Crawler._host_okay_strictish_Crawler._host_okay_lenient.return.host_in_self_root_domains", "embedding": null, "metadata": {"file_path": "test-data/samples/crawl2.py", "file_name": "crawl2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 695, "end_line": 716, "span_ids": ["Crawler._host_okay_lenient", "Crawler._host_okay_strictish"], "tokens": 173}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Crawler:\n\n def _host_okay_strictish(self, host: str) -> bool:\n \"\"\"Check if a host should be crawled, strict-ish version.\n\n This checks for equality modulo an initial 'www.' component.\n \"\"\"\n if host.startswith('www.'):\n if host[4:] in self.root_domains:\n return True\n else:\n if 'www.' + host in self.root_domains:\n return True\n return False\n\n def _host_okay_lenient(self, host: str) -> bool:\n \"\"\"Check if a host should be crawled, lenient version.\n\n This compares the last two components of the host.\n \"\"\"\n parts = host.split('.')\n if len(parts) > 2:\n host = '.'.join(parts[-2:])\n return host in self.root_domains", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Crawler.add_url_Crawler.add_url.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Crawler.add_url_Crawler.add_url.return.True", "embedding": null, "metadata": {"file_path": "test-data/samples/crawl2.py", "file_name": "crawl2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 718, "end_line": 736, "span_ids": ["Crawler.add_url"], "tokens": 193}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Crawler:\n\n def add_url(self, url: str, max_redirect: int = None) -> bool:\n \"\"\"Add a URL to the todo list if not seen before.\"\"\"\n if self.exclude and re.search(self.exclude, url):\n return False\n parsed = urllib.parse.urlparse(url)\n if parsed.scheme not in ('http', 'https'):\n self.log(2, 'skipping non-http scheme in', url)\n return False\n host = parsed.hostname\n if not self.host_okay(host):\n self.log(2, 'skipping non-root host in', url)\n return False\n if max_redirect is None:\n max_redirect = self.max_redirect\n if url in self.todo or url in self.busy or url in self.done:\n return False\n self.log(1, 'adding', url, max_redirect)\n self.todo[url] = max_redirect\n return True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Crawler.crawl_Crawler.crawl.self.t1.time_time_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Crawler.crawl_Crawler.crawl.self.t1.time_time_", "embedding": null, "metadata": {"file_path": "test-data/samples/crawl2.py", "file_name": "crawl2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 738, "end_line": 753, "span_ids": ["Crawler.crawl"], "tokens": 127}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Crawler:\n\n async def crawl(self) -> None:\n \"\"\"Run the crawler until all finished.\"\"\"\n with (await self.termination):\n while self.todo or self.busy:\n if self.todo:\n url, max_redirect = self.todo.popitem()\n fetcher = Fetcher(self.log, url,\n crawler=self,\n max_redirect=max_redirect,\n max_tries=self.max_tries,\n )\n self.busy[url] = fetcher\n fetcher.task = asyncio.Task(self.fetch(fetcher))\n else:\n await self.termination.wait()\n self.t1 = time.time()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Crawler.fetch_Crawler.fetch.with_await_self_terminat.self_termination_notify_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Crawler.fetch_Crawler.fetch.with_await_self_terminat.self_termination_notify_", "embedding": null, "metadata": {"file_path": "test-data/samples/crawl2.py", "file_name": "crawl2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 755, "end_line": 770, "span_ids": ["Crawler.fetch"], "tokens": 136}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Crawler:\n\n async def fetch(self, fetcher: Fetcher) -> None:\n \"\"\"Call the Fetcher's fetch(), with a limit on concurrency.\n\n Once this returns, move the fetcher from busy to done.\n \"\"\"\n url = fetcher.url\n with (await self.governor):\n try:\n await fetcher.fetch() # Fetcher gonna fetch.\n finally:\n # Force GC of the task, so the error is logged.\n fetcher.task = None\n with (await self.termination):\n self.done[url] = fetcher\n del self.busy[url]\n self.termination.notify()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Crawler.report_Crawler.report.print_Date_time_ctime": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_Crawler.report_Crawler.report.print_Date_time_ctime", "embedding": null, "metadata": {"file_path": "test-data/samples/crawl2.py", "file_name": "crawl2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 772, "end_line": 801, "span_ids": ["Crawler.report"], "tokens": 281}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Crawler:\n\n def report(self, file: IO[str] = None) -> None:\n \"\"\"Print a report on all completed URLs.\"\"\"\n if self.t1 is None:\n self.t1 = time.time()\n dt = self.t1 - self.t0\n if dt and self.max_tasks:\n speed = len(self.done) / dt / self.max_tasks\n else:\n speed = 0\n stats = Stats()\n print('*** Report ***', file=file)\n try:\n show = [] # type: List[Tuple[str, Fetcher]]\n show.extend(self.done.items())\n show.extend(self.busy.items())\n show.sort()\n for url, fetcher in show:\n fetcher.report(stats, file=file)\n except KeyboardInterrupt:\n print('\\nInterrupted', file=file)\n print('Finished', len(self.done),\n 'urls in %.3f secs' % dt,\n '(max_tasks=%d)' % self.max_tasks,\n '(%.3f urls/sec/task)' % speed,\n file=file)\n stats.report(file=file)\n print('Todo:', len(self.todo), file=file)\n print('Busy:', len(self.busy), file=file)\n print('Done:', len(self.done), file=file)\n print('Date:', time.ctime(), 'local time', file=file)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_main_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/crawl2.py_main_", "embedding": null, "metadata": {"file_path": "test-data/samples/crawl2.py", "file_name": "crawl2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 804, "end_line": 853, "span_ids": ["impl:19", "main"], "tokens": 301}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def main() -> None:\n \"\"\"Main program.\n\n Parse arguments, set up event loop, run crawler, print report.\n \"\"\"\n args = ARGS.parse_args()\n if not args.roots:\n print('Use --help for command line help')\n return\n\n log = Logger(args.level)\n\n if args.iocp:\n if sys.platform == 'win32':\n from asyncio import ProactorEventLoop\n loop = ProactorEventLoop() # type: ignore\n asyncio.set_event_loop(loop)\n else:\n assert False\n elif args.select:\n loop = asyncio.SelectorEventLoop() # type: ignore\n asyncio.set_event_loop(loop)\n else:\n loop = asyncio.get_event_loop() # type: ignore\n\n roots = {fix_url(root) for root in args.roots}\n\n crawler = Crawler(log,\n roots, exclude=args.exclude,\n strict=args.strict,\n max_redirect=args.max_redirect,\n max_tries=args.max_tries,\n max_tasks=args.max_tasks,\n max_pool=args.max_pool,\n )\n try:\n loop.run_until_complete(crawler.crawl()) # Crawler gonna crawl.\n except KeyboardInterrupt:\n sys.stderr.flush()\n print('\\nInterrupted\\n')\n finally:\n crawler.report()\n crawler.close()\n loop.close()\n\n\nif __name__ == '__main__':\n logging.basicConfig(level=logging.INFO) # type: ignore\n main()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/dict.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/dict.py__", "embedding": null, "metadata": {"file_path": "test-data/samples/dict.py", "file_name": "dict.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 9, "span_ids": ["imports"], "tokens": 78}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import typing\nprices = {'apple': 0.40, 'banana': 0.50}\nmy_purchase = {\n 'apple': 1,\n 'banana': 6}\ngrocery_bill = sum(prices[fruit] * my_purchase[fruit]\n for fruit in my_purchase)\nprint('I owe the grocer $%.2f' % grocery_bill)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/fib.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/fib.py__", "embedding": null, "metadata": {"file_path": "test-data/samples/fib.py", "file_name": "fib.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 6, "span_ids": ["imports"], "tokens": 47}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import typing\nparents, babies = (1, 1)\nwhile babies < 100:\n print('This generation has {0} babies'.format(babies))\n parents, babies = (babies, parents + babies)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/files.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/files.py__", "embedding": null, "metadata": {"file_path": "test-data/samples/files.py", "file_name": "files.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 15, "span_ids": ["docstring"], "tokens": 82}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# indent your Python code to put into an email\nimport glob\nimport typing\n# glob supports Unix style pathname extensions\npython_files = glob.glob('*.py')\nfor file_name in sorted(python_files):\n print(' ------' + file_name)\n\n f = open(file_name)\n for line in f:\n print(' ' + line.rstrip())\n f.close()\n\n print()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/for.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/for.py__", "embedding": null, "metadata": {"file_path": "test-data/samples/for.py", "file_name": "for.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 5, "span_ids": ["imports"], "tokens": 46}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import typing\nfriends = ['john', 'pat', 'gary', 'michael']\nfor i, name in enumerate(friends):\n print(\"iteration {iteration} is {name}\".format(iteration=i, name=name))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/generators.py__Prime_number_sieve_with_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/generators.py__Prime_number_sieve_with_", "embedding": null, "metadata": {"file_path": "test-data/samples/generators.py", "file_name": "generators.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 25, "span_ids": ["impl", "iter_primes", "docstring"], "tokens": 147}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Prime number sieve with generators\n\nimport itertools\nfrom typing import Iterator\n\n\ndef iter_primes() -> Iterator[int]:\n # an iterator of all numbers between 2 and +infinity\n numbers = itertools.count(2) # type: Iterator[int]\n\n # generate primes forever\n while True:\n # get the first number from the iterator (always a prime)\n prime = next(numbers)\n yield prime\n\n # this code iteratively builds up a chain of\n # filters...slightly tricky, but ponder it a bit\n numbers = filter(prime.__rmod__, numbers)\n\nfor p in iter_primes():\n if p > 1000:\n break\n print(p)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/greet.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/greet.py__", "embedding": null, "metadata": {"file_path": "test-data/samples/greet.py", "file_name": "greet.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 9, "span_ids": ["imports", "greet", "impl"], "tokens": 35}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import typing\n\n\ndef greet(name: str) -> None:\n print('Hello', name)\ngreet('Jack')\ngreet('Jill')\ngreet('Bob')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/guess.py__Guess_the_Number_Game_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/guess.py__Guess_the_Number_Game_", "embedding": null, "metadata": {"file_path": "test-data/samples/guess.py", "file_name": "guess.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 33, "span_ids": ["docstring"], "tokens": 202}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# \"Guess the Number\" Game (edited) from http://inventwithpython.com\n\nimport random\nimport typing\n\nguesses_made = 0\n\nname = input('Hello! What is your name?\\n')\n\nnumber = random.randint(1, 20)\nprint('Well, {0}, I am thinking of a number between 1 and 20.'.format(name))\n\nwhile guesses_made < 6:\n\n guess = int(input('Take a guess: '))\n\n guesses_made += 1\n\n if guess < number:\n print('Your guess is too low.')\n\n if guess > number:\n print('Your guess is too high.')\n\n if guess == number:\n break\n\nif guess == number:\n print('Good job, {0}! You guessed my number in {1} guesses!'.format(\n name, guesses_made))\nelse:\n print('Nope. The number I was thinking of was {0}'.format(number))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/hello.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/hello.py__", "embedding": null, "metadata": {"file_path": "test-data/samples/hello.py", "file_name": "hello.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 3, "span_ids": ["imports"], "tokens": 9}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import typing\nprint('Hello, world')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/input.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/input.py__", "embedding": null, "metadata": {"file_path": "test-data/samples/input.py", "file_name": "input.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 4, "span_ids": ["imports"], "tokens": 24}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import typing\nname = input('What is your name?\\n')\nprint('Hi, %s.' % name)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/itertool.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/itertool.py__", "embedding": null, "metadata": {"file_path": "test-data/samples/itertool.py", "file_name": "itertool.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 17, "span_ids": ["imports"], "tokens": 93}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from itertools import groupby\nimport typing\nlines = '''\nThis is the\nfirst paragraph.\n\nThis is the second.\n'''.splitlines()\n# Use itertools.groupby and bool to return groups of\n# consecutive lines that either have content or don't.\nfor has_chars, frags in groupby(lines, bool):\n if has_chars:\n print(' '.join(frags))\n# PRINTS:\n# This is the first paragraph.\n# This is the second.", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/regexp.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/samples/regexp.py__", "embedding": null, "metadata": {"file_path": "test-data/samples/regexp.py", "file_name": "regexp.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 8, "span_ids": ["imports"], "tokens": 67}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import typing\nimport re\nfor test_string in ['555-1212', 'ILL-EGAL']:\n if re.match(r'^\\d{3}-\\d{4}$', test_string):\n print(test_string, 'is a valid US local phone number')\n else:\n print(test_string, 'rejected')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/base64.py__usr_bin_env_python3__translate.return.s_translate_translation_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/base64.py__usr_bin_env_python3__translate.return.s_translate_translation_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/base64.py", "file_name": "base64.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 41, "span_ids": ["_translate", "docstring"], "tokens": 369}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "#! /usr/bin/env python3\n\n\"\"\"RFC 3548: Base16, Base32, Base64 Data Encodings\"\"\"\n\n# Modified 04-Oct-1995 by Jack Jansen to use binascii module\n# Modified 30-Dec-2003 by Barry Warsaw to add full RFC 3548 support\n# Modified 22-May-2007 by Guido van Rossum to use bytes everywhere\n\nimport re\nimport struct\nimport binascii\n\nfrom typing import Dict, List, AnyStr, IO\n\n\n__all__ = [\n # Legacy interface exports traditional RFC 1521 Base64 encodings\n 'encode', 'decode', 'encodebytes', 'decodebytes',\n # Generalized interface for other encodings\n 'b64encode', 'b64decode', 'b32encode', 'b32decode',\n 'b16encode', 'b16decode',\n # Standard Base64 encoding\n 'standard_b64encode', 'standard_b64decode',\n # Some common Base64 alternatives. As referenced by RFC 3458, see thread\n # starting at:\n #\n # http://zgp.org/pipermail/p2p-hackers/2001-September/000316.html\n 'urlsafe_b64encode', 'urlsafe_b64decode',\n ]\n\n\nbytes_types = (bytes, bytearray) # Types acceptable as binary data\n\n\ndef _translate(s: bytes, altchars: Dict[AnyStr, bytes]) -> bytes:\n if not isinstance(s, bytes_types):\n raise TypeError(\"expected bytes, not %s\" % s.__class__.__name__)\n translation = bytearray(range(256))\n for k, v in altchars.items():\n translation[ord(k)] = v[0]\n return s.translate(translation)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/base64.py__Base64_encoding_decodin_b64encode.return.encoded": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/base64.py__Base64_encoding_decodin_b64encode.return.encoded", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/base64.py", "file_name": "base64.py", "file_type": "text/x-python", "category": "implementation", "start_line": 45, "end_line": 67, "span_ids": ["_translate", "b64encode"], "tokens": 240}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Base64 encoding/decoding uses binascii\n\ndef b64encode(s: bytes, altchars: bytes = None) -> bytes:\n \"\"\"Encode a byte string using Base64.\n\n s is the byte string to encode. Optional altchars must be a byte\n string of length 2 which specifies an alternative alphabet for the\n '+' and '/' characters. This allows an application to\n e.g. generate url or filesystem safe Base64 strings.\n\n The encoded byte string is returned.\n \"\"\"\n if not isinstance(s, bytes_types):\n raise TypeError(\"expected bytes, not %s\" % s.__class__.__name__)\n # Strip off the trailing newline\n encoded = binascii.b2a_base64(s)[:-1]\n if altchars is not None:\n if not isinstance(altchars, bytes_types):\n raise TypeError(\"expected bytes, not %s\"\n % altchars.__class__.__name__)\n assert len(altchars) == 2, repr(altchars)\n return _translate(encoded, {'+': altchars[0:1], '/': altchars[1:2]})\n return encoded", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/base64.py_b64decode_b64decode.return.binascii_a2b_base64_s_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/base64.py_b64decode_b64decode.return.binascii_a2b_base64_s_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/base64.py", "file_name": "base64.py", "file_type": "text/x-python", "category": "implementation", "start_line": 70, "end_line": 95, "span_ids": ["b64decode"], "tokens": 306}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def b64decode(s: bytes, altchars: bytes = None,\n validate: bool = False) -> bytes:\n \"\"\"Decode a Base64 encoded byte string.\n\n s is the byte string to decode. Optional altchars must be a\n string of length 2 which specifies the alternative alphabet used\n instead of the '+' and '/' characters.\n\n The decoded string is returned. A binascii.Error is raised if s is\n incorrectly padded.\n\n If validate is False (the default), non-base64-alphabet characters are\n discarded prior to the padding check. If validate is True,\n non-base64-alphabet characters in the input result in a binascii.Error.\n \"\"\"\n if not isinstance(s, bytes_types):\n raise TypeError(\"expected bytes, not %s\" % s.__class__.__name__)\n if altchars is not None:\n if not isinstance(altchars, bytes_types):\n raise TypeError(\"expected bytes, not %s\"\n % altchars.__class__.__name__)\n assert len(altchars) == 2, repr(altchars)\n s = _translate(s, {chr(altchars[0]): b'+', chr(altchars[1]): b'/'})\n if validate and not re.match(b'^[A-Za-z0-9+/]*={0,2}$', s):\n raise binascii.Error('Non-base64 digit found')\n return binascii.a2b_base64(s)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/base64.py_standard_b64encode__b32rev.dict_v_0_k_for_k_v_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/base64.py_standard_b64encode__b32rev.dict_v_0_k_for_k_v_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/base64.py", "file_name": "base64.py", "file_type": "text/x-python", "category": "implementation", "start_line": 98, "end_line": 152, "span_ids": ["urlsafe_b64decode", "standard_b64decode", "impl:5", "urlsafe_b64encode", "standard_b64encode"], "tokens": 598}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def standard_b64encode(s: bytes) -> bytes:\n \"\"\"Encode a byte string using the standard Base64 alphabet.\n\n s is the byte string to encode. The encoded byte string is returned.\n \"\"\"\n return b64encode(s)\n\ndef standard_b64decode(s: bytes) -> bytes:\n \"\"\"Decode a byte string encoded with the standard Base64 alphabet.\n\n s is the byte string to decode. The decoded byte string is\n returned. binascii.Error is raised if the input is incorrectly\n padded or if there are non-alphabet characters present in the\n input.\n \"\"\"\n return b64decode(s)\n\ndef urlsafe_b64encode(s: bytes) -> bytes:\n \"\"\"Encode a byte string using a url-safe Base64 alphabet.\n\n s is the byte string to encode. The encoded byte string is\n returned. The alphabet uses '-' instead of '+' and '_' instead of\n '/'.\n \"\"\"\n return b64encode(s, b'-_')\n\ndef urlsafe_b64decode(s: bytes) -> bytes:\n \"\"\"Decode a byte string encoded with the standard Base64 alphabet.\n\n s is the byte string to decode. The decoded byte string is\n returned. binascii.Error is raised if the input is incorrectly\n padded or if there are non-alphabet characters present in the\n input.\n\n The alphabet uses '-' instead of '+' and '_' instead of '/'.\n \"\"\"\n return b64decode(s, b'-_')\n\n\n\n# Base32 encoding/decoding must be done in Python\n_b32alphabet = {\n 0: b'A', 9: b'J', 18: b'S', 27: b'3',\n 1: b'B', 10: b'K', 19: b'T', 28: b'4',\n 2: b'C', 11: b'L', 20: b'U', 29: b'5',\n 3: b'D', 12: b'M', 21: b'V', 30: b'6',\n 4: b'E', 13: b'N', 22: b'W', 31: b'7',\n 5: b'F', 14: b'O', 23: b'X',\n 6: b'G', 15: b'P', 24: b'Y',\n 7: b'H', 16: b'Q', 25: b'Z',\n 8: b'I', 17: b'R', 26: b'2',\n }\n\n_b32tab = [v[0] for k, v in sorted(_b32alphabet.items())]\n_b32rev = dict([(v[0], k) for k, v in _b32alphabet.items()])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/base64.py_b32encode_b32encode.return.encoded": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/base64.py_b32encode_b32encode.return.encoded", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/base64.py", "file_name": "base64.py", "file_type": "text/x-python", "category": "implementation", "start_line": 155, "end_line": 195, "span_ids": ["b32encode"], "tokens": 631}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def b32encode(s: bytes) -> bytes:\n \"\"\"Encode a byte string using Base32.\n\n s is the byte string to encode. The encoded byte string is returned.\n \"\"\"\n if not isinstance(s, bytes_types):\n raise TypeError(\"expected bytes, not %s\" % s.__class__.__name__)\n quanta, leftover = divmod(len(s), 5)\n # Pad the last quantum with zero bits if necessary\n if leftover:\n s = s + bytes(5 - leftover) # Don't use += !\n quanta += 1\n encoded = bytes()\n for i in range(quanta):\n # c1 and c2 are 16 bits wide, c3 is 8 bits wide. The intent of this\n # code is to process the 40 bits in units of 5 bits. So we take the 1\n # leftover bit of c1 and tack it onto c2. Then we take the 2 leftover\n # bits of c2 and tack them onto c3. The shifts and masks are intended\n # to give us values of exactly 5 bits in width.\n c1, c2, c3 = struct.unpack('!HHB', s[i*5:(i+1)*5]) # type: (int, int, int)\n c2 += (c1 & 1) << 16 # 17 bits wide\n c3 += (c2 & 3) << 8 # 10 bits wide\n encoded += bytes([_b32tab[c1 >> 11], # bits 1 - 5\n _b32tab[(c1 >> 6) & 0x1f], # bits 6 - 10\n _b32tab[(c1 >> 1) & 0x1f], # bits 11 - 15\n _b32tab[c2 >> 12], # bits 16 - 20 (1 - 5)\n _b32tab[(c2 >> 7) & 0x1f], # bits 21 - 25 (6 - 10)\n _b32tab[(c2 >> 2) & 0x1f], # bits 26 - 30 (11 - 15)\n _b32tab[c3 >> 5], # bits 31 - 35 (1 - 5)\n _b32tab[c3 & 0x1f], # bits 36 - 40 (1 - 5)\n ])\n # Adjust for any leftover partial quanta\n if leftover == 1:\n return encoded[:-6] + b'======'\n elif leftover == 2:\n return encoded[:-4] + b'===='\n elif leftover == 3:\n return encoded[:-3] + b'==='\n elif leftover == 4:\n return encoded[:-1] + b'='\n return encoded", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/base64.py_b32decode_b32decode.return.b_join_parts_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/base64.py_b32decode_b32decode.return.b_join_parts_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/base64.py", "file_name": "base64.py", "file_type": "text/x-python", "category": "implementation", "start_line": 198, "end_line": 270, "span_ids": ["b32decode"], "tokens": 783}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def b32decode(s: bytes, casefold: bool = False, map01: bytes = None) -> bytes:\n \"\"\"Decode a Base32 encoded byte string.\n\n s is the byte string to decode. Optional casefold is a flag\n specifying whether a lowercase alphabet is acceptable as input.\n For security purposes, the default is False.\n\n RFC 3548 allows for optional mapping of the digit 0 (zero) to the\n letter O (oh), and for optional mapping of the digit 1 (one) to\n either the letter I (eye) or letter L (el). The optional argument\n map01 when not None, specifies which letter the digit 1 should be\n mapped to (when map01 is not None, the digit 0 is always mapped to\n the letter O). For security purposes the default is None, so that\n 0 and 1 are not allowed in the input.\n\n The decoded byte string is returned. binascii.Error is raised if\n the input is incorrectly padded or if there are non-alphabet\n characters present in the input.\n \"\"\"\n if not isinstance(s, bytes_types):\n raise TypeError(\"expected bytes, not %s\" % s.__class__.__name__)\n quanta, leftover = divmod(len(s), 8)\n if leftover:\n raise binascii.Error('Incorrect padding')\n # Handle section 2.4 zero and one mapping. The flag map01 will be either\n # False, or the character to map the digit 1 (one) to. It should be\n # either L (el) or I (eye).\n if map01 is not None:\n if not isinstance(map01, bytes_types):\n raise TypeError(\"expected bytes, not %s\" % map01.__class__.__name__)\n assert len(map01) == 1, repr(map01)\n s = _translate(s, {b'0': b'O', b'1': map01})\n if casefold:\n s = s.upper()\n # Strip off pad characters from the right. We need to count the pad\n # characters because this will tell us how many null bytes to remove from\n # the end of the decoded string.\n padchars = 0\n mo = re.search(b'(?P[=]*)$', s)\n if mo:\n padchars = len(mo.group('pad'))\n if padchars > 0:\n s = s[:-padchars]\n # Now decode the full quanta\n parts = [] # type: List[bytes]\n acc = 0\n shift = 35\n for c in s:\n val = _b32rev.get(c)\n if val is None:\n raise TypeError('Non-base32 digit found')\n acc += _b32rev[c] << shift\n shift -= 5\n if shift < 0:\n parts.append(binascii.unhexlify(bytes('%010x' % acc, \"ascii\")))\n acc = 0\n shift = 35\n # Process the last, partial quanta\n last = binascii.unhexlify(bytes('%010x' % acc, \"ascii\"))\n if padchars == 0:\n last = b'' # No characters\n elif padchars == 1:\n last = last[:-1]\n elif padchars == 3:\n last = last[:-2]\n elif padchars == 4:\n last = last[:-3]\n elif padchars == 6:\n last = last[:-4]\n else:\n raise binascii.Error('Incorrect padding')\n parts.append(last)\n return b''.join(parts)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/base64.py__RFC_3548_Base_16_Alpha_b16encode.return.binascii_hexlify_s_upper": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/base64.py__RFC_3548_Base_16_Alpha_b16encode.return.binascii_hexlify_s_upper", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/base64.py", "file_name": "base64.py", "file_type": "text/x-python", "category": "implementation", "start_line": 274, "end_line": 284, "span_ids": ["b32decode", "b16encode"], "tokens": 115}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# RFC 3548, Base 16 Alphabet specifies uppercase, but hexlify() returns\n# lowercase. The RFC also recommends against accepting input case\n# insensitively.\ndef b16encode(s: bytes) -> bytes:\n \"\"\"Encode a byte string using Base16.\n\n s is the byte string to encode. The encoded byte string is returned.\n \"\"\"\n if not isinstance(s, bytes_types):\n raise TypeError(\"expected bytes, not %s\" % s.__class__.__name__)\n return binascii.hexlify(s).upper()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/base64.py_b16decode_b16decode.return.binascii_unhexlify_s_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/base64.py_b16decode_b16decode.return.binascii_unhexlify_s_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/base64.py", "file_name": "base64.py", "file_type": "text/x-python", "category": "implementation", "start_line": 287, "end_line": 304, "span_ids": ["b16decode"], "tokens": 178}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def b16decode(s: bytes, casefold: bool = False) -> bytes:\n \"\"\"Decode a Base16 encoded byte string.\n\n s is the byte string to decode. Optional casefold is a flag\n specifying whether a lowercase alphabet is acceptable as input.\n For security purposes, the default is False.\n\n The decoded byte string is returned. binascii.Error is raised if\n s were incorrectly padded or if there are non-alphabet characters\n present in the string.\n \"\"\"\n if not isinstance(s, bytes_types):\n raise TypeError(\"expected bytes, not %s\" % s.__class__.__name__)\n if casefold:\n s = s.upper()\n if re.search(b'[^0-9A-F]', s):\n raise binascii.Error('Non-base16 digit found')\n return binascii.unhexlify(s)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/base64.py__Legacy_interface_This_decode.while_True_.output_write_s_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/base64.py__Legacy_interface_This_decode.while_True_.output_write_s_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/base64.py", "file_name": "base64.py", "file_type": "text/x-python", "category": "implementation", "start_line": 308, "end_line": 337, "span_ids": ["impl:11", "decode", "b16decode", "encode"], "tokens": 247}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Legacy interface. This code could be cleaned up since I don't believe\n# binascii has any line length limitations. It just doesn't seem worth it\n# though. The files should be opened in binary mode.\n\nMAXLINESIZE = 76 # Excluding the CRLF\nMAXBINSIZE = (MAXLINESIZE//4)*3\n\ndef encode(input: IO[bytes], output: IO[bytes]) -> None:\n \"\"\"Encode a file; input and output are binary files.\"\"\"\n while True:\n s = input.read(MAXBINSIZE)\n if not s:\n break\n while len(s) < MAXBINSIZE:\n ns = input.read(MAXBINSIZE-len(s))\n if not ns:\n break\n s += ns\n line = binascii.b2a_base64(s)\n output.write(line)\n\n\ndef decode(input: IO[bytes], output: IO[bytes]) -> None:\n \"\"\"Decode a file; input and output are binary files.\"\"\"\n while True:\n line = input.readline()\n if not line:\n break\n s = binascii.a2b_base64(line)\n output.write(s)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/base64.py_encodebytes_encodebytes.return.b_join_pieces_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/base64.py_encodebytes_encodebytes.return.b_join_pieces_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/base64.py", "file_name": "base64.py", "file_type": "text/x-python", "category": "implementation", "start_line": 340, "end_line": 349, "span_ids": ["encodebytes"], "tokens": 121}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def encodebytes(s: bytes) -> bytes:\n \"\"\"Encode a bytestring into a bytestring containing multiple lines\n of base-64 data.\"\"\"\n if not isinstance(s, bytes_types):\n raise TypeError(\"expected bytes, not %s\" % s.__class__.__name__)\n pieces = [] # type: List[bytes]\n for i in range(0, len(s), MAXBINSIZE):\n chunk = s[i : i + MAXBINSIZE]\n pieces.append(binascii.b2a_base64(chunk))\n return b\"\".join(pieces)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/base64.py_encodestring_decodestring.return.decodebytes_s_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/base64.py_encodestring_decodestring.return.decodebytes_s_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/base64.py", "file_name": "base64.py", "file_type": "text/x-python", "category": "implementation", "start_line": 351, "end_line": 370, "span_ids": ["encodestring", "decodestring", "decodebytes"], "tokens": 180}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def encodestring(s: bytes) -> bytes:\n \"\"\"Legacy alias of encodebytes().\"\"\"\n import warnings\n warnings.warn(\"encodestring() is a deprecated alias, use encodebytes()\",\n DeprecationWarning, 2)\n return encodebytes(s)\n\n\ndef decodebytes(s: bytes) -> bytes:\n \"\"\"Decode a bytestring of base-64 data into a bytestring.\"\"\"\n if not isinstance(s, bytes_types):\n raise TypeError(\"expected bytes, not %s\" % s.__class__.__name__)\n return binascii.a2b_base64(s)\n\ndef decodestring(s: bytes) -> bytes:\n \"\"\"Legacy alias of decodebytes().\"\"\"\n import warnings\n warnings.warn(\"decodestring() is a deprecated alias, use decodebytes()\",\n DeprecationWarning, 2)\n return decodebytes(s)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/base64.py__Usable_as_a_script__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/base64.py__Usable_as_a_script__", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/base64.py", "file_name": "base64.py", "file_type": "text/x-python", "category": "implementation", "start_line": 373, "end_line": 412, "span_ids": ["decodestring", "test", "impl:15", "main"], "tokens": 306}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Usable as a script...\ndef main() -> None:\n \"\"\"Small main program\"\"\"\n import sys, getopt\n try:\n opts, args = getopt.getopt(sys.argv[1:], 'deut')\n except getopt.error as msg:\n sys.stdout = sys.stderr\n print(msg)\n print(\"\"\"usage: %s [-d|-e|-u|-t] [file|-]\n -d, -u: decode\n -e: encode (default)\n -t: encode and decode string 'Aladdin:open sesame'\"\"\"%sys.argv[0])\n sys.exit(2)\n func = encode\n for o, a in opts:\n if o == '-e': func = encode\n if o == '-d': func = decode\n if o == '-u': func = decode\n if o == '-t': test(); return\n if args and args[0] != '-':\n with open(args[0], 'rb') as f:\n func(f, sys.stdout.buffer)\n else:\n func(sys.stdin.buffer, sys.stdout.buffer)\n\n\ndef test() -> None:\n s0 = b\"Aladdin:open sesame\"\n print(repr(s0))\n s1 = encodebytes(s0)\n print(repr(s1))\n s2 = decodebytes(s1)\n print(repr(s2))\n assert s0 == s2\n\n\nif __name__ == '__main__':\n main()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/fnmatch.py__Filename_matching_with___all__._filter_fnmatch_fn": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/fnmatch.py__Filename_matching_with___all__._filter_fnmatch_fn", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/fnmatch.py", "file_name": "fnmatch.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 19, "span_ids": ["docstring"], "tokens": 135}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Filename matching with shell patterns.\n\nfnmatch(FILENAME, PATTERN) matches according to the local convention.\nfnmatchcase(FILENAME, PATTERN) always takes case in account.\n\nThe functions operate by translating the pattern into a regular\nexpression. They cache the compiled regular expressions for speed.\n\nThe function translate(PATTERN) returns a regular expression\ncorresponding to PATTERN. (It does not compile it.)\n\"\"\"\nimport os\nimport posixpath\nimport re\nimport functools\n\nfrom typing import Iterable, List, AnyStr, Any, Callable, Match\n\n__all__ = [\"filter\", \"fnmatch\", \"fnmatchcase\", \"translate\"]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/fnmatch.py_fnmatch_fnmatch.return.fnmatchcase_name_pat_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/fnmatch.py_fnmatch_fnmatch.return.fnmatchcase_name_pat_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/fnmatch.py", "file_name": "fnmatch.py", "file_type": "text/x-python", "category": "implementation", "start_line": 21, "end_line": 38, "span_ids": ["fnmatch"], "tokens": 150}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def fnmatch(name: AnyStr, pat: AnyStr) -> bool:\n \"\"\"Test whether FILENAME matches PATTERN.\n\n Patterns are Unix shell style:\n\n * matches everything\n ? matches any single character\n [seq] matches any character in seq\n [!seq] matches any char not in seq\n\n An initial period in FILENAME is not special.\n Both FILENAME and PATTERN are first case-normalized\n if the operating system requires it.\n If you don't want this, use fnmatchcase(FILENAME, PATTERN).\n \"\"\"\n name = os.path.normcase(name)\n pat = os.path.normcase(pat)\n return fnmatchcase(name, pat)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/fnmatch.py__compile_pattern_fnmatchcase.return.match_name_is_not_None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/fnmatch.py__compile_pattern_fnmatchcase.return.match_name_is_not_None", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/fnmatch.py", "file_name": "fnmatch.py", "file_type": "text/x-python", "category": "implementation", "start_line": 40, "end_line": 75, "span_ids": ["fnmatchcase", "_compile_pattern", "filter"], "tokens": 308}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@functools.lru_cache(maxsize=250)\ndef _compile_pattern(pat: AnyStr,\n is_bytes: bool = False) -> Callable[[AnyStr],\n Match[AnyStr]]:\n if isinstance(pat, bytes):\n pat_str = str(pat, 'ISO-8859-1')\n res_str = translate(pat_str)\n res = bytes(res_str, 'ISO-8859-1')\n else:\n res = translate(pat)\n return re.compile(res).match\n\ndef filter(names: Iterable[AnyStr], pat: AnyStr) -> List[AnyStr]:\n \"\"\"Return the subset of the list NAMES that match PAT.\"\"\"\n result = [] # type: List[AnyStr]\n pat = os.path.normcase(pat)\n match = _compile_pattern(pat, isinstance(pat, bytes))\n if os.path is posixpath:\n # normcase on posix is NOP. Optimize it away from the loop.\n for name in names:\n if match(name):\n result.append(name)\n else:\n for name in names:\n if match(os.path.normcase(name)):\n result.append(name)\n return result\n\ndef fnmatchcase(name: AnyStr, pat: AnyStr) -> bool:\n \"\"\"Test whether FILENAME matches PATTERN, including case.\n\n This is a version of fnmatch() which doesn't case-normalize\n its arguments.\n \"\"\"\n match = _compile_pattern(pat, isinstance(pat, bytes))\n return match(name) is not None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/fnmatch.py_translate_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/fnmatch.py_translate_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/fnmatch.py", "file_name": "fnmatch.py", "file_type": "text/x-python", "category": "implementation", "start_line": 77, "end_line": 113, "span_ids": ["translate"], "tokens": 270}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def translate(pat: str) -> str:\n \"\"\"Translate a shell PATTERN to a regular expression.\n\n There is no way to quote meta-characters.\n \"\"\"\n\n i, n = 0, len(pat)\n res = ''\n while i < n:\n c = pat[i]\n i = i+1\n if c == '*':\n res = res + '.*'\n elif c == '?':\n res = res + '.'\n elif c == '[':\n j = i\n if j < n and pat[j] == '!':\n j = j+1\n if j < n and pat[j] == ']':\n j = j+1\n while j < n and pat[j] != ']':\n j = j+1\n if j >= n:\n res = res + '\\\\['\n else:\n stuff = pat[i:j].replace('\\\\','\\\\\\\\')\n i = j+1\n if stuff[0] == '!':\n stuff = '^' + stuff[1:]\n elif stuff[0] == '^':\n stuff = '\\\\' + stuff\n res = '%s[%s]' % (res, stuff)\n else:\n res = res + re.escape(c)\n return res + r'\\Z(?ms)'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/genericpath.py___commonprefix.return.s1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/genericpath.py___commonprefix.return.s1", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/genericpath.py", "file_name": "genericpath.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 80, "span_ids": ["getmtime", "exists", "commonprefix", "isfile", "isdir", "getsize", "docstring", "getatime", "getctime"], "tokens": 579}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"\nPath operations common to more than one OS\nDo not use directly. The OS specific modules import the appropriate\nfunctions from this module themselves.\n\"\"\"\nimport os\nimport stat\n\nfrom typing import (\n Any as Any_, List as List_, AnyStr as AnyStr_, Tuple as Tuple_\n)\n\n__all__ = ['commonprefix', 'exists', 'getatime', 'getctime', 'getmtime',\n 'getsize', 'isdir', 'isfile']\n\n\n# Does a path exist?\n# This is false for dangling symbolic links on systems that support them.\ndef exists(path: AnyStr_) -> bool:\n \"\"\"Test whether a path exists. Returns False for broken symbolic links\"\"\"\n try:\n os.stat(path)\n except os.error:\n return False\n return True\n\n\n# This follows symbolic links, so both islink() and isdir() can be true\n# for the same path ono systems that support symlinks\ndef isfile(path: AnyStr_) -> bool:\n \"\"\"Test whether a path is a regular file\"\"\"\n try:\n st = os.stat(path)\n except os.error:\n return False\n return stat.S_ISREG(st.st_mode)\n\n\n# Is a path a directory?\n# This follows symbolic links, so both islink() and isdir()\n# can be true for the same path on systems that support symlinks\ndef isdir(s: AnyStr_) -> bool:\n \"\"\"Return true if the pathname refers to an existing directory.\"\"\"\n try:\n st = os.stat(s)\n except os.error:\n return False\n return stat.S_ISDIR(st.st_mode)\n\n\ndef getsize(filename: AnyStr_) -> int:\n \"\"\"Return the size of a file, reported by os.stat().\"\"\"\n return os.stat(filename).st_size\n\n\ndef getmtime(filename: AnyStr_) -> float:\n \"\"\"Return the last modification time of a file, reported by os.stat().\"\"\"\n return os.stat(filename).st_mtime\n\n\ndef getatime(filename: AnyStr_) -> float:\n \"\"\"Return the last access time of a file, reported by os.stat().\"\"\"\n return os.stat(filename).st_atime\n\n\ndef getctime(filename: AnyStr_) -> float:\n \"\"\"Return the metadata change time of a file, reported by os.stat().\"\"\"\n return os.stat(filename).st_ctime\n\n\n# Return the longest prefix of all list elements.\ndef commonprefix(m: List_[Any_]) -> Any_:\n \"Given a list of pathnames, returns the longest common leading component\"\n if not m: return ''\n s1 = min(m)\n s2 = max(m)\n for i, c in enumerate(s1):\n if c != s2[i]:\n return s1[:i]\n return s1", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/genericpath.py__Split_a_path_in_root_an_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/genericpath.py__Split_a_path_in_root_an_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/genericpath.py", "file_name": "genericpath.py", "file_type": "text/x-python", "category": "implementation", "start_line": 83, "end_line": 113, "span_ids": ["_splitext", "commonprefix"], "tokens": 281}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Split a path in root and extension.\n# The extension is everything starting at the last dot in the last\n# pathname component; the root is everything before that.\n# It is always true that root + ext == p.\n\n# Generic implementation of splitext, to be parametrized with\n# the separators\ndef _splitext(p: AnyStr_, sep: AnyStr_, altsep: AnyStr_,\n extsep: AnyStr_) -> Tuple_[AnyStr_, AnyStr_]:\n \"\"\"Split the extension from a pathname.\n\n Extension is everything from the last dot to the end, ignoring\n leading dots. Returns \"(root, ext)\"; ext may be empty.\"\"\"\n # NOTE: This code must work for text and bytes strings.\n\n sepIndex = p.rfind(sep)\n if altsep:\n altsepIndex = p.rfind(altsep)\n sepIndex = max(sepIndex, altsepIndex)\n\n dotIndex = p.rfind(extsep)\n if dotIndex > sepIndex:\n # skip all leading dots\n filenameIndex = sepIndex + 1\n while filenameIndex < dotIndex:\n if p[filenameIndex:filenameIndex+1] != extsep:\n return p[:dotIndex], p[dotIndex:]\n filenameIndex += 1\n\n return p, p[:0]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/getopt.py__Parser_for_command_lin_error.GetoptError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/getopt.py__Parser_for_command_lin_error.GetoptError", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/getopt.py", "file_name": "getopt.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 51, "span_ids": ["impl:3", "GetoptError.__str__", "GetoptError", "GetoptError.__init__", "docstring"], "tokens": 396}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Parser for command line options.\n\nThis module helps scripts to parse the command line arguments in\nsys.argv. It supports the same conventions as the Unix getopt()\nfunction (including the special meanings of arguments of the form `-'\nand `--'). Long options similar to those supported by GNU software\nmay be used as well via an optional third argument. This module\nprovides two functions and an exception:\n\ngetopt() -- Parse command line options\ngnu_getopt() -- Like getopt(), but allow option and non-option arguments\nto be intermixed.\nGetoptError -- exception (class) raised with 'opt' attribute, which is the\noption involved with the exception.\n\"\"\"\n\n# Long option support added by Lars Wirzenius .\n#\n# Gerrit Holl moved the string-based exceptions\n# to class-based exceptions.\n#\n# Peter \u00c3\u0085strand added gnu_getopt().\n#\n# TODO for gnu_getopt():\n#\n# - GNU getopt_long_only mechanism\n# - allow the caller to specify ordering\n# - RETURN_IN_ORDER option\n# - GNU extension with '-' as first character of option string\n# - optional arguments, specified by double colons\n# - a option string with a W followed by semicolon should\n# treat \"-W foo\" as \"--foo\"\n\n__all__ = [\"GetoptError\",\"error\",\"getopt\",\"gnu_getopt\"]\n\nimport os\n\nfrom typing import List, Tuple, Iterable\n\nclass GetoptError(Exception):\n opt = ''\n msg = ''\n def __init__(self, msg: str, opt: str = '') -> None:\n self.msg = msg\n self.opt = opt\n Exception.__init__(self, msg, opt)\n\n def __str__(self) -> str:\n return self.msg\n\nerror = GetoptError", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/getopt.py__backward_compatibility_getopt.return.opts_args": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/getopt.py__backward_compatibility_getopt.return.opts_args", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/getopt.py", "file_name": "getopt.py", "file_type": "text/x-python", "category": "implementation", "start_line": 51, "end_line": 96, "span_ids": ["impl:3", "getopt"], "tokens": 496}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": " # backward compatibility\n\ndef getopt(args: List[str], shortopts: str,\n longopts: Iterable[str] = []) -> Tuple[List[Tuple[str, str]],\n List[str]]:\n \"\"\"getopt(args, options[, long_options]) -> opts, args\n\n Parses command line options and parameter list. args is the\n argument list to be parsed, without the leading reference to the\n running program. Typically, this means \"sys.argv[1:]\". shortopts\n is the string of option letters that the script wants to\n recognize, with options that require an argument followed by a\n colon (i.e., the same format that Unix getopt() uses). If\n specified, longopts is a list of strings with the names of the\n long options which should be supported. The leading '--'\n characters should not be included in the option name. Options\n which require an argument should be followed by an equal sign\n ('=').\n\n The return value consists of two elements: the first is a list of\n (option, value) pairs; the second is the list of program arguments\n left after the option list was stripped (this is a trailing slice\n of the first argument). Each option-and-value pair returned has\n the option as its first element, prefixed with a hyphen (e.g.,\n '-x'), and the option argument as its second element, or an empty\n string if the option has no argument. The options occur in the\n list in the same order in which they were found, thus allowing\n multiple occurrences. Long and short options may be mixed.\n\n \"\"\"\n\n opts = [] # type: List[Tuple[str, str]]\n if isinstance(longopts, str):\n longopts = [longopts]\n else:\n longopts = list(longopts)\n while args and args[0].startswith('-') and args[0] != '-':\n if args[0] == '--':\n args = args[1:]\n break\n if args[0].startswith('--'):\n opts, args = do_longs(opts, args[0][2:], longopts, args[1:])\n else:\n opts, args = do_shorts(opts, args[0][1:], shortopts, args[1:])\n\n return opts, args", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/getopt.py_gnu_getopt_gnu_getopt.return.opts_prog_args": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/getopt.py_gnu_getopt_gnu_getopt.return.opts_prog_args", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/getopt.py", "file_name": "getopt.py", "file_type": "text/x-python", "category": "implementation", "start_line": 98, "end_line": 148, "span_ids": ["gnu_getopt"], "tokens": 411}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def gnu_getopt(args: List[str], shortopts: str,\n longopts: Iterable[str] = []) -> Tuple[List[Tuple[str, str]],\n List[str]]:\n \"\"\"getopt(args, options[, long_options]) -> opts, args\n\n This function works like getopt(), except that GNU style scanning\n mode is used by default. This means that option and non-option\n arguments may be intermixed. The getopt() function stops\n processing options as soon as a non-option argument is\n encountered.\n\n If the first character of the option string is `+', or if the\n environment variable POSIXLY_CORRECT is set, then option\n processing stops as soon as a non-option argument is encountered.\n\n \"\"\"\n\n opts = [] # type: List[Tuple[str, str]]\n prog_args = [] # type: List[str]\n if isinstance(longopts, str):\n longopts = [longopts]\n else:\n longopts = list(longopts)\n\n # Allow options after non-option arguments?\n if shortopts.startswith('+'):\n shortopts = shortopts[1:]\n all_options_first = True\n elif os.environ.get(\"POSIXLY_CORRECT\"):\n all_options_first = True\n else:\n all_options_first = False\n\n while args:\n if args[0] == '--':\n prog_args += args[1:]\n break\n\n if args[0][:2] == '--':\n opts, args = do_longs(opts, args[0][2:], longopts, args[1:])\n elif args[0][:1] == '-' and args[0] != '-':\n opts, args = do_shorts(opts, args[0][1:], shortopts, args[1:])\n else:\n if all_options_first:\n prog_args += args\n break\n else:\n prog_args.append(args[0])\n args = args[1:]\n\n return opts, prog_args", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/getopt.py_do_longs_do_longs.return.opts_args": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/getopt.py_do_longs_do_longs.return.opts_args", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/getopt.py", "file_name": "getopt.py", "file_type": "text/x-python", "category": "implementation", "start_line": 150, "end_line": 169, "span_ids": ["do_longs"], "tokens": 189}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def do_longs(opts: List[Tuple[str, str]], opt: str,\n longopts: List[str],\n args: List[str]) -> Tuple[List[Tuple[str, str]], List[str]]:\n try:\n i = opt.index('=')\n except ValueError:\n optarg = None # type: str\n else:\n opt, optarg = opt[:i], opt[i+1:]\n\n has_arg, opt = long_has_args(opt, longopts)\n if has_arg:\n if optarg is None:\n if not args:\n raise GetoptError('option --%s requires argument' % opt, opt)\n optarg, args = args[0], args[1:]\n elif optarg is not None:\n raise GetoptError('option --%s must not have an argument' % opt, opt)\n opts.append(('--' + opt, optarg or ''))\n return opts, args", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/getopt.py__Return__long_has_args.return.has_arg_unique_match": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/getopt.py__Return__long_has_args.return.has_arg_unique_match", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/getopt.py", "file_name": "getopt.py", "file_type": "text/x-python", "category": "implementation", "start_line": 171, "end_line": 193, "span_ids": ["long_has_args", "do_longs"], "tokens": 223}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Return:\n# has_arg?\n# full option name\ndef long_has_args(opt: str, longopts: List[str]) -> Tuple[bool, str]:\n possibilities = [o for o in longopts if o.startswith(opt)]\n if not possibilities:\n raise GetoptError('option --%s not recognized' % opt, opt)\n # Is there an exact match?\n if opt in possibilities:\n return False, opt\n elif opt + '=' in possibilities:\n return True, opt\n # No exact match, so better be unique.\n if len(possibilities) > 1:\n # XXX since possibilities contains all valid continuations, might be\n # nice to work them into the error msg\n raise GetoptError('option --%s not a unique prefix' % opt, opt)\n assert len(possibilities) == 1\n unique_match = possibilities[0]\n has_arg = unique_match.endswith('=')\n if has_arg:\n unique_match = unique_match[:-1]\n return has_arg, unique_match", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/getopt.py_do_shorts_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/getopt.py_do_shorts_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/getopt.py", "file_name": "getopt.py", "file_type": "text/x-python", "category": "implementation", "start_line": 195, "end_line": 221, "span_ids": ["impl:5", "do_shorts", "short_has_arg"], "tokens": 247}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def do_shorts(opts: List[Tuple[str, str]], optstring: str,\n shortopts: str, args: List[str]) -> Tuple[List[Tuple[str, str]],\n List[str]]:\n while optstring != '':\n opt, optstring = optstring[0], optstring[1:]\n if short_has_arg(opt, shortopts):\n if optstring == '':\n if not args:\n raise GetoptError('option -%s requires argument' % opt,\n opt)\n optstring, args = args[0], args[1:]\n optarg, optstring = optstring, ''\n else:\n optarg = ''\n opts.append(('-' + opt, optarg))\n return opts, args\n\ndef short_has_arg(opt: str, shortopts: str) -> bool:\n for i in range(len(shortopts)):\n if opt == shortopts[i] != ':':\n return shortopts.startswith(':', i+1)\n raise GetoptError('option -%s not recognized' % opt, opt)\n\nif __name__ == '__main__':\n import sys\n print(getopt(sys.argv[1:], \"a:b\", [\"alpha=\", \"beta\"]))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/glob.py__Filename_globbing_util_iglob.for_dirname_in_dirs_.for_name_in_glob_in_dir_d.yield_os_path_join_dirnam": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/glob.py__Filename_globbing_util_iglob.for_dirname_in_dirs_.for_name_in_glob_in_dir_d.yield_os_path_join_dirnam", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/glob.py", "file_name": "glob.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 44, "span_ids": ["glob", "iglob", "docstring"], "tokens": 279}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Filename globbing utility.\"\"\"\n\nimport os\nimport re\nimport fnmatch\n\nfrom typing import List, Iterator, Iterable, Any, AnyStr\n\n__all__ = [\"glob\", \"iglob\"]\n\ndef glob(pathname: AnyStr) -> List[AnyStr]:\n \"\"\"Return a list of paths matching a pathname pattern.\n\n The pattern may contain simple shell-style wildcards a la fnmatch.\n\n \"\"\"\n return list(iglob(pathname))\n\ndef iglob(pathname: AnyStr) -> Iterator[AnyStr]:\n \"\"\"Return an iterator which yields the paths matching a pathname pattern.\n\n The pattern may contain simple shell-style wildcards a la fnmatch.\n\n \"\"\"\n if not has_magic(pathname):\n if os.path.lexists(pathname):\n yield pathname\n return\n dirname, basename = os.path.split(pathname)\n if not dirname:\n for name in glob1(None, basename):\n yield name\n return\n if has_magic(dirname):\n dirs = iglob(dirname) # type: Iterable[AnyStr]\n else:\n dirs = [dirname]\n if has_magic(basename):\n glob_in_dir = glob1 # type: Any\n else:\n glob_in_dir = glob0\n for dirname in dirs:\n for name in glob_in_dir(dirname, basename):\n yield os.path.join(dirname, name)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/glob.py__These_2_helper_function_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/glob.py__These_2_helper_function_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/glob.py", "file_name": "glob.py", "file_type": "text/x-python", "category": "implementation", "start_line": 46, "end_line": 85, "span_ids": ["impl:3", "iglob", "glob1", "glob0", "has_magic"], "tokens": 313}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# These 2 helper functions non-recursively glob inside a literal directory.\n# They return a list of basenames. `glob1` accepts a pattern while `glob0`\n# takes a literal basename (so it only has to check for its existence).\n\ndef glob1(dirname: AnyStr, pattern: AnyStr) -> List[AnyStr]:\n if not dirname:\n if isinstance(pattern, bytes):\n dirname = bytes(os.curdir, 'ASCII')\n else:\n dirname = os.curdir\n try:\n names = os.listdir(dirname)\n except os.error:\n return []\n if pattern[0] != '.':\n names = [x for x in names if x[0] != '.']\n return fnmatch.filter(names, pattern)\n\ndef glob0(dirname: AnyStr, basename: AnyStr) -> List[AnyStr]:\n if basename == '':\n # `os.path.split()` returns an empty basename for paths ending with a\n # directory separator. 'q*x/' should match only directories.\n if os.path.isdir(dirname):\n return [basename]\n else:\n if os.path.lexists(os.path.join(dirname, basename)):\n return [basename]\n return []\n\n\nmagic_check = re.compile('[*?[]')\nmagic_check_bytes = re.compile(b'[*?[]')\n\ndef has_magic(s: AnyStr) -> bool:\n if isinstance(s, bytes):\n match = magic_check_bytes.search(s)\n else:\n match = magic_check.search(s)\n return match is not None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/posixpath.py__Common_operations_on_P__Trailing_es_are_stri": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/posixpath.py__Common_operations_on_P__Trailing_es_are_stri", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/posixpath.py", "file_name": "posixpath.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 94, "span_ids": ["join", "isabs", "normcase", "_get_sep", "docstring"], "tokens": 818}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Common operations on Posix pathnames.\n\nInstead of importing this module directly, import os and refer to\nthis module as os.path. The \"os.path\" name is an alias for this\nmodule on Posix systems; on other systems (e.g. Mac, Windows),\nos.path provides the same operations in a manner specific to that\nplatform, and is an alias to another module (e.g. macpath, ntpath).\n\nSome of this can actually be useful on non-Posix systems too, e.g.\nfor manipulation of the pathname component of URLs.\n\"\"\"\n\nimport os\nimport sys\nimport stat\nimport genericpath\nfrom genericpath import *\n\nfrom typing import (\n Tuple, BinaryIO, TextIO, Pattern, AnyStr, List, Set, Any, Union, cast\n)\n\n__all__ = [\"normcase\",\"isabs\",\"join\",\"splitdrive\",\"split\",\"splitext\",\n \"basename\",\"dirname\",\"commonprefix\",\"getsize\",\"getmtime\",\n \"getatime\",\"getctime\",\"islink\",\"exists\",\"lexists\",\"isdir\",\"isfile\",\n \"ismount\", \"expanduser\",\"expandvars\",\"normpath\",\"abspath\",\n \"samefile\",\"sameopenfile\",\"samestat\",\n \"curdir\",\"pardir\",\"sep\",\"pathsep\",\"defpath\",\"altsep\",\"extsep\",\n \"devnull\",\"realpath\",\"supports_unicode_filenames\",\"relpath\"]\n\n# Strings representing various path-related bits and pieces.\n# These are primarily for export; internally, they are hardcoded.\ncurdir = '.'\npardir = '..'\nextsep = '.'\nsep = '/'\npathsep = ':'\ndefpath = ':/bin:/usr/bin'\naltsep = None # type: str\ndevnull = '/dev/null'\n\ndef _get_sep(path: AnyStr) -> AnyStr:\n if isinstance(path, bytes):\n return b'/'\n else:\n return '/'\n\n# Normalize the case of a pathname. Trivial in Posix, string.lower on Mac.\n# On MS-DOS this may also turn slashes into backslashes; however, other\n# normalizations (such as optimizing '../' away) are not allowed\n# (another function should be defined to do that).\n\ndef normcase(s: AnyStr) -> AnyStr:\n \"\"\"Normalize case of pathname. Has no effect under Posix\"\"\"\n # TODO: on Mac OS X, this should really return s.lower().\n if not isinstance(s, (bytes, str)):\n raise TypeError(\"normcase() argument must be str or bytes, \"\n \"not '{}'\".format(s.__class__.__name__))\n return cast(AnyStr, s)\n\n\n# Return whether a path is absolute.\n# Trivial in Posix, harder on the Mac or MS-DOS.\n\ndef isabs(s: AnyStr) -> bool:\n \"\"\"Test whether a path is absolute\"\"\"\n sep = _get_sep(s)\n return s.startswith(sep)\n\n\n# Join pathnames.\n# Ignore the previous parts if a part is absolute.\n# Insert a '/' unless the first part is empty or already ends in '/'.\n\ndef join(a: AnyStr, *p: AnyStr) -> AnyStr:\n \"\"\"Join two or more pathname components, inserting '/' as needed.\n If any component is an absolute path, all previous path components\n will be discarded.\"\"\"\n sep = _get_sep(a)\n path = a\n for b in p:\n if b.startswith(sep):\n path = b\n elif not path or path.endswith(sep):\n path += b\n else:\n path += sep + b\n return path\n\n\n# Split a path in head (everything up to the last '/') and tail (the\n# rest). If the path ends in '/', tail will be empty. If there is no\n# '/' in the path, head will be empty.\n# Trailing '/'es are stripped from head unless it is the root.", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/posixpath.py_split__describing_the_same_fil": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/posixpath.py_split__describing_the_same_fil", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/posixpath.py", "file_name": "posixpath.py", "file_type": "text/x-python", "category": "implementation", "start_line": 96, "end_line": 194, "span_ids": ["splitext", "basename", "splitdrive", "samefile", "dirname", "split", "lexists", "sameopenfile", "islink", "impl:19"], "tokens": 784}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def split(p: AnyStr) -> Tuple[AnyStr, AnyStr]:\n \"\"\"Split a pathname. Returns tuple \"(head, tail)\" where \"tail\" is\n everything after the final slash. Either part may be empty.\"\"\"\n sep = _get_sep(p)\n i = p.rfind(sep) + 1\n head, tail = p[:i], p[i:]\n if head and head != sep*len(head):\n head = head.rstrip(sep)\n return head, tail\n\n\n# Split a path in root and extension.\n# The extension is everything starting at the last dot in the last\n# pathname component; the root is everything before that.\n# It is always true that root + ext == p.\n\ndef splitext(p: AnyStr) -> Tuple[AnyStr, AnyStr]:\n if isinstance(p, bytes):\n sep = b'/'\n extsep = b'.'\n else:\n sep = '/'\n extsep = '.'\n return genericpath._splitext(p, sep, None, extsep)\nsplitext.__doc__ = genericpath._splitext.__doc__\n\n# Split a pathname into a drive specification and the rest of the\n# path. Useful on DOS/Windows/NT; on Unix, the drive is always empty.\n\ndef splitdrive(p: AnyStr) -> Tuple[AnyStr, AnyStr]:\n \"\"\"Split a pathname into drive and path. On Posix, drive is always\n empty.\"\"\"\n return p[:0], p\n\n\n# Return the tail (basename) part of a path, same as split(path)[1].\n\ndef basename(p: AnyStr) -> AnyStr:\n \"\"\"Returns the final component of a pathname\"\"\"\n sep = _get_sep(p)\n i = p.rfind(sep) + 1\n return p[i:]\n\n\n# Return the head (dirname) part of a path, same as split(path)[0].\n\ndef dirname(p: AnyStr) -> AnyStr:\n \"\"\"Returns the directory component of a pathname\"\"\"\n sep = _get_sep(p)\n i = p.rfind(sep) + 1\n head = p[:i]\n if head and head != sep*len(head):\n head = head.rstrip(sep)\n return head\n\n\n# Is a path a symbolic link?\n# This will always return false on systems where os.lstat doesn't exist.\n\ndef islink(path: AnyStr) -> bool:\n \"\"\"Test whether a path is a symbolic link\"\"\"\n try:\n st = os.lstat(path)\n except (os.error, AttributeError):\n return False\n return stat.S_ISLNK(st.st_mode)\n\n# Being true for dangling symbolic links is also useful.\n\ndef lexists(path: AnyStr) -> bool:\n \"\"\"Test whether a path exists. Returns True for broken symbolic links\"\"\"\n try:\n os.lstat(path)\n except os.error:\n return False\n return True\n\n\n# Are two filenames really pointing to the same file?\n\ndef samefile(f1: AnyStr, f2: AnyStr) -> bool:\n \"\"\"Test whether two pathnames reference the same actual file\"\"\"\n s1 = os.stat(f1)\n s2 = os.stat(f2)\n return samestat(s1, s2)\n\n\n# Are two open files really referencing the same file?\n# (Not necessarily the same file descriptor!)\n\ndef sameopenfile(fp1: int, fp2: int) -> bool:\n \"\"\"Test whether two open file objects reference the same file\"\"\"\n s1 = os.fstat(fp1)\n s2 = os.fstat(fp2)\n return samestat(s1, s2)\n\n\n# Are two stat buffers (obtained from stat, fstat or lstat)\n# describing the same file?", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/posixpath.py_samestat_ismount.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/posixpath.py_samestat_ismount.return.False", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/posixpath.py", "file_name": "posixpath.py", "file_type": "text/x-python", "category": "implementation", "start_line": 196, "end_line": 227, "span_ids": ["ismount", "samestat"], "tokens": 292}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def samestat(s1: os.stat_result, s2: os.stat_result) -> bool:\n \"\"\"Test whether two stat buffers reference the same file\"\"\"\n return s1.st_ino == s2.st_ino and \\\n s1.st_dev == s2.st_dev\n\n\n# Is a path a mount point?\n# (Does this work for all UNIXes? Is it even guaranteed to work by Posix?)\n\ndef ismount(path: AnyStr) -> bool:\n \"\"\"Test whether a path is a mount point\"\"\"\n if islink(path):\n # A symlink can never be a mount point\n return False\n try:\n s1 = os.lstat(path)\n if isinstance(path, bytes):\n parent = join(path, b'..')\n else:\n parent = join(path, '..')\n s2 = os.lstat(parent)\n except os.error:\n return False # It doesn't exist -- so not a mount point :-)\n dev1 = s1.st_dev\n dev2 = s2.st_dev\n if dev1 != dev2:\n return True # path/.. on a different device as path\n ino1 = s1.st_ino\n ino2 = s2.st_ino\n if ino1 == ino2:\n return True # path/.. is the same i-node as path\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/posixpath.py__Expand_paths_beginning__expanduser.return._userhome_path_i_or_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/posixpath.py__Expand_paths_beginning__expanduser.return._userhome_path_i_or_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/posixpath.py", "file_name": "posixpath.py", "file_type": "text/x-python", "category": "implementation", "start_line": 230, "end_line": 275, "span_ids": ["ismount", "expanduser"], "tokens": 397}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Expand paths beginning with '~' or '~user'.\n# '~' means $HOME; '~user' means that user's home directory.\n# If the path doesn't begin with '~', or if the user or $HOME is unknown,\n# the path is returned unchanged (leaving error reporting to whatever\n# function is called with the expanded path as argument).\n# See also module 'glob' for expansion of *, ? and [...] in pathnames.\n# (A function should also be defined to do full *sh-style environment\n# variable expansion.)\n\ndef expanduser(path: AnyStr) -> AnyStr:\n \"\"\"Expand ~ and ~user constructions. If user or $HOME is unknown,\n do nothing.\"\"\"\n if isinstance(path, bytes):\n tilde = b'~'\n else:\n tilde = '~'\n if not path.startswith(tilde):\n return path\n sep = _get_sep(path)\n i = path.find(sep, 1)\n if i < 0:\n i = len(path)\n if i == 1:\n userhome = None # type: Union[str, bytes]\n if 'HOME' not in os.environ:\n import pwd\n userhome = pwd.getpwuid(os.getuid()).pw_dir\n else:\n userhome = os.environ['HOME']\n else:\n import pwd\n name = path[1:i] # type: Union[str, bytes]\n if isinstance(name, bytes):\n name = str(name, 'ASCII')\n try:\n pwent = pwd.getpwnam(name)\n except KeyError:\n return path\n userhome = pwent.pw_dir\n if isinstance(path, bytes):\n userhome = os.fsencode(userhome)\n root = b'/'\n else:\n root = '/'\n userhome = userhome.rstrip(root)\n return (userhome + path[i:]) or root", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/posixpath.py__Expand_paths_containing_expandvars.return.path": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/posixpath.py__Expand_paths_containing_expandvars.return.path", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/posixpath.py", "file_name": "posixpath.py", "file_type": "text/x-python", "category": "implementation", "start_line": 278, "end_line": 330, "span_ids": ["impl:21", "expanduser", "expandvars"], "tokens": 415}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Expand paths containing shell variable substitutions.\n# This expands the forms $variable and ${variable} only.\n# Non-existent variables are left unchanged.\n\n_varprog = None # type: Pattern[str]\n_varprogb = None # type: Pattern[bytes]\n\ndef expandvars(path: AnyStr) -> AnyStr:\n \"\"\"Expand shell variables of form $var and ${var}. Unknown variables\n are left unchanged.\"\"\"\n global _varprog, _varprogb\n if isinstance(path, bytes):\n if b'$' not in path:\n return path\n if not _varprogb:\n import re\n _varprogb = re.compile(br'\\$(\\w+|\\{[^}]*\\})', re.ASCII)\n search = _varprogb.search\n start = b'{'\n end = b'}'\n else:\n if '$' not in path:\n return path\n if not _varprog:\n import re\n _varprog = re.compile(r'\\$(\\w+|\\{[^}]*\\})', re.ASCII)\n search = _varprog.search\n start = '{'\n end = '}'\n i = 0\n while True:\n m = search(path, i)\n if not m:\n break\n i, j = m.span(0)\n name = None # type: Union[str, bytes]\n name = m.group(1)\n if name.startswith(start) and name.endswith(end):\n name = name[1:-1]\n if isinstance(name, bytes):\n name = str(name, 'ASCII')\n if name in os.environ:\n tail = path[j:]\n value = None # type: Union[str, bytes]\n value = os.environ[name]\n if isinstance(path, bytes):\n value = value.encode('ASCII')\n path = path[:i] + value\n i = len(path)\n path += tail\n else:\n i = j\n return path", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/posixpath.py__Normalize_a_path_e_g__normpath.return.path_or_dot": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/posixpath.py__Normalize_a_path_e_g__normpath.return.path_or_dot", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/posixpath.py", "file_name": "posixpath.py", "file_type": "text/x-python", "category": "implementation", "start_line": 333, "end_line": 371, "span_ids": ["normpath", "expandvars"], "tokens": 338}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Normalize a path, e.g. A//B, A/./B and A/foo/../B all become A/B.\n# It should be understood that this may change the meaning of the path\n# if it contains symbolic links!\n\ndef normpath(path: AnyStr) -> AnyStr:\n \"\"\"Normalize path, eliminating double slashes, etc.\"\"\"\n if isinstance(path, bytes):\n sep = b'/'\n empty = b''\n dot = b'.'\n dotdot = b'..'\n else:\n sep = '/'\n empty = ''\n dot = '.'\n dotdot = '..'\n if path == empty:\n return dot\n initial_slashes = path.startswith(sep) # type: int\n # POSIX allows one or two initial slashes, but treats three or more\n # as single slash.\n if (initial_slashes and\n path.startswith(sep*2) and not path.startswith(sep*3)):\n initial_slashes = 2\n comps = path.split(sep)\n new_comps = [] # type: List[AnyStr]\n for comp in comps:\n if comp in (empty, dot):\n continue\n if (comp != dotdot or (not initial_slashes and not new_comps) or\n (new_comps and new_comps[-1] == dotdot)):\n new_comps.append(comp)\n elif new_comps:\n new_comps.pop()\n comps = new_comps\n path = sep.join(comps)\n if initial_slashes:\n path = sep*initial_slashes + path\n return path or dot", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/posixpath.py_abspath_realpath.return.abspath_filename_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/posixpath.py_abspath_realpath.return.abspath_filename_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/posixpath.py", "file_name": "posixpath.py", "file_type": "text/x-python", "category": "implementation", "start_line": 374, "end_line": 414, "span_ids": ["realpath", "abspath"], "tokens": 289}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def abspath(path: AnyStr) -> AnyStr:\n \"\"\"Return an absolute path.\"\"\"\n if not isabs(path):\n if isinstance(path, bytes):\n cwd = os.getcwdb()\n else:\n cwd = os.getcwd()\n path = join(cwd, path)\n return normpath(path)\n\n\n# Return a canonical path (i.e. the absolute location of a file on the\n# filesystem).\n\ndef realpath(filename: AnyStr) -> AnyStr:\n \"\"\"Return the canonical path of the specified filename, eliminating any\nsymbolic links encountered in the path.\"\"\"\n if isinstance(filename, bytes):\n sep = b'/'\n empty = b''\n else:\n sep = '/'\n empty = ''\n if isabs(filename):\n bits = [sep] + filename.split(sep)[1:]\n else:\n bits = [empty] + filename.split(sep)\n\n for i in range(2, len(bits)+1):\n component = join(*bits[0:i])\n # Resolve symbolic links.\n if islink(component):\n resolved = _resolve_link(component)\n if resolved is None:\n # Infinite loop -- return original component + rest of the path\n return abspath(join(*([component] + bits[i:])))\n else:\n newpath = join(*([resolved] + bits[i:]))\n return realpath(newpath)\n\n return abspath(filename)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/posixpath.py__resolve_link_supports_unicode_filenames._sys_platform_darwin_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/posixpath.py__resolve_link_supports_unicode_filenames._sys_platform_darwin_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/posixpath.py", "file_name": "posixpath.py", "file_type": "text/x-python", "category": "implementation", "start_line": 417, "end_line": 437, "span_ids": ["_resolve_link", "impl:25"], "tokens": 181}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _resolve_link(path: AnyStr) -> AnyStr:\n \"\"\"Internal helper function. Takes a path and follows symlinks\n until we either arrive at something that isn't a symlink, or\n encounter a path we've seen before (meaning that there's a loop).\n \"\"\"\n paths_seen = set() # type: Set[AnyStr]\n while islink(path):\n if path in paths_seen:\n # Already seen this path, so we must have a symlink loop\n return None\n paths_seen.add(path)\n # Resolve where the link points to\n resolved = os.readlink(path)\n if not isabs(resolved):\n dir = dirname(path)\n path = normpath(join(dir, resolved))\n else:\n path = normpath(resolved)\n return path\n\nsupports_unicode_filenames = (sys.platform == 'darwin')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/posixpath.py_relpath_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/posixpath.py_relpath_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/posixpath.py", "file_name": "posixpath.py", "file_type": "text/x-python", "category": "implementation", "start_line": 439, "end_line": 467, "span_ids": ["relpath"], "tokens": 209}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def relpath(path: AnyStr, start: AnyStr = None) -> AnyStr:\n \"\"\"Return a relative version of a path\"\"\"\n\n if not path:\n raise ValueError(\"no path specified\")\n\n if isinstance(path, bytes):\n curdir = b'.'\n sep = b'/'\n pardir = b'..'\n else:\n curdir = '.'\n sep = '/'\n pardir = '..'\n\n if start is None:\n start = curdir\n\n start_list = [x for x in abspath(start).split(sep) if x]\n path_list = [x for x in abspath(path).split(sep) if x]\n\n # Work out how much of the filepath is shared by start and path.\n i = len(commonprefix([start_list, path_list]))\n\n rel_list = [pardir] * (len(start_list)-i) + path_list[i:]\n if not rel_list:\n return curdir\n return join(*rel_list)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/pprint.py__sys_isrecursive.return._safe_repr_object_No": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/pprint.py__sys_isrecursive.return._safe_repr_object_No", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/pprint.py", "file_name": "pprint.py", "file_type": "text/x-python", "category": "implementation", "start_line": 37, "end_line": 75, "span_ids": ["pprint", "docstring", "isreadable", "isrecursive", "saferepr", "pformat"], "tokens": 359}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import sys as _sys\nfrom collections import OrderedDict as _OrderedDict\nfrom io import StringIO as _StringIO\n\nfrom typing import Any, Tuple, Dict, TextIO, cast, List\n\n__all__ = [\"pprint\",\"pformat\",\"isreadable\",\"isrecursive\",\"saferepr\",\n \"PrettyPrinter\"]\n\n# cache these for faster access:\n_commajoin = \", \".join\n_id = id\n_len = len\n_type = type\n\n\ndef pprint(object: object, stream: TextIO = None, indent: int = 1,\n width: int = 80, depth: int = None) -> None:\n \"\"\"Pretty-print a Python object to a stream [default is sys.stdout].\"\"\"\n printer = PrettyPrinter(\n stream=stream, indent=indent, width=width, depth=depth)\n printer.pprint(object)\n\ndef pformat(object: object, indent: int = 1, width: int = 80,\n depth: int = None) -> str:\n \"\"\"Format a Python object into a pretty-printed representation.\"\"\"\n return PrettyPrinter(indent=indent, width=width, depth=depth).pformat(object)\n\ndef saferepr(object: object) -> str:\n \"\"\"Version of repr() which can handle recursive data structures.\"\"\"\n return _safe_repr(object, {}, None, 0)[0]\n\ndef isreadable(object: object) -> bool:\n \"\"\"Determine if saferepr(object) is readable by eval().\"\"\"\n return _safe_repr(object, {}, None, 0)[1]\n\ndef isrecursive(object: object) -> bool:\n \"\"\"Determine if object requires a recursive representation.\"\"\"\n return _safe_repr(object, {}, None, 0)[2]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/pprint.py__safe_key__safe_tuple.return._safe_key_t_0__safe_ke": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/pprint.py__safe_key__safe_tuple.return._safe_key_t_0__safe_ke", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/pprint.py", "file_name": "pprint.py", "file_type": "text/x-python", "category": "implementation", "start_line": 77, "end_line": 101, "span_ids": ["_safe_key.__lt__", "_safe_key", "_safe_tuple", "_safe_key.__init__"], "tokens": 225}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class _safe_key:\n \"\"\"Helper function for key functions when sorting unorderable objects.\n\n The wrapped-object will fallback to an Py2.x style comparison for\n unorderable types (sorting first comparing the type name and then by\n the obj ids). Does not work recursively, so dict.items() must have\n _safe_key applied to both the key and the value.\n\n \"\"\"\n\n __slots__ = ['obj']\n\n def __init__(self, obj: Any) -> None:\n self.obj = obj\n\n def __lt__(self, other: Any) -> Any:\n rv = self.obj.__lt__(other.obj) # type: Any\n if rv is NotImplemented:\n rv = (str(type(self.obj)), id(self.obj)) < \\\n (str(type(other.obj)), id(other.obj))\n return rv\n\ndef _safe_tuple(t: Tuple[Any, Any]) -> Tuple[_safe_key, _safe_key]:\n \"Helper function for comparing 2-tuples\"\n return _safe_key(t[0]), _safe_key(t[1])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/pprint.py_PrettyPrinter_PrettyPrinter.isreadable.return.readable_and_not_recursiv": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/pprint.py_PrettyPrinter_PrettyPrinter.isreadable.return.readable_and_not_recursiv", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/pprint.py", "file_name": "pprint.py", "file_type": "text/x-python", "category": "implementation", "start_line": 103, "end_line": 150, "span_ids": ["PrettyPrinter.__init__", "PrettyPrinter.isrecursive", "PrettyPrinter", "PrettyPrinter.pformat", "PrettyPrinter.isreadable", "PrettyPrinter.pprint"], "tokens": 392}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PrettyPrinter:\n def __init__(self, indent: int = 1, width: int = 80, depth: int = None,\n stream: TextIO = None) -> None:\n \"\"\"Handle pretty printing operations onto a stream using a set of\n configured parameters.\n\n indent\n Number of spaces to indent for each level of nesting.\n\n width\n Attempted maximum number of columns in the output.\n\n depth\n The maximum depth to print out nested structures.\n\n stream\n The desired output stream. If omitted (or false), the standard\n output stream available at construction will be used.\n\n \"\"\"\n indent = int(indent)\n width = int(width)\n assert indent >= 0, \"indent must be >= 0\"\n assert depth is None or depth > 0, \"depth must be > 0\"\n assert width, \"width must be != 0\"\n self._depth = depth\n self._indent_per_level = indent\n self._width = width\n if stream is not None:\n self._stream = stream\n else:\n self._stream = _sys.stdout\n\n def pprint(self, object: object) -> None:\n self._format(object, self._stream, 0, 0, {}, 0)\n self._stream.write(\"\\n\")\n\n def pformat(self, object: object) -> str:\n sio = _StringIO()\n self._format(object, sio, 0, 0, {}, 0)\n return sio.getvalue()\n\n def isrecursive(self, object: object) -> int:\n return self.format(object, {}, 0, 0)[2]\n\n def isreadable(self, object: object) -> int:\n s, readable, recursive = self.format(object, {}, 0, 0)\n return readable and not recursive", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/pprint.py_PrettyPrinter._format_PrettyPrinter._format.write_rep_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/pprint.py_PrettyPrinter._format_PrettyPrinter._format.write_rep_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/pprint.py", "file_name": "pprint.py", "file_type": "text/x-python", "category": "implementation", "start_line": 152, "end_line": 250, "span_ids": ["PrettyPrinter._format"], "tokens": 843}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PrettyPrinter:\n\n def _format(self, object: object, stream: TextIO, indent: int,\n allowance: int, context: Dict[int, int], level: int) -> None:\n level = level + 1\n objid = _id(object)\n if objid in context:\n stream.write(_recursion(object))\n self._recursive = True\n self._readable = False\n return\n rep = self._repr(object, context, level - 1)\n typ = _type(object)\n sepLines = _len(rep) > (self._width - 1 - indent - allowance)\n write = stream.write\n\n if self._depth and level > self._depth:\n write(rep)\n return\n\n if sepLines:\n r = getattr(typ, \"__repr__\", None)\n if isinstance(object, dict):\n write('{')\n if self._indent_per_level > 1:\n write((self._indent_per_level - 1) * ' ')\n length = _len(object)\n if length:\n context[objid] = 1\n indent = indent + self._indent_per_level\n if issubclass(typ, _OrderedDict):\n items = list(object.items())\n else:\n items = sorted(object.items(), key=_safe_tuple)\n key, ent = items[0]\n rep = self._repr(key, context, level)\n write(rep)\n write(': ')\n self._format(ent, stream, indent + _len(rep) + 2,\n allowance + 1, context, level)\n if length > 1:\n for key, ent in items[1:]:\n rep = self._repr(key, context, level)\n write(',\\n%s%s: ' % (' '*indent, rep))\n self._format(ent, stream, indent + _len(rep) + 2,\n allowance + 1, context, level)\n indent = indent - self._indent_per_level\n del context[objid]\n write('}')\n return\n\n if ((issubclass(typ, list) and r is list.__repr__) or\n (issubclass(typ, tuple) and r is tuple.__repr__) or\n (issubclass(typ, set) and r is set.__repr__) or\n (issubclass(typ, frozenset) and r is frozenset.__repr__)\n ):\n anyobj = cast(Any, object) # TODO Collection?\n length = _len(anyobj)\n if issubclass(typ, list):\n write('[')\n endchar = ']'\n lst = anyobj\n elif issubclass(typ, set):\n if not length:\n write('set()')\n return\n write('{')\n endchar = '}'\n lst = sorted(anyobj, key=_safe_key)\n elif issubclass(typ, frozenset):\n if not length:\n write('frozenset()')\n return\n write('frozenset({')\n endchar = '})'\n lst = sorted(anyobj, key=_safe_key)\n indent += 10\n else:\n write('(')\n endchar = ')'\n lst = list(anyobj)\n if self._indent_per_level > 1:\n write((self._indent_per_level - 1) * ' ')\n if length:\n context[objid] = 1\n indent = indent + self._indent_per_level\n self._format(lst[0], stream, indent, allowance + 1,\n context, level)\n if length > 1:\n for ent in lst[1:]:\n write(',\\n' + ' '*indent)\n self._format(ent, stream, indent,\n allowance + 1, context, level)\n indent = indent - self._indent_per_level\n del context[objid]\n if issubclass(typ, tuple) and length == 1:\n write(',')\n write(endchar)\n return\n\n write(rep)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/pprint.py_PrettyPrinter._repr_PrettyPrinter.format.return._safe_repr_object_contex": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/pprint.py_PrettyPrinter._repr_PrettyPrinter.format.return._safe_repr_object_contex", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/pprint.py", "file_name": "pprint.py", "file_type": "text/x-python", "category": "implementation", "start_line": 252, "end_line": 268, "span_ids": ["PrettyPrinter._repr", "PrettyPrinter.format"], "tokens": 163}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PrettyPrinter:\n\n def _repr(self, object: object, context: Dict[int, int],\n level: int) -> str:\n repr, readable, recursive = self.format(object, context.copy(),\n self._depth, level)\n if not readable:\n self._readable = False\n if recursive:\n self._recursive = True\n return repr\n\n def format(self, object: object, context: Dict[int, int],\n maxlevels: int, level: int) -> Tuple[str, int, int]:\n \"\"\"Format object for a specific context, returning a string\n and flags indicating whether the representation is 'readable'\n and whether the object represents a recursive construct.\n \"\"\"\n return _safe_repr(object, context, maxlevels, level)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/pprint.py__Return_triple_repr_str__safe_repr.return.rep_bool_rep_and_not_rep": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/pprint.py__Return_triple_repr_str__safe_repr.return.rep_bool_rep_and_not_rep", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/pprint.py", "file_name": "pprint.py", "file_type": "text/x-python", "category": "implementation", "start_line": 271, "end_line": 358, "span_ids": ["_safe_repr", "PrettyPrinter.format"], "tokens": 782}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Return triple (repr_string, isreadable, isrecursive).\n\ndef _safe_repr(object: object, context: Dict[int, int],\n maxlevels: int, level: int) -> Tuple[str, bool, bool]:\n typ = _type(object)\n if typ is str:\n s = cast(str, object)\n if 'locale' not in _sys.modules:\n return repr(object), True, False\n if \"'\" in s and '\"' not in s:\n closure = '\"'\n quotes = {'\"': '\\\\\"'}\n else:\n closure = \"'\"\n quotes = {\"'\": \"\\\\'\"}\n qget = quotes.get\n sio = _StringIO()\n write = sio.write\n for char in s:\n if char.isalpha():\n write(char)\n else:\n write(qget(char, repr(char)[1:-1]))\n return (\"%s%s%s\" % (closure, sio.getvalue(), closure)), True, False\n\n r = getattr(typ, \"__repr__\", None)\n if issubclass(typ, dict) and r is dict.__repr__:\n if not object:\n return \"{}\", True, False\n objid = _id(object)\n if maxlevels and level >= maxlevels:\n return \"{...}\", False, objid in context\n if objid in context:\n return _recursion(object), False, True\n context[objid] = 1\n readable = True\n recursive = False\n components = [] # type: List[str]\n append = components.append\n level += 1\n saferepr = _safe_repr\n items = sorted((cast(dict, object)).items(), key=_safe_tuple)\n for k, v in items:\n krepr, kreadable, krecur = saferepr(k, context, maxlevels, level)\n vrepr, vreadable, vrecur = saferepr(v, context, maxlevels, level)\n append(\"%s: %s\" % (krepr, vrepr))\n readable = readable and kreadable and vreadable\n if krecur or vrecur:\n recursive = True\n del context[objid]\n return \"{%s}\" % _commajoin(components), readable, recursive\n\n if (issubclass(typ, list) and r is list.__repr__) or \\\n (issubclass(typ, tuple) and r is tuple.__repr__):\n anyobj = cast(Any, object) # TODO Sequence?\n if issubclass(typ, list):\n if not object:\n return \"[]\", True, False\n format = \"[%s]\"\n elif _len(anyobj) == 1:\n format = \"(%s,)\"\n else:\n if not object:\n return \"()\", True, False\n format = \"(%s)\"\n objid = _id(object)\n if maxlevels and level >= maxlevels:\n return format % \"...\", False, objid in context\n if objid in context:\n return _recursion(object), False, True\n context[objid] = 1\n readable = True\n recursive = False\n components = []\n append = components.append\n level += 1\n for o in anyobj:\n orepr, oreadable, orecur = _safe_repr(o, context, maxlevels, level)\n append(orepr)\n if not oreadable:\n readable = False\n if orecur:\n recursive = True\n del context[objid]\n return format % _commajoin(components), readable, recursive\n\n rep = repr(object)\n return rep, bool(rep and not rep.startswith('<')), False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/pprint.py__recursion_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/pprint.py__recursion_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/pprint.py", "file_name": "pprint.py", "file_type": "text/x-python", "category": "implementation", "start_line": 361, "end_line": 381, "span_ids": ["impl:11", "_recursion", "_perfcheck"], "tokens": 177}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _recursion(object: object) -> str:\n return (\"\"\n % (_type(object).__name__, _id(object)))\n\n\ndef _perfcheck(object: object = None) -> None:\n import time\n if object is None:\n object = [(\"string\", (1, 2), [3, 4], {5: 6, 7: 8})] * 100000\n p = PrettyPrinter()\n t1 = time.time()\n _safe_repr(object, {}, None, 0)\n t2 = time.time()\n p.pformat(object)\n t3 = time.time()\n print(\"_safe_repr:\", t2 - t1)\n print(\"pformat:\", t3 - t2)\n\nif __name__ == \"__main__\":\n _perfcheck()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py__Random_variable_genera_T.TypeVar_T_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py__Random_variable_genera_T.TypeVar_T_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/random.py", "file_name": "random.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 72, "span_ids": ["docstring:5", "docstring"], "tokens": 555}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Random variable generators.\n\n integers\n --------\n uniform within range\n\n sequences\n ---------\n pick random element\n pick random sample\n generate random permutation\n\n distributions on the real line:\n ------------------------------\n uniform\n triangular\n normal (Gaussian)\n lognormal\n negative exponential\n gamma\n beta\n pareto\n Weibull\n\n distributions on the circle (angles 0 to 2pi)\n ---------------------------------------------\n circular uniform\n von Mises\n\nGeneral notes on the underlying Mersenne Twister core generator:\n\n* The period is 2**19937-1.\n* It is one of the most extensively tested generators in existence.\n* The random() method is implemented in C, executes in a single Python step,\n and is, therefore, threadsafe.\n\n\"\"\"\n\nfrom warnings import warn as _warn\nfrom types import MethodType as _MethodType, BuiltinMethodType as _BuiltinMethodType\nfrom math import log as _log, exp as _exp, pi as _pi, e as _e, ceil as _ceil\nfrom math import sqrt as _sqrt, acos as _acos, cos as _cos, sin as _sin\nfrom os import urandom as _urandom\nfrom collections import Set as _Set, Sequence as _Sequence\nfrom hashlib import sha512 as _sha512\n\nfrom typing import (\n Any, TypeVar, Iterable, Sequence, List, Callable, Set, cast, SupportsInt, Union\n)\n\n__all__ = [\"Random\",\"seed\",\"random\",\"uniform\",\"randint\",\"choice\",\"sample\",\n \"randrange\",\"shuffle\",\"normalvariate\",\"lognormvariate\",\n \"expovariate\",\"vonmisesvariate\",\"gammavariate\",\"triangular\",\n \"gauss\",\"betavariate\",\"paretovariate\",\"weibullvariate\",\n \"getstate\",\"setstate\", \"getrandbits\",\n \"SystemRandom\"]\n\nNV_MAGICCONST = 4 * _exp(-0.5)/_sqrt(2.0)\nTWOPI = 2.0*_pi\nLOG4 = _log(4.0)\nSG_MAGICCONST = 1.0 + _log(4.5)\nBPF = 53 # Number of bits in a float\nRECIP_BPF = 2**-BPF # type: float\n\n\n# Translated by Guido van Rossum from C source provided by\n# Adrian Baddeley. Adapted by Raymond Hettinger for use with\n# the Mersenne Twister and os.urandom() core generators.\n\nimport _random\n\nT = TypeVar('T')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random_Random.__init__.self.gauss_next.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random_Random.__init__.self.gauss_next.None", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/random.py", "file_name": "random.py", "file_type": "text/x-python", "category": "implementation", "start_line": 74, "end_line": 98, "span_ids": ["Random", "Random.__init__"], "tokens": 180}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Random(_random.Random):\n \"\"\"Random number generator base class used by bound module functions.\n\n Used to instantiate instances of Random to get generators that don't\n share state.\n\n Class Random can also be subclassed if you want to use a different basic\n generator of your own devising: in that case, override the following\n methods: random(), seed(), getstate(), and setstate().\n Optionally, implement a getrandbits() method so that randrange()\n can cover arbitrarily large ranges.\n\n \"\"\"\n\n VERSION = 3 # used by getstate/setstate\n gauss_next = 0.0\n\n def __init__(self, x: object = None) -> None:\n \"\"\"Initialize an instance.\n\n Optional argument x controls seeding, as for Random.seed().\n \"\"\"\n\n self.seed(x)\n self.gauss_next = None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random.seed_Random.seed.self.gauss_next.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random.seed_Random.seed.self.gauss_next.None", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/random.py", "file_name": "random.py", "file_type": "text/x-python", "category": "implementation", "start_line": 100, "end_line": 128, "span_ids": ["Random.seed"], "tokens": 235}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Random(_random.Random):\n\n def seed(self, a: Any = None, version: int = 2) -> None:\n \"\"\"Initialize internal state from hashable object.\n\n None or no argument seeds from current time or from an operating\n system specific randomness source if available.\n\n For version 2 (the default), all of the bits are used if *a *is a str,\n bytes, or bytearray. For version 1, the hash() of *a* is used instead.\n\n If *a* is an int, all bits are used.\n\n \"\"\"\n\n if a is None:\n try:\n a = int.from_bytes(_urandom(32), 'big')\n except NotImplementedError:\n import time\n a = int(time.time() * 256) # use fractional seconds\n\n if version == 2:\n if isinstance(a, (str, bytes, bytearray)):\n if isinstance(a, str):\n a = a.encode()\n a += _sha512(a).digest()\n a = int.from_bytes(a, 'big')\n\n super().seed(a)\n self.gauss_next = None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random.getstate_Random.setstate.if_version_3_.else_.raise_ValueError_state_w": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random.getstate_Random.setstate.if_version_3_.else_.raise_ValueError_state_w", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/random.py", "file_name": "random.py", "file_type": "text/x-python", "category": "implementation", "start_line": 130, "end_line": 154, "span_ids": ["Random.setstate", "Random.getstate"], "tokens": 265}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Random(_random.Random):\n\n def getstate(self) -> tuple:\n \"\"\"Return internal state; can be passed to setstate() later.\"\"\"\n return self.VERSION, super().getstate(), self.gauss_next\n\n def setstate(self, state: tuple) -> None:\n \"\"\"Restore internal state from object returned by getstate().\"\"\"\n version = state[0]\n if version == 3:\n version, internalstate, self.gauss_next = state\n super().setstate(internalstate)\n elif version == 2:\n version, internalstate, self.gauss_next = state\n # In version 2, the state was saved as signed ints, which causes\n # inconsistencies between 32/64-bit systems. The state is\n # really unsigned 32-bit ints, so we convert negative ints from\n # version 2 to positive longs for version 3.\n try:\n internalstate = tuple(x % (2**32) for x in internalstate)\n except ValueError as e:\n raise TypeError()\n super().setstate(internalstate)\n else:\n raise ValueError(\"state with version %s passed to \"\n \"Random.setstate() of version %s\" %\n (version, self.VERSION))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random._Methods_below_thi_Random._i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random._Methods_below_thi_Random._i", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/random.py", "file_name": "random.py", "file_type": "text/x-python", "category": "implementation", "start_line": 156, "end_line": 170, "span_ids": ["Random.__getstate__", "Random.__setstate__", "Random.setstate", "Random.__reduce__"], "tokens": 116}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Random(_random.Random):\n\n## ---- Methods below this point do not need to be overridden when\n## ---- subclassing for the purpose of using a different core generator.\n\n## -------------------- pickle support -------------------\n\n def __getstate__(self) -> object: # for pickle\n return self.getstate()\n\n def __setstate__(self, state: Any) -> None: # for pickle\n self.setstate(state)\n\n def __reduce__(self) -> tuple:\n return self.__class__, (), self.getstate()\n\n## -------------------- integer methods -------------------", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random.randrange_Random.randrange.return.istart_istep_self__rand": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random.randrange_Random.randrange.return.istart_istep_self__rand", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/random.py", "file_name": "random.py", "file_type": "text/x-python", "category": "implementation", "start_line": 172, "end_line": 217, "span_ids": ["Random.randrange"], "tokens": 416}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Random(_random.Random):\n\n def randrange(self, start: SupportsInt, stop: SupportsInt = None,\n step: int = 1, int: Callable[[SupportsInt],\n int] = int) -> int:\n \"\"\"Choose a random item from range(start, stop[, step]).\n\n This fixes the problem with randint() which includes the\n endpoint; in Python this is usually not what you want.\n\n Do not supply the 'int' argument.\n \"\"\"\n\n # This code is a bit messy to make it fast for the\n # common case while still doing adequate error checking.\n istart = int(start)\n if istart != start:\n raise ValueError(\"non-integer arg 1 for randrange()\")\n if stop is None:\n if istart > 0:\n return self._randbelow(istart)\n raise ValueError(\"empty range for randrange()\")\n\n # stop argument supplied.\n istop = int(stop)\n if istop != stop:\n raise ValueError(\"non-integer stop for randrange()\")\n width = istop - istart\n if step == 1 and width > 0:\n return istart + self._randbelow(width)\n if step == 1:\n raise ValueError(\"empty range for randrange() (%d,%d, %d)\" % (istart, istop, width))\n\n # Non-unit step argument supplied.\n istep = int(step)\n if istep != step:\n raise ValueError(\"non-integer step for randrange()\")\n if istep > 0:\n n = (width + istep - 1) // istep\n elif istep < 0:\n n = (width + istep + 1) // istep\n else:\n raise ValueError(\"zero step for randrange()\")\n\n if n <= 0:\n raise ValueError(\"empty range for randrange()\")\n\n return istart + istep*self._randbelow(n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random.randint_Random._randbelow.return.int_s_maxsize_n": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random.randint_Random._randbelow.return.int_s_maxsize_n", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/random.py", "file_name": "random.py", "file_type": "text/x-python", "category": "implementation", "start_line": 219, "end_line": 254, "span_ids": ["Random.randint", "Random._randbelow"], "tokens": 426}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Random(_random.Random):\n\n def randint(self, a: int, b: int) -> int:\n \"\"\"Return random integer in range [a, b], including both end points.\n \"\"\"\n\n return self.randrange(a, b+1)\n\n def _randbelow(self, n: int, int: Callable[[float], int] = int,\n maxsize: int = 1< int:\n \"Return a random int in the range [0,n). Raises ValueError if n==0.\"\n\n getrandbits = self.getrandbits\n # Only call self.getrandbits if the original random() builtin method\n # has not been overridden or if a new getrandbits() was supplied.\n if type(self.random) is BuiltinMethod or type(getrandbits) is Method:\n k = n.bit_length() # don't use (n-1) here because n can be 1\n r = getrandbits(k) # 0 <= r < 2**k\n while r >= n:\n r = getrandbits(k)\n return r\n # There's an overridden random() method but no new getrandbits() method,\n # so we can only use random() from here.\n random = self.random\n if n >= maxsize:\n _warn(\"Underlying random() generator does not supply \\n\"\n \"enough bits to choose from a population range this large.\\n\"\n \"To remove the range limitation, add a getrandbits() method.\")\n return int(random() * n)\n rem = maxsize % n\n limit = (maxsize - rem) / maxsize # int(limit * maxsize) % n == 0\n s = random()\n while s >= limit:\n s = random()\n return int(s*maxsize) % n", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random._s_Random.shuffle.for_i_in_reversed_range_1.x_i_x_j_x_j_x_i_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random._s_Random.shuffle.for_i_in_reversed_range_1.x_i_x_j_x_j_x_i_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/random.py", "file_name": "random.py", "file_type": "text/x-python", "category": "implementation", "start_line": 256, "end_line": 279, "span_ids": ["Random._randbelow", "Random.shuffle", "Random.choice"], "tokens": 239}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Random(_random.Random):\n\n## -------------------- sequence methods -------------------\n\n def choice(self, seq: Sequence[T]) -> T:\n \"\"\"Choose a random element from a non-empty sequence.\"\"\"\n try:\n i = self._randbelow(len(seq))\n except ValueError:\n raise IndexError('Cannot choose from an empty sequence')\n return seq[i]\n\n def shuffle(self, x: List[T],\n random: Callable[[], float] = None,\n int: Callable[[float], int] = int) -> None:\n \"\"\"x, random=random.random -> shuffle list x in place; return None.\n\n Optional arg random is a 0-argument function returning a random\n float in [0.0, 1.0); by default, the standard random.random.\n \"\"\"\n\n randbelow = self._randbelow\n for i in reversed(range(1, len(x))):\n # pick an element in x[:i+1] with which to exchange x[i]\n j = randbelow(i+1) if random is None else int(random() * (i+1))\n x[i], x[j] = x[j], x[i]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random.sample_Random.sample.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random.sample_Random.sample.return.result", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/random.py", "file_name": "random.py", "file_type": "text/x-python", "category": "implementation", "start_line": 281, "end_line": 337, "span_ids": ["Random.sample"], "tokens": 604}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Random(_random.Random):\n\n def sample(self, population: Union[_Set[T], _Sequence[T]], k: int) -> List[T]:\n \"\"\"Chooses k unique random elements from a population sequence or set.\n\n Returns a new list containing elements from the population while\n leaving the original population unchanged. The resulting list is\n in selection order so that all sub-slices will also be valid random\n samples. This allows raffle winners (the sample) to be partitioned\n into grand prize and second place winners (the subslices).\n\n Members of the population need not be hashable or unique. If the\n population contains repeats, then each occurrence is a possible\n selection in the sample.\n\n To choose a sample in a range of integers, use range as an argument.\n This is especially fast and space efficient for sampling from a\n large population: sample(range(10000000), 60)\n \"\"\"\n\n # Sampling without replacement entails tracking either potential\n # selections (the pool) in a list or previous selections in a set.\n\n # When the number of selections is small compared to the\n # population, then tracking selections is efficient, requiring\n # only a small set and an occasional reselection. For\n # a larger number of selections, the pool tracking method is\n # preferred since the list takes less space than the\n # set and it doesn't suffer from frequent reselections.\n\n if isinstance(population, _Set):\n population = list(population)\n if not isinstance(population, _Sequence):\n raise TypeError(\"Population must be a sequence or set. For dicts, use list(d).\")\n randbelow = self._randbelow\n n = len(population)\n if not (0 <= k and k <= n):\n raise ValueError(\"Sample larger than population\")\n result = [cast(T, None)] * k\n setsize = 21 # size of a small set minus size of an empty list\n if k > 5:\n setsize += 4 ** _ceil(_log(k * 3, 4)) # table size for big sets\n if n <= setsize:\n # An n-length list is smaller than a k-length set\n pool = list(population)\n for i in range(k): # invariant: non-selected at [0,n-i)\n j = randbelow(n-i)\n result[i] = pool[j]\n pool[j] = pool[n-i-1] # move non-selected item into vacancy\n else:\n selected = set() # type: Set[int]\n selected_add = selected.add\n for i in range(k):\n j = randbelow(n)\n while j in selected:\n j = randbelow(n)\n selected_add(j)\n result[i] = population[j]\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random._r_Random.triangular.return.low_high_low_u_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random._r_Random.triangular.return.low_high_low_u_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/random.py", "file_name": "random.py", "file_type": "text/x-python", "category": "implementation", "start_line": 339, "end_line": 365, "span_ids": ["Random.uniform", "Random.triangular", "Random.sample"], "tokens": 236}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Random(_random.Random):\n\n## -------------------- real-valued distributions -------------------\n\n## -------------------- uniform distribution -------------------\n\n def uniform(self, a: float, b: float) -> float:\n \"Get a random number in the range [a, b) or [a, b] depending on rounding.\"\n return a + (b-a) * self.random()\n\n## -------------------- triangular --------------------\n\n def triangular(self, low: float = 0.0, high: float = 1.0,\n mode: float = None) -> float:\n \"\"\"Triangular distribution.\n\n Continuous distribution bounded by given lower and upper limits,\n and having a given mode value in-between.\n\n http://en.wikipedia.org/wiki/Triangular_distribution\n\n \"\"\"\n u = self.random()\n c = 0.5 if mode is None else (mode - low) / (high - low)\n if u > c:\n u = 1.0 - u\n c = 1.0 - c\n low, high = high, low\n return low + (high - low) * (u * c) ** 0.5", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random._n_Random.normalvariate.return.mu_z_sigma": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random._n_Random.normalvariate.return.mu_z_sigma", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/random.py", "file_name": "random.py", "file_type": "text/x-python", "category": "implementation", "start_line": 367, "end_line": 390, "span_ids": ["Random.normalvariate", "Random.triangular"], "tokens": 200}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Random(_random.Random):\n\n## -------------------- normal distribution --------------------\n\n def normalvariate(self, mu: float, sigma: float) -> float:\n \"\"\"Normal distribution.\n\n mu is the mean, and sigma is the standard deviation.\n\n \"\"\"\n # mu = mean, sigma = standard deviation\n\n # Uses Kinderman and Monahan method. Reference: Kinderman,\n # A.J. and Monahan, J.F., \"Computer generation of random\n # variables using the ratio of uniform deviates\", ACM Trans\n # Math Software, 3, (1977), pp257-260.\n\n random = self.random\n while 1:\n u1 = random()\n u2 = 1.0 - random()\n z = NV_MAGICCONST*(u1-0.5)/u2\n zz = z*z/4.0\n if zz <= -_log(u2):\n break\n return mu + z*sigma", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random._l_Random._v": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random._l_Random._v", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/random.py", "file_name": "random.py", "file_type": "text/x-python", "category": "implementation", "start_line": 392, "end_line": 423, "span_ids": ["Random.normalvariate", "Random.expovariate", "Random.lognormvariate"], "tokens": 276}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Random(_random.Random):\n\n## -------------------- lognormal distribution --------------------\n\n def lognormvariate(self, mu: float, sigma: float) -> float:\n \"\"\"Log normal distribution.\n\n If you take the natural logarithm of this distribution, you'll get a\n normal distribution with mean mu and standard deviation sigma.\n mu can have any value, and sigma must be greater than zero.\n\n \"\"\"\n return _exp(self.normalvariate(mu, sigma))\n\n## -------------------- exponential distribution --------------------\n\n def expovariate(self, lambd: float) -> float:\n \"\"\"Exponential distribution.\n\n lambd is 1.0 divided by the desired mean. It should be\n nonzero. (The parameter would be called \"lambda\", but that is\n a reserved word in Python.) Returned values range from 0 to\n positive infinity if lambd is positive, and from negative\n infinity to 0 if lambd is negative.\n\n \"\"\"\n # lambd: rate lambd = 1/mean\n # ('lambda' is a Python reserved word)\n\n # we use 1-random() instead of random() to preclude the\n # possibility of taking the log of zero.\n return -_log(1.0 - self.random())/lambd\n\n## -------------------- von Mises distribution --------------------", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random.vonmisesvariate_Random._g": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random.vonmisesvariate_Random._g", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/random.py", "file_name": "random.py", "file_type": "text/x-python", "category": "implementation", "start_line": 425, "end_line": 473, "span_ids": ["Random.vonmisesvariate"], "tokens": 427}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Random(_random.Random):\n\n def vonmisesvariate(self, mu: float, kappa: float) -> float:\n \"\"\"Circular data distribution.\n\n mu is the mean angle, expressed in radians between 0 and 2*pi, and\n kappa is the concentration parameter, which must be greater than or\n equal to zero. If kappa is equal to zero, this distribution reduces\n to a uniform random angle over the range 0 to 2*pi.\n\n \"\"\"\n # mu: mean angle (in radians between 0 and 2*pi)\n # kappa: concentration parameter kappa (>= 0)\n # if kappa = 0 generate uniform random angle\n\n # Based upon an algorithm published in: Fisher, N.I.,\n # \"Statistical Analysis of Circular Data\", Cambridge\n # University Press, 1993.\n\n # Thanks to Magnus Kessler for a correction to the\n # implementation of step 4.\n\n random = self.random\n if kappa <= 1e-6:\n return TWOPI * random()\n\n a = 1.0 + _sqrt(1.0 + 4.0 * kappa * kappa)\n b = (a - _sqrt(2.0 * a))/(2.0 * kappa)\n r = (1.0 + b * b)/(2.0 * b)\n\n while 1:\n u1 = random()\n\n z = _cos(_pi * u1)\n f = (1.0 + r * z)/(r + z)\n c = kappa * (r - f)\n\n u2 = random()\n\n if u2 < c * (2.0 - c) or u2 <= c * _exp(1.0 - c):\n break\n\n u3 = random()\n if u3 > 0.5:\n theta = (mu % TWOPI) + _acos(f)\n else:\n theta = (mu % TWOPI) - _acos(f)\n\n return theta\n\n## -------------------- gamma distribution --------------------", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random.gammavariate_Random.gammavariate.if_alpha_1_0_.else_alpha_is_betwee.return.x_beta": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random.gammavariate_Random.gammavariate.if_alpha_1_0_.else_alpha_is_betwee.return.x_beta", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/random.py", "file_name": "random.py", "file_type": "text/x-python", "category": "implementation", "start_line": 475, "end_line": 543, "span_ids": ["Random.gammavariate"], "tokens": 592}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Random(_random.Random):\n\n def gammavariate(self, alpha: float, beta: float) -> float:\n \"\"\"Gamma distribution. Not the gamma function!\n\n Conditions on the parameters are alpha > 0 and beta > 0.\n\n The probability distribution function is:\n\n x ** (alpha - 1) * math.exp(-x / beta)\n pdf(x) = --------------------------------------\n math.gamma(alpha) * beta ** alpha\n\n \"\"\"\n\n # alpha > 0, beta > 0, mean is alpha*beta, variance is alpha*beta**2\n\n # Warning: a few older sources define the gamma distribution in terms\n # of alpha > -1.0\n if alpha <= 0.0 or beta <= 0.0:\n raise ValueError('gammavariate: alpha and beta must be > 0.0')\n\n random = self.random\n if alpha > 1.0:\n\n # Uses R.C.H. Cheng, \"The generation of Gamma\n # variables with non-integral shape parameters\",\n # Applied Statistics, (1977), 26, No. 1, p71-74\n\n ainv = _sqrt(2.0 * alpha - 1.0)\n bbb = alpha - LOG4\n ccc = alpha + ainv\n\n while 1:\n u1 = random()\n if not (1e-7 < u1 and u1 < .9999999):\n continue\n u2 = 1.0 - random()\n v = _log(u1/(1.0-u1))/ainv\n x = alpha*_exp(v)\n z = u1*u1*u2\n r = bbb+ccc*v-x\n if r + SG_MAGICCONST - 4.5*z >= 0.0 or r >= _log(z):\n return x * beta\n\n elif alpha == 1.0:\n # expovariate(1)\n u = random()\n while u <= 1e-7:\n u = random()\n return -_log(u) * beta\n\n else: # alpha is between 0 and 1 (exclusive)\n\n # Uses ALGORITHM GS of Statistical Computing - Kennedy & Gentle\n\n while 1:\n u = random()\n b = (_e + alpha)/_e\n p = b*u\n if p <= 1.0:\n x = p ** (1.0/alpha)\n else:\n x = -_log((b-p)/alpha)\n u1 = random()\n if p > 1.0:\n if u1 <= x ** (alpha - 1.0):\n break\n elif u1 <= _exp(-x):\n break\n return x * beta", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random._G_Random.gauss.return.mu_z_sigma": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random._G_Random.gauss.return.mu_z_sigma", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/random.py", "file_name": "random.py", "file_type": "text/x-python", "category": "implementation", "start_line": 545, "end_line": 584, "span_ids": ["Random.gauss", "Random.gammavariate"], "tokens": 376}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Random(_random.Random):\n\n## -------------------- Gauss (faster alternative) --------------------\n\n def gauss(self, mu: float, sigma: float) -> float:\n \"\"\"Gaussian distribution.\n\n mu is the mean, and sigma is the standard deviation. This is\n slightly faster than the normalvariate() function.\n\n Not thread-safe without a lock around calls.\n\n \"\"\"\n\n # When x and y are two variables from [0, 1), uniformly\n # distributed, then\n #\n # cos(2*pi*x)*sqrt(-2*log(1-y))\n # sin(2*pi*x)*sqrt(-2*log(1-y))\n #\n # are two *independent* variables with normal distribution\n # (mu = 0, sigma = 1).\n # (Lambert Meertens)\n # (corrected version; bug discovered by Mike Miller, fixed by LM)\n\n # Multithreading note: When two threads call this function\n # simultaneously, it is possible that they will receive the\n # same return value. The window is very small though. To\n # avoid this, you have to use a lock around all calls. (I\n # didn't want to slow this down in the serial case by using a\n # lock here.)\n\n random = self.random\n z = self.gauss_next\n self.gauss_next = None\n if z is None:\n x2pi = random() * TWOPI\n g2rad = _sqrt(-2.0 * _log(1.0 - random()))\n z = _cos(x2pi) * g2rad\n self.gauss_next = _sin(x2pi) * g2rad\n\n return mu + z*sigma", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random._b_Random._was_dead_wrong_and_ho": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random._b_Random._was_dead_wrong_and_ho", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/random.py", "file_name": "random.py", "file_type": "text/x-python", "category": "implementation", "start_line": 586, "end_line": 598, "span_ids": ["Random.gauss"], "tokens": 129}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Random(_random.Random):\n\n## -------------------- beta --------------------\n## See\n## http://mail.python.org/pipermail/python-bugs-list/2001-January/003752.html\n## for Ivan Frohne's insightful analysis of why the original implementation:\n##\n## def betavariate(self, alpha, beta):\n## # Discrete Event Simulation in C, pp 87-88.\n##\n## y = self.expovariate(alpha)\n## z = self.expovariate(1.0/beta)\n## return z/(y+z)\n##\n## was dead wrong, and how it probably got that way.", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random.betavariate_Random.betavariate.if_y_0_.else_.return.y_y_self_gammavariat": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random.betavariate_Random.betavariate.if_y_0_.else_.return.y_y_self_gammavariat", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/random.py", "file_name": "random.py", "file_type": "text/x-python", "category": "implementation", "start_line": 600, "end_line": 614, "span_ids": ["Random.betavariate"], "tokens": 148}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Random(_random.Random):\n\n def betavariate(self, alpha: float, beta: float) -> 'float':\n \"\"\"Beta distribution.\n\n Conditions on the parameters are alpha > 0 and beta > 0.\n Returned values range between 0 and 1.\n\n \"\"\"\n\n # This version due to Janne Sinkkonen, and matches all the std\n # texts (e.g., Knuth Vol 2 Ed 3 pg 134 \"the beta distribution\").\n y = self.gammavariate(alpha, 1.)\n if y == 0:\n return 0.0\n else:\n return y / (y + self.gammavariate(beta, 1.))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random._P_Random.weibullvariate.return.alpha__log_u_1_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py_Random._P_Random.weibullvariate.return.alpha__log_u_1_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/random.py", "file_name": "random.py", "file_type": "text/x-python", "category": "implementation", "start_line": 616, "end_line": 636, "span_ids": ["Random.weibullvariate", "Random.paretovariate", "Random.betavariate"], "tokens": 169}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Random(_random.Random):\n\n## -------------------- Pareto --------------------\n\n def paretovariate(self, alpha: float) -> float:\n \"\"\"Pareto distribution. alpha is the shape parameter.\"\"\"\n # Jain, pg. 495\n\n u = 1.0 - self.random()\n return 1.0 / u ** (1.0/alpha)\n\n## -------------------- Weibull --------------------\n\n def weibullvariate(self, alpha: float, beta: float) -> float:\n \"\"\"Weibull distribution.\n\n alpha is the scale parameter and beta is the shape parameter.\n\n \"\"\"\n # Jain, pg. 499; bug fix courtesy Bill Arms\n\n u = 1.0 - self.random()\n return alpha * (-_log(u)) ** (1.0/beta)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py__Operat_SystemRandom.getstate.setstate._notimplemented": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py__Operat_SystemRandom.getstate.setstate._notimplemented", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/random.py", "file_name": "random.py", "file_type": "text/x-python", "category": "implementation", "start_line": 638, "end_line": 669, "span_ids": ["SystemRandom.seed", "Random.weibullvariate", "SystemRandom:3", "SystemRandom.random", "SystemRandom", "SystemRandom.getrandbits", "SystemRandom._notimplemented"], "tokens": 345}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "## --------------- Operating System Random Source ------------------\n\nclass SystemRandom(Random):\n \"\"\"Alternate random number generator using sources provided\n by the operating system (such as /dev/urandom on Unix or\n CryptGenRandom on Windows).\n\n Not available on all systems (see os.urandom() for details).\n \"\"\"\n\n def random(self) -> float:\n \"\"\"Get the next random number in the range [0.0, 1.0).\"\"\"\n return (int.from_bytes(_urandom(7), 'big') >> 3) * RECIP_BPF\n\n def getrandbits(self, k: int) -> int:\n \"\"\"getrandbits(k) -> x. Generates a long int with k random bits.\"\"\"\n if k <= 0:\n raise ValueError('number of bits must be greater than zero')\n if k != int(k):\n raise TypeError('number of bits should be an integer')\n numbytes = (k + 7) // 8 # bits / 8 and rounded up\n x = int.from_bytes(_urandom(numbytes), 'big')\n return x >> (numbytes * 8 - k) # trim excess bits\n\n def seed(self, a: object = None, version: int = None) -> None:\n \"Stub method. Not used for a system random number generator.\"\n return\n\n def _notimplemented(self, *args: Any, **kwds: Any) -> Any:\n \"Method should not be called for a system random number generator.\"\n raise NotImplementedError('System entropy source does not have state.')\n getstate = setstate = _notimplemented", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py__Create_one_instance_se_getrandbits._inst_getrandbits": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py__Create_one_instance_se_getrandbits._inst_getrandbits", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/random.py", "file_name": "random.py", "file_type": "text/x-python", "category": "implementation", "start_line": 671, "end_line": 698, "span_ids": ["SystemRandom:3", "impl:17"], "tokens": 264}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Create one instance, seeded from current time, and export its methods\n# as module-level functions. The functions share state across all uses\n#(both in the user's code and in the Python libraries), but that's fine\n# for most programs and is easier for the casual user than making them\n# instantiate their own Random() instance.\n\n_inst = Random()\nseed = _inst.seed\nrandom = _inst.random\nuniform = _inst.uniform\ntriangular = _inst.triangular\nrandint = _inst.randint\nchoice = _inst.choice\nrandrange = _inst.randrange\nsample = _inst.sample\nshuffle = _inst.shuffle\nnormalvariate = _inst.normalvariate\nlognormvariate = _inst.lognormvariate\nexpovariate = _inst.expovariate\nvonmisesvariate = _inst.vonmisesvariate\ngammavariate = _inst.gammavariate\ngauss = _inst.gauss\nbetavariate = _inst.betavariate\nparetovariate = _inst.paretovariate\nweibullvariate = _inst.weibullvariate\ngetstate = _inst.getstate\nsetstate = _inst.setstate\ngetrandbits = _inst.getrandbits", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py__t__test_generator.print_avg_g_stddev_g_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py__t__test_generator.print_avg_g_stddev_g_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/random.py", "file_name": "random.py", "file_type": "text/x-python", "category": "implementation", "start_line": 700, "end_line": 721, "span_ids": ["_test_generator", "impl:17"], "tokens": 204}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "## -------------------- test program --------------------\n\ndef _test_generator(n: int, func: Any, args: tuple) -> None:\n import time\n print(n, 'times', func.__name__)\n total = 0.0\n sqsum = 0.0\n smallest = 1e10\n largest = -1e10\n t0 = time.time()\n for i in range(n):\n x = func(*args) # type: float\n total += x\n sqsum = sqsum + x*x\n smallest = min(x, smallest)\n largest = max(x, largest)\n t1 = time.time()\n print(round(t1-t0, 3), 'sec,', end=' ')\n avg = total/n\n stddev = _sqrt(sqsum/n - avg*avg)\n print('avg %g, stddev %g, min %g, max %g' % \\\n (avg, stddev, smallest, largest))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py__test_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/random.py__test_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/random.py", "file_name": "random.py", "file_type": "text/x-python", "category": "implementation", "start_line": 724, "end_line": 744, "span_ids": ["_test", "impl:61"], "tokens": 343}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _test(N: int = 2000) -> None:\n _test_generator(N, random, ())\n _test_generator(N, normalvariate, (0.0, 1.0))\n _test_generator(N, lognormvariate, (0.0, 1.0))\n _test_generator(N, vonmisesvariate, (0.0, 1.0))\n _test_generator(N, gammavariate, (0.01, 1.0))\n _test_generator(N, gammavariate, (0.1, 1.0))\n _test_generator(N, gammavariate, (0.1, 2.0))\n _test_generator(N, gammavariate, (0.5, 1.0))\n _test_generator(N, gammavariate, (0.9, 1.0))\n _test_generator(N, gammavariate, (1.0, 1.0))\n _test_generator(N, gammavariate, (2.0, 1.0))\n _test_generator(N, gammavariate, (20.0, 1.0))\n _test_generator(N, gammavariate, (200.0, 1.0))\n _test_generator(N, gauss, (0.0, 1.0))\n _test_generator(N, betavariate, (3.0, 3.0))\n _test_generator(N, triangular, (0.0, 1.0, 1.0/3.0))\n\nif __name__ == '__main__':\n _test()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py__Utility_functions_for___samefile.return._os_path_normcase_os_path": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py__Utility_functions_for___samefile.return._os_path_normcase_os_path", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/shutil.py", "file_name": "shutil.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 95, "span_ids": ["impl:21", "RegistryError", "ReadError", "_samefile", "Error", "copyfileobj", "docstring", "SpecialFileError", "ExecError"], "tokens": 633}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Utility functions for copying and archiving files and directory trees.\n\nXXX The functions here don't copy the resource fork or other metadata on Mac.\n\n\"\"\"\n\nimport os\nimport sys\nimport stat\nfrom os.path import abspath\nimport fnmatch\nimport collections\nimport errno\nimport tarfile\nimport builtins\n\nfrom typing import (\n Any, AnyStr, IO, List, Iterable, Callable, Tuple, Dict, Sequence, cast\n)\nfrom types import TracebackType\n\ntry:\n import bz2\n _BZ2_SUPPORTED = True\nexcept ImportError:\n _BZ2_SUPPORTED = False\n\ntry:\n from pwd import getpwnam as _getpwnam\n getpwnam = _getpwnam\nexcept ImportError:\n getpwnam = None\n\ntry:\n from grp import getgrnam as _getgrnam\n getgrnam = _getgrnam\nexcept ImportError:\n getgrnam = None\n\n__all__ = [\"copyfileobj\", \"copyfile\", \"copymode\", \"copystat\", \"copy\", \"copy2\",\n \"copytree\", \"move\", \"rmtree\", \"Error\", \"SpecialFileError\",\n \"ExecError\", \"make_archive\", \"get_archive_formats\",\n \"register_archive_format\", \"unregister_archive_format\",\n \"get_unpack_formats\", \"register_unpack_format\",\n \"unregister_unpack_format\", \"unpack_archive\", \"ignore_patterns\"]\n\nclass Error(EnvironmentError):\n pass\n\nclass SpecialFileError(EnvironmentError):\n \"\"\"Raised when trying to do a kind of operation (e.g. copying) which is\n not supported on a special file (e.g. a named pipe)\"\"\"\n\nclass ExecError(EnvironmentError):\n \"\"\"Raised when a command could not be executed\"\"\"\n\nclass ReadError(EnvironmentError):\n \"\"\"Raised when an archive cannot be read\"\"\"\n\nclass RegistryError(Exception):\n \"\"\"Raised when a registery operation with the archiving\n and unpacking registeries fails\"\"\"\n\n\nif sys.platform == \"win32\":\n _WindowsError = WindowsError\nelse:\n _WindowsError = None\n\n\n# Function aliases to be patched in test cases\nrename = os.rename\nopen = builtins.open\n\n\ndef copyfileobj(fsrc: IO[AnyStr], fdst: IO[AnyStr],\n length: int = 16*1024) -> None:\n \"\"\"copy data from file-like object fsrc to file-like object fdst\"\"\"\n while 1:\n buf = fsrc.read(length)\n if not buf:\n break\n fdst.write(buf)\n\ndef _samefile(src: str, dst: str) -> bool:\n # Macintosh, Unix.\n if hasattr(os.path, 'samefile'):\n try:\n return os.path.samefile(src, dst)\n except OSError:\n return False\n\n # All other platforms: check for same pathname.\n return (os.path.normcase(os.path.abspath(src)) ==\n os.path.normcase(os.path.abspath(dst)))\n\nif _BZ2_SUPPORTED:\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py_copyfile_copyfile.with_open_src_rb_as_f.with_open_dst_wb_as_f.copyfileobj_fsrc_fdst_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py_copyfile_copyfile.with_open_src_rb_as_f.with_open_dst_wb_as_f.copyfileobj_fsrc_fdst_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/shutil.py", "file_name": "shutil.py", "file_type": "text/x-python", "category": "implementation", "start_line": 97, "end_line": 115, "span_ids": ["copyfile"], "tokens": 168}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def copyfile(src: str, dst: str) -> None:\n \"\"\"Copy data from src to dst\"\"\"\n if _samefile(src, dst):\n raise Error(\"`%s` and `%s` are the same file\" % (src, dst))\n\n for fn in [src, dst]:\n try:\n st = os.stat(fn)\n except OSError:\n # File most likely does not exist\n pass\n else:\n # XXX What about other special files? (sockets, devices...)\n if stat.S_ISFIFO(st.st_mode):\n raise SpecialFileError(\"`%s` is a named pipe\" % fn)\n\n with open(src, 'rb') as fsrc:\n with open(dst, 'wb') as fdst:\n copyfileobj(fsrc, fdst)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py_copymode_copystat.if_hasattr_os_chflags_.try_.except_OSError_as_why_.if_not_hasattr_errno_E.raise": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py_copymode_copystat.if_hasattr_os_chflags_.try_.except_OSError_as_why_.if_not_hasattr_errno_E.raise", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/shutil.py", "file_name": "shutil.py", "file_type": "text/x-python", "category": "implementation", "start_line": 117, "end_line": 138, "span_ids": ["copymode", "copystat"], "tokens": 221}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def copymode(src: str, dst: str) -> None:\n \"\"\"Copy mode bits from src to dst\"\"\"\n if hasattr(os, 'chmod'):\n st = os.stat(src)\n mode = stat.S_IMODE(st.st_mode)\n os.chmod(dst, mode)\n\ndef copystat(src: str, dst: str) -> None:\n \"\"\"Copy all stat info (mode bits, atime, mtime, flags) from src to dst\"\"\"\n st = os.stat(src)\n mode = stat.S_IMODE(st.st_mode)\n if hasattr(os, 'utime'):\n os.utime(dst, (st.st_atime, st.st_mtime))\n if hasattr(os, 'chmod'):\n os.chmod(dst, mode)\n if hasattr(os, 'chflags') and hasattr(st, 'st_flags'):\n try:\n os.chflags(dst, st.st_flags)\n except OSError as why:\n if (not hasattr(errno, 'EOPNOTSUPP') or\n why.errno != errno.EOPNOTSUPP):\n raise", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py_copy_copy2.copystat_src_dst_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py_copy_copy2.copystat_src_dst_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/shutil.py", "file_name": "shutil.py", "file_type": "text/x-python", "category": "implementation", "start_line": 140, "end_line": 160, "span_ids": ["copy2", "copy"], "tokens": 143}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def copy(src: str, dst: str) -> None:\n \"\"\"Copy data and mode bits (\"cp src dst\").\n\n The destination may be a directory.\n\n \"\"\"\n if os.path.isdir(dst):\n dst = os.path.join(dst, os.path.basename(src))\n copyfile(src, dst)\n copymode(src, dst)\n\ndef copy2(src: str, dst: str) -> None:\n \"\"\"Copy data and all stat info (\"cp -p src dst\").\n\n The destination may be a directory.\n\n \"\"\"\n if os.path.isdir(dst):\n dst = os.path.join(dst, os.path.basename(src))\n copyfile(src, dst)\n copystat(src, dst)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py_ignore_patterns_ignore_patterns.return._ignore_patterns": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py_ignore_patterns_ignore_patterns.return._ignore_patterns", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/shutil.py", "file_name": "shutil.py", "file_type": "text/x-python", "category": "implementation", "start_line": 162, "end_line": 173, "span_ids": ["ignore_patterns"], "tokens": 111}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def ignore_patterns(*patterns: str) -> Callable[[str, List[str]],\n Iterable[str]]:\n \"\"\"Function that can be used as copytree() ignore parameter.\n\n Patterns is a sequence of glob-style patterns\n that are used to exclude files\"\"\"\n def _ignore_patterns(path: str, names: List[str]) -> Iterable[str]:\n ignored_names = [] # type: List[str]\n for pattern in patterns:\n ignored_names.extend(fnmatch.filter(names, pattern))\n return set(ignored_names)\n return _ignore_patterns", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py_copytree_copytree.if_errors_.raise_Error_errors_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py_copytree_copytree.if_errors_.raise_Error_errors_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/shutil.py", "file_name": "shutil.py", "file_type": "text/x-python", "category": "implementation", "start_line": 175, "end_line": 257, "span_ids": ["copytree"], "tokens": 782}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def copytree(src: str, dst: str, symlinks: bool = False,\n ignore: Callable[[str, List[str]], Iterable[str]] = None,\n copy_function: Callable[[str, str], None] = copy2,\n ignore_dangling_symlinks: bool = False) -> None:\n \"\"\"Recursively copy a directory tree.\n\n The destination directory must not already exist.\n If exception(s) occur, an Error is raised with a list of reasons.\n\n If the optional symlinks flag is true, symbolic links in the\n source tree result in symbolic links in the destination tree; if\n it is false, the contents of the files pointed to by symbolic\n links are copied. If the file pointed by the symlink doesn't\n exist, an exception will be added in the list of errors raised in\n an Error exception at the end of the copy process.\n\n You can set the optional ignore_dangling_symlinks flag to true if you\n want to silence this exception. Notice that this has no effect on\n platforms that don't support os.symlink.\n\n The optional ignore argument is a callable. If given, it\n is called with the `src` parameter, which is the directory\n being visited by copytree(), and `names` which is the list of\n `src` contents, as returned by os.listdir():\n\n callable(src, names) -> ignored_names\n\n Since copytree() is called recursively, the callable will be\n called once for each directory that is copied. It returns a\n list of names relative to the `src` directory that should\n not be copied.\n\n The optional copy_function argument is a callable that will be used\n to copy each file. It will be called with the source path and the\n destination path as arguments. By default, copy2() is used, but any\n function that supports the same signature (like copy()) can be used.\n\n \"\"\"\n names = os.listdir(src)\n if ignore is not None:\n ignored_names = ignore(src, names)\n else:\n ignored_names = set()\n\n os.makedirs(dst)\n errors = [] # type: List[Tuple[str, str, str]]\n for name in names:\n if name in ignored_names:\n continue\n srcname = os.path.join(src, name)\n dstname = os.path.join(dst, name)\n try:\n if os.path.islink(srcname):\n linkto = os.readlink(srcname)\n if symlinks:\n os.symlink(linkto, dstname)\n else:\n # ignore dangling symlink if the flag is on\n if not os.path.exists(linkto) and ignore_dangling_symlinks:\n continue\n # otherwise let the copy occurs. copy2 will raise an error\n copy_function(srcname, dstname)\n elif os.path.isdir(srcname):\n copytree(srcname, dstname, symlinks, ignore, copy_function)\n else:\n # Will raise a SpecialFileError for unsupported file types\n copy_function(srcname, dstname)\n # catch the Error from the recursive copytree so that we can\n # continue with other files\n except Error as err:\n errors.extend(err.args[0])\n except EnvironmentError as why:\n errors.append((srcname, dstname, str(why)))\n try:\n copystat(src, dst)\n except OSError as why:\n if _WindowsError is not None and isinstance(why, _WindowsError):\n # Copying file access times may fail on Windows\n pass\n else:\n errors.append((src, dst, str(why)))\n if errors:\n raise Error(errors)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py_rmtree_rmtree.None_2.except_os_error_.onerror_os_rmdir_path_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py_rmtree_rmtree.None_2.except_os_error_.onerror_os_rmdir_path_s", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/shutil.py", "file_name": "shutil.py", "file_type": "text/x-python", "category": "implementation", "start_line": 259, "end_line": 311, "span_ids": ["rmtree"], "tokens": 479}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def rmtree(path: str, ignore_errors: bool = False,\n onerror: Callable[[Any, str, Tuple[type, BaseException, TracebackType]],\n None] = None) -> None:\n \"\"\"Recursively delete a directory tree.\n\n If ignore_errors is set, errors are ignored; otherwise, if onerror\n is set, it is called to handle the error with arguments (func,\n path, exc_info) where func is os.listdir, os.remove, or os.rmdir;\n path is the argument to that function that caused it to fail; and\n exc_info is a tuple returned by sys.exc_info(). If ignore_errors\n is false and onerror is None, an exception is raised.\n\n \"\"\"\n if ignore_errors:\n def _onerror(x: Any, y: str,\n z: Tuple[type, BaseException, TracebackType]) -> None:\n pass\n onerror = _onerror\n elif onerror is None:\n def __onerror(x: Any, y: str,\n z: Tuple[type, BaseException, TracebackType]) -> None:\n raise\n onerror = __onerror\n try:\n if os.path.islink(path):\n # symlinks to directories are forbidden, see bug #1669\n raise OSError(\"Cannot call rmtree on a symbolic link\")\n except OSError:\n onerror(os.path.islink, path, sys.exc_info())\n # can't continue even if onerror hook returns\n return\n names = [] # type: List[str]\n try:\n names = os.listdir(path)\n except os.error as err:\n onerror(os.listdir, path, sys.exc_info())\n for name in names:\n fullname = os.path.join(path, name)\n try:\n mode = os.lstat(fullname).st_mode\n except os.error:\n mode = 0\n if stat.S_ISDIR(mode):\n rmtree(fullname, ignore_errors, onerror)\n else:\n try:\n os.remove(fullname)\n except os.error as err:\n onerror(os.remove, fullname, sys.exc_info())\n try:\n os.rmdir(path)\n except os.error:\n onerror(os.rmdir, path, sys.exc_info())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py__basename_move.try_.except_OSError_as_exc_.if_os_path_isdir_src_.else_.os_unlink_src_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py__basename_move.try_.except_OSError_as_exc_.if_os_path_isdir_src_.else_.os_unlink_src_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/shutil.py", "file_name": "shutil.py", "file_type": "text/x-python", "category": "implementation", "start_line": 314, "end_line": 357, "span_ids": ["_basename", "move"], "tokens": 391}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _basename(path: str) -> str:\n # A basename() variant which first strips the trailing slash, if present.\n # Thus we always get the last component of the path, even for directories.\n return os.path.basename(path.rstrip(os.path.sep))\n\ndef move(src: str, dst: str) -> None:\n \"\"\"Recursively move a file or directory to another location. This is\n similar to the Unix \"mv\" command.\n\n If the destination is a directory or a symlink to a directory, the source\n is moved inside the directory. The destination path must not already\n exist.\n\n If the destination already exists but is not a directory, it may be\n overwritten depending on os.rename() semantics.\n\n If the destination is on our current filesystem, then rename() is used.\n Otherwise, src is copied to the destination and then removed.\n A lot more could be done here... A look at a mv.c shows a lot of\n the issues this implementation glosses over.\n\n \"\"\"\n real_dst = dst\n if os.path.isdir(dst):\n if _samefile(src, dst):\n # We might be on a case insensitive filesystem,\n # perform the rename anyway.\n os.rename(src, dst)\n return\n\n real_dst = os.path.join(dst, _basename(src))\n if os.path.exists(real_dst):\n raise Error(\"Destination path '%s' already exists\" % real_dst)\n try:\n os.rename(src, real_dst)\n except OSError as exc:\n if os.path.isdir(src):\n if _destinsrc(src, dst):\n raise Error(\"Cannot move a directory '%s' into itself '%s'.\" % (src, dst))\n copytree(src, real_dst, symlinks=True)\n rmtree(src)\n else:\n copy2(src, real_dst)\n os.unlink(src)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py__destinsrc__get_uid.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py__destinsrc__get_uid.return.None", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/shutil.py", "file_name": "shutil.py", "file_type": "text/x-python", "category": "implementation", "start_line": 359, "end_line": 390, "span_ids": ["_destinsrc", "_get_uid", "_get_gid"], "tokens": 220}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _destinsrc(src: str, dst: str) -> bool:\n src = abspath(src)\n dst = abspath(dst)\n if not src.endswith(os.path.sep):\n src += os.path.sep\n if not dst.endswith(os.path.sep):\n dst += os.path.sep\n return dst.startswith(src)\n\ndef _get_gid(name: str) -> int:\n \"\"\"Returns a gid, given a group name.\"\"\"\n if getgrnam is None or name is None:\n return None\n try:\n result = getgrnam(name)\n except KeyError:\n result = None\n if result is not None:\n return result.gr_gid\n return None\n\ndef _get_uid(name: str) -> int:\n \"\"\"Returns an uid, given a user name.\"\"\"\n if getpwnam is None or name is None:\n return None\n try:\n result = getpwnam(name)\n except KeyError:\n result = None\n if result is not None:\n return result.pw_uid\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py__make_tarball__make_tarball.return.archive_name": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py__make_tarball__make_tarball.return.archive_name", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/shutil.py", "file_name": "shutil.py", "file_type": "text/x-python", "category": "implementation", "start_line": 392, "end_line": 454, "span_ids": ["_make_tarball"], "tokens": 523}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _make_tarball(base_name: str, base_dir: str, compress: str = \"gzip\",\n verbose: bool = False, dry_run: bool = False,\n owner: str = None, group: str = None,\n logger: Any = None) -> str:\n \"\"\"Create a (possibly compressed) tar file from all the files under\n 'base_dir'.\n\n 'compress' must be \"gzip\" (the default), \"bzip2\", or None.\n\n 'owner' and 'group' can be used to define an owner and a group for the\n archive that is being built. If not provided, the current owner and group\n will be used.\n\n The output tar file will be named 'base_name' + \".tar\", possibly plus\n the appropriate compression extension (\".gz\", or \".bz2\").\n\n Returns the output filename.\n \"\"\"\n tar_compression = {'gzip': 'gz', None: ''}\n compress_ext = {'gzip': '.gz'}\n\n if _BZ2_SUPPORTED:\n tar_compression['bzip2'] = 'bz2'\n compress_ext['bzip2'] = '.bz2'\n\n # flags for compression program, each element of list will be an argument\n if compress is not None and compress not in compress_ext.keys():\n raise ValueError(\"bad value for 'compress', or compression format not \"\n \"supported : {0}\".format(compress))\n\n archive_name = base_name + '.tar' + compress_ext.get(compress, '')\n archive_dir = os.path.dirname(archive_name)\n\n if not os.path.exists(archive_dir):\n if logger is not None:\n logger.info(\"creating %s\", archive_dir)\n if not dry_run:\n os.makedirs(archive_dir)\n\n # creating the tarball\n if logger is not None:\n logger.info('Creating tar archive')\n\n uid = _get_uid(owner)\n gid = _get_gid(group)\n\n def _set_uid_gid(tarinfo):\n if gid is not None:\n tarinfo.gid = gid\n tarinfo.gname = group\n if uid is not None:\n tarinfo.uid = uid\n tarinfo.uname = owner\n return tarinfo\n\n if not dry_run:\n tar = tarfile.open(archive_name, 'w|%s' % tar_compression[compress])\n try:\n tar.add(base_dir, filter=_set_uid_gid)\n finally:\n tar.close()\n\n return archive_name", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py__call_external_zip__call_external_zip.try_.except_DistutilsExecError.raise_ExecError_unable_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py__call_external_zip__call_external_zip.try_.except_DistutilsExecError.raise_ExecError_unable_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/shutil.py", "file_name": "shutil.py", "file_type": "text/x-python", "category": "implementation", "start_line": 456, "end_line": 472, "span_ids": ["_call_external_zip"], "tokens": 180}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _call_external_zip(base_dir: str, zip_filename: str, verbose: bool = False,\n dry_run: bool = False) -> None:\n # XXX see if we want to keep an external call here\n if verbose:\n zipoptions = \"-r\"\n else:\n zipoptions = \"-rq\"\n from distutils.errors import DistutilsExecError\n from distutils.spawn import spawn\n try:\n spawn([\"zip\", zipoptions, zip_filename, base_dir], dry_run=dry_run)\n except DistutilsExecError:\n # XXX really should distinguish between \"couldn't find\n # external 'zip' command\" and \"zip failed\".\n raise ExecError((\"unable to create zip file '%s': \"\n \"could neither import the 'zipfile' module nor \"\n \"find a standalone zip utility\") % zip_filename)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py__make_zipfile__make_zipfile.return.zip_filename": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py__make_zipfile__make_zipfile.return.zip_filename", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/shutil.py", "file_name": "shutil.py", "file_type": "text/x-python", "category": "implementation", "start_line": 474, "end_line": 520, "span_ids": ["_make_zipfile"], "tokens": 389}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _make_zipfile(base_name: str, base_dir: str, verbose: bool = False,\n dry_run: bool = False, logger: Any = None) -> str:\n \"\"\"Create a zip file from all the files under 'base_dir'.\n\n The output zip file will be named 'base_name' + \".zip\". Uses either the\n \"zipfile\" Python module (if available) or the InfoZIP \"zip\" utility\n (if installed and found on the default search path). If neither tool is\n available, raises ExecError. Returns the name of the output zip\n file.\n \"\"\"\n zip_filename = base_name + \".zip\"\n archive_dir = os.path.dirname(base_name)\n\n if not os.path.exists(archive_dir):\n if logger is not None:\n logger.info(\"creating %s\", archive_dir)\n if not dry_run:\n os.makedirs(archive_dir)\n\n # If zipfile module is not available, try spawning an external 'zip'\n # command.\n try:\n import zipfile\n except ImportError:\n zipfile = None\n\n if zipfile is None:\n _call_external_zip(base_dir, zip_filename, verbose, dry_run)\n else:\n if logger is not None:\n logger.info(\"creating '%s' and adding '%s' to it\",\n zip_filename, base_dir)\n\n if not dry_run:\n zip = zipfile.ZipFile(zip_filename, \"w\",\n compression=zipfile.ZIP_DEFLATED)\n\n for dirpath, dirnames, filenames in os.walk(base_dir):\n for name in filenames:\n path = os.path.normpath(os.path.join(dirpath, name))\n if os.path.isfile(path):\n zip.write(path, path)\n if logger is not None:\n logger.info(\"adding '%s'\", path)\n zip.close()\n\n return zip_filename", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py__ARCHIVE_FORMATS_get_archive_formats.return.formats": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py__ARCHIVE_FORMATS_get_archive_formats.return.formats", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/shutil.py", "file_name": "shutil.py", "file_type": "text/x-python", "category": "implementation", "start_line": 522, "end_line": 540, "span_ids": ["get_archive_formats", "impl:31"], "tokens": 205}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "_ARCHIVE_FORMATS = {\n 'gztar': (_make_tarball, [('compress', 'gzip')], \"gzip'ed tar-file\"),\n 'tar': (_make_tarball, [('compress', None)], \"uncompressed tar file\"),\n 'zip': (_make_zipfile, [],\"ZIP file\")\n } # type: Dict[str, Tuple[Any, Sequence[Tuple[str, str]], str]]\n\nif _BZ2_SUPPORTED:\n _ARCHIVE_FORMATS['bztar'] = (_make_tarball, [('compress', 'bzip2')],\n \"bzip2'ed tar-file\")\n\ndef get_archive_formats() -> List[Tuple[str, str]]:\n \"\"\"Returns a list of supported formats for archiving and unarchiving.\n\n Each element of the returned sequence is a tuple (name, description)\n \"\"\"\n formats = [(name, registry[2]) for name, registry in\n _ARCHIVE_FORMATS.items()]\n formats.sort()\n return formats", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py_register_archive_format_unregister_archive_format.del__ARCHIVE_FORMATS_name": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py_register_archive_format_unregister_archive_format.del__ARCHIVE_FORMATS_name", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/shutil.py", "file_name": "shutil.py", "file_type": "text/x-python", "category": "implementation", "start_line": 542, "end_line": 566, "span_ids": ["register_archive_format", "unregister_archive_format"], "tokens": 257}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def register_archive_format(name: str, function: Any,\n extra_args: Sequence[Tuple[str, Any]] = None,\n description: str = '') -> None:\n \"\"\"Registers an archive format.\n\n name is the name of the format. function is the callable that will be\n used to create archives. If provided, extra_args is a sequence of\n (name, value) tuples that will be passed as arguments to the callable.\n description can be provided to describe the format, and will be returned\n by the get_archive_formats() function.\n \"\"\"\n if extra_args is None:\n extra_args = []\n if not callable(function):\n raise TypeError('The %s object is not callable' % function)\n if not isinstance(extra_args, (tuple, list)):\n raise TypeError('extra_args needs to be a sequence')\n for element in extra_args:\n if not isinstance(element, (tuple, list)) or len(cast(tuple, element)) !=2 :\n raise TypeError('extra_args elements are : (arg_name, value)')\n\n _ARCHIVE_FORMATS[name] = (function, extra_args, description)\n\ndef unregister_archive_format(name: str) -> None:\n del _ARCHIVE_FORMATS[name]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py_make_archive_make_archive.return.filename": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py_make_archive_make_archive.return.filename", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/shutil.py", "file_name": "shutil.py", "file_type": "text/x-python", "category": "implementation", "start_line": 568, "end_line": 622, "span_ids": ["make_archive"], "tokens": 485}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def make_archive(base_name: str, format: str, root_dir: str = None,\n base_dir: str = None, verbose: bool = False,\n dry_run: bool = False, owner: str = None,\n group: str = None, logger: Any = None) -> str:\n \"\"\"Create an archive file (eg. zip or tar).\n\n 'base_name' is the name of the file to create, minus any format-specific\n extension; 'format' is the archive format: one of \"zip\", \"tar\", \"bztar\"\n or \"gztar\".\n\n 'root_dir' is a directory that will be the root directory of the\n archive; ie. we typically chdir into 'root_dir' before creating the\n archive. 'base_dir' is the directory where we start archiving from;\n ie. 'base_dir' will be the common prefix of all files and\n directories in the archive. 'root_dir' and 'base_dir' both default\n to the current directory. Returns the name of the archive file.\n\n 'owner' and 'group' are used when creating a tar archive. By default,\n uses the current owner and group.\n \"\"\"\n save_cwd = os.getcwd()\n if root_dir is not None:\n if logger is not None:\n logger.debug(\"changing into '%s'\", root_dir)\n base_name = os.path.abspath(base_name)\n if not dry_run:\n os.chdir(root_dir)\n\n if base_dir is None:\n base_dir = os.curdir\n\n kwargs = {'dry_run': dry_run, 'logger': logger}\n\n try:\n format_info = _ARCHIVE_FORMATS[format]\n except KeyError:\n raise ValueError(\"unknown archive format '%s'\" % format)\n\n func = format_info[0]\n for arg, val in format_info[1]:\n kwargs[arg] = val\n\n if format != 'zip':\n kwargs['owner'] = owner\n kwargs['group'] = group\n\n try:\n filename = func(base_name, base_dir, **kwargs)\n finally:\n if root_dir is not None:\n if logger is not None:\n logger.debug(\"changing back to '%s'\", save_cwd)\n os.chdir(save_cwd)\n\n return filename", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py_get_unpack_formats__check_unpack_options.if_not_callable_function_.raise_TypeError_The_regi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py_get_unpack_formats__check_unpack_options.if_not_callable_function_.raise_TypeError_The_regi", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/shutil.py", "file_name": "shutil.py", "file_type": "text/x-python", "category": "implementation", "start_line": 625, "end_line": 652, "span_ids": ["_check_unpack_options", "get_unpack_formats"], "tokens": 242}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_unpack_formats() -> List[Tuple[str, List[str], str]]:\n \"\"\"Returns a list of supported formats for unpacking.\n\n Each element of the returned sequence is a tuple\n (name, extensions, description)\n \"\"\"\n formats = [(name, info[0], info[3]) for name, info in\n _UNPACK_FORMATS.items()]\n formats.sort()\n return formats\n\ndef _check_unpack_options(extensions: List[str], function: Any,\n extra_args: Sequence[Tuple[str, Any]]) -> None:\n \"\"\"Checks what gets registered as an unpacker.\"\"\"\n # first make sure no other unpacker is registered for this extension\n existing_extensions = {} # type: Dict[str, str]\n for name, info in _UNPACK_FORMATS.items():\n for ext in info[0]:\n existing_extensions[ext] = name\n\n for extension in extensions:\n if extension in existing_extensions:\n msg = '%s is already registered for \"%s\"'\n raise RegistryError(msg % (extension,\n existing_extensions[extension]))\n\n if not callable(function):\n raise TypeError('The registered function must be a callable')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py_register_unpack_format_register_unpack_format._UNPACK_FORMATS_name_e": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py_register_unpack_format_register_unpack_format._UNPACK_FORMATS_name_e", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/shutil.py", "file_name": "shutil.py", "file_type": "text/x-python", "category": "implementation", "start_line": 655, "end_line": 676, "span_ids": ["register_unpack_format"], "tokens": 217}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def register_unpack_format(name: str, extensions: List[str], function: Any,\n extra_args: Sequence[Tuple[str, Any]] = None,\n description: str = '') -> None:\n \"\"\"Registers an unpack format.\n\n `name` is the name of the format. `extensions` is a list of extensions\n corresponding to the format.\n\n `function` is the callable that will be\n used to unpack archives. The callable will receive archives to unpack.\n If it's unable to handle an archive, it needs to raise a ReadError\n exception.\n\n If provided, `extra_args` is a sequence of\n (name, value) tuples that will be passed as arguments to the callable.\n description can be provided to describe the format, and will be returned\n by the get_unpack_formats() function.\n \"\"\"\n if extra_args is None:\n extra_args = []\n _check_unpack_options(extensions, function, extra_args)\n _UNPACK_FORMATS[name] = extensions, function, extra_args, description", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py_unregister_unpack_format__unpack_zipfile.None_1.finally_.zip_close_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py_unregister_unpack_format__unpack_zipfile.None_1.finally_.zip_close_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/shutil.py", "file_name": "shutil.py", "file_type": "text/x-python", "category": "implementation", "start_line": 678, "end_line": 723, "span_ids": ["_ensure_directory", "unregister_unpack_format", "_unpack_zipfile"], "tokens": 295}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def unregister_unpack_format(name: str) -> None:\n \"\"\"Removes the pack format from the registery.\"\"\"\n del _UNPACK_FORMATS[name]\n\ndef _ensure_directory(path: str) -> None:\n \"\"\"Ensure that the parent directory of `path` exists\"\"\"\n dirname = os.path.dirname(path)\n if not os.path.isdir(dirname):\n os.makedirs(dirname)\n\ndef _unpack_zipfile(filename: str, extract_dir: str) -> None:\n \"\"\"Unpack zip `filename` to `extract_dir`\n \"\"\"\n try:\n import zipfile\n except ImportError:\n raise ReadError('zlib not supported, cannot unpack this archive.')\n\n if not zipfile.is_zipfile(filename):\n raise ReadError(\"%s is not a zip file\" % filename)\n\n zip = zipfile.ZipFile(filename)\n try:\n for info in zip.infolist():\n name = info.filename\n\n # don't extract absolute paths or ones with .. in them\n if name.startswith('/') or '..' in name:\n continue\n\n target = os.path.join(extract_dir, *name.split('/'))\n if not target:\n continue\n\n _ensure_directory(target)\n if not name.endswith('/'):\n # file\n data = zip.read(info.filename)\n f = open(target,'wb')\n try:\n f.write(data)\n finally:\n f.close()\n del data\n finally:\n zip.close()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py__unpack_tarfile__find_unpack_format.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py__unpack_tarfile__find_unpack_format.return.None", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/shutil.py", "file_name": "shutil.py", "file_type": "text/x-python", "category": "implementation", "start_line": 725, "end_line": 753, "span_ids": ["_unpack_tarfile", "_find_unpack_format", "impl:35"], "tokens": 293}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "try:\n# ... other code\n\ndef _unpack_tarfile(filename: str, extract_dir: str) -> None:\n \"\"\"Unpack tar/tar.gz/tar.bz2 `filename` to `extract_dir`\n \"\"\"\n try:\n tarobj = tarfile.open(filename)\n except tarfile.TarError:\n raise ReadError(\n \"%s is not a compressed or uncompressed tar file\" % filename)\n try:\n tarobj.extractall(extract_dir)\n finally:\n tarobj.close()\n\n_UNPACK_FORMATS = {\n 'gztar': (['.tar.gz', '.tgz'], _unpack_tarfile, [], \"gzip'ed tar-file\"),\n 'tar': (['.tar'], _unpack_tarfile, [], \"uncompressed tar file\"),\n 'zip': (['.zip'], _unpack_zipfile, [], \"ZIP file\")\n } # type: Dict[str, Tuple[List[str], Any, Sequence[Tuple[str, Any]], str]]\n\nif _BZ2_SUPPORTED:\n _UNPACK_FORMATS['bztar'] = (['.bz2'], _unpack_tarfile, [],\n \"bzip2'ed tar-file\")\n\ndef _find_unpack_format(filename: str) -> str:\n for name, info in _UNPACK_FORMATS.items():\n for extension in info[0]:\n if filename.endswith(extension):\n return name\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py_unpack_archive_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/shutil.py_unpack_archive_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/shutil.py", "file_name": "shutil.py", "file_type": "text/x-python", "category": "implementation", "start_line": 755, "end_line": 791, "span_ids": ["unpack_archive"], "tokens": 307}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def unpack_archive(filename: str, extract_dir: str = None,\n format: str = None) -> None:\n \"\"\"Unpack an archive.\n\n `filename` is the name of the archive.\n\n `extract_dir` is the name of the target directory, where the archive\n is unpacked. If not provided, the current working directory is used.\n\n `format` is the archive format: one of \"zip\", \"tar\", or \"gztar\". Or any\n other registered format. If not provided, unpack_archive will use the\n filename extension and see if an unpacker was registered for that\n extension.\n\n In case none is found, a ValueError is raised.\n \"\"\"\n if extract_dir is None:\n extract_dir = os.getcwd()\n\n if format is not None:\n try:\n format_info = _UNPACK_FORMATS[format]\n except KeyError:\n raise ValueError(\"Unknown unpack format '{0}'\".format(format))\n\n func = format_info[1]\n func(filename, extract_dir, **dict(format_info[2]))\n else:\n # we need to look at the registered unpackers supported extensions\n format = _find_unpack_format(filename)\n if format is None:\n raise ReadError(\"Unknown archive format '{0}'\".format(filename))\n\n func = _UNPACK_FORMATS[format][1]\n kwargs = dict(_UNPACK_FORMATS[format][2])\n func(filename, extract_dir, **kwargs)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/tempfile.py__Temporary_files___exists.try_.else_.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/tempfile.py__Temporary_files___exists.try_.else_.return.True", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/tempfile.py", "file_name": "tempfile.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 114, "span_ids": ["_exists", "impl:14", "docstring"], "tokens": 814}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Temporary files.\n\nThis module provides generic, low- and high-level interfaces for\ncreating temporary files and directories. The interfaces listed\nas \"safe\" just below can be used without fear of race conditions.\nThose listed as \"unsafe\" cannot, and are provided for backward\ncompatibility only.\n\nThis module also provides some data items to the user:\n\n TMP_MAX - maximum number of names that will be tried before\n giving up.\n template - the default prefix for all temporary names.\n You may change this to control the default prefix.\n tempdir - If this is set to a string before the first use of\n any routine from this module, it will be considered as\n another candidate location to store temporary files.\n\"\"\"\n\n__all__ = [\n \"NamedTemporaryFile\", \"TemporaryFile\", # high level safe interfaces\n \"SpooledTemporaryFile\", \"TemporaryDirectory\",\n \"mkstemp\", \"mkdtemp\", # low level safe interfaces\n \"mktemp\", # deprecated unsafe interface\n \"TMP_MAX\", \"gettempprefix\", # constants\n \"tempdir\", \"gettempdir\"\n ]\n\n\n# Imports.\n\nimport warnings as _warnings\nimport sys as _sys\nimport io as _io\nimport os as _os\nimport errno as _errno\nfrom random import Random as _Random\n\nfrom typing import (\n Any as _Any, Callable as _Callable, Iterator as _Iterator,\n List as _List, Tuple as _Tuple, Dict as _Dict, Iterable as _Iterable,\n IO as _IO, cast as _cast, Optional as _Optional, Type as _Type,\n)\nfrom typing_extensions import Literal\nfrom types import TracebackType as _TracebackType\n\ntry:\n import fcntl as _fcntl\nexcept ImportError:\n def _set_cloexec(fd: int) -> None:\n pass\nelse:\n def _set_cloexec(fd: int) -> None:\n try:\n flags = _fcntl.fcntl(fd, _fcntl.F_GETFD, 0)\n except IOError:\n pass\n else:\n # flags read successfully, modify\n flags |= _fcntl.FD_CLOEXEC\n _fcntl.fcntl(fd, _fcntl.F_SETFD, flags)\n\n\ntry:\n import _thread\n _allocate_lock = _thread.allocate_lock # type: _Callable[[], _Any]\nexcept ImportError:\n import _dummy_thread\n _allocate_lock = _dummy_thread.allocate_lock\n\n_text_openflags = _os.O_RDWR | _os.O_CREAT | _os.O_EXCL\nif hasattr(_os, 'O_NOINHERIT'):\n _text_openflags |= _os.O_NOINHERIT\nif hasattr(_os, 'O_NOFOLLOW'):\n _text_openflags |= _os.O_NOFOLLOW\n\n_bin_openflags = _text_openflags\nif hasattr(_os, 'O_BINARY'):\n _bin_openflags |= _os.O_BINARY\n\nif hasattr(_os, 'TMP_MAX'):\n TMP_MAX = _os.TMP_MAX\nelse:\n TMP_MAX = 10000\n\ntemplate = \"tmp\"\n\n# Internal routines.\n\n_once_lock = _allocate_lock()\n\nif hasattr(_os, \"lstat\"):\n _stat = _os.lstat # type: _Callable[[str], object]\nelif hasattr(_os, \"stat\"):\n _stat = _os.stat\nelse:\n # Fallback. All we need is something that raises os.error if the\n # file doesn't exist.\n def __stat(fn: str) -> object:\n try:\n f = open(fn)\n except IOError:\n raise _os.error()\n f.close()\n return None\n _stat = __stat\n\ndef _exists(fn: str) -> bool:\n try:\n _stat(fn)\n except _os.error:\n return False\n else:\n return True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/tempfile.py__RandomNameSequence__RandomNameSequence.__next__.return._join_letters_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/tempfile.py__RandomNameSequence__RandomNameSequence.__next__.return._join_letters_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/tempfile.py", "file_name": "tempfile.py", "file_type": "text/x-python", "category": "implementation", "start_line": 116, "end_line": 141, "span_ids": ["_RandomNameSequence.rng", "_RandomNameSequence", "_RandomNameSequence.__iter__", "_RandomNameSequence.__next__"], "tokens": 202}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class _RandomNameSequence(_Iterator[str]):\n \"\"\"An instance of _RandomNameSequence generates an endless\n sequence of unpredictable strings which can safely be incorporated\n into file names. Each string is six characters long. Multiple\n threads can safely use the same instance at the same time.\n\n _RandomNameSequence is an iterator.\"\"\"\n\n characters = \"abcdefghijklmnopqrstuvwxyz0123456789_\"\n\n @property\n def rng(self) -> _Random:\n cur_pid = _os.getpid()\n if cur_pid != getattr(self, '_rng_pid', None):\n self._rng = _Random()\n self._rng_pid = cur_pid\n return self._rng\n\n def __iter__(self) -> _Iterator[str]:\n return self\n\n def __next__(self) -> str:\n c = self.characters\n choose = self.rng.choice\n letters = [choose(c) for dummy in \"123456\"]\n return ''.join(letters)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/tempfile.py__candidate_tempdir_list__candidate_tempdir_list.return.dirlist": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/tempfile.py__candidate_tempdir_list__candidate_tempdir_list.return.dirlist", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/tempfile.py", "file_name": "tempfile.py", "file_type": "text/x-python", "category": "implementation", "start_line": 143, "end_line": 166, "span_ids": ["_candidate_tempdir_list"], "tokens": 196}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _candidate_tempdir_list() -> _List[str]:\n \"\"\"Generate a list of candidate temporary directories which\n _get_default_tempdir will try.\"\"\"\n\n dirlist = [] # type: _List[str]\n\n # First, try the environment.\n for envname in 'TMPDIR', 'TEMP', 'TMP':\n dirname = _os.getenv(envname)\n if dirname: dirlist.append(dirname)\n\n # Failing that, try OS-specific locations.\n if _os.name == 'nt':\n dirlist.extend([ r'c:\\temp', r'c:\\tmp', r'\\temp', r'\\tmp' ])\n else:\n dirlist.extend([ '/tmp', '/var/tmp', '/usr/tmp' ])\n\n # As a last resort, the current directory.\n try:\n dirlist.append(_os.getcwd())\n except (AttributeError, _os.error):\n dirlist.append(_os.curdir)\n\n return dirlist", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/tempfile.py__get_default_tempdir__get_default_tempdir.raise_IOError__errno_ENOE": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/tempfile.py__get_default_tempdir__get_default_tempdir.raise_IOError__errno_ENOE", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/tempfile.py", "file_name": "tempfile.py", "file_type": "text/x-python", "category": "implementation", "start_line": 168, "end_line": 200, "span_ids": ["_get_default_tempdir"], "tokens": 300}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _get_default_tempdir() -> str:\n \"\"\"Calculate the default directory to use for temporary files.\n This routine should be called exactly once.\n\n We determine whether or not a candidate temp dir is usable by\n trying to create and write to a file in that directory. If this\n is successful, the test file is deleted. To prevent denial of\n service, the name of the test file must be randomized.\"\"\"\n\n namer = _RandomNameSequence()\n dirlist = _candidate_tempdir_list()\n\n for dir in dirlist:\n if dir != _os.curdir:\n dir = _os.path.normcase(_os.path.abspath(dir))\n # Try only a few names per directory.\n for seq in range(100):\n name = next(namer)\n filename = _os.path.join(dir, name)\n try:\n fd = _os.open(filename, _bin_openflags, 0o600)\n fp = _io.open(fd, 'wb')\n fp.write(b'blat')\n fp.close()\n _os.unlink(filename)\n fp = fd = None\n return dir\n except (OSError, IOError) as e:\n if e.args[0] != _errno.EEXIST:\n break # no point trying more names in this directory\n pass\n raise IOError(_errno.ENOENT,\n \"No usable temporary directory found in %s\" % dirlist)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/tempfile.py__name_sequence_gettempdir.return.tempdir": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/tempfile.py__name_sequence_gettempdir.return.tempdir", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/tempfile.py", "file_name": "tempfile.py", "file_type": "text/x-python", "category": "implementation", "start_line": 202, "end_line": 257, "span_ids": ["_get_candidate_names", "gettempprefix", "impl:43", "impl:41", "_mkstemp_inner", "gettempdir"], "tokens": 358}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "_name_sequence = None # type: _RandomNameSequence\n\ndef _get_candidate_names() -> _RandomNameSequence:\n \"\"\"Common setup sequence for all user-callable interfaces.\"\"\"\n\n global _name_sequence\n if _name_sequence is None:\n _once_lock.acquire()\n try:\n if _name_sequence is None:\n _name_sequence = _RandomNameSequence()\n finally:\n _once_lock.release()\n return _name_sequence\n\n\ndef _mkstemp_inner(dir: str, pre: str, suf: str,\n flags: int) -> _Tuple[int, str]:\n \"\"\"Code common to mkstemp, TemporaryFile, and NamedTemporaryFile.\"\"\"\n\n names = _get_candidate_names()\n\n for seq in range(TMP_MAX):\n name = next(names)\n file = _os.path.join(dir, pre + name + suf)\n try:\n fd = _os.open(file, flags, 0o600)\n _set_cloexec(fd)\n return (fd, _os.path.abspath(file))\n except OSError as e:\n if e.errno == _errno.EEXIST:\n continue # try again\n raise\n\n raise IOError(_errno.EEXIST, \"No usable temporary file name found\")\n\n\n# User visible interfaces.\n\ndef gettempprefix() -> str:\n \"\"\"Accessor for tempdir.template.\"\"\"\n return template\n\ntempdir = None # type: str\n\ndef gettempdir() -> str:\n \"\"\"Accessor for tempfile.tempdir.\"\"\"\n global tempdir\n if tempdir is None:\n _once_lock.acquire()\n try:\n if tempdir is None:\n tempdir = _get_default_tempdir()\n finally:\n _once_lock.release()\n return tempdir", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/tempfile.py_mkstemp_mkstemp.return._mkstemp_inner_dir_prefi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/tempfile.py_mkstemp_mkstemp.return._mkstemp_inner_dir_prefi", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/tempfile.py", "file_name": "tempfile.py", "file_type": "text/x-python", "category": "implementation", "start_line": 259, "end_line": 294, "span_ids": ["mkstemp"], "tokens": 325}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def mkstemp(suffix: str = \"\", prefix: str = template, dir: str = None,\n text: bool = False) -> _Tuple[int, str]:\n \"\"\"User-callable function to create and return a unique temporary\n file. The return value is a pair (fd, name) where fd is the\n file descriptor returned by os.open, and name is the filename.\n\n If 'suffix' is specified, the file name will end with that suffix,\n otherwise there will be no suffix.\n\n If 'prefix' is specified, the file name will begin with that prefix,\n otherwise a default prefix is used.\n\n If 'dir' is specified, the file will be created in that directory,\n otherwise a default directory is used.\n\n If 'text' is specified and true, the file is opened in text\n mode. Else (the default) the file is opened in binary mode. On\n some operating systems, this makes no difference.\n\n The file is readable and writable only by the creating user ID.\n If the operating system uses permission bits to indicate whether a\n file is executable, the file is executable by no one. The file\n descriptor is not inherited by children of this process.\n\n Caller is responsible for deleting the file when done with it.\n \"\"\"\n\n if dir is None:\n dir = gettempdir()\n\n if text:\n flags = _text_openflags\n else:\n flags = _bin_openflags\n\n return _mkstemp_inner(dir, prefix, suffix, flags)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/tempfile.py_mkdtemp_mkdtemp.raise_IOError__errno_EEXI": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/tempfile.py_mkdtemp_mkdtemp.raise_IOError__errno_EEXI", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/tempfile.py", "file_name": "tempfile.py", "file_type": "text/x-python", "category": "implementation", "start_line": 297, "end_line": 326, "span_ids": ["mkdtemp"], "tokens": 218}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def mkdtemp(suffix: str = \"\", prefix: str = template, dir: str = None) -> str:\n \"\"\"User-callable function to create and return a unique temporary\n directory. The return value is the pathname of the directory.\n\n Arguments are as for mkstemp, except that the 'text' argument is\n not accepted.\n\n The directory is readable, writable, and searchable only by the\n creating user.\n\n Caller is responsible for deleting the directory when done with it.\n \"\"\"\n\n if dir is None:\n dir = gettempdir()\n\n names = _get_candidate_names()\n\n for seq in range(TMP_MAX):\n name = next(names)\n file = _os.path.join(dir, prefix + name + suffix)\n try:\n _os.mkdir(file, 0o700)\n return file\n except OSError as e:\n if e.errno == _errno.EEXIST:\n continue # try again\n raise\n\n raise IOError(_errno.EEXIST, \"No usable temporary directory name found\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/tempfile.py_mktemp_mktemp.raise_IOError__errno_EEXI": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/tempfile.py_mktemp_mktemp.raise_IOError__errno_EEXI", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/tempfile.py", "file_name": "tempfile.py", "file_type": "text/x-python", "category": "implementation", "start_line": 328, "end_line": 355, "span_ids": ["mktemp"], "tokens": 237}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def mktemp(suffix: str = \"\", prefix: str = template, dir: str = None) -> str:\n \"\"\"User-callable function to return a unique temporary file name. The\n file is not created.\n\n Arguments are as for mkstemp, except that the 'text' argument is\n not accepted.\n\n This function is unsafe and should not be used. The file name\n refers to a file that did not exist at some point, but by the time\n you get around to creating it, someone else may have beaten you to\n the punch.\n \"\"\"\n\n## from warnings import warn as _warn\n## _warn(\"mktemp is a potential security risk to your program\",\n## RuntimeWarning, stacklevel=2)\n\n if dir is None:\n dir = gettempdir()\n\n names = _get_candidate_names()\n for seq in range(TMP_MAX):\n name = next(names)\n file = _os.path.join(dir, prefix + name + suffix)\n if not _exists(file):\n return file\n\n raise IOError(_errno.EEXIST, \"No usable temporary filename found\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/tempfile.py__TemporaryFileWrapper__TemporaryFileWrapper.if__os_name_nt_.else_.__exit__.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/tempfile.py__TemporaryFileWrapper__TemporaryFileWrapper.if__os_name_nt_.else_.__exit__.return.False", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/tempfile.py", "file_name": "tempfile.py", "file_type": "text/x-python", "category": "implementation", "start_line": 358, "end_line": 428, "span_ids": ["_TemporaryFileWrapper.__init__", "_TemporaryFileWrapper.__enter__", "_TemporaryFileWrapper", "_TemporaryFileWrapper:3", "_TemporaryFileWrapper.__iter__", "_TemporaryFileWrapper.__getattr__"], "tokens": 639}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class _TemporaryFileWrapper:\n \"\"\"Temporary file wrapper\n\n This class provides a wrapper around files opened for\n temporary use. In particular, it seeks to automatically\n remove the file when it is no longer needed.\n \"\"\"\n\n def __init__(self, file: _IO[_Any], name: str,\n delete: bool = True) -> None:\n self.file = file\n self.name = name\n self.close_called = False\n self.delete = delete\n\n if _os.name != 'nt':\n # Cache the unlinker so we don't get spurious errors at\n # shutdown when the module-level \"os\" is None'd out. Note\n # that this must be referenced as self.unlink, because the\n # name TemporaryFileWrapper may also get None'd out before\n # __del__ is called.\n self.unlink = _os.unlink\n\n def __getattr__(self, name: str) -> _Any:\n # Attribute lookups are delegated to the underlying file\n # and cached for non-numeric results\n # (i.e. methods are cached, closed and friends are not)\n file = _cast(_Any, self).__dict__['file'] # type: _IO[_Any]\n a = getattr(file, name)\n if not isinstance(a, int):\n setattr(self, name, a)\n return a\n\n # The underlying __enter__ method returns the wrong object\n # (self.file) so override it to return the wrapper\n def __enter__(self) -> '_TemporaryFileWrapper':\n self.file.__enter__()\n return self\n\n # iter() doesn't use __getattr__ to find the __iter__ method\n def __iter__(self) -> _Iterator[_Any]:\n return iter(self.file)\n\n # NT provides delete-on-close as a primitive, so we don't need\n # the wrapper to do anything special. We still use it so that\n # file.name is useful (i.e. not \"(fdopen)\") with NamedTemporaryFile.\n if _os.name != 'nt':\n def close(self) -> None:\n if not self.close_called:\n self.close_called = True\n self.file.close()\n if self.delete:\n self.unlink(self.name)\n\n def __del__(self) -> None:\n self.close()\n\n # Need to trap __exit__ as well to ensure the file gets\n # deleted when used in a with statement\n def __exit__(self, exc: _Type[BaseException], value: BaseException,\n tb: _Optional[_TracebackType]) -> bool:\n result = self.file.__exit__(exc, value, tb)\n self.close()\n return result\n else:\n def __exit__(self, # type: ignore[misc]\n exc: _Type[BaseException],\n value: BaseException,\n tb: _Optional[_TracebackType]) -> Literal[False]:\n self.file.__exit__(exc, value, tb)\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/tempfile.py_NamedTemporaryFile_NamedTemporaryFile.return._cast__IO__Any__Tempora": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/tempfile.py_NamedTemporaryFile_NamedTemporaryFile.return._cast__IO__Any__Tempora", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/tempfile.py", "file_name": "tempfile.py", "file_type": "text/x-python", "category": "implementation", "start_line": 431, "end_line": 464, "span_ids": ["NamedTemporaryFile"], "tokens": 375}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def NamedTemporaryFile(mode: str = 'w+b', buffering: int = -1,\n encoding: str = None, newline: str = None,\n suffix: str = \"\", prefix: str = template,\n dir: str = None, delete: bool = True) -> _IO[_Any]:\n \"\"\"Create and return a temporary file.\n Arguments:\n 'prefix', 'suffix', 'dir' -- as for mkstemp.\n 'mode' -- the mode argument to io.open (default \"w+b\").\n 'buffering' -- the buffer size argument to io.open (default -1).\n 'encoding' -- the encoding argument to io.open (default None)\n 'newline' -- the newline argument to io.open (default None)\n 'delete' -- whether the file is deleted on close (default True).\n The file is created as mkstemp() would do it.\n\n Returns an object with a file-like interface; the name of the file\n is accessible as file.name. The file will be automatically deleted\n when it is closed unless the 'delete' argument is set to False.\n \"\"\"\n\n if dir is None:\n dir = gettempdir()\n\n flags = _bin_openflags\n\n # Setting O_TEMPORARY in the flags causes the OS to delete\n # the file when it is closed. This is only supported by Windows.\n if _os.name == 'nt' and delete:\n flags |= _os.O_TEMPORARY\n\n (fd, name) = _mkstemp_inner(dir, prefix, suffix, flags)\n file = _io.open(fd, mode, buffering=buffering,\n newline=newline, encoding=encoding)\n\n return _cast(_IO[_Any], _TemporaryFileWrapper(file, name, delete))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/tempfile.py_if__os_name_posix_or_if__os_name_posix_or.else_.TemporaryFile._TemporaryFile": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/tempfile.py_if__os_name_posix_or_if__os_name_posix_or.else_.TemporaryFile._TemporaryFile", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/tempfile.py", "file_name": "tempfile.py", "file_type": "text/x-python", "category": "implementation", "start_line": 466, "end_line": 502, "span_ids": ["impl:45"], "tokens": 351}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "if _os.name != 'posix' or _sys.platform == 'cygwin':\n # On non-POSIX and Cygwin systems, assume that we cannot unlink a file\n # while it is open.\n TemporaryFile = NamedTemporaryFile\n\nelse:\n def _TemporaryFile(mode: str = 'w+b', buffering: int = -1,\n encoding: str = None, newline: str = None,\n suffix: str = \"\", prefix: str = template,\n dir: str = None, delete: bool = True) -> _IO[_Any]:\n \"\"\"Create and return a temporary file.\n Arguments:\n 'prefix', 'suffix', 'dir' -- as for mkstemp.\n 'mode' -- the mode argument to io.open (default \"w+b\").\n 'buffering' -- the buffer size argument to io.open (default -1).\n 'encoding' -- the encoding argument to io.open (default None)\n 'newline' -- the newline argument to io.open (default None)\n The file is created as mkstemp() would do it.\n\n Returns an object with a file-like interface. The file has no\n name, and will cease to exist when it is closed.\n \"\"\"\n\n if dir is None:\n dir = gettempdir()\n\n flags = _bin_openflags\n\n (fd, name) = _mkstemp_inner(dir, prefix, suffix, flags)\n try:\n _os.unlink(name)\n return _io.open(fd, mode, buffering=buffering,\n newline=newline, encoding=encoding)\n except:\n _os.close(fd)\n raise\n TemporaryFile = _TemporaryFile", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/tempfile.py_SpooledTemporaryFile_SpooledTemporaryFile.seek.self__file_seek_offset_w": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/tempfile.py_SpooledTemporaryFile_SpooledTemporaryFile.seek.self__file_seek_offset_w", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/tempfile.py", "file_name": "tempfile.py", "file_type": "text/x-python", "category": "implementation", "start_line": 504, "end_line": 614, "span_ids": ["SpooledTemporaryFile.mode", "SpooledTemporaryFile.__exit__", "SpooledTemporaryFile.readline", "SpooledTemporaryFile.close", "SpooledTemporaryFile.__init__", "SpooledTemporaryFile.rollover", "SpooledTemporaryFile.flush", "SpooledTemporaryFile.readlines", "SpooledTemporaryFile.closed", "SpooledTemporaryFile.fileno", "SpooledTemporaryFile.__iter__", "SpooledTemporaryFile.newlines", "SpooledTemporaryFile._check", "SpooledTemporaryFile.read", "SpooledTemporaryFile.name", "SpooledTemporaryFile.isatty", "SpooledTemporaryFile.seek", "SpooledTemporaryFile", "SpooledTemporaryFile.__enter__", "SpooledTemporaryFile.encoding"], "tokens": 837}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SpooledTemporaryFile:\n \"\"\"Temporary file wrapper, specialized to switch from\n StringIO to a real file when it exceeds a certain size or\n when a fileno is needed.\n \"\"\"\n _rolled = False\n _file = None # type: _Any # BytesIO, StringIO or TemporaryFile\n\n def __init__(self, max_size: int = 0, mode: str = 'w+b',\n buffering: int = -1, encoding: str = None,\n newline: str = None, suffix: str = \"\",\n prefix: str = template, dir: str = None) -> None:\n if 'b' in mode:\n self._file = _io.BytesIO()\n else:\n # Setting newline=\"\\n\" avoids newline translation;\n # this is important because otherwise on Windows we'd\n # hget double newline translation upon rollover().\n self._file = _io.StringIO(newline=\"\\n\")\n self._max_size = max_size\n self._rolled = False\n self._TemporaryFileArgs = {\n 'mode': mode, 'buffering': buffering,\n 'suffix': suffix, 'prefix': prefix,\n 'encoding': encoding, 'newline': newline,\n 'dir': dir} # type: _Dict[str, _Any]\n\n def _check(self, file: _IO[_Any]) -> None:\n if self._rolled: return\n max_size = self._max_size\n if max_size and file.tell() > max_size:\n self.rollover()\n\n def rollover(self) -> None:\n if self._rolled: return\n file = self._file\n newfile = self._file = TemporaryFile(**self._TemporaryFileArgs)\n self._TemporaryFileArgs = None\n\n newfile.write(file.getvalue())\n newfile.seek(file.tell(), 0)\n\n self._rolled = True\n\n # The method caching trick from NamedTemporaryFile\n # won't work here, because _file may change from a\n # _StringIO instance to a real file. So we list\n # all the methods directly.\n\n # Context management protocol\n def __enter__(self) -> 'SpooledTemporaryFile':\n if self._file.closed:\n raise ValueError(\"Cannot enter context with closed file\")\n return self\n\n def __exit__(self, exc: type, value: BaseException,\n tb: _TracebackType) -> Literal[False]:\n self._file.close()\n return False\n\n # file protocol\n def __iter__(self) -> _Iterable[_Any]:\n return self._file.__iter__()\n\n def close(self) -> None:\n self._file.close()\n\n @property\n def closed(self) -> bool:\n return self._file.closed\n\n @property\n def encoding(self) -> str:\n return self._file.encoding\n\n def fileno(self) -> int:\n self.rollover()\n return self._file.fileno()\n\n def flush(self) -> None:\n self._file.flush()\n\n def isatty(self) -> bool:\n return self._file.isatty()\n\n @property\n def mode(self) -> str:\n return self._file.mode\n\n @property\n def name(self) -> str:\n return self._file.name\n\n @property\n def newlines(self) -> _Any:\n return self._file.newlines\n\n #def next(self):\n # return self._file.next\n\n def read(self, n: int = -1) -> _Any:\n return self._file.read(n)\n\n def readline(self, limit: int = -1) -> _Any:\n return self._file.readline(limit)\n\n def readlines(self, *args) -> _List[_Any]:\n return self._file.readlines(*args)\n\n def seek(self, offset: int, whence: int = 0) -> None:\n self._file.seek(offset, whence)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/tempfile.py_SpooledTemporaryFile.softspace_SpooledTemporaryFile._return_self__file_xr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/tempfile.py_SpooledTemporaryFile.softspace_SpooledTemporaryFile._return_self__file_xr", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/tempfile.py", "file_name": "tempfile.py", "file_type": "text/x-python", "category": "implementation", "start_line": 616, "end_line": 638, "span_ids": ["SpooledTemporaryFile.tell", "SpooledTemporaryFile.writelines", "SpooledTemporaryFile.truncate", "SpooledTemporaryFile.softspace", "SpooledTemporaryFile.write"], "tokens": 172}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SpooledTemporaryFile:\n\n @property\n def softspace(self) -> bool:\n return self._file.softspace\n\n def tell(self) -> int:\n return self._file.tell()\n\n def truncate(self) -> None:\n self._file.truncate()\n\n def write(self, s: _Any) -> int:\n file = self._file # type: _IO[_Any]\n rv = file.write(s)\n self._check(file)\n return rv\n\n def writelines(self, iterable: _Iterable[_Any]) -> None:\n file = self._file # type: _IO[_Any]\n file.writelines(iterable)\n self._check(file)\n\n #def xreadlines(self, *args) -> _Any:\n # return self._file.xreadlines(*args)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/tempfile.py_TemporaryDirectory_TemporaryDirectory.__enter__.return.self_name": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/tempfile.py_TemporaryDirectory_TemporaryDirectory.__enter__.return.self_name", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/tempfile.py", "file_name": "tempfile.py", "file_type": "text/x-python", "category": "implementation", "start_line": 641, "end_line": 676, "span_ids": ["TemporaryDirectory.__repr__", "TemporaryDirectory.__enter__", "TemporaryDirectory.__init__", "TemporaryDirectory"], "tokens": 319}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TemporaryDirectory(object):\n \"\"\"Create and return a temporary directory. This has the same\n behavior as mkdtemp but can be used as a context manager. For\n example:\n\n with TemporaryDirectory() as tmpdir:\n ...\n\n Upon exiting the context, the directory and everything contained\n in it are removed.\n \"\"\"\n\n def __init__(self, suffix: str = \"\", prefix: str = template,\n dir: str = None) -> None:\n self._closed = False\n self.name = None # type: str # Handle mkdtemp throwing an exception\n self.name = mkdtemp(suffix, prefix, dir)\n\n # XXX (ncoghlan): The following code attempts to make\n # this class tolerant of the module nulling out process\n # that happens during CPython interpreter shutdown\n # Alas, it doesn't actually manage it. See issue #10188\n self._listdir = _os.listdir\n self._path_join = _os.path.join\n self._isdir = _os.path.isdir\n self._islink = _os.path.islink\n self._remove = _os.remove\n self._rmdir = _os.rmdir\n self._os_error = _os.error\n self._warn = _warnings.warn\n\n def __repr__(self) -> str:\n return \"<{} {!r}>\".format(self.__class__.__name__, self.name)\n\n def __enter__(self) -> str:\n return self.name", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/tempfile.py_TemporaryDirectory.cleanup_TemporaryDirectory.__del__.self_cleanup__warn_True_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/tempfile.py_TemporaryDirectory.cleanup_TemporaryDirectory.__del__.self_cleanup__warn_True_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/tempfile.py", "file_name": "tempfile.py", "file_type": "text/x-python", "category": "implementation", "start_line": 678, "end_line": 703, "span_ids": ["TemporaryDirectory.__exit__", "TemporaryDirectory.cleanup", "TemporaryDirectory.__del__"], "tokens": 219}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TemporaryDirectory(object):\n\n def cleanup(self, _warn: bool = False) -> None:\n if self.name and not self._closed:\n try:\n self._rmtree(self.name)\n except (TypeError, AttributeError) as ex:\n # Issue #10188: Emit a warning on stderr\n # if the directory could not be cleaned\n # up due to missing globals\n if \"None\" not in str(ex):\n raise\n print(\"ERROR: {!r} while cleaning up {!r}\".format(ex, self,),\n file=_sys.stderr)\n return\n self._closed = True\n if _warn:\n self._warn(\"Implicitly cleaning up {!r}\".format(self),\n ResourceWarning)\n\n def __exit__(self, exc: type, value: BaseException,\n tb: _TracebackType) -> Literal[False]:\n self.cleanup()\n return False\n\n def __del__(self) -> None:\n # Issue a ResourceWarning if implicit cleanup needed\n self.cleanup(_warn=True)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/tempfile.py_TemporaryDirectory._rmtree_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/tempfile.py_TemporaryDirectory._rmtree_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/tempfile.py", "file_name": "tempfile.py", "file_type": "text/x-python", "category": "implementation", "start_line": 705, "end_line": 725, "span_ids": ["TemporaryDirectory._rmtree"], "tokens": 162}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TemporaryDirectory(object):\n\n def _rmtree(self, path: str) -> None:\n # Essentially a stripped down version of shutil.rmtree. We can't\n # use globals because they may be None'ed out at shutdown.\n for name in self._listdir(path):\n fullname = self._path_join(path, name)\n try:\n isdir = self._isdir(fullname) and not self._islink(fullname)\n except self._os_error:\n isdir = False\n if isdir:\n self._rmtree(fullname)\n else:\n try:\n self._remove(fullname)\n except self._os_error:\n pass\n try:\n self._rmdir(path)\n except self._os_error:\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/subprocessdata/fd_status.py__When_called_as_a_scrip_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/subprocessdata/fd_status.py__When_called_as_a_scrip_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/subprocessdata/fd_status.py", "file_name": "fd_status.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 25, "span_ids": ["docstring"], "tokens": 149}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"When called as a script, print a comma-separated list of the open\nfile descriptors on stdout.\"\"\"\n\nimport errno\nimport os\n\ntry:\n _MAXFD = os.sysconf(\"SC_OPEN_MAX\")\nexcept:\n _MAXFD = 256\n\nif __name__ == \"__main__\":\n fds = []\n for fd in range(0, _MAXFD):\n try:\n st = os.fstat(fd)\n except OSError as e:\n if e.errno == errno.EBADF:\n continue\n raise\n # Ignore Solaris door files\n if st.st_mode & 0xF000 != 0xd000:\n fds.append(fd)\n print(','.join(map(str, fds)))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/subprocessdata/input_reader.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/subprocessdata/input_reader.py__", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/subprocessdata/input_reader.py", "file_name": "input_reader.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 8, "span_ids": ["docstring"], "tokens": 31}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"When called as a script, consumes the input\"\"\"\n\nimport sys\n\nif __name__ == \"__main__\":\n for line in sys.stdin:\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/subprocessdata/qcat.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/subprocessdata/qcat.py__", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/subprocessdata/qcat.py", "file_name": "qcat.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 8, "span_ids": ["docstring"], "tokens": 38}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"When ran as a script, simulates cat with no arguments.\"\"\"\n\nimport sys\n\nif __name__ == \"__main__\":\n for line in sys.stdin:\n sys.stdout.write(line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/subprocessdata/qgrep.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/subprocessdata/qgrep.py__", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/subprocessdata/qgrep.py", "file_name": "qgrep.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 11, "span_ids": ["docstring"], "tokens": 58}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"When called with a single argument, simulated fgrep with a single\nargument and no options.\"\"\"\n\nimport sys\n\nif __name__ == \"__main__\":\n pattern = sys.argv[1]\n for line in sys.stdin:\n if pattern in line:\n sys.stdout.write(line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/subprocessdata/sigchild_ignore.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/subprocessdata/sigchild_ignore.py__", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/subprocessdata/sigchild_ignore.py", "file_name": "sigchild_ignore.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 7, "span_ids": ["imports"], "tokens": 93}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import signal, subprocess, sys\n# On Linux this causes os.waitpid to fail with OSError as the OS has already\n# reaped our child process. The wait() passing the OSError on to the caller\n# and causing us to exit with an error is what we are testing against.\nsignal.signal(signal.SIGCHLD, signal.SIG_IGN)\nsubprocess.Popen([sys.executable, '-c', 'print(\"albatross\")']).wait()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py__Supporting_definitions_import_module.with__ignore_deprecated_i.try_.except_ImportError_as_msg.raise_unittest_SkipTest_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py__Supporting_definitions_import_module.with__ignore_deprecated_i.try_.except_ImportError_as_msg.raise_unittest_SkipTest_s", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/support.py", "file_name": "support.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 95, "span_ids": ["import_module", "Error", "TestFailed", "ResourceDenied", "_ignore_deprecated_imports", "docstring"], "tokens": 703}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Supporting definitions for the Python regression tests.\"\"\"\n\nif __name__ != 'test.support':\n raise ImportError('support must be imported from the test package')\n\nimport contextlib\nimport errno\nimport functools\nimport gc\nimport socket\nimport sys\nimport os\nimport platform\nimport shutil\nimport warnings\nimport unittest\nimport importlib\nimport collections\nimport re\nimport subprocess\nimport imp\nimport time\nimport sysconfig\nimport fnmatch\nimport logging.handlers\n\nimport _thread, threading\nfrom typing import Any, Dict, cast\n#try:\n# import multiprocessing.process\n#except ImportError:\n# multiprocessing = None\n\n\n__all__ = [\n \"Error\", \"TestFailed\", \"ResourceDenied\", \"import_module\",\n \"verbose\", \"use_resources\", \"max_memuse\", \"record_original_stdout\",\n \"get_original_stdout\", \"unload\", \"unlink\", \"rmtree\", \"forget\",\n \"is_resource_enabled\", \"requires\", \"requires_mac_ver\",\n \"find_unused_port\", \"bind_port\",\n \"fcmp\", \"is_jython\", \"TESTFN\", \"HOST\", \"FUZZ\", \"SAVEDCWD\", \"temp_cwd\",\n \"findfile\", \"sortdict\", \"check_syntax_error\", \"open_urlresource\",\n \"check_warnings\", \"CleanImport\", \"EnvironmentVarGuard\",\n \"TransientResource\", \"captured_output\", \"captured_stdout\",\n \"captured_stdin\", \"captured_stderr\",\n \"time_out\", \"socket_peer_reset\", \"ioerror_peer_reset\",\n \"run_with_locale\", 'temp_umask', \"transient_internet\",\n \"set_memlimit\", \"bigmemtest\", \"bigaddrspacetest\", \"BasicTestRunner\",\n \"run_unittest\", \"run_doctest\", \"threading_setup\", \"threading_cleanup\",\n \"reap_children\", \"cpython_only\", \"check_impl_detail\", \"get_attribute\",\n \"swap_item\", \"swap_attr\", \"requires_IEEE_754\",\n \"TestHandler\", \"Matcher\", \"can_symlink\", \"skip_unless_symlink\",\n \"import_fresh_module\", \"failfast\",\n ]\n\nclass Error(Exception):\n \"\"\"Base class for regression test exceptions.\"\"\"\n\nclass TestFailed(Error):\n \"\"\"Test failed.\"\"\"\n\nclass ResourceDenied(unittest.SkipTest):\n \"\"\"Test skipped because it requested a disallowed resource.\n\n This is raised when a test calls requires() for a resource that\n has not be enabled. It is used to distinguish between expected\n and unexpected skips.\n \"\"\"\n\n@contextlib.contextmanager\ndef _ignore_deprecated_imports(ignore=True):\n \"\"\"Context manager to suppress package and module deprecation\n warnings when importing them.\n\n If ignore is False, this context manager has no effect.\"\"\"\n if ignore:\n with warnings.catch_warnings():\n warnings.filterwarnings(\"ignore\", \".+ (module|package)\",\n DeprecationWarning)\n yield None\n else:\n yield None\n\n\ndef import_module(name, deprecated=False):\n \"\"\"Import and return the module to be tested, raising SkipTest if\n it is not available.\n\n If deprecated is True, any module or package deprecation messages\n will be suppressed.\"\"\"\n with _ignore_deprecated_imports(deprecated):\n try:\n return importlib.import_module(name)\n except ImportError as msg:\n raise unittest.SkipTest(str(msg))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py__save_and_remove_module__save_and_block_module.return.saved": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py__save_and_remove_module__save_and_block_module.return.saved", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/support.py", "file_name": "support.py", "file_type": "text/x-python", "category": "test", "start_line": 98, "end_line": 121, "span_ids": ["_save_and_block_module", "_save_and_remove_module"], "tokens": 196}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _save_and_remove_module(name, orig_modules):\n \"\"\"Helper function to save and remove a module from sys.modules\n\n Raise ImportError if the module can't be imported.\"\"\"\n # try to import the module and raise an error if it can't be imported\n if name not in sys.modules:\n __import__(name)\n del sys.modules[name]\n for modname in list(sys.modules):\n if modname == name or modname.startswith(name + '.'):\n orig_modules[modname] = sys.modules[modname]\n del sys.modules[modname]\n\ndef _save_and_block_module(name, orig_modules):\n \"\"\"Helper function to save and block a module in sys.modules\n\n Return True if the module was in sys.modules, False otherwise.\"\"\"\n saved = True\n try:\n orig_modules[name] = sys.modules[name]\n except KeyError:\n saved = False\n sys.modules[name] = None\n return saved", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_import_fresh_module_import_fresh_module.with__ignore_deprecated_i.return.fresh_module": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_import_fresh_module_import_fresh_module.with__ignore_deprecated_i.return.fresh_module", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/support.py", "file_name": "support.py", "file_type": "text/x-python", "category": "test", "start_line": 124, "end_line": 159, "span_ids": ["import_fresh_module"], "tokens": 338}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def import_fresh_module(name, fresh=(), blocked=(), deprecated=False):\n \"\"\"Imports and returns a module, deliberately bypassing the sys.modules cache\n and importing a fresh copy of the module. Once the import is complete,\n the sys.modules cache is restored to its original state.\n\n Modules named in fresh are also imported anew if needed by the import.\n If one of these modules can't be imported, None is returned.\n\n Importing of modules named in blocked is prevented while the fresh import\n takes place.\n\n If deprecated is True, any module or package deprecation messages\n will be suppressed.\"\"\"\n # NOTE: test_heapq, test_json and test_warnings include extra sanity checks\n # to make sure that this utility function is working as expected\n with _ignore_deprecated_imports(deprecated):\n # Keep track of modules saved for later restoration as well\n # as those which just need a blocking entry removed\n orig_modules = {}\n names_to_remove = []\n _save_and_remove_module(name, orig_modules)\n try:\n for fresh_name in fresh:\n _save_and_remove_module(fresh_name, orig_modules)\n for blocked_name in blocked:\n if not _save_and_block_module(blocked_name, orig_modules):\n names_to_remove.append(blocked_name)\n fresh_module = importlib.import_module(name)\n except ImportError:\n fresh_module = None\n finally:\n for orig_name, module in orig_modules.items():\n sys.modules[orig_name] = module\n for name_to_remove in names_to_remove:\n del sys.modules[name_to_remove]\n return fresh_module", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_get_attribute_rmtree.try_.except_OSError_as_error_.if_error_errno_not_in_er.raise": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_get_attribute_rmtree.try_.except_OSError_as_error_.if_error_errno_not_in_er.raise", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/support.py", "file_name": "support.py", "file_type": "text/x-python", "category": "test", "start_line": 162, "end_line": 211, "span_ids": ["record_original_stdout", "unload", "get_attribute", "rmtree", "impl:5", "get_original_stdout", "unlink"], "tokens": 375}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_attribute(obj, name):\n \"\"\"Get an attribute, raising SkipTest if AttributeError is raised.\"\"\"\n try:\n attribute = getattr(obj, name)\n except AttributeError:\n raise unittest.SkipTest(\"module %s has no attribute %s\" % (\n obj.__name__, name))\n else:\n return attribute\n\nverbose = 1 # Flag set to 0 by regrtest.py\nuse_resources = None # type: Any # Flag set to [] by regrtest.py\nmax_memuse = 0 # Disable bigmem tests (they will still be run with\n # small sizes, to make sure they work.)\nreal_max_memuse = 0\nfailfast = False\nmatch_tests = None # type: Any\n\n# _original_stdout is meant to hold stdout at the time regrtest began.\n# This may be \"the real\" stdout, or IDLE's emulation of stdout, or whatever.\n# The point is to have some flavor of stdout the user can actually see.\n_original_stdout = None # type: 'Any'\ndef record_original_stdout(stdout):\n global _original_stdout\n _original_stdout = stdout\n\ndef get_original_stdout():\n return _original_stdout or sys.stdout\n\ndef unload(name):\n try:\n del sys.modules[name]\n except KeyError:\n pass\n\ndef unlink(filename):\n try:\n os.unlink(filename)\n except OSError as error:\n # The filename need not exist.\n if error.errno not in (errno.ENOENT, errno.ENOTDIR):\n raise\n\ndef rmtree(path):\n try:\n shutil.rmtree(path)\n except OSError as error:\n # Unix returns ENOENT, Windows returns ESRCH.\n if error.errno not in (errno.ENOENT, errno.ESRCH):\n raise", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_make_legacy_pyc_make_legacy_pyc.return.legacy_pyc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_make_legacy_pyc_make_legacy_pyc.return.legacy_pyc", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/support.py", "file_name": "support.py", "file_type": "text/x-python", "category": "test", "start_line": 213, "end_line": 231, "span_ids": ["make_legacy_pyc"], "tokens": 186}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def make_legacy_pyc(source):\n \"\"\"Move a PEP 3147 pyc/pyo file to its legacy pyc/pyo location.\n\n The choice of .pyc or .pyo extension is done based on the __debug__ flag\n value.\n\n :param source: The file system path to the source file. The source file\n does not need to exist, however the PEP 3147 pyc file must exist.\n :return: The file system path to the legacy pyc file.\n \"\"\"\n pyc_file = imp.cache_from_source(source)\n up_one = os.path.dirname(os.path.abspath(source))\n if __debug__:\n ch = 'c'\n else:\n ch = 'o'\n legacy_pyc = os.path.join(up_one, source + ch)\n os.rename(pyc_file, legacy_pyc)\n return legacy_pyc", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_forget_forget.for_dirname_in_sys_path_.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_forget_forget.for_dirname_in_sys_path_.None_3", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/support.py", "file_name": "support.py", "file_type": "text/x-python", "category": "test", "start_line": 233, "end_line": 247, "span_ids": ["forget"], "tokens": 147}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def forget(modname):\n \"\"\"'Forget' a module was ever imported.\n\n This removes the module from sys.modules and deletes any PEP 3147 or\n legacy .pyc and .pyo files.\n \"\"\"\n unload(modname)\n for dirname in sys.path:\n source = os.path.join(dirname, modname + '.py')\n # It doesn't matter if they exist or not, unlink all possible\n # combinations of PEP 3147 and legacy pyc and pyo files.\n unlink(source + 'c')\n unlink(source + 'o')\n unlink(imp.cache_from_source(source, debug_override=True))\n unlink(imp.cache_from_source(source, debug_override=False))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py__On_some_platforms_shou_is_resource_enabled.return.use_resources_is_not_None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py__On_some_platforms_shou_is_resource_enabled.return.use_resources_is_not_None", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/support.py", "file_name": "support.py", "file_type": "text/x-python", "category": "test", "start_line": 249, "end_line": 282, "span_ids": ["_is_gui_available", "forget", "is_resource_enabled"], "tokens": 318}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# On some platforms, should not run gui test even if it is allowed\n# in `use_resources'.\n#if sys.platform.startswith('win'):\n #import ctypes\n #import ctypes.wintypes\n #def _is_gui_available():\n # UOI_FLAGS = 1\n # WSF_VISIBLE = 0x0001\n # class USEROBJECTFLAGS(ctypes.Structure):\n # _fields_ = [(\"fInherit\", ctypes.wintypes.BOOL),\n # (\"fReserved\", ctypes.wintypes.BOOL),\n # (\"dwFlags\", ctypes.wintypes.DWORD)]\n # dll = ctypes.windll.user32\n # h = dll.GetProcessWindowStation()\n # if not h:\n # raise ctypes.WinError()\n # uof = USEROBJECTFLAGS()\n # needed = ctypes.wintypes.DWORD()\n # res = dll.GetUserObjectInformationW(h,\n # UOI_FLAGS,\n # ctypes.byref(uof),\n # ctypes.sizeof(uof),\n # ctypes.byref(needed))\n # if not res:\n # raise ctypes.WinError()\n # return bool(uof.dwFlags & WSF_VISIBLE)\n#else:\ndef _is_gui_available():\n return True\n\ndef is_resource_enabled(resource):\n \"\"\"Test whether a resource is enabled. Known resources are set by\n regrtest.py.\"\"\"\n return use_resources is not None and resource in use_resources", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_requires_requires.if_not_is_resource_enable.raise_ResourceDenied_msg_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_requires_requires.if_not_is_resource_enable.raise_ResourceDenied_msg_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/support.py", "file_name": "support.py", "file_type": "text/x-python", "category": "test", "start_line": 284, "end_line": 300, "span_ids": ["requires"], "tokens": 172}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def requires(resource, msg=None):\n \"\"\"Raise ResourceDenied if the specified resource is not available.\n\n If the caller's module is __main__ then automatically return True. The\n possibility of False being returned occurs when regrtest.py is\n executing.\n \"\"\"\n if resource == 'gui' and not _is_gui_available():\n raise unittest.SkipTest(\"Cannot use the 'gui' resource\")\n # see if the caller's module is __main__ - if so, treat as if\n # the resource was set\n if sys._getframe(1).f_globals.get(\"__name__\") == \"__main__\":\n return\n if not is_resource_enabled(resource):\n if msg is None:\n msg = \"Use of the `%s' resource not enabled\" % resource\n raise ResourceDenied(msg)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_requires_mac_ver_HOST._localhost_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_requires_mac_ver_HOST._localhost_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/support.py", "file_name": "support.py", "file_type": "text/x-python", "category": "test", "start_line": 302, "end_line": 329, "span_ids": ["requires_mac_ver", "impl:19"], "tokens": 216}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def requires_mac_ver(*min_version):\n \"\"\"Decorator raising SkipTest if the OS is Mac OS X and the OS X\n version if less than min_version.\n\n For example, @requires_mac_ver(10, 5) raises SkipTest if the OS X version\n is lesser than 10.5.\n \"\"\"\n def decorator(func):\n @functools.wraps(func)\n def wrapper(*args, **kw):\n if sys.platform == 'darwin':\n version_txt = platform.mac_ver()[0]\n try:\n version = tuple(map(int, version_txt.split('.')))\n except ValueError:\n pass\n else:\n if version < min_version:\n min_version_txt = '.'.join(map(str, min_version))\n raise unittest.SkipTest(\n \"Mac OS X %s or higher required, not %s\"\n % (min_version_txt, version_txt))\n return func(*args, **kw)\n wrapper.min_version = min_version\n return wrapper\n return decorator\n\nHOST = 'localhost'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_find_unused_port_find_unused_port.return.port": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_find_unused_port_find_unused_port.return.port", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/support.py", "file_name": "support.py", "file_type": "text/x-python", "category": "test", "start_line": 331, "end_line": 391, "span_ids": ["find_unused_port"], "tokens": 872}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def find_unused_port(family=socket.AF_INET, socktype=socket.SOCK_STREAM):\n \"\"\"Returns an unused port that should be suitable for binding. This is\n achieved by creating a temporary socket with the same family and type as\n the 'sock' parameter (default is AF_INET, SOCK_STREAM), and binding it to\n the specified host address (defaults to 0.0.0.0) with the port set to 0,\n eliciting an unused ephemeral port from the OS. The temporary socket is\n then closed and deleted, and the ephemeral port is returned.\n\n Either this method or bind_port() should be used for any tests where a\n server socket needs to be bound to a particular port for the duration of\n the test. Which one to use depends on whether the calling code is creating\n a python socket, or if an unused port needs to be provided in a constructor\n or passed to an external program (i.e. the -accept argument to openssl's\n s_server mode). Always prefer bind_port() over find_unused_port() where\n possible. Hard coded ports should *NEVER* be used. As soon as a server\n socket is bound to a hard coded port, the ability to run multiple instances\n of the test simultaneously on the same host is compromised, which makes the\n test a ticking time bomb in a buildbot environment. On Unix buildbots, this\n may simply manifest as a failed test, which can be recovered from without\n intervention in most cases, but on Windows, the entire python process can\n completely and utterly wedge, requiring someone to log in to the buildbot\n and manually kill the affected process.\n\n (This is easy to reproduce on Windows, unfortunately, and can be traced to\n the SO_REUSEADDR socket option having different semantics on Windows versus\n Unix/Linux. On Unix, you can't have two AF_INET SOCK_STREAM sockets bind,\n listen and then accept connections on identical host/ports. An EADDRINUSE\n socket.error will be raised at some point (depending on the platform and\n the order bind and listen were called on each socket).\n\n However, on Windows, if SO_REUSEADDR is set on the sockets, no EADDRINUSE\n will ever be raised when attempting to bind two identical host/ports. When\n accept() is called on each socket, the second caller's process will steal\n the port from the first caller, leaving them both in an awkwardly wedged\n state where they'll no longer respond to any signals or graceful kills, and\n must be forcibly killed via OpenProcess()/TerminateProcess().\n\n The solution on Windows is to use the SO_EXCLUSIVEADDRUSE socket option\n instead of SO_REUSEADDR, which effectively affords the same semantics as\n SO_REUSEADDR on Unix. Given the propensity of Unix developers in the Open\n Source world compared to Windows ones, this is a common mistake. A quick\n look over OpenSSL's 0.9.8g source shows that they use SO_REUSEADDR when\n openssl.exe is called with the 's_server' option, for example. See\n http://bugs.python.org/issue2550 for more info. The following site also\n has a very thorough description about the implications of both REUSEADDR\n and EXCLUSIVEADDRUSE on Windows:\n http://msdn2.microsoft.com/en-us/library/ms740621(VS.85).aspx)\n\n XXX: although this approach is a vast improvement on previous attempts to\n elicit unused ports, it rests heavily on the assumption that the ephemeral\n port returned to us by the OS won't immediately be dished back out to some\n other process when we close and delete our temporary socket but before our\n calling code has a chance to bind the returned port. We can deal with this\n issue if/when we come across it.\n \"\"\"\n\n tempsock = socket.socket(family, socktype)\n port = bind_port(tempsock)\n tempsock.close()\n #del tempsock\n return port", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_bind_port_bind_port.return.port": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_bind_port_bind_port.return.port", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/support.py", "file_name": "support.py", "file_type": "text/x-python", "category": "test", "start_line": 393, "end_line": 422, "span_ids": ["bind_port"], "tokens": 377}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def bind_port(sock, host=HOST):\n \"\"\"Bind the socket to a free port and return the port number. Relies on\n ephemeral ports in order to ensure we are using an unbound port. This is\n important as many tests may be running simultaneously, especially in a\n buildbot environment. This method raises an exception if the sock.family\n is AF_INET and sock.type is SOCK_STREAM, *and* the socket has SO_REUSEADDR\n or SO_REUSEPORT set on it. Tests should *never* set these socket options\n for TCP/IP sockets. The only case for setting these options is testing\n multicasting via multiple UDP sockets.\n\n Additionally, if the SO_EXCLUSIVEADDRUSE socket option is available (i.e.\n on Windows), it will be set on the socket. This will prevent anyone else\n from bind()'ing to our host/port for the duration of the test.\n \"\"\"\n\n if sock.family == socket.AF_INET and sock.type == socket.SOCK_STREAM:\n if hasattr(socket, 'SO_REUSEADDR'):\n if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR) == 1:\n raise TestFailed(\"tests should never set the SO_REUSEADDR \" \\\n \"socket option on TCP/IP sockets!\")\n if hasattr(socket, 'SO_REUSEPORT'):\n if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT) == 1:\n raise TestFailed(\"tests should never set the SO_REUSEPORT \" \\\n \"socket option on TCP/IP sockets!\")\n if hasattr(socket, 'SO_EXCLUSIVEADDRUSE'):\n sock.setsockopt(socket.SOL_SOCKET, socket.SO_EXCLUSIVEADDRUSE, 1)\n\n sock.bind((host, 0))\n port = sock.getsockname()[1]\n return port", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_FUZZ_fcmp.return._x_y_x_y_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_FUZZ_fcmp.return._x_y_x_y_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/support.py", "file_name": "support.py", "file_type": "text/x-python", "category": "test", "start_line": 424, "end_line": 440, "span_ids": ["impl:21", "fcmp"], "tokens": 156}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "FUZZ = 1e-6\n\ndef fcmp(x, y): # fuzzy comparison function\n if isinstance(x, float) or isinstance(y, float):\n try:\n fuzz = (abs(x) + abs(y)) * FUZZ\n if abs(x-y) <= fuzz:\n return 0\n except:\n pass\n elif type(x) == type(y) and isinstance(x, (tuple, list)):\n for i in range(min(len(x), len(y))):\n outcome = fcmp(x[i], y[i])\n if outcome != 0:\n return outcome\n return (len(x) > len(y)) - (len(x) < len(y))\n return (x > y) - (x < y)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py__decorator_for_skipping__SAVEDCWD.os_getcwd_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py__decorator_for_skipping__SAVEDCWD.os_getcwd_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/support.py", "file_name": "support.py", "file_type": "text/x-python", "category": "test", "start_line": 442, "end_line": 506, "span_ids": ["impl:67", "fcmp", "impl:23"], "tokens": 668}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# decorator for skipping tests on non-IEEE 754 platforms\nrequires_IEEE_754 = unittest.skipUnless(\n cast(Any, float).__getformat__(\"double\").startswith(\"IEEE\"),\n \"test requires IEEE 754 doubles\")\n\nis_jython = sys.platform.startswith('java')\n\nTESTFN = ''\n# Filename used for testing\nif os.name == 'java':\n # Jython disallows @ in module names\n TESTFN = '$test'\nelse:\n TESTFN = '@test'\n\n# Disambiguate TESTFN for parallel testing, while letting it remain a valid\n# module name.\nTESTFN = \"{}_{}_tmp\".format(TESTFN, os.getpid())\n\n\n# TESTFN_UNICODE is a non-ascii filename\nTESTFN_UNICODE = TESTFN + \"-\\xe0\\xf2\\u0258\\u0141\\u011f\"\nif sys.platform == 'darwin':\n # In Mac OS X's VFS API file names are, by definition, canonically\n # decomposed Unicode, encoded using UTF-8. See QA1173:\n # http://developer.apple.com/mac/library/qa/qa2001/qa1173.html\n import unicodedata\n TESTFN_UNICODE = unicodedata.normalize('NFD', TESTFN_UNICODE)\nTESTFN_ENCODING = sys.getfilesystemencoding()\n\n# TESTFN_UNENCODABLE is a filename (str type) that should *not* be able to be\n# encoded by the filesystem encoding (in strict mode). It can be None if we\n# cannot generate such filename.\nTESTFN_UNENCODABLE = None # type: Any\nif sys.platform == \"win32\":\n # skip win32s (0) or Windows 9x/ME (1)\n if sys.getwindowsversion().platform >= 2:\n # Different kinds of characters from various languages to minimize the\n # probability that the whole name is encodable to MBCS (issue #9819)\n TESTFN_UNENCODABLE = TESTFN + \"-\\u5171\\u0141\\u2661\\u0363\\uDC80\"\n try:\n TESTFN_UNENCODABLE.encode(TESTFN_ENCODING)\n except UnicodeEncodeError:\n pass\n else:\n print('WARNING: The filename %r CAN be encoded by the filesystem encoding (%s). '\n 'Unicode filename tests may not be effective'\n % (TESTFN_UNENCODABLE, TESTFN_ENCODING))\n TESTFN_UNENCODABLE = None\n# Mac OS X denies unencodable filenames (invalid utf-8)\nelif sys.platform != 'darwin':\n try:\n # ascii and utf-8 cannot encode the byte 0xff\n b'\\xff'.decode(TESTFN_ENCODING)\n except UnicodeDecodeError:\n # 0xff will be encoded using the surrogate character u+DCFF\n TESTFN_UNENCODABLE = TESTFN \\\n + b'-\\xff'.decode(TESTFN_ENCODING, 'surrogateescape')\n else:\n # File system encoding (eg. ISO-8859-* encodings) can encode\n # the byte 0xff. Skip some unicode filename tests.\n pass\n\n# Save the initial cwd\nSAVEDCWD = os.getcwd()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_temp_cwd_temp_cwd.None_1.finally_.if_is_temporary_.rmtree_name_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_temp_cwd_temp_cwd.None_1.finally_.if_is_temporary_.rmtree_name_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/support.py", "file_name": "support.py", "file_type": "text/x-python", "category": "test", "start_line": 508, "end_line": 545, "span_ids": ["temp_cwd"], "tokens": 288}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@contextlib.contextmanager\ndef temp_cwd(name='tempcwd', quiet=False, path=None):\n \"\"\"\n Context manager that temporarily changes the CWD.\n\n An existing path may be provided as *path*, in which case this\n function makes no changes to the file system.\n\n Otherwise, the new CWD is created in the current directory and it's\n named *name*. If *quiet* is False (default) and it's not possible to\n create or change the CWD, an error is raised. If it's True, only a\n warning is raised and the original CWD is used.\n \"\"\"\n saved_dir = os.getcwd()\n is_temporary = False\n if path is None:\n path = name\n try:\n os.mkdir(name)\n is_temporary = True\n except OSError:\n if not quiet:\n raise\n warnings.warn('tests may fail, unable to create temp CWD ' + name,\n RuntimeWarning, stacklevel=3)\n try:\n os.chdir(path)\n except OSError:\n if not quiet:\n raise\n warnings.warn('tests may fail, unable to change the CWD to ' + name,\n RuntimeWarning, stacklevel=3)\n try:\n yield os.getcwd()\n finally:\n os.chdir(saved_dir)\n if is_temporary:\n rmtree(name)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_temp_umask_findfile.return.file": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_temp_umask_findfile.return.file", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/support.py", "file_name": "support.py", "file_type": "text/x-python", "category": "test", "start_line": 548, "end_line": 571, "span_ids": ["findfile", "temp_umask"], "tokens": 194}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@contextlib.contextmanager\ndef temp_umask(umask):\n \"\"\"Context manager that temporarily sets the process umask.\"\"\"\n oldmask = os.umask(umask)\n try:\n yield None\n finally:\n os.umask(oldmask)\n\n\ndef findfile(file, here=__file__, subdir=None):\n \"\"\"Try to find a file on sys.path and the working directory. If it is not\n found the argument passed to the function is returned (this does not\n necessarily signal failure; could still be the legitimate path).\"\"\"\n if os.path.isabs(file):\n return file\n if subdir is not None:\n file = os.path.join(subdir, file)\n path = sys.path\n path = [os.path.dirname(here)] + path\n for dn in path:\n fn = os.path.join(dn, file)\n if os.path.exists(fn): return fn\n return file", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_sortdict_check_syntax_error._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_sortdict_check_syntax_error._", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/support.py", "file_name": "support.py", "file_type": "text/x-python", "category": "test", "start_line": 573, "end_line": 595, "span_ids": ["sortdict", "make_bad_fd", "check_syntax_error"], "tokens": 163}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def sortdict(dict):\n \"Like repr(dict), but in sorted order.\"\n items = sorted(dict.items())\n reprpairs = [\"%r: %r\" % pair for pair in items]\n withcommas = \", \".join(reprpairs)\n return \"{%s}\" % withcommas\n\ndef make_bad_fd():\n \"\"\"\n Create an invalid file descriptor by opening and closing a file and return\n its fd.\n \"\"\"\n file = open(TESTFN, \"wb\")\n try:\n return file.fileno()\n finally:\n file.close()\n unlink(TESTFN)\n\ndef check_syntax_error(testcase, statement):\n raise NotImplementedError('no compile built-in')\n #testcase.assertRaises(SyntaxError, compile, statement,\n # '', 'exec')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_open_urlresource_open_urlresource.raise_TestFailed_invalid": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_open_urlresource_open_urlresource.raise_TestFailed_invalid", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/support.py", "file_name": "support.py", "file_type": "text/x-python", "category": "test", "start_line": 597, "end_line": 638, "span_ids": ["open_urlresource"], "tokens": 265}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def open_urlresource(url, *args, **kw):\n from urllib import request, parse\n\n check = kw.pop('check', None)\n\n filename = parse.urlparse(url)[2].split('/')[-1] # '/': it's URL!\n\n fn = os.path.join(os.path.dirname(__file__), \"data\", filename)\n\n def check_valid_file(fn):\n f = open(fn, *args, **kw)\n if check is None:\n return f\n elif check(f):\n f.seek(0)\n return f\n f.close()\n\n if os.path.exists(fn):\n f = check_valid_file(fn)\n if f is not None:\n return f\n unlink(fn)\n\n # Verify the requirement before downloading the file\n requires('urlfetch')\n\n print('\\tfetching %s ...' % url, file=get_original_stdout())\n f = request.urlopen(url, timeout=15)\n try:\n with open(fn, \"wb\") as out:\n s = f.read()\n while s:\n out.write(s)\n s = f.read()\n finally:\n f.close()\n\n f = check_valid_file(fn)\n if f is not None:\n return f\n raise TestFailed('invalid resource \"%s\"' % fn)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_WarningsRecorder_WarningsRecorder.reset.self._last.len_self__warnings_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_WarningsRecorder_WarningsRecorder.reset.self._last.len_self__warnings_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/support.py", "file_name": "support.py", "file_type": "text/x-python", "category": "test", "start_line": 641, "end_line": 661, "span_ids": ["WarningsRecorder.__init__", "WarningsRecorder.reset", "WarningsRecorder", "WarningsRecorder.__getattr__"], "tokens": 157}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class WarningsRecorder(object):\n \"\"\"Convenience wrapper for the warnings list returned on\n entry to the warnings.catch_warnings() context manager.\n \"\"\"\n def __init__(self, warnings_list):\n self._warnings = warnings_list\n self._last = 0\n\n def __getattr__(self, attr):\n if len(self._warnings) > self._last:\n return getattr(self._warnings[-1], attr)\n elif attr in warnings.WarningMessage._WARNING_DETAILS:\n return None\n raise AttributeError(\"%r has no attribute %r\" % (self, attr))\n\n #@property\n #def warnings(self):\n # return self._warnings[self._last:]\n\n def reset(self):\n self._last = len(self._warnings)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py__filterwarnings__filterwarnings.if_missing_.raise_AssertionError_fil": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py__filterwarnings__filterwarnings.if_missing_.raise_AssertionError_fil", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/support.py", "file_name": "support.py", "file_type": "text/x-python", "category": "test", "start_line": 664, "end_line": 700, "span_ids": ["_filterwarnings"], "tokens": 338}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _filterwarnings(filters, quiet=False):\n \"\"\"Catch the warnings, then check if all the expected\n warnings have been raised and re-raise unexpected warnings.\n If 'quiet' is True, only re-raise the unexpected warnings.\n \"\"\"\n # Clear the warning registry of the calling module\n # in order to re-raise the warnings.\n frame = sys._getframe(2)\n registry = frame.f_globals.get('__warningregistry__')\n if registry:\n registry.clear()\n with warnings.catch_warnings(record=True) as w:\n # Set filter \"always\" to record all warnings. Because\n # test_warnings swap the module, we need to look up in\n # the sys.modules dictionary.\n sys.modules['warnings'].simplefilter(\"always\")\n yield WarningsRecorder(w)\n # Filter the recorded warnings\n reraise = list(w)\n missing = []\n for msg, cat in filters:\n seen = False\n for w in reraise[:]:\n warning = w.message\n # Filter out the matching messages\n if (re.match(msg, str(warning), re.I) and\n issubclass(warning.__class__, cat)):\n seen = True\n reraise.remove(w)\n if not seen and not quiet:\n # This filter caught nothing\n missing.append((msg, cat.__name__))\n if reraise:\n raise AssertionError(\"unhandled warning %s\" % reraise[0])\n if missing:\n raise AssertionError(\"filter (%r, %s) did not catch any warning\" %\n missing[0])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_check_warnings_check_warnings.return._filterwarnings_filters_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_check_warnings_check_warnings.return._filterwarnings_filters_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/support.py", "file_name": "support.py", "file_type": "text/x-python", "category": "test", "start_line": 703, "end_line": 724, "span_ids": ["check_warnings"], "tokens": 147}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@contextlib.contextmanager\ndef check_warnings(*filters, **kwargs):\n \"\"\"Context manager to silence warnings.\n\n Accept 2-tuples as positional arguments:\n (\"message regexp\", WarningCategory)\n\n Optional argument:\n - if 'quiet' is True, it does not fail if a filter catches nothing\n (default True without argument,\n default False if some filters are defined)\n\n Without argument, it defaults to:\n check_warnings((\"\", Warning), quiet=True)\n \"\"\"\n quiet = kwargs.get('quiet')\n if not filters:\n filters = ((\"\", Warning),)\n # Preserve backward compatibility\n if quiet is None:\n quiet = True\n return _filterwarnings(filters, quiet)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_CleanImport_CleanImport.__exit__.sys_modules_update_self_o": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_CleanImport_CleanImport.__exit__.sys_modules_update_self_o", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/support.py", "file_name": "support.py", "file_type": "text/x-python", "category": "test", "start_line": 727, "end_line": 756, "span_ids": ["CleanImport", "CleanImport.__enter__", "CleanImport.__init__", "CleanImport.__exit__"], "tokens": 226}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CleanImport(object):\n \"\"\"Context manager to force import to return a new module reference.\n\n This is useful for testing module-level behaviours, such as\n the emission of a DeprecationWarning on import.\n\n Use like this:\n\n with CleanImport(\"foo\"):\n importlib.import_module(\"foo\") # new reference\n \"\"\"\n\n def __init__(self, *module_names):\n self.original_modules = sys.modules.copy()\n for module_name in module_names:\n if module_name in sys.modules:\n module = sys.modules[module_name]\n # It is possible that module_name is just an alias for\n # another module (e.g. stub for modules renamed in 3.x).\n # In that case, we also need delete the real module to clear\n # the import cache.\n if module.__name__ != module_name:\n del sys.modules[module.__name__]\n del sys.modules[module_name]\n\n def __enter__(self):\n return self\n\n def __exit__(self, *ignore_exc):\n sys.modules.update(self.original_modules)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_EnvironmentVarGuard_EnvironmentVarGuard.__exit__.os.environ.self__environ": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_EnvironmentVarGuard_EnvironmentVarGuard.__exit__.os.environ.self__environ", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/support.py", "file_name": "support.py", "file_type": "text/x-python", "category": "test", "start_line": 759, "end_line": 809, "span_ids": ["EnvironmentVarGuard.unset", "EnvironmentVarGuard.__enter__", "EnvironmentVarGuard.__exit__", "EnvironmentVarGuard.set", "EnvironmentVarGuard.__len__", "EnvironmentVarGuard", "EnvironmentVarGuard.__init__", "EnvironmentVarGuard.keys", "EnvironmentVarGuard.__setitem__", "EnvironmentVarGuard.__getitem__", "EnvironmentVarGuard.__delitem__", "EnvironmentVarGuard.__iter__"], "tokens": 356}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class EnvironmentVarGuard(dict):\n\n \"\"\"Class to help protect the environment variable properly. Can be used as\n a context manager.\"\"\"\n\n def __init__(self):\n self._environ = os.environ\n self._changed = {}\n\n def __getitem__(self, envvar):\n return self._environ[envvar]\n\n def __setitem__(self, envvar, value):\n # Remember the initial value on the first access\n if envvar not in self._changed:\n self._changed[envvar] = self._environ.get(envvar)\n self._environ[envvar] = value\n\n def __delitem__(self, envvar):\n # Remember the initial value on the first access\n if envvar not in self._changed:\n self._changed[envvar] = self._environ.get(envvar)\n if envvar in self._environ:\n del self._environ[envvar]\n\n def keys(self):\n return self._environ.keys()\n\n def __iter__(self):\n return iter(self._environ)\n\n def __len__(self):\n return len(self._environ)\n\n def set(self, envvar, value):\n self[envvar] = value\n\n def unset(self, envvar):\n del self[envvar]\n\n def __enter__(self):\n return self\n\n def __exit__(self, *ignore_exc):\n for k, v in self._changed.items():\n if v is None:\n if k in self._environ:\n del self._environ[k]\n else:\n self._environ[k] = v\n os.environ = self._environ", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_DirsOnSysPath_DirsOnSysPath.__exit__.sys_path_self_origin": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_DirsOnSysPath_DirsOnSysPath.__exit__.sys_path_self_origin", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/support.py", "file_name": "support.py", "file_type": "text/x-python", "category": "test", "start_line": 812, "end_line": 834, "span_ids": ["DirsOnSysPath.__enter__", "DirsOnSysPath", "DirsOnSysPath.__init__", "DirsOnSysPath.__exit__"], "tokens": 164}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DirsOnSysPath(object):\n \"\"\"Context manager to temporarily add directories to sys.path.\n\n This makes a copy of sys.path, appends any directories given\n as positional arguments, then reverts sys.path to the copied\n settings when the context ends.\n\n Note that *all* sys.path modifications in the body of the\n context manager, including replacement of the object,\n will be reverted at the end of the block.\n \"\"\"\n\n def __init__(self, *paths):\n self.original_value = sys.path[:]\n self.original_object = sys.path\n sys.path.extend(paths)\n\n def __enter__(self):\n return self\n\n def __exit__(self, *ignore_exc):\n sys.path = self.original_object\n sys.path[:] = self.original_value", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_TransientResource_ioerror_peer_reset.TransientResource_IOError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_TransientResource_ioerror_peer_reset.TransientResource_IOError", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/support.py", "file_name": "support.py", "file_type": "text/x-python", "category": "test", "start_line": 837, "end_line": 867, "span_ids": ["impl:69", "TransientResource.__init__", "TransientResource", "TransientResource.__exit__", "TransientResource.__enter__"], "tokens": 278}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TransientResource(object):\n\n \"\"\"Raise ResourceDenied if an exception is raised while the context manager\n is in effect that matches the specified exception and attributes.\"\"\"\n\n def __init__(self, exc, **kwargs):\n self.exc = exc\n self.attrs = kwargs\n\n def __enter__(self):\n return self\n\n def __exit__(self, type_=None, value=None, traceback=None):\n \"\"\"If type_ is a subclass of self.exc and value has attributes matching\n self.attrs, raise ResourceDenied. Otherwise let the exception\n propagate (if any).\"\"\"\n if type_ is not None and issubclass(self.exc, type_):\n for attr, attr_value in self.attrs.items():\n if not hasattr(value, attr):\n break\n if getattr(value, attr) != attr_value:\n break\n else:\n raise ResourceDenied(\"an optional resource is not available\")\n\n# Context managers that raise ResourceDenied when various issues\n# with the Internet connection manifest themselves as exceptions.\n# XXX deprecate these and use transient_internet() instead\ntime_out = TransientResource(IOError, errno=errno.ETIMEDOUT)\nsocket_peer_reset = TransientResource(socket.error, errno=errno.ECONNRESET)\nioerror_peer_reset = TransientResource(IOError, errno=errno.ECONNRESET)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_transient_internet_transient_internet.try_.finally_.socket_setdefaulttimeout_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_transient_internet_transient_internet.try_.finally_.socket_setdefaulttimeout_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/support.py", "file_name": "support.py", "file_type": "text/x-python", "category": "test", "start_line": 870, "end_line": 932, "span_ids": ["transient_internet"], "tokens": 559}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@contextlib.contextmanager\ndef transient_internet(resource_name, *, timeout=30.0, errnos=()):\n \"\"\"Return a context manager that raises ResourceDenied when various issues\n with the Internet connection manifest themselves as exceptions.\"\"\"\n default_errnos = [\n ('ECONNREFUSED', 111),\n ('ECONNRESET', 104),\n ('EHOSTUNREACH', 113),\n ('ENETUNREACH', 101),\n ('ETIMEDOUT', 110),\n ]\n default_gai_errnos = [\n ('EAI_AGAIN', -3),\n ('EAI_FAIL', -4),\n ('EAI_NONAME', -2),\n ('EAI_NODATA', -5),\n # Encountered when trying to resolve IPv6-only hostnames\n ('WSANO_DATA', 11004),\n ]\n\n denied = ResourceDenied(\"Resource '%s' is not available\" % resource_name)\n captured_errnos = errnos\n gai_errnos = []\n if not captured_errnos:\n captured_errnos = [getattr(errno, name, num)\n for name, num in default_errnos]\n gai_errnos = [getattr(socket, name, num)\n for name, num in default_gai_errnos]\n\n def filter_error(err):\n n = getattr(err, 'errno', None)\n if (isinstance(err, socket.timeout) or\n (isinstance(err, socket.gaierror) and n in gai_errnos) or\n n in captured_errnos):\n if not verbose:\n sys.stderr.write(denied.args[0] + \"\\n\")\n raise denied from err\n\n old_timeout = socket.getdefaulttimeout()\n try:\n if timeout is not None:\n socket.setdefaulttimeout(timeout)\n yield None\n except IOError as err:\n # urllib can wrap original socket errors multiple times (!), we must\n # unwrap to get at the original error.\n while True:\n a = err.args\n if len(a) >= 1 and isinstance(a[0], IOError):\n err = a[0]\n # The error can also be wrapped as args[1]:\n # except socket.error as msg:\n # raise IOError('socket error', msg).with_traceback(sys.exc_info()[2])\n elif len(a) >= 2 and isinstance(a[1], IOError):\n err = a[1]\n else:\n break\n filter_error(err)\n raise\n # XXX should we catch generic exceptions and look for their\n # __cause__ or __context__?\n finally:\n socket.setdefaulttimeout(old_timeout)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_captured_output_captured_stdin.return.captured_output_stdin_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_captured_output_captured_stdin.return.captured_output_stdin_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/support.py", "file_name": "support.py", "file_type": "text/x-python", "category": "test", "start_line": 935, "end_line": 960, "span_ids": ["captured_stdin", "captured_stderr", "captured_output", "captured_stdout"], "tokens": 158}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@contextlib.contextmanager\ndef captured_output(stream_name):\n \"\"\"Return a context manager used by captured_stdout/stdin/stderr\n that temporarily replaces the sys stream *stream_name* with a StringIO.\"\"\"\n import io\n orig_stdout = getattr(sys, stream_name)\n setattr(sys, stream_name, io.StringIO())\n try:\n yield getattr(sys, stream_name)\n finally:\n setattr(sys, stream_name, orig_stdout)\n\ndef captured_stdout():\n \"\"\"Capture the output of sys.stdout:\n\n with captured_stdout() as s:\n print(\"hello\")\n self.assertEqual(s.getvalue(), \"hello\")\n \"\"\"\n return captured_output(\"stdout\")\n\ndef captured_stderr():\n return captured_output(\"stderr\")\n\ndef captured_stdin():\n return captured_output(\"stdin\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_gc_collect_python_is_optimized.return.final_opt_and_final_opt_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_gc_collect_python_is_optimized.return.final_opt_and_final_opt_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/support.py", "file_name": "support.py", "file_type": "text/x-python", "category": "test", "start_line": 963, "end_line": 987, "span_ids": ["gc_collect", "python_is_optimized"], "tokens": 204}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def gc_collect():\n \"\"\"Force as many objects as possible to be collected.\n\n In non-CPython implementations of Python, this is needed because timely\n deallocation is not guaranteed by the garbage collector. (Even in CPython\n this can be the case in case of reference cycles.) This means that __del__\n methods may be called later than expected and weakrefs may remain alive for\n longer than expected. This function tries its best to force all garbage\n objects to disappear.\n \"\"\"\n gc.collect()\n if is_jython:\n time.sleep(0.1)\n gc.collect()\n gc.collect()\n\n\ndef python_is_optimized():\n \"\"\"Find if Python was built with optimizations.\"\"\"\n cflags = sysconfig.get_config_var('PY_CFLAGS') or ''\n final_opt = \"\"\n for opt in cflags.split():\n if opt.startswith('-O'):\n final_opt = opt\n return final_opt and final_opt != '-O0'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py___MAX_Py_ssize_t.sys_maxsize": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py___MAX_Py_ssize_t.sys_maxsize", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/support.py", "file_name": "support.py", "file_type": "text/x-python", "category": "test", "start_line": 990, "end_line": 1037, "span_ids": ["run_with_locale", "python_is_optimized", "impl:75"], "tokens": 324}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "#=======================================================================\n# Decorator for running a function in a different locale, correctly resetting\n# it afterwards.\n\ndef run_with_locale(catstr, *locales):\n def decorator(func):\n def inner(*args, **kwds):\n try:\n import locale\n category = getattr(locale, catstr)\n orig_locale = locale.setlocale(category)\n except AttributeError:\n # if the test author gives us an invalid category string\n raise\n except:\n # cannot retrieve original locale, so do nothing\n locale = orig_locale = None\n else:\n for loc in locales:\n try:\n locale.setlocale(category, loc)\n break\n except:\n pass\n\n # now run the function, resetting the locale on exceptions\n try:\n return func(*args, **kwds)\n finally:\n if locale and orig_locale:\n locale.setlocale(category, orig_locale)\n inner.__name__ = func.__name__\n inner.__doc__ = func.__doc__\n return inner\n return decorator\n\n#=======================================================================\n# Big-memory-test support. Separate from 'resources' because memory use\n# should be configurable.\n\n# Some handy shorthands. Note that these are used for byte-limits as well\n# as size-limits, in the various bigmem tests\n_1M = 1024*1024\n_1G = 1024 * _1M\n_2G = 2 * _1G\n_4G = 4 * _1G\n\nMAX_Py_ssize_t = sys.maxsize", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_set_memlimit_set_memlimit.max_memuse.memlimit": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_set_memlimit_set_memlimit.max_memuse.memlimit", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/support.py", "file_name": "support.py", "file_type": "text/x-python", "category": "test", "start_line": 1039, "end_line": 1058, "span_ids": ["set_memlimit"], "tokens": 204}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def set_memlimit(limit):\n global max_memuse\n global real_max_memuse\n sizes = {\n 'k': 1024,\n 'm': _1M,\n 'g': _1G,\n 't': 1024*_1G,\n }\n m = re.match(r'(\\d+(\\.\\d+)?) (K|M|G|T)b?$', limit,\n re.IGNORECASE | re.VERBOSE)\n if m is None:\n raise ValueError('Invalid memory limit %r' % (limit,))\n memlimit = int(float(m.group(1)) * sizes[m.group(3).lower()])\n real_max_memuse = memlimit\n if memlimit > MAX_Py_ssize_t:\n memlimit = MAX_Py_ssize_t\n if memlimit < _2G - 1:\n raise ValueError('Memory limit %r too low to be useful' % (limit,))\n max_memuse = memlimit", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py__memory_watchdog__memory_watchdog.with_f_.while_not_finish_evt_wait.if_data_old_data_.print_process_data_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py__memory_watchdog__memory_watchdog.with_f_.while_not_finish_evt_wait.if_data_old_data_.print_process_data_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/support.py", "file_name": "support.py", "file_type": "text/x-python", "category": "test", "start_line": 1060, "end_line": 1094, "span_ids": ["_memory_watchdog"], "tokens": 325}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _memory_watchdog(start_evt, finish_evt, period=10.0):\n \"\"\"A function which periodically watches the process' memory consumption\n and prints it out.\n \"\"\"\n # XXX: because of the GIL, and because the very long operations tested\n # in most bigmem tests are uninterruptible, the loop below gets woken up\n # much less often than expected.\n # The polling code should be rewritten in raw C, without holding the GIL,\n # and push results onto an anonymous pipe.\n try:\n page_size = os.sysconf('SC_PAGESIZE')\n except (ValueError, AttributeError):\n try:\n page_size = os.sysconf('SC_PAGE_SIZE')\n except (ValueError, AttributeError):\n page_size = 4096\n procfile = '/proc/{pid}/statm'.format(pid=os.getpid())\n try:\n f = open(procfile, 'rb')\n except IOError as e:\n warnings.warn('/proc not available for stats: {}'.format(e),\n RuntimeWarning)\n sys.stderr.flush()\n return\n with f:\n start_evt.set()\n old_data = -1\n while not finish_evt.wait(period):\n f.seek(0)\n statm = f.read().decode('ascii')\n data = int(statm.split()[5])\n if data != old_data:\n old_data = data\n print(\" ... process data size: {data:.1f}G\"\n .format(data=data * page_size / (1024 ** 3)))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_bigmemtest_bigmemtest.return.decorator": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_bigmemtest_bigmemtest.return.decorator", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/support.py", "file_name": "support.py", "file_type": "text/x-python", "category": "test", "start_line": 1096, "end_line": 1146, "span_ids": ["bigmemtest"], "tokens": 372}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def bigmemtest(size, memuse, dry_run=True):\n \"\"\"Decorator for bigmem tests.\n\n 'minsize' is the minimum useful size for the test (in arbitrary,\n test-interpreted units.) 'memuse' is the number of 'bytes per size' for\n the test, or a good estimate of it.\n\n if 'dry_run' is False, it means the test doesn't support dummy runs\n when -M is not specified.\n \"\"\"\n def decorator(f):\n def wrapper(self):\n size = wrapper.size\n memuse = wrapper.memuse\n if not real_max_memuse:\n maxsize = 5147\n else:\n maxsize = size\n\n if ((real_max_memuse or not dry_run)\n and real_max_memuse < maxsize * memuse):\n raise unittest.SkipTest(\n \"not enough memory: %.1fG minimum needed\"\n % (size * memuse / (1024 ** 3)))\n\n if real_max_memuse and verbose and threading:\n print()\n print(\" ... expected peak memory use: {peak:.1f}G\"\n .format(peak=size * memuse / (1024 ** 3)))\n sys.stdout.flush()\n start_evt = threading.Event()\n finish_evt = threading.Event()\n t = threading.Thread(target=_memory_watchdog,\n args=(start_evt, finish_evt, 0.5))\n t.daemon = True\n t.start()\n start_evt.set()\n else:\n t = None\n\n try:\n return f(self, maxsize)\n finally:\n if t:\n finish_evt.set()\n t.join()\n\n wrapper.size = size\n wrapper.memuse = memuse\n return wrapper\n return decorator", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_bigaddrspacetest_bigaddrspacetest.return.wrapper": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_bigaddrspacetest_bigaddrspacetest.return.wrapper", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/support.py", "file_name": "support.py", "file_type": "text/x-python", "category": "test", "start_line": 1148, "end_line": 1161, "span_ids": ["bigaddrspacetest"], "tokens": 133}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def bigaddrspacetest(f):\n \"\"\"Decorator for tests that fill the address space.\"\"\"\n def wrapper(self):\n if max_memuse < MAX_Py_ssize_t:\n if MAX_Py_ssize_t >= 2**63 - 1 and max_memuse >= 2**31:\n raise unittest.SkipTest(\n \"not enough memory: try a 32-bit build instead\")\n else:\n raise unittest.SkipTest(\n \"not enough memory: %.1fG minimum needed\"\n % (MAX_Py_ssize_t / (1024 ** 3)))\n else:\n return f(self)\n return wrapper", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_None_62__filter_suite.suite._tests.newtests": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_None_62__filter_suite.suite._tests.newtests", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/support.py", "file_name": "support.py", "file_type": "text/x-python", "category": "test", "start_line": 1163, "end_line": 1233, "span_ids": ["check_impl_detail", "BasicTestRunner.run", "impl_detail", "_id", "_parse_guards", "requires_resource", "_filter_suite", "BasicTestRunner", "cpython_only", "bigaddrspacetest"], "tokens": 531}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "#=======================================================================\n# unittest integration.\n\nclass BasicTestRunner:\n def run(self, test):\n result = unittest.TestResult()\n test(result)\n return result\n\ndef _id(obj):\n return obj\n\ndef requires_resource(resource):\n if resource == 'gui' and not _is_gui_available():\n return unittest.skip(\"resource 'gui' is not available\")\n if is_resource_enabled(resource):\n return _id\n else:\n return unittest.skip(\"resource {0!r} is not enabled\".format(resource))\n\ndef cpython_only(test):\n \"\"\"\n Decorator for tests only applicable on CPython.\n \"\"\"\n return impl_detail(cpython=True)(test)\n\ndef impl_detail(msg=None, **guards):\n if check_impl_detail(**guards):\n return _id\n if msg is None:\n guardnames, default = _parse_guards(guards)\n if default:\n msg = \"implementation detail not available on {0}\"\n else:\n msg = \"implementation detail specific to {0}\"\n guardnames = sorted(guardnames.keys())\n msg = msg.format(' or '.join(guardnames))\n return unittest.skip(msg)\n\ndef _parse_guards(guards):\n # Returns a tuple ({platform_name: run_me}, default_value)\n if not guards:\n return ({'cpython': True}, False)\n is_true = list(guards.values())[0]\n assert list(guards.values()) == [is_true] * len(guards) # all True or all False\n return (guards, not is_true)\n\n# Use the following check to guard CPython's implementation-specific tests --\n# or to run them only on the implementation(s) guarded by the arguments.\ndef check_impl_detail(**guards):\n \"\"\"This function returns True or False depending on the host platform.\n Examples:\n if check_impl_detail(): # only on CPython (default)\n if check_impl_detail(jython=True): # only on Jython\n if check_impl_detail(cpython=False): # everywhere except on CPython\n \"\"\"\n guards, default = _parse_guards(guards)\n return guards.get(platform.python_implementation().lower(), default)\n\n\ndef _filter_suite(suite, pred):\n \"\"\"Recursively filter test cases in a suite based on a predicate.\"\"\"\n newtests = []\n for test in suite._tests:\n if isinstance(test, unittest.TestSuite):\n _filter_suite(test, pred)\n newtests.append(test)\n else:\n if pred(test):\n newtests.append(test)\n suite._tests = newtests", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py__run_suite__run_suite.if_not_result_wasSuccessf.raise_TestFailed_err_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py__run_suite__run_suite.if_not_result_wasSuccessf.raise_TestFailed_err_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/support.py", "file_name": "support.py", "file_type": "text/x-python", "category": "test", "start_line": 1236, "end_line": 1253, "span_ids": ["_run_suite"], "tokens": 151}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _run_suite(suite):\n \"\"\"Run tests from a unittest.TestSuite-derived class.\"\"\"\n if verbose:\n runner = unittest.TextTestRunner(sys.stdout, verbosity=2,\n failfast=failfast)\n else:\n runner = BasicTestRunner()\n\n result = runner.run(suite)\n if not result.wasSuccessful():\n if len(result.errors) == 1 and not result.failures:\n err = result.errors[0][1]\n elif len(result.failures) == 1 and not result.errors:\n err = result.failures[0][1]\n else:\n err = \"multiple errors occurred\"\n if not verbose: err += \"; run in verbose mode for details\"\n raise TestFailed(err)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_run_unittest_run_unittest._run_suite_suite_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_run_unittest_run_unittest._run_suite_suite_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/support.py", "file_name": "support.py", "file_type": "text/x-python", "category": "test", "start_line": 1256, "end_line": 1278, "span_ids": ["run_unittest"], "tokens": 173}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def run_unittest(*classes):\n \"\"\"Run tests from unittest.TestCase-derived classes.\"\"\"\n valid_types = (unittest.TestSuite, unittest.TestCase)\n suite = unittest.TestSuite()\n for cls in classes:\n if isinstance(cls, str):\n if cls in sys.modules:\n suite.addTest(unittest.findTestCases(sys.modules[cls]))\n else:\n raise ValueError(\"str arguments must be keys in sys.modules\")\n elif isinstance(cls, valid_types):\n suite.addTest(cls)\n else:\n suite.addTest(unittest.makeSuite(cls))\n def case_pred(test):\n if match_tests is None:\n return True\n for name in test.id().split(\".\"):\n if fnmatch.fnmatchcase(name, match_tests):\n return True\n return False\n _filter_suite(suite, case_pred)\n _run_suite(suite)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_None_66_modules_setup.return.sys_modules_copy_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_None_66_modules_setup.return.sys_modules_copy_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/support.py", "file_name": "support.py", "file_type": "text/x-python", "category": "test", "start_line": 1281, "end_line": 1312, "span_ids": ["modules_setup", "run_doctest", "run_unittest"], "tokens": 203}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "#=======================================================================\n# doctest driver.\n\ndef run_doctest(module, verbosity=None):\n \"\"\"Run doctest on the given module. Return (#failures, #tests).\n\n If optional argument verbosity is not specified (or is None), pass\n support's belief about verbosity on to doctest. Else doctest's\n usual behavior is used (it searches sys.argv for -v).\n \"\"\"\n\n import doctest\n\n if verbosity is None:\n verbosity = verbose\n else:\n verbosity = None\n\n f, t = doctest.testmod(module, verbose=verbosity)\n if f:\n raise TestFailed(\"%d of %d doctests failed\" % (f, t))\n if verbose:\n print('doctest (%s) ... %d tests with zero failures' %\n (module.__name__, t))\n return f, t\n\n\n#=======================================================================\n# Support for saving and restoring the imported modules.\n\ndef modules_setup():\n return sys.modules.copy(),", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_modules_cleanup_modules_cleanup.sys_modules_update_oldmod": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_modules_cleanup_modules_cleanup.sys_modules_update_oldmod", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/support.py", "file_name": "support.py", "file_type": "text/x-python", "category": "test", "start_line": 1314, "end_line": 1328, "span_ids": ["modules_cleanup"], "tokens": 199}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def modules_cleanup(oldmodules):\n # Encoders/decoders are registered permanently within the internal\n # codec cache. If we destroy the corresponding modules their\n # globals will be set to None which will trip up the cached functions.\n encodings = [(k, v) for k, v in sys.modules.items()\n if k.startswith('encodings.')]\n sys.modules.clear()\n sys.modules.update(encodings)\n # XXX: This kind of problem can affect more than just encodings. In particular\n # extension modules (such as _ssl) don't cope with reloading properly.\n # Really, test modules should be cleaning out the test specific modules they\n # know they added (ala test_runpy) rather than relying on this function (as\n # test_importhooks and test_pkg do currently).\n # Implicitly imported *real* modules should be left alone (see issue 10556).\n sys.modules.update(oldmodules)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_None_70_reap_threads.return.decorator": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_None_70_reap_threads.return.decorator", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/support.py", "file_name": "support.py", "file_type": "text/x-python", "category": "test", "start_line": 1330, "end_line": 1374, "span_ids": ["threading_cleanup", "threading_setup", "reap_threads", "modules_cleanup"], "tokens": 329}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "#=======================================================================\n# Threading support to prevent reporting refleaks when running regrtest.py -R\n\n# NOTE: we use thread._count() rather than threading.enumerate() (or the\n# moral equivalent thereof) because a threading.Thread object is still alive\n# until its __bootstrap() method has returned, even after it has been\n# unregistered from the threading module.\n# thread._count(), on the other hand, only gets decremented *after* the\n# __bootstrap() method has returned, which gives us reliable reference counts\n# at the end of a test run.\n\ndef threading_setup():\n if _thread:\n return _thread._count(), threading._dangling.copy()\n else:\n return 1, ()\n\ndef threading_cleanup(*original_values):\n if not _thread:\n return\n _MAX_COUNT = 10\n for count in range(_MAX_COUNT):\n values = _thread._count(), threading._dangling\n if values == original_values:\n break\n time.sleep(0.1)\n gc_collect()\n # XXX print a warning in case of failure?\n\ndef reap_threads(func):\n \"\"\"Use this function when threads are being used. This will\n ensure that the threads are cleaned up even when the test fails.\n If threading is unavailable this function does nothing.\n \"\"\"\n if not _thread:\n return func\n\n @functools.wraps(func)\n def decorator(*args):\n key = threading_setup()\n try:\n return func(*args)\n finally:\n threading_cleanup(*key)\n return decorator", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_reap_children_reap_children.if_hasattr_os_waitpid_.while_True_.try_.except_.break": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_reap_children_reap_children.if_hasattr_os_waitpid_.while_True_.try_.except_.break", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/support.py", "file_name": "support.py", "file_type": "text/x-python", "category": "test", "start_line": 1376, "end_line": 1394, "span_ids": ["reap_children"], "tokens": 162}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def reap_children():\n \"\"\"Use this function at the end of test_main() whenever sub-processes\n are started. This will help ensure that no extra children (zombies)\n stick around to hog resources and create problems when looking\n for refleaks.\n \"\"\"\n\n # Reap all our dead child processes so we don't leave zombies around.\n # These hog resources and might be causing some of the buildbots to die.\n if hasattr(os, 'waitpid'):\n any_process = -1\n while True:\n try:\n # This will raise an exception on Windows. That's ok.\n pid, status = os.waitpid(any_process, os.WNOHANG)\n if pid == 0:\n break\n except:\n break", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_swap_attr_swap_attr.if_hasattr_obj_attr_.else_.try_.finally_.delattr_obj_attr_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_swap_attr_swap_attr.if_hasattr_obj_attr_.else_.try_.finally_.delattr_obj_attr_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/support.py", "file_name": "support.py", "file_type": "text/x-python", "category": "test", "start_line": 1396, "end_line": 1421, "span_ids": ["swap_attr"], "tokens": 179}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@contextlib.contextmanager\ndef swap_attr(obj, attr, new_val):\n \"\"\"Temporary swap out an attribute with a new object.\n\n Usage:\n with swap_attr(obj, \"attr\", 5):\n ...\n\n This will set obj.attr to 5 for the duration of the with: block,\n restoring the old value at the end of the block. If `attr` doesn't\n exist on `obj`, it will be created and then deleted at the end of the\n block.\n \"\"\"\n if hasattr(obj, attr):\n real_val = getattr(obj, attr)\n setattr(obj, attr, new_val)\n try:\n yield None\n finally:\n setattr(obj, attr, real_val)\n else:\n setattr(obj, attr, new_val)\n try:\n yield None\n finally:\n delattr(obj, attr)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_swap_item_swap_item.if_item_in_obj_.else_.try_.finally_.del_obj_item_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_swap_item_swap_item.if_item_in_obj_.else_.try_.finally_.del_obj_item_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/support.py", "file_name": "support.py", "file_type": "text/x-python", "category": "test", "start_line": 1423, "end_line": 1448, "span_ids": ["swap_item"], "tokens": 173}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@contextlib.contextmanager\ndef swap_item(obj, item, new_val):\n \"\"\"Temporary swap out an item with a new object.\n\n Usage:\n with swap_item(obj, \"item\", 5):\n ...\n\n This will set obj[\"item\"] to 5 for the duration of the with: block,\n restoring the old value at the end of the block. If `item` doesn't\n exist on `obj`, it will be created and then deleted at the end of the\n block.\n \"\"\"\n if item in obj:\n real_val = obj[item]\n obj[item] = new_val\n try:\n yield None\n finally:\n obj[item] = real_val\n else:\n obj[item] = new_val\n try:\n yield None\n finally:\n del obj[item]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_strip_python_stderr_args_from_interpreter_flags.return.args": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_strip_python_stderr_args_from_interpreter_flags.return.args", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/support.py", "file_name": "support.py", "file_type": "text/x-python", "category": "test", "start_line": 1450, "end_line": 1478, "span_ids": ["args_from_interpreter_flags", "strip_python_stderr"], "tokens": 223}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def strip_python_stderr(stderr):\n \"\"\"Strip the stderr of a Python process from potential debug output\n emitted by the interpreter.\n\n This will typically be run on the result of the communicate() method\n of a subprocess.Popen object.\n \"\"\"\n stderr = re.sub(br\"\\[\\d+ refs\\]\\r?\\n?$\", b\"\", stderr).strip()\n return stderr\n\ndef args_from_interpreter_flags():\n \"\"\"Return a list of command-line arguments reproducing the current\n settings in sys.flags.\"\"\"\n flag_opt_map = {\n 'bytes_warning': 'b',\n 'dont_write_bytecode': 'B',\n 'hash_randomization': 'R',\n 'ignore_environment': 'E',\n 'no_user_site': 's',\n 'no_site': 'S',\n 'optimize': 'O',\n 'verbose': 'v',\n }\n args = []\n for flag, opt in flag_opt_map.items():\n v = getattr(sys.flags, flag)\n if v > 0:\n args.append('-' + opt * v)\n return args", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_None_79_TestHandler.matches.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_None_79_TestHandler.matches.return.result", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/support.py", "file_name": "support.py", "file_type": "text/x-python", "category": "test", "start_line": 1480, "end_line": 1510, "span_ids": ["TestHandler.__init__", "TestHandler.matches", "TestHandler.emit", "TestHandler", "args_from_interpreter_flags", "TestHandler.shouldFlush"], "tokens": 201}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "#============================================================\n# Support for assertions about logging.\n#============================================================\n\nclass TestHandler(logging.handlers.BufferingHandler):\n def __init__(self, matcher):\n # BufferingHandler takes a \"capacity\" argument\n # so as to know when to flush. As we're overriding\n # shouldFlush anyway, we can set a capacity of zero.\n # You can call flush() manually to clear out the\n # buffer.\n logging.handlers.BufferingHandler.__init__(self, 0)\n self.matcher = matcher\n\n def shouldFlush(self, record):\n return False\n\n def emit(self, record):\n self.format(record)\n self.buffer.append(record.__dict__)\n\n def matches(self, **kwargs):\n \"\"\"\n Look for a saved dict whose keys/values match the supplied arguments.\n \"\"\"\n result = False\n for d in self.buffer:\n if self.matcher.matches(d, **kwargs):\n result = True\n break\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_Matcher_Matcher.match_value.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_Matcher_Matcher.match_value.return.result", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/support.py", "file_name": "support.py", "file_type": "text/x-python", "category": "test", "start_line": 1512, "end_line": 1543, "span_ids": ["Matcher.matches", "Matcher.match_value", "Matcher"], "tokens": 229}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Matcher(object):\n\n _partial_matches = ('msg', 'message')\n\n def matches(self, d, **kwargs):\n \"\"\"\n Try to match a single dict with the supplied arguments.\n\n Keys whose values are strings and which are in self._partial_matches\n will be checked for partial (i.e. substring) matches. You can extend\n this scheme to (for example) do regular expression matching, etc.\n \"\"\"\n result = True\n for k in kwargs:\n v = kwargs[k]\n dv = d.get(k)\n if not self.match_value(k, dv, v):\n result = False\n break\n return result\n\n def match_value(self, k, dv, v):\n \"\"\"\n Try to match a single stored value (dv) with a supplied value (v).\n \"\"\"\n if type(v) != type(dv):\n result = False\n elif type(dv) is not str or k not in self._partial_matches:\n result = (v == dv)\n else:\n result = dv.find(v) >= 0\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py__can_symlink_skip_unless_symlink.if_ok_.else_.return.unittest_skip_msg_test_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py__can_symlink_skip_unless_symlink.if_ok_.else_.return.unittest_skip_msg_test_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/support.py", "file_name": "support.py", "file_type": "text/x-python", "category": "test", "start_line": 1546, "end_line": 1569, "span_ids": ["can_symlink", "impl:85", "skip_unless_symlink"], "tokens": 161}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "_can_symlink = None # type: Any\ndef can_symlink():\n global _can_symlink\n if _can_symlink is not None:\n return _can_symlink\n symlink_path = TESTFN + \"can_symlink\"\n try:\n os.symlink(TESTFN, symlink_path)\n can = True\n except (OSError, NotImplementedError, AttributeError):\n can = False\n else:\n os.remove(symlink_path)\n _can_symlink = can\n return can\n\ndef skip_unless_symlink(test):\n \"\"\"Skip decorator for tests that require functional symlink\"\"\"\n ok = can_symlink()\n msg = \"Requires functional symlink implementation\"\n if ok:\n return test\n else:\n return unittest.skip(msg)(test)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_patch_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/support.py_patch_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/support.py", "file_name": "support.py", "file_type": "text/x-python", "category": "test", "start_line": 1571, "end_line": 1603, "span_ids": ["patch"], "tokens": 254}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def patch(test_instance, object_to_patch, attr_name, new_value):\n \"\"\"Override 'object_to_patch'.'attr_name' with 'new_value'.\n\n Also, add a cleanup procedure to 'test_instance' to restore\n 'object_to_patch' value for 'attr_name'.\n The 'attr_name' should be a valid attribute for 'object_to_patch'.\n\n \"\"\"\n # check that 'attr_name' is a real attribute for 'object_to_patch'\n # will raise AttributeError if it does not exist\n getattr(object_to_patch, attr_name)\n\n # keep a copy of the old value\n attr_is_local = False\n try:\n old_value = object_to_patch.__dict__[attr_name]\n except (AttributeError, KeyError):\n old_value = getattr(object_to_patch, attr_name, None)\n else:\n attr_is_local = True\n\n # restore the value when the test is done\n def cleanup():\n if attr_is_local:\n setattr(object_to_patch, attr_name, old_value)\n else:\n delattr(object_to_patch, attr_name)\n\n test_instance.addCleanup(cleanup)\n\n # actually override the attribute\n setattr(object_to_patch, attr_name, new_value)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_base64.py_unittest_LegacyBase64TestCase.test_encodebytes.self_assertRaises_TypeErr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_base64.py_unittest_LegacyBase64TestCase.test_encodebytes.self_assertRaises_TypeErr", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_base64.py", "file_name": "test_base64.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 26, "span_ids": ["imports", "LegacyBase64TestCase", "LegacyBase64TestCase.test_encodebytes"], "tokens": 289}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import unittest\nfrom test import support\nimport base64\nimport binascii\nimport sys\nimport subprocess\n\nfrom typing import Any\n\n\n\nclass LegacyBase64TestCase(unittest.TestCase):\n def test_encodebytes(self) -> None:\n eq = self.assertEqual\n eq(base64.encodebytes(b\"www.python.org\"), b\"d3d3LnB5dGhvbi5vcmc=\\n\")\n eq(base64.encodebytes(b\"a\"), b\"YQ==\\n\")\n eq(base64.encodebytes(b\"ab\"), b\"YWI=\\n\")\n eq(base64.encodebytes(b\"abc\"), b\"YWJj\\n\")\n eq(base64.encodebytes(b\"\"), b\"\")\n eq(base64.encodebytes(b\"abcdefghijklmnopqrstuvwxyz\"\n b\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n b\"0123456789!@#0^&*();:<>,. []{}\"),\n b\"YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQkNE\"\n b\"RUZHSElKS0xNTk9QUVJTVFVWV1hZWjAxMjM0\\nNT\"\n b\"Y3ODkhQCMwXiYqKCk7Ojw+LC4gW117fQ==\\n\")\n self.assertRaises(TypeError, base64.encodebytes, \"\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_base64.py_LegacyBase64TestCase.test_decodebytes_LegacyBase64TestCase.test_decodebytes.self_assertRaises_TypeErr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_base64.py_LegacyBase64TestCase.test_decodebytes_LegacyBase64TestCase.test_decodebytes.self_assertRaises_TypeErr", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_base64.py", "file_name": "test_base64.py", "file_type": "text/x-python", "category": "test", "start_line": 28, "end_line": 41, "span_ids": ["LegacyBase64TestCase.test_decodebytes"], "tokens": 262}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LegacyBase64TestCase(unittest.TestCase):\n\n def test_decodebytes(self) -> None:\n eq = self.assertEqual\n eq(base64.decodebytes(b\"d3d3LnB5dGhvbi5vcmc=\\n\"), b\"www.python.org\")\n eq(base64.decodebytes(b\"YQ==\\n\"), b\"a\")\n eq(base64.decodebytes(b\"YWI=\\n\"), b\"ab\")\n eq(base64.decodebytes(b\"YWJj\\n\"), b\"abc\")\n eq(base64.decodebytes(b\"YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQkNE\"\n b\"RUZHSElKS0xNTk9QUVJTVFVWV1hZWjAxMjM0\\nNT\"\n b\"Y3ODkhQCMwXiYqKCk7Ojw+LC4gW117fQ==\\n\"),\n b\"abcdefghijklmnopqrstuvwxyz\"\n b\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n b\"0123456789!@#0^&*();:<>,. []{}\")\n eq(base64.decodebytes(b''), b'')\n self.assertRaises(TypeError, base64.decodebytes, \"\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_base64.py_LegacyBase64TestCase.test_encode_LegacyBase64TestCase.test_decode.self_assertEqual_outfp_ge": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_base64.py_LegacyBase64TestCase.test_encode_LegacyBase64TestCase.test_decode.self_assertEqual_outfp_ge", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_base64.py", "file_name": "test_base64.py", "file_type": "text/x-python", "category": "test", "start_line": 43, "end_line": 61, "span_ids": ["LegacyBase64TestCase.test_decode", "LegacyBase64TestCase.test_encode"], "tokens": 256}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LegacyBase64TestCase(unittest.TestCase):\n\n def test_encode(self) -> None:\n eq = self.assertEqual\n from io import BytesIO\n infp = BytesIO(b'abcdefghijklmnopqrstuvwxyz'\n b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'\n b'0123456789!@#0^&*();:<>,. []{}')\n outfp = BytesIO()\n base64.encode(infp, outfp)\n eq(outfp.getvalue(),\n b'YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQkNE'\n b'RUZHSElKS0xNTk9QUVJTVFVWV1hZWjAxMjM0\\nNT'\n b'Y3ODkhQCMwXiYqKCk7Ojw+LC4gW117fQ==\\n')\n\n def test_decode(self) -> None:\n from io import BytesIO\n infp = BytesIO(b'd3d3LnB5dGhvbi5vcmc=')\n outfp = BytesIO()\n base64.decode(infp, outfp)\n self.assertEqual(outfp.getvalue(), b'www.python.org')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_base64.py_BaseXYTestCase_BaseXYTestCase.test_b64encode.None_19": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_base64.py_BaseXYTestCase_BaseXYTestCase.test_b64encode.None_19", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_base64.py", "file_name": "test_base64.py", "file_type": "text/x-python", "category": "test", "start_line": 64, "end_line": 103, "span_ids": ["BaseXYTestCase.test_b64encode", "BaseXYTestCase"], "tokens": 701}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseXYTestCase(unittest.TestCase):\n def test_b64encode(self) -> None:\n eq = self.assertEqual\n # Test default alphabet\n eq(base64.b64encode(b\"www.python.org\"), b\"d3d3LnB5dGhvbi5vcmc=\")\n eq(base64.b64encode(b'\\x00'), b'AA==')\n eq(base64.b64encode(b\"a\"), b\"YQ==\")\n eq(base64.b64encode(b\"ab\"), b\"YWI=\")\n eq(base64.b64encode(b\"abc\"), b\"YWJj\")\n eq(base64.b64encode(b\"\"), b\"\")\n eq(base64.b64encode(b\"abcdefghijklmnopqrstuvwxyz\"\n b\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n b\"0123456789!@#0^&*();:<>,. []{}\"),\n b\"YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQkNE\"\n b\"RUZHSElKS0xNTk9QUVJTVFVWV1hZWjAxMjM0NT\"\n b\"Y3ODkhQCMwXiYqKCk7Ojw+LC4gW117fQ==\")\n # Test with arbitrary alternative characters\n eq(base64.b64encode(b'\\xd3V\\xbeo\\xf7\\x1d', altchars=b'*$'), b'01a*b$cd')\n # Check if passing a str object raises an error\n self.assertRaises(TypeError, base64.b64encode, \"\")\n self.assertRaises(TypeError, base64.b64encode, b\"\", altchars=\"\")\n # Test standard alphabet\n eq(base64.standard_b64encode(b\"www.python.org\"), b\"d3d3LnB5dGhvbi5vcmc=\")\n eq(base64.standard_b64encode(b\"a\"), b\"YQ==\")\n eq(base64.standard_b64encode(b\"ab\"), b\"YWI=\")\n eq(base64.standard_b64encode(b\"abc\"), b\"YWJj\")\n eq(base64.standard_b64encode(b\"\"), b\"\")\n eq(base64.standard_b64encode(b\"abcdefghijklmnopqrstuvwxyz\"\n b\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n b\"0123456789!@#0^&*();:<>,. []{}\"),\n b\"YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQkNE\"\n b\"RUZHSElKS0xNTk9QUVJTVFVWV1hZWjAxMjM0NT\"\n b\"Y3ODkhQCMwXiYqKCk7Ojw+LC4gW117fQ==\")\n # Check if passing a str object raises an error\n self.assertRaises(TypeError, base64.standard_b64encode, \"\")\n self.assertRaises(TypeError, base64.standard_b64encode, b\"\", altchars=\"\")\n # Test with 'URL safe' alternative characters\n eq(base64.urlsafe_b64encode(b'\\xd3V\\xbeo\\xf7\\x1d'), b'01a-b_cd')\n # Check if passing a str object raises an error\n self.assertRaises(TypeError, base64.urlsafe_b64encode, \"\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_base64.py_BaseXYTestCase.test_b64decode_BaseXYTestCase.test_b64decode.None_19": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_base64.py_BaseXYTestCase.test_b64decode_BaseXYTestCase.test_b64decode.None_19", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_base64.py", "file_name": "test_base64.py", "file_type": "text/x-python", "category": "test", "start_line": 105, "end_line": 141, "span_ids": ["BaseXYTestCase.test_b64decode"], "tokens": 684}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseXYTestCase(unittest.TestCase):\n\n def test_b64decode(self) -> None:\n eq = self.assertEqual\n eq(base64.b64decode(b\"d3d3LnB5dGhvbi5vcmc=\"), b\"www.python.org\")\n eq(base64.b64decode(b'AA=='), b'\\x00')\n eq(base64.b64decode(b\"YQ==\"), b\"a\")\n eq(base64.b64decode(b\"YWI=\"), b\"ab\")\n eq(base64.b64decode(b\"YWJj\"), b\"abc\")\n eq(base64.b64decode(b\"YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQkNE\"\n b\"RUZHSElKS0xNTk9QUVJTVFVWV1hZWjAxMjM0\\nNT\"\n b\"Y3ODkhQCMwXiYqKCk7Ojw+LC4gW117fQ==\"),\n b\"abcdefghijklmnopqrstuvwxyz\"\n b\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n b\"0123456789!@#0^&*();:<>,. []{}\")\n eq(base64.b64decode(b''), b'')\n # Test with arbitrary alternative characters\n eq(base64.b64decode(b'01a*b$cd', altchars=b'*$'), b'\\xd3V\\xbeo\\xf7\\x1d')\n # Check if passing a str object raises an error\n self.assertRaises(TypeError, base64.b64decode, \"\")\n self.assertRaises(TypeError, base64.b64decode, b\"\", altchars=\"\")\n # Test standard alphabet\n eq(base64.standard_b64decode(b\"d3d3LnB5dGhvbi5vcmc=\"), b\"www.python.org\")\n eq(base64.standard_b64decode(b\"YQ==\"), b\"a\")\n eq(base64.standard_b64decode(b\"YWI=\"), b\"ab\")\n eq(base64.standard_b64decode(b\"YWJj\"), b\"abc\")\n eq(base64.standard_b64decode(b\"\"), b\"\")\n eq(base64.standard_b64decode(b\"YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQkNE\"\n b\"RUZHSElKS0xNTk9QUVJTVFVWV1hZWjAxMjM0NT\"\n b\"Y3ODkhQCMwXiYqKCk7Ojw+LC4gW117fQ==\"),\n b\"abcdefghijklmnopqrstuvwxyz\"\n b\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n b\"0123456789!@#0^&*();:<>,. []{}\")\n # Check if passing a str object raises an error\n self.assertRaises(TypeError, base64.standard_b64decode, \"\")\n self.assertRaises(TypeError, base64.standard_b64decode, b\"\", altchars=\"\")\n # Test with 'URL safe' alternative characters\n eq(base64.urlsafe_b64decode(b'01a-b_cd'), b'\\xd3V\\xbeo\\xf7\\x1d')\n self.assertRaises(TypeError, base64.urlsafe_b64decode, \"\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_base64.py_BaseXYTestCase.test_b64decode_padding_error_BaseXYTestCase.test_b64decode_invalid_chars.for_bstr_res_in_tests_.with_self_assertRaises_bi.base64_b64decode_bstr_va": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_base64.py_BaseXYTestCase.test_b64decode_padding_error_BaseXYTestCase.test_b64decode_invalid_chars.for_bstr_res_in_tests_.with_self_assertRaises_bi.base64_b64decode_bstr_va", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_base64.py", "file_name": "test_base64.py", "file_type": "text/x-python", "category": "test", "start_line": 143, "end_line": 160, "span_ids": ["BaseXYTestCase.test_b64decode_padding_error", "BaseXYTestCase.test_b64decode_invalid_chars"], "tokens": 210}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseXYTestCase(unittest.TestCase):\n\n def test_b64decode_padding_error(self) -> None:\n self.assertRaises(binascii.Error, base64.b64decode, b'abc')\n\n def test_b64decode_invalid_chars(self) -> None:\n # issue 1466065: Test some invalid characters.\n tests = ((b'%3d==', b'\\xdd'),\n (b'$3d==', b'\\xdd'),\n (b'[==', b''),\n (b'YW]3=', b'am'),\n (b'3{d==', b'\\xdd'),\n (b'3d}==', b'\\xdd'),\n (b'@@', b''),\n (b'!', b''),\n (b'YWJj\\nYWI=', b'abcab'))\n for bstr, res in tests:\n self.assertEqual(base64.b64decode(bstr), res)\n with self.assertRaises(binascii.Error):\n base64.b64decode(bstr, validate=True)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_base64.py_BaseXYTestCase.test_b32encode_BaseXYTestCase.test_b32encode.self_assertRaises_TypeErr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_base64.py_BaseXYTestCase.test_b32encode_BaseXYTestCase.test_b32encode.self_assertRaises_TypeErr", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_base64.py", "file_name": "test_base64.py", "file_type": "text/x-python", "category": "test", "start_line": 162, "end_line": 171, "span_ids": ["BaseXYTestCase.test_b32encode"], "tokens": 152}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseXYTestCase(unittest.TestCase):\n\n def test_b32encode(self) -> None:\n eq = self.assertEqual\n eq(base64.b32encode(b''), b'')\n eq(base64.b32encode(b'\\x00'), b'AA======')\n eq(base64.b32encode(b'a'), b'ME======')\n eq(base64.b32encode(b'ab'), b'MFRA====')\n eq(base64.b32encode(b'abc'), b'MFRGG===')\n eq(base64.b32encode(b'abcd'), b'MFRGGZA=')\n eq(base64.b32encode(b'abcde'), b'MFRGGZDF')\n self.assertRaises(TypeError, base64.b32encode, \"\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_base64.py_BaseXYTestCase.test_b32decode_BaseXYTestCase.test_b32decode.self_assertRaises_TypeErr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_base64.py_BaseXYTestCase.test_b32decode_BaseXYTestCase.test_b32decode.self_assertRaises_TypeErr", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_base64.py", "file_name": "test_base64.py", "file_type": "text/x-python", "category": "test", "start_line": 173, "end_line": 182, "span_ids": ["BaseXYTestCase.test_b32decode"], "tokens": 152}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseXYTestCase(unittest.TestCase):\n\n def test_b32decode(self) -> None:\n eq = self.assertEqual\n eq(base64.b32decode(b''), b'')\n eq(base64.b32decode(b'AA======'), b'\\x00')\n eq(base64.b32decode(b'ME======'), b'a')\n eq(base64.b32decode(b'MFRA===='), b'ab')\n eq(base64.b32decode(b'MFRGG==='), b'abc')\n eq(base64.b32decode(b'MFRGGZA='), b'abcd')\n eq(base64.b32decode(b'MFRGGZDF'), b'abcde')\n self.assertRaises(TypeError, base64.b32decode, \"\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_base64.py_BaseXYTestCase.test_b32decode_casefold_BaseXYTestCase.test_b32decode_casefold.None_15": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_base64.py_BaseXYTestCase.test_b32decode_casefold_BaseXYTestCase.test_b32decode_casefold.None_15", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_base64.py", "file_name": "test_base64.py", "file_type": "text/x-python", "category": "test", "start_line": 184, "end_line": 204, "span_ids": ["BaseXYTestCase.test_b32decode_casefold"], "tokens": 362}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseXYTestCase(unittest.TestCase):\n\n def test_b32decode_casefold(self) -> None:\n eq = self.assertEqual\n eq(base64.b32decode(b'', True), b'')\n eq(base64.b32decode(b'ME======', True), b'a')\n eq(base64.b32decode(b'MFRA====', True), b'ab')\n eq(base64.b32decode(b'MFRGG===', True), b'abc')\n eq(base64.b32decode(b'MFRGGZA=', True), b'abcd')\n eq(base64.b32decode(b'MFRGGZDF', True), b'abcde')\n # Lower cases\n eq(base64.b32decode(b'me======', True), b'a')\n eq(base64.b32decode(b'mfra====', True), b'ab')\n eq(base64.b32decode(b'mfrgg===', True), b'abc')\n eq(base64.b32decode(b'mfrggza=', True), b'abcd')\n eq(base64.b32decode(b'mfrggzdf', True), b'abcde')\n # Expected exceptions\n self.assertRaises(TypeError, base64.b32decode, b'me======')\n # Mapping zero and one\n eq(base64.b32decode(b'MLO23456'), b'b\\xdd\\xad\\xf3\\xbe')\n eq(base64.b32decode(b'M1023456', map01=b'L'), b'b\\xdd\\xad\\xf3\\xbe')\n eq(base64.b32decode(b'M1023456', map01=b'I'), b'b\\x1d\\xad\\xf3\\xbe')\n self.assertRaises(TypeError, base64.b32decode, b\"\", map01=\"\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_base64.py_BaseXYTestCase.test_b32decode_error_BaseXYTestCase.test_b16encode.self_assertRaises_TypeErr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_base64.py_BaseXYTestCase.test_b32decode_error_BaseXYTestCase.test_b16encode.self_assertRaises_TypeErr", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_base64.py", "file_name": "test_base64.py", "file_type": "text/x-python", "category": "test", "start_line": 206, "end_line": 214, "span_ids": ["BaseXYTestCase.test_b16encode", "BaseXYTestCase.test_b32decode_error"], "tokens": 127}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseXYTestCase(unittest.TestCase):\n\n def test_b32decode_error(self) -> None:\n self.assertRaises(binascii.Error, base64.b32decode, b'abc')\n self.assertRaises(binascii.Error, base64.b32decode, b'ABCDEF==')\n\n def test_b16encode(self) -> None:\n eq = self.assertEqual\n eq(base64.b16encode(b'\\x01\\x02\\xab\\xcd\\xef'), b'0102ABCDEF')\n eq(base64.b16encode(b'\\x00'), b'00')\n self.assertRaises(TypeError, base64.b16encode, \"\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_base64.py_BaseXYTestCase.test_b16decode_BaseXYTestCase.test_ErrorHeritage.self_assertTrue_issubclas": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_base64.py_BaseXYTestCase.test_b16decode_BaseXYTestCase.test_ErrorHeritage.self_assertTrue_issubclas", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_base64.py", "file_name": "test_base64.py", "file_type": "text/x-python", "category": "test", "start_line": 216, "end_line": 227, "span_ids": ["BaseXYTestCase.test_ErrorHeritage", "BaseXYTestCase.test_b16decode"], "tokens": 166}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseXYTestCase(unittest.TestCase):\n\n def test_b16decode(self) -> None:\n eq = self.assertEqual\n eq(base64.b16decode(b'0102ABCDEF'), b'\\x01\\x02\\xab\\xcd\\xef')\n eq(base64.b16decode(b'00'), b'\\x00')\n # Lower case is not allowed without a flag\n self.assertRaises(binascii.Error, base64.b16decode, b'0102abcdef')\n # Case fold\n eq(base64.b16decode(b'0102abcdef', True), b'\\x01\\x02\\xab\\xcd\\xef')\n self.assertRaises(TypeError, base64.b16decode, \"\")\n\n def test_ErrorHeritage(self) -> None:\n self.assertTrue(issubclass(binascii.Error, ValueError))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_base64.py_TestMain_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_base64.py_TestMain_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_base64.py", "file_name": "test_base64.py", "file_type": "text/x-python", "category": "test", "start_line": 231, "end_line": 268, "span_ids": ["impl", "TestMain.get_output", "TestMain", "TestMain.test_encode_decode", "TestMain.test_encode_file", "TestMain.test_decode", "test_main"], "tokens": 329}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestMain(unittest.TestCase):\n def get_output(self, *args_tuple: str, **options: Any) -> Any:\n args = [sys.executable, '-m', 'base64'] + list(args_tuple)\n return subprocess.check_output(args, **options)\n\n def test_encode_decode(self) -> None:\n output = self.get_output('-t')\n self.assertSequenceEqual(output.splitlines(), [\n b\"b'Aladdin:open sesame'\",\n br\"b'QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\n'\",\n b\"b'Aladdin:open sesame'\",\n ])\n\n def test_encode_file(self) -> None:\n with open(support.TESTFN, 'wb') as fp:\n fp.write(b'a\\xffb\\n')\n\n output = self.get_output('-e', support.TESTFN)\n self.assertEqual(output.rstrip(), b'Yf9iCg==')\n\n with open(support.TESTFN, 'rb') as fp:\n output = self.get_output('-e', stdin=fp)\n self.assertEqual(output.rstrip(), b'Yf9iCg==')\n\n def test_decode(self) -> None:\n with open(support.TESTFN, 'wb') as fp:\n fp.write(b'Yf9iCg==')\n output = self.get_output('-d', support.TESTFN)\n self.assertEqual(output.rstrip(), b'a\\xffb')\n\n\n\ndef test_main() -> None:\n support.run_unittest(__name__)\n\nif __name__ == '__main__':\n test_main()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_fnmatch.py__Test_cases_for_the_fnm_FnmatchTestCase.test_fnmatch.check_n_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_fnmatch.py__Test_cases_for_the_fnm_FnmatchTestCase.test_fnmatch.check_n_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_fnmatch.py", "file_name": "test_fnmatch.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 49, "span_ids": ["FnmatchTestCase.test_fnmatch", "FnmatchTestCase.check_match", "FnmatchTestCase", "docstring"], "tokens": 392}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Test cases for the fnmatch module.\"\"\"\n\nfrom test import support\nimport unittest\n\nfrom fnmatch import fnmatch, fnmatchcase, translate, filter\n\nfrom typing import Any, AnyStr, Callable\n\nclass FnmatchTestCase(unittest.TestCase):\n\n def check_match(self, filename: AnyStr, pattern: AnyStr,\n should_match: int = 1,\n fn: Any = fnmatch) -> None: # see #270\n if should_match:\n self.assertTrue(fn(filename, pattern),\n \"expected %r to match pattern %r\"\n % (filename, pattern))\n else:\n self.assertTrue(not fn(filename, pattern),\n \"expected %r not to match pattern %r\"\n % (filename, pattern))\n\n def test_fnmatch(self) -> None:\n check = self.check_match\n check('abc', 'abc')\n check('abc', '?*?')\n check('abc', '???*')\n check('abc', '*???')\n check('abc', '???')\n check('abc', '*')\n check('abc', 'ab[cd]')\n check('abc', 'ab[!de]')\n check('abc', 'ab[de]', 0)\n check('a', '??', 0)\n check('a', 'b', 0)\n\n # these test that '\\' is handled correctly in character sets;\n # see SF bug #409651\n check('\\\\', r'[\\]')\n check('a', r'[!\\]')\n check('\\\\', r'[!\\]', 0)\n\n # test that filenames with newlines in them are handled correctly.\n # http://bugs.python.org/issue6665\n check('foo\\nbar', 'foo*')\n check('foo\\nbar\\n', 'foo*')\n check('\\nfoo', 'foo*', False)\n check('\\n', '*')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_fnmatch.py_FnmatchTestCase.test_mix_bytes_str_FnmatchTestCase.test_bytes.self_check_match_b_foo_nb": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_fnmatch.py_FnmatchTestCase.test_mix_bytes_str_FnmatchTestCase.test_bytes.self_check_match_b_foo_nb", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_fnmatch.py", "file_name": "test_fnmatch.py", "file_type": "text/x-python", "category": "test", "start_line": 51, "end_line": 65, "span_ids": ["FnmatchTestCase.test_fnmatchcase", "FnmatchTestCase.test_bytes", "FnmatchTestCase.test_mix_bytes_str"], "tokens": 178}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FnmatchTestCase(unittest.TestCase):\n\n def test_mix_bytes_str(self) -> None:\n self.assertRaises(TypeError, fnmatch, 'test', b'*')\n self.assertRaises(TypeError, fnmatch, b'test', '*')\n self.assertRaises(TypeError, fnmatchcase, 'test', b'*')\n self.assertRaises(TypeError, fnmatchcase, b'test', '*')\n\n def test_fnmatchcase(self) -> None:\n check = self.check_match\n check('AbC', 'abc', 0, fnmatchcase)\n check('abc', 'AbC', 0, fnmatchcase)\n\n def test_bytes(self) -> None:\n self.check_match(b'test', b'te*')\n self.check_match(b'test\\xff', b'te*\\xff')\n self.check_match(b'foo\\nbar', b'foo*')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_fnmatch.py_TranslateTestCase_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_fnmatch.py_TranslateTestCase_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_fnmatch.py", "file_name": "test_fnmatch.py", "file_type": "text/x-python", "category": "test", "start_line": 67, "end_line": 94, "span_ids": ["FilterTestCase", "FilterTestCase.test_filter", "impl", "TranslateTestCase.test_translate", "TranslateTestCase", "test_main"], "tokens": 223}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TranslateTestCase(unittest.TestCase):\n\n def test_translate(self) -> None:\n self.assertEqual(translate('*'), r'.*\\Z(?ms)')\n self.assertEqual(translate('?'), r'.\\Z(?ms)')\n self.assertEqual(translate('a?b*'), r'a.b.*\\Z(?ms)')\n self.assertEqual(translate('[abc]'), r'[abc]\\Z(?ms)')\n self.assertEqual(translate('[]]'), r'[]]\\Z(?ms)')\n self.assertEqual(translate('[!x]'), r'[^x]\\Z(?ms)')\n self.assertEqual(translate('[^x]'), r'[\\\\^x]\\Z(?ms)')\n self.assertEqual(translate('[x'), r'\\\\[x\\Z(?ms)')\n\n\nclass FilterTestCase(unittest.TestCase):\n\n def test_filter(self) -> None:\n self.assertEqual(filter(['a', 'b'], 'a'), ['a'])\n\n\ndef test_main() -> None:\n support.run_unittest(FnmatchTestCase,\n TranslateTestCase,\n FilterTestCase)\n\n\nif __name__ == \"__main__\":\n test_main()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_genericpath.py___GenericTest.test_no_argument.for_attr_in_self_common_a.with_self_assertRaises_Ty.self_fail_did_no": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_genericpath.py___GenericTest.test_no_argument.for_attr_in_self_common_a.with_self_assertRaises_Ty.self_fail_did_no", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_genericpath.py", "file_name": "test_genericpath.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 36, "span_ids": ["safe_rmdir", "GenericTest", "GenericTest.test_no_argument", "docstring"], "tokens": 224}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"\nTests common to genericpath, macpath, ntpath and posixpath\n\"\"\"\n\nimport unittest\nfrom test import support\nimport os\n\nimport genericpath\nimport imp\nimp.reload(genericpath) # Make sure we are using the local copy\n\nimport sys\nfrom typing import Any, List\n\n\ndef safe_rmdir(dirname: str) -> None:\n try:\n os.rmdir(dirname)\n except OSError:\n pass\n\n\nclass GenericTest(unittest.TestCase):\n # The path module to be tested\n pathmodule = genericpath # type: Any\n common_attributes = ['commonprefix', 'getsize', 'getatime', 'getctime',\n 'getmtime', 'exists', 'isdir', 'isfile']\n attributes = [] # type: List[str]\n\n def test_no_argument(self) -> None:\n for attr in self.common_attributes + self.attributes:\n with self.assertRaises(TypeError):\n getattr(self.pathmodule, attr)()\n self.fail(\"{}.{}() did not raise a TypeError\"\n .format(self.pathmodule.__name__, attr))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_genericpath.py_GenericTest.test_commonprefix_GenericTest.test_commonprefix.for_s1_in_testlist_.for_s2_in_testlist_.if_s1_s2_.self_assertNotEqual_s1_n_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_genericpath.py_GenericTest.test_commonprefix_GenericTest.test_commonprefix.for_s1_in_testlist_.for_s2_in_testlist_.if_s1_s2_.self_assertNotEqual_s1_n_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_genericpath.py", "file_name": "test_genericpath.py", "file_type": "text/x-python", "category": "test", "start_line": 38, "end_line": 103, "span_ids": ["GenericTest.test_commonprefix"], "tokens": 564}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GenericTest(unittest.TestCase):\n\n def test_commonprefix(self) -> None:\n commonprefix = self.pathmodule.commonprefix\n self.assertEqual(\n commonprefix([]),\n \"\"\n )\n self.assertEqual(\n commonprefix([\"/home/swenson/spam\", \"/home/swen/spam\"]),\n \"/home/swen\"\n )\n self.assertEqual(\n commonprefix([\"/home/swen/spam\", \"/home/swen/eggs\"]),\n \"/home/swen/\"\n )\n self.assertEqual(\n commonprefix([\"/home/swen/spam\", \"/home/swen/spam\"]),\n \"/home/swen/spam\"\n )\n self.assertEqual(\n commonprefix([\"home:swenson:spam\", \"home:swen:spam\"]),\n \"home:swen\"\n )\n self.assertEqual(\n commonprefix([\":home:swen:spam\", \":home:swen:eggs\"]),\n \":home:swen:\"\n )\n self.assertEqual(\n commonprefix([\":home:swen:spam\", \":home:swen:spam\"]),\n \":home:swen:spam\"\n )\n\n self.assertEqual(\n commonprefix([b\"/home/swenson/spam\", b\"/home/swen/spam\"]),\n b\"/home/swen\"\n )\n self.assertEqual(\n commonprefix([b\"/home/swen/spam\", b\"/home/swen/eggs\"]),\n b\"/home/swen/\"\n )\n self.assertEqual(\n commonprefix([b\"/home/swen/spam\", b\"/home/swen/spam\"]),\n b\"/home/swen/spam\"\n )\n self.assertEqual(\n commonprefix([b\"home:swenson:spam\", b\"home:swen:spam\"]),\n b\"home:swen\"\n )\n self.assertEqual(\n commonprefix([b\":home:swen:spam\", b\":home:swen:eggs\"]),\n b\":home:swen:\"\n )\n self.assertEqual(\n commonprefix([b\":home:swen:spam\", b\":home:swen:spam\"]),\n b\":home:swen:spam\"\n )\n\n testlist = ['', 'abc', 'Xbcd', 'Xb', 'XY', 'abcd',\n 'aXc', 'abd', 'ab', 'aX', 'abcX']\n for s1 in testlist:\n for s2 in testlist:\n p = commonprefix([s1, s2])\n self.assertTrue(s1.startswith(p))\n self.assertTrue(s2.startswith(p))\n if s1 != s2:\n n = len(p)\n self.assertNotEqual(s1[n:n+1], s2[n:n+1])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_genericpath.py_GenericTest.test_getsize_GenericTest.test_time.try_.finally_.support_unlink_support_TE": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_genericpath.py_GenericTest.test_getsize_GenericTest.test_time.try_.finally_.support_unlink_support_TE", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_genericpath.py", "file_name": "test_genericpath.py", "file_type": "text/x-python", "category": "test", "start_line": 105, "end_line": 136, "span_ids": ["GenericTest.test_getsize", "GenericTest.test_time"], "tokens": 219}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GenericTest(unittest.TestCase):\n\n def test_getsize(self) -> None:\n f = open(support.TESTFN, \"wb\")\n try:\n f.write(b\"foo\")\n f.close()\n self.assertEqual(self.pathmodule.getsize(support.TESTFN), 3)\n finally:\n if not f.closed:\n f.close()\n support.unlink(support.TESTFN)\n\n def test_time(self) -> None:\n f = open(support.TESTFN, \"wb\")\n try:\n f.write(b\"foo\")\n f.close()\n f = open(support.TESTFN, \"ab\")\n f.write(b\"bar\")\n f.close()\n f = open(support.TESTFN, \"rb\")\n d = f.read()\n f.close()\n self.assertEqual(d, b\"foobar\")\n\n self.assertLessEqual(\n self.pathmodule.getctime(support.TESTFN),\n self.pathmodule.getmtime(support.TESTFN)\n )\n finally:\n if not f.closed:\n f.close()\n support.unlink(support.TESTFN)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_genericpath.py_GenericTest.test_exists_GenericTest.test_isdir.try_.finally_.safe_rmdir_support_TESTFN": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_genericpath.py_GenericTest.test_exists_GenericTest.test_isdir.try_.finally_.safe_rmdir_support_TESTFN", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_genericpath.py", "file_name": "test_genericpath.py", "file_type": "text/x-python", "category": "test", "start_line": 138, "end_line": 168, "span_ids": ["GenericTest.test_exists", "GenericTest.test_isdir"], "tokens": 249}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GenericTest(unittest.TestCase):\n\n def test_exists(self) -> None:\n self.assertIs(self.pathmodule.exists(support.TESTFN), False)\n f = open(support.TESTFN, \"wb\")\n try:\n f.write(b\"foo\")\n f.close()\n self.assertIs(self.pathmodule.exists(support.TESTFN), True)\n if not self.pathmodule == genericpath:\n self.assertIs(self.pathmodule.lexists(support.TESTFN),\n True)\n finally:\n if not f.closed:\n f.close()\n support.unlink(support.TESTFN)\n\n def test_isdir(self) -> None:\n self.assertIs(self.pathmodule.isdir(support.TESTFN), False)\n f = open(support.TESTFN, \"wb\")\n try:\n f.write(b\"foo\")\n f.close()\n self.assertIs(self.pathmodule.isdir(support.TESTFN), False)\n os.remove(support.TESTFN)\n os.mkdir(support.TESTFN)\n self.assertIs(self.pathmodule.isdir(support.TESTFN), True)\n os.rmdir(support.TESTFN)\n finally:\n if not f.closed:\n f.close()\n support.unlink(support.TESTFN)\n safe_rmdir(support.TESTFN)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_genericpath.py_GenericTest.test_isfile_GenericTest.test_isfile.try_.finally_.safe_rmdir_support_TESTFN": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_genericpath.py_GenericTest.test_isfile_GenericTest.test_isfile.try_.finally_.safe_rmdir_support_TESTFN", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_genericpath.py", "file_name": "test_genericpath.py", "file_type": "text/x-python", "category": "test", "start_line": 170, "end_line": 185, "span_ids": ["GenericTest.test_isfile"], "tokens": 139}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GenericTest(unittest.TestCase):\n\n def test_isfile(self) -> None:\n self.assertIs(self.pathmodule.isfile(support.TESTFN), False)\n f = open(support.TESTFN, \"wb\")\n try:\n f.write(b\"foo\")\n f.close()\n self.assertIs(self.pathmodule.isfile(support.TESTFN), True)\n os.remove(support.TESTFN)\n os.mkdir(support.TESTFN)\n self.assertIs(self.pathmodule.isfile(support.TESTFN), False)\n os.rmdir(support.TESTFN)\n finally:\n if not f.closed:\n f.close()\n support.unlink(support.TESTFN)\n safe_rmdir(support.TESTFN)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_genericpath.py__Following_TestCase_is_n_CommonTest.common_attributes.GenericTest_common_attrib": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_genericpath.py__Following_TestCase_is_n_CommonTest.common_attributes.GenericTest_common_attrib", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_genericpath.py", "file_name": "test_genericpath.py", "file_type": "text/x-python", "category": "test", "start_line": 188, "end_line": 202, "span_ids": ["CommonTest", "GenericTest.test_isfile"], "tokens": 179}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Following TestCase is not supposed to be run from test_genericpath.\n# It is inherited by other test modules (macpath, ntpath, posixpath).\n\nclass CommonTest(GenericTest):\n # The path module to be tested\n pathmodule = None # type: Any\n common_attributes = GenericTest.common_attributes + [\n # Properties\n 'curdir', 'pardir', 'extsep', 'sep',\n 'pathsep', 'defpath', 'altsep', 'devnull',\n # Methods\n 'normcase', 'splitdrive', 'expandvars', 'normpath', 'abspath',\n 'join', 'split', 'splitext', 'isabs', 'basename', 'dirname',\n 'lexists', 'islink', 'ismount', 'expanduser', 'normpath', 'realpath',\n ]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_genericpath.py_CommonTest.test_normcase_CommonTest.test_normcase.for_path_in_None_True_.self_assertRaises_TypeErr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_genericpath.py_CommonTest.test_normcase_CommonTest.test_normcase.for_path_in_None_True_.self_assertRaises_TypeErr", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_genericpath.py", "file_name": "test_genericpath.py", "file_type": "text/x-python", "category": "test", "start_line": 204, "end_line": 216, "span_ids": ["CommonTest.test_normcase"], "tokens": 146}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CommonTest(GenericTest):\n\n def test_normcase(self) -> None:\n normcase = self.pathmodule.normcase\n # check that normcase() is idempotent\n for p in [\"FoO/./BaR\", b\"FoO/./BaR\"]:\n p = normcase(p)\n self.assertEqual(p, normcase(p))\n\n self.assertEqual(normcase(''), '')\n self.assertEqual(normcase(b''), b'')\n\n # check that normcase raises a TypeError for invalid types\n for path in (None, True, 0, 2.5, [], bytearray(b''), {'o','o'}):\n self.assertRaises(TypeError, normcase, path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_genericpath.py_CommonTest.test_splitdrive_CommonTest.test_splitdrive.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_genericpath.py_CommonTest.test_splitdrive_CommonTest.test_splitdrive.None_5", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_genericpath.py", "file_name": "test_genericpath.py", "file_type": "text/x-python", "category": "test", "start_line": 218, "end_line": 227, "span_ids": ["CommonTest.test_splitdrive"], "tokens": 144}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CommonTest(GenericTest):\n\n def test_splitdrive(self) -> None:\n # splitdrive for non-NT paths\n splitdrive = self.pathmodule.splitdrive\n self.assertEqual(splitdrive(\"/foo/bar\"), (\"\", \"/foo/bar\"))\n self.assertEqual(splitdrive(\"foo:bar\"), (\"\", \"foo:bar\"))\n self.assertEqual(splitdrive(\":foo:bar\"), (\"\", \":foo:bar\"))\n\n self.assertEqual(splitdrive(b\"/foo/bar\"), (b\"\", b\"/foo/bar\"))\n self.assertEqual(splitdrive(b\"foo:bar\"), (b\"\", b\"foo:bar\"))\n self.assertEqual(splitdrive(b\":foo:bar\"), (b\"\", b\":foo:bar\"))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_genericpath.py_CommonTest.test_expandvars_CommonTest.test_expandvars.with_support_EnvironmentV.None_24": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_genericpath.py_CommonTest.test_expandvars_CommonTest.test_expandvars.with_support_EnvironmentV.None_24", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_genericpath.py", "file_name": "test_genericpath.py", "file_type": "text/x-python", "category": "test", "start_line": 229, "end_line": 262, "span_ids": ["CommonTest.test_expandvars"], "tokens": 475}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CommonTest(GenericTest):\n\n def test_expandvars(self) -> None:\n if self.pathmodule.__name__ == 'macpath':\n self.skipTest('macpath.expandvars is a stub')\n expandvars = self.pathmodule.expandvars\n with support.EnvironmentVarGuard() as env:\n env.clear()\n env[\"foo\"] = \"bar\"\n env[\"{foo\"] = \"baz1\"\n env[\"{foo}\"] = \"baz2\"\n self.assertEqual(expandvars(\"foo\"), \"foo\")\n self.assertEqual(expandvars(\"$foo bar\"), \"bar bar\")\n self.assertEqual(expandvars(\"${foo}bar\"), \"barbar\")\n self.assertEqual(expandvars(\"$[foo]bar\"), \"$[foo]bar\")\n self.assertEqual(expandvars(\"$bar bar\"), \"$bar bar\")\n self.assertEqual(expandvars(\"$?bar\"), \"$?bar\")\n self.assertEqual(expandvars(\"${foo}bar\"), \"barbar\")\n self.assertEqual(expandvars(\"$foo}bar\"), \"bar}bar\")\n self.assertEqual(expandvars(\"${foo\"), \"${foo\")\n self.assertEqual(expandvars(\"${{foo}}\"), \"baz1}\")\n self.assertEqual(expandvars(\"$foo$foo\"), \"barbar\")\n self.assertEqual(expandvars(\"$bar$bar\"), \"$bar$bar\")\n\n self.assertEqual(expandvars(b\"foo\"), b\"foo\")\n self.assertEqual(expandvars(b\"$foo bar\"), b\"bar bar\")\n self.assertEqual(expandvars(b\"${foo}bar\"), b\"barbar\")\n self.assertEqual(expandvars(b\"$[foo]bar\"), b\"$[foo]bar\")\n self.assertEqual(expandvars(b\"$bar bar\"), b\"$bar bar\")\n self.assertEqual(expandvars(b\"$?bar\"), b\"$?bar\")\n self.assertEqual(expandvars(b\"${foo}bar\"), b\"barbar\")\n self.assertEqual(expandvars(b\"$foo}bar\"), b\"bar}bar\")\n self.assertEqual(expandvars(b\"${foo\"), b\"${foo\")\n self.assertEqual(expandvars(b\"${{foo}}\"), b\"baz1}\")\n self.assertEqual(expandvars(b\"$foo$foo\"), b\"barbar\")\n self.assertEqual(expandvars(b\"$bar$bar\"), b\"$bar$bar\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_genericpath.py_CommonTest.test_abspath_CommonTest.test_normpath_issue5827.for_path_in_.self_assertIsInstance_sel": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_genericpath.py_CommonTest.test_abspath_CommonTest.test_normpath_issue5827.for_path_in_.self_assertIsInstance_sel", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_genericpath.py", "file_name": "test_genericpath.py", "file_type": "text/x-python", "category": "test", "start_line": 264, "end_line": 279, "span_ids": ["CommonTest.test_abspath", "CommonTest.test_realpath", "CommonTest.test_normpath_issue5827"], "tokens": 185}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CommonTest(GenericTest):\n\n def test_abspath(self) -> None:\n self.assertIn(\"foo\", self.pathmodule.abspath(\"foo\"))\n self.assertIn(b\"foo\", self.pathmodule.abspath(b\"foo\"))\n\n # Abspath returns bytes when the arg is bytes\n for path in (b'', b'foo', b'f\\xf2\\xf2', b'/foo', b'C:\\\\'):\n self.assertIsInstance(self.pathmodule.abspath(path), bytes)\n\n def test_realpath(self) -> None:\n self.assertIn(\"foo\", self.pathmodule.realpath(\"foo\"))\n self.assertIn(b\"foo\", self.pathmodule.realpath(b\"foo\"))\n\n def test_normpath_issue5827(self) -> None:\n # Make sure normpath preserves unicode\n for path in ('', '.', '/', '\\\\', '///foo/.//bar//'):\n self.assertIsInstance(self.pathmodule.normpath(path), str)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_genericpath.py_CommonTest.test_abspath_issue3426_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_genericpath.py_CommonTest.test_abspath_issue3426_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_genericpath.py", "file_name": "test_genericpath.py", "file_type": "text/x-python", "category": "test", "start_line": 281, "end_line": 314, "span_ids": ["test_main", "CommonTest.test_nonascii_abspath", "impl:2", "CommonTest.test_abspath_issue3426"], "tokens": 295}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CommonTest(GenericTest):\n\n def test_abspath_issue3426(self) -> None:\n # Check that abspath returns unicode when the arg is unicode\n # with both ASCII and non-ASCII cwds.\n abspath = self.pathmodule.abspath\n for path in ('', 'fuu', 'f\\xf9\\xf9', '/fuu', 'U:\\\\'):\n self.assertIsInstance(abspath(path), str)\n\n unicwd = '\\xe7w\\xf0'\n try:\n fsencoding = support.TESTFN_ENCODING or \"ascii\"\n unicwd.encode(fsencoding)\n except (AttributeError, UnicodeEncodeError):\n # FS encoding is probably ASCII\n pass\n else:\n with support.temp_cwd(unicwd):\n for path in ('', 'fuu', 'f\\xf9\\xf9', '/fuu', 'U:\\\\'):\n self.assertIsInstance(abspath(path), str)\n\n @unittest.skipIf(sys.platform == 'darwin',\n \"Mac OS X denies the creation of a directory with an invalid utf8 name\")\n def test_nonascii_abspath(self) -> None:\n # Test non-ASCII, non-UTF8 bytes in the path.\n with support.temp_cwd(b'\\xe7w\\xf0'):\n self.test_abspath()\n\n\ndef test_main() -> None:\n support.run_unittest(GenericTest)\n\n\nif __name__==\"__main__\":\n test_main()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_getopt.py__test_getopt_py_GetoptTests.test_short_has_arg.self_assertError_getopt_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_getopt.py__test_getopt_py_GetoptTests.test_short_has_arg.self_assertError_getopt_s", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_getopt.py", "file_name": "test_getopt.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 30, "span_ids": ["GetoptTests", "GetoptTests.test_short_has_arg", "GetoptTests.tearDown", "docstring", "GetoptTests.assertError", "GetoptTests.setUp"], "tokens": 237}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# test_getopt.py\n# David Goodger 2000-08-19\n\nfrom test.support import verbose, run_doctest, run_unittest, EnvironmentVarGuard\nimport unittest\n\nimport getopt\n\nfrom typing import cast, Any\n\nsentinel = object()\n\nclass GetoptTests(unittest.TestCase):\n def setUp(self) -> None:\n self.env = EnvironmentVarGuard()\n if \"POSIXLY_CORRECT\" in self.env:\n del self.env[\"POSIXLY_CORRECT\"]\n\n def tearDown(self) -> None:\n self.env.__exit__()\n del self.env\n\n def assertError(self, *args: Any, **kwargs: Any) -> None:\n # JLe: work around mypy bug #229\n cast(Any, self.assertRaises)(getopt.GetoptError, *args, **kwargs)\n\n def test_short_has_arg(self) -> None:\n self.assertTrue(getopt.short_has_arg('a', 'a:'))\n self.assertFalse(getopt.short_has_arg('a', 'a'))\n self.assertError(getopt.short_has_arg, 'a', 'b')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_getopt.py_GetoptTests.test_long_has_args_GetoptTests.test_long_has_args.None_8": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_getopt.py_GetoptTests.test_long_has_args_GetoptTests.test_long_has_args.None_8", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_getopt.py", "file_name": "test_getopt.py", "file_type": "text/x-python", "category": "test", "start_line": 32, "end_line": 47, "span_ids": ["GetoptTests.test_long_has_args"], "tokens": 158}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GetoptTests(unittest.TestCase):\n\n def test_long_has_args(self) -> None:\n has_arg, option = getopt.long_has_args('abc', ['abc='])\n self.assertTrue(has_arg)\n self.assertEqual(option, 'abc')\n\n has_arg, option = getopt.long_has_args('abc', ['abc'])\n self.assertFalse(has_arg)\n self.assertEqual(option, 'abc')\n\n has_arg, option = getopt.long_has_args('abc', ['abcd'])\n self.assertFalse(has_arg)\n self.assertEqual(option, 'abcd')\n\n self.assertError(getopt.long_has_args, 'abc', ['def'])\n self.assertError(getopt.long_has_args, 'abc', [])\n self.assertError(getopt.long_has_args, 'abc', ['abcd','abcde'])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_getopt.py_GetoptTests.test_do_shorts_GetoptTests.test_do_shorts.None_9": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_getopt.py_GetoptTests.test_do_shorts_GetoptTests.test_do_shorts.None_9", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_getopt.py", "file_name": "test_getopt.py", "file_type": "text/x-python", "category": "test", "start_line": 49, "end_line": 71, "span_ids": ["GetoptTests.test_do_shorts"], "tokens": 244}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GetoptTests(unittest.TestCase):\n\n def test_do_shorts(self) -> None:\n opts, args = getopt.do_shorts([], 'a', 'a', [])\n self.assertEqual(opts, [('-a', '')])\n self.assertEqual(args, [])\n\n opts, args = getopt.do_shorts([], 'a1', 'a:', [])\n self.assertEqual(opts, [('-a', '1')])\n self.assertEqual(args, [])\n\n #opts, args = getopt.do_shorts([], 'a=1', 'a:', [])\n #self.assertEqual(opts, [('-a', '1')])\n #self.assertEqual(args, [])\n\n opts, args = getopt.do_shorts([], 'a', 'a:', ['1'])\n self.assertEqual(opts, [('-a', '1')])\n self.assertEqual(args, [])\n\n opts, args = getopt.do_shorts([], 'a', 'a:', ['1', '2'])\n self.assertEqual(opts, [('-a', '1')])\n self.assertEqual(args, ['2'])\n\n self.assertError(getopt.do_shorts, [], 'a1', 'a', [])\n self.assertError(getopt.do_shorts, [], 'a', 'a:', [])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_getopt.py_GetoptTests.test_do_longs_GetoptTests.test_do_longs.None_11": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_getopt.py_GetoptTests.test_do_longs_GetoptTests.test_do_longs.None_11", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_getopt.py", "file_name": "test_getopt.py", "file_type": "text/x-python", "category": "test", "start_line": 73, "end_line": 98, "span_ids": ["GetoptTests.test_do_longs"], "tokens": 290}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GetoptTests(unittest.TestCase):\n\n def test_do_longs(self) -> None:\n opts, args = getopt.do_longs([], 'abc', ['abc'], [])\n self.assertEqual(opts, [('--abc', '')])\n self.assertEqual(args, [])\n\n opts, args = getopt.do_longs([], 'abc=1', ['abc='], [])\n self.assertEqual(opts, [('--abc', '1')])\n self.assertEqual(args, [])\n\n opts, args = getopt.do_longs([], 'abc=1', ['abcd='], [])\n self.assertEqual(opts, [('--abcd', '1')])\n self.assertEqual(args, [])\n\n opts, args = getopt.do_longs([], 'abc', ['ab', 'abc', 'abcd'], [])\n self.assertEqual(opts, [('--abc', '')])\n self.assertEqual(args, [])\n\n # Much like the preceding, except with a non-alpha character (\"-\") in\n # option name that precedes \"=\"; failed in\n # http://python.org/sf/126863\n opts, args = getopt.do_longs([], 'foo=42', ['foo-bar', 'foo=',], [])\n self.assertEqual(opts, [('--foo', '42')])\n self.assertEqual(args, [])\n\n self.assertError(getopt.do_longs, [], 'abc=1', ['abc'], [])\n self.assertError(getopt.do_longs, [], 'abc', ['abc='], [])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_getopt.py_GetoptTests.test_getopt_GetoptTests.test_getopt.self_assertError_getopt_g": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_getopt.py_GetoptTests.test_getopt_GetoptTests.test_getopt.self_assertError_getopt_g", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_getopt.py", "file_name": "test_getopt.py", "file_type": "text/x-python", "category": "test", "start_line": 100, "end_line": 115, "span_ids": ["GetoptTests.test_getopt"], "tokens": 237}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GetoptTests(unittest.TestCase):\n\n def test_getopt(self) -> None:\n # note: the empty string between '-a' and '--beta' is significant:\n # it simulates an empty string option argument ('-a \"\"') on the\n # command line.\n cmdline = ['-a', '1', '-b', '--alpha=2', '--beta', '-a', '3', '-a',\n '', '--beta', 'arg1', 'arg2']\n\n opts, args = getopt.getopt(cmdline, 'a:b', ['alpha=', 'beta'])\n self.assertEqual(opts, [('-a', '1'), ('-b', ''),\n ('--alpha', '2'), ('--beta', ''),\n ('-a', '3'), ('-a', ''), ('--beta', '')])\n # Note ambiguity of ('-b', '') and ('-a', '') above. This must be\n # accounted for in the code that calls getopt().\n self.assertEqual(args, ['arg1', 'arg2'])\n\n self.assertError(getopt.getopt, cmdline, 'a:b', ['alpha', 'beta'])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_getopt.py_GetoptTests.test_gnu_getopt_GetoptTests.test_gnu_getopt.None_7": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_getopt.py_GetoptTests.test_gnu_getopt_GetoptTests.test_gnu_getopt.None_7", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_getopt.py", "file_name": "test_getopt.py", "file_type": "text/x-python", "category": "test", "start_line": 117, "end_line": 141, "span_ids": ["GetoptTests.test_gnu_getopt"], "tokens": 318}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GetoptTests(unittest.TestCase):\n\n def test_gnu_getopt(self) -> None:\n # Test handling of GNU style scanning mode.\n cmdline = ['-a', 'arg1', '-b', '1', '--alpha', '--beta=2']\n\n # GNU style\n opts, args = getopt.gnu_getopt(cmdline, 'ab:', ['alpha', 'beta='])\n self.assertEqual(args, ['arg1'])\n self.assertEqual(opts, [('-a', ''), ('-b', '1'),\n ('--alpha', ''), ('--beta', '2')])\n\n # recognize \"-\" as an argument\n opts, args = getopt.gnu_getopt(['-a', '-', '-b', '-'], 'ab:', [])\n self.assertEqual(args, ['-'])\n self.assertEqual(opts, [('-a', ''), ('-b', '-')])\n\n # Posix style via +\n opts, args = getopt.gnu_getopt(cmdline, '+ab:', ['alpha', 'beta='])\n self.assertEqual(opts, [('-a', '')])\n self.assertEqual(args, ['arg1', '-b', '1', '--alpha', '--beta=2'])\n\n # Posix style via POSIXLY_CORRECT\n self.env[\"POSIXLY_CORRECT\"] = \"1\"\n opts, args = getopt.gnu_getopt(cmdline, 'ab:', ['alpha', 'beta='])\n self.assertEqual(opts, [('-a', '')])\n self.assertEqual(args, ['arg1', '-b', '1', '--alpha', '--beta=2'])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_getopt.py_GetoptTests.test_libref_examples_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_getopt.py_GetoptTests.test_libref_examples_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_getopt.py", "file_name": "test_getopt.py", "file_type": "text/x-python", "category": "test", "start_line": 143, "end_line": 191, "span_ids": ["test_main", "impl:3", "GetoptTests.test_libref_examples", "GetoptTests.test_issue4629"], "tokens": 459}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GetoptTests(unittest.TestCase):\n\n def test_libref_examples(self) -> None:\n s = \"\"\"\n Examples from the Library Reference: Doc/lib/libgetopt.tex\n\n An example using only Unix style options:\n\n\n >>> import getopt\n >>> args = '-a -b -cfoo -d bar a1 a2'.split()\n >>> args\n ['-a', '-b', '-cfoo', '-d', 'bar', 'a1', 'a2']\n >>> optlist, args = getopt.getopt(args, 'abc:d:')\n >>> optlist\n [('-a', ''), ('-b', ''), ('-c', 'foo'), ('-d', 'bar')]\n >>> args\n ['a1', 'a2']\n\n Using long option names is equally easy:\n\n\n >>> s = '--condition=foo --testing --output-file abc.def -x a1 a2'\n >>> args = s.split()\n >>> args\n ['--condition=foo', '--testing', '--output-file', 'abc.def', '-x', 'a1', 'a2']\n >>> optlist, args = getopt.getopt(args, 'x', [\n ... 'condition=', 'output-file=', 'testing'])\n >>> optlist\n [('--condition', 'foo'), ('--testing', ''), ('--output-file', 'abc.def'), ('-x', '')]\n >>> args\n ['a1', 'a2']\n \"\"\"\n\n import types\n m = types.ModuleType(\"libreftest\", s)\n run_doctest(m, verbose)\n\n def test_issue4629(self) -> None:\n longopts, shortopts = getopt.getopt(['--help='], '', ['help='])\n self.assertEqual(longopts, [('--help', '')])\n longopts, shortopts = getopt.getopt(['--help=x'], '', ['help='])\n self.assertEqual(longopts, [('--help', 'x')])\n self.assertRaises(getopt.GetoptError, getopt.getopt, ['--help='], '', ['help'])\n\ndef test_main() -> None:\n run_unittest(GetoptTests)\n\nif __name__ == \"__main__\":\n test_main()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_glob.py_unittest_GlobTests.setUp.if_can_symlink_.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_glob.py_unittest_GlobTests.setUp.if_can_symlink_.None_1", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_glob.py", "file_name": "test_glob.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 37, "span_ids": ["imports", "GlobTests.norm", "GlobTests.mktemp", "GlobTests.setUp", "GlobTests"], "tokens": 293}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import unittest\nfrom test.support import run_unittest, TESTFN, skip_unless_symlink, can_symlink\nimport glob\nimport os\nimport shutil\n\nfrom typing import TypeVar, Iterable, List, cast\n\nT = TypeVar('T')\n\nclass GlobTests(unittest.TestCase):\n\n tempdir = ''\n\n # JLe: work around mypy issue #231\n def norm(self, first: str, *parts: str) -> str:\n return os.path.normpath(os.path.join(self.tempdir, first, *parts))\n\n def mktemp(self, *parts: str) -> None:\n filename = self.norm(*parts)\n base, file = os.path.split(filename)\n if not os.path.exists(base):\n os.makedirs(base)\n f = open(filename, 'w')\n f.close()\n\n def setUp(self) -> None:\n self.tempdir = TESTFN+\"_dir\"\n self.mktemp('a', 'D')\n self.mktemp('aab', 'F')\n self.mktemp('aaa', 'zzzF')\n self.mktemp('ZZZ')\n self.mktemp('a', 'bcd', 'EF')\n self.mktemp('a', 'bcd', 'efg', 'ha')\n if can_symlink():\n os.symlink(self.norm('broken'), self.norm('sym1'))\n os.symlink(self.norm('broken'), self.norm('sym2'))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_glob.py_GlobTests.tearDown_GlobTests.assertSequencesEqual_noorder.self_assertEqual_set_l1_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_glob.py_GlobTests.tearDown_GlobTests.assertSequencesEqual_noorder.self_assertEqual_set_l1_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_glob.py", "file_name": "test_glob.py", "file_type": "text/x-python", "category": "test", "start_line": 39, "end_line": 54, "span_ids": ["GlobTests.glob", "GlobTests.assertSequencesEqual_noorder", "GlobTests.tearDown"], "tokens": 136}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GlobTests(unittest.TestCase):\n\n def tearDown(self) -> None:\n shutil.rmtree(self.tempdir)\n\n def glob(self, *parts: str) -> List[str]:\n if len(parts) == 1:\n pattern = parts[0]\n else:\n pattern = os.path.join(*parts)\n p = os.path.join(self.tempdir, pattern)\n res = glob.glob(p)\n self.assertEqual(list(glob.iglob(p)), res)\n return res\n\n def assertSequencesEqual_noorder(self, l1: Iterable[T],\n l2: Iterable[T]) -> None:\n self.assertEqual(set(l1), set(l2))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_glob.py_GlobTests.test_glob_literal_GlobTests.test_glob_literal.if_set_type_x_for_x_in_t.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_glob.py_GlobTests.test_glob_literal_GlobTests.test_glob_literal.if_set_type_x_for_x_in_t.None_1", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_glob.py", "file_name": "test_glob.py", "file_type": "text/x-python", "category": "test", "start_line": 56, "end_line": 71, "span_ids": ["GlobTests.test_glob_literal"], "tokens": 194}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GlobTests(unittest.TestCase):\n\n def test_glob_literal(self) -> None:\n eq = self.assertSequencesEqual_noorder\n eq(self.glob('a'), [self.norm('a')])\n eq(self.glob('a', 'D'), [self.norm('a', 'D')])\n eq(self.glob('aab'), [self.norm('aab')])\n eq(self.glob('zymurgy'), cast(List[str], [])) # JLe: work around #230\n\n # test return types are unicode, but only if os.listdir\n # returns unicode filenames\n uniset = set([str])\n tmp = os.listdir('.')\n if set(type(x) for x in tmp) == uniset:\n u1 = glob.glob('*')\n u2 = glob.glob('./*')\n self.assertEqual(set(type(r) for r in u1), uniset)\n self.assertEqual(set(type(r) for r in u2), uniset)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_glob.py_GlobTests.test_glob_one_directory_GlobTests.test_glob_one_directory._JLe_work_around_230": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_glob.py_GlobTests.test_glob_one_directory_GlobTests.test_glob_one_directory._JLe_work_around_230", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_glob.py", "file_name": "test_glob.py", "file_type": "text/x-python", "category": "test", "start_line": 73, "end_line": 79, "span_ids": ["GlobTests.test_glob_one_directory"], "tokens": 126}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GlobTests(unittest.TestCase):\n\n def test_glob_one_directory(self) -> None:\n eq = self.assertSequencesEqual_noorder\n eq(self.glob('a*'), map(self.norm, ['a', 'aab', 'aaa']))\n eq(self.glob('*a'), map(self.norm, ['a', 'aaa']))\n eq(self.glob('aa?'), map(self.norm, ['aaa', 'aab']))\n eq(self.glob('aa[ab]'), map(self.norm, ['aaa', 'aab']))\n eq(self.glob('*q'), cast(List[str], [])) # JLe: work around #230", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_glob.py_GlobTests.test_glob_nested_directory_GlobTests.test_glob_nested_directory.eq_self_glob_a_bcd_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_glob.py_GlobTests.test_glob_nested_directory_GlobTests.test_glob_nested_directory.eq_self_glob_a_bcd_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_glob.py", "file_name": "test_glob.py", "file_type": "text/x-python", "category": "test", "start_line": 81, "end_line": 90, "span_ids": ["GlobTests.test_glob_nested_directory"], "tokens": 150}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GlobTests(unittest.TestCase):\n\n def test_glob_nested_directory(self) -> None:\n eq = self.assertSequencesEqual_noorder\n if os.path.normcase(\"abCD\") == \"abCD\":\n # case-sensitive filesystem\n eq(self.glob('a', 'bcd', 'E*'), [self.norm('a', 'bcd', 'EF')])\n else:\n # case insensitive filesystem\n eq(self.glob('a', 'bcd', 'E*'), [self.norm('a', 'bcd', 'EF'),\n self.norm('a', 'bcd', 'efg')])\n eq(self.glob('a', 'bcd', '*g'), [self.norm('a', 'bcd', 'efg')])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_glob.py_GlobTests.test_glob_directory_names_GlobTests.test_glob_directory_names.eq_self_glob_a_F_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_glob.py_GlobTests.test_glob_directory_names_GlobTests.test_glob_directory_names.eq_self_glob_a_F_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_glob.py", "file_name": "test_glob.py", "file_type": "text/x-python", "category": "test", "start_line": 92, "end_line": 99, "span_ids": ["GlobTests.test_glob_directory_names"], "tokens": 135}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GlobTests(unittest.TestCase):\n\n def test_glob_directory_names(self) -> None:\n eq = self.assertSequencesEqual_noorder\n eq(self.glob('*', 'D'), [self.norm('a', 'D')])\n eq(self.glob('*', '*a'), cast(List[str], [])) # JLe: work around #230\n eq(self.glob('a', '*', '*', '*a'),\n [self.norm('a', 'bcd', 'efg', 'ha')])\n eq(self.glob('?a?', '*F'), map(self.norm, [os.path.join('aaa', 'zzzF'),\n os.path.join('aab', 'F')]))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_glob.py_GlobTests.test_glob_directory_with_trailing_slash_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_glob.py_GlobTests.test_glob_directory_with_trailing_slash_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_glob.py", "file_name": "test_glob.py", "file_type": "text/x-python", "category": "test", "start_line": 101, "end_line": 123, "span_ids": ["GlobTests.test_glob_directory_with_trailing_slash", "impl:3", "GlobTests.test_glob_broken_symlinks", "test_main"], "tokens": 208}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GlobTests(unittest.TestCase):\n\n def test_glob_directory_with_trailing_slash(self) -> None:\n # We are verifying that when there is wildcard pattern which\n # ends with os.sep doesn't blow up.\n res = glob.glob(self.tempdir + '*' + os.sep)\n self.assertEqual(len(res), 1)\n # either of these results are reasonable\n self.assertIn(res[0], [self.tempdir, self.tempdir + os.sep])\n\n @skip_unless_symlink\n def test_glob_broken_symlinks(self) -> None:\n eq = self.assertSequencesEqual_noorder\n eq(self.glob('sym*'), [self.norm('sym1'), self.norm('sym2')])\n eq(self.glob('sym1'), [self.norm('sym1')])\n eq(self.glob('sym2'), [self.norm('sym2')])\n\n\ndef test_main() -> None:\n run_unittest(GlobTests)\n\n\nif __name__ == \"__main__\":\n test_main()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_unittest_ABSTFN.abspath_support_TESTFN_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_unittest_ABSTFN.abspath_support_TESTFN_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_posixpath.py", "file_name": "test_posixpath.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 23, "span_ids": ["imports"], "tokens": 127}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import unittest\nfrom test import support, test_genericpath\n\nimport posixpath\nimport genericpath\n\nimport imp\nimp.reload(posixpath) # Make sure we are using the local copy\nimp.reload(genericpath)\n\nimport os\nimport sys\nfrom posixpath import realpath, abspath, dirname, basename\n\nimport posix\nfrom typing import cast, Any, TypeVar, Callable\n\nT = TypeVar('T')\n\n# An absolute path to a temporary filename for testing. We can't rely on TESTFN\n# being an absolute path, so we need this.\n\nABSTFN = abspath(support.TESTFN)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_skip_if_ABSTFN_contains_backslash_safe_rmdir.try_.except_OSError_.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_skip_if_ABSTFN_contains_backslash_safe_rmdir.try_.except_OSError_.pass", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_posixpath.py", "file_name": "test_posixpath.py", "file_type": "text/x-python", "category": "test", "start_line": 25, "end_line": 40, "span_ids": ["safe_rmdir", "skip_if_ABSTFN_contains_backslash"], "tokens": 135}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def skip_if_ABSTFN_contains_backslash(\n test: Callable[[T], None]) -> Callable[[T], None]:\n \"\"\"\n On Windows, posixpath.abspath still returns paths with backslashes\n instead of posix forward slashes. If this is the case, several tests\n fail, so skip them.\n \"\"\"\n found_backslash = '\\\\' in ABSTFN\n msg = \"ABSTFN is not a posix path - tests fail\"\n return [test, unittest.skip(msg)(test)][found_backslash]\n\ndef safe_rmdir(dirname: str) -> None:\n try:\n os.rmdir(dirname)\n except OSError:\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest_PosixPathTest.test_join.None_7": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest_PosixPathTest.test_join.None_7", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_posixpath.py", "file_name": "test_posixpath.py", "file_type": "text/x-python", "category": "test", "start_line": 42, "end_line": 67, "span_ids": ["PosixPathTest.tearDown", "PosixPathTest.test_join", "PosixPathTest.setUp", "PosixPathTest"], "tokens": 259}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PosixPathTest(unittest.TestCase):\n\n def setUp(self) -> None:\n self.tearDown()\n\n def tearDown(self) -> None:\n for suffix in [\"\", \"1\", \"2\"]:\n support.unlink(support.TESTFN + suffix)\n safe_rmdir(support.TESTFN + suffix)\n\n def test_join(self) -> None:\n self.assertEqual(posixpath.join(\"/foo\", \"bar\", \"/bar\", \"baz\"),\n \"/bar/baz\")\n self.assertEqual(posixpath.join(\"/foo\", \"bar\", \"baz\"), \"/foo/bar/baz\")\n self.assertEqual(posixpath.join(\"/foo/\", \"bar/\", \"baz/\"),\n \"/foo/bar/baz/\")\n\n self.assertEqual(posixpath.join(b\"/foo\", b\"bar\", b\"/bar\", b\"baz\"),\n b\"/bar/baz\")\n self.assertEqual(posixpath.join(b\"/foo\", b\"bar\", b\"baz\"),\n b\"/foo/bar/baz\")\n self.assertEqual(posixpath.join(b\"/foo/\", b\"bar/\", b\"baz/\"),\n b\"/foo/bar/baz/\")\n\n self.assertRaises(TypeError, posixpath.join, b\"bytes\", \"str\")\n self.assertRaises(TypeError, posixpath.join, \"str\", b\"bytes\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_split_PosixPathTest.test_split.None_9": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_split_PosixPathTest.test_split.None_9", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_posixpath.py", "file_name": "test_posixpath.py", "file_type": "text/x-python", "category": "test", "start_line": 69, "end_line": 80, "span_ids": ["PosixPathTest.test_split"], "tokens": 198}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PosixPathTest(unittest.TestCase):\n\n def test_split(self) -> None:\n self.assertEqual(posixpath.split(\"/foo/bar\"), (\"/foo\", \"bar\"))\n self.assertEqual(posixpath.split(\"/\"), (\"/\", \"\"))\n self.assertEqual(posixpath.split(\"foo\"), (\"\", \"foo\"))\n self.assertEqual(posixpath.split(\"////foo\"), (\"////\", \"foo\"))\n self.assertEqual(posixpath.split(\"//foo//bar\"), (\"//foo\", \"bar\"))\n\n self.assertEqual(posixpath.split(b\"/foo/bar\"), (b\"/foo\", b\"bar\"))\n self.assertEqual(posixpath.split(b\"/\"), (b\"/\", b\"\"))\n self.assertEqual(posixpath.split(b\"foo\"), (b\"\", b\"foo\"))\n self.assertEqual(posixpath.split(b\"////foo\"), (b\"////\", b\"foo\"))\n self.assertEqual(posixpath.split(b\"//foo//bar\"), (b\"//foo\", b\"bar\"))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.splitextTest_PosixPathTest.splitextTest.None_11": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.splitextTest_PosixPathTest.splitextTest.None_11", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_posixpath.py", "file_name": "test_posixpath.py", "file_type": "text/x-python", "category": "test", "start_line": 82, "end_line": 108, "span_ids": ["PosixPathTest.splitextTest"], "tokens": 341}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PosixPathTest(unittest.TestCase):\n\n def splitextTest(self, path: str, filename: str, ext: str) -> None:\n self.assertEqual(posixpath.splitext(path), (filename, ext))\n self.assertEqual(posixpath.splitext(\"/\" + path), (\"/\" + filename, ext))\n self.assertEqual(posixpath.splitext(\"abc/\" + path),\n (\"abc/\" + filename, ext))\n self.assertEqual(posixpath.splitext(\"abc.def/\" + path),\n (\"abc.def/\" + filename, ext))\n self.assertEqual(posixpath.splitext(\"/abc.def/\" + path),\n (\"/abc.def/\" + filename, ext))\n self.assertEqual(posixpath.splitext(path + \"/\"),\n (filename + ext + \"/\", \"\"))\n\n pathb = bytes(path, \"ASCII\")\n filenameb = bytes(filename, \"ASCII\")\n extb = bytes(ext, \"ASCII\")\n\n self.assertEqual(posixpath.splitext(pathb), (filenameb, extb))\n self.assertEqual(posixpath.splitext(b\"/\" + pathb),\n (b\"/\" + filenameb, extb))\n self.assertEqual(posixpath.splitext(b\"abc/\" + pathb),\n (b\"abc/\" + filenameb, extb))\n self.assertEqual(posixpath.splitext(b\"abc.def/\" + pathb),\n (b\"abc.def/\" + filenameb, extb))\n self.assertEqual(posixpath.splitext(b\"/abc.def/\" + pathb),\n (b\"/abc.def/\" + filenameb, extb))\n self.assertEqual(posixpath.splitext(pathb + b\"/\"),\n (filenameb + extb + b\"/\", b\"\"))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_splitext_PosixPathTest.test_splitext.None_11": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_splitext_PosixPathTest.test_splitext.None_11", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_posixpath.py", "file_name": "test_posixpath.py", "file_type": "text/x-python", "category": "test", "start_line": 110, "end_line": 122, "span_ids": ["PosixPathTest.test_splitext"], "tokens": 181}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PosixPathTest(unittest.TestCase):\n\n def test_splitext(self) -> None:\n self.splitextTest(\"foo.bar\", \"foo\", \".bar\")\n self.splitextTest(\"foo.boo.bar\", \"foo.boo\", \".bar\")\n self.splitextTest(\"foo.boo.biff.bar\", \"foo.boo.biff\", \".bar\")\n self.splitextTest(\".csh.rc\", \".csh\", \".rc\")\n self.splitextTest(\"nodots\", \"nodots\", \"\")\n self.splitextTest(\".cshrc\", \".cshrc\", \"\")\n self.splitextTest(\"...manydots\", \"...manydots\", \"\")\n self.splitextTest(\"...manydots.ext\", \"...manydots\", \".ext\")\n self.splitextTest(\".\", \".\", \"\")\n self.splitextTest(\"..\", \"..\", \"\")\n self.splitextTest(\"........\", \"........\", \"\")\n self.splitextTest(\"\", \"\", \"\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_isabs_PosixPathTest.test_isabs.None_9": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_isabs_PosixPathTest.test_isabs.None_9", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_posixpath.py", "file_name": "test_posixpath.py", "file_type": "text/x-python", "category": "test", "start_line": 124, "end_line": 135, "span_ids": ["PosixPathTest.test_isabs"], "tokens": 152}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PosixPathTest(unittest.TestCase):\n\n def test_isabs(self) -> None:\n self.assertIs(posixpath.isabs(\"\"), False)\n self.assertIs(posixpath.isabs(\"/\"), True)\n self.assertIs(posixpath.isabs(\"/foo\"), True)\n self.assertIs(posixpath.isabs(\"/foo/bar\"), True)\n self.assertIs(posixpath.isabs(\"foo/bar\"), False)\n\n self.assertIs(posixpath.isabs(b\"\"), False)\n self.assertIs(posixpath.isabs(b\"/\"), True)\n self.assertIs(posixpath.isabs(b\"/foo\"), True)\n self.assertIs(posixpath.isabs(b\"/foo/bar\"), True)\n self.assertIs(posixpath.isabs(b\"foo/bar\"), False)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_basename_PosixPathTest.test_basename.None_9": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_basename_PosixPathTest.test_basename.None_9", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_posixpath.py", "file_name": "test_posixpath.py", "file_type": "text/x-python", "category": "test", "start_line": 137, "end_line": 148, "span_ids": ["PosixPathTest.test_basename"], "tokens": 161}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PosixPathTest(unittest.TestCase):\n\n def test_basename(self) -> None:\n self.assertEqual(posixpath.basename(\"/foo/bar\"), \"bar\")\n self.assertEqual(posixpath.basename(\"/\"), \"\")\n self.assertEqual(posixpath.basename(\"foo\"), \"foo\")\n self.assertEqual(posixpath.basename(\"////foo\"), \"foo\")\n self.assertEqual(posixpath.basename(\"//foo//bar\"), \"bar\")\n\n self.assertEqual(posixpath.basename(b\"/foo/bar\"), b\"bar\")\n self.assertEqual(posixpath.basename(b\"/\"), b\"\")\n self.assertEqual(posixpath.basename(b\"foo\"), b\"foo\")\n self.assertEqual(posixpath.basename(b\"////foo\"), b\"foo\")\n self.assertEqual(posixpath.basename(b\"//foo//bar\"), b\"bar\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_dirname_PosixPathTest.test_dirname.None_9": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_dirname_PosixPathTest.test_dirname.None_9", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_posixpath.py", "file_name": "test_posixpath.py", "file_type": "text/x-python", "category": "test", "start_line": 150, "end_line": 161, "span_ids": ["PosixPathTest.test_dirname"], "tokens": 161}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PosixPathTest(unittest.TestCase):\n\n def test_dirname(self) -> None:\n self.assertEqual(posixpath.dirname(\"/foo/bar\"), \"/foo\")\n self.assertEqual(posixpath.dirname(\"/\"), \"/\")\n self.assertEqual(posixpath.dirname(\"foo\"), \"\")\n self.assertEqual(posixpath.dirname(\"////foo\"), \"////\")\n self.assertEqual(posixpath.dirname(\"//foo//bar\"), \"//foo\")\n\n self.assertEqual(posixpath.dirname(b\"/foo/bar\"), b\"/foo\")\n self.assertEqual(posixpath.dirname(b\"/\"), b\"/\")\n self.assertEqual(posixpath.dirname(b\"foo\"), b\"\")\n self.assertEqual(posixpath.dirname(b\"////foo\"), b\"////\")\n self.assertEqual(posixpath.dirname(b\"//foo//bar\"), b\"//foo\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_islink_PosixPathTest.test_islink.try_.finally_.if_not_f_closed_.f_close_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_islink_PosixPathTest.test_islink.try_.finally_.if_not_f_closed_.f_close_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_posixpath.py", "file_name": "test_posixpath.py", "file_type": "text/x-python", "category": "test", "start_line": 163, "end_line": 180, "span_ids": ["PosixPathTest.test_islink"], "tokens": 222}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PosixPathTest(unittest.TestCase):\n\n def test_islink(self) -> None:\n self.assertIs(posixpath.islink(support.TESTFN + \"1\"), False)\n self.assertIs(posixpath.lexists(support.TESTFN + \"2\"), False)\n f = open(support.TESTFN + \"1\", \"wb\")\n try:\n f.write(b\"foo\")\n f.close()\n self.assertIs(posixpath.islink(support.TESTFN + \"1\"), False)\n if support.can_symlink():\n os.symlink(support.TESTFN + \"1\", support.TESTFN + \"2\")\n self.assertIs(posixpath.islink(support.TESTFN + \"2\"), True)\n os.remove(support.TESTFN + \"1\")\n self.assertIs(posixpath.islink(support.TESTFN + \"2\"), True)\n self.assertIs(posixpath.exists(support.TESTFN + \"2\"), False)\n self.assertIs(posixpath.lexists(support.TESTFN + \"2\"), True)\n finally:\n if not f.closed:\n f.close()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest._create_file_PosixPathTest.test_samefile_on_links.self_assertFalse_posixpat": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest._create_file_PosixPathTest.test_samefile_on_links.self_assertFalse_posixpat", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_posixpath.py", "file_name": "test_posixpath.py", "file_type": "text/x-python", "category": "test", "start_line": 182, "end_line": 208, "span_ids": ["PosixPathTest.test_samefile", "PosixPathTest.test_samefile_on_links", "PosixPathTest._create_file"], "tokens": 246}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PosixPathTest(unittest.TestCase):\n\n @staticmethod\n def _create_file(filename: str) -> None:\n with open(filename, 'wb') as f:\n f.write(b'foo')\n\n def test_samefile(self) -> None:\n test_fn = support.TESTFN + \"1\"\n self._create_file(test_fn)\n self.assertTrue(posixpath.samefile(test_fn, test_fn))\n self.assertRaises(TypeError, posixpath.samefile)\n\n @unittest.skipIf(\n sys.platform.startswith('win'),\n \"posixpath.samefile does not work on links in Windows\")\n @unittest.skipUnless(hasattr(os, \"symlink\"),\n \"Missing symlink implementation\")\n def test_samefile_on_links(self) -> None:\n test_fn1 = support.TESTFN + \"1\"\n test_fn2 = support.TESTFN + \"2\"\n self._create_file(test_fn1)\n\n os.symlink(test_fn1, test_fn2)\n self.assertTrue(posixpath.samefile(test_fn1, test_fn2))\n os.remove(test_fn2)\n\n self._create_file(test_fn2)\n self.assertFalse(posixpath.samefile(test_fn1, test_fn2))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_samestat_PosixPathTest.test_samestat_on_links.self_assertRaises_TypeErr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_samestat_PosixPathTest.test_samestat_on_links.self_assertRaises_TypeErr", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_posixpath.py", "file_name": "test_posixpath.py", "file_type": "text/x-python", "category": "test", "start_line": 211, "end_line": 237, "span_ids": ["PosixPathTest.test_samestat_on_links", "PosixPathTest.test_samestat"], "tokens": 259}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PosixPathTest(unittest.TestCase):\n\n\n def test_samestat(self) -> None:\n test_fn = support.TESTFN + \"1\"\n self._create_file(test_fn)\n test_fns = [test_fn]*2\n stats = map(os.stat, test_fns)\n self.assertTrue(posixpath.samestat(*stats))\n\n @unittest.skipIf(\n sys.platform.startswith('win'),\n \"posixpath.samestat does not work on links in Windows\")\n @unittest.skipUnless(hasattr(os, \"symlink\"),\n \"Missing symlink implementation\")\n def test_samestat_on_links(self) -> None:\n test_fn1 = support.TESTFN + \"1\"\n test_fn2 = support.TESTFN + \"2\"\n self._create_file(test_fn1)\n test_fns = [test_fn1, test_fn2]\n cast(Any, os.symlink)(*test_fns)\n stats = map(os.stat, test_fns)\n self.assertTrue(posixpath.samestat(*stats))\n os.remove(test_fn2)\n\n self._create_file(test_fn2)\n stats = map(os.stat, test_fns)\n self.assertFalse(posixpath.samestat(*stats))\n\n self.assertRaises(TypeError, posixpath.samestat)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_ismount_PosixPathTest.test_ismount_symlinks.try_.finally_.os_unlink_ABSTFN_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_ismount_PosixPathTest.test_ismount_symlinks.try_.finally_.os_unlink_ABSTFN_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_posixpath.py", "file_name": "test_posixpath.py", "file_type": "text/x-python", "category": "test", "start_line": 239, "end_line": 260, "span_ids": ["PosixPathTest.test_ismount_symlinks", "PosixPathTest.test_ismount", "PosixPathTest.test_ismount_non_existent"], "tokens": 198}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PosixPathTest(unittest.TestCase):\n\n def test_ismount(self) -> None:\n self.assertIs(posixpath.ismount(\"/\"), True)\n self.assertIs(posixpath.ismount(b\"/\"), True)\n\n def test_ismount_non_existent(self) -> None:\n # Non-existent mountpoint.\n self.assertIs(posixpath.ismount(ABSTFN), False)\n try:\n os.mkdir(ABSTFN)\n self.assertIs(posixpath.ismount(ABSTFN), False)\n finally:\n safe_rmdir(ABSTFN)\n\n @unittest.skipUnless(support.can_symlink(),\n \"Test requires symlink support\")\n def test_ismount_symlinks(self) -> None:\n # Symlinks are never mountpoints.\n try:\n os.symlink(\"/\", ABSTFN)\n self.assertIs(posixpath.ismount(ABSTFN), False)\n finally:\n os.unlink(ABSTFN)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_ismount_different_device_PosixPathTest.test_ismount_different_device.try_.finally_.setattr_os_lstat_save": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_ismount_different_device_PosixPathTest.test_ismount_different_device.try_.finally_.setattr_os_lstat_save", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_posixpath.py", "file_name": "test_posixpath.py", "file_type": "text/x-python", "category": "test", "start_line": 262, "end_line": 278, "span_ids": ["PosixPathTest.test_ismount_different_device"], "tokens": 205}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PosixPathTest(unittest.TestCase):\n\n @unittest.skipIf(posix is None, \"Test requires posix module\")\n def test_ismount_different_device(self) -> None:\n # Simulate the path being on a different device from its parent by\n # mocking out st_dev.\n save_lstat = os.lstat\n def fake_lstat(path):\n st_ino = 0\n st_dev = 0\n if path == ABSTFN:\n st_dev = 1\n st_ino = 1\n return posix.stat_result((0, st_ino, st_dev, 0, 0, 0, 0, 0, 0, 0))\n try:\n setattr(os, 'lstat', fake_lstat) # mypy: can't modify os directly\n self.assertIs(posixpath.ismount(ABSTFN), True)\n finally:\n setattr(os, 'lstat', save_lstat)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_expanduser_PosixPathTest.test_expanduser.try_.else_.with_support_EnvironmentV.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_expanduser_PosixPathTest.test_expanduser.try_.else_.with_support_EnvironmentV.None_1", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_posixpath.py", "file_name": "test_posixpath.py", "file_type": "text/x-python", "category": "test", "start_line": 280, "end_line": 311, "span_ids": ["PosixPathTest.test_expanduser"], "tokens": 302}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PosixPathTest(unittest.TestCase):\n\n def test_expanduser(self) -> None:\n self.assertEqual(posixpath.expanduser(\"foo\"), \"foo\")\n self.assertEqual(posixpath.expanduser(b\"foo\"), b\"foo\")\n try:\n import pwd\n except ImportError:\n pass\n else:\n self.assertIsInstance(posixpath.expanduser(\"~/\"), str)\n self.assertIsInstance(posixpath.expanduser(b\"~/\"), bytes)\n # if home directory == root directory, this test makes no sense\n if posixpath.expanduser(\"~\") != '/':\n self.assertEqual(\n posixpath.expanduser(\"~\") + \"/\",\n posixpath.expanduser(\"~/\")\n )\n self.assertEqual(\n posixpath.expanduser(b\"~\") + b\"/\",\n posixpath.expanduser(b\"~/\")\n )\n self.assertIsInstance(posixpath.expanduser(\"~root/\"), str)\n self.assertIsInstance(posixpath.expanduser(\"~foo/\"), str)\n self.assertIsInstance(posixpath.expanduser(b\"~root/\"), bytes)\n self.assertIsInstance(posixpath.expanduser(b\"~foo/\"), bytes)\n\n with support.EnvironmentVarGuard() as env:\n env['HOME'] = '/'\n self.assertEqual(posixpath.expanduser(\"~\"), \"/\")\n # expanduser should fall back to using the password database\n del env['HOME']\n home = pwd.getpwuid(os.getuid()).pw_dir\n self.assertEqual(posixpath.expanduser(\"~\"), home)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_normpath_PosixPathTest.test_normpath.None_13": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_normpath_PosixPathTest.test_normpath.None_13", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_posixpath.py", "file_name": "test_posixpath.py", "file_type": "text/x-python", "category": "test", "start_line": 313, "end_line": 331, "span_ids": ["PosixPathTest.test_normpath"], "tokens": 274}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PosixPathTest(unittest.TestCase):\n\n def test_normpath(self) -> None:\n self.assertEqual(posixpath.normpath(\"\"), \".\")\n self.assertEqual(posixpath.normpath(\"/\"), \"/\")\n self.assertEqual(posixpath.normpath(\"//\"), \"//\")\n self.assertEqual(posixpath.normpath(\"///\"), \"/\")\n self.assertEqual(posixpath.normpath(\"///foo/.//bar//\"), \"/foo/bar\")\n self.assertEqual(posixpath.normpath(\"///foo/.//bar//.//..//.//baz\"),\n \"/foo/baz\")\n self.assertEqual(posixpath.normpath(\"///..//./foo/.//bar\"), \"/foo/bar\")\n\n self.assertEqual(posixpath.normpath(b\"\"), b\".\")\n self.assertEqual(posixpath.normpath(b\"/\"), b\"/\")\n self.assertEqual(posixpath.normpath(b\"//\"), b\"//\")\n self.assertEqual(posixpath.normpath(b\"///\"), b\"/\")\n self.assertEqual(posixpath.normpath(b\"///foo/.//bar//\"), b\"/foo/bar\")\n self.assertEqual(posixpath.normpath(b\"///foo/.//bar//.//..//.//baz\"),\n b\"/foo/baz\")\n self.assertEqual(posixpath.normpath(b\"///..//./foo/.//bar\"),\n b\"/foo/bar\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_realpath_basic_PosixPathTest.test_realpath_relative.try_.finally_.support_unlink_ABSTFN_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_realpath_basic_PosixPathTest.test_realpath_relative.try_.finally_.support_unlink_ABSTFN_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_posixpath.py", "file_name": "test_posixpath.py", "file_type": "text/x-python", "category": "test", "start_line": 333, "end_line": 352, "span_ids": ["PosixPathTest.test_realpath_relative", "PosixPathTest.test_realpath_basic"], "tokens": 190}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PosixPathTest(unittest.TestCase):\n\n @unittest.skipUnless(hasattr(os, \"symlink\"),\n \"Missing symlink implementation\")\n @skip_if_ABSTFN_contains_backslash\n def test_realpath_basic(self) -> None:\n # Basic operation.\n try:\n os.symlink(ABSTFN+\"1\", ABSTFN)\n self.assertEqual(realpath(ABSTFN), ABSTFN+\"1\")\n finally:\n support.unlink(ABSTFN)\n\n @unittest.skipUnless(hasattr(os, \"symlink\"),\n \"Missing symlink implementation\")\n @skip_if_ABSTFN_contains_backslash\n def test_realpath_relative(self) -> None:\n try:\n os.symlink(posixpath.relpath(ABSTFN+\"1\"), ABSTFN)\n self.assertEqual(realpath(ABSTFN), ABSTFN+\"1\")\n finally:\n support.unlink(ABSTFN)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_realpath_symlink_loops_PosixPathTest.test_realpath_symlink_loops.try_.finally_.support_unlink_ABSTFN_2_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_realpath_symlink_loops_PosixPathTest.test_realpath_symlink_loops.try_.finally_.support_unlink_ABSTFN_2_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_posixpath.py", "file_name": "test_posixpath.py", "file_type": "text/x-python", "category": "test", "start_line": 354, "end_line": 377, "span_ids": ["PosixPathTest.test_realpath_symlink_loops"], "tokens": 253}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PosixPathTest(unittest.TestCase):\n\n @unittest.skipUnless(hasattr(os, \"symlink\"),\n \"Missing symlink implementation\")\n @skip_if_ABSTFN_contains_backslash\n def test_realpath_symlink_loops(self) -> None:\n # Bug #930024, return the path unchanged if we get into an infinite\n # symlink loop.\n try:\n old_path = abspath('.')\n os.symlink(ABSTFN, ABSTFN)\n self.assertEqual(realpath(ABSTFN), ABSTFN)\n\n os.symlink(ABSTFN+\"1\", ABSTFN+\"2\")\n os.symlink(ABSTFN+\"2\", ABSTFN+\"1\")\n self.assertEqual(realpath(ABSTFN+\"1\"), ABSTFN+\"1\")\n self.assertEqual(realpath(ABSTFN+\"2\"), ABSTFN+\"2\")\n\n # Test using relative path as well.\n os.chdir(dirname(ABSTFN))\n self.assertEqual(realpath(basename(ABSTFN)), ABSTFN)\n finally:\n os.chdir(old_path)\n support.unlink(ABSTFN)\n support.unlink(ABSTFN+\"1\")\n support.unlink(ABSTFN+\"2\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_realpath_resolve_parents_PosixPathTest.test_realpath_resolve_parents.try_.finally_.safe_rmdir_ABSTFN_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_realpath_resolve_parents_PosixPathTest.test_realpath_resolve_parents.try_.finally_.safe_rmdir_ABSTFN_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_posixpath.py", "file_name": "test_posixpath.py", "file_type": "text/x-python", "category": "test", "start_line": 379, "end_line": 399, "span_ids": ["PosixPathTest.test_realpath_resolve_parents"], "tokens": 235}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PosixPathTest(unittest.TestCase):\n\n @unittest.skipUnless(hasattr(os, \"symlink\"),\n \"Missing symlink implementation\")\n @skip_if_ABSTFN_contains_backslash\n def test_realpath_resolve_parents(self) -> None:\n # We also need to resolve any symlinks in the parents of a relative\n # path passed to realpath. E.g.: current working directory is\n # /usr/doc with 'doc' being a symlink to /usr/share/doc. We call\n # realpath(\"a\"). This should return /usr/share/doc/a/.\n try:\n old_path = abspath('.')\n os.mkdir(ABSTFN)\n os.mkdir(ABSTFN + \"/y\")\n os.symlink(ABSTFN + \"/y\", ABSTFN + \"/k\")\n\n os.chdir(ABSTFN + \"/k\")\n self.assertEqual(realpath(\"a\"), ABSTFN + \"/y/a\")\n finally:\n os.chdir(old_path)\n support.unlink(ABSTFN + \"/k\")\n safe_rmdir(ABSTFN + \"/y\")\n safe_rmdir(ABSTFN)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_realpath_resolve_before_normalizing_PosixPathTest.test_realpath_resolve_before_normalizing.try_.finally_.safe_rmdir_ABSTFN_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_realpath_resolve_before_normalizing_PosixPathTest.test_realpath_resolve_before_normalizing.try_.finally_.safe_rmdir_ABSTFN_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_posixpath.py", "file_name": "test_posixpath.py", "file_type": "text/x-python", "category": "test", "start_line": 401, "end_line": 430, "span_ids": ["PosixPathTest.test_realpath_resolve_before_normalizing"], "tokens": 331}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PosixPathTest(unittest.TestCase):\n\n @unittest.skipUnless(hasattr(os, \"symlink\"),\n \"Missing symlink implementation\")\n @skip_if_ABSTFN_contains_backslash\n def test_realpath_resolve_before_normalizing(self) -> None:\n # Bug #990669: Symbolic links should be resolved before we\n # normalize the path. E.g.: if we have directories 'a', 'k' and 'y'\n # in the following hierarchy:\n # a/k/y\n #\n # and a symbolic link 'link-y' pointing to 'y' in directory 'a',\n # then realpath(\"link-y/..\") should return 'k', not 'a'.\n try:\n old_path = abspath('.')\n os.mkdir(ABSTFN)\n os.mkdir(ABSTFN + \"/k\")\n os.mkdir(ABSTFN + \"/k/y\")\n os.symlink(ABSTFN + \"/k/y\", ABSTFN + \"/link-y\")\n\n # Absolute path.\n self.assertEqual(realpath(ABSTFN + \"/link-y/..\"), ABSTFN + \"/k\")\n # Relative path.\n os.chdir(dirname(ABSTFN))\n self.assertEqual(realpath(basename(ABSTFN) + \"/link-y/..\"),\n ABSTFN + \"/k\")\n finally:\n os.chdir(old_path)\n support.unlink(ABSTFN + \"/link-y\")\n safe_rmdir(ABSTFN + \"/k/y\")\n safe_rmdir(ABSTFN + \"/k\")\n safe_rmdir(ABSTFN)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_realpath_resolve_first_PosixPathTest.test_realpath_resolve_first.try_.finally_.safe_rmdir_ABSTFN_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_realpath_resolve_first_PosixPathTest.test_realpath_resolve_first.try_.finally_.safe_rmdir_ABSTFN_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_posixpath.py", "file_name": "test_posixpath.py", "file_type": "text/x-python", "category": "test", "start_line": 432, "end_line": 453, "span_ids": ["PosixPathTest.test_realpath_resolve_first"], "tokens": 212}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PosixPathTest(unittest.TestCase):\n\n @unittest.skipUnless(hasattr(os, \"symlink\"),\n \"Missing symlink implementation\")\n @skip_if_ABSTFN_contains_backslash\n def test_realpath_resolve_first(self) -> None:\n # Bug #1213894: The first component of the path, if not absolute,\n # must be resolved too.\n\n try:\n old_path = abspath('.')\n os.mkdir(ABSTFN)\n os.mkdir(ABSTFN + \"/k\")\n os.symlink(ABSTFN, ABSTFN + \"link\")\n os.chdir(dirname(ABSTFN))\n\n base = basename(ABSTFN)\n self.assertEqual(realpath(base + \"link\"), ABSTFN)\n self.assertEqual(realpath(base + \"link/k\"), ABSTFN + \"/k\")\n finally:\n os.chdir(old_path)\n support.unlink(ABSTFN + \"link\")\n safe_rmdir(ABSTFN + \"/k\")\n safe_rmdir(ABSTFN)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_relpath_PosixPathTest.test_relpath.try_.finally_.setattr_os_getcwd_rea": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_relpath_PosixPathTest.test_relpath.try_.finally_.setattr_os_getcwd_rea", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_posixpath.py", "file_name": "test_posixpath.py", "file_type": "text/x-python", "category": "test", "start_line": 455, "end_line": 481, "span_ids": ["PosixPathTest.test_relpath"], "tokens": 414}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PosixPathTest(unittest.TestCase):\n\n def test_relpath(self) -> None:\n real_getcwd = os.getcwd\n # mypy: can't modify os directly\n setattr(os, 'getcwd', lambda: r\"/home/user/bar\")\n try:\n curdir = os.path.split(os.getcwd())[-1]\n self.assertRaises(ValueError, posixpath.relpath, \"\")\n self.assertEqual(posixpath.relpath(\"a\"), \"a\")\n self.assertEqual(posixpath.relpath(posixpath.abspath(\"a\")), \"a\")\n self.assertEqual(posixpath.relpath(\"a/b\"), \"a/b\")\n self.assertEqual(posixpath.relpath(\"../a/b\"), \"../a/b\")\n self.assertEqual(posixpath.relpath(\"a\", \"../b\"), \"../\"+curdir+\"/a\")\n self.assertEqual(posixpath.relpath(\"a/b\", \"../c\"),\n \"../\"+curdir+\"/a/b\")\n self.assertEqual(posixpath.relpath(\"a\", \"b/c\"), \"../../a\")\n self.assertEqual(posixpath.relpath(\"a\", \"a\"), \".\")\n self.assertEqual(posixpath.relpath(\"/foo/bar/bat\", \"/x/y/z\"), '../../../foo/bar/bat')\n self.assertEqual(posixpath.relpath(\"/foo/bar/bat\", \"/foo/bar\"), 'bat')\n self.assertEqual(posixpath.relpath(\"/foo/bar/bat\", \"/\"), 'foo/bar/bat')\n self.assertEqual(posixpath.relpath(\"/\", \"/foo/bar/bat\"), '../../..')\n self.assertEqual(posixpath.relpath(\"/foo/bar/bat\", \"/x\"), '../foo/bar/bat')\n self.assertEqual(posixpath.relpath(\"/x\", \"/foo/bar/bat\"), '../../../x')\n self.assertEqual(posixpath.relpath(\"/\", \"/\"), '.')\n self.assertEqual(posixpath.relpath(\"/a\", \"/a\"), '.')\n self.assertEqual(posixpath.relpath(\"/a/b\", \"/a/b\"), '.')\n finally:\n setattr(os, 'getcwd', real_getcwd)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_relpath_bytes_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_posixpath.py_PosixPathTest.test_relpath_bytes_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_posixpath.py", "file_name": "test_posixpath.py", "file_type": "text/x-python", "category": "test", "start_line": 483, "end_line": 532, "span_ids": ["PosixPathTest.test_sameopenfile", "impl:7", "PosixPathTest.test_relpath_bytes", "PosixCommonTest", "test_main"], "tokens": 640}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class PosixPathTest(unittest.TestCase):\n\n def test_relpath_bytes(self) -> None:\n real_getcwdb = os.getcwdb\n # mypy: can't modify os directly\n setattr(os, 'getcwdb', lambda: br\"/home/user/bar\")\n try:\n curdir = os.path.split(os.getcwdb())[-1]\n self.assertRaises(ValueError, posixpath.relpath, b\"\")\n self.assertEqual(posixpath.relpath(b\"a\"), b\"a\")\n self.assertEqual(posixpath.relpath(posixpath.abspath(b\"a\")), b\"a\")\n self.assertEqual(posixpath.relpath(b\"a/b\"), b\"a/b\")\n self.assertEqual(posixpath.relpath(b\"../a/b\"), b\"../a/b\")\n self.assertEqual(posixpath.relpath(b\"a\", b\"../b\"),\n b\"../\"+curdir+b\"/a\")\n self.assertEqual(posixpath.relpath(b\"a/b\", b\"../c\"),\n b\"../\"+curdir+b\"/a/b\")\n self.assertEqual(posixpath.relpath(b\"a\", b\"b/c\"), b\"../../a\")\n self.assertEqual(posixpath.relpath(b\"a\", b\"a\"), b\".\")\n self.assertEqual(posixpath.relpath(b\"/foo/bar/bat\", b\"/x/y/z\"), b'../../../foo/bar/bat')\n self.assertEqual(posixpath.relpath(b\"/foo/bar/bat\", b\"/foo/bar\"), b'bat')\n self.assertEqual(posixpath.relpath(b\"/foo/bar/bat\", b\"/\"), b'foo/bar/bat')\n self.assertEqual(posixpath.relpath(b\"/\", b\"/foo/bar/bat\"), b'../../..')\n self.assertEqual(posixpath.relpath(b\"/foo/bar/bat\", b\"/x\"), b'../foo/bar/bat')\n self.assertEqual(posixpath.relpath(b\"/x\", b\"/foo/bar/bat\"), b'../../../x')\n self.assertEqual(posixpath.relpath(b\"/\", b\"/\"), b'.')\n self.assertEqual(posixpath.relpath(b\"/a\", b\"/a\"), b'.')\n self.assertEqual(posixpath.relpath(b\"/a/b\", b\"/a/b\"), b'.')\n\n self.assertRaises(TypeError, posixpath.relpath, b\"bytes\", \"str\")\n self.assertRaises(TypeError, posixpath.relpath, \"str\", b\"bytes\")\n finally:\n setattr(os, 'getcwdb', real_getcwdb)\n\n def test_sameopenfile(self) -> None:\n fname = support.TESTFN + \"1\"\n with open(fname, \"wb\") as a, open(fname, \"wb\") as b:\n self.assertTrue(posixpath.sameopenfile(a.fileno(), b.fileno()))\n\n\nclass PosixCommonTest(test_genericpath.CommonTest):\n pathmodule = posixpath\n attributes = ['relpath', 'samefile', 'sameopenfile', 'samestat']\n\n\ndef test_main() -> None:\n support.run_unittest(PosixPathTest, PosixCommonTest)\n\n\nif __name__==\"__main__\":\n test_main()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_pprint.py_pprint_Unorderable.__repr__.return.str_id_self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_pprint.py_pprint_Unorderable.__repr__.return.str_id_self_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_pprint.py", "file_name": "test_pprint.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 35, "span_ids": ["Unorderable.__repr__", "imports", "Unorderable", "tuple2", "tuple3", "tuple3.__repr__", "list3", "list3.__repr__", "dict3", "dict3.__repr__", "list2", "dict2"], "tokens": 169}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import pprint\nimport test.support\nimport unittest\nimport test.test_set\nimport random\nimport collections\nimport itertools\n\nfrom typing import List, Any, Dict, Tuple, cast, Callable\n\n# list, tuple and dict subclasses that do or don't overwrite __repr__\nclass list2(list):\n pass\n\nclass list3(list):\n def __repr__(self) -> str:\n return list.__repr__(self)\n\nclass tuple2(tuple):\n pass\n\nclass tuple3(tuple):\n def __repr__(self) -> str:\n return tuple.__repr__(self)\n\nclass dict2(dict):\n pass\n\nclass dict3(dict):\n def __repr__(self) -> str:\n return dict.__repr__(self)\n\nclass Unorderable:\n def __repr__(self) -> str:\n return str(id(self))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_pprint.py_QueryTestCase_QueryTestCase.test_basic.for_safe_in_2_2_0_comp.self_assertTrue_pp_isread": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_pprint.py_QueryTestCase_QueryTestCase.test_basic.for_safe_in_2_2_0_comp.self_assertTrue_pp_isread", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_pprint.py", "file_name": "test_pprint.py", "file_type": "text/x-python", "category": "test", "start_line": 37, "end_line": 58, "span_ids": ["QueryTestCase.test_basic", "QueryTestCase", "QueryTestCase.setUp"], "tokens": 254}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class QueryTestCase(unittest.TestCase):\n\n def setUp(self) -> None:\n self.a = list(range(100)) # type: List[Any]\n self.b = list(range(200)) # type: List[Any]\n self.a[-12] = self.b\n\n def test_basic(self) -> None:\n # Verify .isrecursive() and .isreadable() w/o recursion\n pp = pprint.PrettyPrinter()\n for safe in (2, 2.0, complex(0.0, 2.0), \"abc\", [3], (2,2), {3: 3}, \"yaddayadda\",\n self.a, self.b):\n # module-level convenience functions\n self.assertFalse(pprint.isrecursive(safe),\n \"expected not isrecursive for %r\" % (safe,))\n self.assertTrue(pprint.isreadable(safe),\n \"expected isreadable for %r\" % (safe,))\n # PrettyPrinter methods\n self.assertFalse(pp.isrecursive(safe),\n \"expected not isrecursive for %r\" % (safe,))\n self.assertTrue(pp.isreadable(safe),\n \"expected isreadable for %r\" % (safe,))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_pprint.py_QueryTestCase.test_knotted_QueryTestCase.test_knotted.for_safe_in_self_a_self_.self_assertTrue_pp_isread": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_pprint.py_QueryTestCase.test_knotted_QueryTestCase.test_knotted.for_safe_in_self_a_self_.self_assertTrue_pp_isread", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_pprint.py", "file_name": "test_pprint.py", "file_type": "text/x-python", "category": "test", "start_line": 60, "end_line": 91, "span_ids": ["QueryTestCase.test_knotted"], "tokens": 337}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class QueryTestCase(unittest.TestCase):\n\n def test_knotted(self) -> None:\n # Verify .isrecursive() and .isreadable() w/ recursion\n # Tie a knot.\n self.b[67] = self.a\n # Messy dict.\n self.d = {} # type: Dict[int, dict]\n self.d[0] = self.d[1] = self.d[2] = self.d\n\n pp = pprint.PrettyPrinter()\n\n for icky in self.a, self.b, self.d, (self.d, self.d):\n self.assertTrue(pprint.isrecursive(icky), \"expected isrecursive\")\n self.assertFalse(pprint.isreadable(icky), \"expected not isreadable\")\n self.assertTrue(pp.isrecursive(icky), \"expected isrecursive\")\n self.assertFalse(pp.isreadable(icky), \"expected not isreadable\")\n\n # Break the cycles.\n self.d.clear()\n del self.a[:]\n del self.b[:]\n\n for safe in self.a, self.b, self.d, (self.d, self.d):\n # module-level convenience functions\n self.assertFalse(pprint.isrecursive(safe),\n \"expected not isrecursive for %r\" % (safe,))\n self.assertTrue(pprint.isreadable(safe),\n \"expected isreadable for %r\" % (safe,))\n # PrettyPrinter methods\n self.assertFalse(pp.isrecursive(safe),\n \"expected not isrecursive for %r\" % (safe,))\n self.assertTrue(pp.isreadable(safe),\n \"expected isreadable for %r\" % (safe,))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_pprint.py_QueryTestCase.test_unreadable_QueryTestCase.test_unreadable.for_unreadable_in_type_3_.self_assertFalse_pp_isrea": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_pprint.py_QueryTestCase.test_unreadable_QueryTestCase.test_unreadable.for_unreadable_in_type_3_.self_assertFalse_pp_isrea", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_pprint.py", "file_name": "test_pprint.py", "file_type": "text/x-python", "category": "test", "start_line": 93, "end_line": 106, "span_ids": ["QueryTestCase.test_unreadable"], "tokens": 169}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class QueryTestCase(unittest.TestCase):\n\n def test_unreadable(self) -> None:\n # Not recursive but not readable anyway\n pp = pprint.PrettyPrinter()\n for unreadable in type(3), pprint, pprint.isrecursive:\n # module-level convenience functions\n self.assertFalse(pprint.isrecursive(unreadable),\n \"expected not isrecursive for %r\" % (unreadable,))\n self.assertFalse(pprint.isreadable(unreadable),\n \"expected not isreadable for %r\" % (unreadable,))\n # PrettyPrinter methods\n self.assertFalse(pp.isrecursive(unreadable),\n \"expected not isrecursive for %r\" % (unreadable,))\n self.assertFalse(pp.isreadable(unreadable),\n \"expected not isreadable for %r\" % (unreadable,))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_pprint.py_QueryTestCase.test_same_as_repr_QueryTestCase.test_same_as_repr.for_simple_in_0_0_comp.for_function_in_pformat_.self_assertEqual_native_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_pprint.py_QueryTestCase.test_same_as_repr_QueryTestCase.test_same_as_repr.for_simple_in_0_0_comp.for_function_in_pformat_.self_assertEqual_native_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_pprint.py", "file_name": "test_pprint.py", "file_type": "text/x-python", "category": "test", "start_line": 108, "end_line": 136, "span_ids": ["QueryTestCase.test_same_as_repr"], "tokens": 439}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class QueryTestCase(unittest.TestCase):\n\n def test_same_as_repr(self) -> None:\n # Simple objects, small containers and classes that overwrite __repr__\n # For those the result should be the same as repr().\n # Ahem. The docs don't say anything about that -- this appears to\n # be testing an implementation quirk. Starting in Python 2.5, it's\n # not true for dicts: pprint always sorts dicts by key now; before,\n # it sorted a dict display if and only if the display required\n # multiple lines. For that reason, dicts with more than one element\n # aren't tested here.\n for simple in (0, 0, complex(0.0), 0.0, \"\", b\"\",\n (), tuple2(), tuple3(),\n [], list2(), list3(),\n {}, dict2(), dict3(),\n self.assertTrue, pprint,\n -6, -6, complex(-6.,-6.), -1.5, \"x\", b\"x\", (3,), [3], {3: 6},\n (1,2), [3,4], {5: 6},\n tuple2((1,2)), tuple3((1,2)), tuple3(range(100)), # type: ignore\n [3,4], list2(cast(Any, [3,4])), list3(cast(Any, [3,4])),\n list3(cast(Any, range(100))), dict2(cast(Any, {5: 6})),\n dict3(cast(Any, {5: 6})), # JLe: work around mypy issue #233\n range(10, -11, -1)\n ):\n native = repr(simple)\n for function in \"pformat\", \"saferepr\":\n f = getattr(pprint, function)\n got = f(simple)\n self.assertEqual(native, got,\n \"expected %s got %s from pprint.%s\" %\n (native, got, function))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_pprint.py_QueryTestCase.test_basic_line_wrap_QueryTestCase.test_basic_line_wrap.None_3.self_assertEqual_pprint_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_pprint.py_QueryTestCase.test_basic_line_wrap_QueryTestCase.test_basic_line_wrap.None_3.self_assertEqual_pprint_p", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_pprint.py", "file_name": "test_pprint.py", "file_type": "text/x-python", "category": "test", "start_line": 138, "end_line": 173, "span_ids": ["QueryTestCase.test_basic_line_wrap"], "tokens": 381}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class QueryTestCase(unittest.TestCase):\n\n def test_basic_line_wrap(self) -> None:\n # verify basic line-wrapping operation\n o = {'RPM_cal': 0,\n 'RPM_cal2': 48059,\n 'Speed_cal': 0,\n 'controldesk_runtime_us': 0,\n 'main_code_runtime_us': 0,\n 'read_io_runtime_us': 0,\n 'write_io_runtime_us': 43690}\n exp = \"\"\"\\\n{'RPM_cal': 0,\n 'RPM_cal2': 48059,\n 'Speed_cal': 0,\n 'controldesk_runtime_us': 0,\n 'main_code_runtime_us': 0,\n 'read_io_runtime_us': 0,\n 'write_io_runtime_us': 43690}\"\"\"\n # JLe: work around mypy issue #232\n for type in cast(List[Any], [dict, dict2]):\n self.assertEqual(pprint.pformat(type(o)), exp)\n\n o2 = range(100)\n exp = '[%s]' % ',\\n '.join(map(str, o2))\n for type in cast(List[Any], [list, list2]):\n self.assertEqual(pprint.pformat(type(o2)), exp)\n\n o3 = tuple(range(100))\n exp = '(%s)' % ',\\n '.join(map(str, o3))\n for type in cast(List[Any], [tuple, tuple2]):\n self.assertEqual(pprint.pformat(type(o3)), exp)\n\n # indent parameter\n o4 = range(100)\n exp = '[ %s]' % ',\\n '.join(map(str, o4))\n for type in cast(List[Any], [list, list2]):\n self.assertEqual(pprint.pformat(type(o4), indent=4), exp)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_pprint.py_QueryTestCase.test_nested_indentations_QueryTestCase.test_nested_indentations.self_assertEqual_pprint_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_pprint.py_QueryTestCase.test_nested_indentations_QueryTestCase.test_nested_indentations.self_assertEqual_pprint_p", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_pprint.py", "file_name": "test_pprint.py", "file_type": "text/x-python", "category": "test", "start_line": 175, "end_line": 184, "span_ids": ["QueryTestCase.test_nested_indentations"], "tokens": 135}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class QueryTestCase(unittest.TestCase):\n\n def test_nested_indentations(self) -> None:\n o1 = list(range(10))\n o2 = {'first':1, 'second':2, 'third':3}\n o = [o1, o2]\n expected = \"\"\"\\\n[ [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],\n { 'first': 1,\n 'second': 2,\n 'third': 3}]\"\"\"\n self.assertEqual(pprint.pformat(o, indent=4, width=42), expected)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_pprint.py_QueryTestCase.test_sorted_dict_QueryTestCase.test_sorted_dict.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_pprint.py_QueryTestCase.test_sorted_dict_QueryTestCase.test_sorted_dict.None_2", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_pprint.py", "file_name": "test_pprint.py", "file_type": "text/x-python", "category": "test", "start_line": 186, "end_line": 202, "span_ids": ["QueryTestCase.test_sorted_dict"], "tokens": 315}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class QueryTestCase(unittest.TestCase):\n\n def test_sorted_dict(self) -> None:\n # Starting in Python 2.5, pprint sorts dict displays by key regardless\n # of how small the dictionary may be.\n # Before the change, on 32-bit Windows pformat() gave order\n # 'a', 'c', 'b' here, so this test failed.\n d = {'a': 1, 'b': 1, 'c': 1}\n self.assertEqual(pprint.pformat(d), \"{'a': 1, 'b': 1, 'c': 1}\")\n self.assertEqual(pprint.pformat([d, d]),\n \"[{'a': 1, 'b': 1, 'c': 1}, {'a': 1, 'b': 1, 'c': 1}]\")\n\n # The next one is kind of goofy. The sorted order depends on the\n # alphabetic order of type names: \"int\" < \"str\" < \"tuple\". Before\n # Python 2.5, this was in the test_same_as_repr() test. It's worth\n # keeping around for now because it's one of few tests of pprint\n # against a crazy mix of types.\n self.assertEqual(pprint.pformat({\"xy\\tab\\n\": (3,), 5: [[]], (): {}}),\n r\"{5: [[]], 'xy\\tab\\n': (3,), (): {}}\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_pprint.py_QueryTestCase.test_ordered_dict_QueryTestCase.test_subclassing.self_assertEqual_DottedPr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_pprint.py_QueryTestCase.test_ordered_dict_QueryTestCase.test_subclassing.self_assertEqual_DottedPr", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_pprint.py", "file_name": "test_pprint.py", "file_type": "text/x-python", "category": "test", "start_line": 204, "end_line": 224, "span_ids": ["QueryTestCase.test_ordered_dict", "QueryTestCase.test_subclassing"], "tokens": 191}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class QueryTestCase(unittest.TestCase):\n\n def test_ordered_dict(self) -> None:\n words = 'the quick brown fox jumped over a lazy dog'.split()\n d = collections.OrderedDict(zip(words, itertools.count()))\n self.assertEqual(pprint.pformat(d),\n\"\"\"\\\n{'the': 0,\n 'quick': 1,\n 'brown': 2,\n 'fox': 3,\n 'jumped': 4,\n 'over': 5,\n 'a': 6,\n 'lazy': 7,\n 'dog': 8}\"\"\")\n def test_subclassing(self) -> None:\n o = {'names with spaces': 'should be presented using repr()',\n 'others.should.not.be': 'like.this'}\n exp = \"\"\"\\\n{'names with spaces': 'should be presented using repr()',\n others.should.not.be: like.this}\"\"\"\n self.assertEqual(DottedPrettyPrinter().pformat(o), exp)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_pprint.py_QueryTestCase.test_set_reprs_QueryTestCase.test_set_reprs.cubo_repr_tgt": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_pprint.py_QueryTestCase.test_set_reprs_QueryTestCase.test_set_reprs.cubo_repr_tgt", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_pprint.py", "file_name": "test_pprint.py", "file_type": "text/x-python", "category": "test", "start_line": 226, "end_line": 434, "span_ids": ["QueryTestCase.test_set_reprs"], "tokens": 673}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class QueryTestCase(unittest.TestCase):\n\n @test.support.cpython_only\n def test_set_reprs(self) -> None:\n # This test creates a complex arrangement of frozensets and\n # compares the pretty-printed repr against a string hard-coded in\n # the test. The hard-coded repr depends on the sort order of\n # frozensets.\n #\n # However, as the docs point out: \"Since sets only define\n # partial ordering (subset relationships), the output of the\n # list.sort() method is undefined for lists of sets.\"\n #\n # In a nutshell, the test assumes frozenset({0}) will always\n # sort before frozenset({1}), but:\n #\n # >>> frozenset({0}) < frozenset({1})\n # False\n # >>> frozenset({1}) < frozenset({0})\n # False\n #\n # Consequently, this test is fragile and\n # implementation-dependent. Small changes to Python's sort\n # algorithm cause the test to fail when it should pass.\n\n self.assertEqual(pprint.pformat(set()), 'set()')\n self.assertEqual(pprint.pformat(set(range(3))), '{0, 1, 2}')\n self.assertEqual(pprint.pformat(frozenset()), 'frozenset()')\n self.assertEqual(pprint.pformat(frozenset(range(3))), 'frozenset({0, 1, 2})')\n cube_repr_tgt = \"\"\"\\\n{frozenset(): frozenset({frozenset({2}), frozenset({0}), frozenset({1})}),\n frozenset({0}): frozenset({frozenset(),\n frozenset({0, 2}),\n frozenset({0, 1})}),\n frozenset({1}): frozenset({frozenset(),\n frozenset({1, 2}),\n frozenset({0, 1})}),\n frozenset({2}): frozenset({frozenset(),\n frozenset({1, 2}),\n frozenset({0, 2})}),\n frozenset({1, 2}): frozenset({frozenset({2}),\n frozenset({1}),\n frozenset({0, 1, 2})}),\n frozenset({0, 2}): frozenset({frozenset({2}),\n frozenset({0}),\n frozenset({0, 1, 2})}),\n frozenset({0, 1}): frozenset({frozenset({0}),\n frozenset({1}),\n frozenset({0, 1, 2})}),\n frozenset({0, 1, 2}): frozenset({frozenset({1, 2}),\n frozenset({0, 2}),\n frozenset({0, 1})})}\"\"\"\n cube = test.test_set.cube(3)\n self.assertEqual(pprint.pformat(cube), cube_repr_tgt)\n cubo_repr_tgt =\n # ... other code\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_pprint.py_QueryTestCase.test_set_reprs.cubo_repr_tgt.__QueryTestCase.test_set_reprs.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_pprint.py_QueryTestCase.test_set_reprs.cubo_repr_tgt.__QueryTestCase.test_set_reprs.None_5", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_pprint.py", "file_name": "test_pprint.py", "file_type": "text/x-python", "category": "test", "start_line": 278, "end_line": 437, "span_ids": ["QueryTestCase.test_set_reprs"], "tokens": 1554}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class QueryTestCase(unittest.TestCase):\n\n @test.support.cpython_only\n def test_set_reprs(self) -> None:\n cubo_repr_tgt = \"\"\"\\\n{frozenset({frozenset({0, 2}), frozenset({0})}): frozenset({frozenset({frozenset({0,\n 2}),\n frozenset({0,\n 1,\n 2})}),\n frozenset({frozenset({0}),\n frozenset({0,\n 1})}),\n frozenset({frozenset(),\n frozenset({0})}),\n frozenset({frozenset({2}),\n frozenset({0,\n 2})})}),\n frozenset({frozenset({0, 1}), frozenset({1})}): frozenset({frozenset({frozenset({0,\n 1}),\n frozenset({0,\n 1,\n 2})}),\n frozenset({frozenset({0}),\n frozenset({0,\n 1})}),\n frozenset({frozenset({1}),\n frozenset({1,\n 2})}),\n frozenset({frozenset(),\n frozenset({1})})}),\n frozenset({frozenset({1, 2}), frozenset({1})}): frozenset({frozenset({frozenset({1,\n 2}),\n frozenset({0,\n 1,\n 2})}),\n frozenset({frozenset({2}),\n frozenset({1,\n 2})}),\n frozenset({frozenset(),\n frozenset({1})}),\n frozenset({frozenset({1}),\n frozenset({0,\n 1})})}),\n frozenset({frozenset({1, 2}), frozenset({2})}): frozenset({frozenset({frozenset({1,\n 2}),\n frozenset({0,\n 1,\n 2})}),\n frozenset({frozenset({1}),\n frozenset({1,\n 2})}),\n frozenset({frozenset({2}),\n frozenset({0,\n 2})}),\n frozenset({frozenset(),\n frozenset({2})})}),\n frozenset({frozenset(), frozenset({0})}): frozenset({frozenset({frozenset({0}),\n frozenset({0,\n 1})}),\n frozenset({frozenset({0}),\n frozenset({0,\n 2})}),\n frozenset({frozenset(),\n frozenset({1})}),\n frozenset({frozenset(),\n frozenset({2})})}),\n frozenset({frozenset(), frozenset({1})}): frozenset({frozenset({frozenset(),\n frozenset({0})}),\n frozenset({frozenset({1}),\n frozenset({1,\n 2})}),\n frozenset({frozenset(),\n frozenset({2})}),\n frozenset({frozenset({1}),\n frozenset({0,\n 1})})}),\n frozenset({frozenset({2}), frozenset()}): frozenset({frozenset({frozenset({2}),\n frozenset({1,\n 2})}),\n frozenset({frozenset(),\n frozenset({0})}),\n frozenset({frozenset(),\n frozenset({1})}),\n frozenset({frozenset({2}),\n frozenset({0,\n 2})})}),\n frozenset({frozenset({0, 1, 2}), frozenset({0, 1})}): frozenset({frozenset({frozenset({1,\n 2}),\n frozenset({0,\n 1,\n 2})}),\n frozenset({frozenset({0,\n 2}),\n frozenset({0,\n 1,\n 2})}),\n frozenset({frozenset({0}),\n frozenset({0,\n 1})}),\n frozenset({frozenset({1}),\n frozenset({0,\n 1})})}),\n frozenset({frozenset({0}), frozenset({0, 1})}): frozenset({frozenset({frozenset(),\n frozenset({0})}),\n frozenset({frozenset({0,\n 1}),\n frozenset({0,\n 1,\n 2})}),\n frozenset({frozenset({0}),\n frozenset({0,\n 2})}),\n frozenset({frozenset({1}),\n frozenset({0,\n 1})})}),\n frozenset({frozenset({2}), frozenset({0, 2})}): frozenset({frozenset({frozenset({0,\n 2}),\n frozenset({0,\n 1,\n 2})}),\n frozenset({frozenset({2}),\n frozenset({1,\n 2})}),\n frozenset({frozenset({0}),\n frozenset({0,\n 2})}),\n frozenset({frozenset(),\n frozenset({2})})}),\n frozenset({frozenset({0, 1, 2}), frozenset({0, 2})}): frozenset({frozenset({frozenset({1,\n 2}),\n frozenset({0,\n 1,\n 2})}),\n frozenset({frozenset({0,\n 1}),\n frozenset({0,\n 1,\n 2})}),\n frozenset({frozenset({0}),\n frozenset({0,\n 2})}),\n frozenset({frozenset({2}),\n frozenset({0,\n 2})})}),\n frozenset({frozenset({1, 2}), frozenset({0, 1, 2})}): frozenset({frozenset({frozenset({0,\n 2}),\n frozenset({0,\n 1,\n 2})}),\n frozenset({frozenset({0,\n 1}),\n frozenset({0,\n 1,\n 2})}),\n frozenset({frozenset({2}),\n frozenset({1,\n 2})}),\n frozenset({frozenset({1}),\n frozenset({1,\n 2})})})}\"\"\"\n\n cubo = test.test_set.linegraph(cube)\n self.assertEqual(pprint.pformat(cubo), cubo_repr_tgt)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_pprint.py_QueryTestCase.test_depth_QueryTestCase.test_depth.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_pprint.py_QueryTestCase.test_depth_QueryTestCase.test_depth.None_5", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_pprint.py", "file_name": "test_pprint.py", "file_type": "text/x-python", "category": "test", "start_line": 439, "end_line": 452, "span_ids": ["QueryTestCase.test_depth"], "tokens": 228}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class QueryTestCase(unittest.TestCase):\n\n def test_depth(self) -> None:\n nested_tuple = (1, (2, (3, (4, (5, 6)))))\n nested_dict = {1: {2: {3: {4: {5: {6: 6}}}}}}\n nested_list = [1, [2, [3, [4, [5, [6, []]]]]]]\n self.assertEqual(pprint.pformat(nested_tuple), repr(nested_tuple))\n self.assertEqual(pprint.pformat(nested_dict), repr(nested_dict))\n self.assertEqual(pprint.pformat(nested_list), repr(nested_list))\n\n lv1_tuple = '(1, (...))'\n lv1_dict = '{1: {...}}'\n lv1_list = '[1, [...]]'\n self.assertEqual(pprint.pformat(nested_tuple, depth=1), lv1_tuple)\n self.assertEqual(pprint.pformat(nested_dict, depth=1), lv1_dict)\n self.assertEqual(pprint.pformat(nested_list, depth=1), lv1_list)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_pprint.py_QueryTestCase.test_sort_unorderable_values_QueryTestCase.test_sort_unorderable_values.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_pprint.py_QueryTestCase.test_sort_unorderable_values_QueryTestCase.test_sort_unorderable_values.None_3", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_pprint.py", "file_name": "test_pprint.py", "file_type": "text/x-python", "category": "test", "start_line": 454, "end_line": 467, "span_ids": ["QueryTestCase.test_sort_unorderable_values"], "tokens": 195}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class QueryTestCase(unittest.TestCase):\n\n def test_sort_unorderable_values(self) -> None:\n # Issue 3976: sorted pprints fail for unorderable values.\n n = 20\n keys = [Unorderable() for i in range(n)]\n random.shuffle(keys)\n skeys = sorted(keys, key=id)\n clean = lambda s: s.replace(' ', '').replace('\\n','') # type: Callable[[str], str]\n\n self.assertEqual(clean(pprint.pformat(set(keys))),\n '{' + ','.join(map(repr, skeys)) + '}')\n self.assertEqual(clean(pprint.pformat(frozenset(keys))),\n 'frozenset({' + ','.join(map(repr, skeys)) + '})')\n self.assertEqual(clean(pprint.pformat(dict.fromkeys(keys))),\n '{' + ','.join('%r:None' % k for k in skeys) + '}')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_pprint.py_DottedPrettyPrinter_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_pprint.py_DottedPrettyPrinter_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_pprint.py", "file_name": "test_pprint.py", "file_type": "text/x-python", "category": "test", "start_line": 469, "end_line": 489, "span_ids": ["DottedPrettyPrinter", "DottedPrettyPrinter.format", "impl", "test_main"], "tokens": 134}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DottedPrettyPrinter(pprint.PrettyPrinter):\n\n def format(self, object: object, context: Dict[int, Any], maxlevels: int,\n level: int) -> Tuple[str, int, int]:\n if isinstance(object, str):\n if ' ' in object:\n return repr(object), 1, 0\n else:\n return object, 0, 0\n else:\n return pprint.PrettyPrinter.format(\n self, object, context, maxlevels, level)\n\n\ndef test_main() -> None:\n test.support.run_unittest(QueryTestCase)\n\n\nif __name__ == \"__main__\":\n test_main()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py__usr_bin_env_python3_TestBasicOps.test_saverestore.self_assertEqual_randseq_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py__usr_bin_env_python3_TestBasicOps.test_saverestore.self_assertEqual_randseq_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_random.py", "file_name": "test_random.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 40, "span_ids": ["TestBasicOps.test_saverestore", "TestBasicOps.test_autoseed", "TestBasicOps", "TestBasicOps.randomlist", "docstring"], "tokens": 305}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "#!/usr/bin/env python3\n\nimport unittest\nimport random\nimport time\nimport pickle\nimport warnings\nfrom math import log, exp, pi, fsum, sin\nfrom test import support\n\nfrom typing import Any, Dict, List, Callable, Generic, TypeVar, cast\n\nRT = TypeVar('RT', random.Random, random.SystemRandom)\n\nclass TestBasicOps(unittest.TestCase, Generic[RT]):\n # Superclass with tests common to all generators.\n # Subclasses must arrange for self.gen to retrieve the Random instance\n # to be tested.\n\n gen = None # type: RT # Either Random or SystemRandom\n\n def randomlist(self, n: int) -> List[float]:\n \"\"\"Helper function to make a list of random numbers\"\"\"\n return [self.gen.random() for i in range(n)]\n\n def test_autoseed(self) -> None:\n self.gen.seed()\n state1 = self.gen.getstate()\n time.sleep(0.1)\n self.gen.seed() # diffent seeds at different times\n state2 = self.gen.getstate()\n self.assertNotEqual(state1, state2)\n\n def test_saverestore(self) -> None:\n N = 1000\n self.gen.seed()\n state = self.gen.getstate()\n randseq = self.randomlist(N)\n self.gen.setstate(state) # should regenerate the same sequence\n self.assertEqual(randseq, self.randomlist(N))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_TestBasicOps.test_seedargs_TestBasicOps.test_seedargs._type_ignore_mypy_is": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_TestBasicOps.test_seedargs_TestBasicOps.test_seedargs._type_ignore_mypy_is", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_random.py", "file_name": "test_random.py", "file_type": "text/x-python", "category": "test", "start_line": 42, "end_line": 49, "span_ids": ["TestBasicOps.test_seedargs"], "tokens": 181}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestBasicOps(unittest.TestCase, Generic[RT]):\n # Superclass with tests common to all generators.\n # Subclasses must arrange for self.gen to retrieve the Random instance\n\n def test_seedargs(self) -> None:\n for arg in [None, 0, 0, 1, 1, -1, -1, 10**20, -(10**20),\n 3.14, complex(1., 2.), 'a', tuple('abc')]:\n self.gen.seed(arg)\n for arg in [list(range(3)), {'one': 1}]:\n self.assertRaises(TypeError, self.gen.seed, arg)\n self.assertRaises(TypeError, self.gen.seed, 1, 2, 3, 4)\n self.assertRaises(TypeError, type(self.gen), []) # type: ignore # mypy issue 1846", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_TestBasicOps.test_choice_TestBasicOps.test_sample._test_edge_case_N_k_0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_TestBasicOps.test_choice_TestBasicOps.test_sample._test_edge_case_N_k_0", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_random.py", "file_name": "test_random.py", "file_type": "text/x-python", "category": "test", "start_line": 51, "end_line": 69, "span_ids": ["TestBasicOps.test_sample", "TestBasicOps.test_choice"], "tokens": 217}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestBasicOps(unittest.TestCase, Generic[RT]):\n # Superclass with tests common to all generators.\n # Subclasses must arrange for self.gen to retrieve the Random instance\n\n def test_choice(self) -> None:\n choice = self.gen.choice\n with self.assertRaises(IndexError):\n choice([])\n self.assertEqual(choice([50]), 50)\n self.assertIn(choice([25, 75]), [25, 75])\n\n def test_sample(self) -> None:\n # For the entire allowable range of 0 <= k <= N, validate that\n # the sample is of the correct length and contains only unique items\n N = 100\n population = range(N)\n for k in range(N+1):\n s = self.gen.sample(population, k)\n self.assertEqual(len(s), k)\n uniq = set(s)\n self.assertEqual(len(uniq), k)\n self.assertTrue(uniq <= set(population))\n self.assertEqual(self.gen.sample([], 0), []) # test edge case N==k==0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_TestBasicOps.test_sample_distribution_TestBasicOps.test_sample_distribution.for_k_in_range_n_.for_i_in_range_trials_.else_.self_fail_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_TestBasicOps.test_sample_distribution_TestBasicOps.test_sample_distribution.for_k_in_range_n_.for_i_in_range_trials_.else_.self_fail_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_random.py", "file_name": "test_random.py", "file_type": "text/x-python", "category": "test", "start_line": 71, "end_line": 89, "span_ids": ["TestBasicOps.test_sample_distribution"], "tokens": 208}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestBasicOps(unittest.TestCase, Generic[RT]):\n # Superclass with tests common to all generators.\n # Subclasses must arrange for self.gen to retrieve the Random instance\n\n def test_sample_distribution(self) -> None:\n # For the entire allowable range of 0 <= k <= N, validate that\n # sample generates all possible permutations\n n = 5\n pop = range(n)\n trials = 10000 # large num prevents false negatives without slowing normal case\n def factorial(n: int) -> int:\n if n == 0:\n return 1\n return n * factorial(n - 1)\n for k in range(n):\n expected = factorial(n) // factorial(n-k)\n perms = {} # type: Dict[tuple, object]\n for i in range(trials):\n perms[tuple(self.gen.sample(pop, k))] = None\n if len(perms) == expected:\n break\n else:\n self.fail()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_TestBasicOps.test_sample_inputs_TestBasicOps.test_sample_on_dicts.self_assertRaises_TypeErr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_TestBasicOps.test_sample_inputs_TestBasicOps.test_sample_on_dicts.self_assertRaises_TypeErr", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_random.py", "file_name": "test_random.py", "file_type": "text/x-python", "category": "test", "start_line": 91, "end_line": 100, "span_ids": ["TestBasicOps.test_sample_inputs", "TestBasicOps.test_sample_on_dicts"], "tokens": 151}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestBasicOps(unittest.TestCase, Generic[RT]):\n # Superclass with tests common to all generators.\n # Subclasses must arrange for self.gen to retrieve the Random instance\n\n def test_sample_inputs(self) -> None:\n # SF bug #801342 -- population can be any iterable defining __len__()\n self.gen.sample(set(range(20)), 2)\n self.gen.sample(range(20), 2)\n self.gen.sample(range(20), 2)\n self.gen.sample(str('abcdefghijklmnopqrst'), 2)\n self.gen.sample(tuple('abcdefghijklmnopqrst'), 2)\n\n def test_sample_on_dicts(self) -> None:\n self.assertRaises(TypeError, self.gen.sample, dict.fromkeys('abcdef'), 2)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_TestBasicOps.test_gauss_TestBasicOps.test_pickling.self_assertEqual_origseq_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_TestBasicOps.test_gauss_TestBasicOps.test_pickling.self_assertEqual_origseq_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_random.py", "file_name": "test_random.py", "file_type": "text/x-python", "category": "test", "start_line": 102, "end_line": 124, "span_ids": ["TestBasicOps.test_gauss", "TestBasicOps.test_pickling"], "tokens": 270}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestBasicOps(unittest.TestCase, Generic[RT]):\n # Superclass with tests common to all generators.\n # Subclasses must arrange for self.gen to retrieve the Random instance\n\n def test_gauss(self) -> None:\n # Ensure that the seed() method initializes all the hidden state. In\n # particular, through 2.2.1 it failed to reset a piece of state used\n # by (and only by) the .gauss() method.\n\n for seed in 1, 12, 123, 1234, 12345, 123456, 654321:\n self.gen.seed(seed)\n x1 = self.gen.random()\n y1 = self.gen.gauss(0, 1)\n\n self.gen.seed(seed)\n x2 = self.gen.random()\n y2 = self.gen.gauss(0, 1)\n\n self.assertEqual(x1, x2)\n self.assertEqual(y1, y2)\n\n def test_pickling(self) -> None:\n state = pickle.dumps(self.gen)\n origseq = [self.gen.random() for i in range(10)]\n newgen = pickle.loads(state)\n restoredseq = [newgen.random() for i in range(10)]\n self.assertEqual(origseq, restoredseq)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_TestBasicOps.test_bug_1727780_TestBasicOps.test_bug_9025.self_assertTrue_0_30_k_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_TestBasicOps.test_bug_1727780_TestBasicOps.test_bug_9025.self_assertTrue_0_30_k_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_random.py", "file_name": "test_random.py", "file_type": "text/x-python", "category": "test", "start_line": 126, "end_line": 145, "span_ids": ["TestBasicOps.test_bug_9025", "TestBasicOps.test_bug_1727780"], "tokens": 279}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestBasicOps(unittest.TestCase, Generic[RT]):\n # Superclass with tests common to all generators.\n # Subclasses must arrange for self.gen to retrieve the Random instance\n\n def test_bug_1727780(self) -> None:\n # verify that version-2-pickles can be loaded\n # fine, whether they are created on 32-bit or 64-bit\n # platforms, and that version-3-pickles load fine.\n files = [(\"randv2_32.pck\", 780),\n (\"randv2_64.pck\", 866),\n (\"randv3.pck\", 343)]\n for file, value in files:\n f = open(support.findfile(file),\"rb\")\n r = pickle.load(f)\n f.close()\n self.assertEqual(int(r.random()*1000), value)\n\n def test_bug_9025(self) -> None:\n # Had problem with an uneven distribution in int(n*random())\n # Verify the fix by checking that distributions fall within expectations.\n n = 100000\n randrange = self.gen.randrange\n k = sum(randrange(6755399441055744) % 3 == 2 for i in range(n))\n self.assertTrue(0.30 < k/n and k/n < .37, (k/n))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_SystemRandom_TestBasicOps_SystemRandom_TestBasicOps.test_rangelimits.for_start_stop_in_2_0.self_assertEqual_set_rang": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_SystemRandom_TestBasicOps_SystemRandom_TestBasicOps.test_rangelimits.for_start_stop_in_2_0.self_assertEqual_set_rang", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_random.py", "file_name": "test_random.py", "file_type": "text/x-python", "category": "test", "start_line": 147, "end_line": 200, "span_ids": ["SystemRandom_TestBasicOps.test_gauss", "SystemRandom_TestBasicOps.test_bigrand_ranges", "SystemRandom_TestBasicOps.test_saverestore", "SystemRandom_TestBasicOps.test_53_bits_per_float", "SystemRandom_TestBasicOps.test_bigrand", "SystemRandom_TestBasicOps.test_seedargs", "SystemRandom_TestBasicOps.test_autoseed", "SystemRandom_TestBasicOps.test_pickling", "SystemRandom_TestBasicOps", "SystemRandom_TestBasicOps.test_rangelimits"], "tokens": 518}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SystemRandom_TestBasicOps(TestBasicOps[random.SystemRandom]):\n gen = random.SystemRandom()\n\n def test_autoseed(self) -> None:\n # Doesn't need to do anything except not fail\n self.gen.seed()\n\n def test_saverestore(self) -> None:\n self.assertRaises(NotImplementedError, self.gen.getstate)\n self.assertRaises(NotImplementedError, self.gen.setstate, None)\n\n def test_seedargs(self) -> None:\n # Doesn't need to do anything except not fail\n self.gen.seed(100)\n\n def test_gauss(self) -> None:\n self.gen.gauss_next = None\n self.gen.seed(100)\n self.assertEqual(self.gen.gauss_next, None)\n\n def test_pickling(self) -> None:\n self.assertRaises(NotImplementedError, pickle.dumps, self.gen)\n\n def test_53_bits_per_float(self) -> None:\n # This should pass whenever a C double has 53 bit precision.\n span = 2 ** 53 # type: int\n cum = 0\n for i in range(100):\n cum |= int(self.gen.random() * span)\n self.assertEqual(cum, span-1)\n\n def test_bigrand(self) -> None:\n # The randrange routine should build-up the required number of bits\n # in stages so that all bit positions are active.\n span = 2 ** 500 # type: int\n cum = 0\n for i in range(100):\n r = self.gen.randrange(span)\n self.assertTrue(0 <= r < span)\n cum |= r\n self.assertEqual(cum, span-1)\n\n def test_bigrand_ranges(self) -> None:\n for i in [40,80, 160, 200, 211, 250, 375, 512, 550]:\n start = self.gen.randrange(2 ** i)\n stop = self.gen.randrange(2 ** (i-2))\n if stop <= start:\n return\n self.assertTrue(start <= self.gen.randrange(start, stop) < stop)\n\n def test_rangelimits(self) -> None:\n for start, stop in [(-2,0), (-(2**60)-2,-(2**60)), (2**60,2**60+2)]:\n self.assertEqual(set(range(start,stop)),\n set([self.gen.randrange(start,stop) for i in range(100)]))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_SystemRandom_TestBasicOps.test_genrandbits_SystemRandom_TestBasicOps.test_genrandbits.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_SystemRandom_TestBasicOps.test_genrandbits_SystemRandom_TestBasicOps.test_genrandbits.None_4", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_random.py", "file_name": "test_random.py", "file_type": "text/x-python", "category": "test", "start_line": 202, "end_line": 220, "span_ids": ["SystemRandom_TestBasicOps.test_genrandbits"], "tokens": 236}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SystemRandom_TestBasicOps(TestBasicOps[random.SystemRandom]):\n\n def test_genrandbits(self) -> None:\n # Verify ranges\n for k in range(1, 1000):\n self.assertTrue(0 <= self.gen.getrandbits(k) < 2**k)\n\n # Verify all bits active\n getbits = self.gen.getrandbits\n for span in [1, 2, 3, 4, 31, 32, 32, 52, 53, 54, 119, 127, 128, 129]:\n cum = 0\n for i in range(100):\n cum |= getbits(span)\n self.assertEqual(cum, 2**span-1)\n\n # Verify argument checking\n self.assertRaises(TypeError, self.gen.getrandbits)\n self.assertRaises(TypeError, self.gen.getrandbits, 1, 2)\n self.assertRaises(ValueError, self.gen.getrandbits, 0)\n self.assertRaises(ValueError, self.gen.getrandbits, -1)\n self.assertRaises(TypeError, self.gen.getrandbits, 10.1)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_SystemRandom_TestBasicOps.test_randbelow_logic_SystemRandom_TestBasicOps.test_randbelow_logic.for_i_in_range_1_1000_.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_SystemRandom_TestBasicOps.test_randbelow_logic_SystemRandom_TestBasicOps.test_randbelow_logic.for_i_in_range_1_1000_.None_4", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_random.py", "file_name": "test_random.py", "file_type": "text/x-python", "category": "test", "start_line": 222, "end_line": 242, "span_ids": ["SystemRandom_TestBasicOps.test_randbelow_logic"], "tokens": 324}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SystemRandom_TestBasicOps(TestBasicOps[random.SystemRandom]):\n\n def test_randbelow_logic(self, _log: Callable[[float, float], float] = log,\n int: Callable[[float], int] = int) -> None:\n # check bitcount transition points: 2**i and 2**(i+1)-1\n # show that: k = int(1.001 + _log(n, 2))\n # is equal to or one greater than the number of bits in n\n for i in range(1, 1000):\n n = 1 << i # check an exact power of two\n numbits = i+1\n k = int(1.00001 + _log(n, 2))\n self.assertEqual(k, numbits)\n self.assertEqual(n, 2**(k-1))\n\n n += n - 1 # check 1 below the next power of two\n k = int(1.00001 + _log(n, 2))\n self.assertIn(k, [numbits, numbits+1])\n self.assertTrue(2**k > n > 2**(k-2))\n\n n -= n >> 15 # check a little farther below the next power of two\n k = int(1.00001 + _log(n, 2))\n self.assertEqual(k, numbits) # note the stronger assertion\n self.assertTrue(2**k > n > 2**(k-1)) # note the stronger assertion", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_MersenneTwister_TestBasicOps_MersenneTwister_TestBasicOps.test_guaranteed_stable.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_MersenneTwister_TestBasicOps_MersenneTwister_TestBasicOps.test_guaranteed_stable.None_3", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_random.py", "file_name": "test_random.py", "file_type": "text/x-python", "category": "test", "start_line": 245, "end_line": 257, "span_ids": ["MersenneTwister_TestBasicOps.test_guaranteed_stable", "MersenneTwister_TestBasicOps"], "tokens": 245}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MersenneTwister_TestBasicOps(TestBasicOps[random.Random]):\n gen = random.Random()\n\n def test_guaranteed_stable(self) -> None:\n # These sequences are guaranteed to stay the same across versions of python\n self.gen.seed(3456147, version=1)\n self.assertEqual([self.gen.random().hex() for i in range(4)],\n ['0x1.ac362300d90d2p-1', '0x1.9d16f74365005p-1',\n '0x1.1ebb4352e4c4dp-1', '0x1.1a7422abf9c11p-1'])\n self.gen.seed(\"the quick brown fox\", version=2)\n self.assertEqual([self.gen.random().hex() for i in range(4)],\n ['0x1.1239ddfb11b7cp-3', '0x1.b3cbb5c51b120p-4',\n '0x1.8c4f55116b60fp-1', '0x1.63eb525174a27p-1'])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_MersenneTwister_TestBasicOps.test_setstate_first_arg_MersenneTwister_TestBasicOps.test_setstate_middle_arg.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_MersenneTwister_TestBasicOps.test_setstate_first_arg_MersenneTwister_TestBasicOps.test_setstate_middle_arg.None_3", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_random.py", "file_name": "test_random.py", "file_type": "text/x-python", "category": "test", "start_line": 259, "end_line": 270, "span_ids": ["MersenneTwister_TestBasicOps.test_setstate_first_arg", "MersenneTwister_TestBasicOps.test_setstate_middle_arg"], "tokens": 189}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MersenneTwister_TestBasicOps(TestBasicOps[random.Random]):\n\n def test_setstate_first_arg(self) -> None:\n self.assertRaises(ValueError, self.gen.setstate, (1, None, None))\n\n def test_setstate_middle_arg(self) -> None:\n # Wrong type, s/b tuple\n self.assertRaises(TypeError, self.gen.setstate, (2, None, None))\n # Wrong length, s/b 625\n self.assertRaises(ValueError, self.gen.setstate, (2, (1,2,3), None))\n # Wrong type, s/b tuple of 625 ints\n self.assertRaises(TypeError, self.gen.setstate, (2, tuple(['a',]*625), None))\n # Last element s/b an int also\n self.assertRaises(TypeError, self.gen.setstate, (2, cast(Any, (0,))*624+('a',), None))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_MersenneTwister_TestBasicOps.test_referenceImplementation_MersenneTwister_TestBasicOps.test_referenceImplementation.for_a_e_in_zip_actual_e.self_assertAlmostEqual_a_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_MersenneTwister_TestBasicOps.test_referenceImplementation_MersenneTwister_TestBasicOps.test_referenceImplementation.for_a_e_in_zip_actual_e.self_assertAlmostEqual_a_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_random.py", "file_name": "test_random.py", "file_type": "text/x-python", "category": "test", "start_line": 272, "end_line": 301, "span_ids": ["MersenneTwister_TestBasicOps.test_referenceImplementation"], "tokens": 371}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MersenneTwister_TestBasicOps(TestBasicOps[random.Random]):\n\n def test_referenceImplementation(self) -> None:\n # Compare the python implementation with results from the original\n # code. Create 2000 53-bit precision random floats. Compare only\n # the last ten entries to show that the independent implementations\n # are tracking. Here is the main() function needed to create the\n # list of expected random numbers:\n # void main(void){\n # int i;\n # unsigned long init[4]={61731, 24903, 614, 42143}, length=4;\n # init_by_array(init, length);\n # for (i=0; i<2000; i++) {\n # printf(\"%.15f \", genrand_res53());\n # if (i%5==4) printf(\"\\n\");\n # }\n # }\n expected = [0.45839803073713259,\n 0.86057815201978782,\n 0.92848331726782152,\n 0.35932681119782461,\n 0.081823493762449573,\n 0.14332226470169329,\n 0.084297823823520024,\n 0.53814864671831453,\n 0.089215024911993401,\n 0.78486196105372907]\n\n self.gen.seed(61731 + (24903<<32) + (614<<64) + (42143<<96))\n actual = self.randomlist(2000)[-10:]\n for a, e in zip(actual, expected):\n self.assertAlmostEqual(a,e,places=14)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_MersenneTwister_TestBasicOps.test_strong_reference_implementation_MersenneTwister_TestBasicOps.test_strong_reference_implementation.for_a_e_in_zip_actual_e.self_assertEqual_int_ldex": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_MersenneTwister_TestBasicOps.test_strong_reference_implementation_MersenneTwister_TestBasicOps.test_strong_reference_implementation.for_a_e_in_zip_actual_e.self_assertEqual_int_ldex", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_random.py", "file_name": "test_random.py", "file_type": "text/x-python", "category": "test", "start_line": 303, "end_line": 323, "span_ids": ["MersenneTwister_TestBasicOps.test_strong_reference_implementation"], "tokens": 286}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MersenneTwister_TestBasicOps(TestBasicOps[random.Random]):\n\n def test_strong_reference_implementation(self) -> None:\n # Like test_referenceImplementation, but checks for exact bit-level\n # equality. This should pass on any box where C double contains\n # at least 53 bits of precision (the underlying algorithm suffers\n # no rounding errors -- all results are exact).\n from math import ldexp\n\n expected = [0x0eab3258d2231f,\n 0x1b89db315277a5,\n 0x1db622a5518016,\n 0x0b7f9af0d575bf,\n 0x029e4c4db82240,\n 0x04961892f5d673,\n 0x02b291598e4589,\n 0x11388382c15694,\n 0x02dad977c9e1fe,\n 0x191d96d4d334c6]\n self.gen.seed(61731 + (24903<<32) + (614<<64) + (42143<<96))\n actual = self.randomlist(2000)[-10:]\n for a, e in zip(actual, expected):\n self.assertEqual(int(ldexp(a, 53)), e)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_MersenneTwister_TestBasicOps.test_long_seed_MersenneTwister_TestBasicOps.test_rangelimits.for_start_stop_in_2_0.self_assertEqual_set_rang": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_MersenneTwister_TestBasicOps.test_long_seed_MersenneTwister_TestBasicOps.test_rangelimits.for_start_stop_in_2_0.self_assertEqual_set_rang", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_random.py", "file_name": "test_random.py", "file_type": "text/x-python", "category": "test", "start_line": 325, "end_line": 364, "span_ids": ["MersenneTwister_TestBasicOps.test_bigrand", "MersenneTwister_TestBasicOps.test_rangelimits", "MersenneTwister_TestBasicOps.test_53_bits_per_float", "MersenneTwister_TestBasicOps.test_long_seed", "MersenneTwister_TestBasicOps.test_bigrand_ranges"], "tokens": 469}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MersenneTwister_TestBasicOps(TestBasicOps[random.Random]):\n\n def test_long_seed(self) -> None:\n # This is most interesting to run in debug mode, just to make sure\n # nothing blows up. Under the covers, a dynamically resized array\n # is allocated, consuming space proportional to the number of bits\n # in the seed. Unfortunately, that's a quadratic-time algorithm,\n # so don't make this horribly big.\n seed = (1 << (10000 * 8)) - 1 # about 10K bytes\n self.gen.seed(seed)\n\n def test_53_bits_per_float(self) -> None:\n # This should pass whenever a C double has 53 bit precision.\n span = 2 ** 53 # type: int\n cum = 0\n for i in range(100):\n cum |= int(self.gen.random() * span)\n self.assertEqual(cum, span-1)\n\n def test_bigrand(self) -> None:\n # The randrange routine should build-up the required number of bits\n # in stages so that all bit positions are active.\n span = 2 ** 500 # type: int\n cum = 0\n for i in range(100):\n r = self.gen.randrange(span)\n self.assertTrue(0 <= r < span)\n cum |= r\n self.assertEqual(cum, span-1)\n\n def test_bigrand_ranges(self) -> None:\n for i in [40,80, 160, 200, 211, 250, 375, 512, 550]:\n start = self.gen.randrange(2 ** i)\n stop = self.gen.randrange(2 ** (i-2))\n if stop <= start:\n return\n self.assertTrue(start <= self.gen.randrange(start, stop) < stop)\n\n def test_rangelimits(self) -> None:\n for start, stop in [(-2,0), (-(2**60)-2,-(2**60)), (2**60,2**60+2)]:\n self.assertEqual(set(range(start,stop)),\n set([self.gen.randrange(start,stop) for i in range(100)]))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_MersenneTwister_TestBasicOps.test_genrandbits_MersenneTwister_TestBasicOps.test_genrandbits.None_6": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_MersenneTwister_TestBasicOps.test_genrandbits_MersenneTwister_TestBasicOps.test_genrandbits.None_6", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_random.py", "file_name": "test_random.py", "file_type": "text/x-python", "category": "test", "start_line": 366, "end_line": 388, "span_ids": ["MersenneTwister_TestBasicOps.test_genrandbits"], "tokens": 278}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MersenneTwister_TestBasicOps(TestBasicOps[random.Random]):\n\n def test_genrandbits(self) -> None:\n # Verify cross-platform repeatability\n self.gen.seed(1234567)\n self.assertEqual(self.gen.getrandbits(100),\n 97904845777343510404718956115)\n # Verify ranges\n for k in range(1, 1000):\n self.assertTrue(0 <= self.gen.getrandbits(k) < 2**k)\n\n # Verify all bits active\n getbits = self.gen.getrandbits\n for span in [1, 2, 3, 4, 31, 32, 32, 52, 53, 54, 119, 127, 128, 129]:\n cum = 0\n for i in range(100):\n cum |= getbits(span)\n self.assertEqual(cum, 2**span-1)\n\n # Verify argument checking\n self.assertRaises(TypeError, self.gen.getrandbits)\n self.assertRaises(TypeError, self.gen.getrandbits, 'a')\n self.assertRaises(TypeError, self.gen.getrandbits, 1, 2)\n self.assertRaises(ValueError, self.gen.getrandbits, 0)\n self.assertRaises(ValueError, self.gen.getrandbits, -1)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_MersenneTwister_TestBasicOps.test_randbelow_logic_MersenneTwister_TestBasicOps.test_randrange_bug_1590891.self_assertEqual_x_stop_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_MersenneTwister_TestBasicOps.test_randbelow_logic_MersenneTwister_TestBasicOps.test_randrange_bug_1590891.self_assertEqual_x_stop_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_random.py", "file_name": "test_random.py", "file_type": "text/x-python", "category": "test", "start_line": 390, "end_line": 419, "span_ids": ["MersenneTwister_TestBasicOps.test_randbelow_logic", "MersenneTwister_TestBasicOps.test_randrange_bug_1590891"], "tokens": 405}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MersenneTwister_TestBasicOps(TestBasicOps[random.Random]):\n\n def test_randbelow_logic(self,\n _log: Callable[[int, float], float] = log,\n int: Callable[[float], int] = int) -> None:\n # check bitcount transition points: 2**i and 2**(i+1)-1\n # show that: k = int(1.001 + _log(n, 2))\n # is equal to or one greater than the number of bits in n\n for i in range(1, 1000):\n n = 1 << i # check an exact power of two\n numbits = i+1\n k = int(1.00001 + _log(n, 2))\n self.assertEqual(k, numbits)\n self.assertEqual(n, 2**(k-1))\n\n n += n - 1 # check 1 below the next power of two\n k = int(1.00001 + _log(n, 2))\n self.assertIn(k, [numbits, numbits+1])\n self.assertTrue(2**k > n > 2**(k-2))\n\n n -= n >> 15 # check a little farther below the next power of two\n k = int(1.00001 + _log(n, 2))\n self.assertEqual(k, numbits) # note the stronger assertion\n self.assertTrue(2**k > n > 2**(k-1)) # note the stronger assertion\n\n def test_randrange_bug_1590891(self) -> None:\n start = 1000000000000\n stop = -100000000000000000000\n step = -200\n x = self.gen.randrange(start, stop, step)\n self.assertTrue(stop < x <= start)\n self.assertEqual((x+stop)%step, 0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_gamma_gamma.return.az_z_0_5_exp_az_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_gamma_gamma.return.az_z_0_5_exp_az_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_random.py", "file_name": "test_random.py", "file_type": "text/x-python", "category": "test", "start_line": 421, "end_line": 437, "span_ids": ["gamma"], "tokens": 262}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def gamma(z: float, sqrt2pi: float = (2.0*pi)**0.5) -> float:\n # Reflection to right half of complex plane\n if z < 0.5:\n return pi / sin(pi*z) / gamma(1.0-z)\n # Lanczos approximation with g=7\n az = z + (7.0 - 0.5)\n return az ** (z-0.5) / exp(az) * sqrt2pi * fsum([\n 0.9999999999995183,\n 676.5203681218835 / z,\n -1259.139216722289 / (z+1.0),\n 771.3234287757674 / (z+2.0),\n -176.6150291498386 / (z+3.0),\n 12.50734324009056 / (z+4.0),\n -0.1385710331296526 / (z+5.0),\n 0.9934937113930748e-05 / (z+6.0),\n 0.1659470187408462e-06 / (z+7.0),\n ])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_TestDistributions_TestDistributions.test_zeroinputs.g_triangular_0_0_1_0_1_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_TestDistributions_TestDistributions.test_zeroinputs.g_triangular_0_0_1_0_1_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_random.py", "file_name": "test_random.py", "file_type": "text/x-python", "category": "test", "start_line": 439, "end_line": 458, "span_ids": ["TestDistributions.test_zeroinputs", "TestDistributions"], "tokens": 304}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestDistributions(unittest.TestCase):\n def test_zeroinputs(self) -> None:\n # Verify that distributions can handle a series of zero inputs'\n g = random.Random()\n x = [g.random() for i in range(50)] + [0.0]*5\n def patch() -> None:\n setattr(g, 'random', x[:].pop)\n patch(); g.uniform(1.0,10.0)\n patch(); g.paretovariate(1.0)\n patch(); g.expovariate(1.0)\n patch(); g.weibullvariate(1.0, 1.0)\n patch(); g.normalvariate(0.0, 1.0)\n patch(); g.gauss(0.0, 1.0)\n patch(); g.lognormvariate(0.0, 1.0)\n patch(); g.vonmisesvariate(0.0, 1.0)\n patch(); g.gammavariate(0.01, 1.0)\n patch(); g.gammavariate(1.0, 1.0)\n patch(); g.gammavariate(200.0, 1.0)\n patch(); g.betavariate(3.0, 3.0)\n patch(); g.triangular(0.0, 1.0, 1.0/3.0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_TestDistributions.test_avg_std_TestDistributions.test_avg_std.for_variate_args_mu_si.self_assertAlmostEqual_s2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_TestDistributions.test_avg_std_TestDistributions.test_avg_std.for_variate_args_mu_si.self_assertAlmostEqual_s2", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_random.py", "file_name": "test_random.py", "file_type": "text/x-python", "category": "test", "start_line": 460, "end_line": 488, "span_ids": ["TestDistributions.test_avg_std"], "tokens": 437}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestDistributions(unittest.TestCase):\n\n def test_avg_std(self) -> None:\n # Use integration to test distribution average and standard deviation.\n # Only works for distributions which do not consume variates in pairs\n g = random.Random()\n N = 5000\n x = [i/float(N) for i in range(1,N)]\n variate = None # type: Any\n for variate, args, mu, sigmasqrd in [\n (g.uniform, (1.0,10.0), (10.0+1.0)/2, (10.0-1.0)**2/12),\n (g.triangular, (0.0, 1.0, 1.0/3.0), 4.0/9.0, 7.0/9.0/18.0),\n (g.expovariate, (1.5,), 1/1.5, 1/1.5**2),\n (g.paretovariate, (5.0,), 5.0/(5.0-1),\n 5.0/((5.0-1)**2*(5.0-2))),\n (g.weibullvariate, (1.0, 3.0), gamma(1+1/3.0),\n gamma(1+2/3.0)-gamma(1+1/3.0)**2) ]:\n setattr(g, 'random', x[:].pop)\n y = [] # type: List[float]\n for i in range(len(x)):\n try:\n y.append(variate(*args))\n except IndexError:\n pass\n s1 = s2 = 0.0\n for e in y:\n s1 += e\n s2 += (e - mu) ** 2\n N = len(y)\n self.assertAlmostEqual(s1/N, mu, places=2)\n self.assertAlmostEqual(s2/(N-1), sigmasqrd, places=2)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_TestModule_TestModule.test_random_subclass_with_kwargs.Subclass_newarg_1_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_TestModule_TestModule.test_random_subclass_with_kwargs.Subclass_newarg_1_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_random.py", "file_name": "test_random.py", "file_type": "text/x-python", "category": "test", "start_line": 490, "end_line": 506, "span_ids": ["TestModule.test__all__", "TestModule", "TestModule.test_random_subclass_with_kwargs", "TestModule.testMagicConstants"], "tokens": 193}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestModule(unittest.TestCase):\n def testMagicConstants(self) -> None:\n self.assertAlmostEqual(random.NV_MAGICCONST, 1.71552776992141)\n self.assertAlmostEqual(random.TWOPI, 6.28318530718)\n self.assertAlmostEqual(random.LOG4, 1.38629436111989)\n self.assertAlmostEqual(random.SG_MAGICCONST, 2.50407739677627)\n\n def test__all__(self) -> None:\n # tests validity but not completeness of the __all__ list\n self.assertTrue(set(random.__all__) <= set(dir(random)))\n\n def test_random_subclass_with_kwargs(self) -> None:\n # SF bug #1486663 -- this used to erroneously raise a TypeError\n class Subclass(random.Random):\n def __init__(self, newarg: object = None) -> None:\n random.Random.__init__(self)\n Subclass(newarg=1)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_test_main_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_random.py_test_main_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_random.py", "file_name": "test_random.py", "file_type": "text/x-python", "category": "test", "start_line": 509, "end_line": 534, "span_ids": ["impl:3", "test_main"], "tokens": 161}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def test_main(verbose: bool = None) -> None:\n testclasses = [MersenneTwister_TestBasicOps,\n TestDistributions,\n TestModule]\n\n try:\n random.SystemRandom().random()\n except NotImplementedError:\n pass\n else:\n testclasses.append(SystemRandom_TestBasicOps)\n\n support.run_unittest(*testclasses)\n\n # verify reference counting\n import sys\n if verbose and hasattr(sys, \"gettotalrefcount\"):\n counts = [None] * 5 # type: List[int]\n for i in range(len(counts)):\n support.run_unittest(*testclasses)\n counts[i] = sys.gettotalrefcount()\n print(counts)\n\nif __name__ == \"__main__\":\n test_main(verbose=True)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_unittest_ReprWrapper.__repr__.return.repr_self_value_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_unittest_ReprWrapper.__repr__.return.repr_self_value_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_set.py", "file_name": "test_set.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 30, "span_ids": ["BadCmp.__hash__", "PassThru", "check_pass_thru", "imports", "ReprWrapper.__repr__", "ReprWrapper", "BadCmp", "BadCmp.__eq__"], "tokens": 135}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import unittest\nfrom test import support\nimport gc\nimport weakref\nimport operator\nimport copy\nimport pickle\nfrom random import randrange, shuffle\nimport sys\nimport warnings\nimport collections\nfrom typing import Set, Any\n\nclass PassThru(Exception):\n pass\n\ndef check_pass_thru():\n raise PassThru\n yield 1\n\nclass BadCmp:\n def __hash__(self):\n return 1\n def __eq__(self, other):\n raise RuntimeError\n\nclass ReprWrapper:\n 'Used to test self-referential repr() calls'\n def __repr__(self):\n return repr(self.value)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py__class_HashCountingInt_in_TestJointOps.test_contains.self_assertIn_self_thetyp": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py__class_HashCountingInt_in_TestJointOps.test_contains.self_assertIn_self_thetyp", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_set.py", "file_name": "test_set.py", "file_type": "text/x-python", "category": "test", "start_line": 32, "end_line": 69, "span_ids": ["TestJointOps.test_uniquification", "TestJointOps.test_len", "ReprWrapper.__repr__", "TestJointOps.test_contains", "TestJointOps.test_new_or_init", "TestJointOps", "TestJointOps.setUp"], "tokens": 319}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "#class HashCountingInt(int):\n# 'int-like object that counts the number of times __hash__ is called'\n# def __init__(self, *args):\n# self.hash_count = 0\n# def __hash__(self):\n# self.hash_count += 1\n# return int.__hash__(self)\n\nclass TestJointOps(unittest.TestCase):\n # Tests common to both set and frozenset\n\n def setUp(self):\n self.word = word = 'simsalabim'\n self.otherword = 'madagascar'\n self.letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'\n self.s = self.thetype(word)\n self.d = dict.fromkeys(word)\n\n def test_new_or_init(self):\n self.assertRaises(TypeError, self.thetype, [], 2)\n self.assertRaises(TypeError, set().__init__, a=1)\n\n def test_uniquification(self):\n actual = sorted(self.s)\n expected = sorted(self.d)\n self.assertEqual(actual, expected)\n self.assertRaises(PassThru, self.thetype, check_pass_thru())\n self.assertRaises(TypeError, self.thetype, [[]])\n\n def test_len(self):\n self.assertEqual(len(self.s), len(self.d))\n\n def test_contains(self):\n for c in self.letters:\n self.assertEqual(c in self.s, c in self.d)\n self.assertRaises(TypeError, self.s.__contains__, [[]])\n s = self.thetype([frozenset(self.letters)])\n self.assertIn(self.thetype(self.letters), s)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestJointOps.test_union_TestJointOps.test_union.self_assertEqual_x_union_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestJointOps.test_union_TestJointOps.test_union.self_assertEqual_x_union_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_set.py", "file_name": "test_set.py", "file_type": "text/x-python", "category": "test", "start_line": 71, "end_line": 88, "span_ids": ["TestJointOps.test_union"], "tokens": 264}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestJointOps(unittest.TestCase):\n\n def test_union(self):\n u = self.s.union(self.otherword)\n for c in self.letters:\n self.assertEqual(c in u, c in self.d or c in self.otherword)\n self.assertEqual(self.s, self.thetype(self.word))\n self.assertEqual(type(u), self.basetype)\n self.assertRaises(PassThru, self.s.union, check_pass_thru())\n self.assertRaises(TypeError, self.s.union, [[]])\n for C in set, frozenset, dict.fromkeys, str, list, tuple:\n self.assertEqual(self.thetype('abcba').union(C('cdc')), set('abcd'))\n self.assertEqual(self.thetype('abcba').union(C('efgfe')), set('abcefg'))\n self.assertEqual(self.thetype('abcba').union(C('ccb')), set('abc'))\n self.assertEqual(self.thetype('abcba').union(C('ef')), set('abcef'))\n self.assertEqual(self.thetype('abcba').union(C('ef'), C('fg')), set('abcefg'))\n\n # Issue #6573\n x = self.thetype()\n self.assertEqual(x.union(set([1]), x, set([2])), self.thetype([1, 2]))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestJointOps.test_or_TestJointOps.test_intersection.if_self_thetype_frozen.else_.self_assertNotEqual_id_s_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestJointOps.test_or_TestJointOps.test_intersection.if_self_thetype_frozen.else_.self_assertNotEqual_id_s_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_set.py", "file_name": "test_set.py", "file_type": "text/x-python", "category": "test", "start_line": 90, "end_line": 119, "span_ids": ["TestJointOps.test_intersection", "TestJointOps.test_or"], "tokens": 337}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestJointOps(unittest.TestCase):\n\n def test_or(self):\n i = self.s.union(self.otherword)\n self.assertEqual(self.s | set(self.otherword), i)\n self.assertEqual(self.s | frozenset(self.otherword), i)\n try:\n self.s | self.otherword\n except TypeError:\n pass\n else:\n self.fail(\"s|t did not screen-out general iterables\")\n\n def test_intersection(self):\n i = self.s.intersection(self.otherword)\n for c in self.letters:\n self.assertEqual(c in i, c in self.d and c in self.otherword)\n self.assertEqual(self.s, self.thetype(self.word))\n self.assertEqual(type(i), self.basetype)\n self.assertRaises(PassThru, self.s.intersection, check_pass_thru())\n for C in set, frozenset, dict.fromkeys, str, list, tuple:\n self.assertEqual(self.thetype('abcba').intersection(C('cdc')), set('cc'))\n self.assertEqual(self.thetype('abcba').intersection(C('efgfe')), set(''))\n self.assertEqual(self.thetype('abcba').intersection(C('ccb')), set('bc'))\n self.assertEqual(self.thetype('abcba').intersection(C('ef')), set(''))\n self.assertEqual(self.thetype('abcba').intersection(C('cbcf'), C('bag')), set('b'))\n s = self.thetype('abcba')\n z = s.intersection()\n if self.thetype == frozenset():\n self.assertEqual(id(s), id(z))\n else:\n self.assertNotEqual(id(s), id(z))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestJointOps.test_isdisjoint_TestJointOps.test_and.try_.else_.self_fail_s_t_did_not_sc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestJointOps.test_isdisjoint_TestJointOps.test_and.try_.else_.self_fail_s_t_did_not_sc", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_set.py", "file_name": "test_set.py", "file_type": "text/x-python", "category": "test", "start_line": 121, "end_line": 144, "span_ids": ["TestJointOps.test_isdisjoint", "TestJointOps.test_and"], "tokens": 275}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestJointOps(unittest.TestCase):\n\n def test_isdisjoint(self):\n def f(s1, s2):\n 'Pure python equivalent of isdisjoint()'\n return not set(s1).intersection(s2)\n for larg in '', 'a', 'ab', 'abc', 'ababac', 'cdc', 'cc', 'efgfe', 'ccb', 'ef':\n s1 = self.thetype(larg)\n for rarg in '', 'a', 'ab', 'abc', 'ababac', 'cdc', 'cc', 'efgfe', 'ccb', 'ef':\n for C in set, frozenset, dict.fromkeys, str, list, tuple:\n s2 = C(rarg)\n actual = s1.isdisjoint(s2)\n expected = f(s1, s2)\n self.assertEqual(actual, expected)\n self.assertTrue(actual is True or actual is False)\n\n def test_and(self):\n i = self.s.intersection(self.otherword)\n self.assertEqual(self.s & set(self.otherword), i)\n self.assertEqual(self.s & frozenset(self.otherword), i)\n try:\n self.s & self.otherword\n except TypeError:\n pass\n else:\n self.fail(\"s&t did not screen-out general iterables\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestJointOps.test_difference_TestJointOps.test_difference.for_C_in_set_frozenset_.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestJointOps.test_difference_TestJointOps.test_difference.for_C_in_set_frozenset_.None_5", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_set.py", "file_name": "test_set.py", "file_type": "text/x-python", "category": "test", "start_line": 146, "end_line": 160, "span_ids": ["TestJointOps.test_difference"], "tokens": 241}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestJointOps(unittest.TestCase):\n\n def test_difference(self):\n i = self.s.difference(self.otherword)\n for c in self.letters:\n self.assertEqual(c in i, c in self.d and c not in self.otherword)\n self.assertEqual(self.s, self.thetype(self.word))\n self.assertEqual(type(i), self.basetype)\n self.assertRaises(PassThru, self.s.difference, check_pass_thru())\n self.assertRaises(TypeError, self.s.difference, [[]])\n for C in set, frozenset, dict.fromkeys, str, list, tuple:\n self.assertEqual(self.thetype('abcba').difference(C('cdc')), set('ab'))\n self.assertEqual(self.thetype('abcba').difference(C('efgfe')), set('abc'))\n self.assertEqual(self.thetype('abcba').difference(C('ccb')), set('a'))\n self.assertEqual(self.thetype('abcba').difference(C('ef')), set('abc'))\n self.assertEqual(self.thetype('abcba').difference(), set('abc'))\n self.assertEqual(self.thetype('abcba').difference(C('a'), C('b')), set('c'))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestJointOps.test_sub_TestJointOps.test_symmetric_difference.for_C_in_set_frozenset_.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestJointOps.test_sub_TestJointOps.test_symmetric_difference.for_C_in_set_frozenset_.None_3", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_set.py", "file_name": "test_set.py", "file_type": "text/x-python", "category": "test", "start_line": 162, "end_line": 185, "span_ids": ["TestJointOps.test_symmetric_difference", "TestJointOps.test_sub"], "tokens": 297}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestJointOps(unittest.TestCase):\n\n def test_sub(self):\n i = self.s.difference(self.otherword)\n self.assertEqual(self.s - set(self.otherword), i)\n self.assertEqual(self.s - frozenset(self.otherword), i)\n try:\n self.s - self.otherword\n except TypeError:\n pass\n else:\n self.fail(\"s-t did not screen-out general iterables\")\n\n def test_symmetric_difference(self):\n i = self.s.symmetric_difference(self.otherword)\n for c in self.letters:\n self.assertEqual(c in i, (c in self.d) ^ (c in self.otherword))\n self.assertEqual(self.s, self.thetype(self.word))\n self.assertEqual(type(i), self.basetype)\n self.assertRaises(PassThru, self.s.symmetric_difference, check_pass_thru())\n self.assertRaises(TypeError, self.s.symmetric_difference, [[]])\n for C in set, frozenset, dict.fromkeys, str, list, tuple:\n self.assertEqual(self.thetype('abcba').symmetric_difference(C('cdc')), set('abd'))\n self.assertEqual(self.thetype('abcba').symmetric_difference(C('efgfe')), set('abcefg'))\n self.assertEqual(self.thetype('abcba').symmetric_difference(C('ccb')), set('a'))\n self.assertEqual(self.thetype('abcba').symmetric_difference(C('ef')), set('abcef'))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestJointOps.test_xor_TestJointOps.test_setOfFrozensets.self_assertEqual_len_s_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestJointOps.test_xor_TestJointOps.test_setOfFrozensets.self_assertEqual_len_s_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_set.py", "file_name": "test_set.py", "file_type": "text/x-python", "category": "test", "start_line": 187, "end_line": 209, "span_ids": ["TestJointOps.test_setOfFrozensets", "TestJointOps.test_xor", "TestJointOps.test_equality"], "tokens": 220}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestJointOps(unittest.TestCase):\n\n def test_xor(self):\n i = self.s.symmetric_difference(self.otherword)\n self.assertEqual(self.s ^ set(self.otherword), i)\n self.assertEqual(self.s ^ frozenset(self.otherword), i)\n try:\n self.s ^ self.otherword\n except TypeError:\n pass\n else:\n self.fail(\"s^t did not screen-out general iterables\")\n\n def test_equality(self):\n self.assertEqual(self.s, set(self.word))\n self.assertEqual(self.s, frozenset(self.word))\n self.assertEqual(self.s == self.word, False)\n self.assertNotEqual(self.s, set(self.otherword))\n self.assertNotEqual(self.s, frozenset(self.otherword))\n self.assertEqual(self.s != self.word, True)\n\n def test_setOfFrozensets(self):\n t = map(frozenset, ['abcdef', 'bcd', 'bdcb', 'fed', 'fedccba'])\n s = self.thetype(t)\n self.assertEqual(len(s), 3)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestJointOps.test_sub_and_super_TestJointOps.test_sub_and_super.self_assertFalse_set_cbs": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestJointOps.test_sub_and_super_TestJointOps.test_sub_and_super.self_assertFalse_set_cbs", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_set.py", "file_name": "test_set.py", "file_type": "text/x-python", "category": "test", "start_line": 211, "end_line": 225, "span_ids": ["TestJointOps.test_sub_and_super"], "tokens": 154}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestJointOps(unittest.TestCase):\n\n def test_sub_and_super(self):\n p, q, r = map(self.thetype, ['ab', 'abcde', 'def'])\n self.assertTrue(p < q)\n self.assertTrue(p <= q)\n self.assertTrue(q <= q)\n self.assertTrue(q > p)\n self.assertTrue(q >= p)\n self.assertFalse(q < r)\n self.assertFalse(q <= r)\n self.assertFalse(q > r)\n self.assertFalse(q >= r)\n self.assertTrue(set('a').issubset('abc'))\n self.assertTrue(set('abc').issuperset('a'))\n self.assertFalse(set('a').issubset('cbs'))\n self.assertFalse(set('cbs').issuperset('a'))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestJointOps.test_pickling_TestJointOps.test_deepcopy.self_assertEqual_t_value_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestJointOps.test_pickling_TestJointOps.test_deepcopy.self_assertEqual_t_value_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_set.py", "file_name": "test_set.py", "file_type": "text/x-python", "category": "test", "start_line": 227, "end_line": 253, "span_ids": ["TestJointOps.test_pickling", "TestJointOps.test_deepcopy"], "tokens": 246}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestJointOps(unittest.TestCase):\n\n def test_pickling(self):\n for i in range(pickle.HIGHEST_PROTOCOL + 1):\n p = pickle.dumps(self.s, i)\n dup = pickle.loads(p)\n self.assertEqual(self.s, dup, \"%s != %s\" % (self.s, dup))\n if type(self.s) not in (set, frozenset):\n self.s.x = 10\n p = pickle.dumps(self.s)\n dup = pickle.loads(p)\n self.assertEqual(self.s.x, dup.x)\n\n def test_deepcopy(self):\n class Tracer:\n def __init__(self, value):\n self.value = value\n def __hash__(self):\n return self.value\n def __deepcopy__(self, memo=None):\n return Tracer(self.value + 1)\n t = Tracer(10)\n s = self.thetype([t])\n dup = copy.deepcopy(s)\n self.assertNotEqual(id(s), id(dup))\n for elem in dup:\n newt = elem\n self.assertNotEqual(id(t), id(newt))\n self.assertEqual(t.value + 1, newt.value)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestJointOps.test_gc_TestJointOps.test_subclass_with_custom_hash.f_discard_s_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestJointOps.test_gc_TestJointOps.test_subclass_with_custom_hash.f_discard_s_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_set.py", "file_name": "test_set.py", "file_type": "text/x-python", "category": "test", "start_line": 255, "end_line": 277, "span_ids": ["TestJointOps.test_subclass_with_custom_hash", "TestJointOps.test_gc"], "tokens": 170}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestJointOps(unittest.TestCase):\n\n def test_gc(self):\n # Create a nest of cycles to exercise overall ref count check\n class A:\n pass\n s = set(A() for i in range(1000))\n for elem in s:\n elem.cycle = s\n elem.sub = elem\n elem.set = set([elem])\n\n def test_subclass_with_custom_hash(self):\n raise NotImplementedError() # runtime computed base class below\n # Bug #1257731\n class H: # (self.thetype):\n def __hash__(self):\n return int(id(self) & 0x7fffffff)\n s=H()\n f=set()\n f.add(s)\n self.assertIn(s, f)\n f.remove(s)\n f.add(s)\n f.discard(s)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestJointOps.test_badcmp_TestJointOps.test_badcmp.if_hasattr_s_add_.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestJointOps.test_badcmp_TestJointOps.test_badcmp.if_hasattr_s_add_.None_2", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_set.py", "file_name": "test_set.py", "file_type": "text/x-python", "category": "test", "start_line": 279, "end_line": 288, "span_ids": ["TestJointOps.test_badcmp"], "tokens": 124}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestJointOps(unittest.TestCase):\n\n def test_badcmp(self):\n s = self.thetype([BadCmp()])\n # Detect comparison errors during insertion and lookup\n self.assertRaises(RuntimeError, self.thetype, [BadCmp(), BadCmp()])\n self.assertRaises(RuntimeError, s.__contains__, BadCmp())\n # Detect errors during mutating operations\n if hasattr(s, 'add'):\n self.assertRaises(RuntimeError, s.add, BadCmp())\n self.assertRaises(RuntimeError, s.discard, BadCmp())\n self.assertRaises(RuntimeError, s.remove, BadCmp())", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestJointOps.test_cyclical_repr_TestJointOps.test_cyclical_print.try_.finally_.support_unlink_support_TE": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestJointOps.test_cyclical_repr_TestJointOps.test_cyclical_print.try_.finally_.support_unlink_support_TE", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_set.py", "file_name": "test_set.py", "file_type": "text/x-python", "category": "test", "start_line": 290, "end_line": 312, "span_ids": ["TestJointOps.test_cyclical_repr", "TestJointOps.test_cyclical_print"], "tokens": 192}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestJointOps(unittest.TestCase):\n\n def test_cyclical_repr(self):\n w = ReprWrapper()\n s = self.thetype([w])\n w.value = s\n if self.thetype == set:\n self.assertEqual(repr(s), '{set(...)}')\n else:\n name = repr(s).partition('(')[0] # strip class name\n self.assertEqual(repr(s), '%s({%s(...)})' % (name, name))\n\n def test_cyclical_print(self):\n w = ReprWrapper()\n s = self.thetype([w])\n w.value = s\n fo = open(support.TESTFN, \"w\")\n try:\n fo.write(str(s))\n fo.close()\n fo = open(support.TESTFN, \"r\")\n self.assertEqual(fo.read(), repr(s))\n finally:\n fo.close()\n support.unlink(support.TESTFN)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestJointOps.test_do_not_rehash_dict_keys_TestJointOps.test_container_iterator.self_assertTrue_ref_is_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestJointOps.test_do_not_rehash_dict_keys_TestJointOps.test_container_iterator.self_assertTrue_ref_is_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_set.py", "file_name": "test_set.py", "file_type": "text/x-python", "category": "test", "start_line": 314, "end_line": 345, "span_ids": ["TestJointOps.test_do_not_rehash_dict_keys", "TestJointOps.test_container_iterator"], "tokens": 325}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestJointOps(unittest.TestCase):\n\n def test_do_not_rehash_dict_keys(self):\n raise NotImplementedError() # cannot subclass int\n n = 10\n d = None # dict.fromkeys(map(HashCountingInt, range(n)))\n self.assertEqual(sum(elem.hash_count for elem in d), n)\n s = self.thetype(d)\n self.assertEqual(sum(elem.hash_count for elem in d), n)\n s.difference(d)\n self.assertEqual(sum(elem.hash_count for elem in d), n)\n if hasattr(s, 'symmetric_difference_update'):\n s.symmetric_difference_update(d)\n self.assertEqual(sum(elem.hash_count for elem in d), n)\n d2 = dict.fromkeys(set(d))\n self.assertEqual(sum(elem.hash_count for elem in d), n)\n d3 = dict.fromkeys(frozenset(d))\n self.assertEqual(sum(elem.hash_count for elem in d), n)\n d3 = dict.fromkeys(frozenset(d), 123)\n self.assertEqual(sum(elem.hash_count for elem in d), n)\n self.assertEqual(d3, dict.fromkeys(d, 123))\n\n def test_container_iterator(self):\n # Bug #3680: tp_traverse was not implemented for set iterator object\n class C(object):\n pass\n obj = C()\n ref = weakref.ref(obj)\n container = set([obj, 1])\n obj.x = iter(container)\n obj = None\n container = None\n gc.collect()\n self.assertTrue(ref() is None, \"Cycle was not collected\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestSet_TestSet.test_pop.self_assertRaises_KeyErro": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestSet_TestSet.test_pop.self_assertRaises_KeyErro", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_set.py", "file_name": "test_set.py", "file_type": "text/x-python", "category": "test", "start_line": 347, "end_line": 441, "span_ids": ["TestSet.test_set_literal", "TestSet.test_add", "TestSet.test_pop", "TestSet.test_discard", "TestSet.test_remove", "TestSet.test_constructor_identity", "TestSet.test_remove_keyerror_set", "TestSet.test_clear", "TestSet", "TestSet.test_copy", "TestSet.test_hash", "TestSet.test_remove_keyerror_unpacking", "TestSet.test_init"], "tokens": 720}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestSet(TestJointOps):\n thetype = set\n basetype = set\n\n def test_init(self):\n s = self.thetype()\n s.__init__(self.word)\n self.assertEqual(s, set(self.word))\n s.__init__(self.otherword)\n self.assertEqual(s, set(self.otherword))\n self.assertRaises(TypeError, s.__init__, s, 2);\n self.assertRaises(TypeError, s.__init__, 1)\n\n def test_constructor_identity(self):\n s = self.thetype(range(3))\n t = self.thetype(s)\n self.assertNotEqual(id(s), id(t))\n\n def test_set_literal(self):\n raise NotImplementedError()\n #s = set([1,2,3])\n #t = {1,2,3}\n #self.assertEqual(s, t)\n\n def test_hash(self):\n self.assertRaises(TypeError, hash, self.s)\n\n def test_clear(self):\n self.s.clear()\n self.assertEqual(self.s, set())\n self.assertEqual(len(self.s), 0)\n\n def test_copy(self):\n dup = self.s.copy()\n self.assertEqual(self.s, dup)\n self.assertNotEqual(id(self.s), id(dup))\n self.assertEqual(type(dup), self.basetype)\n\n def test_add(self):\n self.s.add('Q')\n self.assertIn('Q', self.s)\n dup = self.s.copy()\n self.s.add('Q')\n self.assertEqual(self.s, dup)\n self.assertRaises(TypeError, self.s.add, [])\n\n def test_remove(self):\n self.s.remove('a')\n self.assertNotIn('a', self.s)\n self.assertRaises(KeyError, self.s.remove, 'Q')\n self.assertRaises(TypeError, self.s.remove, [])\n s = self.thetype([frozenset(self.word)])\n self.assertIn(self.thetype(self.word), s)\n s.remove(self.thetype(self.word))\n self.assertNotIn(self.thetype(self.word), s)\n self.assertRaises(KeyError, self.s.remove, self.thetype(self.word))\n\n def test_remove_keyerror_unpacking(self):\n # bug: www.python.org/sf/1576657\n for v1 in ['Q', (1,)]:\n try:\n self.s.remove(v1)\n except KeyError as e:\n v2 = e.args[0]\n self.assertEqual(v1, v2)\n else:\n self.fail()\n\n def test_remove_keyerror_set(self):\n key = self.thetype([3, 4])\n try:\n self.s.remove(key)\n except KeyError as e:\n self.assertTrue(e.args[0] is key,\n \"KeyError should be {0}, not {1}\".format(key,\n e.args[0]))\n else:\n self.fail()\n\n def test_discard(self):\n self.s.discard('a')\n self.assertNotIn('a', self.s)\n self.s.discard('Q')\n self.assertRaises(TypeError, self.s.discard, [])\n s = self.thetype([frozenset(self.word)])\n self.assertIn(self.thetype(self.word), s)\n s.discard(self.thetype(self.word))\n self.assertNotIn(self.thetype(self.word), s)\n s.discard(self.thetype(self.word))\n\n def test_pop(self):\n for i in range(len(self.s)):\n elem = self.s.pop()\n self.assertNotIn(elem, self.s)\n self.assertRaises(KeyError, self.s.pop)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestSet.test_update_TestSet.test_update.for_p_in_cdc_efgfe_.for_C_in_set_frozenset_.self_assertEqual_s_set_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestSet.test_update_TestSet.test_update.for_p_in_cdc_efgfe_.for_C_in_set_frozenset_.self_assertEqual_s_set_s", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_set.py", "file_name": "test_set.py", "file_type": "text/x-python", "category": "test", "start_line": 443, "end_line": 460, "span_ids": ["TestSet.test_update"], "tokens": 248}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestSet(TestJointOps):\n\n def test_update(self):\n retval = self.s.update(self.otherword)\n self.assertEqual(retval, None)\n for c in (self.word + self.otherword):\n self.assertIn(c, self.s)\n self.assertRaises(PassThru, self.s.update, check_pass_thru())\n self.assertRaises(TypeError, self.s.update, [[]])\n for p, q in (('cdc', 'abcd'), ('efgfe', 'abcefg'), ('ccb', 'abc'), ('ef', 'abcef')):\n for C in set, frozenset, dict.fromkeys, str, list, tuple:\n s = self.thetype('abcba')\n self.assertEqual(s.update(C(p)), None)\n self.assertEqual(s, set(q))\n for p in ('cdc', 'efgfe', 'ccb', 'ef', 'abcda'):\n q = 'ahi'\n for C in set, frozenset, dict.fromkeys, str, list, tuple:\n s = self.thetype('abcba')\n self.assertEqual(s.update(C(p), C(q)), None)\n self.assertEqual(s, set(s) | set(p) | set(q))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestSet.test_ior_TestSet.test_iand.for_c_in_self_word_sel.if_c_in_self_otherword_an.else_.self_assertNotIn_c_self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestSet.test_ior_TestSet.test_iand.for_c_in_self_word_sel.if_c_in_self_otherword_an.else_.self_assertNotIn_c_self_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_set.py", "file_name": "test_set.py", "file_type": "text/x-python", "category": "test", "start_line": 462, "end_line": 494, "span_ids": ["TestSet.test_iand", "TestSet.test_ior", "TestSet.test_intersection_update"], "tokens": 334}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestSet(TestJointOps):\n\n def test_ior(self):\n self.s |= set(self.otherword)\n for c in (self.word + self.otherword):\n self.assertIn(c, self.s)\n\n def test_intersection_update(self):\n retval = self.s.intersection_update(self.otherword)\n self.assertEqual(retval, None)\n for c in (self.word + self.otherword):\n if c in self.otherword and c in self.word:\n self.assertIn(c, self.s)\n else:\n self.assertNotIn(c, self.s)\n self.assertRaises(PassThru, self.s.intersection_update, check_pass_thru())\n self.assertRaises(TypeError, self.s.intersection_update, [[]])\n for p, q in (('cdc', 'c'), ('efgfe', ''), ('ccb', 'bc'), ('ef', '')):\n for C in set, frozenset, dict.fromkeys, str, list, tuple:\n s = self.thetype('abcba')\n self.assertEqual(s.intersection_update(C(p)), None)\n self.assertEqual(s, set(q))\n ss = 'abcba'\n s = self.thetype(ss)\n t = 'cbc'\n self.assertEqual(s.intersection_update(C(p), C(t)), None)\n self.assertEqual(s, set('abcba')&set(p)&set(t))\n\n def test_iand(self):\n self.s &= set(self.otherword)\n for c in (self.word + self.otherword):\n if c in self.otherword and c in self.word:\n self.assertIn(c, self.s)\n else:\n self.assertNotIn(c, self.s)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestSet.test_difference_update_TestSet.test_difference_update.for_p_q_in_cdc_ab_.for_C_in_set_frozenset_.None_7": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestSet.test_difference_update_TestSet.test_difference_update.for_p_q_in_cdc_ab_.for_C_in_set_frozenset_.None_7", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_set.py", "file_name": "test_set.py", "file_type": "text/x-python", "category": "test", "start_line": 496, "end_line": 523, "span_ids": ["TestSet.test_difference_update"], "tokens": 303}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestSet(TestJointOps):\n\n def test_difference_update(self):\n retval = self.s.difference_update(self.otherword)\n self.assertEqual(retval, None)\n for c in (self.word + self.otherword):\n if c in self.word and c not in self.otherword:\n self.assertIn(c, self.s)\n else:\n self.assertNotIn(c, self.s)\n self.assertRaises(PassThru, self.s.difference_update, check_pass_thru())\n self.assertRaises(TypeError, self.s.difference_update, [[]])\n self.assertRaises(TypeError, self.s.symmetric_difference_update, [[]])\n for p, q in (('cdc', 'ab'), ('efgfe', 'abc'), ('ccb', 'a'), ('ef', 'abc')):\n for C in set, frozenset, dict.fromkeys, str, list, tuple:\n s = self.thetype('abcba')\n self.assertEqual(s.difference_update(C(p)), None)\n self.assertEqual(s, set(q))\n\n s = self.thetype('abcdefghih')\n s.difference_update()\n self.assertEqual(s, self.thetype('abcdefghih'))\n\n s = self.thetype('abcdefghih')\n s.difference_update(C('aba'))\n self.assertEqual(s, self.thetype('cdefghih'))\n\n s = self.thetype('abcdefghih')\n s.difference_update(C('cdc'), C('aba'))\n self.assertEqual(s, self.thetype('efghih'))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestSet.test_isub_TestSet.test_symmetric_difference_update.for_p_q_in_cdc_abd.for_C_in_set_frozenset_.self_assertEqual_s_set_q": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestSet.test_isub_TestSet.test_symmetric_difference_update.for_p_q_in_cdc_abd.for_C_in_set_frozenset_.self_assertEqual_s_set_q", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_set.py", "file_name": "test_set.py", "file_type": "text/x-python", "category": "test", "start_line": 525, "end_line": 547, "span_ids": ["TestSet.test_isub", "TestSet.test_symmetric_difference_update"], "tokens": 262}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestSet(TestJointOps):\n\n def test_isub(self):\n self.s -= set(self.otherword)\n for c in (self.word + self.otherword):\n if c in self.word and c not in self.otherword:\n self.assertIn(c, self.s)\n else:\n self.assertNotIn(c, self.s)\n\n def test_symmetric_difference_update(self):\n retval = self.s.symmetric_difference_update(self.otherword)\n self.assertEqual(retval, None)\n for c in (self.word + self.otherword):\n if (c in self.word) ^ (c in self.otherword):\n self.assertIn(c, self.s)\n else:\n self.assertNotIn(c, self.s)\n self.assertRaises(PassThru, self.s.symmetric_difference_update, check_pass_thru())\n self.assertRaises(TypeError, self.s.symmetric_difference_update, [[]])\n for p, q in (('cdc', 'abd'), ('efgfe', 'abcefg'), ('ccb', 'a'), ('ef', 'abcef')):\n for C in set, frozenset, dict.fromkeys, str, list, tuple:\n s = self.thetype('abcba')\n self.assertEqual(s.symmetric_difference_update(C(p)), None)\n self.assertEqual(s, set(q))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestSet.test_ixor_TestSet.test_weakref.self_assertRaises_Referen": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestSet.test_ixor_TestSet.test_weakref.self_assertRaises_Referen", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_set.py", "file_name": "test_set.py", "file_type": "text/x-python", "category": "test", "start_line": 549, "end_line": 574, "span_ids": ["TestSet.test_weakref", "TestSet.test_inplace_on_self", "TestSet.test_ixor"], "tokens": 199}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestSet(TestJointOps):\n\n def test_ixor(self):\n self.s ^= set(self.otherword)\n for c in (self.word + self.otherword):\n if (c in self.word) ^ (c in self.otherword):\n self.assertIn(c, self.s)\n else:\n self.assertNotIn(c, self.s)\n\n def test_inplace_on_self(self):\n t = self.s.copy()\n t |= t\n self.assertEqual(t, self.s)\n t &= t\n self.assertEqual(t, self.s)\n t -= t\n self.assertEqual(t, self.thetype())\n t = self.s.copy()\n t ^= t\n self.assertEqual(t, self.thetype())\n\n def test_weakref(self):\n s = self.thetype('gallahad')\n p = weakref.proxy(s)\n self.assertEqual(str(p), str(s))\n s = None\n self.assertRaises(ReferenceError, str, p)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestSet.test_rich_compare_TestSet.if_hasattr_set_test_c_a.test_c_api.self_assertEqual_set_te": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestSet.test_rich_compare_TestSet.if_hasattr_set_test_c_a.test_c_api.self_assertEqual_set_te", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_set.py", "file_name": "test_set.py", "file_type": "text/x-python", "category": "test", "start_line": 576, "end_line": 615, "span_ids": ["TestSet:6", "TestSet.test_rich_compare"], "tokens": 297}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestSet(TestJointOps):\n\n def test_rich_compare(self):\n class TestRichSetCompare:\n def __gt__(self, some_set):\n self.gt_called = True\n return False\n def __lt__(self, some_set):\n self.lt_called = True\n return False\n def __ge__(self, some_set):\n self.ge_called = True\n return False\n def __le__(self, some_set):\n self.le_called = True\n return False\n\n # This first tries the builtin rich set comparison, which doesn't know\n # how to handle the custom object. Upon returning NotImplemented, the\n # corresponding comparison on the right object is invoked.\n myset = {1, 2, 3}\n\n myobj = TestRichSetCompare()\n myset < myobj\n self.assertTrue(myobj.gt_called)\n\n myobj = TestRichSetCompare()\n myset > myobj\n self.assertTrue(myobj.lt_called)\n\n myobj = TestRichSetCompare()\n myset <= myobj\n self.assertTrue(myobj.ge_called)\n\n myobj = TestRichSetCompare()\n myset >= myobj\n self.assertTrue(myobj.le_called)\n\n # C API test only available in a debug build\n if hasattr(set, \"test_c_api\"):\n def test_c_api(self):\n self.assertEqual(set().test_c_api(), True)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_SetSubclass_TestSetSubclassWithKeywordArgs.test_keywords_in_subclass.SetSubclassWithKeywordArg": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_SetSubclass_TestSetSubclassWithKeywordArgs.test_keywords_in_subclass.SetSubclassWithKeywordArg", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_set.py", "file_name": "test_set.py", "file_type": "text/x-python", "category": "test", "start_line": 617, "end_line": 632, "span_ids": ["TestSetSubclassWithKeywordArgs", "SetSubclass", "TestSetSubclass", "TestSetSubclassWithKeywordArgs.test_keywords_in_subclass", "SetSubclassWithKeywordArgs", "SetSubclassWithKeywordArgs.__init__"], "tokens": 112}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SetSubclass(set):\n pass\n\nclass TestSetSubclass(TestSet):\n thetype = SetSubclass\n basetype = set\n\nclass SetSubclassWithKeywordArgs(set):\n def __init__(self, iterable=[], newarg=None):\n set.__init__(self, iterable)\n\nclass TestSetSubclassWithKeywordArgs(TestSet):\n\n def test_keywords_in_subclass(self):\n 'SF bug #1486663 -- this used to erroneously raise a TypeError'\n SetSubclassWithKeywordArgs(newarg=1)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestFrozenSet_TestFrozenSet.test_singleton_empty_frozenset.self_assertEqual_len_set_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestFrozenSet_TestFrozenSet.test_singleton_empty_frozenset.self_assertEqual_len_set_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_set.py", "file_name": "test_set.py", "file_type": "text/x-python", "category": "test", "start_line": 634, "end_line": 650, "span_ids": ["TestFrozenSet", "TestFrozenSet.test_singleton_empty_frozenset", "TestFrozenSet.test_init"], "tokens": 173}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestFrozenSet(TestJointOps):\n thetype = frozenset\n basetype = frozenset\n\n def test_init(self):\n s = self.thetype(self.word)\n s.__init__(self.otherword)\n self.assertEqual(s, set(self.word))\n\n def test_singleton_empty_frozenset(self):\n f = frozenset()\n efs = [frozenset(), frozenset([]), frozenset(()), frozenset(''),\n frozenset(), frozenset([]), frozenset(()), frozenset(''),\n frozenset(range(0)), frozenset(frozenset()),\n frozenset(f), f]\n # All of the empty frozensets should have just one id()\n self.assertEqual(len(set(map(id, efs))), 1)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestFrozenSet.test_constructor_identity_TestFrozenSet.test_hash_effectiveness.self_assertEqual_len_hash": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestFrozenSet.test_constructor_identity_TestFrozenSet.test_hash_effectiveness.self_assertEqual_len_hash", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_set.py", "file_name": "test_set.py", "file_type": "text/x-python", "category": "test", "start_line": 652, "end_line": 695, "span_ids": ["TestFrozenSet.test_hash", "TestFrozenSet.test_constructor_identity", "TestFrozenSet.test_hash_caching", "TestFrozenSet.test_copy", "TestFrozenSet.test_frozen_as_dictkey", "TestFrozenSet.test_hash_effectiveness"], "tokens": 378}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestFrozenSet(TestJointOps):\n\n def test_constructor_identity(self):\n s = self.thetype(range(3))\n t = self.thetype(s)\n self.assertEqual(id(s), id(t))\n\n def test_hash(self):\n self.assertEqual(hash(self.thetype('abcdeb')),\n hash(self.thetype('ebecda')))\n\n # make sure that all permutations give the same hash value\n n = 100\n seq = [randrange(n) for i in range(n)]\n results = set()\n for i in range(200):\n shuffle(seq)\n results.add(hash(self.thetype(seq)))\n self.assertEqual(len(results), 1)\n\n def test_copy(self):\n dup = self.s.copy()\n self.assertEqual(id(self.s), id(dup))\n\n def test_frozen_as_dictkey(self):\n seq = list(range(10)) + list('abcdefg') + ['apple']\n key1 = self.thetype(seq)\n key2 = self.thetype(reversed(seq))\n self.assertEqual(key1, key2)\n self.assertNotEqual(id(key1), id(key2))\n d = {}\n d[key1] = 42\n self.assertEqual(d[key2], 42)\n\n def test_hash_caching(self):\n f = self.thetype('abcdcda')\n self.assertEqual(hash(f), hash(f))\n\n def test_hash_effectiveness(self):\n n = 13\n hashvalues = set()\n addhashvalue = hashvalues.add\n elemmasks = [(i+1, 1<=\": \"issuperset\",\n }\n\n reverse = {\"==\": \"==\",\n \"!=\": \"!=\",\n \"<\": \">\",\n \">\": \"<\",\n \"<=\": \">=\",\n \">=\": \"<=\",\n }\n\n def test_issubset(self):\n raise NotImplementedError() # eval not supported below\n x = self.left\n y = self.right\n for case in \"!=\", \"==\", \"<\", \"<=\", \">\", \">=\":\n expected = case in self.cases\n # Test the binary infix spelling.\n result = None ## eval(\"x\" + case + \"y\", locals())\n self.assertEqual(result, expected)\n # Test the \"friendly\" method-name spelling, if one exists.\n if case in TestSubsets.case2method:\n method = getattr(x, TestSubsets.case2method[case])\n result = method(y)\n self.assertEqual(result, expected)\n\n # Now do the same for the operands reversed.\n rcase = TestSubsets.reverse[case]\n result = None ## eval(\"y\" + rcase + \"x\", locals())\n self.assertEqual(result, expected)\n if rcase in TestSubsets.case2method:\n method = getattr(y, TestSubsets.case2method[rcase])\n result = method(x)\n self.assertEqual(result, expected)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_None_23_TestSubsetNonOverlap.cases._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_None_23_TestSubsetNonOverlap.cases._", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_set.py", "file_name": "test_set.py", "file_type": "text/x-python", "category": "test", "start_line": 1265, "end_line": 1303, "span_ids": ["TestSubsetNonOverlap", "TestSubsetEqualNonEmpty", "TestSubsets.test_issubset", "TestSubsetPartial", "TestSubsetEqualEmpty", "TestSubsetEmptyNonEmpty"], "tokens": 251}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "#------------------------------------------------------------------------------\n\nclass TestSubsetEqualEmpty(TestSubsets):\n left = set() # type: Any\n right = set() # type: Any\n name = \"both empty\"\n cases = \"==\", \"<=\", \">=\"\n\n#------------------------------------------------------------------------------\n\nclass TestSubsetEqualNonEmpty(TestSubsets):\n left = set([1, 2])\n right = set([1, 2])\n name = \"equal pair\"\n cases = \"==\", \"<=\", \">=\"\n\n#------------------------------------------------------------------------------\n\nclass TestSubsetEmptyNonEmpty(TestSubsets):\n left = set() # type: Any\n right = set([1, 2])\n name = \"one empty, one non-empty\"\n cases = \"!=\", \"<\", \"<=\"\n\n#------------------------------------------------------------------------------\n\nclass TestSubsetPartial(TestSubsets):\n left = set([1])\n right = set([1, 2])\n name = \"one a non-empty proper subset of other\"\n cases = \"!=\", \"<\", \"<=\"\n\n#------------------------------------------------------------------------------\n\nclass TestSubsetNonOverlap(TestSubsets):\n left = set([1])\n right = set([2])\n name = \"neither empty, neither contains\"\n cases = \"!=\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_None_28_TestOnlySetsInBinaryOps.test_ge_gt_le_lt.None_7": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_None_28_TestOnlySetsInBinaryOps.test_ge_gt_le_lt.None_7", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_set.py", "file_name": "test_set.py", "file_type": "text/x-python", "category": "test", "start_line": 1305, "end_line": 1325, "span_ids": ["TestSubsetNonOverlap", "TestOnlySetsInBinaryOps.test_ge_gt_le_lt", "TestOnlySetsInBinaryOps", "TestOnlySetsInBinaryOps.test_eq_ne"], "tokens": 195}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "#==============================================================================\n\nclass TestOnlySetsInBinaryOps(unittest.TestCase):\n\n def test_eq_ne(self):\n # Unlike the others, this is testing that == and != *are* allowed.\n self.assertEqual(self.other == self.set, False)\n self.assertEqual(self.set == self.other, False)\n self.assertEqual(self.other != self.set, True)\n self.assertEqual(self.set != self.other, True)\n\n def test_ge_gt_le_lt(self):\n self.assertRaises(TypeError, lambda: self.set < self.other)\n self.assertRaises(TypeError, lambda: self.set <= self.other)\n self.assertRaises(TypeError, lambda: self.set > self.other)\n self.assertRaises(TypeError, lambda: self.set >= self.other)\n\n self.assertRaises(TypeError, lambda: self.other < self.set)\n self.assertRaises(TypeError, lambda: self.other <= self.set)\n self.assertRaises(TypeError, lambda: self.other > self.set)\n self.assertRaises(TypeError, lambda: self.other >= self.set)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestOnlySetsInBinaryOps.test_update_operator_TestOnlySetsInBinaryOps.test_difference.if_self_otherIsIterable_.else_.self_assertRaises_TypeErr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestOnlySetsInBinaryOps.test_update_operator_TestOnlySetsInBinaryOps.test_difference.if_self_otherIsIterable_.else_.self_assertRaises_TypeErr", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_set.py", "file_name": "test_set.py", "file_type": "text/x-python", "category": "test", "start_line": 1327, "end_line": 1419, "span_ids": ["TestOnlySetsInBinaryOps.test_intersection", "TestOnlySetsInBinaryOps.test_sym_difference", "TestOnlySetsInBinaryOps.test_update_operator", "TestOnlySetsInBinaryOps.test_union", "TestOnlySetsInBinaryOps.test_difference_update", "TestOnlySetsInBinaryOps.test_difference", "TestOnlySetsInBinaryOps.test_difference_update_operator", "TestOnlySetsInBinaryOps.test_sym_difference_update", "TestOnlySetsInBinaryOps.test_sym_difference_update_operator", "TestOnlySetsInBinaryOps.test_intersection_update_operator", "TestOnlySetsInBinaryOps.test_intersection_update", "TestOnlySetsInBinaryOps.test_update"], "tokens": 559}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestOnlySetsInBinaryOps(unittest.TestCase):\n\n def test_update_operator(self):\n try:\n self.set |= self.other\n except TypeError:\n pass\n else:\n self.fail(\"expected TypeError\")\n\n def test_update(self):\n if self.otherIsIterable:\n self.set.update(self.other)\n else:\n self.assertRaises(TypeError, self.set.update, self.other)\n\n def test_union(self):\n self.assertRaises(TypeError, lambda: self.set | self.other)\n self.assertRaises(TypeError, lambda: self.other | self.set)\n if self.otherIsIterable:\n self.set.union(self.other)\n else:\n self.assertRaises(TypeError, self.set.union, self.other)\n\n def test_intersection_update_operator(self):\n try:\n self.set &= self.other\n except TypeError:\n pass\n else:\n self.fail(\"expected TypeError\")\n\n def test_intersection_update(self):\n if self.otherIsIterable:\n self.set.intersection_update(self.other)\n else:\n self.assertRaises(TypeError,\n self.set.intersection_update,\n self.other)\n\n def test_intersection(self):\n self.assertRaises(TypeError, lambda: self.set & self.other)\n self.assertRaises(TypeError, lambda: self.other & self.set)\n if self.otherIsIterable:\n self.set.intersection(self.other)\n else:\n self.assertRaises(TypeError, self.set.intersection, self.other)\n\n def test_sym_difference_update_operator(self):\n try:\n self.set ^= self.other\n except TypeError:\n pass\n else:\n self.fail(\"expected TypeError\")\n\n def test_sym_difference_update(self):\n if self.otherIsIterable:\n self.set.symmetric_difference_update(self.other)\n else:\n self.assertRaises(TypeError,\n self.set.symmetric_difference_update,\n self.other)\n\n def test_sym_difference(self):\n self.assertRaises(TypeError, lambda: self.set ^ self.other)\n self.assertRaises(TypeError, lambda: self.other ^ self.set)\n if self.otherIsIterable:\n self.set.symmetric_difference(self.other)\n else:\n self.assertRaises(TypeError, self.set.symmetric_difference, self.other)\n\n def test_difference_update_operator(self):\n try:\n self.set -= self.other\n except TypeError:\n pass\n else:\n self.fail(\"expected TypeError\")\n\n def test_difference_update(self):\n if self.otherIsIterable:\n self.set.difference_update(self.other)\n else:\n self.assertRaises(TypeError,\n self.set.difference_update,\n self.other)\n\n def test_difference(self):\n self.assertRaises(TypeError, lambda: self.set - self.other)\n self.assertRaises(TypeError, lambda: self.other - self.set)\n if self.otherIsIterable:\n self.set.difference(self.other)\n else:\n self.assertRaises(TypeError, self.set.difference, self.other)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_None_29_TestOnlySetsGenerator.setUp.self.otherIsIterable.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_None_29_TestOnlySetsGenerator.setUp.self.otherIsIterable.True", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_set.py", "file_name": "test_set.py", "file_type": "text/x-python", "category": "test", "start_line": 1421, "end_line": 1470, "span_ids": ["TestOnlySetsOperator.setUp", "TestOnlySetsNumeric", "TestOnlySetsString.setUp", "TestOnlySetsNumeric.setUp", "TestOnlySetsTuple.setUp", "TestOnlySetsTuple", "TestOnlySetsInBinaryOps.test_difference", "TestOnlySetsDict", "TestOnlySetsGenerator.setUp", "TestOnlySetsOperator", "TestOnlySetsGenerator", "TestOnlySetsDict.setUp", "TestOnlySetsString"], "tokens": 327}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "#------------------------------------------------------------------------------\n\nclass TestOnlySetsNumeric(TestOnlySetsInBinaryOps):\n def setUp(self):\n self.set = set((1, 2, 3))\n self.other = 19\n self.otherIsIterable = False\n\n#------------------------------------------------------------------------------\n\nclass TestOnlySetsDict(TestOnlySetsInBinaryOps):\n def setUp(self):\n self.set = set((1, 2, 3))\n self.other = {1:2, 3:4}\n self.otherIsIterable = True\n\n#------------------------------------------------------------------------------\n\nclass TestOnlySetsOperator(TestOnlySetsInBinaryOps):\n def setUp(self):\n self.set = set((1, 2, 3))\n self.other = operator.add\n self.otherIsIterable = False\n\n#------------------------------------------------------------------------------\n\nclass TestOnlySetsTuple(TestOnlySetsInBinaryOps):\n def setUp(self):\n self.set = set((1, 2, 3))\n self.other = (2, 4, 6)\n self.otherIsIterable = True\n\n#------------------------------------------------------------------------------\n\nclass TestOnlySetsString(TestOnlySetsInBinaryOps):\n def setUp(self):\n self.set = set((1, 2, 3))\n self.other = 'abc'\n self.otherIsIterable = True\n\n#------------------------------------------------------------------------------\n\nclass TestOnlySetsGenerator(TestOnlySetsInBinaryOps):\n def setUp(self):\n def gen():\n for i in range(0, 10, 2):\n yield i\n self.set = set((1, 2, 3))\n self.other = gen()\n self.otherIsIterable = True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_None_35_TestCopying.test_deep_copy.for_i_in_range_len_dup_li.self_assertEqual_dup_list": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_None_35_TestCopying.test_deep_copy.for_i_in_range_len_dup_li.self_assertEqual_dup_list", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_set.py", "file_name": "test_set.py", "file_type": "text/x-python", "category": "test", "start_line": 1472, "end_line": 1491, "span_ids": ["TestOnlySetsGenerator.setUp", "TestCopying", "TestCopying.test_copy", "TestCopying.test_deep_copy"], "tokens": 165}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "#==============================================================================\n\nclass TestCopying(unittest.TestCase):\n\n def test_copy(self):\n dup = self.set.copy()\n dup_list = sorted(dup, key=repr)\n set_list = sorted(self.set, key=repr)\n self.assertEqual(len(dup_list), len(set_list))\n for i in range(len(dup_list)):\n self.assertTrue(dup_list[i] is set_list[i])\n\n def test_deep_copy(self):\n dup = copy.deepcopy(self.set)\n ##print type(dup), repr(dup)\n dup_list = sorted(dup, key=repr)\n set_list = sorted(self.set, key=repr)\n self.assertEqual(len(dup_list), len(set_list))\n for i in range(len(dup_list)):\n self.assertEqual(dup_list[i], set_list[i])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_None_36_TestCopyingNested.setUp.self.set.set_1_2_3_4_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_None_36_TestCopyingNested.setUp.self.set.set_1_2_3_4_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_set.py", "file_name": "test_set.py", "file_type": "text/x-python", "category": "test", "start_line": 1493, "end_line": 1521, "span_ids": ["TestCopyingTriple", "TestCopyingTuple", "TestCopyingEmpty", "TestCopying.test_deep_copy", "TestCopyingTuple.setUp", "TestCopyingNested", "TestCopyingTriple.setUp", "TestCopyingSingleton.setUp", "TestCopyingSingleton", "TestCopyingNested.setUp", "TestCopyingEmpty.setUp"], "tokens": 127}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "#------------------------------------------------------------------------------\n\nclass TestCopyingEmpty(TestCopying):\n def setUp(self):\n self.set = set()\n\n#------------------------------------------------------------------------------\n\nclass TestCopyingSingleton(TestCopying):\n def setUp(self):\n self.set = set([\"hello\"])\n\n#------------------------------------------------------------------------------\n\nclass TestCopyingTriple(TestCopying):\n def setUp(self):\n self.set = set([\"zero\", 0, None])\n\n#------------------------------------------------------------------------------\n\nclass TestCopyingTuple(TestCopying):\n def setUp(self):\n self.set = set([(1, 2)])\n\n#------------------------------------------------------------------------------\n\nclass TestCopyingNested(TestCopying):\n def setUp(self):\n self.set = set([((1, 2), (3, 4))])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_None_41_TestIdentities.test_commutativity.if_a_b_.self_assertNotEqual_a_b_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_None_41_TestIdentities.test_commutativity.if_a_b_.self_assertNotEqual_a_b_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_set.py", "file_name": "test_set.py", "file_type": "text/x-python", "category": "test", "start_line": 1523, "end_line": 1546, "span_ids": ["TestIdentities.test_commutativity", "TestIdentities", "TestIdentities.test_binopsVsSubsets", "TestCopyingNested.setUp", "TestIdentities.setUp"], "tokens": 190}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "#==============================================================================\n\nclass TestIdentities(unittest.TestCase):\n def setUp(self):\n self.a = set('abracadabra')\n self.b = set('alacazam')\n\n def test_binopsVsSubsets(self):\n a, b = self.a, self.b\n self.assertTrue(a - b < a)\n self.assertTrue(b - a < b)\n self.assertTrue(a & b < a)\n self.assertTrue(a & b < b)\n self.assertTrue(a | b > a)\n self.assertTrue(a | b > b)\n self.assertTrue(a ^ b < a | b)\n\n def test_commutativity(self):\n a, b = self.a, self.b\n self.assertEqual(a&b, b&a)\n self.assertEqual(a|b, b|a)\n self.assertEqual(a^b, b^a)\n if a != b:\n self.assertNotEqual(a-b, b-a)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestIdentities.test_summations_TestIdentities.test_exclusion.self_assertEqual_a_b_a": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestIdentities.test_summations_TestIdentities.test_exclusion.self_assertEqual_a_b_a", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_set.py", "file_name": "test_set.py", "file_type": "text/x-python", "category": "test", "start_line": 1548, "end_line": 1564, "span_ids": ["TestIdentities.test_exclusion", "TestIdentities.test_summations"], "tokens": 206}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestIdentities(unittest.TestCase):\n\n def test_summations(self):\n # check that sums of parts equal the whole\n a, b = self.a, self.b\n self.assertEqual((a-b)|(a&b)|(b-a), a|b)\n self.assertEqual((a&b)|(a^b), a|b)\n self.assertEqual(a|(b-a), a|b)\n self.assertEqual((a-b)|b, a|b)\n self.assertEqual((a-b)|(a&b), a)\n self.assertEqual((b-a)|(a&b), b)\n self.assertEqual((a-b)|(b-a), a^b)\n\n def test_exclusion(self):\n # check that inverse operations show non-overlap\n a, b, zero = self.a, self.b, set()\n self.assertEqual((a-b)&b, zero)\n self.assertEqual((b-a)&a, zero)\n self.assertEqual((a&b)&(a^b), zero)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py__Tests_derived_from_test_L.return.chain_map_lambda_x_x_R_I": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py__Tests_derived_from_test_L.return.chain_map_lambda_x_x_R_I", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_set.py", "file_name": "test_set.py", "file_type": "text/x-python", "category": "test", "start_line": 1566, "end_line": 1643, "span_ids": ["impl:3", "G.__init__", "E.__next__", "X.__next__", "G", "TestIdentities.test_exclusion", "X", "Ig.__iter__", "N", "E", "S.__iter__", "S.__init__", "Ig", "Ig.__init__", "N.__init__", "I.__iter__", "N.__iter__", "I.__next__", "S", "E.__init__", "L", "G.__getitem__", "I", "I.__init__", "E.__iter__", "S.__next__", "R", "X.__init__"], "tokens": 488}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Tests derived from test_itertools.py =======================================\n\ndef R(seqn):\n 'Regular generator'\n for i in seqn:\n yield i\n\nclass G:\n 'Sequence using __getitem__'\n def __init__(self, seqn):\n self.seqn = seqn\n def __getitem__(self, i):\n return self.seqn[i]\n\nclass I:\n 'Sequence using iterator protocol'\n def __init__(self, seqn):\n self.seqn = seqn\n self.i = 0\n def __iter__(self):\n return self\n def __next__(self):\n if self.i >= len(self.seqn): raise StopIteration\n v = self.seqn[self.i]\n self.i += 1\n return v\n\nclass Ig:\n 'Sequence using iterator protocol defined with a generator'\n def __init__(self, seqn):\n self.seqn = seqn\n self.i = 0\n def __iter__(self):\n for val in self.seqn:\n yield val\n\nclass X:\n 'Missing __getitem__ and __iter__'\n def __init__(self, seqn):\n self.seqn = seqn\n self.i = 0\n def __next__(self):\n if self.i >= len(self.seqn): raise StopIteration\n v = self.seqn[self.i]\n self.i += 1\n return v\n\nclass N:\n 'Iterator missing __next__()'\n def __init__(self, seqn):\n self.seqn = seqn\n self.i = 0\n def __iter__(self):\n return self\n\nclass E:\n 'Test propagation of exceptions'\n def __init__(self, seqn):\n self.seqn = seqn\n self.i = 0\n def __iter__(self):\n return self\n def __next__(self):\n 3 // 0\n\nclass S:\n 'Test immediate stop'\n def __init__(self, seqn):\n pass\n def __iter__(self):\n return self\n def __next__(self):\n raise StopIteration\n\nfrom itertools import chain\ndef L(seqn):\n 'Test multiple tiers of iterators'\n return chain(map(lambda x:x, R(Ig(G(seqn)))))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestVariousIteratorArgs_TestVariousIteratorArgs.test_constructor.for_cons_in_set_frozens.for_s_in_123_rang.self_assertRaises_ZeroDiv": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestVariousIteratorArgs_TestVariousIteratorArgs.test_constructor.for_cons_in_set_frozens.for_s_in_123_rang.self_assertRaises_ZeroDiv", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_set.py", "file_name": "test_set.py", "file_type": "text/x-python", "category": "test", "start_line": 1645, "end_line": 1654, "span_ids": ["TestVariousIteratorArgs", "TestVariousIteratorArgs.test_constructor"], "tokens": 127}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestVariousIteratorArgs(unittest.TestCase):\n\n def test_constructor(self):\n for cons in (set, frozenset):\n for s in (\"123\", \"\", range(1000), ('do', 1.2), range(2000,2200,5)):\n for g in (G, I, Ig, S, L, R):\n self.assertEqual(sorted(cons(g(s)), key=repr), sorted(g(s), key=repr))\n self.assertRaises(TypeError, cons , X(s))\n self.assertRaises(TypeError, cons , N(s))\n self.assertRaises(ZeroDivisionError, cons , E(s))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestVariousIteratorArgs.test_inline_methods_TestVariousIteratorArgs.test_inline_methods.for_data_in_123_r.for_meth_in_s_union_s_i.self_assertRaises_ZeroDiv": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestVariousIteratorArgs.test_inline_methods_TestVariousIteratorArgs.test_inline_methods.for_data_in_123_r.for_meth_in_s_union_s_i.self_assertRaises_ZeroDiv", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_set.py", "file_name": "test_set.py", "file_type": "text/x-python", "category": "test", "start_line": 1656, "end_line": 1669, "span_ids": ["TestVariousIteratorArgs.test_inline_methods"], "tokens": 177}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestVariousIteratorArgs(unittest.TestCase):\n\n def test_inline_methods(self):\n s = set('november')\n for data in (\"123\", \"\", range(1000), ('do', 1.2), range(2000,2200,5), 'december'):\n for meth in (s.union, s.intersection, s.difference, s.symmetric_difference, s.isdisjoint):\n for g in (G, I, Ig, L, R):\n expected = meth(data)\n actual = meth(G(data))\n if isinstance(expected, bool):\n self.assertEqual(actual, expected)\n else:\n self.assertEqual(sorted(actual, key=repr), sorted(expected, key=repr))\n self.assertRaises(TypeError, meth, X(s))\n self.assertRaises(TypeError, meth, N(s))\n self.assertRaises(ZeroDivisionError, meth, E(s))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestVariousIteratorArgs.test_inplace_methods_TestVariousIteratorArgs.test_inplace_methods.for_data_in_123_r.for_methname_in_update_.self_assertRaises_ZeroDiv": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestVariousIteratorArgs.test_inplace_methods_TestVariousIteratorArgs.test_inplace_methods.for_data_in_123_r.for_methname_in_update_.self_assertRaises_ZeroDiv", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_set.py", "file_name": "test_set.py", "file_type": "text/x-python", "category": "test", "start_line": 1671, "end_line": 1684, "span_ids": ["TestVariousIteratorArgs.test_inplace_methods"], "tokens": 197}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestVariousIteratorArgs(unittest.TestCase):\n\n def test_inplace_methods(self):\n for data in (\"123\", \"\", range(1000), ('do', 1.2), range(2000,2200,5), 'december'):\n for methname in ('update', 'intersection_update',\n 'difference_update', 'symmetric_difference_update'):\n for g in (G, I, Ig, S, L, R):\n s = set('january')\n t = s.copy()\n getattr(s, methname)(list(g(data)))\n getattr(t, methname)(g(data))\n self.assertEqual(sorted(s, key=repr), sorted(t, key=repr))\n\n self.assertRaises(TypeError, getattr(set('january'), methname), X(data))\n self.assertRaises(TypeError, getattr(set('january'), methname), N(data))\n self.assertRaises(ZeroDivisionError, getattr(set('january'), methname), E(data))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_be_bad_TestWeirdBugs.test_8420_set_merge.set1_symmetric_difference": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_be_bad_TestWeirdBugs.test_8420_set_merge.set1_symmetric_difference", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_set.py", "file_name": "test_set.py", "file_type": "text/x-python", "category": "test", "start_line": 1686, "end_line": 1719, "span_ids": ["bad_dict_clear", "impl:4", "bad_eq.__hash__", "TestWeirdBugs", "bad_dict_clear.__hash__", "bad_eq", "bad_eq.__eq__", "bad_dict_clear.__eq__", "TestWeirdBugs.test_8420_set_merge"], "tokens": 234}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "be_bad = set2 = dict2 = None # type: Any\n\nclass bad_eq:\n def __eq__(self, other):\n if be_bad:\n set2.clear()\n raise ZeroDivisionError\n return self is other\n def __hash__(self):\n return 0\n\nclass bad_dict_clear:\n def __eq__(self, other):\n if be_bad:\n dict2.clear()\n return self is other\n def __hash__(self):\n return 0\n\nclass TestWeirdBugs(unittest.TestCase):\n def test_8420_set_merge(self):\n # This used to segfault\n global be_bad, set2, dict2\n be_bad = False\n set1 = {bad_eq()}\n set2 = {bad_eq() for i in range(75)}\n be_bad = True\n self.assertRaises(ZeroDivisionError, set1.update, set2)\n\n be_bad = False\n set1 = {bad_dict_clear()}\n dict2 = {bad_dict_clear(): None}\n be_bad = True\n set1.symmetric_difference_update(dict2)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py__Application_tests_base_cube.return.dict_x_frozenset_x_s_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py__Application_tests_base_cube.return.dict_x_frozenset_x_s_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_set.py", "file_name": "test_set.py", "file_type": "text/x-python", "category": "test", "start_line": 1721, "end_line": 1738, "span_ids": ["TestWeirdBugs.test_8420_set_merge", "powerset", "cube"], "tokens": 142}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Application tests (based on David Eppstein's graph recipes ====================================\n\ndef powerset(U):\n \"\"\"Generates all subsets of a set or sequence U.\"\"\"\n U = iter(U)\n try:\n x = frozenset([next(U)])\n for S in powerset(U):\n yield S\n yield S | x\n except StopIteration:\n yield frozenset()\n\ndef cube(n):\n \"\"\"Graph of n-dimensional hypercube.\"\"\"\n singletons = [frozenset([x]) for x in range(n)]\n return dict([(x, frozenset([x^s for s in singletons]))\n for x in powerset(range(n))])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_linegraph_linegraph.return.L": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_linegraph_linegraph.return.L", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_set.py", "file_name": "test_set.py", "file_type": "text/x-python", "category": "test", "start_line": 1740, "end_line": 1750, "span_ids": ["linegraph"], "tokens": 118}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def linegraph(G):\n \"\"\"Graph, the vertices of which are edges of G,\n with two vertices being adjacent iff the corresponding\n edges share a vertex.\"\"\"\n L = {}\n for x in G:\n for y in G[x]:\n nx = [frozenset([x,z]) for z in G[x] if z != y]\n ny = [frozenset([y,z]) for z in G[y] if z != x]\n L[frozenset([x,y])] = frozenset(nx+ny)\n return L", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_faces_faces.return.f": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_faces_faces.return.f", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_set.py", "file_name": "test_set.py", "file_type": "text/x-python", "category": "test", "start_line": 1752, "end_line": 1775, "span_ids": ["faces"], "tokens": 225}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def faces(G):\n 'Return a set of faces in G. Where a face is a set of vertices on that face'\n # currently limited to triangles,squares, and pentagons\n f = set()\n for v1, edges in G.items():\n for v2 in edges:\n for v3 in G[v2]:\n if v1 == v3:\n continue\n if v1 in G[v3]:\n f.add(frozenset([v1, v2, v3]))\n else:\n for v4 in G[v3]:\n if v4 == v2:\n continue\n if v1 in G[v4]:\n f.add(frozenset([v1, v2, v3, v4]))\n else:\n for v5 in G[v4]:\n if v5 == v3 or v5 == v2:\n continue\n if v1 in G[v5]:\n f.add(frozenset([v1, v2, v3, v4, v5]))\n return f", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestGraphs_TestGraphs.test_cube.for_face_in_cubefaces_._each_face_is_a_square": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestGraphs_TestGraphs.test_cube.for_face_in_cubefaces_._each_face_is_a_square", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_set.py", "file_name": "test_set.py", "file_type": "text/x-python", "category": "test", "start_line": 1778, "end_line": 1796, "span_ids": ["TestGraphs.test_cube", "TestGraphs"], "tokens": 172}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestGraphs(unittest.TestCase):\n\n def test_cube(self):\n\n g = cube(3) # vert --> {v1, v2, v3}\n vertices1 = set(g)\n self.assertEqual(len(vertices1), 8) # eight vertices\n for edge in g.values():\n self.assertEqual(len(edge), 3) # each vertex connects to three edges\n vertices2 = set()\n for edges in g.values():\n for v in edges:\n vertices2.add(v)\n self.assertEqual(vertices1, vertices2) # edge vertices in original set\n\n cubefaces = faces(g)\n self.assertEqual(len(cubefaces), 6) # six faces\n for face in cubefaces:\n self.assertEqual(len(face), 4) # each face is a square", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestGraphs.test_cuboctahedron_TestGraphs.test_cuboctahedron.for_vertex_in_cuboctahedr.for_cubevert_in_edge_.self_assertIn_cubevert_g": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_TestGraphs.test_cuboctahedron_TestGraphs.test_cuboctahedron.for_vertex_in_cuboctahedr.for_cubevert_in_edge_.self_assertIn_cubevert_g", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_set.py", "file_name": "test_set.py", "file_type": "text/x-python", "category": "test", "start_line": 1798, "end_line": 1825, "span_ids": ["TestGraphs.test_cuboctahedron"], "tokens": 325}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestGraphs(unittest.TestCase):\n\n def test_cuboctahedron(self):\n\n # http://en.wikipedia.org/wiki/Cuboctahedron\n # 8 triangular faces and 6 square faces\n # 12 identical vertices each connecting a triangle and square\n\n g = cube(3)\n cuboctahedron = linegraph(g) # V( --> {V1, V2, V3, V4}\n self.assertEqual(len(cuboctahedron), 12)# twelve vertices\n\n vertices = set(cuboctahedron)\n for edges in cuboctahedron.values():\n self.assertEqual(len(edges), 4) # each vertex connects to four other vertices\n othervertices = set(edge for edges in cuboctahedron.values() for edge in edges)\n self.assertEqual(vertices, othervertices) # edge vertices in original set\n\n cubofaces = faces(cuboctahedron)\n facesizes = collections.defaultdict(int)\n for face in cubofaces:\n facesizes[len(face)] += 1\n self.assertEqual(facesizes[3], 8) # eight triangular faces\n self.assertEqual(facesizes[4], 6) # six square faces\n\n for vertex in cuboctahedron:\n edge = vertex # Cuboctahedron vertices are edges in Cube\n self.assertEqual(len(edge), 2) # Two cube vertices define an edge\n for cubevert in edge:\n self.assertIn(cubevert, g)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_None_45_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_set.py_None_45_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_set.py", "file_name": "test_set.py", "file_type": "text/x-python", "category": "test", "start_line": 1828, "end_line": 1885, "span_ids": ["impl:8", "TestGraphs.test_cuboctahedron", "test_main"], "tokens": 326}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "#==============================================================================\n\ndef test_main(verbose=None):\n test_classes = (\n TestSet,\n TestSetSubclass,\n TestSetSubclassWithKeywordArgs,\n TestFrozenSet,\n TestFrozenSetSubclass,\n TestSetOfSets,\n TestExceptionPropagation,\n TestBasicOpsEmpty,\n TestBasicOpsSingleton,\n TestBasicOpsTuple,\n TestBasicOpsTriple,\n TestBasicOpsString,\n TestBasicOpsBytes,\n TestBasicOpsMixedStringBytes,\n TestBinaryOps,\n TestUpdateOps,\n TestMutate,\n TestSubsetEqualEmpty,\n TestSubsetEqualNonEmpty,\n TestSubsetEmptyNonEmpty,\n TestSubsetPartial,\n TestSubsetNonOverlap,\n TestOnlySetsNumeric,\n TestOnlySetsDict,\n TestOnlySetsOperator,\n TestOnlySetsTuple,\n TestOnlySetsString,\n TestOnlySetsGenerator,\n TestCopyingEmpty,\n TestCopyingSingleton,\n TestCopyingTriple,\n TestCopyingTuple,\n TestCopyingNested,\n TestIdentities,\n TestVariousIteratorArgs,\n TestGraphs,\n TestWeirdBugs,\n )\n\n support.run_unittest(*test_classes)\n\n # verify reference counting\n if verbose and hasattr(sys, \"gettotalrefcount\"):\n import gc\n counts = [None] * 5\n for i in range(len(counts)):\n support.run_unittest(*test_classes)\n gc.collect()\n counts[i] = sys.gettotalrefcount()\n print(counts)\n\nif __name__ == \"__main__\":\n test_main(verbose=True)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_unittest_mock_rename.return.wrap": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_unittest_mock_rename.return.wrap", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_shutil.py", "file_name": "test_shutil.py", "file_type": "text/x-python", "category": "test", "start_line": 3, "end_line": 58, "span_ids": ["_fake_rename", "mock_rename", "docstring"], "tokens": 323}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import unittest\nimport shutil\nimport tempfile\nimport sys\nimport stat\nimport os\nimport os.path\nimport functools\nfrom test import support\nfrom test.support import TESTFN\nfrom os.path import splitdrive\nfrom distutils.spawn import find_executable, spawn\nfrom shutil import (_make_tarball, _make_zipfile, make_archive,\n register_archive_format, unregister_archive_format,\n get_archive_formats, Error, unpack_archive,\n register_unpack_format, RegistryError,\n unregister_unpack_format, get_unpack_formats)\nimport tarfile\nimport warnings\n\nfrom test import support\nfrom test.support import check_warnings, captured_stdout\n\nfrom typing import (\n Any, Callable, Tuple, List, Sequence, BinaryIO, IO, Union, cast\n)\nfrom types import TracebackType\n\nimport bz2\nBZ2_SUPPORTED = True\n\nTESTFN2 = TESTFN + \"2\"\n\nimport grp\nimport pwd\nUID_GID_SUPPORT = True\n\nimport zlib\n\nimport zipfile\nZIP_SUPPORT = True\n\ndef _fake_rename(*args: Any, **kwargs: Any) -> None:\n # Pretend the destination path is on a different filesystem.\n raise OSError()\n\ndef mock_rename(func: Any) -> Any:\n @functools.wraps(func)\n def wrap(*args: Any, **kwargs: Any) -> Any:\n try:\n builtin_rename = shutil.rename\n shutil.rename = cast(Any, _fake_rename)\n return func(*args, **kwargs)\n finally:\n shutil.rename = cast(Any, builtin_rename)\n return wrap", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil_TestShutil.if_hasattr_os_chmod_.test_on_error.shutil_rmtree_TESTFN_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil_TestShutil.if_hasattr_os_chmod_.test_on_error.shutil_rmtree_TESTFN_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_shutil.py", "file_name": "test_shutil.py", "file_type": "text/x-python", "category": "test", "start_line": 60, "end_line": 128, "span_ids": ["TestShutil.setUp", "TestShutil:2", "TestShutil.tearDown", "TestShutil.write_file", "TestShutil.test_rmtree_errors", "TestShutil", "TestShutil.mkdtemp"], "tokens": 556}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestShutil(unittest.TestCase):\n\n def setUp(self) -> None:\n super().setUp()\n self.tempdirs = [] # type: List[str]\n\n def tearDown(self) -> None:\n super().tearDown()\n while self.tempdirs:\n d = self.tempdirs.pop()\n shutil.rmtree(d, os.name in ('nt', 'cygwin'))\n\n def write_file(self, path: Union[str, List[str], tuple], content: str = 'xxx') -> None:\n \"\"\"Writes a file in the given path.\n\n\n path can be a string or a sequence.\n \"\"\"\n if isinstance(path, list):\n path = os.path.join(*path)\n elif isinstance(path, tuple):\n path = cast(str, os.path.join(*path))\n f = open(path, 'w')\n try:\n f.write(content)\n finally:\n f.close()\n\n def mkdtemp(self) -> str:\n \"\"\"Create a temporary directory that will be cleaned up.\n\n Returns the path of the directory.\n \"\"\"\n d = tempfile.mkdtemp()\n self.tempdirs.append(d)\n return d\n\n def test_rmtree_errors(self) -> None:\n # filename is guaranteed not to exist\n filename = tempfile.mktemp()\n self.assertRaises(OSError, shutil.rmtree, filename)\n\n # See bug #1071513 for why we don't run this on cygwin\n # and bug #1076467 for why we don't run this as root.\n if (hasattr(os, 'chmod') and sys.platform[:6] != 'cygwin'\n and not (hasattr(os, 'geteuid') and os.geteuid() == 0)):\n def test_on_error(self) -> None:\n self.errorState = 0\n os.mkdir(TESTFN)\n self.childpath = os.path.join(TESTFN, 'a')\n f = open(self.childpath, 'w')\n f.close()\n old_dir_mode = os.stat(TESTFN).st_mode\n old_child_mode = os.stat(self.childpath).st_mode\n # Make unwritable.\n os.chmod(self.childpath, stat.S_IREAD)\n os.chmod(TESTFN, stat.S_IREAD)\n\n shutil.rmtree(TESTFN, onerror=self.check_args_to_onerror)\n # Test whether onerror has actually been called.\n self.assertEqual(self.errorState, 2,\n \"Expected call to onerror function did not happen.\")\n\n # Make writable again.\n os.chmod(TESTFN, old_dir_mode)\n os.chmod(self.childpath, old_child_mode)\n\n # Clean up.\n shutil.rmtree(TESTFN)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.check_args_to_onerror_TestShutil._write_data.f_close_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.check_args_to_onerror_TestShutil._write_data.f_close_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_shutil.py", "file_name": "test_shutil.py", "file_type": "text/x-python", "category": "test", "start_line": 130, "end_line": 168, "span_ids": ["TestShutil.check_args_to_onerror", "TestShutil._write_data", "TestShutil.test_rmtree_dont_delete_file"], "tokens": 380}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestShutil(unittest.TestCase):\n\n def check_args_to_onerror(self, func: Callable[[str], Any], arg: str,\n exc: Tuple[type, BaseException,\n TracebackType]) -> None:\n # test_rmtree_errors deliberately runs rmtree\n # on a directory that is chmod 400, which will fail.\n # This function is run when shutil.rmtree fails.\n # 99.9% of the time it initially fails to remove\n # a file in the directory, so the first time through\n # func is os.remove.\n # However, some Linux machines running ZFS on\n # FUSE experienced a failure earlier in the process\n # at os.listdir. The first failure may legally\n # be either.\n if self.errorState == 0:\n if func is os.remove:\n self.assertEqual(arg, self.childpath)\n else:\n self.assertIs(func, os.listdir,\n \"func must be either os.remove or os.listdir\")\n self.assertEqual(arg, TESTFN)\n self.assertTrue(issubclass(exc[0], OSError))\n self.errorState = 1\n else:\n self.assertEqual(func, os.rmdir)\n self.assertEqual(arg, TESTFN)\n self.assertTrue(issubclass(exc[0], OSError))\n self.errorState = 2\n\n def test_rmtree_dont_delete_file(self) -> None:\n # When called on a file instead of a directory, don't delete it.\n handle, path = tempfile.mkstemp()\n os.fdopen(handle).close()\n self.assertRaises(OSError, shutil.rmtree, path)\n os.remove(path)\n\n def _write_data(self, path: str, data: str) -> None:\n f = open(path, \"w\")\n f.write(data)\n f.close()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.test_copytree_simple_TestShutil.test_copytree_simple.try_.finally_.for_path_in_src_dir_.if_os_path_exists_path_.shutil_rmtree_path_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.test_copytree_simple_TestShutil.test_copytree_simple.try_.finally_.for_path_in_src_dir_.if_os_path_exists_path_.shutil_rmtree_path_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_shutil.py", "file_name": "test_shutil.py", "file_type": "text/x-python", "category": "test", "start_line": 170, "end_line": 207, "span_ids": ["TestShutil.test_copytree_simple"], "tokens": 346}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestShutil(unittest.TestCase):\n\n def test_copytree_simple(self) -> None:\n\n def read_data(path: str) -> str:\n f = open(path)\n data = f.read()\n f.close()\n return data\n\n src_dir = tempfile.mkdtemp()\n dst_dir = os.path.join(tempfile.mkdtemp(), 'destination')\n self._write_data(os.path.join(src_dir, 'test.txt'), '123')\n os.mkdir(os.path.join(src_dir, 'test_dir'))\n self._write_data(os.path.join(src_dir, 'test_dir', 'test.txt'), '456')\n\n try:\n shutil.copytree(src_dir, dst_dir)\n self.assertTrue(os.path.isfile(os.path.join(dst_dir, 'test.txt')))\n self.assertTrue(os.path.isdir(os.path.join(dst_dir, 'test_dir')))\n self.assertTrue(os.path.isfile(os.path.join(dst_dir, 'test_dir',\n 'test.txt')))\n actual = read_data(os.path.join(dst_dir, 'test.txt'))\n self.assertEqual(actual, '123')\n actual = read_data(os.path.join(dst_dir, 'test_dir', 'test.txt'))\n self.assertEqual(actual, '456')\n finally:\n for path in (\n os.path.join(src_dir, 'test.txt'),\n os.path.join(dst_dir, 'test.txt'),\n os.path.join(src_dir, 'test_dir', 'test.txt'),\n os.path.join(dst_dir, 'test_dir', 'test.txt'),\n ):\n if os.path.exists(path):\n os.remove(path)\n for path in (src_dir,\n os.path.dirname(dst_dir)\n ):\n if os.path.exists(path):\n shutil.rmtree(path)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.test_copytree_with_exclude_TestShutil.test_copytree_with_exclude.try_.finally_.shutil_rmtree_os_path_dir": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.test_copytree_with_exclude_TestShutil.test_copytree_with_exclude.try_.finally_.shutil_rmtree_os_path_dir", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_shutil.py", "file_name": "test_shutil.py", "file_type": "text/x-python", "category": "test", "start_line": 209, "end_line": 285, "span_ids": ["TestShutil.test_copytree_with_exclude"], "tokens": 706}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestShutil(unittest.TestCase):\n\n def test_copytree_with_exclude(self) -> None:\n\n def read_data(path: str) -> str:\n f = open(path)\n data = f.read()\n f.close()\n return data\n\n # creating data\n join = os.path.join\n exists = os.path.exists\n src_dir = tempfile.mkdtemp()\n try:\n dst_dir = join(tempfile.mkdtemp(), 'destination')\n self._write_data(join(src_dir, 'test.txt'), '123')\n self._write_data(join(src_dir, 'test.tmp'), '123')\n os.mkdir(join(src_dir, 'test_dir'))\n self._write_data(join(src_dir, 'test_dir', 'test.txt'), '456')\n os.mkdir(join(src_dir, 'test_dir2'))\n self._write_data(join(src_dir, 'test_dir2', 'test.txt'), '456')\n os.mkdir(join(src_dir, 'test_dir2', 'subdir'))\n os.mkdir(join(src_dir, 'test_dir2', 'subdir2'))\n self._write_data(join(src_dir, 'test_dir2', 'subdir', 'test.txt'),\n '456')\n self._write_data(join(src_dir, 'test_dir2', 'subdir2', 'test.py'),\n '456')\n\n\n # testing glob-like patterns\n try:\n patterns = shutil.ignore_patterns('*.tmp', 'test_dir2')\n shutil.copytree(src_dir, dst_dir, ignore=patterns)\n # checking the result: some elements should not be copied\n self.assertTrue(exists(join(dst_dir, 'test.txt')))\n self.assertTrue(not exists(join(dst_dir, 'test.tmp')))\n self.assertTrue(not exists(join(dst_dir, 'test_dir2')))\n finally:\n if os.path.exists(dst_dir):\n shutil.rmtree(dst_dir)\n try:\n patterns = shutil.ignore_patterns('*.tmp', 'subdir*')\n shutil.copytree(src_dir, dst_dir, ignore=patterns)\n # checking the result: some elements should not be copied\n self.assertTrue(not exists(join(dst_dir, 'test.tmp')))\n self.assertTrue(not exists(join(dst_dir, 'test_dir2', 'subdir2')))\n self.assertTrue(not exists(join(dst_dir, 'test_dir2', 'subdir')))\n finally:\n if os.path.exists(dst_dir):\n shutil.rmtree(dst_dir)\n\n # testing callable-style\n try:\n def _filter(src: str, names: Sequence[str]) -> List[str]:\n res = [] # type: List[str]\n for name in names:\n path = os.path.join(src, name)\n\n if (os.path.isdir(path) and\n path.split()[-1] == 'subdir'):\n res.append(name)\n elif os.path.splitext(path)[-1] in ('.py'):\n res.append(name)\n return res\n\n shutil.copytree(src_dir, dst_dir, ignore=_filter)\n\n # checking the result: some elements should not be copied\n self.assertTrue(not exists(join(dst_dir, 'test_dir2', 'subdir2',\n 'test.py')))\n self.assertTrue(not exists(join(dst_dir, 'test_dir2', 'subdir')))\n\n finally:\n if os.path.exists(dst_dir):\n shutil.rmtree(dst_dir)\n finally:\n shutil.rmtree(src_dir)\n shutil.rmtree(os.path.dirname(dst_dir))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.test_dont_copy_file_onto_link_to_itself_TestShutil.test_dont_copy_file_onto_link_to_itself.try_.finally_.shutil_rmtree_TESTFN_ign": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.test_dont_copy_file_onto_link_to_itself_TestShutil.test_dont_copy_file_onto_link_to_itself.try_.finally_.shutil_rmtree_TESTFN_ign", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_shutil.py", "file_name": "test_shutil.py", "file_type": "text/x-python", "category": "test", "start_line": 287, "end_line": 305, "span_ids": ["TestShutil.test_dont_copy_file_onto_link_to_itself"], "tokens": 182}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestShutil(unittest.TestCase):\n\n @unittest.skipUnless(hasattr(os, 'link'), 'requires os.link')\n def test_dont_copy_file_onto_link_to_itself(self) -> None:\n # Temporarily disable test on Windows.\n if os.name == 'nt':\n return\n # bug 851123.\n os.mkdir(TESTFN)\n src = os.path.join(TESTFN, 'cheese')\n dst = os.path.join(TESTFN, 'shop')\n try:\n with open(src, 'w') as f:\n f.write('cheddar')\n os.link(src, dst)\n self.assertRaises(shutil.Error, shutil.copyfile, src, dst)\n with open(src, 'r') as f:\n self.assertEqual(f.read(), 'cheddar')\n os.remove(dst)\n finally:\n shutil.rmtree(TESTFN, ignore_errors=True)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.test_dont_copy_file_onto_symlink_to_itself_TestShutil.test_dont_copy_file_onto_symlink_to_itself.try_.finally_.shutil_rmtree_TESTFN_ign": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.test_dont_copy_file_onto_symlink_to_itself_TestShutil.test_dont_copy_file_onto_symlink_to_itself.try_.finally_.shutil_rmtree_TESTFN_ign", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_shutil.py", "file_name": "test_shutil.py", "file_type": "text/x-python", "category": "test", "start_line": 307, "end_line": 325, "span_ids": ["TestShutil.test_dont_copy_file_onto_symlink_to_itself"], "tokens": 201}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestShutil(unittest.TestCase):\n\n @support.skip_unless_symlink\n def test_dont_copy_file_onto_symlink_to_itself(self) -> None:\n # bug 851123.\n os.mkdir(TESTFN)\n src = os.path.join(TESTFN, 'cheese')\n dst = os.path.join(TESTFN, 'shop')\n try:\n with open(src, 'w') as f:\n f.write('cheddar')\n # Using `src` here would mean we end up with a symlink pointing\n # to TESTFN/TESTFN/cheese, while it should point at\n # TESTFN/cheese.\n os.symlink('cheese', dst)\n self.assertRaises(shutil.Error, shutil.copyfile, src, dst)\n with open(src, 'r') as f:\n self.assertEqual(f.read(), 'cheddar')\n os.remove(dst)\n finally:\n shutil.rmtree(TESTFN, ignore_errors=True)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.test_rmtree_on_symlink_TestShutil.if_hasattr_os_mkfifo_.test_copytree_named_pipe.try_.finally_.shutil_rmtree_TESTFN2_ig": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.test_rmtree_on_symlink_TestShutil.if_hasattr_os_mkfifo_.test_copytree_named_pipe.try_.finally_.shutil_rmtree_TESTFN2_ig", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_shutil.py", "file_name": "test_shutil.py", "file_type": "text/x-python", "category": "test", "start_line": 327, "end_line": 371, "span_ids": ["TestShutil.test_rmtree_on_symlink", "TestShutil:3"], "tokens": 381}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestShutil(unittest.TestCase):\n\n @support.skip_unless_symlink\n def test_rmtree_on_symlink(self) -> None:\n # bug 1669.\n os.mkdir(TESTFN)\n try:\n src = os.path.join(TESTFN, 'cheese')\n dst = os.path.join(TESTFN, 'shop')\n os.mkdir(src)\n os.symlink(src, dst)\n self.assertRaises(OSError, shutil.rmtree, dst)\n finally:\n shutil.rmtree(TESTFN, ignore_errors=True)\n\n if hasattr(os, \"mkfifo\"):\n # Issue #3002: copyfile and copytree block indefinitely on named pipes\n def test_copyfile_named_pipe(self) -> None:\n os.mkfifo(TESTFN)\n try:\n self.assertRaises(shutil.SpecialFileError,\n shutil.copyfile, TESTFN, TESTFN2)\n self.assertRaises(shutil.SpecialFileError,\n shutil.copyfile, __file__, TESTFN)\n finally:\n os.remove(TESTFN)\n\n @support.skip_unless_symlink\n def test_copytree_named_pipe(self) -> None:\n os.mkdir(TESTFN)\n try:\n subdir = os.path.join(TESTFN, \"subdir\")\n os.mkdir(subdir)\n pipe = os.path.join(subdir, \"mypipe\")\n os.mkfifo(pipe)\n try:\n shutil.copytree(TESTFN, TESTFN2)\n except shutil.Error as e:\n errors = e.args[0]\n self.assertEqual(len(errors), 1)\n src, dst, error_msg = errors[0]\n self.assertEqual(\"`%s` is a named pipe\" % pipe, error_msg)\n else:\n self.fail(\"shutil.Error should have been raised\")\n finally:\n shutil.rmtree(TESTFN, ignore_errors=True)\n shutil.rmtree(TESTFN2, ignore_errors=True)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.test_copytree_special_func_TestShutil.test_copytree_special_func.self_assertEqual_len_copi": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.test_copytree_special_func_TestShutil.test_copytree_special_func.self_assertEqual_len_copi", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_shutil.py", "file_name": "test_shutil.py", "file_type": "text/x-python", "category": "test", "start_line": 373, "end_line": 386, "span_ids": ["TestShutil.test_copytree_special_func"], "tokens": 160}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestShutil(unittest.TestCase):\n\n def test_copytree_special_func(self) -> None:\n\n src_dir = self.mkdtemp()\n dst_dir = os.path.join(self.mkdtemp(), 'destination')\n self._write_data(os.path.join(src_dir, 'test.txt'), '123')\n os.mkdir(os.path.join(src_dir, 'test_dir'))\n self._write_data(os.path.join(src_dir, 'test_dir', 'test.txt'), '456')\n\n copied = [] # type: List[Tuple[str, str]]\n def _copy(src: str, dst: str) -> None:\n copied.append((src, dst))\n\n shutil.copytree(src_dir, dst_dir, copy_function=_copy)\n self.assertEqual(len(copied), 2)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.test_copytree_dangling_symlinks_TestShutil.test_copytree_dangling_symlinks.self_assertIn_test_txt_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.test_copytree_dangling_symlinks_TestShutil.test_copytree_dangling_symlinks.self_assertIn_test_txt_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_shutil.py", "file_name": "test_shutil.py", "file_type": "text/x-python", "category": "test", "start_line": 388, "end_line": 407, "span_ids": ["TestShutil.test_copytree_dangling_symlinks"], "tokens": 252}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestShutil(unittest.TestCase):\n\n @support.skip_unless_symlink\n def test_copytree_dangling_symlinks(self) -> None:\n\n # a dangling symlink raises an error at the end\n src_dir = self.mkdtemp()\n dst_dir = os.path.join(self.mkdtemp(), 'destination')\n os.symlink('IDONTEXIST', os.path.join(src_dir, 'test.txt'))\n os.mkdir(os.path.join(src_dir, 'test_dir'))\n self._write_data(os.path.join(src_dir, 'test_dir', 'test.txt'), '456')\n self.assertRaises(Error, shutil.copytree, src_dir, dst_dir)\n\n # a dangling symlink is ignored with the proper flag\n dst_dir = os.path.join(self.mkdtemp(), 'destination2')\n shutil.copytree(src_dir, dst_dir, ignore_dangling_symlinks=True)\n self.assertNotIn('test.txt', os.listdir(dst_dir))\n\n # a dangling symlink is copied if symlinks=True\n dst_dir = os.path.join(self.mkdtemp(), 'destination3')\n shutil.copytree(src_dir, dst_dir, symlinks=True)\n self.assertIn('test.txt', os.listdir(dst_dir))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil._copy_file_TestShutil.test_copy.self_assertEqual_os_stat_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil._copy_file_TestShutil.test_copy.self_assertEqual_os_stat_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_shutil.py", "file_name": "test_shutil.py", "file_type": "text/x-python", "category": "test", "start_line": 409, "end_line": 425, "span_ids": ["TestShutil.test_copy", "TestShutil._copy_file"], "tokens": 195}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestShutil(unittest.TestCase):\n\n def _copy_file(self,\n method: Callable[[str, str], None]) -> Tuple[str, str]:\n fname = 'test.txt'\n tmpdir = self.mkdtemp()\n self.write_file([tmpdir, fname])\n file1 = os.path.join(tmpdir, fname)\n tmpdir2 = self.mkdtemp()\n method(file1, tmpdir2)\n file2 = os.path.join(tmpdir2, fname)\n return (file1, file2)\n\n @unittest.skipUnless(hasattr(os, 'chmod'), 'requires os.chmod')\n def test_copy(self) -> None:\n # Ensure that the copied file exists and has the same mode bits.\n file1, file2 = self._copy_file(shutil.copy)\n self.assertTrue(os.path.exists(file2))\n self.assertEqual(os.stat(file1).st_mode, os.stat(file2).st_mode)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.test_copy2_TestShutil.test_copy2.if_hasattr_os_chflags_.self_assertEqual_getattr_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.test_copy2_TestShutil.test_copy2.if_hasattr_os_chflags_.self_assertEqual_getattr_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_shutil.py", "file_name": "test_shutil.py", "file_type": "text/x-python", "category": "test", "start_line": 427, "end_line": 443, "span_ids": ["TestShutil.test_copy2"], "tokens": 228}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestShutil(unittest.TestCase):\n\n @unittest.skipUnless(hasattr(os, 'chmod'), 'requires os.chmod')\n @unittest.skipUnless(hasattr(os, 'utime'), 'requires os.utime')\n def test_copy2(self) -> None:\n # Ensure that the copied file exists and has the same mode and\n # modification time bits.\n file1, file2 = self._copy_file(shutil.copy2)\n self.assertTrue(os.path.exists(file2))\n file1_stat = os.stat(file1)\n file2_stat = os.stat(file2)\n self.assertEqual(file1_stat.st_mode, file2_stat.st_mode)\n for attr in 'st_atime', 'st_mtime':\n # The modification times may be truncated in the new file.\n self.assertLessEqual(getattr(file1_stat, attr),\n getattr(file2_stat, attr) + 1)\n if hasattr(os, 'chflags') and hasattr(file1_stat, 'st_flags'):\n self.assertEqual(getattr(file1_stat, 'st_flags'),\n getattr(file2_stat, 'st_flags'))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.test_make_tarball_TestShutil.test_make_tarball.None_9": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.test_make_tarball_TestShutil.test_make_tarball.None_9", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_shutil.py", "file_name": "test_shutil.py", "file_type": "text/x-python", "category": "test", "start_line": 445, "end_line": 483, "span_ids": ["TestShutil.test_make_tarball"], "tokens": 342}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestShutil(unittest.TestCase):\n\n @unittest.skipUnless(zlib, \"requires zlib\")\n def test_make_tarball(self) -> None:\n # creating something to tar\n tmpdir = self.mkdtemp()\n self.write_file([tmpdir, 'file1'], 'xxx')\n self.write_file([tmpdir, 'file2'], 'xxx')\n os.mkdir(os.path.join(tmpdir, 'sub'))\n self.write_file([tmpdir, 'sub', 'file3'], 'xxx')\n\n tmpdir2 = self.mkdtemp()\n # force shutil to create the directory\n os.rmdir(tmpdir2)\n unittest.skipUnless(splitdrive(tmpdir)[0] == splitdrive(tmpdir2)[0],\n \"source and target should be on same drive\")\n\n base_name = os.path.join(tmpdir2, 'archive')\n\n # working with relative paths to avoid tar warnings\n old_dir = os.getcwd()\n os.chdir(tmpdir)\n try:\n _make_tarball(splitdrive(base_name)[1], '.')\n finally:\n os.chdir(old_dir)\n\n # check if the compressed tarball was created\n tarball = base_name + '.tar.gz'\n self.assertTrue(os.path.exists(tarball))\n\n # trying an uncompressed one\n base_name = os.path.join(tmpdir2, 'archive')\n old_dir = os.getcwd()\n os.chdir(tmpdir)\n try:\n _make_tarball(splitdrive(base_name)[1], '.', compress=None)\n finally:\n os.chdir(old_dir)\n tarball = base_name + '.tar'\n self.assertTrue(os.path.exists(tarball))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil._tarinfo_TestShutil._create_files.return.tmpdir_tmpdir2_base_nam": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil._tarinfo_TestShutil._create_files.return.tmpdir_tmpdir2_base_nam", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_shutil.py", "file_name": "test_shutil.py", "file_type": "text/x-python", "category": "test", "start_line": 485, "end_line": 506, "span_ids": ["TestShutil._create_files", "TestShutil._tarinfo"], "tokens": 206}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestShutil(unittest.TestCase):\n\n def _tarinfo(self, path: str) -> tuple:\n tar = tarfile.open(path)\n try:\n names = tar.getnames()\n names.sort()\n return tuple(names)\n finally:\n tar.close()\n\n def _create_files(self) -> Tuple[str, str, str]:\n # creating something to tar\n tmpdir = self.mkdtemp()\n dist = os.path.join(tmpdir, 'dist')\n os.mkdir(dist)\n self.write_file([dist, 'file1'], 'xxx')\n self.write_file([dist, 'file2'], 'xxx')\n os.mkdir(os.path.join(dist, 'sub'))\n self.write_file([dist, 'sub', 'file3'], 'xxx')\n os.mkdir(os.path.join(dist, 'sub2'))\n tmpdir2 = self.mkdtemp()\n base_name = os.path.join(tmpdir2, 'archive')\n return tmpdir, tmpdir2, base_name", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.test_tarfile_vs_tar_TestShutil.test_tarfile_vs_tar.None_8": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.test_tarfile_vs_tar_TestShutil.test_tarfile_vs_tar.None_8", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_shutil.py", "file_name": "test_shutil.py", "file_type": "text/x-python", "category": "test", "start_line": 508, "end_line": 561, "span_ids": ["TestShutil.test_tarfile_vs_tar"], "tokens": 455}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestShutil(unittest.TestCase):\n\n @unittest.skipUnless(zlib, \"Requires zlib\")\n @unittest.skipUnless(find_executable('tar') and find_executable('gzip'),\n 'Need the tar command to run')\n def test_tarfile_vs_tar(self) -> None:\n tmpdir, tmpdir2, base_name = self._create_files()\n old_dir = os.getcwd()\n os.chdir(tmpdir)\n try:\n _make_tarball(base_name, 'dist')\n finally:\n os.chdir(old_dir)\n\n # check if the compressed tarball was created\n tarball = base_name + '.tar.gz'\n self.assertTrue(os.path.exists(tarball))\n\n # now create another tarball using `tar`\n tarball2 = os.path.join(tmpdir, 'archive2.tar.gz')\n tar_cmd = ['tar', '-cf', 'archive2.tar', 'dist']\n gzip_cmd = ['gzip', '-f9', 'archive2.tar']\n old_dir = os.getcwd()\n os.chdir(tmpdir)\n try:\n with captured_stdout() as s:\n spawn(tar_cmd)\n spawn(gzip_cmd)\n finally:\n os.chdir(old_dir)\n\n self.assertTrue(os.path.exists(tarball2))\n # let's compare both tarballs\n self.assertEqual(self._tarinfo(tarball), self._tarinfo(tarball2))\n\n # trying an uncompressed one\n base_name = os.path.join(tmpdir2, 'archive')\n old_dir = os.getcwd()\n os.chdir(tmpdir)\n try:\n _make_tarball(base_name, 'dist', compress=None)\n finally:\n os.chdir(old_dir)\n tarball = base_name + '.tar'\n self.assertTrue(os.path.exists(tarball))\n\n # now for a dry_run\n base_name = os.path.join(tmpdir2, 'archive')\n old_dir = os.getcwd()\n os.chdir(tmpdir)\n try:\n _make_tarball(base_name, 'dist', compress=None, dry_run=True)\n finally:\n os.chdir(old_dir)\n tarball = base_name + '.tar'\n self.assertTrue(os.path.exists(tarball))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.test_make_zipfile_TestShutil.test_make_archive.self_assertRaises_ValueEr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.test_make_zipfile_TestShutil.test_make_archive.self_assertRaises_ValueEr", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_shutil.py", "file_name": "test_shutil.py", "file_type": "text/x-python", "category": "test", "start_line": 563, "end_line": 585, "span_ids": ["TestShutil.test_make_archive", "TestShutil.test_make_zipfile"], "tokens": 221}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestShutil(unittest.TestCase):\n\n @unittest.skipUnless(zlib, \"Requires zlib\")\n @unittest.skipUnless(ZIP_SUPPORT, 'Need zip support to run')\n def test_make_zipfile(self) -> None:\n # creating something to tar\n tmpdir = self.mkdtemp()\n self.write_file([tmpdir, 'file1'], 'xxx')\n self.write_file([tmpdir, 'file2'], 'xxx')\n\n tmpdir2 = self.mkdtemp()\n # force shutil to create the directory\n os.rmdir(tmpdir2)\n base_name = os.path.join(tmpdir2, 'archive')\n _make_zipfile(base_name, tmpdir)\n\n # check if the compressed tarball was created\n tarball = base_name + '.zip'\n self.assertTrue(os.path.exists(tarball))\n\n\n def test_make_archive(self) -> None:\n tmpdir = self.mkdtemp()\n base_name = os.path.join(tmpdir, 'archive')\n self.assertRaises(ValueError, make_archive, base_name, 'xxx')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.test_make_archive_owner_group_TestShutil.test_make_archive_owner_group.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.test_make_archive_owner_group_TestShutil.test_make_archive_owner_group.None_3", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_shutil.py", "file_name": "test_shutil.py", "file_type": "text/x-python", "category": "test", "start_line": 587, "end_line": 612, "span_ids": ["TestShutil.test_make_archive_owner_group"], "tokens": 270}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestShutil(unittest.TestCase):\n\n @unittest.skipUnless(zlib, \"Requires zlib\")\n def test_make_archive_owner_group(self) -> None:\n # testing make_archive with owner and group, with various combinations\n # this works even if there's not gid/uid support\n if UID_GID_SUPPORT:\n group = grp.getgrgid(0).gr_name\n owner = pwd.getpwuid(0).pw_name\n else:\n group = owner = 'root'\n\n base_dir, root_dir, base_name = self._create_files()\n base_name = os.path.join(self.mkdtemp() , 'archive')\n res = make_archive(base_name, 'zip', root_dir, base_dir, owner=owner,\n group=group)\n self.assertTrue(os.path.exists(res))\n\n res = make_archive(base_name, 'zip', root_dir, base_dir)\n self.assertTrue(os.path.exists(res))\n\n res = make_archive(base_name, 'tar', root_dir, base_dir,\n owner=owner, group=group)\n self.assertTrue(os.path.exists(res))\n\n res = make_archive(base_name, 'tar', root_dir, base_dir,\n owner='kjhkjhkjg', group='oihohoh')\n self.assertTrue(os.path.exists(res))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.test_tarfile_root_owner_TestShutil.test_tarfile_root_owner.None_1.finally_.archive_close_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.test_tarfile_root_owner_TestShutil.test_tarfile_root_owner.None_1.finally_.archive_close_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_shutil.py", "file_name": "test_shutil.py", "file_type": "text/x-python", "category": "test", "start_line": 615, "end_line": 639, "span_ids": ["TestShutil.test_tarfile_root_owner"], "tokens": 219}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestShutil(unittest.TestCase):\n\n\n @unittest.skipUnless(zlib, \"Requires zlib\")\n @unittest.skipUnless(UID_GID_SUPPORT, \"Requires grp and pwd support\")\n def test_tarfile_root_owner(self) -> None:\n tmpdir, tmpdir2, base_name = self._create_files()\n old_dir = os.getcwd()\n os.chdir(tmpdir)\n group = grp.getgrgid(0).gr_name\n owner = pwd.getpwuid(0).pw_name\n try:\n archive_name = _make_tarball(base_name, 'dist', compress=None,\n owner=owner, group=group)\n finally:\n os.chdir(old_dir)\n\n # check if the compressed tarball was created\n self.assertTrue(os.path.exists(archive_name))\n\n # now checks the rights\n archive = tarfile.open(archive_name)\n try:\n for member in archive.getmembers():\n self.assertEqual(member.uid, 0)\n self.assertEqual(member.gid, 0)\n finally:\n archive.close()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.test_make_archive_cwd_TestShutil.test_register_archive_format.self_assertNotIn_xxx_f": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.test_make_archive_cwd_TestShutil.test_register_archive_format.self_assertNotIn_xxx_f", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_shutil.py", "file_name": "test_shutil.py", "file_type": "text/x-python", "category": "test", "start_line": 641, "end_line": 672, "span_ids": ["TestShutil.test_register_archive_format", "TestShutil.test_make_archive_cwd"], "tokens": 274}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestShutil(unittest.TestCase):\n\n def test_make_archive_cwd(self) -> None:\n current_dir = os.getcwd()\n def _breaks(*args: Any, **kw: Any) -> None:\n raise RuntimeError()\n\n register_archive_format('xxx', _breaks, [], 'xxx file')\n try:\n try:\n make_archive('xxx', 'xxx', root_dir=self.mkdtemp())\n except Exception:\n pass\n self.assertEqual(os.getcwd(), current_dir)\n finally:\n unregister_archive_format('xxx')\n\n def test_register_archive_format(self) -> None:\n\n self.assertRaises(TypeError, register_archive_format, 'xxx', 1)\n self.assertRaises(TypeError, register_archive_format, 'xxx',\n lambda: 1/0,\n 1)\n self.assertRaises(TypeError, register_archive_format, 'xxx',\n lambda: 1/0,\n [(1, 2), (1, 2, 3)])\n\n register_archive_format('xxx', lambda: 1/0, [('x', 2)], 'xxx file')\n formats = [name for name, params in get_archive_formats()]\n self.assertIn('xxx', formats)\n\n unregister_archive_format('xxx')\n formats = [name for name, params in get_archive_formats()]\n self.assertNotIn('xxx', formats)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil._compare_dirs_TestShutil._compare_dirs.return.diff": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil._compare_dirs_TestShutil._compare_dirs.return.diff", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_shutil.py", "file_name": "test_shutil.py", "file_type": "text/x-python", "category": "test", "start_line": 674, "end_line": 684, "span_ids": ["TestShutil._compare_dirs"], "tokens": 121}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestShutil(unittest.TestCase):\n\n def _compare_dirs(self, dir1: str, dir2: str) -> List[str]:\n # check that dir1 and dir2 are equivalent,\n # return the diff\n diff = [] # type: List[str]\n for root, dirs, files in os.walk(dir1):\n for file_ in files:\n path = os.path.join(root, file_)\n target_path = os.path.join(dir2, os.path.split(path)[-1])\n if not os.path.exists(target_path):\n diff.append(file_)\n return diff", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.test_unpack_archive_TestShutil.test_unpack_archive.self_assertRaises_ValueEr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.test_unpack_archive_TestShutil.test_unpack_archive.self_assertRaises_ValueEr", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_shutil.py", "file_name": "test_shutil.py", "file_type": "text/x-python", "category": "test", "start_line": 686, "end_line": 709, "span_ids": ["TestShutil.test_unpack_archive"], "tokens": 237}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestShutil(unittest.TestCase):\n\n @unittest.skipUnless(zlib, \"Requires zlib\")\n def test_unpack_archive(self) -> None:\n formats = ['tar', 'gztar', 'zip']\n if BZ2_SUPPORTED:\n formats.append('bztar')\n\n for format in formats:\n tmpdir = self.mkdtemp()\n base_dir, root_dir, base_name = self._create_files()\n tmpdir2 = self.mkdtemp()\n filename = make_archive(base_name, format, root_dir, base_dir)\n\n # let's try to unpack it now\n unpack_archive(filename, tmpdir2)\n diff = self._compare_dirs(tmpdir, tmpdir2)\n self.assertEqual(diff, [])\n\n # and again, this time with the format specified\n tmpdir3 = self.mkdtemp()\n unpack_archive(filename, tmpdir3, format=format)\n diff = self._compare_dirs(tmpdir, tmpdir3)\n self.assertEqual(diff, [])\n self.assertRaises(shutil.ReadError, unpack_archive, TESTFN)\n self.assertRaises(ValueError, unpack_archive, TESTFN, format='xxx')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.test_unpack_registery_TestShutil.test_unpack_registery.self_assertEqual_get_unpa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestShutil.test_unpack_registery_TestShutil.test_unpack_registery.self_assertEqual_get_unpa", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_shutil.py", "file_name": "test_shutil.py", "file_type": "text/x-python", "category": "test", "start_line": 711, "end_line": 735, "span_ids": ["TestShutil.test_unpack_registery"], "tokens": 232}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestShutil(unittest.TestCase):\n\n def test_unpack_registery(self) -> None:\n\n formats = get_unpack_formats()\n\n def _boo(filename: str, extract_dir: str, extra: int) -> None:\n self.assertEqual(extra, 1)\n self.assertEqual(filename, 'stuff.boo')\n self.assertEqual(extract_dir, 'xx')\n\n register_unpack_format('Boo', ['.boo', '.b2'], _boo, [('extra', 1)])\n unpack_archive('stuff.boo', 'xx')\n\n # trying to register a .boo unpacker again\n self.assertRaises(RegistryError, register_unpack_format, 'Boo2',\n ['.boo'], _boo)\n\n # should work now\n unregister_unpack_format('Boo')\n register_unpack_format('Boo2', ['.boo'], _boo)\n self.assertIn(('Boo2', ['.boo'], ''), get_unpack_formats())\n self.assertNotIn(('Boo', ['.boo'], ''), get_unpack_formats())\n\n # let's leave a clean state\n unregister_unpack_format('Boo2')\n self.assertEqual(get_unpack_formats(), formats)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestMove_TestMove.test_dont_move_dir_in_itself.self_assertRaises_shutil_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestMove_TestMove.test_dont_move_dir_in_itself.self_assertRaises_shutil_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_shutil.py", "file_name": "test_shutil.py", "file_type": "text/x-python", "category": "test", "start_line": 738, "end_line": 824, "span_ids": ["TestMove", "TestMove.test_move_dir", "TestMove.setUp", "TestMove.tearDown", "TestMove.test_move_file_to_dir_other_fs", "TestMove.test_move_file_to_dir", "TestMove._check_move_dir", "TestMove.test_move_file_other_fs", "TestMove.test_move_dir_to_dir", "TestMove.test_existing_file_inside_dest_dir", "TestMove._check_move_file", "TestMove.test_move_dir_other_fs", "TestMove.test_dont_move_dir_in_itself", "TestMove.test_move_dir_to_dir_other_fs", "TestMove.test_move_file"], "tokens": 733}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestMove(unittest.TestCase):\n\n def setUp(self) -> None:\n filename = \"foo\"\n self.src_dir = tempfile.mkdtemp()\n self.dst_dir = tempfile.mkdtemp()\n self.src_file = os.path.join(self.src_dir, filename)\n self.dst_file = os.path.join(self.dst_dir, filename)\n with open(self.src_file, \"wb\") as f:\n f.write(b\"spam\")\n\n def tearDown(self) -> None:\n for d in (self.src_dir, self.dst_dir):\n try:\n if d:\n shutil.rmtree(d)\n except:\n pass\n\n def _check_move_file(self, src: str, dst: str, real_dst: str) -> None:\n with open(src, \"rb\") as f:\n contents = f.read()\n shutil.move(src, dst)\n with open(real_dst, \"rb\") as f:\n self.assertEqual(contents, f.read())\n self.assertFalse(os.path.exists(src))\n\n def _check_move_dir(self, src: str, dst: str, real_dst: str) -> None:\n contents = sorted(os.listdir(src))\n shutil.move(src, dst)\n self.assertEqual(contents, sorted(os.listdir(real_dst)))\n self.assertFalse(os.path.exists(src))\n\n def test_move_file(self) -> None:\n # Move a file to another location on the same filesystem.\n self._check_move_file(self.src_file, self.dst_file, self.dst_file)\n\n def test_move_file_to_dir(self) -> None:\n # Move a file inside an existing dir on the same filesystem.\n self._check_move_file(self.src_file, self.dst_dir, self.dst_file)\n\n @mock_rename\n def test_move_file_other_fs(self) -> None:\n # Move a file to an existing dir on another filesystem.\n self.test_move_file()\n\n @mock_rename\n def test_move_file_to_dir_other_fs(self) -> None:\n # Move a file to another location on another filesystem.\n self.test_move_file_to_dir()\n\n def test_move_dir(self) -> None:\n # Move a dir to another location on the same filesystem.\n dst_dir = tempfile.mktemp()\n try:\n self._check_move_dir(self.src_dir, dst_dir, dst_dir)\n finally:\n try:\n shutil.rmtree(dst_dir)\n except:\n pass\n\n @mock_rename\n def test_move_dir_other_fs(self) -> None:\n # Move a dir to another location on another filesystem.\n self.test_move_dir()\n\n def test_move_dir_to_dir(self) -> None:\n # Move a dir inside an existing dir on the same filesystem.\n self._check_move_dir(self.src_dir, self.dst_dir,\n os.path.join(self.dst_dir, os.path.basename(self.src_dir)))\n\n @mock_rename\n def test_move_dir_to_dir_other_fs(self) -> None:\n # Move a dir inside an existing dir on another filesystem.\n self.test_move_dir_to_dir()\n\n def test_existing_file_inside_dest_dir(self) -> None:\n # A file with the same name inside the destination dir already exists.\n with open(self.dst_file, \"wb\"):\n pass\n self.assertRaises(shutil.Error, shutil.move, self.src_file, self.dst_dir)\n\n def test_dont_move_dir_in_itself(self) -> None:\n # Moving a dir inside itself raises an Error.\n dst = os.path.join(self.src_dir, \"bar\")\n self.assertRaises(shutil.Error, shutil.move, self.src_dir, dst)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestMove.test_destinsrc_false_negative_TestMove.test_destinsrc_false_negative.try_.finally_.shutil_rmtree_TESTFN_ign": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestMove.test_destinsrc_false_negative_TestMove.test_destinsrc_false_negative.try_.finally_.shutil_rmtree_TESTFN_ign", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_shutil.py", "file_name": "test_shutil.py", "file_type": "text/x-python", "category": "test", "start_line": 826, "end_line": 836, "span_ids": ["TestMove.test_destinsrc_false_negative"], "tokens": 123}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestMove(unittest.TestCase):\n\n def test_destinsrc_false_negative(self) -> None:\n os.mkdir(TESTFN)\n try:\n for src, dst in [('srcdir', 'srcdir/dest')]:\n src = os.path.join(TESTFN, src)\n dst = os.path.join(TESTFN, dst)\n self.assertTrue(shutil._destinsrc(src, dst),\n msg='_destinsrc() wrongly concluded that '\n 'dst (%s) is not in src (%s)' % (dst, src))\n finally:\n shutil.rmtree(TESTFN, ignore_errors=True)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestMove.test_destinsrc_false_positive_TestMove.test_destinsrc_false_positive.try_.finally_.shutil_rmtree_TESTFN_ign": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestMove.test_destinsrc_false_positive_TestMove.test_destinsrc_false_positive.try_.finally_.shutil_rmtree_TESTFN_ign", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_shutil.py", "file_name": "test_shutil.py", "file_type": "text/x-python", "category": "test", "start_line": 838, "end_line": 848, "span_ids": ["TestMove.test_destinsrc_false_positive"], "tokens": 130}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestMove(unittest.TestCase):\n\n def test_destinsrc_false_positive(self) -> None:\n os.mkdir(TESTFN)\n try:\n for src, dst in [('srcdir', 'src/dest'), ('srcdir', 'srcdir.new')]:\n src = os.path.join(TESTFN, src)\n dst = os.path.join(TESTFN, dst)\n self.assertFalse(shutil._destinsrc(src, dst),\n msg='_destinsrc() wrongly concluded that '\n 'dst (%s) is in src (%s)' % (dst, src))\n finally:\n shutil.rmtree(TESTFN, ignore_errors=True)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestCopyFile_TestCopyFile.Faux.__exit__.return.self__suppress_at_exit": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestCopyFile_TestCopyFile.Faux.__exit__.return.self__suppress_at_exit", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_shutil.py", "file_name": "test_shutil.py", "file_type": "text/x-python", "category": "test", "start_line": 851, "end_line": 873, "span_ids": ["TestCopyFile.Faux.__enter__", "TestCopyFile", "TestCopyFile.Faux", "TestCopyFile.Faux.__init__", "TestCopyFile.Faux.read", "TestCopyFile.Faux.__exit__"], "tokens": 199}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCopyFile(unittest.TestCase):\n\n _delete = False\n\n class Faux(object):\n _entered = False\n _exited_with = None # type: tuple\n _raised = False\n def __init__(self, raise_in_exit: bool = False,\n suppress_at_exit: bool = True) -> None:\n self._raise_in_exit = raise_in_exit\n self._suppress_at_exit = suppress_at_exit\n def read(self, *args: Any) -> str:\n return ''\n def __enter__(self) -> None:\n self._entered = True\n def __exit__(self, exc_type: type, exc_val: BaseException,\n exc_tb: TracebackType) -> bool:\n self._exited_with = exc_type, exc_val, exc_tb\n if self._raise_in_exit:\n self._raised = True\n raise IOError(\"Cannot close\")\n return self._suppress_at_exit", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestCopyFile.tearDown_TestCopyFile.test_w_source_open_fails.self_assertRaises_IOError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestCopyFile.tearDown_TestCopyFile.test_w_source_open_fails.self_assertRaises_IOError", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_shutil.py", "file_name": "test_shutil.py", "file_type": "text/x-python", "category": "test", "start_line": 875, "end_line": 890, "span_ids": ["TestCopyFile.tearDown", "TestCopyFile.test_w_source_open_fails", "TestCopyFile._set_shutil_open"], "tokens": 140}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCopyFile(unittest.TestCase):\n\n def tearDown(self) -> None:\n shutil.open = open\n\n def _set_shutil_open(self, func: Any) -> None:\n shutil.open = func\n self._delete = True\n\n def test_w_source_open_fails(self) -> None:\n def _open(filename: str, mode: str= 'r') -> BinaryIO:\n if filename == 'srcfile':\n raise IOError('Cannot open \"srcfile\"')\n assert 0 # shouldn't reach here.\n\n self._set_shutil_open(_open)\n\n self.assertRaises(IOError, shutil.copyfile, 'srcfile', 'destfile')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestCopyFile.test_w_dest_open_fails_TestCopyFile.test_w_dest_open_fails.self_assertEqual_srcfile_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestCopyFile.test_w_dest_open_fails_TestCopyFile.test_w_dest_open_fails.self_assertEqual_srcfile_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_shutil.py", "file_name": "test_shutil.py", "file_type": "text/x-python", "category": "test", "start_line": 892, "end_line": 909, "span_ids": ["TestCopyFile.test_w_dest_open_fails"], "tokens": 163}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCopyFile(unittest.TestCase):\n\n def test_w_dest_open_fails(self) -> None:\n\n srcfile = TestCopyFile.Faux()\n\n def _open(filename: str, mode: str = 'r') -> TestCopyFile.Faux:\n if filename == 'srcfile':\n return srcfile\n if filename == 'destfile':\n raise IOError('Cannot open \"destfile\"')\n assert 0 # shouldn't reach here.\n\n self._set_shutil_open(_open)\n\n shutil.copyfile('srcfile', 'destfile')\n self.assertTrue(srcfile._entered)\n self.assertTrue(srcfile._exited_with[0] is IOError)\n self.assertEqual(srcfile._exited_with[1].args,\n ('Cannot open \"destfile\"',))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestCopyFile.test_w_dest_close_fails_TestCopyFile.test_w_dest_close_fails.self_assertEqual_srcfile_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestCopyFile.test_w_dest_close_fails_TestCopyFile.test_w_dest_close_fails.self_assertEqual_srcfile_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_shutil.py", "file_name": "test_shutil.py", "file_type": "text/x-python", "category": "test", "start_line": 911, "end_line": 931, "span_ids": ["TestCopyFile.test_w_dest_close_fails"], "tokens": 181}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCopyFile(unittest.TestCase):\n\n def test_w_dest_close_fails(self) -> None:\n\n srcfile = TestCopyFile.Faux()\n destfile = TestCopyFile.Faux(True)\n\n def _open(filename: str, mode: str = 'r') -> TestCopyFile.Faux:\n if filename == 'srcfile':\n return srcfile\n if filename == 'destfile':\n return destfile\n assert 0 # shouldn't reach here.\n\n self._set_shutil_open(_open)\n\n shutil.copyfile('srcfile', 'destfile')\n self.assertTrue(srcfile._entered)\n self.assertTrue(destfile._entered)\n self.assertTrue(destfile._raised)\n self.assertTrue(srcfile._exited_with[0] is IOError)\n self.assertEqual(srcfile._exited_with[1].args,\n ('Cannot close',))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestCopyFile.test_w_source_close_fails_TestCopyFile.test_w_source_close_fails.None_6": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestCopyFile.test_w_source_close_fails_TestCopyFile.test_w_source_close_fails.None_6", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_shutil.py", "file_name": "test_shutil.py", "file_type": "text/x-python", "category": "test", "start_line": 933, "end_line": 953, "span_ids": ["TestCopyFile.test_w_source_close_fails"], "tokens": 176}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCopyFile(unittest.TestCase):\n\n def test_w_source_close_fails(self) -> None:\n\n srcfile = TestCopyFile.Faux(True)\n destfile = TestCopyFile.Faux()\n\n def _open(filename: str, mode: str= 'r') -> TestCopyFile.Faux:\n if filename == 'srcfile':\n return srcfile\n if filename == 'destfile':\n return destfile\n assert 0 # shouldn't reach here.\n\n self._set_shutil_open(_open)\n\n self.assertRaises(IOError,\n shutil.copyfile, 'srcfile', 'destfile')\n self.assertTrue(srcfile._entered)\n self.assertTrue(destfile._entered)\n self.assertFalse(destfile._raised)\n self.assertTrue(srcfile._exited_with[0] is None)\n self.assertTrue(srcfile._raised)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestCopyFile.test_move_dir_caseinsensitive_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_shutil.py_TestCopyFile.test_move_dir_caseinsensitive_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_shutil.py", "file_name": "test_shutil.py", "file_type": "text/x-python", "category": "test", "start_line": 955, "end_line": 979, "span_ids": ["impl:9", "TestCopyFile.test_move_dir_caseinsensitive", "test_main"], "tokens": 160}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestCopyFile(unittest.TestCase):\n\n def test_move_dir_caseinsensitive(self) -> None:\n # Renames a folder to the same name\n # but a different case.\n\n self.src_dir = tempfile.mkdtemp()\n dst_dir = os.path.join(\n os.path.dirname(self.src_dir),\n os.path.basename(self.src_dir).upper())\n self.assertNotEqual(self.src_dir, dst_dir)\n\n try:\n shutil.move(self.src_dir, dst_dir)\n self.assertTrue(os.path.isdir(dst_dir))\n finally:\n if os.path.exists(dst_dir):\n os.rmdir(dst_dir)\n\n\n\ndef test_main() -> None:\n support.run_unittest(TestShutil, TestMove, TestCopyFile)\n\nif __name__ == '__main__':\n test_main()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py__tempfile_py_unit_tests__if_sys_platform_in_open.else_.TEST_FILES.100": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py__tempfile_py_unit_tests__if_sys_platform_in_open.else_.TEST_FILES.100", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_tempfile.py", "file_name": "test_tempfile.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 29, "span_ids": ["docstring"], "tokens": 164}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# tempfile.py unit tests.\nimport tempfile\nimport os\nimport signal\nimport sys\nimport re\nimport warnings\n\nimport unittest\nfrom test import support\n\nfrom typing import Any, AnyStr, List, Dict, IO\n\n\nif hasattr(os, 'stat'):\n import stat\n has_stat = 1\nelse:\n has_stat = 0\n\nhas_textmode = (tempfile._text_openflags != tempfile._bin_openflags)\nhas_spawnl = hasattr(os, 'spawnl')\n\n# TEST_FILES may need to be tweaked for systems depending on the maximum\n# number of files that can be opened at one time (see ulimit -n)\nif sys.platform in ('openbsd3', 'openbsd4'):\n TEST_FILES = 48\nelse:\n TEST_FILES = 100", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py__This_is_organized_as_on_TC.failOnException.self_fail_s_raised_s_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py__This_is_organized_as_on_TC.failOnException.self_fail_s_raised_s_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_tempfile.py", "file_name": "test_tempfile.py", "file_type": "text/x-python", "category": "test", "start_line": 31, "end_line": 53, "span_ids": ["TC.failOnException", "TC.tearDown", "TC", "docstring", "TC.setUp"], "tokens": 193}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# This is organized as one test for each chunk of code in tempfile.py,\n# in order of their appearance in the file. Testing which requires\n# threads is not done here.\n\n# Common functionality.\nclass TC(unittest.TestCase):\n\n str_check = re.compile(r\"[a-zA-Z0-9_-]{6}$\")\n\n def setUp(self) -> None:\n self._warnings_manager = support.check_warnings()\n self._warnings_manager.__enter__()\n warnings.filterwarnings(\"ignore\", category=RuntimeWarning,\n message=\"mktemp\", module=__name__)\n\n def tearDown(self) -> None:\n self._warnings_manager.__exit__(None, None, None)\n\n\n def failOnException(self, what: str, ei: tuple = None) -> None:\n if ei is None:\n ei = sys.exc_info()\n self.fail(\"%s raised %s: %s\" % (what, ei[0], ei[1]))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_TC.nameCheck_test_classes._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_TC.nameCheck_test_classes._", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_tempfile.py", "file_name": "test_tempfile.py", "file_type": "text/x-python", "category": "test", "start_line": 55, "end_line": 73, "span_ids": ["TC.nameCheck", "impl:17"], "tokens": 227}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TC(unittest.TestCase):\n\n def nameCheck(self, name: str, dir: str, pre: str, suf: str) -> None:\n (ndir, nbase) = os.path.split(name)\n npre = nbase[:len(pre)]\n nsuf = nbase[len(nbase)-len(suf):]\n\n # check for equality of the absolute paths!\n self.assertEqual(os.path.abspath(ndir), os.path.abspath(dir),\n \"file '%s' not in directory '%s'\" % (name, dir))\n self.assertEqual(npre, pre,\n \"file '%s' does not begin with '%s'\" % (nbase, pre))\n self.assertEqual(nsuf, suf,\n \"file '%s' does not end with '%s'\" % (nbase, suf))\n\n nbase = nbase[len(pre):len(nbase)-len(suf)]\n self.assertTrue(self.str_check.match(nbase),\n \"random string '%s' does not match /^[a-zA-Z0-9_-]{6}$/\"\n % nbase)\n\ntest_classes = []", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py__type_List_type__test_exports.test_exports.self_assertTrue_len_unexp": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py__type_List_type__test_exports.test_exports.self_assertTrue_len_unexp", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_tempfile.py", "file_name": "test_tempfile.py", "file_type": "text/x-python", "category": "test", "start_line": 73, "end_line": 100, "span_ids": ["test_exports", "impl:17", "test_exports.test_exports"], "tokens": 222}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": " # type: List[type]\n\nclass test_exports(TC):\n def test_exports(self) -> None:\n # There are no surprising symbols in the tempfile module\n dict = tempfile.__dict__\n\n expected = {\n \"NamedTemporaryFile\" : 1,\n \"TemporaryFile\" : 1,\n \"mkstemp\" : 1,\n \"mkdtemp\" : 1,\n \"mktemp\" : 1,\n \"TMP_MAX\" : 1,\n \"gettempprefix\" : 1,\n \"gettempdir\" : 1,\n \"tempdir\" : 1,\n \"template\" : 1,\n \"SpooledTemporaryFile\" : 1,\n \"TemporaryDirectory\" : 1,\n }\n\n unexp = [] # type: List[str]\n for key in dict:\n if key[0] != '_' and key not in expected:\n unexp.append(key)\n self.assertTrue(len(unexp) == 0,\n \"unexpected keys: %s\" % unexp)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_classes_append_test__test__RandomNameSequence.supports_iter.try_.except_.self_failOnException_ite": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_classes_append_test__test__RandomNameSequence.supports_iter.try_.except_.self_failOnException_ite", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_tempfile.py", "file_name": "test_tempfile.py", "file_type": "text/x-python", "category": "test", "start_line": 102, "end_line": 139, "span_ids": ["test__RandomNameSequence", "test__RandomNameSequence.setUp", "test__RandomNameSequence.test_get_six_char_str", "test__RandomNameSequence.supports_iter", "test__RandomNameSequence.test_many", "impl:19"], "tokens": 240}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "test_classes.append(test_exports)\n\n\nclass test__RandomNameSequence(TC):\n \"\"\"Test the internal iterator object _RandomNameSequence.\"\"\"\n\n def setUp(self) -> None:\n self.r = tempfile._RandomNameSequence()\n super().setUp()\n\n def test_get_six_char_str(self) -> None:\n # _RandomNameSequence returns a six-character string\n s = next(self.r)\n self.nameCheck(s, '', '', '')\n\n def test_many(self) -> None:\n # _RandomNameSequence returns no duplicate strings (stochastic)\n\n dict = {} # type: Dict[str, int]\n r = self.r\n for i in range(TEST_FILES):\n s = next(r)\n self.nameCheck(s, '', '', '')\n self.assertNotIn(s, dict)\n dict[s] = 1\n\n def supports_iter(self) -> None:\n # _RandomNameSequence supports the iterator protocol\n\n i = 0\n r = self.r\n try:\n for s in r:\n i += 1\n if i == 20:\n break\n except:\n self.failOnException(\"iteration\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test__RandomNameSequence.test_process_awareness_None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test__RandomNameSequence.test_process_awareness_None_1", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_tempfile.py", "file_name": "test_tempfile.py", "file_type": "text/x-python", "category": "test", "start_line": 141, "end_line": 172, "span_ids": ["impl:20", "test__RandomNameSequence.test_process_awareness"], "tokens": 248}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class test__RandomNameSequence(TC):\n\n @unittest.skipUnless(hasattr(os, 'fork'),\n \"os.fork is required for this test\")\n def test_process_awareness(self) -> None:\n # ensure that the random source differs between\n # child and parent.\n read_fd, write_fd = os.pipe()\n pid = None # type: int\n try:\n pid = os.fork()\n if not pid:\n os.close(read_fd)\n os.write(write_fd, next(self.r).encode(\"ascii\"))\n os.close(write_fd)\n # bypass the normal exit handlers- leave those to\n # the parent.\n os._exit(0)\n parent_value = next(self.r)\n child_value = os.read(read_fd, len(parent_value)).decode(\"ascii\")\n finally:\n if pid:\n # best effort to ensure the process can't bleed out\n # via any bugs above\n try:\n os.kill(pid, signal.SIGKILL)\n except EnvironmentError:\n pass\n os.close(read_fd)\n os.close(write_fd)\n self.assertNotEqual(child_value, parent_value)\n\n\ntest_classes.append(test__RandomNameSequence)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test__candidate_tempdir_list_test__candidate_tempdir_list.test_wanted_dirs.with_support_EnvironmentV._paths_in_this_list_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test__candidate_tempdir_list_test__candidate_tempdir_list.test_wanted_dirs.with_support_EnvironmentV._paths_in_this_list_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_tempfile.py", "file_name": "test_tempfile.py", "file_type": "text/x-python", "category": "test", "start_line": 175, "end_line": 212, "span_ids": ["test__candidate_tempdir_list.test_wanted_dirs", "test__candidate_tempdir_list", "test__candidate_tempdir_list.test_nonempty_list"], "tokens": 269}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class test__candidate_tempdir_list(TC):\n \"\"\"Test the internal function _candidate_tempdir_list.\"\"\"\n\n def test_nonempty_list(self) -> None:\n # _candidate_tempdir_list returns a nonempty list of strings\n\n cand = tempfile._candidate_tempdir_list()\n\n self.assertFalse(len(cand) == 0)\n for c in cand:\n self.assertIsInstance(c, str)\n\n def test_wanted_dirs(self) -> None:\n # _candidate_tempdir_list contains the expected directories\n\n # Make sure the interesting environment variables are all set.\n with support.EnvironmentVarGuard() as env:\n for envname in 'TMPDIR', 'TEMP', 'TMP':\n dirname = os.getenv(envname)\n if not dirname:\n env[envname] = os.path.abspath(envname)\n\n cand = tempfile._candidate_tempdir_list()\n\n for envname in 'TMPDIR', 'TEMP', 'TMP':\n dirname = os.getenv(envname)\n if not dirname: raise ValueError\n self.assertIn(dirname, cand)\n\n try:\n dirname = os.getcwd()\n except (AttributeError, os.error):\n dirname = os.curdir\n\n self.assertIn(dirname, cand)\n\n # Not practical to try to verify the presence of OS-specific\n # paths in this list.", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_None_2_None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_None_2_None_3", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_tempfile.py", "file_name": "test_tempfile.py", "file_type": "text/x-python", "category": "test", "start_line": 214, "end_line": 235, "span_ids": ["impl:21", "test__get_candidate_names.test_same_thing", "test__get_candidate_names", "impl:23", "test__get_candidate_names.test_retval"], "tokens": 145}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "test_classes.append(test__candidate_tempdir_list)\n\n\n# We test _get_default_tempdir by testing gettempdir.\n\n\nclass test__get_candidate_names(TC):\n \"\"\"Test the internal function _get_candidate_names.\"\"\"\n\n def test_retval(self) -> None:\n # _get_candidate_names returns a _RandomNameSequence object\n obj = tempfile._get_candidate_names()\n self.assertIsInstance(obj, tempfile._RandomNameSequence)\n\n def test_same_thing(self) -> None:\n # _get_candidate_names always returns the same object\n a = tempfile._get_candidate_names()\n b = tempfile._get_candidate_names()\n\n self.assertTrue(a is b)\n\ntest_classes.append(test__get_candidate_names)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test__mkstemp_inner_test__mkstemp_inner.mkstemped.__del__.self__unlink_self_name_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test__mkstemp_inner_test__mkstemp_inner.mkstemped.__del__.self__unlink_self_name_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_tempfile.py", "file_name": "test_tempfile.py", "file_type": "text/x-python", "category": "test", "start_line": 238, "end_line": 259, "span_ids": ["test__mkstemp_inner.mkstemped.write", "test__mkstemp_inner", "test__mkstemp_inner.mkstemped", "test__mkstemp_inner.mkstemped.__del__", "test__mkstemp_inner.mkstemped.__init__"], "tokens": 182}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class test__mkstemp_inner(TC):\n \"\"\"Test the internal function _mkstemp_inner.\"\"\"\n\n class mkstemped:\n _bflags = tempfile._bin_openflags\n _tflags = tempfile._text_openflags\n\n def __init__(self, dir: str, pre: str, suf: str, bin: int) -> None:\n if bin: flags = self._bflags\n else: flags = self._tflags\n\n (self.fd, self.name) = tempfile._mkstemp_inner(dir, pre, suf, flags)\n\n self._close = os.close\n self._unlink = os.unlink\n\n def write(self, str: bytes) -> None:\n os.write(self.fd, str)\n\n def __del__(self) -> None:\n self._close(self.fd)\n self._unlink(self.name)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test__mkstemp_inner.do_create_test__mkstemp_inner.test_choose_directory.try_.finally_.os_rmdir_dir_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test__mkstemp_inner.do_create_test__mkstemp_inner.test_choose_directory.try_.finally_.os_rmdir_dir_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_tempfile.py", "file_name": "test_tempfile.py", "file_type": "text/x-python", "category": "test", "start_line": 261, "end_line": 293, "span_ids": ["test__mkstemp_inner.test_basic_many", "test__mkstemp_inner.test_basic", "test__mkstemp_inner.test_choose_directory", "test__mkstemp_inner.do_create"], "tokens": 337}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class test__mkstemp_inner(TC):\n\n def do_create(self, dir: str = None, pre: str = \"\", suf: str= \"\",\n bin: int = 1) -> mkstemped:\n if dir is None:\n dir = tempfile.gettempdir()\n try:\n file = test__mkstemp_inner.mkstemped(dir, pre, suf, bin) # see #259\n except:\n self.failOnException(\"_mkstemp_inner\")\n\n self.nameCheck(file.name, dir, pre, suf)\n return file\n\n def test_basic(self) -> None:\n # _mkstemp_inner can create files\n self.do_create().write(b\"blat\")\n self.do_create(pre=\"a\").write(b\"blat\")\n self.do_create(suf=\"b\").write(b\"blat\")\n self.do_create(pre=\"a\", suf=\"b\").write(b\"blat\")\n self.do_create(pre=\"aa\", suf=\".txt\").write(b\"blat\")\n\n def test_basic_many(self) -> None:\n # _mkstemp_inner can create many files (stochastic)\n extant = list(range(TEST_FILES)) # type: List[Any]\n for i in extant:\n extant[i] = self.do_create(pre=\"aa\")\n\n def test_choose_directory(self) -> None:\n # _mkstemp_inner can create files in a user-selected directory\n dir = tempfile.mkdtemp()\n try:\n self.do_create(dir=dir).write(b\"blat\")\n finally:\n os.rmdir(dir)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test__mkstemp_inner.test_file_mode_test__mkstemp_inner.test_file_mode.self_assertEqual_mode_ex": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test__mkstemp_inner.test_file_mode_test__mkstemp_inner.test_file_mode.self_assertEqual_mode_ex", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_tempfile.py", "file_name": "test_tempfile.py", "file_type": "text/x-python", "category": "test", "start_line": 295, "end_line": 308, "span_ids": ["test__mkstemp_inner.test_file_mode"], "tokens": 153}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class test__mkstemp_inner(TC):\n\n def test_file_mode(self) -> None:\n # _mkstemp_inner creates files with the proper mode\n if not has_stat:\n return # ugh, can't use SkipTest.\n\n file = self.do_create()\n mode = stat.S_IMODE(os.stat(file.name).st_mode)\n expected = 0o600\n if sys.platform in ('win32', 'os2emx'):\n # There's no distinction among 'user', 'group' and 'world';\n # replicate the 'user' bits.\n user = expected >> 6\n expected = user * (1 + 8 + 64)\n self.assertEqual(mode, expected)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test__mkstemp_inner.test_noinherit_test__mkstemp_inner.test_noinherit.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test__mkstemp_inner.test_noinherit_test__mkstemp_inner.test_noinherit.None_1", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_tempfile.py", "file_name": "test_tempfile.py", "file_type": "text/x-python", "category": "test", "start_line": 310, "end_line": 346, "span_ids": ["test__mkstemp_inner.test_noinherit"], "tokens": 326}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class test__mkstemp_inner(TC):\n\n def test_noinherit(self) -> None:\n # _mkstemp_inner file handles are not inherited by child processes\n if not has_spawnl:\n return # ugh, can't use SkipTest.\n\n if support.verbose:\n v=\"v\"\n else:\n v=\"q\"\n\n file = self.do_create()\n fd = \"%d\" % file.fd\n\n try:\n me = __file__ # type: str\n except NameError:\n me = sys.argv[0]\n\n # We have to exec something, so that FD_CLOEXEC will take\n # effect. The core of this test is therefore in\n # tf_inherit_check.py, which see.\n tester = os.path.join(os.path.dirname(os.path.abspath(me)),\n \"tf_inherit_check.py\")\n\n # On Windows a spawn* /path/ with embedded spaces shouldn't be quoted,\n # but an arg with embedded spaces should be decorated with double\n # quotes on each end\n if sys.platform in ('win32',):\n decorated = '\"%s\"' % sys.executable\n tester = '\"%s\"' % tester\n else:\n decorated = sys.executable\n\n retval = os.spawnl(os.P_WAIT, sys.executable, decorated, tester, v, fd)\n self.assertFalse(retval < 0,\n \"child process caught fatal signal %d\" % -retval)\n self.assertFalse(retval > 0, \"child process reports failure %d\"%retval)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test__mkstemp_inner.test_textmode_None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test__mkstemp_inner.test_textmode_None_4", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_tempfile.py", "file_name": "test_tempfile.py", "file_type": "text/x-python", "category": "test", "start_line": 348, "end_line": 360, "span_ids": ["impl:24", "test__mkstemp_inner.test_textmode"], "tokens": 139}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class test__mkstemp_inner(TC):\n\n def test_textmode(self) -> None:\n # _mkstemp_inner can create files in text mode\n if not has_textmode:\n return # ugh, can't use SkipTest.\n\n # A text file is truncated at the first Ctrl+Z byte\n f = self.do_create(bin=0)\n f.write(b\"blat\\x1a\")\n f.write(b\"extra\\n\")\n os.lseek(f.fd, 0, os.SEEK_SET)\n self.assertEqual(os.read(f.fd, 20), b\"blat\")\n\ntest_classes.append(test__mkstemp_inner)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_gettempprefix_None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_gettempprefix_None_5", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_tempfile.py", "file_name": "test_tempfile.py", "file_type": "text/x-python", "category": "test", "start_line": 363, "end_line": 392, "span_ids": ["test_gettempprefix.test_usable_template", "test_gettempprefix.test_sane_template", "test_gettempprefix", "impl:25"], "tokens": 224}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class test_gettempprefix(TC):\n \"\"\"Test gettempprefix().\"\"\"\n\n def test_sane_template(self) -> None:\n # gettempprefix returns a nonempty prefix string\n p = tempfile.gettempprefix()\n\n self.assertIsInstance(p, str)\n self.assertTrue(len(p) > 0)\n\n def test_usable_template(self) -> None:\n # gettempprefix returns a usable prefix string\n\n # Create a temp directory, avoiding use of the prefix.\n # Then attempt to create a file whose name is\n # prefix + 'xxxxxx.xxx' in that directory.\n p = tempfile.gettempprefix() + \"xxxxxx.xxx\"\n d = tempfile.mkdtemp(prefix=\"\")\n try:\n p = os.path.join(d, p)\n try:\n fd = os.open(p, os.O_RDWR | os.O_CREAT)\n except:\n self.failOnException(\"os.open\")\n os.close(fd)\n os.unlink(p)\n finally:\n os.rmdir(d)\n\ntest_classes.append(test_gettempprefix)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_gettempdir_test_gettempdir.test_same_thing.self_assertTrue_a_is_b_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_gettempdir_test_gettempdir.test_same_thing.self_assertTrue_a_is_b_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_tempfile.py", "file_name": "test_tempfile.py", "file_type": "text/x-python", "category": "test", "start_line": 395, "end_line": 425, "span_ids": ["test_gettempdir", "test_gettempdir.test_directory_writable", "test_gettempdir.test_same_thing", "test_gettempdir.test_directory_exists"], "tokens": 236}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class test_gettempdir(TC):\n \"\"\"Test gettempdir().\"\"\"\n\n def test_directory_exists(self) -> None:\n # gettempdir returns a directory which exists\n\n dir = tempfile.gettempdir()\n self.assertTrue(os.path.isabs(dir) or dir == os.curdir,\n \"%s is not an absolute path\" % dir)\n self.assertTrue(os.path.isdir(dir),\n \"%s is not a directory\" % dir)\n\n def test_directory_writable(self) -> None:\n # gettempdir returns a directory writable by the user\n\n # sneaky: just instantiate a NamedTemporaryFile, which\n # defaults to writing into the directory returned by\n # gettempdir.\n try:\n file = tempfile.NamedTemporaryFile()\n file.write(b\"blat\")\n file.close()\n except:\n self.failOnException(\"create file in %s\" % tempfile.gettempdir())\n\n def test_same_thing(self) -> None:\n # gettempdir always returns the same object\n a = tempfile.gettempdir()\n b = tempfile.gettempdir()\n\n self.assertTrue(a is b)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_None_6_test_mkstemp.do_create.None_1.finally_.os_unlink_name_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_None_6_test_mkstemp.do_create.None_1.finally_.os_unlink_name_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_tempfile.py", "file_name": "test_tempfile.py", "file_type": "text/x-python", "category": "test", "start_line": 427, "end_line": 449, "span_ids": ["test_mkstemp", "test_mkstemp.do_create", "impl:26"], "tokens": 181}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "test_classes.append(test_gettempdir)\n\n\nclass test_mkstemp(TC):\n \"\"\"Test mkstemp().\"\"\"\n\n def do_create(self, dir: str = None, pre: str = \"\", suf: str = \"\") -> None:\n if dir is None:\n dir = tempfile.gettempdir()\n try:\n (fd, name) = tempfile.mkstemp(dir=dir, prefix=pre, suffix=suf)\n (ndir, nbase) = os.path.split(name)\n adir = os.path.abspath(dir)\n self.assertEqual(adir, ndir,\n \"Directory '%s' incorrectly returned as '%s'\" % (adir, ndir))\n except:\n self.failOnException(\"mkstemp\")\n\n try:\n self.nameCheck(name, dir, pre, suf)\n finally:\n os.close(fd)\n os.unlink(name)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_mkstemp.test_basic_None_7": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_mkstemp.test_basic_None_7", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_tempfile.py", "file_name": "test_tempfile.py", "file_type": "text/x-python", "category": "test", "start_line": 451, "end_line": 468, "span_ids": ["test_mkstemp.test_basic", "impl:27", "test_mkstemp.test_choose_directory"], "tokens": 139}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class test_mkstemp(TC):\n\n def test_basic(self) -> None:\n # mkstemp can create files\n self.do_create()\n self.do_create(pre=\"a\")\n self.do_create(suf=\"b\")\n self.do_create(pre=\"a\", suf=\"b\")\n self.do_create(pre=\"aa\", suf=\".txt\")\n self.do_create(dir=\".\")\n\n def test_choose_directory(self) -> None:\n # mkstemp can create directories in a user-selected directory\n dir = tempfile.mkdtemp()\n try:\n self.do_create(dir=dir)\n finally:\n os.rmdir(dir)\n\ntest_classes.append(test_mkstemp)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_mkdtemp_test_mkdtemp.test_choose_directory.try_.finally_.os_rmdir_dir_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_mkdtemp_test_mkdtemp.test_choose_directory.try_.finally_.os_rmdir_dir_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_tempfile.py", "file_name": "test_tempfile.py", "file_type": "text/x-python", "category": "test", "start_line": 471, "end_line": 514, "span_ids": ["test_mkdtemp.do_create", "test_mkdtemp.test_basic_many", "test_mkdtemp.test_basic", "test_mkdtemp", "test_mkdtemp.test_choose_directory"], "tokens": 340}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class test_mkdtemp(TC):\n \"\"\"Test mkdtemp().\"\"\"\n\n def do_create(self, dir: str = None, pre: str = \"\", suf: str = \"\") -> str:\n if dir is None:\n dir = tempfile.gettempdir()\n try:\n name = tempfile.mkdtemp(dir=dir, prefix=pre, suffix=suf)\n except:\n self.failOnException(\"mkdtemp\")\n\n try:\n self.nameCheck(name, dir, pre, suf)\n return name\n except:\n os.rmdir(name)\n raise\n\n def test_basic(self) -> None:\n # mkdtemp can create directories\n os.rmdir(self.do_create())\n os.rmdir(self.do_create(pre=\"a\"))\n os.rmdir(self.do_create(suf=\"b\"))\n os.rmdir(self.do_create(pre=\"a\", suf=\"b\"))\n os.rmdir(self.do_create(pre=\"aa\", suf=\".txt\"))\n\n def test_basic_many(self) -> None:\n # mkdtemp can create many directories (stochastic)\n extant = list(range(TEST_FILES)) # type: List[Any]\n try:\n for i in extant:\n extant[i] = self.do_create(pre=\"aa\")\n finally:\n for i in extant:\n if(isinstance(i, str)):\n os.rmdir(i)\n\n def test_choose_directory(self) -> None:\n # mkdtemp can create directories in a user-selected directory\n dir = tempfile.mkdtemp()\n try:\n os.rmdir(self.do_create(dir=dir))\n finally:\n os.rmdir(dir)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_mkdtemp.test_mode_None_8": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_mkdtemp.test_mode_None_8", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_tempfile.py", "file_name": "test_tempfile.py", "file_type": "text/x-python", "category": "test", "start_line": 516, "end_line": 535, "span_ids": ["test_mkdtemp.test_mode", "impl:28"], "tokens": 184}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class test_mkdtemp(TC):\n\n def test_mode(self) -> None:\n # mkdtemp creates directories with the proper mode\n if not has_stat:\n return # ugh, can't use SkipTest.\n\n dir = self.do_create()\n try:\n mode = stat.S_IMODE(os.stat(dir).st_mode)\n mode &= 0o777 # Mask off sticky bits inherited from /tmp\n expected = 0o700\n if sys.platform in ('win32', 'os2emx'):\n # There's no distinction among 'user', 'group' and 'world';\n # replicate the 'user' bits.\n user = expected >> 6\n expected = user * (1 + 8 + 64)\n self.assertEqual(mode, expected)\n finally:\n os.rmdir(dir)\n\ntest_classes.append(test_mkdtemp)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_mktemp_test_mktemp.mktemped.__del__.self__unlink_self_name_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_mktemp_test_mktemp.mktemped.__del__.self__unlink_self_name_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_tempfile.py", "file_name": "test_tempfile.py", "file_type": "text/x-python", "category": "test", "start_line": 538, "end_line": 566, "span_ids": ["test_mktemp.mktemped", "test_mktemp.mktemped:2", "test_mktemp.mktemped.__del__", "test_mktemp.mktemped._unlink", "test_mktemp", "test_mktemp.tearDown", "test_mktemp.mktemped.__init__", "test_mktemp.setUp"], "tokens": 232}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class test_mktemp(TC):\n \"\"\"Test mktemp().\"\"\"\n\n # For safety, all use of mktemp must occur in a private directory.\n # We must also suppress the RuntimeWarning it generates.\n def setUp(self) -> None:\n self.dir = tempfile.mkdtemp()\n super().setUp()\n\n def tearDown(self) -> None:\n if self.dir:\n os.rmdir(self.dir)\n self.dir = None\n super().tearDown()\n\n class mktemped:\n def _unlink(self, path: str) -> None:\n os.unlink(path)\n\n _bflags = tempfile._bin_openflags\n\n def __init__(self, dir: str, pre: str, suf: str) -> None:\n self.name = tempfile.mktemp(dir=dir, prefix=pre, suffix=suf)\n # Create the file. This will raise an exception if it's\n # mysteriously appeared in the meanwhile.\n os.close(os.open(self.name, self._bflags, 0o600))\n\n def __del__(self) -> None:\n self._unlink(self.name)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_mktemp.do_create_None_9": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_mktemp.do_create_None_9", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_tempfile.py", "file_name": "test_tempfile.py", "file_type": "text/x-python", "category": "test", "start_line": 568, "end_line": 599, "span_ids": ["impl:29", "test_mktemp.do_create", "test_mktemp.test_basic", "test_mktemp.test_many"], "tokens": 270}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class test_mktemp(TC):\n\n def do_create(self, pre: str = \"\", suf: str = \"\") -> mktemped:\n try:\n file = test_mktemp.mktemped(self.dir, pre, suf) # see #259\n except:\n self.failOnException(\"mktemp\")\n\n self.nameCheck(file.name, self.dir, pre, suf)\n return file\n\n def test_basic(self) -> None:\n # mktemp can choose usable file names\n self.do_create()\n self.do_create(pre=\"a\")\n self.do_create(suf=\"b\")\n self.do_create(pre=\"a\", suf=\"b\")\n self.do_create(pre=\"aa\", suf=\".txt\")\n\n def test_many(self) -> None:\n # mktemp can choose many usable file names (stochastic)\n extant = list(range(TEST_FILES)) # type: List[Any]\n for i in extant:\n extant[i] = self.do_create(pre=\"aa\")\n\n## def test_warning(self):\n## # mktemp issues a warning when used\n## warnings.filterwarnings(\"error\",\n## category=RuntimeWarning,\n## message=\"mktemp\")\n## self.assertRaises(RuntimeWarning,\n## tempfile.mktemp, dir=self.dir)\n\ntest_classes.append(test_mktemp)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py__We_test__TemporaryFileW_test_NamedTemporaryFile.test_del_on_close.try_.finally_.os_rmdir_dir_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py__We_test__TemporaryFileW_test_NamedTemporaryFile.test_del_on_close.try_.finally_.os_rmdir_dir_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_tempfile.py", "file_name": "test_tempfile.py", "file_type": "text/x-python", "category": "test", "start_line": 602, "end_line": 646, "span_ids": ["test_NamedTemporaryFile", "impl:29", "test_NamedTemporaryFile.do_create", "test_NamedTemporaryFile.test_del_on_close", "test_NamedTemporaryFile.test_creates_named", "test_NamedTemporaryFile.test_basic"], "tokens": 340}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# We test _TemporaryFileWrapper by testing NamedTemporaryFile.\n\n\nclass test_NamedTemporaryFile(TC):\n \"\"\"Test NamedTemporaryFile().\"\"\"\n\n def do_create(self, dir: str = None, pre: str = \"\", suf: str = \"\",\n delete: bool = True) -> IO[Any]:\n if dir is None:\n dir = tempfile.gettempdir()\n try:\n file = tempfile.NamedTemporaryFile(dir=dir, prefix=pre, suffix=suf,\n delete=delete)\n except:\n self.failOnException(\"NamedTemporaryFile\")\n\n self.nameCheck(file.name, dir, pre, suf)\n return file\n\n\n def test_basic(self) -> None:\n # NamedTemporaryFile can create files\n self.do_create()\n self.do_create(pre=\"a\")\n self.do_create(suf=\"b\")\n self.do_create(pre=\"a\", suf=\"b\")\n self.do_create(pre=\"aa\", suf=\".txt\")\n\n def test_creates_named(self) -> None:\n # NamedTemporaryFile creates files with names\n f = tempfile.NamedTemporaryFile()\n self.assertTrue(os.path.exists(f.name),\n \"NamedTemporaryFile %s does not exist\" % f.name)\n\n def test_del_on_close(self) -> None:\n # A NamedTemporaryFile is deleted when closed\n dir = tempfile.mkdtemp()\n try:\n f = tempfile.NamedTemporaryFile(dir=dir)\n f.write(b'blat')\n f.close()\n self.assertFalse(os.path.exists(f.name),\n \"NamedTemporaryFile %s exists after close\" % f.name)\n finally:\n os.rmdir(dir)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_NamedTemporaryFile.test_dis_del_on_close_test_NamedTemporaryFile.test_dis_del_on_close.try_.finally_.os_rmdir_dir_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_NamedTemporaryFile.test_dis_del_on_close_test_NamedTemporaryFile.test_dis_del_on_close.try_.finally_.os_rmdir_dir_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_tempfile.py", "file_name": "test_tempfile.py", "file_type": "text/x-python", "category": "test", "start_line": 648, "end_line": 662, "span_ids": ["test_NamedTemporaryFile.test_dis_del_on_close"], "tokens": 129}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class test_NamedTemporaryFile(TC):\n\n def test_dis_del_on_close(self) -> None:\n # Tests that delete-on-close can be disabled\n dir = tempfile.mkdtemp()\n tmp = None # type: str\n try:\n f = tempfile.NamedTemporaryFile(dir=dir, delete=False)\n tmp = f.name\n f.write(b'blat')\n f.close()\n self.assertTrue(os.path.exists(f.name),\n \"NamedTemporaryFile %s missing after close\" % f.name)\n finally:\n if tmp is not None:\n os.unlink(tmp)\n os.rmdir(dir)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_NamedTemporaryFile.test_multiple_close_None_10": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_NamedTemporaryFile.test_multiple_close_None_10", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_tempfile.py", "file_name": "test_tempfile.py", "file_type": "text/x-python", "category": "test", "start_line": 664, "end_line": 687, "span_ids": ["test_NamedTemporaryFile.test_multiple_close", "impl:31", "test_NamedTemporaryFile.test_context_manager"], "tokens": 167}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class test_NamedTemporaryFile(TC):\n\n def test_multiple_close(self) -> None:\n # A NamedTemporaryFile can be closed many times without error\n f = tempfile.NamedTemporaryFile()\n f.write(b'abc\\n')\n f.close()\n try:\n f.close()\n f.close()\n except:\n self.failOnException(\"close\")\n\n def test_context_manager(self) -> None:\n # A NamedTemporaryFile can be used as a context manager\n with tempfile.NamedTemporaryFile() as f:\n self.assertTrue(os.path.exists(f.name))\n self.assertFalse(os.path.exists(f.name))\n def use_closed():\n with f:\n pass\n self.assertRaises(ValueError, use_closed)\n\n # How to test the mode and bufsize parameters?\n\ntest_classes.append(test_NamedTemporaryFile)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_SpooledTemporaryFile_test_SpooledTemporaryFile.test_basic.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_SpooledTemporaryFile_test_SpooledTemporaryFile.test_basic.None_1", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_tempfile.py", "file_name": "test_tempfile.py", "file_type": "text/x-python", "category": "test", "start_line": 689, "end_line": 709, "span_ids": ["test_SpooledTemporaryFile.do_create", "test_SpooledTemporaryFile.test_basic", "test_SpooledTemporaryFile"], "tokens": 176}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class test_SpooledTemporaryFile(TC):\n \"\"\"Test SpooledTemporaryFile().\"\"\"\n\n def do_create(self, max_size: int = 0, dir: str = None, pre: str = \"\",\n suf: str = \"\") -> tempfile.SpooledTemporaryFile:\n if dir is None:\n dir = tempfile.gettempdir()\n try:\n file = tempfile.SpooledTemporaryFile(max_size=max_size, dir=dir, prefix=pre, suffix=suf)\n except:\n self.failOnException(\"SpooledTemporaryFile\")\n\n return file\n\n\n def test_basic(self) -> None:\n # SpooledTemporaryFile can create files\n f = self.do_create()\n self.assertFalse(f._rolled)\n f = self.do_create(max_size=100, pre=\"a\", suf=\".txt\")\n self.assertFalse(f._rolled)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_SpooledTemporaryFile.test_del_on_close_test_SpooledTemporaryFile.test_del_on_close.try_.finally_.os_rmdir_dir_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_SpooledTemporaryFile.test_del_on_close_test_SpooledTemporaryFile.test_del_on_close.try_.finally_.os_rmdir_dir_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_tempfile.py", "file_name": "test_tempfile.py", "file_type": "text/x-python", "category": "test", "start_line": 711, "end_line": 724, "span_ids": ["test_SpooledTemporaryFile.test_del_on_close"], "tokens": 135}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class test_SpooledTemporaryFile(TC):\n\n def test_del_on_close(self) -> None:\n # A SpooledTemporaryFile is deleted when closed\n dir = tempfile.mkdtemp()\n try:\n f = tempfile.SpooledTemporaryFile(max_size=10, dir=dir)\n self.assertFalse(f._rolled)\n f.write(b'blat ' * 5)\n self.assertTrue(f._rolled)\n filename = f.name\n f.close()\n self.assertFalse(isinstance(filename, str) and os.path.exists(filename),\n \"SpooledTemporaryFile %s exists after close\" % filename)\n finally:\n os.rmdir(dir)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_SpooledTemporaryFile.test_rewrite_small_test_SpooledTemporaryFile.test_multiple_close_after_rollover.try_.except_.self_failOnException_clo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_SpooledTemporaryFile.test_rewrite_small_test_SpooledTemporaryFile.test_multiple_close_after_rollover.try_.except_.self_failOnException_clo", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_tempfile.py", "file_name": "test_tempfile.py", "file_type": "text/x-python", "category": "test", "start_line": 726, "end_line": 803, "span_ids": ["test_SpooledTemporaryFile.test_sparse", "test_SpooledTemporaryFile.test_rewrite_small", "test_SpooledTemporaryFile.test_fileno", "test_SpooledTemporaryFile.test_writelines_sequential", "test_SpooledTemporaryFile.test_multiple_close_after_rollover", "test_SpooledTemporaryFile.test_writelines", "test_SpooledTemporaryFile.test_multiple_close_before_rollover", "test_SpooledTemporaryFile.test_write_sequential"], "tokens": 660}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class test_SpooledTemporaryFile(TC):\n\n def test_rewrite_small(self) -> None:\n # A SpooledTemporaryFile can be written to multiple within the max_size\n f = self.do_create(max_size=30)\n self.assertFalse(f._rolled)\n for i in range(5):\n f.seek(0, 0)\n f.write(b'x' * 20)\n self.assertFalse(f._rolled)\n\n def test_write_sequential(self) -> None:\n # A SpooledTemporaryFile should hold exactly max_size bytes, and roll\n # over afterward\n f = self.do_create(max_size=30)\n self.assertFalse(f._rolled)\n f.write(b'x' * 20)\n self.assertFalse(f._rolled)\n f.write(b'x' * 10)\n self.assertFalse(f._rolled)\n f.write(b'x')\n self.assertTrue(f._rolled)\n\n def test_writelines(self) -> None:\n # Verify writelines with a SpooledTemporaryFile\n f = self.do_create()\n f.writelines([b'x', b'y', b'z'])\n f.seek(0)\n buf = f.read()\n self.assertEqual(buf, b'xyz')\n\n def test_writelines_sequential(self) -> None:\n # A SpooledTemporaryFile should hold exactly max_size bytes, and roll\n # over afterward\n f = self.do_create(max_size=35)\n f.writelines([b'x' * 20, b'x' * 10, b'x' * 5])\n self.assertFalse(f._rolled)\n f.write(b'x')\n self.assertTrue(f._rolled)\n\n def test_sparse(self) -> None:\n # A SpooledTemporaryFile that is written late in the file will extend\n # when that occurs\n f = self.do_create(max_size=30)\n self.assertFalse(f._rolled)\n f.seek(100, 0)\n self.assertFalse(f._rolled)\n f.write(b'x')\n self.assertTrue(f._rolled)\n\n def test_fileno(self) -> None:\n # A SpooledTemporaryFile should roll over to a real file on fileno()\n f = self.do_create(max_size=30)\n self.assertFalse(f._rolled)\n self.assertTrue(f.fileno() > 0)\n self.assertTrue(f._rolled)\n\n def test_multiple_close_before_rollover(self) -> None:\n # A SpooledTemporaryFile can be closed many times without error\n f = tempfile.SpooledTemporaryFile()\n f.write(b'abc\\n')\n self.assertFalse(f._rolled)\n f.close()\n try:\n f.close()\n f.close()\n except:\n self.failOnException(\"close\")\n\n def test_multiple_close_after_rollover(self) -> None:\n # A SpooledTemporaryFile can be closed many times without error\n f = tempfile.SpooledTemporaryFile(max_size=1)\n f.write(b'abc\\n')\n self.assertTrue(f._rolled)\n f.close()\n try:\n f.close()\n f.close()\n except:\n self.failOnException(\"close\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_SpooledTemporaryFile.test_bound_methods_test_SpooledTemporaryFile.test_bound_methods.self_assertEqual_read_70_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_SpooledTemporaryFile.test_bound_methods_test_SpooledTemporaryFile.test_bound_methods.self_assertEqual_read_70_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_tempfile.py", "file_name": "test_tempfile.py", "file_type": "text/x-python", "category": "test", "start_line": 805, "end_line": 817, "span_ids": ["test_SpooledTemporaryFile.test_bound_methods"], "tokens": 135}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class test_SpooledTemporaryFile(TC):\n\n def test_bound_methods(self) -> None:\n # It should be OK to steal a bound method from a SpooledTemporaryFile\n # and use it independently; when the file rolls over, those bound\n # methods should continue to function\n f = self.do_create(max_size=30)\n read = f.read\n write = f.write\n seek = f.seek\n\n write(b\"a\" * 35)\n write(b\"b\" * 35)\n seek(0, 0)\n self.assertEqual(read(70), b'a'*35 + b'b'*35)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_SpooledTemporaryFile.test_text_mode_test_SpooledTemporaryFile.test_text_mode.None_11": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_SpooledTemporaryFile.test_text_mode_test_SpooledTemporaryFile.test_text_mode.None_11", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_tempfile.py", "file_name": "test_tempfile.py", "file_type": "text/x-python", "category": "test", "start_line": 819, "end_line": 835, "span_ids": ["test_SpooledTemporaryFile.test_text_mode"], "tokens": 192}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class test_SpooledTemporaryFile(TC):\n\n def test_text_mode(self) -> None:\n # Creating a SpooledTemporaryFile with a text mode should produce\n # a file object reading and writing (Unicode) text strings.\n f = tempfile.SpooledTemporaryFile(mode='w+', max_size=10)\n f.write(\"abc\\n\")\n f.seek(0)\n self.assertEqual(f.read(), \"abc\\n\")\n f.write(\"def\\n\")\n f.seek(0)\n self.assertEqual(f.read(), \"abc\\ndef\\n\")\n f.write(\"xyzzy\\n\")\n f.seek(0)\n self.assertEqual(f.read(), \"abc\\ndef\\nxyzzy\\n\")\n # Check that Ctrl+Z doesn't truncate the file\n f.write(\"foo\\x1abar\\n\")\n f.seek(0)\n self.assertEqual(f.read(), \"abc\\ndef\\nxyzzy\\nfoo\\x1abar\\n\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_SpooledTemporaryFile.test_text_newline_and_encoding_test_SpooledTemporaryFile.test_text_newline_and_encoding.self_assertTrue_f__rolled": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_SpooledTemporaryFile.test_text_newline_and_encoding_test_SpooledTemporaryFile.test_text_newline_and_encoding.self_assertTrue_f__rolled", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_tempfile.py", "file_name": "test_tempfile.py", "file_type": "text/x-python", "category": "test", "start_line": 837, "end_line": 848, "span_ids": ["test_SpooledTemporaryFile.test_text_newline_and_encoding"], "tokens": 142}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class test_SpooledTemporaryFile(TC):\n\n def test_text_newline_and_encoding(self) -> None:\n f = tempfile.SpooledTemporaryFile(mode='w+', max_size=10,\n newline='', encoding='utf-8')\n f.write(\"\\u039B\\r\\n\")\n f.seek(0)\n self.assertEqual(f.read(), \"\\u039B\\r\\n\")\n self.assertFalse(f._rolled)\n\n f.write(\"\\u039B\" * 20 + \"\\r\\n\")\n f.seek(0)\n self.assertEqual(f.read(), \"\\u039B\\r\\n\" + (\"\\u039B\" * 20) + \"\\r\\n\")\n self.assertTrue(f._rolled)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_SpooledTemporaryFile.test_context_manager_before_rollover_test_SpooledTemporaryFile.test_context_manager_after_rollover.self_assertRaises_ValueEr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_SpooledTemporaryFile.test_context_manager_before_rollover_test_SpooledTemporaryFile.test_context_manager_after_rollover.self_assertRaises_ValueEr", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_tempfile.py", "file_name": "test_tempfile.py", "file_type": "text/x-python", "category": "test", "start_line": 850, "end_line": 887, "span_ids": ["test_SpooledTemporaryFile.test_context_manager_after_rollover", "test_SpooledTemporaryFile.test_context_manager_during_rollover", "test_SpooledTemporaryFile.test_context_manager_before_rollover"], "tokens": 293}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class test_SpooledTemporaryFile(TC):\n\n def test_context_manager_before_rollover(self) -> None:\n # A SpooledTemporaryFile can be used as a context manager\n with tempfile.SpooledTemporaryFile(max_size=1) as f:\n self.assertFalse(f._rolled)\n self.assertFalse(f.closed)\n self.assertTrue(f.closed)\n def use_closed():\n with f:\n pass\n self.assertRaises(ValueError, use_closed)\n\n def test_context_manager_during_rollover(self) -> None:\n # A SpooledTemporaryFile can be used as a context manager\n with tempfile.SpooledTemporaryFile(max_size=1) as f:\n self.assertFalse(f._rolled)\n f.write(b'abc\\n')\n f.flush()\n self.assertTrue(f._rolled)\n self.assertFalse(f.closed)\n self.assertTrue(f.closed)\n def use_closed():\n with f:\n pass\n self.assertRaises(ValueError, use_closed)\n\n def test_context_manager_after_rollover(self) -> None:\n # A SpooledTemporaryFile can be used as a context manager\n f = tempfile.SpooledTemporaryFile(max_size=1)\n f.write(b'abc\\n')\n f.flush()\n self.assertTrue(f._rolled)\n with f:\n self.assertFalse(f.closed)\n self.assertTrue(f.closed)\n def use_closed():\n with f:\n pass\n self.assertRaises(ValueError, use_closed)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_None_11_test_TemporaryFile.test_has_no_name.try_.except_.self_failOnException_rmd": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_None_11_test_TemporaryFile.test_has_no_name.try_.except_.self_failOnException_rmd", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_tempfile.py", "file_name": "test_tempfile.py", "file_type": "text/x-python", "category": "test", "start_line": 890, "end_line": 919, "span_ids": ["test_TemporaryFile.test_has_no_name", "impl:32", "test_TemporaryFile", "test_TemporaryFile.test_basic"], "tokens": 204}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "test_classes.append(test_SpooledTemporaryFile)\n\n\nclass test_TemporaryFile(TC):\n \"\"\"Test TemporaryFile().\"\"\"\n\n def test_basic(self) -> None:\n # TemporaryFile can create files\n # No point in testing the name params - the file has no name.\n try:\n tempfile.TemporaryFile()\n except:\n self.failOnException(\"TemporaryFile\")\n\n def test_has_no_name(self) -> None:\n # TemporaryFile creates files with no names (on this system)\n dir = tempfile.mkdtemp()\n f = tempfile.TemporaryFile(dir=dir)\n f.write(b'blat')\n\n # Sneaky: because this file has no name, it should not prevent\n # us from removing the directory it was created in.\n try:\n os.rmdir(dir)\n except:\n ei = sys.exc_info()\n # cleanup\n f.close()\n os.rmdir(dir)\n self.failOnException(\"rmdir\", ei)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_TemporaryFile.test_multiple_close_test_TemporaryFile.test_mode_and_encoding.roundtrip_foo_r_n_w_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_TemporaryFile.test_multiple_close_test_TemporaryFile.test_mode_and_encoding.roundtrip_foo_r_n_w_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_tempfile.py", "file_name": "test_tempfile.py", "file_type": "text/x-python", "category": "test", "start_line": 921, "end_line": 944, "span_ids": ["test_TemporaryFile.test_multiple_close", "test_TemporaryFile.test_mode_and_encoding"], "tokens": 210}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class test_TemporaryFile(TC):\n\n def test_multiple_close(self) -> None:\n # A TemporaryFile can be closed many times without error\n f = tempfile.TemporaryFile()\n f.write(b'abc\\n')\n f.close()\n try:\n f.close()\n f.close()\n except:\n self.failOnException(\"close\")\n\n # How to test the mode and bufsize parameters?\n def test_mode_and_encoding(self) -> None:\n\n def roundtrip(input: AnyStr, *args: Any, **kwargs: Any) -> None:\n with tempfile.TemporaryFile(*args, **kwargs) as fileobj:\n fileobj.write(input)\n fileobj.seek(0)\n self.assertEqual(input, fileobj.read())\n\n roundtrip(b\"1234\", \"w+b\")\n roundtrip(\"abdc\\n\", \"w+\")\n roundtrip(\"\\u039B\", \"w+\", encoding=\"utf-16\")\n roundtrip(\"foo\\r\\n\", \"w+\", newline=\"\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_if_tempfile_NamedTemporar_NulledModules.__exit__.for_d_c_in_zip_self_refs.d_update_c_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_if_tempfile_NamedTemporar_NulledModules.__exit__.for_d_c_in_zip_self_refs.d_update_c_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_tempfile.py", "file_name": "test_tempfile.py", "file_type": "text/x-python", "category": "test", "start_line": 947, "end_line": 965, "span_ids": ["NulledModules", "impl:33", "NulledModules.__exit__", "NulledModules.__init__", "NulledModules.__enter__"], "tokens": 145}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "if tempfile.NamedTemporaryFile is not tempfile.TemporaryFile:\n test_classes.append(test_TemporaryFile)\n\n\n# Helper for test_del_on_shutdown\nclass NulledModules:\n def __init__(self, *modules: Any) -> None:\n self.refs = [mod.__dict__ for mod in modules]\n self.contents = [ref.copy() for ref in self.refs]\n\n def __enter__(self) -> None:\n for d in self.refs:\n for key in d:\n d[key] = None\n\n def __exit__(self, *exc_info: Any) -> None:\n for d, c in zip(self.refs, self.contents):\n d.clear()\n d.update(c)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_TemporaryDirectory_test_TemporaryDirectory.do_create.return.tmp": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_TemporaryDirectory_test_TemporaryDirectory.do_create.return.tmp", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_tempfile.py", "file_name": "test_tempfile.py", "file_type": "text/x-python", "category": "test", "start_line": 967, "end_line": 984, "span_ids": ["test_TemporaryDirectory.do_create", "test_TemporaryDirectory"], "tokens": 171}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class test_TemporaryDirectory(TC):\n \"\"\"Test TemporaryDirectory().\"\"\"\n\n def do_create(self, dir: str = None, pre: str = \"\", suf: str = \"\",\n recurse: int = 1) -> tempfile.TemporaryDirectory:\n if dir is None:\n dir = tempfile.gettempdir()\n try:\n tmp = tempfile.TemporaryDirectory(dir=dir, prefix=pre, suffix=suf)\n except:\n self.failOnException(\"TemporaryDirectory\")\n self.nameCheck(tmp.name, dir, pre, suf)\n # Create a subdirectory and some files\n if recurse:\n self.do_create(tmp.name, pre, suf, recurse-1)\n with open(os.path.join(tmp.name, \"test.txt\"), \"wb\") as f:\n f.write(b\"Hello world!\")\n return tmp", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_TemporaryDirectory.test_mkdtemp_failure_test_TemporaryDirectory.test_explicit_cleanup.try_.finally_.os_rmdir_dir_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_TemporaryDirectory.test_mkdtemp_failure_test_TemporaryDirectory.test_explicit_cleanup.try_.finally_.os_rmdir_dir_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_tempfile.py", "file_name": "test_tempfile.py", "file_type": "text/x-python", "category": "test", "start_line": 986, "end_line": 1006, "span_ids": ["test_TemporaryDirectory.test_mkdtemp_failure", "test_TemporaryDirectory.test_explicit_cleanup"], "tokens": 185}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class test_TemporaryDirectory(TC):\n\n def test_mkdtemp_failure(self) -> None:\n # Check no additional exception if mkdtemp fails\n # Previously would raise AttributeError instead\n # (noted as part of Issue #10188)\n with tempfile.TemporaryDirectory() as nonexistent:\n pass\n with self.assertRaises(os.error):\n tempfile.TemporaryDirectory(dir=nonexistent)\n\n def test_explicit_cleanup(self) -> None:\n # A TemporaryDirectory is deleted when cleaned up\n dir = tempfile.mkdtemp()\n try:\n d = self.do_create(dir=dir)\n self.assertTrue(os.path.exists(d.name),\n \"TemporaryDirectory %s does not exist\" % d.name)\n d.cleanup()\n self.assertFalse(os.path.exists(d.name),\n \"TemporaryDirectory %s exists after cleanup\" % d.name)\n finally:\n os.rmdir(dir)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_TemporaryDirectory.test_cleanup_with_symlink_to_a_directory_test_TemporaryDirectory.test_del_on_collection.try_.finally_.os_rmdir_dir_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_TemporaryDirectory.test_cleanup_with_symlink_to_a_directory_test_TemporaryDirectory.test_del_on_collection.try_.finally_.os_rmdir_dir_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_tempfile.py", "file_name": "test_tempfile.py", "file_type": "text/x-python", "category": "test", "start_line": 1008, "end_line": 1040, "span_ids": ["test_TemporaryDirectory.test_cleanup_with_symlink_to_a_directory", "test_TemporaryDirectory.test_del_on_collection"], "tokens": 300}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class test_TemporaryDirectory(TC):\n\n @support.skip_unless_symlink\n def test_cleanup_with_symlink_to_a_directory(self) -> None:\n # cleanup() should not follow symlinks to directories (issue #12464)\n d1 = self.do_create()\n d2 = self.do_create()\n\n # Symlink d1/foo -> d2\n os.symlink(d2.name, os.path.join(d1.name, \"foo\"))\n\n # This call to cleanup() should not follow the \"foo\" symlink\n d1.cleanup()\n\n self.assertFalse(os.path.exists(d1.name),\n \"TemporaryDirectory %s exists after cleanup\" % d1.name)\n self.assertTrue(os.path.exists(d2.name),\n \"Directory pointed to by a symlink was deleted\")\n self.assertEqual(os.listdir(d2.name), ['test.txt'],\n \"Contents of the directory pointed to by a symlink \"\n \"were deleted\")\n d2.cleanup()\n\n @support.cpython_only\n def test_del_on_collection(self) -> None:\n # A TemporaryDirectory is deleted when garbage collected\n dir = tempfile.mkdtemp()\n try:\n d = self.do_create(dir=dir)\n name = d.name\n del d # Rely on refcounting to invoke __del__\n self.assertFalse(os.path.exists(name),\n \"TemporaryDirectory %s exists after __del__\" % name)\n finally:\n os.rmdir(dir)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_TemporaryDirectory.test_del_on_shutdown_test_TemporaryDirectory.test_del_on_shutdown.with_self_do_create_as_.self_assertFalse_os_path_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_TemporaryDirectory.test_del_on_shutdown_test_TemporaryDirectory.test_del_on_shutdown.with_self_do_create_as_.self_assertFalse_os_path_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_tempfile.py", "file_name": "test_tempfile.py", "file_type": "text/x-python", "category": "test", "start_line": 1042, "end_line": 1064, "span_ids": ["test_TemporaryDirectory.test_del_on_shutdown"], "tokens": 225}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class test_TemporaryDirectory(TC):\n\n @unittest.expectedFailure # See issue #10188\n def test_del_on_shutdown(self) -> None:\n # A TemporaryDirectory may be cleaned up during shutdown\n # Make sure it works with the relevant modules nulled out\n with self.do_create() as dir:\n d = self.do_create(dir=dir)\n # Mimic the nulling out of modules that\n # occurs during system shutdown\n modules = [os, os.path]\n if has_stat:\n modules.append(stat)\n # Currently broken, so suppress the warning\n # that is otherwise emitted on stdout\n with support.captured_stderr() as err:\n with NulledModules(*modules):\n d.cleanup()\n # Currently broken, so stop spurious exception by\n # indicating the object has already been closed\n d._closed = True\n # And this assert will fail, as expected by the\n # unittest decorator...\n self.assertFalse(os.path.exists(d.name),\n \"TemporaryDirectory %s exists after cleanup\" % d.name)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_TemporaryDirectory.test_warnings_on_cleanup_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_tempfile.py_test_TemporaryDirectory.test_warnings_on_cleanup_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_tempfile.py", "file_name": "test_tempfile.py", "file_type": "text/x-python", "category": "test", "start_line": 1066, "end_line": 1123, "span_ids": ["impl:36", "test_TemporaryDirectory.test_multiple_close", "test_TemporaryDirectory.test_warnings_on_cleanup", "test_TemporaryDirectory.test_context_manager", "impl:35", "test_main"], "tokens": 427}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class test_TemporaryDirectory(TC):\n\n def test_warnings_on_cleanup(self) -> None:\n # Two kinds of warning on shutdown\n # Issue 10888: may write to stderr if modules are nulled out\n # ResourceWarning will be triggered by __del__\n with self.do_create() as dir:\n if os.sep != '\\\\':\n # Embed a backslash in order to make sure string escaping\n # in the displayed error message is dealt with correctly\n suffix = '\\\\check_backslash_handling'\n else:\n suffix = ''\n d = self.do_create(dir=dir, suf=suffix)\n\n #Check for the Issue 10888 message\n modules = [os, os.path]\n if has_stat:\n modules.append(stat)\n with support.captured_stderr() as err:\n with NulledModules(*modules):\n d.cleanup()\n message = err.getvalue().replace('\\\\\\\\', '\\\\')\n self.assertIn(\"while cleaning up\", message)\n self.assertIn(d.name, message)\n\n # Check for the resource warning\n with support.check_warnings(('Implicitly', ResourceWarning), quiet=False):\n warnings.filterwarnings(\"always\", category=ResourceWarning)\n d.__del__()\n self.assertFalse(os.path.exists(d.name),\n \"TemporaryDirectory %s exists after __del__\" % d.name)\n\n def test_multiple_close(self) -> None:\n # Can be cleaned-up many times without error\n d = self.do_create()\n d.cleanup()\n try:\n d.cleanup()\n d.cleanup()\n except:\n self.failOnException(\"cleanup\")\n\n def test_context_manager(self) -> None:\n # Can be used as a context manager\n d = self.do_create()\n with d as name:\n self.assertTrue(os.path.exists(name))\n self.assertEqual(name, d.name)\n self.assertFalse(os.path.exists(name))\n\n\ntest_classes.append(test_TemporaryDirectory)\n\ndef test_main() -> None:\n support.run_unittest(*test_classes)\n\nif __name__ == \"__main__\":\n test_main()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py___BaseTestCase.check_split.self_assertEqual_result_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py___BaseTestCase.check_split.self_assertEqual_result_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_textwrap.py", "file_name": "test_textwrap.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 49, "span_ids": ["BaseTestCase.show", "BaseTestCase.check_wrap", "BaseTestCase", "BaseTestCase.check_split", "docstring", "BaseTestCase.check"], "tokens": 362}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "#\n# Test suite for the textwrap module.\n#\n# Original tests written by Greg Ward .\n# Converted to PyUnit by Peter Hansen .\n# Currently maintained by Greg Ward.\n#\n# $Id$\n#\n\nimport unittest\nfrom test import support\n\nfrom typing import Any, List, Sequence\n\nfrom textwrap import TextWrapper, wrap, fill, dedent\n\n\nclass BaseTestCase(unittest.TestCase):\n '''Parent class with utility methods for textwrap tests.'''\n\n wrapper = None # type: TextWrapper\n\n def show(self, textin: Sequence[str]) -> str:\n if isinstance(textin, list):\n results = [] # type: List[str]\n for i in range(len(textin)):\n results.append(\" %d: %r\" % (i, textin[i]))\n result = '\\n'.join(results)\n elif isinstance(textin, str):\n result = \" %s\\n\" % repr(textin)\n return result\n\n\n def check(self, result: Sequence[str], expect: Sequence[str]) -> None:\n self.assertEqual(result, expect,\n 'expected:\\n%s\\nbut got:\\n%s' % (\n self.show(expect), self.show(result)))\n\n def check_wrap(self, text: str, width: int, expect: Sequence[str],\n **kwargs: Any) -> None:\n result = wrap(text, width, **kwargs)\n self.check(result, expect)\n\n def check_split(self, text: str, expect: Sequence[str]) -> None:\n result = self.wrapper._split(text)\n self.assertEqual(result, expect,\n \"\\nexpected %r\\n\"\n \"but got %r\" % (expect, result))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_WrapTestCase_WrapTestCase.test_simple.self_check_wrap_text_80_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_WrapTestCase_WrapTestCase.test_simple.self_check_wrap_text_80_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_textwrap.py", "file_name": "test_textwrap.py", "file_type": "text/x-python", "category": "test", "start_line": 52, "end_line": 72, "span_ids": ["WrapTestCase", "WrapTestCase.test_simple", "WrapTestCase.setUp"], "tokens": 160}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class WrapTestCase(BaseTestCase):\n\n def setUp(self) -> None:\n self.wrapper = TextWrapper(width=45)\n\n def test_simple(self) -> None:\n # Simple case: just words, spaces, and a bit of punctuation\n\n text = \"Hello there, how are you this fine day? I'm glad to hear it!\"\n\n self.check_wrap(text, 12,\n [\"Hello there,\",\n \"how are you\",\n \"this fine\",\n \"day? I'm\",\n \"glad to hear\",\n \"it!\"])\n self.check_wrap(text, 42,\n [\"Hello there, how are you this fine day?\",\n \"I'm glad to hear it!\"])\n self.check_wrap(text, 80, [text])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_WrapTestCase.test_whitespace_WrapTestCase.test_whitespace.self_check_results_n_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_WrapTestCase.test_whitespace_WrapTestCase.test_whitespace.self_check_results_n_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_textwrap.py", "file_name": "test_textwrap.py", "file_type": "text/x-python", "category": "test", "start_line": 75, "end_line": 97, "span_ids": ["WrapTestCase.test_whitespace"], "tokens": 189}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class WrapTestCase(BaseTestCase):\n\n\n def test_whitespace(self) -> None:\n # Whitespace munging and end-of-sentence detection\n\n text = \"\"\"\\\nThis is a paragraph that already has\nline breaks. But some of its lines are much longer than the others,\nso it needs to be wrapped.\nSome lines are \\ttabbed too.\nWhat a mess!\n\"\"\"\n\n expect = [\"This is a paragraph that already has line\",\n \"breaks. But some of its lines are much\",\n \"longer than the others, so it needs to be\",\n \"wrapped. Some lines are tabbed too. What a\",\n \"mess!\"]\n\n wrapper = TextWrapper(45, fix_sentence_endings=True)\n result = wrapper.wrap(text)\n self.check(result, expect)\n\n results = wrapper.fill(text)\n self.check(results, '\\n'.join(expect))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_WrapTestCase.test_fix_sentence_endings_WrapTestCase.test_fix_sentence_endings.None_7": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_WrapTestCase.test_fix_sentence_endings_WrapTestCase.test_fix_sentence_endings.None_7", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_textwrap.py", "file_name": "test_textwrap.py", "file_type": "text/x-python", "category": "test", "start_line": 99, "end_line": 139, "span_ids": ["WrapTestCase.test_fix_sentence_endings"], "tokens": 419}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class WrapTestCase(BaseTestCase):\n\n def test_fix_sentence_endings(self) -> None:\n wrapper = TextWrapper(60, fix_sentence_endings=True)\n\n # SF #847346: ensure that fix_sentence_endings=True does the\n # right thing even on input short enough that it doesn't need to\n # be wrapped.\n text = \"A short line. Note the single space.\"\n expect = [\"A short line. Note the single space.\"]\n self.check(wrapper.wrap(text), expect)\n\n # Test some of the hairy end cases that _fix_sentence_endings()\n # is supposed to handle (the easy stuff is tested in\n # test_whitespace() above).\n text = \"Well, Doctor? What do you think?\"\n expect = [\"Well, Doctor? What do you think?\"]\n self.check(wrapper.wrap(text), expect)\n\n text = \"Well, Doctor?\\nWhat do you think?\"\n self.check(wrapper.wrap(text), expect)\n\n text = 'I say, chaps! Anyone for \"tennis?\"\\nHmmph!'\n expect = ['I say, chaps! Anyone for \"tennis?\" Hmmph!']\n self.check(wrapper.wrap(text), expect)\n\n wrapper.width = 20\n expect = ['I say, chaps!', 'Anyone for \"tennis?\"', 'Hmmph!']\n self.check(wrapper.wrap(text), expect)\n\n text = 'And she said, \"Go to hell!\"\\nCan you believe that?'\n expect = ['And she said, \"Go to',\n 'hell!\" Can you',\n 'believe that?']\n self.check(wrapper.wrap(text), expect)\n\n wrapper.width = 60\n expect = ['And she said, \"Go to hell!\" Can you believe that?']\n self.check(wrapper.wrap(text), expect)\n\n text = 'File stdio.h is nice.'\n expect = ['File stdio.h is nice.']\n self.check(wrapper.wrap(text), expect)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_WrapTestCase.test_wrap_short_WrapTestCase.test_wrap_short_1line.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_WrapTestCase.test_wrap_short_WrapTestCase.test_wrap_short_1line.None_1", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_textwrap.py", "file_name": "test_textwrap.py", "file_type": "text/x-python", "category": "test", "start_line": 141, "end_line": 158, "span_ids": ["WrapTestCase.test_wrap_short_1line", "WrapTestCase.test_wrap_short"], "tokens": 147}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class WrapTestCase(BaseTestCase):\n\n def test_wrap_short(self) -> None:\n # Wrapping to make short lines longer\n\n text = \"This is a\\nshort paragraph.\"\n\n self.check_wrap(text, 20, [\"This is a short\",\n \"paragraph.\"])\n self.check_wrap(text, 40, [\"This is a short paragraph.\"])\n\n\n def test_wrap_short_1line(self) -> None:\n # Test endcases\n\n text = \"This is a short line.\"\n\n self.check_wrap(text, 30, [\"This is a short line.\"])\n self.check_wrap(text, 30, [\"(1) This is a short line.\"],\n initial_indent=\"(1) \")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_WrapTestCase.test_hyphenated_WrapTestCase.test_hyphenated.self_check_wrap_text_42_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_WrapTestCase.test_hyphenated_WrapTestCase.test_hyphenated.self_check_wrap_text_42_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_textwrap.py", "file_name": "test_textwrap.py", "file_type": "text/x-python", "category": "test", "start_line": 161, "end_line": 175, "span_ids": ["WrapTestCase.test_hyphenated"], "tokens": 157}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class WrapTestCase(BaseTestCase):\n\n\n def test_hyphenated(self) -> None:\n # Test breaking hyphenated words\n\n text = (\"this-is-a-useful-feature-for-\"\n \"reformatting-posts-from-tim-peters'ly\")\n\n self.check_wrap(text, 40,\n [\"this-is-a-useful-feature-for-\",\n \"reformatting-posts-from-tim-peters'ly\"])\n self.check_wrap(text, 41,\n [\"this-is-a-useful-feature-for-\",\n \"reformatting-posts-from-tim-peters'ly\"])\n self.check_wrap(text, 42,\n [\"this-is-a-useful-feature-for-reformatting-\",\n \"posts-from-tim-peters'ly\"])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_WrapTestCase.test_hyphenated_numbers_WrapTestCase.test_hyphenated_numbers.self_check_wrap_text_29_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_WrapTestCase.test_hyphenated_numbers_WrapTestCase.test_hyphenated_numbers.self_check_wrap_text_29_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_textwrap.py", "file_name": "test_textwrap.py", "file_type": "text/x-python", "category": "test", "start_line": 177, "end_line": 193, "span_ids": ["WrapTestCase.test_hyphenated_numbers"], "tokens": 270}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class WrapTestCase(BaseTestCase):\n\n def test_hyphenated_numbers(self) -> None:\n # Test that hyphenated numbers (eg. dates) are not broken like words.\n text = (\"Python 1.0.0 was released on 1994-01-26. Python 1.0.1 was\\n\"\n \"released on 1994-02-15.\")\n\n self.check_wrap(text, 30, ['Python 1.0.0 was released on',\n '1994-01-26. Python 1.0.1 was',\n 'released on 1994-02-15.'])\n self.check_wrap(text, 40, ['Python 1.0.0 was released on 1994-01-26.',\n 'Python 1.0.1 was released on 1994-02-15.'])\n\n text = \"I do all my shopping at 7-11.\"\n self.check_wrap(text, 25, [\"I do all my shopping at\",\n \"7-11.\"])\n self.check_wrap(text, 27, [\"I do all my shopping at\",\n \"7-11.\"])\n self.check_wrap(text, 29, [\"I do all my shopping at 7-11.\"])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_WrapTestCase.test_em_dash_WrapTestCase.test_em_dash.None_14": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_WrapTestCase.test_em_dash_WrapTestCase.test_em_dash.None_14", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_textwrap.py", "file_name": "test_textwrap.py", "file_type": "text/x-python", "category": "test", "start_line": 195, "end_line": 247, "span_ids": ["WrapTestCase.test_em_dash"], "tokens": 525}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class WrapTestCase(BaseTestCase):\n\n def test_em_dash(self) -> None:\n # Test text with em-dashes\n text = \"Em-dashes should be written -- thus.\"\n self.check_wrap(text, 25,\n [\"Em-dashes should be\",\n \"written -- thus.\"])\n\n # Probe the boundaries of the properly written em-dash,\n # ie. \" -- \".\n self.check_wrap(text, 29,\n [\"Em-dashes should be written\",\n \"-- thus.\"])\n expect = [\"Em-dashes should be written --\",\n \"thus.\"]\n self.check_wrap(text, 30, expect)\n self.check_wrap(text, 35, expect)\n self.check_wrap(text, 36,\n [\"Em-dashes should be written -- thus.\"])\n\n # The improperly written em-dash is handled too, because\n # it's adjacent to non-whitespace on both sides.\n text = \"You can also do--this or even---this.\"\n expect = [\"You can also do\",\n \"--this or even\",\n \"---this.\"]\n self.check_wrap(text, 15, expect)\n self.check_wrap(text, 16, expect)\n expect = [\"You can also do--\",\n \"this or even---\",\n \"this.\"]\n self.check_wrap(text, 17, expect)\n self.check_wrap(text, 19, expect)\n expect = [\"You can also do--this or even\",\n \"---this.\"]\n self.check_wrap(text, 29, expect)\n self.check_wrap(text, 31, expect)\n expect = [\"You can also do--this or even---\",\n \"this.\"]\n self.check_wrap(text, 32, expect)\n self.check_wrap(text, 35, expect)\n\n # All of the above behaviour could be deduced by probing the\n # _split() method.\n text = \"Here's an -- em-dash and--here's another---and another!\"\n expect = [\"Here's\", \" \", \"an\", \" \", \"--\", \" \", \"em-\", \"dash\", \" \",\n \"and\", \"--\", \"here's\", \" \", \"another\", \"---\",\n \"and\", \" \", \"another!\"]\n self.check_split(text, expect)\n\n text = \"and then--bam!--he was gone\"\n expect = [\"and\", \" \", \"then\", \"--\", \"bam!\", \"--\",\n \"he\", \" \", \"was\", \" \", \"gone\"]\n self.check_split(text, expect)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_WrapTestCase.test_unix_options_WrapTestCase.test_unix_options.self_check_split_text_ex": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_WrapTestCase.test_unix_options_WrapTestCase.test_unix_options.self_check_split_text_ex", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_textwrap.py", "file_name": "test_textwrap.py", "file_type": "text/x-python", "category": "test", "start_line": 250, "end_line": 282, "span_ids": ["WrapTestCase.test_unix_options"], "tokens": 374}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class WrapTestCase(BaseTestCase):\n\n\n def test_unix_options (self) -> None:\n # Test that Unix-style command-line options are wrapped correctly.\n # Both Optik (OptionParser) and Docutils rely on this behaviour!\n\n text = \"You should use the -n option, or --dry-run in its long form.\"\n self.check_wrap(text, 20,\n [\"You should use the\",\n \"-n option, or --dry-\",\n \"run in its long\",\n \"form.\"])\n self.check_wrap(text, 21,\n [\"You should use the -n\",\n \"option, or --dry-run\",\n \"in its long form.\"])\n expect = [\"You should use the -n option, or\",\n \"--dry-run in its long form.\"]\n self.check_wrap(text, 32, expect)\n self.check_wrap(text, 34, expect)\n self.check_wrap(text, 35, expect)\n self.check_wrap(text, 38, expect)\n expect = [\"You should use the -n option, or --dry-\",\n \"run in its long form.\"]\n self.check_wrap(text, 39, expect)\n self.check_wrap(text, 41, expect)\n expect = [\"You should use the -n option, or --dry-run\",\n \"in its long form.\"]\n self.check_wrap(text, 42, expect)\n\n # Again, all of the above can be deduced from _split().\n text = \"the -n option, or --dry-run or --dryrun\"\n expect = [\"the\", \" \", \"-n\", \" \", \"option,\", \" \", \"or\", \" \",\n \"--dry-\", \"run\", \" \", \"or\", \" \", \"--dryrun\"]\n self.check_split(text, expect)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_WrapTestCase.test_funky_hyphens_WrapTestCase.test_funky_hyphens.self_check_split_foo_o": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_WrapTestCase.test_funky_hyphens_WrapTestCase.test_funky_hyphens.self_check_split_foo_o", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_textwrap.py", "file_name": "test_textwrap.py", "file_type": "text/x-python", "category": "test", "start_line": 284, "end_line": 299, "span_ids": ["WrapTestCase.test_funky_hyphens"], "tokens": 232}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class WrapTestCase(BaseTestCase):\n\n def test_funky_hyphens (self) -> None:\n # Screwy edge cases cooked up by David Goodger. All reported\n # in SF bug #596434.\n self.check_split(\"what the--hey!\", [\"what\", \" \", \"the\", \"--\", \"hey!\"])\n self.check_split(\"what the--\", [\"what\", \" \", \"the--\"])\n self.check_split(\"what the--.\", [\"what\", \" \", \"the--.\"])\n self.check_split(\"--text--.\", [\"--text--.\"])\n\n # When I first read bug #596434, this is what I thought David\n # was talking about. I was wrong; these have always worked\n # fine. The real problem is tested in test_funky_parens()\n # below...\n self.check_split(\"--option\", [\"--option\"])\n self.check_split(\"--option-opt\", [\"--option-\", \"opt\"])\n self.check_split(\"foo --option-opt bar\",\n [\"foo\", \" \", \"--option-\", \"opt\", \" \", \"bar\"])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_WrapTestCase.test_punct_hyphens_WrapTestCase.test_punct_hyphens.self_check_split_the_w": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_WrapTestCase.test_punct_hyphens_WrapTestCase.test_punct_hyphens.self_check_split_the_w", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_textwrap.py", "file_name": "test_textwrap.py", "file_type": "text/x-python", "category": "test", "start_line": 301, "end_line": 316, "span_ids": ["WrapTestCase.test_punct_hyphens"], "tokens": 268}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class WrapTestCase(BaseTestCase):\n\n def test_punct_hyphens(self) -> None:\n # Oh bother, SF #965425 found another problem with hyphens --\n # hyphenated words in single quotes weren't handled correctly.\n # In fact, the bug is that *any* punctuation around a hyphenated\n # word was handled incorrectly, except for a leading \"--\", which\n # was special-cased for Optik and Docutils. So test a variety\n # of styles of punctuation around a hyphenated word.\n # (Actually this is based on an Optik bug report, #813077).\n self.check_split(\"the 'wibble-wobble' widget\",\n ['the', ' ', \"'wibble-\", \"wobble'\", ' ', 'widget'])\n self.check_split('the \"wibble-wobble\" widget',\n ['the', ' ', '\"wibble-', 'wobble\"', ' ', 'widget'])\n self.check_split(\"the (wibble-wobble) widget\",\n ['the', ' ', \"(wibble-\", \"wobble)\", ' ', 'widget'])\n self.check_split(\"the ['wibble-wobble'] widget\",\n ['the', ' ', \"['wibble-\", \"wobble']\", ' ', 'widget'])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_WrapTestCase.test_funky_parens_WrapTestCase.test_funky_parens.self_check_split_blah_d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_WrapTestCase.test_funky_parens_WrapTestCase.test_funky_parens.self_check_split_blah_d", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_textwrap.py", "file_name": "test_textwrap.py", "file_type": "text/x-python", "category": "test", "start_line": 318, "end_line": 329, "span_ids": ["WrapTestCase.test_funky_parens"], "tokens": 142}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class WrapTestCase(BaseTestCase):\n\n def test_funky_parens (self) -> None:\n # Second part of SF bug #596434: long option strings inside\n # parentheses.\n self.check_split(\"foo (--option) bar\",\n [\"foo\", \" \", \"(--option)\", \" \", \"bar\"])\n\n # Related stuff -- make sure parens work in simpler contexts.\n self.check_split(\"foo (bar) baz\",\n [\"foo\", \" \", \"(bar)\", \" \", \"baz\"])\n self.check_split(\"blah (ding dong), wubba\",\n [\"blah\", \" \", \"(ding\", \" \", \"dong),\",\n \" \", \"wubba\"])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_WrapTestCase.test_initial_whitespace_WrapTestCase.test_no_drop_whitespace.self_check_wrap_text_10_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_WrapTestCase.test_initial_whitespace_WrapTestCase.test_no_drop_whitespace.self_check_wrap_text_10_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_textwrap.py", "file_name": "test_textwrap.py", "file_type": "text/x-python", "category": "test", "start_line": 331, "end_line": 346, "span_ids": ["WrapTestCase.test_no_drop_whitespace", "WrapTestCase.test_initial_whitespace"], "tokens": 170}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class WrapTestCase(BaseTestCase):\n\n def test_initial_whitespace(self) -> None:\n # SF bug #622849 reported inconsistent handling of leading\n # whitespace; let's test that a bit, shall we?\n text = \" This is a sentence with leading whitespace.\"\n self.check_wrap(text, 50,\n [\" This is a sentence with leading whitespace.\"])\n self.check_wrap(text, 30,\n [\" This is a sentence with\", \"leading whitespace.\"])\n\n def test_no_drop_whitespace(self) -> None:\n # SF patch #1581073\n text = \" This is a sentence with much whitespace.\"\n self.check_wrap(text, 10,\n [\" This is a\", \" \", \"sentence \",\n \"with \", \"much white\", \"space.\"],\n drop_whitespace=False)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_WrapTestCase.test_split_WrapTestCase.test_split.self_check_result_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_WrapTestCase.test_split_WrapTestCase.test_split.self_check_result_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_textwrap.py", "file_name": "test_textwrap.py", "file_type": "text/x-python", "category": "test", "start_line": 348, "end_line": 357, "span_ids": ["WrapTestCase.test_split"], "tokens": 117}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class WrapTestCase(BaseTestCase):\n\n def test_split(self) -> None:\n # Ensure that the standard _split() method works as advertised\n # in the comments\n\n text = \"Hello there -- you goof-ball, use the -b option!\"\n\n result = self.wrapper._split(text)\n self.check(result,\n [\"Hello\", \" \", \"there\", \" \", \"--\", \" \", \"you\", \" \", \"goof-\",\n \"ball,\", \" \", \"use\", \" \", \"the\", \" \", \"-b\", \" \", \"option!\"])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_WrapTestCase.test_break_on_hyphens_WrapTestCase.test_umlaut_followed_by_dash.self_check_wrap_text_7_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_WrapTestCase.test_break_on_hyphens_WrapTestCase.test_umlaut_followed_by_dash.self_check_wrap_text_7_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_textwrap.py", "file_name": "test_textwrap.py", "file_type": "text/x-python", "category": "test", "start_line": 359, "end_line": 379, "span_ids": ["WrapTestCase.test_umlaut_followed_by_dash", "WrapTestCase.test_break_on_hyphens", "WrapTestCase.test_bad_width", "WrapTestCase.test_no_split_at_umlaut"], "tokens": 262}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class WrapTestCase(BaseTestCase):\n\n def test_break_on_hyphens(self) -> None:\n # Ensure that the break_on_hyphens attributes work\n text = \"yaba daba-doo\"\n self.check_wrap(text, 10, [\"yaba daba-\", \"doo\"],\n break_on_hyphens=True)\n self.check_wrap(text, 10, [\"yaba\", \"daba-doo\"],\n break_on_hyphens=False)\n\n def test_bad_width(self) -> None:\n # Ensure that width <= 0 is caught.\n text = \"Whatever, it doesn't matter.\"\n self.assertRaises(ValueError, wrap, text, 0)\n self.assertRaises(ValueError, wrap, text, -1)\n\n def test_no_split_at_umlaut(self) -> None:\n text = \"Die Empf\\xe4nger-Auswahl\"\n self.check_wrap(text, 13, [\"Die\", \"Empf\\xe4nger-\", \"Auswahl\"])\n\n def test_umlaut_followed_by_dash(self) -> None:\n text = \"aa \\xe4\\xe4-\\xe4\\xe4\"\n self.check_wrap(text, 7, [\"aa \\xe4\\xe4-\", \"\\xe4\\xe4\"])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_LongWordTestCase_LongWordTestCase.test_break_long.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_LongWordTestCase_LongWordTestCase.test_break_long.None_3", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_textwrap.py", "file_name": "test_textwrap.py", "file_type": "text/x-python", "category": "test", "start_line": 382, "end_line": 424, "span_ids": ["LongWordTestCase", "LongWordTestCase.setUp", "LongWordTestCase.test_break_long"], "tokens": 353}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LongWordTestCase (BaseTestCase):\n def setUp(self) -> None:\n self.wrapper = TextWrapper()\n self.text = '''\\\nDid you say \"supercalifragilisticexpialidocious?\"\nHow *do* you spell that odd word, anyways?\n'''\n\n def test_break_long(self) -> None:\n # Wrap text with long words and lots of punctuation\n\n self.check_wrap(self.text, 30,\n ['Did you say \"supercalifragilis',\n 'ticexpialidocious?\" How *do*',\n 'you spell that odd word,',\n 'anyways?'])\n self.check_wrap(self.text, 50,\n ['Did you say \"supercalifragilisticexpialidocious?\"',\n 'How *do* you spell that odd word, anyways?'])\n\n # SF bug 797650. Prevent an infinite loop by making sure that at\n # least one character gets split off on every pass.\n self.check_wrap('-'*10+'hello', 10,\n ['----------',\n ' h',\n ' e',\n ' l',\n ' l',\n ' o'],\n subsequent_indent = ' '*15)\n\n # bug 1146. Prevent a long word to be wrongly wrapped when the\n # preceding word is exactly one character shorter than the width\n self.check_wrap(self.text, 12,\n ['Did you say ',\n '\"supercalifr',\n 'agilisticexp',\n 'ialidocious?',\n '\" How *do*',\n 'you spell',\n 'that odd',\n 'word,',\n 'anyways?'])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_LongWordTestCase.test_nobreak_long_LongWordTestCase.test_nobreak_long.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_LongWordTestCase.test_nobreak_long_LongWordTestCase.test_nobreak_long.None_1", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_textwrap.py", "file_name": "test_textwrap.py", "file_type": "text/x-python", "category": "test", "start_line": 426, "end_line": 440, "span_ids": ["LongWordTestCase.test_nobreak_long"], "tokens": 142}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LongWordTestCase (BaseTestCase):\n\n def test_nobreak_long(self) -> None:\n # Test with break_long_words disabled\n self.wrapper.break_long_words = False\n self.wrapper.width = 30\n expect = ['Did you say',\n '\"supercalifragilisticexpialidocious?\"',\n 'How *do* you spell that odd',\n 'word, anyways?'\n ]\n result = self.wrapper.wrap(self.text)\n self.check(result, expect)\n\n # Same thing with kwargs passed to standalone wrap() function.\n result = wrap(self.text, width=30, break_long_words=0)\n self.check(result, expect)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_IndentTestCases_IndentTestCases.test_subsequent_indent.self_check_result_expect": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_IndentTestCases_IndentTestCases.test_subsequent_indent.self_check_result_expect", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_textwrap.py", "file_name": "test_textwrap.py", "file_type": "text/x-python", "category": "test", "start_line": 443, "end_line": 489, "span_ids": ["IndentTestCases.test_fill", "IndentTestCases.test_subsequent_indent", "IndentTestCases", "IndentTestCases.setUp", "IndentTestCases.test_initial_indent"], "tokens": 301}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IndentTestCases(BaseTestCase):\n\n # called before each test method\n def setUp(self) -> None:\n self.text = '''\\\nThis paragraph will be filled, first without any indentation,\nand then with some (including a hanging indent).'''\n\n\n def test_fill(self) -> None:\n # Test the fill() method\n\n expect = '''\\\nThis paragraph will be filled, first\nwithout any indentation, and then with\nsome (including a hanging indent).'''\n\n result = fill(self.text, 40)\n self.check(result, expect)\n\n\n def test_initial_indent(self) -> None:\n # Test initial_indent parameter\n\n expect = [\" This paragraph will be filled,\",\n \"first without any indentation, and then\",\n \"with some (including a hanging indent).\"]\n result = wrap(self.text, 40, initial_indent=\" \")\n self.check(result, expect)\n\n expects = \"\\n\".join(expect)\n results = fill(self.text, 40, initial_indent=\" \")\n self.check(results, expects)\n\n\n def test_subsequent_indent(self) -> None:\n # Test subsequent_indent parameter\n\n expect = '''\\\n * This paragraph will be filled, first\n without any indentation, and then\n with some (including a hanging\n indent).'''\n\n result = fill(self.text, 40,\n initial_indent=\" * \", subsequent_indent=\" \")\n self.check(result, expect)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py__Despite_the_similar_nam_DedentTestCase.test_dedent_nomargin.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py__Despite_the_similar_nam_DedentTestCase.test_dedent_nomargin.None_3", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_textwrap.py", "file_name": "test_textwrap.py", "file_type": "text/x-python", "category": "test", "start_line": 492, "end_line": 515, "span_ids": ["DedentTestCase", "IndentTestCases.test_subsequent_indent", "DedentTestCase.assertUnchanged", "DedentTestCase.test_dedent_nomargin"], "tokens": 207}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Despite the similar names, DedentTestCase is *not* the inverse\n# of IndentTestCase!\nclass DedentTestCase(unittest.TestCase):\n\n def assertUnchanged(self, text: str) -> None:\n \"\"\"assert that dedent() has no effect on 'text'\"\"\"\n self.assertEqual(text, dedent(text))\n\n def test_dedent_nomargin(self) -> None:\n # No lines indented.\n text = \"Hello there.\\nHow are you?\\nOh good, I'm glad.\"\n self.assertUnchanged(text)\n\n # Similar, with a blank line.\n text = \"Hello there.\\n\\nBoo!\"\n self.assertUnchanged(text)\n\n # Some lines indented, but overall margin is still zero.\n text = \"Hello there.\\n This is indented.\"\n self.assertUnchanged(text)\n\n # Again, add a blank line.\n text = \"Hello there.\\n\\n Boo!\\n\"\n self.assertUnchanged(text)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_DedentTestCase.test_dedent_even_DedentTestCase.test_dedent_even.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_DedentTestCase.test_dedent_even_DedentTestCase.test_dedent_even.None_2", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_textwrap.py", "file_name": "test_textwrap.py", "file_type": "text/x-python", "category": "test", "start_line": 517, "end_line": 531, "span_ids": ["DedentTestCase.test_dedent_even"], "tokens": 193}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DedentTestCase(unittest.TestCase):\n\n def test_dedent_even(self) -> None:\n # All lines indented by two spaces.\n text = \" Hello there.\\n How are ya?\\n Oh good.\"\n expect = \"Hello there.\\nHow are ya?\\nOh good.\"\n self.assertEqual(expect, dedent(text))\n\n # Same, with blank lines.\n text = \" Hello there.\\n\\n How are ya?\\n Oh good.\\n\"\n expect = \"Hello there.\\n\\nHow are ya?\\nOh good.\\n\"\n self.assertEqual(expect, dedent(text))\n\n # Now indent one of the blank lines.\n text = \" Hello there.\\n \\n How are ya?\\n Oh good.\\n\"\n expect = \"Hello there.\\n\\nHow are ya?\\nOh good.\\n\"\n self.assertEqual(expect, dedent(text))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_DedentTestCase.test_dedent_uneven_DedentTestCase.test_dedent_uneven.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_DedentTestCase.test_dedent_uneven_DedentTestCase.test_dedent_uneven.None_2", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_textwrap.py", "file_name": "test_textwrap.py", "file_type": "text/x-python", "category": "test", "start_line": 533, "end_line": 555, "span_ids": ["DedentTestCase.test_dedent_uneven"], "tokens": 172}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DedentTestCase(unittest.TestCase):\n\n def test_dedent_uneven(self) -> None:\n # Lines indented unevenly.\n text = '''\\\n def foo():\n while 1:\n return foo\n '''\n expect = '''\\\ndef foo():\n while 1:\n return foo\n'''\n self.assertEqual(expect, dedent(text))\n\n # Uneven indentation with a blank line.\n text = \" Foo\\n Bar\\n\\n Baz\\n\"\n expect = \"Foo\\n Bar\\n\\n Baz\\n\"\n self.assertEqual(expect, dedent(text))\n\n # Uneven indentation with a whitespace-only line.\n text = \" Foo\\n Bar\\n \\n Baz\\n\"\n expect = \"Foo\\n Bar\\n\\n Baz\\n\"\n self.assertEqual(expect, dedent(text))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_DedentTestCase._dedent_should_not_man_DedentTestCase._considered_equivalent_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_DedentTestCase._dedent_should_not_man_DedentTestCase._considered_equivalent_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_textwrap.py", "file_name": "test_textwrap.py", "file_type": "text/x-python", "category": "test", "start_line": 557, "end_line": 569, "span_ids": ["DedentTestCase.test_dedent_preserve_internal_tabs", "DedentTestCase.test_dedent_uneven"], "tokens": 140}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DedentTestCase(unittest.TestCase):\n\n # dedent() should not mangle internal tabs\n def test_dedent_preserve_internal_tabs(self) -> None:\n text = \" hello\\tthere\\n how are\\tyou?\"\n expect = \"hello\\tthere\\nhow are\\tyou?\"\n self.assertEqual(expect, dedent(text))\n\n # make sure that it preserves tabs when it's not making any\n # changes at all\n self.assertEqual(expect, dedent(expect))\n\n # dedent() should not mangle tabs in the margin (i.e.\n # tabs and spaces both count as margin, but are *not*\n # considered equivalent)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_DedentTestCase.test_dedent_preserve_margin_tabs_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/test_textwrap.py_DedentTestCase.test_dedent_preserve_margin_tabs_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/test_textwrap.py", "file_name": "test_textwrap.py", "file_type": "text/x-python", "category": "test", "start_line": 570, "end_line": 602, "span_ids": ["DedentTestCase.test_dedent_preserve_margin_tabs", "impl", "test_main"], "tokens": 261}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DedentTestCase(unittest.TestCase):\n def test_dedent_preserve_margin_tabs(self) -> None:\n text = \" hello there\\n\\thow are you?\"\n self.assertUnchanged(text)\n\n # same effect even if we have 8 spaces\n text = \" hello there\\n\\thow are you?\"\n self.assertUnchanged(text)\n\n # dedent() only removes whitespace that can be uniformly removed!\n text = \"\\thello there\\n\\thow are you?\"\n expect = \"hello there\\nhow are you?\"\n self.assertEqual(expect, dedent(text))\n\n text = \" \\thello there\\n \\thow are you?\"\n self.assertEqual(expect, dedent(text))\n\n text = \" \\t hello there\\n \\t how are you?\"\n self.assertEqual(expect, dedent(text))\n\n text = \" \\thello there\\n \\t how are you?\"\n expect = \"hello there\\n how are you?\"\n self.assertEqual(expect, dedent(text))\n\n\ndef test_main() -> None:\n support.run_unittest(WrapTestCase,\n LongWordTestCase,\n IndentTestCases,\n DedentTestCase)\n\nif __name__ == '__main__':\n test_main()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/tf_inherit_check.py__Helper_script_for_test__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/test/tf_inherit_check.py__Helper_script_for_test__", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/test/tf_inherit_check.py", "file_name": "tf_inherit_check.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 26, "span_ids": ["docstring"], "tokens": 159}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Helper script for test_tempfile.py. argv[2] is the number of a file\n# descriptor which should _not_ be open. Check this by attempting to\n# write to it -- if we succeed, something is wrong.\n\nimport sys\nimport os\n\nverbose = (sys.argv[1] == 'v')\ntry:\n fd = int(sys.argv[2])\n\n try:\n os.write(fd, b\"blat\")\n except os.error:\n # Success -- could not write to fd.\n sys.exit(0)\n else:\n if verbose:\n sys.stderr.write(\"fd %d is open in child\" % fd)\n sys.exit(1)\n\nexcept Exception:\n if verbose:\n raise\n sys.exit(1)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/textwrap.py__Text_wrapping_and_fill__whitespace._t_n_x0b_x0c_r_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/textwrap.py__Text_wrapping_and_fill__whitespace._t_n_x0b_x0c_r_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/textwrap.py", "file_name": "textwrap.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 22, "span_ids": ["docstring"], "tokens": 183}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Text wrapping and filling.\n\"\"\"\n\nimport string, re\n\nfrom typing import Dict, List, Any\n\n__all__ = ['TextWrapper', 'wrap', 'fill', 'dedent']\n\n# Hardcode the recognized whitespace characters to the US-ASCII\n# whitespace characters. The main reason for doing this is that in\n# ISO-8859-1, 0xa0 is non-breaking whitespace, so in certain locales\n# that character winds up in string.whitespace. Respecting\n# string.whitespace in those cases would 1) make textwrap treat 0xa0 the\n# same as any other whitespace char, which is clearly wrong (it's a\n# *non-breaking* space), 2) possibly cause problems with Unicode,\n# since 0xa0 is not in range(128).\n_whitespace = '\\t\\n\\x0b\\x0c\\r '", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/textwrap.py_TextWrapper_TextWrapper._is_US_ASCII_only_and_t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/textwrap.py_TextWrapper_TextWrapper._is_US_ASCII_only_and_t", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/textwrap.py", "file_name": "textwrap.py", "file_type": "text/x-python", "category": "implementation", "start_line": 24, "end_line": 89, "span_ids": ["TextWrapper"], "tokens": 771}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TextWrapper:\n \"\"\"\n Object for wrapping/filling text. The public interface consists of\n the wrap() and fill() methods; the other methods are just there for\n subclasses to override in order to tweak the default behaviour.\n If you want to completely replace the main wrapping algorithm,\n you'll probably have to override _wrap_chunks().\n\n Several instance attributes control various aspects of wrapping:\n width (default: 70)\n the maximum width of wrapped lines (unless break_long_words\n is false)\n initial_indent (default: \"\")\n string that will be prepended to the first line of wrapped\n output. Counts towards the line's width.\n subsequent_indent (default: \"\")\n string that will be prepended to all lines save the first\n of wrapped output; also counts towards each line's width.\n expand_tabs (default: true)\n Expand tabs in input text to spaces before further processing.\n Each tab will become 1 .. 8 spaces, depending on its position in\n its line. If false, each tab is treated as a single character.\n replace_whitespace (default: true)\n Replace all whitespace characters in the input text by spaces\n after tab expansion. Note that if expand_tabs is false and\n replace_whitespace is true, every tab will be converted to a\n single space!\n fix_sentence_endings (default: false)\n Ensure that sentence-ending punctuation is always followed\n by two spaces. Off by default because the algorithm is\n (unavoidably) imperfect.\n break_long_words (default: true)\n Break words longer than 'width'. If false, those words will not\n be broken, and some lines might be longer than 'width'.\n break_on_hyphens (default: true)\n Allow breaking hyphenated words. If true, wrapping will occur\n preferably on whitespaces and right after hyphens part of\n compound words.\n drop_whitespace (default: true)\n Drop leading and trailing whitespace from lines.\n \"\"\"\n\n unicode_whitespace_trans = {} # type: Dict[int, int]\n uspace = ord(' ')\n for x in _whitespace:\n unicode_whitespace_trans[ord(x)] = uspace\n\n # This funky little regex is just the trick for splitting\n # text up into word-wrappable chunks. E.g.\n # \"Hello there -- you goof-ball, use the -b option!\"\n # splits into\n # Hello/ /there/ /--/ /you/ /goof-/ball,/ /use/ /the/ /-b/ /option!\n # (after stripping out empty strings).\n wordsep_re = re.compile(\n r'(\\s+|' # any whitespace\n r'[^\\s\\w]*\\w+[^0-9\\W]-(?=\\w+[^0-9\\W])|' # hyphenated words\n r'(?<=[\\w\\!\\\"\\'\\&\\.\\,\\?])-{2,}(?=\\w))') # em-dash\n\n # This less funky little regex just split on recognized spaces. E.g.\n # \"Hello there -- you goof-ball, use the -b option!\"\n # splits into\n # Hello/ /there/ /--/ /you/ /goof-ball,/ /use/ /the/ /-b/ /option!/\n wordsep_simple_re = re.compile(r'(\\s+)')\n\n # XXX this is not locale- or charset-aware -- string.lowercase\n # is US-ASCII only (and therefore English-only)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/textwrap.py_TextWrapper.sentence_end_re_TextWrapper._munge_whitespace.return.text": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/textwrap.py_TextWrapper.sentence_end_re_TextWrapper._munge_whitespace.return.text", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/textwrap.py", "file_name": "textwrap.py", "file_type": "text/x-python", "category": "implementation", "start_line": 90, "end_line": 131, "span_ids": ["TextWrapper", "TextWrapper.__init__", "TextWrapper._munge_whitespace"], "tokens": 351}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TextWrapper:\n sentence_end_re = re.compile(r'[a-z]' # lowercase letter\n r'[\\.\\!\\?]' # sentence-ending punct.\n r'[\\\"\\']?' # optional end-of-quote\n r'\\Z') # end of chunk\n\n\n def __init__(self,\n width: int = 70,\n initial_indent: str = \"\",\n subsequent_indent: str = \"\",\n expand_tabs: bool = True,\n replace_whitespace: bool = True,\n fix_sentence_endings: bool = False,\n break_long_words: bool = True,\n drop_whitespace: bool = True,\n break_on_hyphens: bool = True) -> None:\n self.width = width\n self.initial_indent = initial_indent\n self.subsequent_indent = subsequent_indent\n self.expand_tabs = expand_tabs\n self.replace_whitespace = replace_whitespace\n self.fix_sentence_endings = fix_sentence_endings\n self.break_long_words = break_long_words\n self.drop_whitespace = drop_whitespace\n self.break_on_hyphens = break_on_hyphens\n\n\n # -- Private methods -----------------------------------------------\n # (possibly useful for subclasses to override)\n\n def _munge_whitespace(self, text: str) -> str:\n \"\"\"_munge_whitespace(text : string) -> string\n\n Munge whitespace in text: expand tabs and convert all other\n whitespace characters to spaces. Eg. \" foo\\tbar\\n\\nbaz\"\n becomes \" foo bar baz\".\n \"\"\"\n if self.expand_tabs:\n text = text.expandtabs()\n if self.replace_whitespace:\n text = text.translate(self.unicode_whitespace_trans)\n return text", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/textwrap.py_TextWrapper._split_TextWrapper._split.return.chunks": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/textwrap.py_TextWrapper._split_TextWrapper._split.return.chunks", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/textwrap.py", "file_name": "textwrap.py", "file_type": "text/x-python", "category": "implementation", "start_line": 134, "end_line": 154, "span_ids": ["TextWrapper._split"], "tokens": 235}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TextWrapper:\n\n\n def _split(self, text: str) -> List[str]:\n \"\"\"_split(text : string) -> [string]\n\n Split the text to wrap into indivisible chunks. Chunks are\n not quite the same as words; see _wrap_chunks() for full\n details. As an example, the text\n Look, goof-ball -- use the -b option!\n breaks into the following chunks:\n 'Look,', ' ', 'goof-', 'ball', ' ', '--', ' ',\n 'use', ' ', 'the', ' ', '-b', ' ', 'option!'\n if break_on_hyphens is True, or in:\n 'Look,', ' ', 'goof-ball', ' ', '--', ' ',\n 'use', ' ', 'the', ' ', '-b', ' ', option!'\n otherwise.\n \"\"\"\n if self.break_on_hyphens is True:\n chunks = self.wordsep_re.split(text)\n else:\n chunks = self.wordsep_simple_re.split(text)\n chunks = [c for c in chunks if c]\n return chunks", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/textwrap.py_TextWrapper._fix_sentence_endings_TextWrapper._fix_sentence_endings.while_i_len_chunks_1_.if_chunks_i_1_and.else_.i_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/textwrap.py_TextWrapper._fix_sentence_endings_TextWrapper._fix_sentence_endings.while_i_len_chunks_1_.if_chunks_i_1_and.else_.i_1", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/textwrap.py", "file_name": "textwrap.py", "file_type": "text/x-python", "category": "implementation", "start_line": 156, "end_line": 172, "span_ids": ["TextWrapper._fix_sentence_endings"], "tokens": 175}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TextWrapper:\n\n def _fix_sentence_endings(self, chunks: List[str]) -> None:\n \"\"\"_fix_sentence_endings(chunks : [string])\n\n Correct for sentence endings buried in 'chunks'. Eg. when the\n original text contains \"... foo.\\nBar ...\", munge_whitespace()\n and split() will convert that to [..., \"foo.\", \" \", \"Bar\", ...]\n which has one too few spaces; this method simply changes the one\n space to two.\n \"\"\"\n i = 0\n patsearch = self.sentence_end_re.search\n while i < len(chunks)-1:\n if chunks[i+1] == \" \" and patsearch(chunks[i]):\n chunks[i+1] = \" \"\n i += 2\n else:\n i += 1", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/textwrap.py_TextWrapper._handle_long_word_TextWrapper._handle_long_word._devoted_to_the_long_wor": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/textwrap.py_TextWrapper._handle_long_word_TextWrapper._handle_long_word._devoted_to_the_long_wor", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/textwrap.py", "file_name": "textwrap.py", "file_type": "text/x-python", "category": "implementation", "start_line": 174, "end_line": 207, "span_ids": ["TextWrapper._handle_long_word"], "tokens": 362}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TextWrapper:\n\n def _handle_long_word(self, reversed_chunks: List[str],\n cur_line: List[str], cur_len: int,\n width: int) -> None:\n \"\"\"_handle_long_word(chunks : [string],\n cur_line : [string],\n cur_len : int, width : int)\n\n Handle a chunk of text (most likely a word, not whitespace) that\n is too long to fit in any line.\n \"\"\"\n # Figure out when indent is larger than the specified width, and make\n # sure at least one character is stripped off on every pass\n if width < 1:\n space_left = 1\n else:\n space_left = width - cur_len\n\n # If we're allowed to break long words, then do so: put as much\n # of the next chunk onto the current line as will fit.\n if self.break_long_words:\n cur_line.append(reversed_chunks[-1][:space_left])\n reversed_chunks[-1] = reversed_chunks[-1][space_left:]\n\n # Otherwise, we have to preserve the long word intact. Only add\n # it to the current line if there's nothing already there --\n # that minimizes how much we violate the width constraint.\n elif not cur_line:\n cur_line.append(reversed_chunks.pop())\n\n # If we're not allowed to break long words, and there's already\n # text on the current line, do nothing. Next time through the\n # main loop of _wrap_chunks(), we'll wind up here again, but\n # cur_len will be zero, so the next line will be entirely\n # devoted to the long word that we can't handle right now.", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/textwrap.py_TextWrapper._wrap_chunks_TextWrapper._wrap_chunks.return.lines": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/textwrap.py_TextWrapper._wrap_chunks_TextWrapper._wrap_chunks.return.lines", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/textwrap.py", "file_name": "textwrap.py", "file_type": "text/x-python", "category": "implementation", "start_line": 209, "end_line": 277, "span_ids": ["TextWrapper._wrap_chunks"], "tokens": 604}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TextWrapper:\n\n def _wrap_chunks(self, chunks: List[str]) -> List[str]:\n \"\"\"_wrap_chunks(chunks : [string]) -> [string]\n\n Wrap a sequence of text chunks and return a list of lines of\n length 'self.width' or less. (If 'break_long_words' is false,\n some lines may be longer than this.) Chunks correspond roughly\n to words and the whitespace between them: each chunk is\n indivisible (modulo 'break_long_words'), but a line break can\n come between any two chunks. Chunks should not have internal\n whitespace; ie. a chunk is either all whitespace or a \"word\".\n Whitespace chunks will be removed from the beginning and end of\n lines, but apart from that whitespace is preserved.\n \"\"\"\n lines = [] # type: List[str]\n if self.width <= 0:\n raise ValueError(\"invalid width %r (must be > 0)\" % self.width)\n\n # Arrange in reverse order so items can be efficiently popped\n # from a stack of chucks.\n chunks.reverse()\n\n while chunks:\n\n # Start the list of chunks that will make up the current line.\n # cur_len is just the length of all the chunks in cur_line.\n cur_line = [] # type: List[str]\n cur_len = 0\n\n # Figure out which static string will prefix this line.\n if lines:\n indent = self.subsequent_indent\n else:\n indent = self.initial_indent\n\n # Maximum width for this line.\n width = self.width - len(indent)\n\n # First chunk on line is whitespace -- drop it, unless this\n # is the very beginning of the text (ie. no lines started yet).\n if self.drop_whitespace and chunks[-1].strip() == '' and lines:\n del chunks[-1]\n\n while chunks:\n l = len(chunks[-1])\n\n # Can at least squeeze this chunk onto the current line.\n if cur_len + l <= width:\n cur_line.append(chunks.pop())\n cur_len += l\n\n # Nope, this line is full.\n else:\n break\n\n # The current line is full, and the next chunk is too big to\n # fit on *any* line (not just this one).\n if chunks and len(chunks[-1]) > width:\n self._handle_long_word(chunks, cur_line, cur_len, width)\n\n # If the last chunk on this line is all whitespace, drop it.\n if self.drop_whitespace and cur_line and cur_line[-1].strip() == '':\n del cur_line[-1]\n\n # Convert current line back to a string and store it in list\n # of all lines (return value).\n if cur_line:\n lines.append(indent + ''.join(cur_line))\n\n return lines", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/textwrap.py_TextWrapper._Public_interface__TextWrapper.fill.return._n_join_self_wrap_text_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/textwrap.py_TextWrapper._Public_interface__TextWrapper.fill.return._n_join_self_wrap_text_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/textwrap.py", "file_name": "textwrap.py", "file_type": "text/x-python", "category": "implementation", "start_line": 280, "end_line": 304, "span_ids": ["TextWrapper.wrap", "TextWrapper._wrap_chunks", "TextWrapper.fill"], "tokens": 223}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TextWrapper:\n\n\n # -- Public interface ----------------------------------------------\n\n def wrap(self, text: str) -> List[str]:\n \"\"\"wrap(text : string) -> [string]\n\n Reformat the single paragraph in 'text' so it fits in lines of\n no more than 'self.width' columns, and return a list of wrapped\n lines. Tabs in 'text' are expanded with string.expandtabs(),\n and all other whitespace characters (including newline) are\n converted to space.\n \"\"\"\n text = self._munge_whitespace(text)\n chunks = self._split(text)\n if self.fix_sentence_endings:\n self._fix_sentence_endings(chunks)\n return self._wrap_chunks(chunks)\n\n def fill(self, text: str) -> str:\n \"\"\"fill(text : string) -> string\n\n Reformat the single paragraph in 'text' to fit in lines of no\n more than 'self.width' columns, and return a new string\n containing the entire wrapped paragraph.\n \"\"\"\n return \"\\n\".join(self.wrap(text))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/textwrap.py__Convenience_interfac_wrap.return.w_wrap_text_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/textwrap.py__Convenience_interfac_wrap.return.w_wrap_text_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/textwrap.py", "file_name": "textwrap.py", "file_type": "text/x-python", "category": "implementation", "start_line": 307, "end_line": 320, "span_ids": ["wrap", "TextWrapper.fill"], "tokens": 151}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# -- Convenience interface ---------------------------------------------\n\ndef wrap(text: str, width: int = 70, **kwargs: Any) -> List[str]:\n \"\"\"Wrap a single paragraph of text, returning a list of wrapped lines.\n\n Reformat the single paragraph in 'text' so it fits in lines of no\n more than 'width' columns, and return a list of wrapped lines. By\n default, tabs in 'text' are expanded with string.expandtabs(), and\n all other whitespace characters (including newline) are converted to\n space. See TextWrapper class for available keyword args to customize\n wrapping behaviour.\n \"\"\"\n w = TextWrapper(width=width, **kwargs)\n return w.wrap(text)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/textwrap.py_fill__leading_whitespace_re.re_compile_t_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/textwrap.py_fill__leading_whitespace_re.re_compile_t_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/textwrap.py", "file_name": "textwrap.py", "file_type": "text/x-python", "category": "implementation", "start_line": 322, "end_line": 338, "span_ids": ["fill", "impl:5"], "tokens": 176}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def fill(text: str, width: int = 70, **kwargs: Any) -> str:\n \"\"\"Fill a single paragraph of text, returning a new string.\n\n Reformat the single paragraph in 'text' to fit in lines of no more\n than 'width' columns, and return a new string containing the entire\n wrapped paragraph. As with wrap(), tabs are expanded and other\n whitespace characters converted to space. See TextWrapper class for\n available keyword args to customize wrapping behaviour.\n \"\"\"\n w = TextWrapper(width=width, **kwargs)\n return w.fill(text)\n\n\n# -- Loosely related functionality -------------------------------------\n\n_whitespace_only_re = re.compile('^[ \\t]+$', re.MULTILINE)\n_leading_whitespace_re = re.compile('(^[ \\t]*)(?:[^ \\t\\n])', re.MULTILINE)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/textwrap.py_dedent_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/stdlib-samples/3.2/textwrap.py_dedent_", "embedding": null, "metadata": {"file_path": "test-data/stdlib-samples/3.2/textwrap.py", "file_name": "textwrap.py", "file_type": "text/x-python", "category": "implementation", "start_line": 340, "end_line": 392, "span_ids": ["impl:9", "dedent"], "tokens": 440}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def dedent(text: str) -> str:\n \"\"\"Remove any common leading whitespace from every line in `text`.\n\n This can be used to make triple-quoted strings line up with the left\n edge of the display, while still presenting them in the source code\n in indented form.\n\n Note that tabs and spaces are both treated as whitespace, but they\n are not equal: the lines \" hello\" and \"\\thello\" are\n considered to have no common leading whitespace. (This behaviour is\n new in Python 2.5; older versions of this module incorrectly\n expanded tabs before searching for common leading whitespace.)\n \"\"\"\n # Look for the longest leading string of spaces and tabs common to\n # all lines.\n margin = None # type: str\n text = _whitespace_only_re.sub('', text)\n indents = _leading_whitespace_re.findall(text)\n for indent in indents:\n if margin is None:\n margin = indent\n\n # Current line more deeply indented than previous winner:\n # no change (previous winner is still on top).\n elif indent.startswith(margin):\n pass\n\n # Current line consistent with and no deeper than previous winner:\n # it's the new winner.\n elif margin.startswith(indent):\n margin = indent\n\n # Current line and previous winner have no common whitespace:\n # there is no margin.\n else:\n margin = \"\"\n break\n\n # sanity check (testing/debugging only)\n if 0 and margin:\n for line in text.split(\"\\n\"):\n assert not line or line.startswith(margin), \\\n \"line = %r, margin = %r\" % (line, margin)\n\n if margin:\n text = re.sub(r'(?m)^' + margin, '', text)\n return text\n\nif __name__ == \"__main__\":\n #print dedent(\"\\tfoo\\n\\tbar\")\n #print dedent(\" \\thello there\\n \\t how are you?\")\n print(dedent(\"Hello there.\\n This is indented.\"))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/arg_kinds.py_sys_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/arg_kinds.py_sys_", "embedding": null, "metadata": {"file_path": "test-data/unit/plugins/arg_kinds.py", "file_name": "arg_kinds.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 35, "span_ids": ["extract_arg_kinds_from_function", "plugin", "imports", "ArgKindsPlugin.get_method_hook", "extract_arg_kinds_from_method", "ArgKindsPlugin", "ArgKindsPlugin.get_function_hook"], "tokens": 214}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import sys\nfrom typing import Optional, Callable\n\nfrom mypy.nodes import Context\nfrom mypy.plugin import Plugin, MethodContext, FunctionContext\nfrom mypy.types import Type\n\n\nclass ArgKindsPlugin(Plugin):\n def get_function_hook(self, fullname: str\n ) -> Optional[Callable[[FunctionContext], Type]]:\n if 'func' in fullname:\n return extract_arg_kinds_from_function\n return None\n\n def get_method_hook(self, fullname: str\n ) -> Optional[Callable[[MethodContext], Type]]:\n if 'Class.method' in fullname:\n return extract_arg_kinds_from_method\n return None\n\n\ndef extract_arg_kinds_from_function(ctx: FunctionContext) -> Type:\n ctx.api.fail(str(ctx.arg_kinds), ctx.context)\n return ctx.default_return_type\n\n\ndef extract_arg_kinds_from_method(ctx: MethodContext) -> Type:\n ctx.api.fail(str(ctx.arg_kinds), ctx.context)\n return ctx.default_return_type\n\n\ndef plugin(version):\n return ArgKindsPlugin", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/arg_names.py_from_typing_import_Option_ArgNamesPlugin.get_method_hook.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/arg_names.py_from_typing_import_Option_ArgNamesPlugin.get_method_hook.return.None", "embedding": null, "metadata": {"file_path": "test-data/unit/plugins/arg_names.py", "file_name": "arg_names.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 21, "span_ids": ["imports", "ArgNamesPlugin", "ArgNamesPlugin.get_method_hook", "ArgNamesPlugin.get_function_hook"], "tokens": 200}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from typing import Optional, Callable\n\nfrom mypy.plugin import Plugin, MethodContext, FunctionContext\nfrom mypy.types import Type\n\n\nclass ArgNamesPlugin(Plugin):\n def get_function_hook(self, fullname: str\n ) -> Optional[Callable[[FunctionContext], Type]]:\n if fullname in {'mod.func', 'mod.func_unfilled', 'mod.func_star_expr',\n 'mod.ClassInit', 'mod.Outer.NestedClassInit'}:\n return extract_classname_and_set_as_return_type_function\n return None\n\n def get_method_hook(self, fullname: str\n ) -> Optional[Callable[[MethodContext], Type]]:\n if fullname in {'mod.Class.method', 'mod.Class.myclassmethod', 'mod.Class.mystaticmethod',\n 'mod.ClassUnfilled.method', 'mod.ClassStarExpr.method',\n 'mod.ClassChild.method', 'mod.ClassChild.myclassmethod'}:\n return extract_classname_and_set_as_return_type_method\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/arg_names.py_extract_classname_and_set_as_return_type_function_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/arg_names.py_extract_classname_and_set_as_return_type_function_", "embedding": null, "metadata": {"file_path": "test-data/unit/plugins/arg_names.py", "file_name": "arg_names.py", "file_type": "text/x-python", "category": "implementation", "start_line": 24, "end_line": 36, "span_ids": ["extract_classname_and_set_as_return_type_function", "plugin", "extract_classname_and_set_as_return_type_method"], "tokens": 109}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def extract_classname_and_set_as_return_type_function(ctx: FunctionContext) -> Type:\n classname = ctx.args[ctx.callee_arg_names.index('classname')][0].value\n return ctx.api.named_generic_type(classname, [])\n\n\ndef extract_classname_and_set_as_return_type_method(ctx: MethodContext) -> Type:\n classname = ctx.args[ctx.callee_arg_names.index('classname')][0].value\n return ctx.api.named_generic_type(classname, [])\n\n\ndef plugin(version):\n return ArgNamesPlugin", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/attrhook.py_from_typing_import_Option_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/attrhook.py_from_typing_import_Option_", "embedding": null, "metadata": {"file_path": "test-data/unit/plugins/attrhook.py", "file_name": "attrhook.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 22, "span_ids": ["plugin", "imports", "signal_call_callback", "AttrPlugin", "AttrPlugin.get_attribute_hook"], "tokens": 116}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from typing import Optional, Callable\n\nfrom mypy.plugin import Plugin, AttributeContext\nfrom mypy.types import Type, Instance\n\n\nclass AttrPlugin(Plugin):\n def get_attribute_hook(self, fullname: str) -> Optional[Callable[[AttributeContext], Type]]:\n if fullname == 'm.Signal.__call__':\n return signal_call_callback\n return None\n\n\ndef signal_call_callback(ctx: AttributeContext) -> Type:\n if isinstance(ctx.type, Instance):\n return ctx.type.args[0]\n return ctx.default_attr_type\n\n\ndef plugin(version):\n return AttrPlugin", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/attrhook2.py_from_typing_import_Option_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/attrhook2.py_from_typing_import_Option_", "embedding": null, "metadata": {"file_path": "test-data/unit/plugins/attrhook2.py", "file_name": "attrhook2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 27, "span_ids": ["plugin", "imports", "nonexistent_field_callback", "magic_field_callback", "AttrPlugin", "AttrPlugin.get_attribute_hook"], "tokens": 164}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from typing import Optional, Callable\n\nfrom mypy.plugin import Plugin, AttributeContext\nfrom mypy.types import Type, AnyType, TypeOfAny\n\n\nclass AttrPlugin(Plugin):\n def get_attribute_hook(self, fullname: str) -> Optional[Callable[[AttributeContext], Type]]:\n if fullname == 'm.Magic.magic_field':\n return magic_field_callback\n if fullname == 'm.Magic.nonexistent_field':\n return nonexistent_field_callback\n return None\n\n\ndef magic_field_callback(ctx: AttributeContext) -> Type:\n return ctx.api.named_generic_type(\"builtins.str\", [])\n\n\ndef nonexistent_field_callback(ctx: AttributeContext) -> Type:\n ctx.api.fail(\"Field does not exist\", ctx.context)\n return AnyType(TypeOfAny.from_error)\n\n\ndef plugin(version):\n return AttrPlugin", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/badreturn.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/badreturn.py__", "embedding": null, "metadata": {"file_path": "test-data/unit/plugins/badreturn.py", "file_name": "badreturn.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 3, "span_ids": ["plugin"], "tokens": 6}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def plugin(version):\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/badreturn2.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/badreturn2.py__", "embedding": null, "metadata": {"file_path": "test-data/unit/plugins/badreturn2.py", "file_name": "badreturn2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 6, "span_ids": ["plugin", "MyPlugin"], "tokens": 15}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MyPlugin:\n pass\n\ndef plugin(version):\n return MyPlugin", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/callable_instance.py_from_mypy_plugin_import_M_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/callable_instance.py_from_mypy_plugin_import_M_", "embedding": null, "metadata": {"file_path": "test-data/unit/plugins/callable_instance.py", "file_name": "callable_instance.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 24, "span_ids": ["CallableInstancePlugin.get_method_hook", "CallableInstancePlugin.get_function_hook", "plugin", "imports", "CallableInstancePlugin", "my_hook"], "tokens": 145}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from mypy.plugin import MethodContext, Plugin\nfrom mypy.types import Instance, Type\n\nclass CallableInstancePlugin(Plugin):\n def get_function_hook(self, fullname):\n assert not fullname.endswith(' of Foo')\n\n def get_method_hook(self, fullname):\n # Ensure that all names are fully qualified\n assert not fullname.endswith(' of Foo')\n\n if fullname == '__main__.Class.__call__':\n return my_hook\n\n return None\n\ndef my_hook(ctx: MethodContext) -> Type:\n if isinstance(ctx.type, Instance) and len(ctx.type.args) == 1:\n return ctx.type.args[0]\n return ctx.default_return_type\n\ndef plugin(version):\n return CallableInstancePlugin", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/class_callable.py_from_mypy_plugin_import_P_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/class_callable.py_from_mypy_plugin_import_P_", "embedding": null, "metadata": {"file_path": "test-data/unit/plugins/class_callable.py", "file_name": "class_callable.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 33, "span_ids": ["plugin", "attr_hook", "imports", "AttrPlugin.get_function_hook", "AttrPlugin"], "tokens": 256}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from mypy.plugin import Plugin\nfrom mypy.nodes import NameExpr\nfrom mypy.types import UnionType, NoneType, Instance\n\nclass AttrPlugin(Plugin):\n def get_function_hook(self, fullname):\n if fullname.startswith('mod.Attr'):\n return attr_hook\n return None\n\ndef attr_hook(ctx):\n assert isinstance(ctx.default_return_type, Instance)\n if ctx.default_return_type.type.fullname == 'mod.Attr':\n attr_base = ctx.default_return_type\n else:\n attr_base = None\n for base in ctx.default_return_type.type.bases:\n if base.type.fullname == 'mod.Attr':\n attr_base = base\n break\n assert attr_base is not None\n last_arg_exprs = ctx.args[-1]\n if any(isinstance(expr, NameExpr) and expr.name == 'True' for expr in last_arg_exprs):\n return attr_base\n assert len(attr_base.args) == 1\n arg_type = attr_base.args[0]\n return Instance(attr_base.type, [UnionType([arg_type, NoneType()])],\n line=ctx.default_return_type.line,\n column=ctx.default_return_type.column)\n\ndef plugin(version):\n return AttrPlugin", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/common_api_incremental.py_from_mypy_plugin_import_P_DynPlugin.get_base_class_hook.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/common_api_incremental.py_from_mypy_plugin_import_P_DynPlugin.get_base_class_hook.return.None", "embedding": null, "metadata": {"file_path": "test-data/unit/plugins/common_api_incremental.py", "file_name": "common_api_incremental.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 18, "span_ids": ["DynPlugin", "imports", "DynPlugin.get_base_class_hook", "DynPlugin.get_dynamic_class_hook"], "tokens": 126}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from mypy.plugin import Plugin\nfrom mypy.nodes import (\n ClassDef, Block, TypeInfo, SymbolTable, SymbolTableNode, MDEF, GDEF, Var\n)\n\n\nclass DynPlugin(Plugin):\n def get_dynamic_class_hook(self, fullname):\n if fullname == 'lib.declarative_base':\n return add_info_hook\n return None\n\n def get_base_class_hook(self, fullname: str):\n sym = self.lookup_fully_qualified(fullname)\n if sym and isinstance(sym.node, TypeInfo):\n if sym.node.metadata.get('magic'):\n return add_magic_hook\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/common_api_incremental.py_add_info_hook_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/common_api_incremental.py_add_info_hook_", "embedding": null, "metadata": {"file_path": "test-data/unit/plugins/common_api_incremental.py", "file_name": "common_api_incremental.py", "file_type": "text/x-python", "category": "implementation", "start_line": 21, "end_line": 45, "span_ids": ["add_info_hook", "add_magic_hook", "plugin"], "tokens": 197}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_info_hook(ctx) -> None:\n class_def = ClassDef(ctx.name, Block([]))\n class_def.fullname = ctx.api.qualified_name(ctx.name)\n\n info = TypeInfo(SymbolTable(), class_def, ctx.api.cur_mod_id)\n class_def.info = info\n obj = ctx.api.builtin_type('builtins.object')\n info.mro = [info, obj.type]\n info.bases = [obj]\n ctx.api.add_symbol_table_node(ctx.name, SymbolTableNode(GDEF, info))\n info.metadata['magic'] = True\n\n\ndef add_magic_hook(ctx) -> None:\n info = ctx.cls.info\n str_type = ctx.api.named_type_or_none('builtins.str', [])\n assert str_type is not None\n var = Var('__magic__', str_type)\n var.info = info\n info.names['__magic__'] = SymbolTableNode(MDEF, var)\n\n\ndef plugin(version):\n return DynPlugin", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/config_data.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/config_data.py__", "embedding": null, "metadata": {"file_path": "test-data/unit/plugins/config_data.py", "file_name": "config_data.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 19, "span_ids": ["plugin", "imports", "ConfigDataPlugin.report_config_data", "ConfigDataPlugin"], "tokens": 87}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nimport json\n\nfrom typing import Any\n\nfrom mypy.plugin import Plugin, ReportConfigContext\n\n\nclass ConfigDataPlugin(Plugin):\n def report_config_data(self, ctx: ReportConfigContext) -> Any:\n path = os.path.join('tmp/test.json')\n with open(path) as f:\n data = json.load(f)\n return data.get(ctx.id)\n\n\ndef plugin(version):\n return ConfigDataPlugin", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/customentry.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/customentry.py__", "embedding": null, "metadata": {"file_path": "test-data/unit/plugins/customentry.py", "file_name": "customentry.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 15, "span_ids": ["register", "imports", "MyPlugin", "MyPlugin.get_function_hook", "my_hook"], "tokens": 73}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from mypy.plugin import Plugin\n\nclass MyPlugin(Plugin):\n def get_function_hook(self, fullname):\n if fullname == '__main__.f':\n return my_hook\n assert fullname is not None\n return None\n\ndef my_hook(ctx):\n return ctx.api.named_generic_type('builtins.int', [])\n\ndef register(version):\n return MyPlugin", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/customize_mro.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/customize_mro.py__", "embedding": null, "metadata": {"file_path": "test-data/unit/plugins/customize_mro.py", "file_name": "customize_mro.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 11, "span_ids": ["plugin", "imports", "DummyPlugin", "DummyPlugin.get_customize_class_mro_hook"], "tokens": 47}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from mypy.plugin import Plugin\n\nclass DummyPlugin(Plugin):\n def get_customize_class_mro_hook(self, fullname):\n def analyze(classdef_ctx):\n pass\n return analyze\n\ndef plugin(version):\n return DummyPlugin", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/decimal_to_int.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/decimal_to_int.py__", "embedding": null, "metadata": {"file_path": "test-data/unit/plugins/decimal_to_int.py", "file_name": "decimal_to_int.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 19, "span_ids": ["plugin", "imports", "MyPlugin.get_type_analyze_hook", "MyPlugin", "decimal_to_int_hook"], "tokens": 97}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import builtins\nfrom typing import Optional, Callable\n\nfrom mypy.plugin import Plugin, AnalyzeTypeContext\nfrom mypy.types import CallableType, Type\n\n\nclass MyPlugin(Plugin):\n def get_type_analyze_hook(self, fullname):\n if fullname == \"decimal.Decimal\":\n return decimal_to_int_hook\n return None\n\ndef plugin(version):\n return MyPlugin\n\ndef decimal_to_int_hook(ctx):\n return ctx.api.named_type('builtins.int', [])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/depshook.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/depshook.py__", "embedding": null, "metadata": {"file_path": "test-data/unit/plugins/depshook.py", "file_name": "depshook.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 16, "span_ids": ["imports", "DepsPlugin", "plugin", "DepsPlugin.get_additional_deps"], "tokens": 89}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from typing import Optional, Callable, List, Tuple\n\nfrom mypy.plugin import Plugin\nfrom mypy.nodes import MypyFile\n\n\nclass DepsPlugin(Plugin):\n def get_additional_deps(self, file: MypyFile) -> List[Tuple[int, str, int]]:\n if file.fullname == '__main__':\n return [(10, 'err', -1)]\n return []\n\n\ndef plugin(version):\n return DepsPlugin", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/descriptor.py_from_mypy_plugin_import_P_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/descriptor.py_from_mypy_plugin_import_P_", "embedding": null, "metadata": {"file_path": "test-data/unit/plugins/descriptor.py", "file_name": "descriptor.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 35, "span_ids": ["get_hook", "DescriptorPlugin.get_method_hook", "plugin", "imports", "DescriptorPlugin", "DescriptorPlugin.get_method_signature_hook", "set_hook"], "tokens": 194}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from mypy.plugin import Plugin\nfrom mypy.types import NoneType, CallableType\n\n\nclass DescriptorPlugin(Plugin):\n def get_method_hook(self, fullname):\n if fullname == \"__main__.Desc.__get__\":\n return get_hook\n return None\n\n def get_method_signature_hook(self, fullname):\n if fullname == \"__main__.Desc.__set__\":\n return set_hook\n return None\n\n\ndef get_hook(ctx):\n if isinstance(ctx.arg_types[0][0], NoneType):\n return ctx.api.named_type(\"builtins.str\")\n return ctx.api.named_type(\"builtins.int\")\n\n\ndef set_hook(ctx):\n return CallableType(\n [ctx.api.named_type(\"__main__.Cls\"), ctx.api.named_type(\"builtins.int\")],\n ctx.default_signature.arg_kinds,\n ctx.default_signature.arg_names,\n ctx.default_signature.ret_type,\n ctx.default_signature.fallback,\n )\n\n\ndef plugin(version):\n return DescriptorPlugin", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/dyn_class.py_from_mypy_plugin_import_P_DynPlugin.get_base_class_hook.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/dyn_class.py_from_mypy_plugin_import_P_DynPlugin.get_base_class_hook.return.None", "embedding": null, "metadata": {"file_path": "test-data/unit/plugins/dyn_class.py", "file_name": "dyn_class.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 18, "span_ids": ["DynPlugin", "imports", "DynPlugin.get_base_class_hook", "DynPlugin.get_dynamic_class_hook"], "tokens": 113}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from mypy.plugin import Plugin\nfrom mypy.nodes import (\n ClassDef, Block, TypeInfo, SymbolTable, SymbolTableNode, GDEF, Var\n)\nfrom mypy.types import Instance\n\nDECL_BASES = set()\n\nclass DynPlugin(Plugin):\n def get_dynamic_class_hook(self, fullname):\n if fullname == 'mod.declarative_base':\n return add_info_hook\n return None\n\n def get_base_class_hook(self, fullname: str):\n if fullname in DECL_BASES:\n return replace_col_hook\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/dyn_class.py_add_info_hook_add_info_hook.DECL_BASES_add_class_def_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/dyn_class.py_add_info_hook_add_info_hook.DECL_BASES_add_class_def_", "embedding": null, "metadata": {"file_path": "test-data/unit/plugins/dyn_class.py", "file_name": "dyn_class.py", "file_type": "text/x-python", "category": "implementation", "start_line": 20, "end_line": 30, "span_ids": ["add_info_hook"], "tokens": 115}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_info_hook(ctx):\n class_def = ClassDef(ctx.name, Block([]))\n class_def.fullname = ctx.api.qualified_name(ctx.name)\n\n info = TypeInfo(SymbolTable(), class_def, ctx.api.cur_mod_id)\n class_def.info = info\n obj = ctx.api.builtin_type('builtins.object')\n info.mro = [info, obj.type]\n info.bases = [obj]\n ctx.api.add_symbol_table_node(ctx.name, SymbolTableNode(GDEF, info))\n DECL_BASES.add(class_def.fullname)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/dyn_class.py_replace_col_hook_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/dyn_class.py_replace_col_hook_", "embedding": null, "metadata": {"file_path": "test-data/unit/plugins/dyn_class.py", "file_name": "dyn_class.py", "file_type": "text/x-python", "category": "implementation", "start_line": 32, "end_line": 48, "span_ids": ["replace_col_hook", "plugin"], "tokens": 122}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def replace_col_hook(ctx):\n info = ctx.cls.info\n for sym in info.names.values():\n node = sym.node\n if isinstance(node, Var) and isinstance(node.type, Instance):\n if node.type.type.fullname == 'mod.Column':\n new_sym = ctx.api.lookup_fully_qualified_or_none('mod.Instr')\n if new_sym:\n new_info = new_sym.node\n assert isinstance(new_info, TypeInfo)\n node.type = Instance(new_info, node.type.args,\n node.type.line,\n node.type.column)\n\ndef plugin(version):\n return DynPlugin", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/dyn_class_from_method.py_from_mypy_nodes_import_B_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/dyn_class_from_method.py_from_mypy_nodes_import_B_", "embedding": null, "metadata": {"file_path": "test-data/unit/plugins/dyn_class_from_method.py", "file_name": "dyn_class_from_method.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 29, "span_ids": ["DynPlugin", "add_info_hook", "plugin", "DynPlugin.get_dynamic_class_hook", "imports"], "tokens": 243}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from mypy.nodes import (Block, ClassDef, GDEF, SymbolTable, SymbolTableNode, TypeInfo)\nfrom mypy.plugin import DynamicClassDefContext, Plugin\nfrom mypy.types import Instance\n\n\nclass DynPlugin(Plugin):\n def get_dynamic_class_hook(self, fullname):\n if 'from_queryset' in fullname:\n return add_info_hook\n return None\n\n\ndef add_info_hook(ctx: DynamicClassDefContext):\n class_def = ClassDef(ctx.name, Block([]))\n class_def.fullname = ctx.api.qualified_name(ctx.name)\n\n info = TypeInfo(SymbolTable(), class_def, ctx.api.cur_mod_id)\n class_def.info = info\n queryset_type_fullname = ctx.call.args[0].fullname\n queryset_info = ctx.api.lookup_fully_qualified_or_none(queryset_type_fullname).node # type: TypeInfo\n obj = ctx.api.builtin_type('builtins.object')\n info.mro = [info, queryset_info, obj.type]\n info.bases = [Instance(queryset_info, [])]\n ctx.api.add_symbol_table_node(ctx.name, SymbolTableNode(GDEF, info))\n\n\ndef plugin(version):\n return DynPlugin", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/fnplugin.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/fnplugin.py__", "embedding": null, "metadata": {"file_path": "test-data/unit/plugins/fnplugin.py", "file_name": "fnplugin.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 15, "span_ids": ["plugin", "imports", "MyPlugin", "MyPlugin.get_function_hook", "my_hook"], "tokens": 73}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from mypy.plugin import Plugin\n\nclass MyPlugin(Plugin):\n def get_function_hook(self, fullname):\n if fullname == '__main__.f':\n return my_hook\n assert fullname is not None\n return None\n\ndef my_hook(ctx):\n return ctx.api.named_generic_type('builtins.int', [])\n\ndef plugin(version):\n return MyPlugin", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/fully_qualified_test_hook.py_from_mypy_plugin_import_C_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/fully_qualified_test_hook.py_from_mypy_plugin_import_C_", "embedding": null, "metadata": {"file_path": "test-data/unit/plugins/fully_qualified_test_hook.py", "file_name": "fully_qualified_test_hook.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 17, "span_ids": ["plugin", "FullyQualifiedTestPlugin", "imports", "FullyQualifiedTestPlugin.get_method_signature_hook", "my_hook"], "tokens": 124}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from mypy.plugin import CallableType, MethodSigContext, Plugin\n\nclass FullyQualifiedTestPlugin(Plugin):\n def get_method_signature_hook(self, fullname):\n # Ensure that all names are fully qualified\n if 'FullyQualifiedTest' in fullname:\n assert fullname.startswith('__main__.') and not ' of ' in fullname, fullname\n return my_hook\n\n return None\n\ndef my_hook(ctx: MethodSigContext) -> CallableType:\n return ctx.default_signature.copy_modified(ret_type=ctx.api.named_generic_type('builtins.int', []))\n\ndef plugin(version):\n return FullyQualifiedTestPlugin", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/function_sig_hook.py_from_mypy_plugin_import_C_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/function_sig_hook.py_from_mypy_plugin_import_C_", "embedding": null, "metadata": {"file_path": "test-data/unit/plugins/function_sig_hook.py", "file_name": "function_sig_hook.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 27, "span_ids": ["FunctionSigPlugin.get_function_signature_hook", "plugin", "imports", "_str_to_int", "FunctionSigPlugin", "my_hook"], "tokens": 212}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from mypy.plugin import CallableType, CheckerPluginInterface, FunctionSigContext, Plugin\nfrom mypy.types import Instance, Type\n\nclass FunctionSigPlugin(Plugin):\n def get_function_signature_hook(self, fullname):\n if fullname == '__main__.dynamic_signature':\n return my_hook\n return None\n\ndef _str_to_int(api: CheckerPluginInterface, typ: Type) -> Type:\n if isinstance(typ, Instance):\n if typ.type.fullname == 'builtins.str':\n return api.named_generic_type('builtins.int', [])\n elif typ.args:\n return typ.copy_modified(args=[_str_to_int(api, t) for t in typ.args])\n\n return typ\n\ndef my_hook(ctx: FunctionSigContext) -> CallableType:\n return ctx.default_signature.copy_modified(\n arg_types=[_str_to_int(ctx.api, t) for t in ctx.default_signature.arg_types],\n ret_type=_str_to_int(ctx.api, ctx.default_signature.ret_type),\n )\n\ndef plugin(version):\n return FunctionSigPlugin", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/method_sig_hook.py_from_mypy_plugin_import_C_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/method_sig_hook.py_from_mypy_plugin_import_C_", "embedding": null, "metadata": {"file_path": "test-data/unit/plugins/method_sig_hook.py", "file_name": "method_sig_hook.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 31, "span_ids": ["plugin", "imports", "MethodSigPlugin", "_str_to_int", "MethodSigPlugin.get_method_signature_hook", "my_hook"], "tokens": 231}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from mypy.plugin import CallableType, CheckerPluginInterface, MethodSigContext, Plugin\nfrom mypy.types import Instance, Type\n\nclass MethodSigPlugin(Plugin):\n def get_method_signature_hook(self, fullname):\n # Ensure that all names are fully qualified\n assert not fullname.endswith(' of Foo')\n\n if fullname.startswith('__main__.Foo.'):\n return my_hook\n\n return None\n\ndef _str_to_int(api: CheckerPluginInterface, typ: Type) -> Type:\n if isinstance(typ, Instance):\n if typ.type.fullname == 'builtins.str':\n return api.named_generic_type('builtins.int', [])\n elif typ.args:\n return typ.copy_modified(args=[_str_to_int(api, t) for t in typ.args])\n\n return typ\n\ndef my_hook(ctx: MethodSigContext) -> CallableType:\n return ctx.default_signature.copy_modified(\n arg_types=[_str_to_int(ctx.api, t) for t in ctx.default_signature.arg_types],\n ret_type=_str_to_int(ctx.api, ctx.default_signature.ret_type),\n )\n\ndef plugin(version):\n return MethodSigPlugin", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/named_callable.py_from_mypy_plugin_import_P_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/named_callable.py_from_mypy_plugin_import_P_", "embedding": null, "metadata": {"file_path": "test-data/unit/plugins/named_callable.py", "file_name": "named_callable.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 29, "span_ids": ["plugin", "imports", "decorator_call_hook", "decorate_hook", "MyPlugin", "MyPlugin.get_function_hook"], "tokens": 172}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from mypy.plugin import Plugin\nfrom mypy.types import CallableType\n\n\nclass MyPlugin(Plugin):\n def get_function_hook(self, fullname):\n if fullname == 'm.decorator1':\n return decorator_call_hook\n if fullname == 'm._decorated': # This is a dummy name generated by the plugin\n return decorate_hook\n return None\n\n\ndef decorator_call_hook(ctx):\n if isinstance(ctx.default_return_type, CallableType):\n return ctx.default_return_type.copy_modified(name='m._decorated')\n return ctx.default_return_type\n\n\ndef decorate_hook(ctx):\n if isinstance(ctx.default_return_type, CallableType):\n return ctx.default_return_type.copy_modified(\n ret_type=ctx.api.named_generic_type('builtins.str', []))\n return ctx.default_return_type\n\n\ndef plugin(version):\n return MyPlugin", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/noentry.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/noentry.py__", "embedding": null, "metadata": {"file_path": "test-data/unit/plugins/noentry.py", "file_name": "noentry.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 2, "span_ids": ["docstring"], "tokens": 3}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# empty plugin", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/plugin2.py__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/plugin2.py__", "embedding": null, "metadata": {"file_path": "test-data/unit/plugins/plugin2.py", "file_name": "plugin2.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 14, "span_ids": ["plugin", "imports", "Plugin2.get_function_hook", "str_hook", "Plugin2"], "tokens": 72}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from mypy.plugin import Plugin\n\nclass Plugin2(Plugin):\n def get_function_hook(self, fullname):\n if fullname in ('__main__.f', '__main__.g'):\n return str_hook\n return None\n\ndef str_hook(ctx):\n return ctx.api.named_generic_type('builtins.str', [])\n\ndef plugin(version):\n return Plugin2", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/type_anal_hook.py_from_typing_import_Option_TypeAnalyzePlugin.get_type_analyze_hook.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/type_anal_hook.py_from_typing_import_Option_TypeAnalyzePlugin.get_type_analyze_hook.return.None", "embedding": null, "metadata": {"file_path": "test-data/unit/plugins/type_anal_hook.py", "file_name": "type_anal_hook.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 14, "span_ids": ["imports", "TypeAnalyzePlugin", "TypeAnalyzePlugin.get_type_analyze_hook"], "tokens": 132}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from typing import Optional, Callable\n\nfrom mypy.plugin import Plugin, AnalyzeTypeContext\nfrom mypy.types import Type, UnboundType, TypeList, AnyType, CallableType, TypeOfAny\n# The official name changed to NoneType but we have an alias for plugin compat reasons\n# so we'll keep testing that here.\nfrom mypy.types import NoneTyp\n\nclass TypeAnalyzePlugin(Plugin):\n def get_type_analyze_hook(self, fullname: str\n ) -> Optional[Callable[[AnalyzeTypeContext], Type]]:\n if fullname == 'm.Signal':\n return signal_type_analyze_callback\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/type_anal_hook.py_signal_type_analyze_callback_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/type_anal_hook.py_signal_type_analyze_callback_", "embedding": null, "metadata": {"file_path": "test-data/unit/plugins/type_anal_hook.py", "file_name": "type_anal_hook.py", "file_type": "text/x-python", "category": "implementation", "start_line": 17, "end_line": 40, "span_ids": ["signal_type_analyze_callback", "plugin"], "tokens": 214}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def signal_type_analyze_callback(ctx: AnalyzeTypeContext) -> Type:\n if (len(ctx.type.args) != 1\n or not isinstance(ctx.type.args[0], TypeList)):\n ctx.api.fail('Invalid \"Signal\" type (expected \"Signal[[t, ...]]\")', ctx.context)\n return AnyType(TypeOfAny.from_error)\n\n args = ctx.type.args[0]\n assert isinstance(args, TypeList)\n analyzed = ctx.api.analyze_callable_args(args)\n if analyzed is None:\n return AnyType(TypeOfAny.from_error) # Error generated elsewhere\n arg_types, arg_kinds, arg_names = analyzed\n arg_types = [ctx.api.analyze_type(arg) for arg in arg_types]\n type_arg = CallableType(arg_types,\n arg_kinds,\n arg_names,\n NoneTyp(),\n ctx.api.named_type('builtins.function', []))\n return ctx.api.named_type('m.Signal', [type_arg])\n\n\ndef plugin(version):\n return TypeAnalyzePlugin", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/union_method.py_from_mypy_plugin_import__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/test-data/unit/plugins/union_method.py_from_mypy_plugin_import__", "embedding": null, "metadata": {"file_path": "test-data/unit/plugins/union_method.py", "file_name": "union_method.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 50, "span_ids": ["plugin", "MethodPlugin.get_method_signature_hook", "imports", "_str_to_int", "my_meth_sig_hook", "MethodPlugin", "_float_to_int", "my_meth_hook", "MethodPlugin.get_method_hook"], "tokens": 358}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from mypy.plugin import (\n CallableType, CheckerPluginInterface, MethodSigContext, MethodContext, Plugin\n)\nfrom mypy.types import Instance, Type\n\n\nclass MethodPlugin(Plugin):\n def get_method_signature_hook(self, fullname):\n if fullname.startswith('__main__.Foo.'):\n return my_meth_sig_hook\n return None\n\n def get_method_hook(self, fullname):\n if fullname.startswith('__main__.Bar.'):\n return my_meth_hook\n return None\n\n\ndef _str_to_int(api: CheckerPluginInterface, typ: Type) -> Type:\n if isinstance(typ, Instance):\n if typ.type.fullname == 'builtins.str':\n return api.named_generic_type('builtins.int', [])\n elif typ.args:\n return typ.copy_modified(args=[_str_to_int(api, t) for t in typ.args])\n return typ\n\n\ndef _float_to_int(api: CheckerPluginInterface, typ: Type) -> Type:\n if isinstance(typ, Instance):\n if typ.type.fullname == 'builtins.float':\n return api.named_generic_type('builtins.int', [])\n elif typ.args:\n return typ.copy_modified(args=[_float_to_int(api, t) for t in typ.args])\n return typ\n\n\ndef my_meth_sig_hook(ctx: MethodSigContext) -> CallableType:\n return ctx.default_signature.copy_modified(\n arg_types=[_str_to_int(ctx.api, t) for t in ctx.default_signature.arg_types],\n ret_type=_str_to_int(ctx.api, ctx.default_signature.ret_type),\n )\n\n\ndef my_meth_hook(ctx: MethodContext) -> Type:\n return _float_to_int(ctx.api, ctx.default_return_type)\n\n\ndef plugin(version):\n return MethodPlugin", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestUnit.test_missing_StubtestUnit.test_missing_no_runtime_all.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestUnit.test_missing_StubtestUnit.test_missing_no_runtime_all.None_1", "embedding": null, "metadata": {"file_path": "mypy/test/teststubtest.py", "file_name": "teststubtest.py", "file_type": "text/x-python", "category": "test", "start_line": 602, "end_line": 629, "span_ids": ["StubtestUnit.test_missing_no_runtime_all", "StubtestUnit.test_missing"], "tokens": 297}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubtestUnit(unittest.TestCase):\n\n @collect_cases\n def test_missing(self) -> Iterator[Case]:\n yield Case(stub=\"x = 5\", runtime=\"\", error=\"x\")\n yield Case(stub=\"def f(): ...\", runtime=\"\", error=\"f\")\n yield Case(stub=\"class X: ...\", runtime=\"\", error=\"X\")\n yield Case(\n stub=\"\"\"\n from typing import overload\n @overload\n def h(x: int): ...\n @overload\n def h(x: str): ...\n \"\"\",\n runtime=\"\",\n error=\"h\",\n )\n yield Case(\"\", \"__all__ = []\", None) # dummy case\n yield Case(stub=\"\", runtime=\"__all__ += ['y']\\ny = 5\", error=\"y\")\n yield Case(stub=\"\", runtime=\"__all__ += ['g']\\ndef g(): pass\", error=\"g\")\n # Here we should only check that runtime has B, since the stub explicitly re-exports it\n yield Case(\n stub=\"from mystery import A, B as B, C as D # type: ignore\", runtime=\"\", error=\"B\"\n )\n\n @collect_cases\n def test_missing_no_runtime_all(self) -> Iterator[Case]:\n yield Case(stub=\"\", runtime=\"import sys\", error=None)\n yield Case(stub=\"\", runtime=\"def g(): ...\", error=\"g\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestUnit.test_special_dunders_StubtestUnit.test_special_dunders.None_1.yield_Case_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestUnit.test_special_dunders_StubtestUnit.test_special_dunders.None_1.yield_Case_", "embedding": null, "metadata": {"file_path": "mypy/test/teststubtest.py", "file_name": "teststubtest.py", "file_type": "text/x-python", "category": "test", "start_line": 631, "end_line": 654, "span_ids": ["StubtestUnit.test_special_dunders"], "tokens": 289}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubtestUnit(unittest.TestCase):\n\n @collect_cases\n def test_special_dunders(self) -> Iterator[Case]:\n yield Case(\n stub=\"class A:\\n def __init__(self, a: int, b: int) -> None: ...\",\n runtime=\"class A:\\n def __init__(self, a, bx): pass\",\n error=\"A.__init__\",\n )\n yield Case(\n stub=\"class B:\\n def __call__(self, c: int, d: int) -> None: ...\",\n runtime=\"class B:\\n def __call__(self, c, dx): pass\",\n error=\"B.__call__\",\n )\n if sys.version_info >= (3, 6):\n yield Case(\n stub=\"class C:\\n def __init_subclass__(cls, e: int, **kwargs: int) -> None: ...\",\n runtime=\"class C:\\n def __init_subclass__(cls, e, **kwargs): pass\",\n error=None,\n )\n if sys.version_info >= (3, 9):\n yield Case(\n stub=\"class D:\\n def __class_getitem__(cls, type: type) -> type: ...\",\n runtime=\"class D:\\n def __class_getitem__(cls, type): ...\",\n error=None,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestUnit.test_name_mangling_StubtestUnit.test_name_mangling.yield_Case_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestUnit.test_name_mangling_StubtestUnit.test_name_mangling.yield_Case_", "embedding": null, "metadata": {"file_path": "mypy/test/teststubtest.py", "file_name": "teststubtest.py", "file_type": "text/x-python", "category": "test", "start_line": 656, "end_line": 670, "span_ids": ["StubtestUnit.test_name_mangling"], "tokens": 118}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubtestUnit(unittest.TestCase):\n\n @collect_cases\n def test_name_mangling(self) -> Iterator[Case]:\n yield Case(\n stub=\"\"\"\n class X:\n def __mangle_good(self, text: str) -> None: ...\n def __mangle_bad(self, number: int) -> None: ...\n \"\"\",\n runtime=\"\"\"\n class X:\n def __mangle_good(self, text): pass\n def __mangle_bad(self, text): pass\n \"\"\",\n error=\"X.__mangle_bad\"\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/upload-pypi.py__usr_bin_env_python3_download_all_release_assets.with_ThreadPoolExecutor_.for_asset_in_e_map_lambda.print_f_Downloaded_asset": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/upload-pypi.py__usr_bin_env_python3_download_all_release_assets.with_ThreadPoolExecutor_.for_asset_in_e_map_lambda.print_f_Downloaded_asset", "embedding": null, "metadata": {"file_path": "misc/upload-pypi.py", "file_name": "upload-pypi.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 51, "span_ids": ["is_whl_or_tar", "docstring", "get_release_for_tag", "download_asset", "download_all_release_assets"], "tokens": 360}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "#!/usr/bin/env python3\n\"\"\"Upload mypy packages to PyPI.\n\nYou must first tag the release, use `git push --tags` and wait for the wheel build in CI to complete.\n\n\"\"\"\n\nimport argparse\nimport contextlib\nimport json\nimport re\nimport shutil\nimport subprocess\nimport tarfile\nimport tempfile\nimport venv\nfrom concurrent.futures import ThreadPoolExecutor\nfrom pathlib import Path\nfrom typing import Any, Dict, Iterator, List\nfrom urllib.request import urlopen\n\nBASE = \"https://api.github.com/repos\"\nREPO = \"mypyc/mypy_mypyc-wheels\"\n\n\ndef is_whl_or_tar(name: str) -> bool:\n return name.endswith(\".tar.gz\") or name.endswith(\".whl\")\n\n\ndef get_release_for_tag(tag: str) -> Dict[str, Any]:\n with urlopen(f\"{BASE}/{REPO}/releases/tags/{tag}\") as f:\n data = json.load(f)\n assert data[\"tag_name\"] == tag\n return data\n\n\ndef download_asset(asset: Dict[str, Any], dst: Path) -> Path:\n name = asset[\"name\"]\n download_url = asset[\"browser_download_url\"]\n assert is_whl_or_tar(name)\n with urlopen(download_url) as src_file:\n with open(dst / name, \"wb\") as dst_file:\n shutil.copyfileobj(src_file, dst_file)\n return dst / name\n\n\ndef download_all_release_assets(release: Dict[str, Any], dst: Path) -> None:\n print(f\"Downloading assets...\")\n with ThreadPoolExecutor() as e:\n for asset in e.map(lambda asset: download_asset(asset, dst), release[\"assets\"]):\n print(f\"Downloaded {asset}\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/upload-pypi.py_check_sdist_check_sdist.with_tarfile_open_sdist_.assert_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/upload-pypi.py_check_sdist_check_sdist.with_tarfile_open_sdist_.assert_", "embedding": null, "metadata": {"file_path": "misc/upload-pypi.py", "file_name": "upload-pypi.py", "file_type": "text/x-python", "category": "implementation", "start_line": 54, "end_line": 70, "span_ids": ["check_sdist"], "tokens": 196}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def check_sdist(dist: Path, version: str) -> None:\n tarfiles = list(dist.glob(\"*.tar.gz\"))\n assert len(tarfiles) == 1\n sdist = tarfiles[0]\n assert version in sdist.name\n with tarfile.open(sdist) as f:\n version_py = f.extractfile(f\"{sdist.name[:-len('.tar.gz')]}/mypy/version.py\")\n assert version_py is not None\n version_py_contents = version_py.read().decode(\"utf-8\")\n\n # strip a git hash from our version, if necessary, since that's not present in version.py\n match = re.match(r\"(.*\\+dev).*$\", version)\n hashless_version = match.group(1) if match else version\n\n assert (\n f\"'{hashless_version}'\" in version_py_contents\n ), \"Version does not match version.py in sdist\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/upload-pypi.py_spot_check_dist_upload_dist.with_tmp_twine_as_twine.if_dry_run_.else_.subprocess_check_call_cmd": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/upload-pypi.py_spot_check_dist_upload_dist.with_tmp_twine_as_twine.if_dry_run_.else_.subprocess_check_call_cmd", "embedding": null, "metadata": {"file_path": "misc/upload-pypi.py", "file_name": "upload-pypi.py", "file_type": "text/x-python", "category": "implementation", "start_line": 73, "end_line": 99, "span_ids": ["upload_dist", "spot_check_dist", "tmp_twine"], "tokens": 289}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def spot_check_dist(dist: Path, version: str) -> None:\n items = [item for item in dist.iterdir() if is_whl_or_tar(item.name)]\n assert len(items) > 10\n assert all(version in item.name for item in items)\n assert any(item.name.endswith(\"py3-none-any.whl\") for item in items)\n\n\n@contextlib.contextmanager\ndef tmp_twine() -> Iterator[Path]:\n with tempfile.TemporaryDirectory() as tmp_dir:\n tmp_venv_dir = Path(tmp_dir) / \"venv\"\n venv.create(tmp_venv_dir, with_pip=True)\n pip_exe = tmp_venv_dir / \"bin\" / \"pip\"\n subprocess.check_call([pip_exe, \"install\", \"twine\"])\n yield tmp_venv_dir / \"bin\" / \"twine\"\n\n\ndef upload_dist(dist: Path, dry_run: bool = True) -> None:\n with tmp_twine() as twine:\n files = [item for item in dist.iterdir() if is_whl_or_tar(item.name)]\n cmd: List[Any] = [twine, \"upload\"]\n cmd += files\n if dry_run:\n print(\"[dry run] \" + \" \".join(map(str, cmd)))\n else:\n print(\" \".join(map(str, cmd)))\n subprocess.check_call(cmd)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/upload-pypi.py_upload_to_pypi_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/upload-pypi.py_upload_to_pypi_", "embedding": null, "metadata": {"file_path": "misc/upload-pypi.py", "file_name": "upload-pypi.py", "file_type": "text/x-python", "category": "implementation", "start_line": 102, "end_line": 136, "span_ids": ["upload_to_pypi", "impl:5", "main"], "tokens": 270}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def upload_to_pypi(version: str, dry_run: bool = True) -> None:\n assert re.match(r\"v?0\\.[0-9]{3}(\\+\\S+)?$\", version)\n if \"dev\" in version:\n assert dry_run, \"Must use --dry-run with dev versions of mypy\"\n if version.startswith(\"v\"):\n version = version[1:]\n\n target_dir = tempfile.mkdtemp()\n dist = Path(target_dir) / \"dist\"\n dist.mkdir()\n print(f\"Temporary target directory: {target_dir}\")\n\n release = get_release_for_tag(f\"v{version}\")\n download_all_release_assets(release, dist)\n\n spot_check_dist(dist, version)\n check_sdist(dist, version)\n upload_dist(dist, dry_run)\n print(\"<< All done! >>\")\n\n\ndef main() -> None:\n parser = argparse.ArgumentParser(description=\"PyPI mypy package uploader\")\n parser.add_argument(\n \"--dry-run\", action=\"store_true\", default=False, help=\"Don't actually upload packages\"\n )\n parser.add_argument(\"version\", help=\"mypy version to release\")\n args = parser.parse_args()\n\n upload_to_pypi(args.version, args.dry_run)\n\n\nif __name__ == \"__main__\":\n main()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_Errors.is_ignored_error_Errors.is_ignored_error.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_Errors.is_ignored_error_Errors.is_ignored_error.return.False", "embedding": null, "metadata": {"file_path": "mypy/errors.py", "file_name": "errors.py", "file_type": "text/x-python", "category": "implementation", "start_line": 359, "end_line": 372, "span_ids": ["Errors.is_ignored_error"], "tokens": 130}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Errors:\n\n def is_ignored_error(self, line: int, info: ErrorInfo, ignores: Dict[int, List[str]]) -> bool:\n if info.blocker:\n # Blocking errors can never be ignored\n return False\n if info.code and self.is_error_code_enabled(info.code) is False:\n return True\n if line not in ignores:\n return False\n if not ignores[line]:\n # Empty list means that we ignore all errors\n return True\n if info.code and self.is_error_code_enabled(info.code) is True:\n return info.code.code in ignores[line]\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_Errors.is_error_code_enabled_Errors.clear_errors_in_targets.if_path_in_self_error_inf.self_error_info_map_path_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/errors.py_Errors.is_error_code_enabled_Errors.clear_errors_in_targets.if_path_in_self_error_inf.self_error_info_map_path_", "embedding": null, "metadata": {"file_path": "mypy/errors.py", "file_name": "errors.py", "file_type": "text/x-python", "category": "implementation", "start_line": 374, "end_line": 391, "span_ids": ["Errors.is_error_code_enabled", "Errors.clear_errors_in_targets"], "tokens": 154}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Errors:\n\n def is_error_code_enabled(self, error_code: ErrorCode) -> bool:\n if error_code in self.disabled_error_codes:\n return False\n elif error_code in self.enabled_error_codes:\n return True\n else:\n return error_code.default_enabled\n\n def clear_errors_in_targets(self, path: str, targets: Set[str]) -> None:\n \"\"\"Remove errors in specific fine-grained targets within a file.\"\"\"\n if path in self.error_info_map:\n new_errors = []\n for info in self.error_info_map[path]:\n if info.target not in targets:\n new_errors.append(info)\n elif info.only_once:\n self.only_once_messages.remove(info.message)\n self.error_info_map[path] = new_errors", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/find_sources.py_keyfunc_normalise_package_base.return.root": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/find_sources.py_keyfunc_normalise_package_base.return.root", "embedding": null, "metadata": {"file_path": "mypy/find_sources.py", "file_name": "find_sources.py", "file_type": "text/x-python", "category": "implementation", "start_line": 50, "end_line": 70, "span_ids": ["normalise_package_base", "keyfunc"], "tokens": 163}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def keyfunc(name: str) -> Tuple[bool, int, str]:\n \"\"\"Determines sort order for directory listing.\n\n The desirable properties are:\n 1) foo < foo.pyi < foo.py\n 2) __init__.py[i] < foo\n \"\"\"\n base, suffix = os.path.splitext(name)\n for i, ext in enumerate(PY_EXTENSIONS):\n if suffix == ext:\n return (base != \"__init__\", i, base)\n return (base != \"__init__\", -1, name)\n\n\ndef normalise_package_base(root: str) -> str:\n if not root:\n root = os.curdir\n root = os.path.abspath(root)\n if root.endswith(os.sep):\n root = root[:-1]\n return root", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/find_sources.py_get_explicit_package_bases_get_explicit_package_bases.return._normalise_package_base_r": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/find_sources.py_get_explicit_package_bases_get_explicit_package_bases.return._normalise_package_base_r", "embedding": null, "metadata": {"file_path": "mypy/find_sources.py", "file_name": "find_sources.py", "file_type": "text/x-python", "category": "implementation", "start_line": 73, "end_line": 86, "span_ids": ["get_explicit_package_bases"], "tokens": 153}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_explicit_package_bases(options: Options) -> Optional[List[str]]:\n \"\"\"Returns explicit package bases to use if the option is enabled, or None if disabled.\n\n We currently use MYPYPATH and the current directory as the package bases. In the future,\n when --namespace-packages is the default could also use the values passed with the\n --package-root flag, see #9632.\n\n Values returned are normalised so we can use simple string comparisons in\n SourceFinder.is_explicit_package_base\n \"\"\"\n if not options.explicit_package_bases:\n return None\n roots = mypy_path() + options.mypy_path + [os.getcwd()]\n return [normalise_package_base(root) for root in roots]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/find_sources.py_SourceFinder_SourceFinder.find_sources_in_dir.return.sources": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/find_sources.py_SourceFinder_SourceFinder.find_sources_in_dir.return.sources", "embedding": null, "metadata": {"file_path": "mypy/find_sources.py", "file_name": "find_sources.py", "file_type": "text/x-python", "category": "implementation", "start_line": 89, "end_line": 129, "span_ids": ["SourceFinder.__init__", "SourceFinder.find_sources_in_dir", "SourceFinder", "SourceFinder.is_explicit_package_base"], "tokens": 341}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SourceFinder:\n def __init__(self, fscache: FileSystemCache, options: Options) -> None:\n self.fscache = fscache\n self.explicit_package_bases = get_explicit_package_bases(options)\n self.namespace_packages = options.namespace_packages\n self.exclude = options.exclude\n self.verbosity = options.verbosity\n\n def is_explicit_package_base(self, path: str) -> bool:\n assert self.explicit_package_bases\n return normalise_package_base(path) in self.explicit_package_bases\n\n def find_sources_in_dir(self, path: str) -> List[BuildSource]:\n sources = []\n\n seen = set() # type: Set[str]\n names = sorted(self.fscache.listdir(path), key=keyfunc)\n for name in names:\n # Skip certain names altogether\n if name in (\"__pycache__\", \"site-packages\", \"node_modules\") or name.startswith(\".\"):\n continue\n subpath = os.path.join(path, name)\n\n if matches_exclude(\n subpath, self.exclude, self.fscache, self.verbosity >= 2\n ):\n continue\n\n if self.fscache.isdir(subpath):\n sub_sources = self.find_sources_in_dir(subpath)\n if sub_sources:\n seen.add(name)\n sources.extend(sub_sources)\n else:\n stem, suffix = os.path.splitext(name)\n if stem not in seen and suffix in PY_EXTENSIONS:\n seen.add(stem)\n module, base_dir = self.crawl_up(subpath)\n sources.append(BuildSource(subpath, module, None, base_dir))\n\n return sources", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/find_sources.py_SourceFinder.crawl_up_SourceFinder.crawl_up_dir.return.self__crawl_up_helper_dir": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/find_sources.py_SourceFinder.crawl_up_SourceFinder.crawl_up_dir.return.self__crawl_up_helper_dir", "embedding": null, "metadata": {"file_path": "mypy/find_sources.py", "file_name": "find_sources.py", "file_type": "text/x-python", "category": "implementation", "start_line": 124, "end_line": 154, "span_ids": ["SourceFinder.crawl_up_dir", "SourceFinder.crawl_up"], "tokens": 290}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SourceFinder:\n\n def crawl_up(self, path: str) -> Tuple[str, str]:\n \"\"\"Given a .py[i] filename, return module and base directory.\n\n For example, given \"xxx/yyy/foo/bar.py\", we might return something like:\n (\"foo.bar\", \"xxx/yyy\")\n\n If namespace packages is off, we crawl upwards until we find a directory without\n an __init__.py\n\n If namespace packages is on, we crawl upwards until the nearest explicit base directory.\n Failing that, we return one past the highest directory containing an __init__.py\n\n We won't crawl past directories with invalid package names.\n The base directory returned is an absolute path.\n \"\"\"\n path = os.path.abspath(path)\n parent, filename = os.path.split(path)\n\n module_name = strip_py(filename) or filename\n\n parent_module, base_dir = self.crawl_up_dir(parent)\n if module_name == \"__init__\":\n return parent_module, base_dir\n\n # Note that module_name might not actually be a valid identifier, but that's okay\n # Ignoring this possibility sidesteps some search path confusion\n module = module_join(parent_module, module_name)\n return module, base_dir\n\n def crawl_up_dir(self, dir: str) -> Tuple[str, str]:\n return self._crawl_up_helper(dir) or (\"\", dir)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/find_sources.py_SourceFinder._crawl_up_helper_SourceFinder._crawl_up_helper.return.module_join_mod_prefix_n": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/find_sources.py_SourceFinder._crawl_up_helper_SourceFinder._crawl_up_helper.return.module_join_mod_prefix_n", "embedding": null, "metadata": {"file_path": "mypy/find_sources.py", "file_name": "find_sources.py", "file_type": "text/x-python", "category": "implementation", "start_line": 156, "end_line": 204, "span_ids": ["SourceFinder._crawl_up_helper"], "tokens": 535}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SourceFinder:\n\n @functools.lru_cache()\n def _crawl_up_helper(self, dir: str) -> Optional[Tuple[str, str]]:\n \"\"\"Given a directory, maybe returns module and base directory.\n\n We return a non-None value if we were able to find something clearly intended as a base\n directory (as adjudicated by being an explicit base directory or by containing a package\n with __init__.py).\n\n This distinction is necessary for namespace packages, so that we know when to treat\n ourselves as a subpackage.\n \"\"\"\n # stop crawling if we're an explicit base directory\n if self.explicit_package_bases is not None and self.is_explicit_package_base(dir):\n return \"\", dir\n\n parent, name = os.path.split(dir)\n if name.endswith('-stubs'):\n name = name[:-6] # PEP-561 stub-only directory\n\n # recurse if there's an __init__.py\n init_file = self.get_init_file(dir)\n if init_file is not None:\n if not name.isidentifier():\n # in most cases the directory name is invalid, we'll just stop crawling upwards\n # but if there's an __init__.py in the directory, something is messed up\n raise InvalidSourceList(\"{} is not a valid Python package name\".format(name))\n # we're definitely a package, so we always return a non-None value\n mod_prefix, base_dir = self.crawl_up_dir(parent)\n return module_join(mod_prefix, name), base_dir\n\n # stop crawling if we're out of path components or our name is an invalid identifier\n if not name or not parent or not name.isidentifier():\n return None\n\n # stop crawling if namespace packages is off (since we don't have an __init__.py)\n if not self.namespace_packages:\n return None\n\n # at this point: namespace packages is on, we don't have an __init__.py and we're not an\n # explicit base directory\n result = self._crawl_up_helper(parent)\n if result is None:\n # we're not an explicit base directory and we don't have an __init__.py\n # and none of our parents are either, so return\n return None\n # one of our parents was an explicit base directory or had an __init__.py, so we're\n # definitely a subpackage! chain our name to the module.\n mod_prefix, base_dir = result\n return module_join(mod_prefix, name), base_dir", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fscache.py__Interface_for_accessin_from_mypy_extensions_impo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fscache.py__Interface_for_accessin_from_mypy_extensions_impo", "embedding": null, "metadata": {"file_path": "mypy/fscache.py", "file_name": "fscache.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 36, "span_ids": ["docstring"], "tokens": 253}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Interface for accessing the file system with automatic caching.\n\nThe idea is to cache the results of any file system state reads during\na single transaction. This has two main benefits:\n\n* This avoids redundant syscalls, as we won't perform the same OS\n operations multiple times.\n\n* This makes it easier to reason about concurrent FS updates, as different\n operations targeting the same paths can't report different state during\n a transaction.\n\nNote that this only deals with reading state, not writing.\n\nProperties maintained by the API:\n\n* The contents of the file are always from the same or later time compared\n to the reported mtime of the file, even if mtime is queried after reading\n a file.\n\n* Repeating an operation produces the same result as the first one during\n a transaction.\n\n* Call flush() to start a new transaction (flush the caches).\n\nThe API is a bit limited. It's easy to add new cached operations, however.\nYou should perform all file system reads through the API to actually take\nadvantage of the benefits.\n\"\"\"\n\nimport os\nimport stat\nimport sys\nfrom typing import Dict, List, Set\nfrom mypy.util import hash_digest\nfrom mypy_extensions import mypyc_attr", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_FindModuleCache.find_modules_recursive_FindModuleCache.find_modules_recursive.return.sources": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_FindModuleCache.find_modules_recursive_FindModuleCache.find_modules_recursive.return.sources", "embedding": null, "metadata": {"file_path": "mypy/modulefinder.py", "file_name": "modulefinder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 429, "end_line": 478, "span_ids": ["FindModuleCache.find_modules_recursive"], "tokens": 483}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FindModuleCache:\n\n def find_modules_recursive(self, module: str) -> List[BuildSource]:\n module_path = self.find_module(module)\n if isinstance(module_path, ModuleNotFoundReason):\n return []\n sources = [BuildSource(module_path, module, None)]\n\n package_path = None\n if module_path.endswith(('__init__.py', '__init__.pyi')):\n package_path = os.path.dirname(module_path)\n elif self.fscache.isdir(module_path):\n package_path = module_path\n if package_path is None:\n return sources\n\n # This logic closely mirrors that in find_sources. One small but important difference is\n # that we do not sort names with keyfunc. The recursive call to find_modules_recursive\n # calls find_module, which will handle the preference between packages, pyi and py.\n # Another difference is it doesn't handle nested search paths / package roots.\n\n seen = set() # type: Set[str]\n names = sorted(self.fscache.listdir(package_path))\n for name in names:\n # Skip certain names altogether\n if name in (\"__pycache__\", \"site-packages\", \"node_modules\") or name.startswith(\".\"):\n continue\n subpath = os.path.join(package_path, name)\n\n if self.options and matches_exclude(\n subpath, self.options.exclude, self.fscache, self.options.verbosity >= 2\n ):\n continue\n\n if self.fscache.isdir(subpath):\n # Only recurse into packages\n if (self.options and self.options.namespace_packages) or (\n self.fscache.isfile(os.path.join(subpath, \"__init__.py\"))\n or self.fscache.isfile(os.path.join(subpath, \"__init__.pyi\"))\n ):\n seen.add(name)\n sources.extend(self.find_modules_recursive(module + '.' + name))\n else:\n stem, suffix = os.path.splitext(name)\n if stem == '__init__':\n continue\n if stem not in seen and '.' not in stem and suffix in PYTHON_EXTENSIONS:\n # (If we sorted names by keyfunc) we could probably just make the BuildSource\n # ourselves, but this ensures compatibility with find_module / the cache\n seen.add(stem)\n sources.extend(self.find_modules_recursive(module + '.' + stem))\n return sources", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_if_TYPE_CHECKING__del__nongen_builtins_col": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_if_TYPE_CHECKING__del__nongen_builtins_col", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 59, "end_line": 145, "span_ids": ["impl", "impl:35"], "tokens": 771}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "if TYPE_CHECKING:\n # break import cycle only needed for mypy\n import mypy.types\n\n\nT = TypeVar('T')\n\nJsonDict = Dict[str, Any]\n\n\n# Symbol table node kinds\n#\n# TODO rename to use more descriptive names\n\nLDEF = 0 # type: Final\nGDEF = 1 # type: Final\nMDEF = 2 # type: Final\n\n# Placeholder for a name imported via 'from ... import'. Second phase of\n# semantic will replace this the actual imported reference. This is\n# needed so that we can detect whether a name has been imported during\n# XXX what?\nUNBOUND_IMPORTED = 3 # type: Final\n\n# RevealExpr node kinds\nREVEAL_TYPE = 0 # type: Final\nREVEAL_LOCALS = 1 # type: Final\n\nLITERAL_YES = 2 # type: Final\nLITERAL_TYPE = 1 # type: Final\nLITERAL_NO = 0 # type: Final\n\nnode_kinds = {\n LDEF: 'Ldef',\n GDEF: 'Gdef',\n MDEF: 'Mdef',\n UNBOUND_IMPORTED: 'UnboundImported',\n} # type: Final\ninverse_node_kinds = {_kind: _name for _name, _kind in node_kinds.items()} # type: Final\n\n\nimplicit_module_attrs = {'__name__': '__builtins__.str',\n '__doc__': None, # depends on Python version, see semanal.py\n '__file__': '__builtins__.str',\n '__package__': '__builtins__.str'} # type: Final\n\n\n# These aliases exist because built-in class objects are not subscriptable.\n# For example `list[int]` fails at runtime. Instead List[int] should be used.\ntype_aliases = {\n 'typing.List': 'builtins.list',\n 'typing.Dict': 'builtins.dict',\n 'typing.Set': 'builtins.set',\n 'typing.FrozenSet': 'builtins.frozenset',\n 'typing.ChainMap': 'collections.ChainMap',\n 'typing.Counter': 'collections.Counter',\n 'typing.DefaultDict': 'collections.defaultdict',\n 'typing.Deque': 'collections.deque',\n 'typing.OrderedDict': 'collections.OrderedDict',\n} # type: Final\n\n# This keeps track of the oldest supported Python version where the corresponding\n# alias source is available.\ntype_aliases_source_versions = {\n 'typing.List': (2, 7),\n 'typing.Dict': (2, 7),\n 'typing.Set': (2, 7),\n 'typing.FrozenSet': (2, 7),\n 'typing.ChainMap': (3, 3),\n 'typing.Counter': (2, 7),\n 'typing.DefaultDict': (2, 7),\n 'typing.Deque': (2, 7),\n 'typing.OrderedDict': (3, 7),\n} # type: Final\n\nreverse_builtin_aliases = {\n 'builtins.list': 'typing.List',\n 'builtins.dict': 'typing.Dict',\n 'builtins.set': 'typing.Set',\n 'builtins.frozenset': 'typing.FrozenSet',\n} # type: Final\n\n_nongen_builtins = {'builtins.tuple': 'typing.Tuple',\n 'builtins.enumerate': ''} # type: Final\n_nongen_builtins.update((name, alias) for alias, name in type_aliases.items())\n# Drop OrderedDict from this for backward compatibility\ndel _nongen_builtins['collections.OrderedDict']", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_get_nongen_builtins_Lvalue.Expression": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_get_nongen_builtins_Lvalue.Expression", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 148, "end_line": 205, "span_ids": ["Statement.accept", "Node.__str__", "get_nongen_builtins", "Statement", "impl:41", "Node", "Expression", "impl:43", "FakeExpression", "Node.accept", "Expression.accept"], "tokens": 341}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_nongen_builtins(python_version: Tuple[int, int]) -> Dict[str, str]:\n # After 3.9 with pep585 generic builtins are allowed.\n return _nongen_builtins if python_version < (3, 9) else {}\n\n\nRUNTIME_PROTOCOL_DECOS = ('typing.runtime_checkable',\n 'typing_extensions.runtime',\n 'typing_extensions.runtime_checkable') # type: Final\n\n\nclass Node(Context):\n \"\"\"Common base class for all non-type parse tree nodes.\"\"\"\n\n __slots__ = ()\n\n def __str__(self) -> str:\n ans = self.accept(mypy.strconv.StrConv())\n if ans is None:\n return repr(self)\n return ans\n\n def accept(self, visitor: NodeVisitor[T]) -> T:\n raise RuntimeError('Not implemented')\n\n\n@trait\nclass Statement(Node):\n \"\"\"A statement node.\"\"\"\n\n __slots__ = ()\n\n def accept(self, visitor: StatementVisitor[T]) -> T:\n raise RuntimeError('Not implemented')\n\n\n@trait\nclass Expression(Node):\n \"\"\"An expression node.\"\"\"\n\n __slots__ = ()\n\n def accept(self, visitor: ExpressionVisitor[T]) -> T:\n raise RuntimeError('Not implemented')\n\n\nclass FakeExpression(Expression):\n \"\"\"A dummy expression.\n\n We need a dummy expression in one place, and can't instantiate Expression\n because it is a trait and mypyc barfs.\n \"\"\"\n pass\n\n\n# TODO:\n# Lvalue = Union['NameExpr', 'MemberExpr', 'IndexExpr', 'SuperExpr', 'StarExpr'\n# 'TupleExpr']; see #1783.\nLvalue = Expression", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/options.py_from_mypy_ordered_dict_im_Options": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/options.py_from_mypy_ordered_dict_im_Options", "embedding": null, "metadata": {"file_path": "mypy/options.py", "file_name": "options.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 425, "span_ids": ["imports", "BuildType", "impl:2", "Options"], "tokens": 395}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from mypy.ordered_dict import OrderedDict\nimport re\nimport pprint\nimport sys\n\nfrom typing_extensions import Final, TYPE_CHECKING\nfrom typing import Dict, List, Mapping, Optional, Pattern, Set, Tuple, Callable, Any\n\nfrom mypy import defaults\nfrom mypy.util import get_class_descriptors, replace_object_state\n\nif TYPE_CHECKING:\n from mypy.errors import ErrorCode\n\n\nclass BuildType:\n STANDARD = 0 # type: Final\n MODULE = 1 # type: Final\n PROGRAM_TEXT = 2 # type: Final\n\n\nPER_MODULE_OPTIONS = {\n # Please keep this list sorted\n \"allow_redefinition\",\n \"allow_untyped_globals\",\n \"always_false\",\n \"always_true\",\n \"check_untyped_defs\",\n \"debug_cache\",\n \"disallow_any_decorated\",\n \"disallow_any_explicit\",\n \"disallow_any_expr\",\n \"disallow_any_generics\",\n \"disallow_any_unimported\",\n \"disallow_incomplete_defs\",\n \"disallow_subclassing_any\",\n \"disallow_untyped_calls\",\n \"disallow_untyped_decorators\",\n \"disallow_untyped_defs\",\n \"follow_imports\",\n \"follow_imports_for_stubs\",\n \"ignore_errors\",\n \"ignore_missing_imports\",\n \"implicit_reexport\",\n \"local_partial_types\",\n \"mypyc\",\n \"no_implicit_optional\",\n \"show_none_errors\",\n \"strict_equality\",\n \"strict_optional\",\n \"strict_optional_whitelist\",\n \"warn_no_return\",\n \"warn_return_any\",\n \"warn_unreachable\",\n \"warn_unused_ignores\",\n} # type: Final\n\nOPTIONS_AFFECTING_CACHE = ((PER_MODULE_OPTIONS |\n {\"platform\", \"bazel\", \"plugins\"})\n - {\"debug_cache\"}) # type: Final\n\n\nclass Options:", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py_Attribute.serialize_Attribute.serialize.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py_Attribute.serialize_Attribute.serialize.return._", "embedding": null, "metadata": {"file_path": "mypy/plugins/attrs.py", "file_name": "attrs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 165, "end_line": 177, "span_ids": ["Attribute.serialize"], "tokens": 124}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Attribute:\n\n def serialize(self) -> JsonDict:\n \"\"\"Serialize this object so it can be saved and restored.\"\"\"\n return {\n 'name': self.name,\n 'has_default': self.has_default,\n 'init': self.init,\n 'kw_only': self.kw_only,\n 'converter_name': self.converter.name,\n 'converter_is_attr_converters_optional': self.converter.is_attr_converters_optional,\n 'context_line': self.context.line,\n 'context_column': self.context.column,\n 'init_type': self.init_type.serialize() if self.init_type else None,\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py_Attribute.deserialize_Attribute.expand_typevar_from_subtype.self.init_type.map_type_from_supertype_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py_Attribute.deserialize_Attribute.expand_typevar_from_subtype.self.init_type.map_type_from_supertype_s", "embedding": null, "metadata": {"file_path": "mypy/plugins/attrs.py", "file_name": "attrs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 179, "end_line": 202, "span_ids": ["Attribute.deserialize", "Attribute.expand_typevar_from_subtype"], "tokens": 213}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Attribute:\n\n @classmethod\n def deserialize(cls, info: TypeInfo,\n data: JsonDict,\n api: SemanticAnalyzerPluginInterface) -> 'Attribute':\n \"\"\"Return the Attribute that was serialized.\"\"\"\n raw_init_type = data['init_type']\n init_type = deserialize_and_fixup_type(raw_init_type, api) if raw_init_type else None\n\n return Attribute(data['name'],\n info,\n data['has_default'],\n data['init'],\n data['kw_only'],\n Converter(data['converter_name'], data['converter_is_attr_converters_optional']),\n Context(line=data['context_line'], column=data['context_column']),\n init_type)\n\n def expand_typevar_from_subtype(self, sub_type: TypeInfo) -> None:\n \"\"\"Expands type vars in the context of a subtype when an attribute is inherited\n from a generic super type.\"\"\"\n if not isinstance(self.init_type, TypeVarType):\n return\n\n self.init_type = map_type_from_supertype(self.init_type, sub_type, self.info)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py__detect_auto_attribs__detect_auto_attribs.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/attrs.py__detect_auto_attribs__detect_auto_attribs.return.True", "embedding": null, "metadata": {"file_path": "mypy/plugins/attrs.py", "file_name": "attrs.py", "file_type": "text/x-python", "category": "implementation", "start_line": 415, "end_line": 439, "span_ids": ["_detect_auto_attribs"], "tokens": 236}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _detect_auto_attribs(ctx: 'mypy.plugin.ClassDefContext') -> bool:\n \"\"\"Return whether auto_attribs should be enabled or disabled.\n\n It's disabled if there are any unannotated attribs()\n \"\"\"\n for stmt in ctx.cls.defs.body:\n if isinstance(stmt, AssignmentStmt):\n for lvalue in stmt.lvalues:\n lvalues, rvalues = _parse_assignments(lvalue, stmt)\n\n if len(lvalues) != len(rvalues):\n # This means we have some assignment that isn't 1 to 1.\n # It can't be an attrib.\n continue\n\n for lhs, rvalue in zip(lvalues, rvalues):\n # Check if the right hand side is a call to an attribute maker.\n if (isinstance(rvalue, CallExpr)\n and isinstance(rvalue.callee, RefExpr)\n and rvalue.callee.fullname in attr_attrib_makers\n and not stmt.new_syntax):\n # This means we have an attrib without an annotation and so\n # we can't do auto_attribs=True\n return False\n return True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/dataclasses.py_None_3_DataclassAttribute.expand_typevar_from_subtype.self.type.map_type_from_supertype_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/dataclasses.py_None_3_DataclassAttribute.expand_typevar_from_subtype.self.type.map_type_from_supertype_s", "embedding": null, "metadata": {"file_path": "mypy/plugins/dataclasses.py", "file_name": "dataclasses.py", "file_type": "text/x-python", "category": "implementation", "start_line": 25, "end_line": 86, "span_ids": ["DataclassAttribute.expand_typevar_from_subtype", "DataclassAttribute.__init__", "DataclassAttribute.serialize", "DataclassAttribute.to_var", "DataclassAttribute.to_argument", "DataclassAttribute", "DataclassAttribute.deserialize", "docstring"], "tokens": 414}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": " # type: Final\n\n\nclass DataclassAttribute:\n def __init__(\n self,\n name: str,\n is_in_init: bool,\n is_init_var: bool,\n has_default: bool,\n line: int,\n column: int,\n type: Optional[Type],\n info: TypeInfo,\n ) -> None:\n self.name = name\n self.is_in_init = is_in_init\n self.is_init_var = is_init_var\n self.has_default = has_default\n self.line = line\n self.column = column\n self.type = type\n self.info = info\n\n def to_argument(self) -> Argument:\n return Argument(\n variable=self.to_var(),\n type_annotation=self.type,\n initializer=None,\n kind=ARG_OPT if self.has_default else ARG_POS,\n )\n\n def to_var(self) -> Var:\n return Var(self.name, self.type)\n\n def serialize(self) -> JsonDict:\n assert self.type\n return {\n 'name': self.name,\n 'is_in_init': self.is_in_init,\n 'is_init_var': self.is_init_var,\n 'has_default': self.has_default,\n 'line': self.line,\n 'column': self.column,\n 'type': self.type.serialize(),\n }\n\n @classmethod\n def deserialize(\n cls, info: TypeInfo, data: JsonDict, api: SemanticAnalyzerPluginInterface\n ) -> 'DataclassAttribute':\n data = data.copy()\n typ = deserialize_and_fixup_type(data.pop('type'), api)\n return cls(type=typ, info=info, **data)\n\n def expand_typevar_from_subtype(self, sub_type: TypeInfo) -> None:\n \"\"\"Expands type vars in the context of a subtype when an attribute is inherited\n from a generic super type.\"\"\"\n if not isinstance(self.type, TypeVarType):\n return\n\n self.type = map_type_from_supertype(self.type, sub_type, self.info)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_type_application_SemanticAnalyzer.analyze_type_application.if_isinstance_base_RefEx.else_.if_n_and_n_fullname_in_ge.self_fail_no_subscript_bu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal.py_SemanticAnalyzer.analyze_type_application_SemanticAnalyzer.analyze_type_application.if_isinstance_base_RefEx.else_.if_n_and_n_fullname_in_ge.self_fail_no_subscript_bu", "embedding": null, "metadata": {"file_path": "mypy/semanal.py", "file_name": "semanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3795, "end_line": 3819, "span_ids": ["SemanticAnalyzer.analyze_type_application"], "tokens": 293}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SemanticAnalyzer(NodeVisitor[None],\n SemanticAnalyzerInterface,\n SemanticAnalyzerPluginInterface):\n\n def analyze_type_application(self, expr: IndexExpr) -> None:\n \"\"\"Analyze special form -- type application (either direct or via type aliasing).\"\"\"\n types = self.analyze_type_application_args(expr)\n if types is None:\n return\n base = expr.base\n expr.analyzed = TypeApplication(base, types)\n expr.analyzed.line = expr.line\n expr.analyzed.column = expr.column\n # Types list, dict, set are not subscriptable, prohibit this if\n # subscripted either via type alias...\n if isinstance(base, RefExpr) and isinstance(base.node, TypeAlias):\n alias = base.node\n target = get_proper_type(alias.target)\n if isinstance(target, Instance):\n name = target.type.fullname\n if (alias.no_args and # this avoids bogus errors for already reported aliases\n name in get_nongen_builtins(self.options.python_version) and\n not alias.normalized):\n self.fail(no_subscript_builtin_alias(name, propose_alt=False), expr)\n # ...or directly.\n else:\n n = self.lookup_type_node(base)\n if n and n.fullname in get_nongen_builtins(self.options.python_version):\n self.fail(no_subscript_builtin_alias(n.fullname, propose_alt=False), expr)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_shared.py__type_Final_SemanticAnalyzerCoreInterface.is_stub_file.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/semanal_shared.py__type_Final_SemanticAnalyzerCoreInterface.is_stub_file.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "mypy/semanal_shared.py", "file_name": "semanal_shared.py", "file_type": "text/x-python", "category": "implementation", "start_line": 25, "end_line": 84, "span_ids": ["SemanticAnalyzerCoreInterface.note", "SemanticAnalyzerCoreInterface.is_stub_file", "SemanticAnalyzerCoreInterface.final_iteration", "SemanticAnalyzerCoreInterface.lookup_fully_qualified", "SemanticAnalyzerCoreInterface.lookup_fully_qualified_or_none", "SemanticAnalyzerCoreInterface.defer", "SemanticAnalyzerCoreInterface.is_future_flag_set", "SemanticAnalyzerCoreInterface.lookup_qualified", "docstring", "SemanticAnalyzerCoreInterface.record_incomplete_ref", "SemanticAnalyzerCoreInterface", "SemanticAnalyzerCoreInterface.fail", "SemanticAnalyzerCoreInterface.is_incomplete_namespace"], "tokens": 379}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": " # type: Final\n\n\n@trait\nclass SemanticAnalyzerCoreInterface:\n \"\"\"A core abstract interface to generic semantic analyzer functionality.\n\n This is implemented by both semantic analyzer passes 2 and 3.\n \"\"\"\n\n @abstractmethod\n def lookup_qualified(self, name: str, ctx: Context,\n suppress_errors: bool = False) -> Optional[SymbolTableNode]:\n raise NotImplementedError\n\n @abstractmethod\n def lookup_fully_qualified(self, name: str) -> SymbolTableNode:\n raise NotImplementedError\n\n @abstractmethod\n def lookup_fully_qualified_or_none(self, name: str) -> Optional[SymbolTableNode]:\n raise NotImplementedError\n\n @abstractmethod\n def fail(self, msg: str, ctx: Context, serious: bool = False, *,\n blocker: bool = False, code: Optional[ErrorCode] = None) -> None:\n raise NotImplementedError\n\n @abstractmethod\n def note(self, msg: str, ctx: Context, *, code: Optional[ErrorCode] = None) -> None:\n raise NotImplementedError\n\n @abstractmethod\n def record_incomplete_ref(self) -> None:\n raise NotImplementedError\n\n @abstractmethod\n def defer(self) -> None:\n raise NotImplementedError\n\n @abstractmethod\n def is_incomplete_namespace(self, fullname: str) -> bool:\n \"\"\"Is a module or class namespace potentially missing some definitions?\"\"\"\n raise NotImplementedError\n\n @property\n @abstractmethod\n def final_iteration(self) -> bool:\n \"\"\"Is this the final iteration of semantic analysis?\"\"\"\n raise NotImplementedError\n\n @abstractmethod\n def is_future_flag_set(self, flag: str) -> bool:\n \"\"\"Is the specific __future__ feature imported\"\"\"\n raise NotImplementedError\n\n @property\n @abstractmethod\n def is_stub_file(self) -> bool:\n raise NotImplementedError", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_get_mypy_type_of_runtime_value_get_mypy_type_of_runtime_value.try_.except_TypeError_.return.fallback": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py_get_mypy_type_of_runtime_value_get_mypy_type_of_runtime_value.try_.except_TypeError_.return.fallback", "embedding": null, "metadata": {"file_path": "mypy/stubtest.py", "file_name": "stubtest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 889, "end_line": 981, "span_ids": ["get_mypy_type_of_runtime_value"], "tokens": 801}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_mypy_type_of_runtime_value(runtime: Any) -> Optional[mypy.types.Type]:\n \"\"\"Returns a mypy type object representing the type of ``runtime``.\n\n Returns None if we can't find something that works.\n\n \"\"\"\n if runtime is None:\n return mypy.types.NoneType()\n if isinstance(runtime, property):\n # Give up on properties to avoid issues with things that are typed as attributes.\n return None\n\n def anytype() -> mypy.types.AnyType:\n return mypy.types.AnyType(mypy.types.TypeOfAny.unannotated)\n\n if isinstance(\n runtime,\n (types.FunctionType, types.BuiltinFunctionType,\n types.MethodType, types.BuiltinMethodType)\n ):\n builtins = get_stub(\"builtins\")\n assert builtins is not None\n type_info = builtins.names[\"function\"].node\n assert isinstance(type_info, nodes.TypeInfo)\n fallback = mypy.types.Instance(type_info, [anytype()])\n try:\n signature = inspect.signature(runtime)\n arg_types = []\n arg_kinds = []\n arg_names = []\n for arg in signature.parameters.values():\n arg_types.append(anytype())\n arg_names.append(\n None if arg.kind == inspect.Parameter.POSITIONAL_ONLY else arg.name\n )\n has_default = arg.default == inspect.Parameter.empty\n if arg.kind == inspect.Parameter.POSITIONAL_ONLY:\n arg_kinds.append(nodes.ARG_POS if has_default else nodes.ARG_OPT)\n elif arg.kind == inspect.Parameter.POSITIONAL_OR_KEYWORD:\n arg_kinds.append(nodes.ARG_POS if has_default else nodes.ARG_OPT)\n elif arg.kind == inspect.Parameter.KEYWORD_ONLY:\n arg_kinds.append(nodes.ARG_NAMED if has_default else nodes.ARG_NAMED_OPT)\n elif arg.kind == inspect.Parameter.VAR_POSITIONAL:\n arg_kinds.append(nodes.ARG_STAR)\n elif arg.kind == inspect.Parameter.VAR_KEYWORD:\n arg_kinds.append(nodes.ARG_STAR2)\n else:\n raise AssertionError\n except ValueError:\n arg_types = [anytype(), anytype()]\n arg_kinds = [nodes.ARG_STAR, nodes.ARG_STAR2]\n arg_names = [None, None]\n\n return mypy.types.CallableType(\n arg_types,\n arg_kinds,\n arg_names,\n ret_type=anytype(),\n fallback=fallback,\n is_ellipsis_args=True,\n )\n\n # Try and look up a stub for the runtime object\n stub = get_stub(type(runtime).__module__)\n if stub is None:\n return None\n type_name = type(runtime).__name__\n if type_name not in stub.names:\n return None\n type_info = stub.names[type_name].node\n if isinstance(type_info, nodes.Var):\n return type_info.type\n if not isinstance(type_info, nodes.TypeInfo):\n return None\n\n if isinstance(runtime, tuple):\n # Special case tuples so we construct a valid mypy.types.TupleType\n optional_items = [get_mypy_type_of_runtime_value(v) for v in runtime]\n items = [(i if i is not None else anytype()) for i in optional_items]\n fallback = mypy.types.Instance(type_info, [anytype()])\n return mypy.types.TupleType(items, fallback)\n\n fallback = mypy.types.Instance(type_info, [anytype() for _ in type_info.type_vars])\n try:\n # Literals are supposed to be only bool, int, str, bytes or enums, but this seems to work\n # well (when not using mypyc, for which bytes and enums are also problematic).\n return mypy.types.LiteralType(\n value=runtime,\n fallback=fallback,\n )\n except TypeError:\n # Ask for forgiveness if we're using mypyc.\n return fallback", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py__all_stubs_build_stubs.return.all_modules": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py__all_stubs_build_stubs.return.all_modules", "embedding": null, "metadata": {"file_path": "mypy/stubtest.py", "file_name": "stubtest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1002, "end_line": 1060, "span_ids": ["build_stubs", "impl:13"], "tokens": 489}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "_all_stubs = {} # type: Dict[str, nodes.MypyFile]\n\n\ndef build_stubs(modules: List[str], options: Options, find_submodules: bool = False) -> List[str]:\n \"\"\"Uses mypy to construct stub objects for the given modules.\n\n This sets global state that ``get_stub`` can access.\n\n Returns all modules we might want to check. If ``find_submodules`` is False, this is equal\n to ``modules``.\n\n :param modules: List of modules to build stubs for.\n :param options: Mypy options for finding and building stubs.\n :param find_submodules: Whether to attempt to find submodules of the given modules as well.\n\n \"\"\"\n data_dir = mypy.build.default_data_dir()\n search_path = mypy.modulefinder.compute_search_paths([], options, data_dir)\n find_module_cache = mypy.modulefinder.FindModuleCache(\n search_path, fscache=None, options=options\n )\n\n all_modules = []\n sources = []\n for module in modules:\n all_modules.append(module)\n if not find_submodules:\n module_path = find_module_cache.find_module(module)\n if not isinstance(module_path, str):\n # test_module will yield an error later when it can't find stubs\n continue\n sources.append(mypy.modulefinder.BuildSource(module_path, module, None))\n else:\n found_sources = find_module_cache.find_modules_recursive(module)\n sources.extend(found_sources)\n all_modules.extend(s.module for s in found_sources if s.module not in all_modules)\n\n try:\n res = mypy.build.build(sources=sources, options=options)\n except mypy.errors.CompileError as e:\n output = [\n _style(\"error: \", color=\"red\", bold=True),\n \"not checking stubs due to failed mypy compile:\\n\",\n str(e),\n ]\n print(\"\".join(output))\n raise RuntimeError from e\n if res.errors:\n output = [\n _style(\"error: \", color=\"red\", bold=True),\n \"not checking stubs due to mypy build errors:\\n\",\n ]\n print(\"\".join(output) + \"\\n\".join(res.errors))\n raise RuntimeError\n\n global _all_stubs\n _all_stubs = res.files\n\n return all_modules", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/test_find_sources.py_normalise_path_find_sources.return.normalise_build_source_li": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/test_find_sources.py_normalise_path_find_sources.return.normalise_build_source_li", "embedding": null, "metadata": {"file_path": "mypy/test/test_find_sources.py", "file_name": "test_find_sources.py", "file_type": "text/x-python", "category": "test", "start_line": 36, "end_line": 62, "span_ids": ["crawl", "find_sources", "normalise_path", "normalise_build_source_list", "find_sources_in_dir"], "tokens": 242}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def normalise_path(path: str) -> str:\n path = os.path.splitdrive(path)[1]\n path = path.replace(os.sep, \"/\")\n return path\n\n\ndef normalise_build_source_list(sources: List[BuildSource]) -> List[Tuple[str, Optional[str]]]:\n return sorted(\n (s.module, (normalise_path(s.base_dir) if s.base_dir is not None else None))\n for s in sources\n )\n\n\ndef crawl(finder: SourceFinder, f: str) -> Tuple[str, str]:\n module, base_dir = finder.crawl_up(f)\n return module, normalise_path(base_dir)\n\n\ndef find_sources_in_dir(finder: SourceFinder, f: str) -> List[Tuple[str, Optional[str]]]:\n return normalise_build_source_list(finder.find_sources_in_dir(os.path.abspath(f)))\n\n\ndef find_sources(\n paths: List[str], options: Options, fscache: FileSystemCache\n) -> List[Tuple[str, Optional[str]]]:\n paths = [os.path.abspath(p) for p in paths]\n return normalise_build_source_list(create_source_list(paths, options, fscache))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/test_find_sources.py_SourceFinderSuite_SourceFinderSuite.test_crawl_no_namespace.None_6": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/test_find_sources.py_SourceFinderSuite_SourceFinderSuite.test_crawl_no_namespace.None_6", "embedding": null, "metadata": {"file_path": "mypy/test/test_find_sources.py", "file_name": "test_find_sources.py", "file_type": "text/x-python", "category": "test", "start_line": 65, "end_line": 104, "span_ids": ["SourceFinderSuite.tearDown", "SourceFinderSuite.setUp", "SourceFinderSuite.test_crawl_no_namespace", "SourceFinderSuite"], "tokens": 406}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SourceFinderSuite(unittest.TestCase):\n def setUp(self) -> None:\n self.tempdir = tempfile.mkdtemp()\n self.oldcwd = os.getcwd()\n os.chdir(self.tempdir)\n\n def tearDown(self) -> None:\n os.chdir(self.oldcwd)\n shutil.rmtree(self.tempdir)\n\n def test_crawl_no_namespace(self) -> None:\n options = Options()\n options.namespace_packages = False\n\n finder = SourceFinder(FakeFSCache({\"/setup.py\"}), options)\n assert crawl(finder, \"/setup.py\") == (\"setup\", \"/\")\n\n finder = SourceFinder(FakeFSCache({\"/a/setup.py\"}), options)\n assert crawl(finder, \"/a/setup.py\") == (\"setup\", \"/a\")\n\n finder = SourceFinder(FakeFSCache({\"/a/b/setup.py\"}), options)\n assert crawl(finder, \"/a/b/setup.py\") == (\"setup\", \"/a/b\")\n\n finder = SourceFinder(FakeFSCache({\"/a/setup.py\", \"/a/__init__.py\"}), options)\n assert crawl(finder, \"/a/setup.py\") == (\"a.setup\", \"/\")\n\n finder = SourceFinder(\n FakeFSCache({\"/a/invalid-name/setup.py\", \"/a/__init__.py\"}),\n options,\n )\n assert crawl(finder, \"/a/invalid-name/setup.py\") == (\"setup\", \"/a/invalid-name\")\n\n finder = SourceFinder(FakeFSCache({\"/a/b/setup.py\", \"/a/__init__.py\"}), options)\n assert crawl(finder, \"/a/b/setup.py\") == (\"setup\", \"/a/b\")\n\n finder = SourceFinder(\n FakeFSCache({\"/a/b/c/setup.py\", \"/a/__init__.py\", \"/a/b/c/__init__.py\"}),\n options,\n )\n assert crawl(finder, \"/a/b/c/setup.py\") == (\"c.setup\", \"/a/b\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/test_find_sources.py_SourceFinderSuite.test_crawl_namespace_SourceFinderSuite.test_crawl_namespace.None_6": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/test_find_sources.py_SourceFinderSuite.test_crawl_namespace_SourceFinderSuite.test_crawl_namespace.None_6", "embedding": null, "metadata": {"file_path": "mypy/test/test_find_sources.py", "file_name": "test_find_sources.py", "file_type": "text/x-python", "category": "test", "start_line": 86, "end_line": 115, "span_ids": ["SourceFinderSuite.test_crawl_namespace"], "tokens": 350}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SourceFinderSuite(unittest.TestCase):\n\n def test_crawl_namespace(self) -> None:\n options = Options()\n options.namespace_packages = True\n\n finder = SourceFinder(FakeFSCache({\"/setup.py\"}), options)\n assert crawl(finder, \"/setup.py\") == (\"setup\", \"/\")\n\n finder = SourceFinder(FakeFSCache({\"/a/setup.py\"}), options)\n assert crawl(finder, \"/a/setup.py\") == (\"setup\", \"/a\")\n\n finder = SourceFinder(FakeFSCache({\"/a/b/setup.py\"}), options)\n assert crawl(finder, \"/a/b/setup.py\") == (\"setup\", \"/a/b\")\n\n finder = SourceFinder(FakeFSCache({\"/a/setup.py\", \"/a/__init__.py\"}), options)\n assert crawl(finder, \"/a/setup.py\") == (\"a.setup\", \"/\")\n\n finder = SourceFinder(\n FakeFSCache({\"/a/invalid-name/setup.py\", \"/a/__init__.py\"}),\n options,\n )\n assert crawl(finder, \"/a/invalid-name/setup.py\") == (\"setup\", \"/a/invalid-name\")\n\n finder = SourceFinder(FakeFSCache({\"/a/b/setup.py\", \"/a/__init__.py\"}), options)\n assert crawl(finder, \"/a/b/setup.py\") == (\"a.b.setup\", \"/\")\n\n finder = SourceFinder(\n FakeFSCache({\"/a/b/c/setup.py\", \"/a/__init__.py\", \"/a/b/c/__init__.py\"}),\n options,\n )\n assert crawl(finder, \"/a/b/c/setup.py\") == (\"a.b.c.setup\", \"/\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/test_find_sources.py_SourceFinderSuite.test_crawl_namespace_explicit_base_SourceFinderSuite.test_crawl_namespace_explicit_base.None_9": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/test_find_sources.py_SourceFinderSuite.test_crawl_namespace_explicit_base_SourceFinderSuite.test_crawl_namespace_explicit_base.None_9", "embedding": null, "metadata": {"file_path": "mypy/test/test_find_sources.py", "file_name": "test_find_sources.py", "file_type": "text/x-python", "category": "test", "start_line": 117, "end_line": 163, "span_ids": ["SourceFinderSuite.test_crawl_namespace_explicit_base"], "tokens": 553}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SourceFinderSuite(unittest.TestCase):\n\n def test_crawl_namespace_explicit_base(self) -> None:\n options = Options()\n options.namespace_packages = True\n options.explicit_package_bases = True\n\n finder = SourceFinder(FakeFSCache({\"/setup.py\"}), options)\n assert crawl(finder, \"/setup.py\") == (\"setup\", \"/\")\n\n finder = SourceFinder(FakeFSCache({\"/a/setup.py\"}), options)\n assert crawl(finder, \"/a/setup.py\") == (\"setup\", \"/a\")\n\n finder = SourceFinder(FakeFSCache({\"/a/b/setup.py\"}), options)\n assert crawl(finder, \"/a/b/setup.py\") == (\"setup\", \"/a/b\")\n\n finder = SourceFinder(FakeFSCache({\"/a/setup.py\", \"/a/__init__.py\"}), options)\n assert crawl(finder, \"/a/setup.py\") == (\"a.setup\", \"/\")\n\n finder = SourceFinder(\n FakeFSCache({\"/a/invalid-name/setup.py\", \"/a/__init__.py\"}),\n options,\n )\n assert crawl(finder, \"/a/invalid-name/setup.py\") == (\"setup\", \"/a/invalid-name\")\n\n finder = SourceFinder(FakeFSCache({\"/a/b/setup.py\", \"/a/__init__.py\"}), options)\n assert crawl(finder, \"/a/b/setup.py\") == (\"a.b.setup\", \"/\")\n\n finder = SourceFinder(\n FakeFSCache({\"/a/b/c/setup.py\", \"/a/__init__.py\", \"/a/b/c/__init__.py\"}),\n options,\n )\n assert crawl(finder, \"/a/b/c/setup.py\") == (\"a.b.c.setup\", \"/\")\n\n # set mypy path, so we actually have some explicit base dirs\n options.mypy_path = [\"/a/b\"]\n\n finder = SourceFinder(FakeFSCache({\"/a/b/c/setup.py\"}), options)\n assert crawl(finder, \"/a/b/c/setup.py\") == (\"c.setup\", \"/a/b\")\n\n finder = SourceFinder(\n FakeFSCache({\"/a/b/c/setup.py\", \"/a/__init__.py\", \"/a/b/c/__init__.py\"}),\n options,\n )\n assert crawl(finder, \"/a/b/c/setup.py\") == (\"c.setup\", \"/a/b\")\n\n options.mypy_path = [\"/a/b\", \"/a/b/c\"]\n finder = SourceFinder(FakeFSCache({\"/a/b/c/setup.py\"}), options)\n assert crawl(finder, \"/a/b/c/setup.py\") == (\"setup\", \"/a/b/c\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/test_find_sources.py_SourceFinderSuite.test_crawl_namespace_multi_dir_SourceFinderSuite.test_crawl_namespace_multi_dir.assert_crawl_finder_b_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/test_find_sources.py_SourceFinderSuite.test_crawl_namespace_multi_dir_SourceFinderSuite.test_crawl_namespace_multi_dir.assert_crawl_finder_b_", "embedding": null, "metadata": {"file_path": "mypy/test/test_find_sources.py", "file_name": "test_find_sources.py", "file_type": "text/x-python", "category": "test", "start_line": 165, "end_line": 173, "span_ids": ["SourceFinderSuite.test_crawl_namespace_multi_dir"], "tokens": 120}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SourceFinderSuite(unittest.TestCase):\n\n def test_crawl_namespace_multi_dir(self) -> None:\n options = Options()\n options.namespace_packages = True\n options.explicit_package_bases = True\n options.mypy_path = [\"/a\", \"/b\"]\n\n finder = SourceFinder(FakeFSCache({\"/a/pkg/a.py\", \"/b/pkg/b.py\"}), options)\n assert crawl(finder, \"/a/pkg/a.py\") == (\"pkg.a\", \"/a\")\n assert crawl(finder, \"/b/pkg/b.py\") == (\"pkg.b\", \"/b\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestUnit.test_var_StubtestUnit.test_var.None_7": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_StubtestUnit.test_var_StubtestUnit.test_var.None_7", "embedding": null, "metadata": {"file_path": "mypy/test/teststubtest.py", "file_name": "teststubtest.py", "file_type": "text/x-python", "category": "test", "start_line": 533, "end_line": 569, "span_ids": ["StubtestUnit.test_var"], "tokens": 299}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubtestUnit(unittest.TestCase):\n\n @collect_cases\n def test_var(self) -> Iterator[Case]:\n yield Case(stub=\"x1: int\", runtime=\"x1 = 5\", error=None)\n yield Case(stub=\"x2: str\", runtime=\"x2 = 5\", error=\"x2\")\n yield Case(\"from typing import Tuple\", \"\", None) # dummy case\n yield Case(\n stub=\"\"\"\n x3: Tuple[int, int]\n \"\"\",\n runtime=\"x3 = (1, 3)\",\n error=None,\n )\n yield Case(\n stub=\"\"\"\n x4: Tuple[int, int]\n \"\"\",\n runtime=\"x4 = (1, 3, 5)\",\n error=\"x4\",\n )\n yield Case(stub=\"x5: int\", runtime=\"def x5(a, b): pass\", error=\"x5\")\n yield Case(\n stub=\"def foo(a: int, b: int) -> None: ...\\nx6 = foo\",\n runtime=\"def foo(a, b): pass\\ndef x6(c, d): pass\",\n error=\"x6\",\n )\n yield Case(\n stub=\"\"\"\n class X:\n f: int\n \"\"\",\n runtime=\"\"\"\n class X:\n def __init__(self):\n self.f = \"asdf\"\n \"\"\",\n error=None,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testutil.py_os_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testutil.py_os_", "embedding": null, "metadata": {"file_path": "mypy/test/testutil.py", "file_name": "testutil.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 16, "span_ids": ["imports", "TestGetTerminalSize.test_get_terminal_size_in_pty_defaults_to_80", "TestGetTerminalSize"], "tokens": 142}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nfrom unittest import mock, TestCase\n\nfrom mypy.util import get_terminal_width\n\n\nclass TestGetTerminalSize(TestCase):\n def test_get_terminal_size_in_pty_defaults_to_80(self) -> None:\n # when run using a pty, `os.get_terminal_size()` returns `0, 0`\n ret = os.terminal_size((0, 0))\n mock_environ = os.environ.copy()\n mock_environ.pop('COLUMNS', None)\n with mock.patch.object(os, 'get_terminal_size', return_value=ret):\n with mock.patch.dict(os.environ, values=mock_environ, clear=True):\n assert get_terminal_width() == 80", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/treetransform.py_TransformVisitor_TransformVisitor.__init__._type_Dict_FuncDef_Fun": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/treetransform.py_TransformVisitor_TransformVisitor.__init__._type_Dict_FuncDef_Fun", "embedding": null, "metadata": {"file_path": "mypy/treetransform.py", "file_name": "treetransform.py", "file_type": "text/x-python", "category": "implementation", "start_line": 31, "end_line": 63, "span_ids": ["TransformVisitor.__init__", "TransformVisitor"], "tokens": 325}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TransformVisitor(NodeVisitor[Node]):\n \"\"\"Transform a semantically analyzed AST (or subtree) to an identical copy.\n\n Use the node() method to transform an AST node.\n\n Subclass to perform a non-identity transform.\n\n Notes:\n\n * This can only be used to transform functions or classes, not top-level\n statements, and/or modules as a whole.\n * Do not duplicate TypeInfo nodes. This would generally not be desirable.\n * Only update some name binding cross-references, but only those that\n refer to Var, Decorator or FuncDef nodes, not those targeting ClassDef or\n TypeInfo nodes.\n * Types are not transformed, but you can override type() to also perform\n type transformation.\n\n TODO nested classes and functions have not been tested well enough\n \"\"\"\n\n def __init__(self) -> None:\n # To simplify testing, set this flag to True if you want to transform\n # all statements in a file (this is prohibited in normal mode).\n self.test_only = False\n # There may be multiple references to a Var node. Keep track of\n # Var translations using a dictionary.\n self.var_map = {} # type: Dict[Var, Var]\n # These are uninitialized placeholder nodes used temporarily for nested\n # functions while we are transforming a top-level function. This maps an\n # untransformed node to a placeholder (which will later become the\n # transformed node).\n self.func_placeholder_map = {} # type: Dict[FuncDef, FuncDef]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/treetransform.py_TransformVisitor.visit_mypy_file_TransformVisitor.visit_mypy_file.return.new": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/treetransform.py_TransformVisitor.visit_mypy_file_TransformVisitor.visit_mypy_file.return.new", "embedding": null, "metadata": {"file_path": "mypy/treetransform.py", "file_name": "treetransform.py", "file_type": "text/x-python", "category": "implementation", "start_line": 65, "end_line": 75, "span_ids": ["TransformVisitor.visit_mypy_file"], "tokens": 136}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TransformVisitor(NodeVisitor[Node]):\n\n def visit_mypy_file(self, node: MypyFile) -> MypyFile:\n assert self.test_only, \"This visitor should not be used for whole files.\"\n # NOTE: The 'names' and 'imports' instance variables will be empty!\n ignored_lines = {line: codes[:]\n for line, codes in node.ignored_lines.items()}\n new = MypyFile(self.statements(node.defs), [], node.is_bom,\n ignored_lines=ignored_lines)\n new._fullname = node._fullname\n new.path = node.path\n new.names = SymbolTable()\n return new", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/treetransform.py_TransformVisitor.visit_import_TransformVisitor.copy_argument.return.arg": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/treetransform.py_TransformVisitor.visit_import_TransformVisitor.copy_argument.return.arg", "embedding": null, "metadata": {"file_path": "mypy/treetransform.py", "file_name": "treetransform.py", "file_type": "text/x-python", "category": "implementation", "start_line": 77, "end_line": 97, "span_ids": ["TransformVisitor.visit_import_all", "TransformVisitor.visit_import", "TransformVisitor.copy_argument", "TransformVisitor.visit_import_from"], "tokens": 145}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TransformVisitor(NodeVisitor[Node]):\n\n def visit_import(self, node: Import) -> Import:\n return Import(node.ids[:])\n\n def visit_import_from(self, node: ImportFrom) -> ImportFrom:\n return ImportFrom(node.id, node.relative, node.names[:])\n\n def visit_import_all(self, node: ImportAll) -> ImportAll:\n return ImportAll(node.id, node.relative)\n\n def copy_argument(self, argument: Argument) -> Argument:\n arg = Argument(\n self.visit_var(argument.variable),\n argument.type_annotation,\n argument.initializer,\n argument.kind,\n )\n\n # Refresh lines of the inner things\n arg.set_line(argument.line)\n\n return arg", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_None_3_analyze_type_alias.return.res_analyzer_aliases_use": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_None_3_analyze_type_alias.return.res_analyzer_aliases_use", "embedding": null, "metadata": {"file_path": "mypy/typeanal.py", "file_name": "typeanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 63, "end_line": 93, "span_ids": ["docstring:3", "analyze_type_alias"], "tokens": 283}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": " # type: Final\n\n\ndef analyze_type_alias(node: Expression,\n api: SemanticAnalyzerCoreInterface,\n tvar_scope: TypeVarLikeScope,\n plugin: Plugin,\n options: Options,\n is_typeshed_stub: bool,\n allow_unnormalized: bool = False,\n allow_placeholder: bool = False,\n in_dynamic_func: bool = False,\n global_scope: bool = True) -> Optional[Tuple[Type, Set[str]]]:\n \"\"\"Analyze r.h.s. of a (potential) type alias definition.\n\n If `node` is valid as a type alias rvalue, return the resulting type and a set of\n full names of type aliases it depends on (directly or indirectly).\n Return None otherwise. 'node' must have been semantically analyzed.\n \"\"\"\n try:\n type = expr_to_unanalyzed_type(node)\n except TypeTranslationError:\n api.fail('Invalid type alias: expression is not a valid type', node)\n return None\n analyzer = TypeAnalyser(api, tvar_scope, plugin, options, is_typeshed_stub,\n allow_unnormalized=allow_unnormalized, defining_alias=True,\n allow_placeholder=allow_placeholder)\n analyzer.in_dynamic_func = in_dynamic_func\n analyzer.global_scope = global_scope\n res = type.accept(analyzer)\n return res, analyzer.aliases_used", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_no_subscript_builtin_alias_no_subscript_builtin_alias.return.msg": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_no_subscript_builtin_alias_no_subscript_builtin_alias.return.msg", "embedding": null, "metadata": {"file_path": "mypy/typeanal.py", "file_name": "typeanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 96, "end_line": 103, "span_ids": ["no_subscript_builtin_alias"], "tokens": 112}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def no_subscript_builtin_alias(name: str, propose_alt: bool = True) -> str:\n msg = '\"{}\" is not subscriptable'.format(name.split('.')[-1])\n # This should never be called if the python_version is 3.9 or newer\n nongen_builtins = get_nongen_builtins((3, 8))\n replacement = nongen_builtins[name]\n if replacement and propose_alt:\n msg += ', use \"{}\" instead'.format(replacement)\n return msg", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.visit_literal_type_TypeAnalyser.visit_union_type.return.UnionType_self_anal_array": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.visit_literal_type_TypeAnalyser.visit_union_type.return.UnionType_self_anal_array", "embedding": null, "metadata": {"file_path": "mypy/typeanal.py", "file_name": "typeanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 613, "end_line": 626, "span_ids": ["TypeAnalyser.visit_star_type", "TypeAnalyser.visit_union_type", "TypeAnalyser.visit_literal_type"], "tokens": 172}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeAnalyser(SyntheticTypeVisitor[Type], TypeAnalyzerPluginInterface):\n\n def visit_literal_type(self, t: LiteralType) -> Type:\n return t\n\n def visit_star_type(self, t: StarType) -> Type:\n return StarType(self.anal_type(t.type), t.line)\n\n def visit_union_type(self, t: UnionType) -> Type:\n if (t.uses_pep604_syntax is True\n and t.is_evaluated is True\n and self.api.is_stub_file is False\n and self.options.python_version < (3, 10)\n and self.api.is_future_flag_set('annotations') is False):\n self.fail(\"X | Y syntax for unions requires Python 3.10\", t)\n return UnionType(self.anal_array(t.items), t.line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.visit_partial_type_TypeAnalyser.visit_placeholder_type.if_not_n_or_isinstance_n_.else_.return.self_analyze_type_with_ty": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.visit_partial_type_TypeAnalyser.visit_placeholder_type.if_not_n_or_isinstance_n_.else_.return.self_analyze_type_with_ty", "embedding": null, "metadata": {"file_path": "mypy/typeanal.py", "file_name": "typeanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 628, "end_line": 646, "span_ids": ["TypeAnalyser.visit_placeholder_type", "TypeAnalyser.visit_ellipsis_type", "TypeAnalyser.visit_type_type", "TypeAnalyser.visit_partial_type"], "tokens": 213}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeAnalyser(SyntheticTypeVisitor[Type], TypeAnalyzerPluginInterface):\n\n def visit_partial_type(self, t: PartialType) -> Type:\n assert False, \"Internal error: Unexpected partial type\"\n\n def visit_ellipsis_type(self, t: EllipsisType) -> Type:\n self.fail(\"Unexpected '...'\", t)\n return AnyType(TypeOfAny.from_error)\n\n def visit_type_type(self, t: TypeType) -> Type:\n return TypeType.make_normalized(self.anal_type(t.item), line=t.line)\n\n def visit_placeholder_type(self, t: PlaceholderType) -> Type:\n n = None if t.fullname is None else self.api.lookup_fully_qualified(t.fullname)\n if not n or isinstance(n.node, PlaceholderNode):\n self.api.defer() # Still incomplete\n return t\n else:\n # TODO: Handle non-TypeInfo\n assert isinstance(n.node, TypeInfo)\n return self.analyze_type_with_type_info(n.node, t.args, t)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_None_14_write_junit_xml.with_open_path_wb_as_.f_write_xml_encode_utf_8": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_None_14_write_junit_xml.with_open_path_wb_as_.f_write_xml_encode_utf_8", "embedding": null, "metadata": {"file_path": "mypy/util.py", "file_name": "util.py", "file_type": "text/x-python", "category": "implementation", "start_line": 238, "end_line": 259, "span_ids": ["write_junit_xml", "impl:25"], "tokens": 202}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": " # type: Final\n\n\ndef write_junit_xml(dt: float, serious: bool, messages: List[str], path: str,\n version: str, platform: str) -> None:\n from xml.sax.saxutils import escape\n if not messages and not serious:\n xml = PASS_TEMPLATE.format(time=dt, ver=version, platform=platform)\n elif not serious:\n xml = FAIL_TEMPLATE.format(text=escape('\\n'.join(messages)), time=dt,\n ver=version, platform=platform)\n else:\n xml = ERROR_TEMPLATE.format(text=escape('\\n'.join(messages)), time=dt,\n ver=version, platform=platform)\n\n # checks for a directory structure in path and creates folders if needed\n xml_dirs = os.path.dirname(os.path.abspath(path))\n if not os.path.isdir(xml_dirs):\n os.makedirs(xml_dirs)\n\n with open(path, 'wb') as f:\n f.write(xml.encode('utf-8'))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_count_stats_get_terminal_width.return._int_os_getenv_MYPY_FORC": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_count_stats_get_terminal_width.return._int_os_getenv_MYPY_FORC", "embedding": null, "metadata": {"file_path": "mypy/util.py", "file_name": "util.py", "file_type": "text/x-python", "category": "implementation", "start_line": 394, "end_line": 422, "span_ids": ["count_stats", "split_words", "get_terminal_width"], "tokens": 229}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def count_stats(errors: List[str]) -> Tuple[int, int]:\n \"\"\"Count total number of errors and files in error list.\"\"\"\n errors = [e for e in errors if ': error:' in e]\n files = {e.split(':')[0] for e in errors}\n return len(errors), len(files)\n\n\ndef split_words(msg: str) -> List[str]:\n \"\"\"Split line of text into words (but not within quoted groups).\"\"\"\n next_word = ''\n res = [] # type: List[str]\n allow_break = True\n for c in msg:\n if c == ' ' and allow_break:\n res.append(next_word)\n next_word = ''\n continue\n if c == '\"':\n allow_break = not allow_break\n next_word += c\n res.append(next_word)\n return res\n\n\ndef get_terminal_width() -> int:\n \"\"\"Get current terminal width if possible, otherwise return the default one.\"\"\"\n return (int(os.getenv('MYPY_FORCE_TERMINAL_WIDTH', '0'))\n or shutil.get_terminal_size().columns\n or DEFAULT_COLUMNS)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py__Data_flow_analyses__from_mypyc_ir_func_ir_imp": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py__Data_flow_analyses__from_mypyc_ir_func_ir_imp", "embedding": null, "metadata": {"file_path": "mypyc/analysis/dataflow.py", "file_name": "dataflow.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 14, "span_ids": ["docstring"], "tokens": 164}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Data-flow analyses.\"\"\"\n\nfrom abc import abstractmethod\n\nfrom typing import Dict, Tuple, List, Set, TypeVar, Iterator, Generic, Optional, Iterable, Union\n\nfrom mypyc.ir.ops import (\n Value, ControlOp,\n BasicBlock, OpVisitor, Assign, AssignMulti, Integer, LoadErrorValue, RegisterOp, Goto, Branch,\n Return, Call, Box, Unbox, Cast, Op, Unreachable, TupleGet, TupleSet, GetAttr, SetAttr,\n LoadLiteral, LoadStatic, InitStatic, MethodCall, RaiseStandardError, CallC, LoadGlobal,\n Truncate, IntOp, LoadMem, GetElementPtr, LoadAddress, ComparisonOp, SetMem, KeepAlive\n)\nfrom mypyc.ir.func_ir import all_values", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py_analyze_undefined_regs_non_trivial_sources.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py_analyze_undefined_regs_non_trivial_sources.return.result", "embedding": null, "metadata": {"file_path": "mypyc/analysis/dataflow.py", "file_name": "dataflow.py", "file_type": "text/x-python", "category": "implementation", "start_line": 354, "end_line": 378, "span_ids": ["analyze_undefined_regs", "non_trivial_sources"], "tokens": 173}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def analyze_undefined_regs(blocks: List[BasicBlock],\n cfg: CFG,\n initial_defined: Set[Value]) -> AnalysisResult[Value]:\n \"\"\"Calculate potentially undefined registers at each CFG location.\n\n A register is undefined if there is some path from initial block\n where it has an undefined value.\n\n Function arguments are assumed to be always defined.\n \"\"\"\n initial_undefined = set(all_values([], blocks)) - initial_defined\n return run_analysis(blocks=blocks,\n cfg=cfg,\n gen_and_kill=UndefinedVisitor(),\n initial=initial_undefined,\n backward=False,\n kind=MAYBE_ANALYSIS)\n\n\ndef non_trivial_sources(op: Op) -> Set[Value]:\n result = set()\n for source in op.sources():\n if not isinstance(source, Integer):\n result.add(source)\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py_LivenessVisitor_LivenessVisitor.visit_set_mem.return.non_trivial_sources_op_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py_LivenessVisitor_LivenessVisitor.visit_set_mem.return.non_trivial_sources_op_", "embedding": null, "metadata": {"file_path": "mypyc/analysis/dataflow.py", "file_name": "dataflow.py", "file_type": "text/x-python", "category": "implementation", "start_line": 401, "end_line": 428, "span_ids": ["LivenessVisitor.visit_branch", "LivenessVisitor.visit_set_mem", "LivenessVisitor.visit_register_op", "LivenessVisitor", "LivenessVisitor.visit_unreachable", "LivenessVisitor.visit_return", "LivenessVisitor.visit_assign_multi", "LivenessVisitor.visit_assign"], "tokens": 229}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LivenessVisitor(BaseAnalysisVisitor):\n def visit_branch(self, op: Branch) -> GenAndKill:\n return non_trivial_sources(op), set()\n\n def visit_return(self, op: Return) -> GenAndKill:\n if not isinstance(op.value, Integer):\n return {op.value}, set()\n else:\n return set(), set()\n\n def visit_unreachable(self, op: Unreachable) -> GenAndKill:\n return set(), set()\n\n def visit_register_op(self, op: RegisterOp) -> GenAndKill:\n gen = non_trivial_sources(op)\n if not op.is_void:\n return gen, {op}\n else:\n return gen, set()\n\n def visit_assign(self, op: Assign) -> GenAndKill:\n return non_trivial_sources(op), {op.dest}\n\n def visit_assign_multi(self, op: AssignMulti) -> GenAndKill:\n return non_trivial_sources(op), {op.dest}\n\n def visit_set_mem(self, op: SetMem) -> GenAndKill:\n return non_trivial_sources(op), set()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_dealloc_for_class_generate_dealloc_for_class.None_8": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_dealloc_for_class_generate_dealloc_for_class.None_8", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitclass.py", "file_name": "emitclass.py", "file_type": "text/x-python", "category": "implementation", "start_line": 622, "end_line": 635, "span_ids": ["generate_dealloc_for_class"], "tokens": 170}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_dealloc_for_class(cl: ClassIR,\n dealloc_func_name: str,\n clear_func_name: str,\n emitter: Emitter) -> None:\n emitter.emit_line('static void')\n emitter.emit_line('{}({} *self)'.format(dealloc_func_name, cl.struct_name(emitter.names)))\n emitter.emit_line('{')\n emitter.emit_line('PyObject_GC_UnTrack(self);')\n # The trashcan is needed to handle deep recursive deallocations\n emitter.emit_line('CPy_TRASHCAN_BEGIN(self, {})'.format(dealloc_func_name))\n emitter.emit_line('{}(self);'.format(clear_func_name))\n emitter.emit_line('Py_TYPE(self)->tp_free((PyObject *)self);')\n emitter.emit_line('CPy_TRASHCAN_END(self)')\n emitter.emit_line('}')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.visit_return_FunctionEmitterVisitor.visit_tuple_set.self_emit_inc_ref_dest_t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.visit_return_FunctionEmitterVisitor.visit_tuple_set.self_emit_inc_ref_dest_t", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitfunc.py", "file_name": "emitfunc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 143, "end_line": 156, "span_ids": ["FunctionEmitterVisitor.visit_tuple_set", "FunctionEmitterVisitor.visit_return"], "tokens": 163}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FunctionEmitterVisitor(OpVisitor[None]):\n\n def visit_return(self, op: Return) -> None:\n value_str = self.reg(op.value)\n self.emit_line('return %s;' % value_str)\n\n def visit_tuple_set(self, op: TupleSet) -> None:\n dest = self.reg(op)\n tuple_type = op.tuple_type\n self.emitter.declare_tuple_struct(tuple_type)\n if len(op.items) == 0: # empty tuple\n self.emit_line('{}.empty_struct_error_flag = 0;'.format(dest))\n else:\n for i, item in enumerate(op.items):\n self.emit_line('{}.f{} = {};'.format(dest, i, self.reg(item)))\n self.emit_inc_ref(dest, tuple_type)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.visit_call_c_FunctionEmitterVisitor.visit_int_op.self_emit_line_s_s_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.visit_call_c_FunctionEmitterVisitor.visit_int_op.self_emit_line_s_s_", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitfunc.py", "file_name": "emitfunc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 400, "end_line": 427, "span_ids": ["FunctionEmitterVisitor.visit_load_global", "FunctionEmitterVisitor.visit_int_op", "FunctionEmitterVisitor.visit_call_c", "FunctionEmitterVisitor.visit_truncate"], "tokens": 298}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FunctionEmitterVisitor(OpVisitor[None]):\n\n def visit_call_c(self, op: CallC) -> None:\n if op.is_void:\n dest = ''\n else:\n dest = self.get_dest_assign(op)\n args = ', '.join(self.reg(arg) for arg in op.args)\n self.emitter.emit_line(\"{}{}({});\".format(dest, op.function_name, args))\n\n def visit_truncate(self, op: Truncate) -> None:\n dest = self.reg(op)\n value = self.reg(op.src)\n # for C backend the generated code are straight assignments\n self.emit_line(\"{} = {};\".format(dest, value))\n\n def visit_load_global(self, op: LoadGlobal) -> None:\n dest = self.reg(op)\n ann = ''\n if op.ann:\n s = repr(op.ann)\n if not any(x in s for x in ('/*', '*/', '\\0')):\n ann = ' /* %s */' % s\n self.emit_line('%s = %s;%s' % (dest, op.identifier, ann))\n\n def visit_int_op(self, op: IntOp) -> None:\n dest = self.reg(op)\n lhs = self.reg(op.lhs)\n rhs = self.reg(op.rhs)\n self.emit_line('%s = %s %s %s;' % (dest, lhs, op.op_str[op.op], rhs))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/func_ir.py_INVALID_FUNC_DEF_all_values.return.values": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/func_ir.py_INVALID_FUNC_DEF_all_values.return.values", "embedding": null, "metadata": {"file_path": "mypyc/ir/func_ir.py", "file_name": "func_ir.py", "file_type": "text/x-python", "category": "implementation", "start_line": 223, "end_line": 252, "span_ids": ["all_values", "impl:7"], "tokens": 222}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "INVALID_FUNC_DEF = FuncDef('', [], Block([])) # type: Final\n\n\ndef all_values(args: List[Register], blocks: List[BasicBlock]) -> List[Value]:\n \"\"\"Return the set of all values that may be initialized in the blocks.\n\n This omits registers that are only read.\n \"\"\"\n values = list(args) # type: List[Value]\n seen_registers = set(args)\n\n for block in blocks:\n for op in block.ops:\n if not isinstance(op, ControlOp):\n if isinstance(op, (Assign, AssignMulti)):\n if op.dest not in seen_registers:\n values.append(op.dest)\n seen_registers.add(op.dest)\n elif op.is_void:\n continue\n else:\n # If we take the address of a register, it might get initialized.\n if (isinstance(op, LoadAddress)\n and isinstance(op.src, Register)\n and op.src not in seen_registers):\n values.append(op.src)\n seen_registers.add(op.src)\n values.append(op)\n\n return values", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/func_ir.py_all_values_full_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/func_ir.py_all_values_full_", "embedding": null, "metadata": {"file_path": "mypyc/ir/func_ir.py", "file_name": "func_ir.py", "file_type": "text/x-python", "category": "implementation", "start_line": 255, "end_line": 279, "span_ids": ["all_values_full"], "tokens": 192}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def all_values_full(args: List[Register], blocks: List[BasicBlock]) -> List[Value]:\n \"\"\"Return set of all values that are initialized or accessed.\"\"\"\n values = list(args) # type: List[Value]\n seen_registers = set(args)\n\n for block in blocks:\n for op in block.ops:\n for source in op.sources():\n # Look for unitialized registers that are accessed. Ignore\n # non-registers since we don't allow ops outside basic blocks.\n if isinstance(source, Register) and source not in seen_registers:\n values.append(source)\n seen_registers.add(source)\n if not isinstance(op, ControlOp):\n if isinstance(op, (Assign, AssignMulti)):\n if op.dest not in seen_registers:\n values.append(op.dest)\n seen_registers.add(op.dest)\n elif op.is_void:\n continue\n else:\n values.append(op)\n\n return values", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py__Low_level_opcodes_for__T.TypeVar_T_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py__Low_level_opcodes_for__T.TypeVar_T_", "embedding": null, "metadata": {"file_path": "mypyc/ir/ops.py", "file_name": "ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 31, "span_ids": ["docstring"], "tokens": 265}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Low-level opcodes for compiler intermediate representation (IR).\n\nOpcodes operate on abstract values (Value) in a register machine. Each\nvalue has a type (RType). A value can hold various things, such as:\n\n- local variables (Register)\n- intermediate values of expressions (RegisterOp subclasses)\n- condition flags (true/false)\n- literals (integer literals, True, False, etc.)\n\"\"\"\n\nfrom abc import abstractmethod\nfrom typing import (\n List, Sequence, Dict, Generic, TypeVar, Optional, NamedTuple, Tuple, Union\n)\n\nfrom typing_extensions import Final, TYPE_CHECKING\nfrom mypy_extensions import trait\n\nfrom mypyc.ir.rtypes import (\n RType, RInstance, RTuple, RArray, RVoid, is_bool_rprimitive, is_int_rprimitive,\n is_short_int_rprimitive, is_none_rprimitive, object_rprimitive, bool_rprimitive,\n short_int_rprimitive, int_rprimitive, void_rtype, pointer_rprimitive, is_pointer_rprimitive,\n bit_rprimitive, is_bit_rprimitive\n)\n\nif TYPE_CHECKING:\n from mypyc.ir.class_ir import ClassIR # noqa\n from mypyc.ir.func_ir import FuncIR, FuncDecl # noqa\n\nT = TypeVar('T')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py__Never_generates_an_exce_Value.is_void.return.isinstance_self_type_RVo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py__Never_generates_an_exce_Value.is_void.return.isinstance_self_type_RVo", "embedding": null, "metadata": {"file_path": "mypyc/ir/ops.py", "file_name": "ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 79, "end_line": 116, "span_ids": ["impl:4", "Value.is_void", "Value", "BasicBlock.terminated"], "tokens": 302}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Never generates an exception\nERR_NEVER = 0 # type: Final\n# Generates magic value (c_error_value) based on target RType on exception\nERR_MAGIC = 1 # type: Final\n# Generates false (bool) on exception\nERR_FALSE = 2 # type: Final\n# Always fails\nERR_ALWAYS = 3 # type: Final\n\n# Hack: using this line number for an op will suppress it in tracebacks\nNO_TRACEBACK_LINE_NO = -10000\n\n\nclass Value:\n \"\"\"Abstract base class for all IR values.\n\n These include references to registers, literals, and all\n operations (Ops), such as assignments, calls and branches.\n\n Values are often used as inputs of Ops. Register can be used as an\n assignment target.\n\n A Value is part of the IR being compiled if it's included in a BasicBlock\n that is reachable from a FuncIR (i.e., is part of a function).\n\n See also: Op is a subclass of Value that is the base class of all\n operations.\n \"\"\"\n\n # Source line number (-1 for no/unknown line)\n line = -1\n # Type of the value or the result of the operation\n type = void_rtype # type: RType\n is_borrowed = False\n\n @property\n def is_void(self) -> bool:\n return isinstance(self.type, RVoid)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_Register_Register.__repr__.return._Register_r_at_s_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_Register_Register.__repr__.return._Register_r_at_s_", "embedding": null, "metadata": {"file_path": "mypyc/ir/ops.py", "file_name": "ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 119, "end_line": 142, "span_ids": ["Register.__init__", "Register.__repr__", "Register", "Register.is_void"], "tokens": 207}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Register(Value):\n \"\"\"A Register holds a value of a specific type, and it can be read and mutated.\n\n A Register is always local to a function. Each local variable maps\n to a Register, and they are also used for some (but not all)\n temporary values.\n\n Note that the term 'register' is overloaded and is sometimes used\n to refer to arbitrary Values (for example, in RegisterOp).\n \"\"\"\n\n def __init__(self, type: RType, name: str = '', is_arg: bool = False, line: int = -1) -> None:\n self.type = type\n self.name = name\n self.is_arg = is_arg\n self.is_borrowed = is_arg\n self.line = line\n\n @property\n def is_void(self) -> bool:\n return False\n\n def __repr__(self) -> str:\n return '' % (self.name, hex(id(self)))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_Integer_Integer.__init__.self.line.line": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_Integer_Integer.__init__.self.line.line", "embedding": null, "metadata": {"file_path": "mypyc/ir/ops.py", "file_name": "ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 145, "end_line": 167, "span_ids": ["Integer", "Integer.__init__"], "tokens": 204}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Integer(Value):\n \"\"\"Short integer literal.\n\n Integer literals are treated as constant values and are generally\n not included in data flow analyses and such, unlike Register and\n Op subclasses.\n\n Integer can represent multiple types:\n\n * Short tagged integers (short_int_primitive type; the tag bit is clear)\n * Ordinary fixed-width integers (e.g., int32_rprimitive)\n * Values of other unboxed primitive types that are represented as integers\n (none_rprimitive, bool_rprimitive)\n * Null pointers (value 0) of various types, including object_rprimitive\n \"\"\"\n\n def __init__(self, value: int, rtype: RType = short_int_rprimitive, line: int = -1) -> None:\n if is_short_int_rprimitive(rtype) or is_int_rprimitive(rtype):\n self.value = value * 2\n else:\n self.value = value\n self.type = rtype\n self.line = line", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_Branch_Branch.accept.return.visitor_visit_branch_self": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_Branch_Branch.accept.return.visitor_visit_branch_self", "embedding": null, "metadata": {"file_path": "mypyc/ir/ops.py", "file_name": "ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 257, "end_line": 304, "span_ids": ["Branch", "Branch.accept", "Branch.invert", "Branch.sources", "Branch.__init__"], "tokens": 388}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Branch(ControlOp):\n \"\"\"Branch based on a value.\n\n If op is BOOL, branch based on a bit/bool value:\n if [not] r1 goto L1 else goto L2\n\n If op is IS_ERROR, branch based on whether there is an error value:\n if [not] is_error(r1) goto L1 else goto L2\n \"\"\"\n\n # Branch ops never raise an exception.\n error_kind = ERR_NEVER\n\n BOOL = 100 # type: Final\n IS_ERROR = 101 # type: Final\n\n def __init__(self,\n value: Value,\n true_label: BasicBlock,\n false_label: BasicBlock,\n op: int,\n line: int = -1,\n *,\n rare: bool = False) -> None:\n super().__init__(line)\n # Target value being checked\n self.value = value\n # Branch here if the condition is true\n self.true = true_label\n # Branch here if the condition is false\n self.false = false_label\n # Branch.BOOL (boolean check) or Branch.IS_ERROR (error value check)\n self.op = op\n # If True, the condition is negated\n self.negated = False\n # If not None, the true label should generate a traceback entry (func name, line number)\n self.traceback_entry = None # type: Optional[Tuple[str, int]]\n # If True, the condition is expected to be usually False (for optimization purposes)\n self.rare = rare\n\n def sources(self) -> List[Value]:\n return [self.value]\n\n def invert(self) -> None:\n self.negated = not self.negated\n\n def accept(self, visitor: 'OpVisitor[T]') -> T:\n return visitor.visit_branch(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_Return_Unreachable.accept.return.visitor_visit_unreachable": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_Return_Unreachable.accept.return.visitor_visit_unreachable", "embedding": null, "metadata": {"file_path": "mypyc/ir/ops.py", "file_name": "ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 307, "end_line": 351, "span_ids": ["Return", "Unreachable.__init__", "Return.accept", "Return.__init__", "Return.stolen", "Return.sources", "Unreachable", "Unreachable.accept", "Unreachable.sources"], "tokens": 310}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Return(ControlOp):\n \"\"\"Return a value from a function.\"\"\"\n\n error_kind = ERR_NEVER\n\n def __init__(self, value: Value, line: int = -1) -> None:\n super().__init__(line)\n self.value = value\n\n def sources(self) -> List[Value]:\n return [self.value]\n\n def stolen(self) -> List[Value]:\n return [self.value]\n\n def accept(self, visitor: 'OpVisitor[T]') -> T:\n return visitor.visit_return(self)\n\n\nclass Unreachable(ControlOp):\n \"\"\"Mark the end of basic block as unreachable.\n\n This is sometimes necessary when the end of a basic block is never\n reached. This can also be explicitly added to the end of non-None\n returning functions (in None-returning function we can just return\n None).\n\n Mypy statically guarantees that the end of the function is not\n unreachable if there is not a return statement.\n\n This prevents the block formatter from being confused due to lack\n of a leave and also leaves a nifty note in the IR. It is not\n generally processed by visitors.\n \"\"\"\n\n error_kind = ERR_NEVER\n\n def __init__(self, line: int = -1) -> None:\n super().__init__(line)\n\n def sources(self) -> List[Value]:\n return []\n\n def accept(self, visitor: 'OpVisitor[T]') -> T:\n return visitor.visit_unreachable(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_IncRef_DecRef.accept.return.visitor_visit_dec_ref_sel": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_IncRef_DecRef.accept.return.visitor_visit_dec_ref_sel", "embedding": null, "metadata": {"file_path": "mypyc/ir/ops.py", "file_name": "ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 379, "end_line": 418, "span_ids": ["IncRef.accept", "IncRef.sources", "IncRef.__init__", "DecRef.__repr__", "DecRef.__init__", "DecRef.accept", "DecRef", "DecRef.sources", "IncRef"], "tokens": 299}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IncRef(RegisterOp):\n \"\"\"Increase reference count (inc_ref src).\"\"\"\n\n error_kind = ERR_NEVER\n\n def __init__(self, src: Value, line: int = -1) -> None:\n assert src.type.is_refcounted\n super().__init__(line)\n self.src = src\n\n def sources(self) -> List[Value]:\n return [self.src]\n\n def accept(self, visitor: 'OpVisitor[T]') -> T:\n return visitor.visit_inc_ref(self)\n\n\nclass DecRef(RegisterOp):\n \"\"\"Decrease reference count and free object if zero (dec_ref src).\n\n The is_xdec flag says to use an XDECREF, which checks if the\n pointer is NULL first.\n \"\"\"\n\n error_kind = ERR_NEVER\n\n def __init__(self, src: Value, is_xdec: bool = False, line: int = -1) -> None:\n assert src.type.is_refcounted\n super().__init__(line)\n self.src = src\n self.is_xdec = is_xdec\n\n def __repr__(self) -> str:\n return '<%sDecRef %r>' % ('X' if self.is_xdec else '', self.src)\n\n def sources(self) -> List[Value]:\n return [self.src]\n\n def accept(self, visitor: 'OpVisitor[T]') -> T:\n return visitor.visit_dec_ref(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_None_15_LoadStatic.accept.return.visitor_visit_load_static": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_None_15_LoadStatic.accept.return.visitor_visit_load_static", "embedding": null, "metadata": {"file_path": "mypyc/ir/ops.py", "file_name": "ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 551, "end_line": 586, "span_ids": ["LoadStatic", "LoadStatic.sources", "impl:14", "LoadStatic.accept", "LoadStatic.__init__"], "tokens": 269}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": " # type: Final\n\n\nclass LoadStatic(RegisterOp):\n \"\"\"Load a static name (name :: static).\n\n Load a C static variable/pointer. The namespace for statics is shared\n for the entire compilation group. You can optionally provide a module\n name and a sub-namespace identifier for additional namespacing to avoid\n name conflicts. The static namespace does not overlap with other C names,\n since the final C name will get a prefix, so conflicts only must be\n avoided with other statics.\n \"\"\"\n\n error_kind = ERR_NEVER\n is_borrowed = True\n\n def __init__(self,\n type: RType,\n identifier: str,\n module_name: Optional[str] = None,\n namespace: str = NAMESPACE_STATIC,\n line: int = -1,\n ann: object = None) -> None:\n super().__init__(line)\n self.identifier = identifier\n self.module_name = module_name\n self.namespace = namespace\n self.type = type\n self.ann = ann # An object to pretty print with the load\n\n def sources(self) -> List[Value]:\n return []\n\n def accept(self, visitor: 'OpVisitor[T]') -> T:\n return visitor.visit_load_static(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_RaiseStandardError_StealsDescription.Union_bool_List_bool_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_RaiseStandardError_StealsDescription.Union_bool_List_bool_", "embedding": null, "metadata": {"file_path": "mypyc/ir/ops.py", "file_name": "ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 734, "end_line": 766, "span_ids": ["RaiseStandardError", "RaiseStandardError.sources", "RaiseStandardError.__init__", "RaiseStandardError.accept", "impl:20"], "tokens": 283}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RaiseStandardError(RegisterOp):\n \"\"\"Raise built-in exception with an optional error string.\n\n We have a separate opcode for this for convenience and to\n generate smaller, more idiomatic C code.\n \"\"\"\n\n # TODO: Make it more explicit at IR level that this always raises\n\n error_kind = ERR_FALSE\n\n VALUE_ERROR = 'ValueError' # type: Final\n ASSERTION_ERROR = 'AssertionError' # type: Final\n STOP_ITERATION = 'StopIteration' # type: Final\n UNBOUND_LOCAL_ERROR = 'UnboundLocalError' # type: Final\n RUNTIME_ERROR = 'RuntimeError' # type: Final\n NAME_ERROR = 'NameError' # type: Final\n\n def __init__(self, class_name: str, value: Optional[Union[str, Value]], line: int) -> None:\n super().__init__(line)\n self.class_name = class_name\n self.value = value\n self.type = bool_rprimitive\n\n def sources(self) -> List[Value]:\n return []\n\n def accept(self, visitor: 'OpVisitor[T]') -> T:\n return visitor.visit_raise_standard_error(self)\n\n\n# True steals all arguments, False steals none, a list steals those in matching positions\nStealsDescription = Union[bool, List[bool]]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_IntOp_IntOp.accept.return.visitor_visit_int_op_self": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_IntOp_IntOp.accept.return.visitor_visit_int_op_self", "embedding": null, "metadata": {"file_path": "mypyc/ir/ops.py", "file_name": "ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 865, "end_line": 918, "span_ids": ["IntOp.sources", "IntOp.__init__", "IntOp.accept", "IntOp"], "tokens": 423}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IntOp(RegisterOp):\n \"\"\"Binary arithmetic or bitwise op on integer operands (e.g., r1 = r2 + r3).\n\n These ops are low-level and are similar to the corresponding C\n operations (and unlike Python operations).\n\n The left and right values must have low-level integer types with\n compatible representations. Fixed-width integers, short_int_rprimitive,\n bool_rprimitive and bit_rprimitive are supported.\n\n For tagged (arbitrary-precision) integer ops look at mypyc.primitives.int_ops.\n \"\"\"\n\n error_kind = ERR_NEVER\n\n # Arithmetic ops\n ADD = 0 # type: Final\n SUB = 1 # type: Final\n MUL = 2 # type: Final\n DIV = 3 # type: Final\n MOD = 4 # type: Final\n\n # Bitwise ops\n AND = 200 # type: Final\n OR = 201 # type: Final\n XOR = 202 # type: Final\n LEFT_SHIFT = 203 # type: Final\n RIGHT_SHIFT = 204 # type: Final\n\n op_str = {\n ADD: '+',\n SUB: '-',\n MUL: '*',\n DIV: '/',\n MOD: '%',\n AND: '&',\n OR: '|',\n XOR: '^',\n LEFT_SHIFT: '<<',\n RIGHT_SHIFT: '>>',\n } # type: Final\n\n def __init__(self, type: RType, lhs: Value, rhs: Value, op: int, line: int = -1) -> None:\n super().__init__(line)\n self.type = type\n self.lhs = lhs\n self.rhs = rhs\n self.op = op\n\n def sources(self) -> List[Value]:\n return [self.lhs, self.rhs]\n\n def accept(self, visitor: 'OpVisitor[T]') -> T:\n return visitor.visit_int_op(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_ComparisonOp_ComparisonOp.accept.return.visitor_visit_comparison_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_ComparisonOp_ComparisonOp.accept.return.visitor_visit_comparison_", "embedding": null, "metadata": {"file_path": "mypyc/ir/ops.py", "file_name": "ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 921, "end_line": 973, "span_ids": ["ComparisonOp.sources", "ComparisonOp.accept", "ComparisonOp", "ComparisonOp.__init__"], "tokens": 433}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ComparisonOp(RegisterOp):\n \"\"\"Low-level comparison op for integers and pointers.\n\n Both unsigned and signed comparisons are supported. Supports\n comparisons between fixed-width integer types and pointer types.\n The operands should have matching sizes.\n\n The result is always a bit (representing a boolean).\n\n Python semantics, such as calling __eq__, are not supported.\n \"\"\"\n\n # Must be ERR_NEVER or ERR_FALSE. ERR_FALSE means that a false result\n # indicates that an exception has been raised and should be propagated.\n error_kind = ERR_NEVER\n\n # S for signed and U for unsigned\n EQ = 100 # type: Final\n NEQ = 101 # type: Final\n SLT = 102 # type: Final\n SGT = 103 # type: Final\n SLE = 104 # type: Final\n SGE = 105 # type: Final\n ULT = 106 # type: Final\n UGT = 107 # type: Final\n ULE = 108 # type: Final\n UGE = 109 # type: Final\n\n op_str = {\n EQ: '==',\n NEQ: '!=',\n SLT: '<',\n SGT: '>',\n SLE: '<=',\n SGE: '>=',\n ULT: '<',\n UGT: '>',\n ULE: '<=',\n UGE: '>=',\n } # type: Final\n\n def __init__(self, lhs: Value, rhs: Value, op: int, line: int = -1) -> None:\n super().__init__(line)\n self.type = bit_rprimitive\n self.lhs = lhs\n self.rhs = rhs\n self.op = op\n\n def sources(self) -> List[Value]:\n return [self.lhs, self.rhs]\n\n def accept(self, visitor: 'OpVisitor[T]') -> T:\n return visitor.visit_comparison_op(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py__TODO_Should_the_follow_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py__TODO_Should_the_follow_", "embedding": null, "metadata": {"file_path": "mypyc/ir/ops.py", "file_name": "ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1318, "end_line": 1344, "span_ids": ["impl:22", "OpVisitor.visit_keep_alive"], "tokens": 296}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# TODO: Should the following definition live somewhere else?\n\n# We do a three-pass deserialization scheme in order to resolve name\n# references.\n# 1. Create an empty ClassIR for each class in an SCC.\n# 2. Deserialize all of the functions, which can contain references\n# to ClassIRs in their types\n# 3. Deserialize all of the classes, which contain lots of references\n# to the functions they contain. (And to other classes.)\n#\n# Note that this approach differs from how we deserialize ASTs in mypy itself,\n# where everything is deserialized in one pass then a second pass cleans up\n# 'cross_refs'. We don't follow that approach here because it seems to be more\n# code for not a lot of gain since it is easy in mypyc to identify all the objects\n# we might need to reference.\n#\n# Because of these references, we need to maintain maps from class\n# names to ClassIRs and func names to FuncIRs.\n#\n# These are tracked in a DeserMaps which is passed to every\n# deserialization function.\n#\n# (Serialization and deserialization *will* be used for incremental\n# compilation but so far it is not hooked up to anything.)\nDeserMaps = NamedTuple('DeserMaps',\n [('classes', Dict[str, 'ClassIR']), ('functions', Dict[str, 'FuncIR'])])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/pprint.py__Utilities_for_pretty_p_from_mypyc_ir_rtypes_impo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/pprint.py__Utilities_for_pretty_p_from_mypyc_ir_rtypes_impo", "embedding": null, "metadata": {"file_path": "mypyc/ir/pprint.py", "file_name": "pprint.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 17, "span_ids": ["docstring"], "tokens": 206}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Utilities for pretty-printing IR in a human-readable form.\"\"\"\n\nfrom typing import Any, Dict, List\n\nfrom typing_extensions import Final\n\nfrom mypyc.common import short_name\nfrom mypyc.ir.ops import (\n Goto, Branch, Return, Unreachable, Assign, Integer, LoadErrorValue, GetAttr, SetAttr,\n LoadStatic, InitStatic, TupleGet, TupleSet, IncRef, DecRef, Call, MethodCall, Cast, Box, Unbox,\n RaiseStandardError, CallC, Truncate, LoadGlobal, IntOp, ComparisonOp, LoadMem, SetMem,\n GetElementPtr, LoadAddress, Register, Value, OpVisitor, BasicBlock, ControlOp, LoadLiteral,\n AssignMulti, KeepAlive\n)\nfrom mypyc.ir.func_ir import FuncIR, all_values_full\nfrom mypyc.ir.module_ir import ModuleIRs\nfrom mypyc.ir.rtypes import is_bool_rprimitive, is_int_rprimitive, RType", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/pprint.py_IRPrettyPrintVisitor_IRPrettyPrintVisitor._type_Final": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/pprint.py_IRPrettyPrintVisitor_IRPrettyPrintVisitor._type_Final", "embedding": null, "metadata": {"file_path": "mypyc/ir/pprint.py", "file_name": "pprint.py", "file_type": "text/x-python", "category": "implementation", "start_line": 19, "end_line": 34, "span_ids": ["IRPrettyPrintVisitor.visit_goto", "IRPrettyPrintVisitor.__init__", "IRPrettyPrintVisitor", "IRPrettyPrintVisitor:3"], "tokens": 150}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRPrettyPrintVisitor(OpVisitor[str]):\n \"\"\"Internal visitor that pretty-prints ops.\"\"\"\n\n def __init__(self, names: Dict[Value, str]) -> None:\n # This should contain a name for all values that are shown as\n # registers in the output. This is not just for Register\n # instances -- all Ops that produce values need (generated) names.\n self.names = names\n\n def visit_goto(self, op: Goto) -> str:\n return self.format('goto %l', op.label)\n\n branch_op_names = {\n Branch.BOOL: ('%r', 'bool'),\n Branch.IS_ERROR: ('is_error(%r)', ''),\n } # type: Final", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/pprint.py_IRPrettyPrintVisitor.visit_branch_IRPrettyPrintVisitor.visit_branch.return.self_format_fmt_op_true_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/pprint.py_IRPrettyPrintVisitor.visit_branch_IRPrettyPrintVisitor.visit_branch.return.self_format_fmt_op_true_", "embedding": null, "metadata": {"file_path": "mypyc/ir/pprint.py", "file_name": "pprint.py", "file_type": "text/x-python", "category": "implementation", "start_line": 36, "end_line": 48, "span_ids": ["IRPrettyPrintVisitor.visit_branch"], "tokens": 134}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRPrettyPrintVisitor(OpVisitor[str]):\n\n def visit_branch(self, op: Branch) -> str:\n fmt, typ = self.branch_op_names[op.op]\n if op.negated:\n fmt = 'not {}'.format(fmt)\n\n cond = self.format(fmt, op.value)\n tb = ''\n if op.traceback_entry:\n tb = ' (error at %s:%d)' % op.traceback_entry\n fmt = 'if {} goto %l{} else goto %l'.format(cond, tb)\n if typ:\n fmt += ' :: {}'.format(typ)\n return self.format(fmt, op.true, op.false)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/pprint.py_IRPrettyPrintVisitor.visit_call_c_IRPrettyPrintVisitor.visit_int_op.return.self_format_r_r_s_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/pprint.py_IRPrettyPrintVisitor.visit_call_c_IRPrettyPrintVisitor.visit_int_op.return.self_format_r_r_s_", "embedding": null, "metadata": {"file_path": "mypyc/ir/pprint.py", "file_name": "pprint.py", "file_type": "text/x-python", "category": "implementation", "start_line": 138, "end_line": 153, "span_ids": ["IRPrettyPrintVisitor.visit_int_op", "IRPrettyPrintVisitor.visit_call_c", "IRPrettyPrintVisitor.visit_load_global", "IRPrettyPrintVisitor.visit_truncate"], "tokens": 239}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRPrettyPrintVisitor(OpVisitor[str]):\n\n def visit_call_c(self, op: CallC) -> str:\n args_str = ', '.join(self.format('%r', arg) for arg in op.args)\n if op.is_void:\n return self.format('%s(%s)', op.function_name, args_str)\n else:\n return self.format('%r = %s(%s)', op, op.function_name, args_str)\n\n def visit_truncate(self, op: Truncate) -> str:\n return self.format(\"%r = truncate %r: %t to %t\", op, op.src, op.src_type, op.type)\n\n def visit_load_global(self, op: LoadGlobal) -> str:\n ann = ' ({})'.format(repr(op.ann)) if op.ann else ''\n return self.format('%r = load_global %s :: static%s', op, op.identifier, ann)\n\n def visit_int_op(self, op: IntOp) -> str:\n return self.format('%r = %r %s %r', op, op.lhs, IntOp.op_str[op.op], op.rhs)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/pprint.py_IRPrettyPrintVisitor.visit_comparison_op_IRPrettyPrintVisitor.visit_comparison_op.return.self_format_r_r_s_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/pprint.py_IRPrettyPrintVisitor.visit_comparison_op_IRPrettyPrintVisitor.visit_comparison_op.return.self_format_r_r_s_", "embedding": null, "metadata": {"file_path": "mypyc/ir/pprint.py", "file_name": "pprint.py", "file_type": "text/x-python", "category": "implementation", "start_line": 155, "end_line": 163, "span_ids": ["IRPrettyPrintVisitor.visit_comparison_op"], "tokens": 138}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRPrettyPrintVisitor(OpVisitor[str]):\n\n def visit_comparison_op(self, op: ComparisonOp) -> str:\n if op.op in (ComparisonOp.SLT, ComparisonOp.SGT, ComparisonOp.SLE, ComparisonOp.SGE):\n sign_format = \" :: signed\"\n elif op.op in (ComparisonOp.ULT, ComparisonOp.UGT, ComparisonOp.ULE, ComparisonOp.UGE):\n sign_format = \" :: unsigned\"\n else:\n sign_format = \"\"\n return self.format('%r = %r %s %r%s', op, op.lhs, ComparisonOp.op_str[op.op],\n op.rhs, sign_format)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/pprint.py_IRPrettyPrintVisitor.visit_load_mem_IRPrettyPrintVisitor._Helpers": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/pprint.py_IRPrettyPrintVisitor.visit_load_mem_IRPrettyPrintVisitor._Helpers", "embedding": null, "metadata": {"file_path": "mypyc/ir/pprint.py", "file_name": "pprint.py", "file_type": "text/x-python", "category": "implementation", "start_line": 179, "end_line": 198, "span_ids": ["IRPrettyPrintVisitor.visit_get_element_ptr", "IRPrettyPrintVisitor.visit_set_mem", "IRPrettyPrintVisitor.visit_load_mem", "IRPrettyPrintVisitor.visit_keep_alive", "IRPrettyPrintVisitor.visit_load_address"], "tokens": 242}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRPrettyPrintVisitor(OpVisitor[str]):\n\n def visit_load_mem(self, op: LoadMem) -> str:\n return self.format(\"%r = load_mem %r :: %t*\", op, op.src, op.type)\n\n def visit_set_mem(self, op: SetMem) -> str:\n return self.format(\"set_mem %r, %r :: %t*\", op.dest, op.src, op.dest_type)\n\n def visit_get_element_ptr(self, op: GetElementPtr) -> str:\n return self.format(\"%r = get_element_ptr %r %s :: %t\", op, op.src, op.field, op.src_type)\n\n def visit_load_address(self, op: LoadAddress) -> str:\n if isinstance(op.src, Register):\n return self.format(\"%r = load_address %r\", op, op.src)\n else:\n return self.format(\"%r = load_address %s\", op, op.src)\n\n def visit_keep_alive(self, op: KeepAlive) -> str:\n return self.format('keep_alive %s' % ', '.join(self.format('%r', v)\n for v in op.src))\n\n # Helpers", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/pprint.py_IRPrettyPrintVisitor.format_IRPrettyPrintVisitor.format.return._join_result_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/pprint.py_IRPrettyPrintVisitor.format_IRPrettyPrintVisitor.format.return._join_result_", "embedding": null, "metadata": {"file_path": "mypyc/ir/pprint.py", "file_name": "pprint.py", "file_type": "text/x-python", "category": "implementation", "start_line": 190, "end_line": 242, "span_ids": ["IRPrettyPrintVisitor.format"], "tokens": 381}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRPrettyPrintVisitor(OpVisitor[str]):\n\n def format(self, fmt: str, *args: Any) -> str:\n \"\"\"Helper for formatting strings.\n\n These format sequences are supported in fmt:\n\n %s: arbitrary object converted to string using str()\n %r: name of IR value/register\n %d: int\n %f: float\n %l: BasicBlock (formatted as label 'Ln')\n %t: RType\n \"\"\"\n result = []\n i = 0\n arglist = list(args)\n while i < len(fmt):\n n = fmt.find('%', i)\n if n < 0:\n n = len(fmt)\n result.append(fmt[i:n])\n if n < len(fmt):\n typespec = fmt[n + 1]\n arg = arglist.pop(0)\n if typespec == 'r':\n # Register/value\n assert isinstance(arg, Value)\n if isinstance(arg, Integer):\n result.append(str(arg.value))\n else:\n result.append(self.names[arg])\n elif typespec == 'd':\n # Integer\n result.append('%d' % arg)\n elif typespec == 'f':\n # Float\n result.append('%f' % arg)\n elif typespec == 'l':\n # Basic block (label)\n assert isinstance(arg, BasicBlock)\n result.append('L%s' % arg.label)\n elif typespec == 't':\n # RType\n assert isinstance(arg, RType)\n result.append(arg.name)\n elif typespec == 's':\n # String\n result.append(str(arg))\n else:\n raise ValueError('Invalid format sequence %{}'.format(typespec))\n i = n + 2\n else:\n i = n\n return ''.join(result)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/pprint.py_format_registers_format_registers.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/pprint.py_format_registers_format_registers.return.result", "embedding": null, "metadata": {"file_path": "mypyc/ir/pprint.py", "file_name": "pprint.py", "file_type": "text/x-python", "category": "implementation", "start_line": 245, "end_line": 258, "span_ids": ["format_registers"], "tokens": 143}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def format_registers(func_ir: FuncIR,\n names: Dict[Value, str]) -> List[str]:\n result = []\n i = 0\n regs = all_values_full(func_ir.arg_regs, func_ir.blocks)\n while i < len(regs):\n i0 = i\n group = [names[regs[i0]]]\n while i + 1 < len(regs) and regs[i + 1].type == regs[i0].type:\n i += 1\n group.append(names[regs[i]])\n i += 1\n result.append('%s :: %s' % (', '.join(group), regs[i0].type))\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/pprint.py_format_blocks_format_blocks.return.lines": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/pprint.py_format_blocks_format_blocks.return.lines", "embedding": null, "metadata": {"file_path": "mypyc/ir/pprint.py", "file_name": "pprint.py", "file_type": "text/x-python", "category": "implementation", "start_line": 261, "end_line": 295, "span_ids": ["format_blocks"], "tokens": 323}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def format_blocks(blocks: List[BasicBlock],\n names: Dict[Value, str]) -> List[str]:\n \"\"\"Format a list of IR basic blocks into a human-readable form.\"\"\"\n # First label all of the blocks\n for i, block in enumerate(blocks):\n block.label = i\n\n handler_map = {} # type: Dict[BasicBlock, List[BasicBlock]]\n for b in blocks:\n if b.error_handler:\n handler_map.setdefault(b.error_handler, []).append(b)\n\n visitor = IRPrettyPrintVisitor(names)\n\n lines = []\n for i, block in enumerate(blocks):\n handler_msg = ''\n if block in handler_map:\n labels = sorted('L%d' % b.label for b in handler_map[block])\n handler_msg = ' (handler for {})'.format(', '.join(labels))\n\n lines.append('L%d:%s' % (block.label, handler_msg))\n ops = block.ops\n if (isinstance(ops[-1], Goto) and i + 1 < len(blocks)\n and ops[-1].label == blocks[i + 1]):\n # Hide the last goto if it just goes to the next basic block.\n ops = ops[:-1]\n for op in ops:\n line = ' ' + op.accept(visitor)\n lines.append(line)\n\n if not isinstance(block.ops[-1], (Goto, Branch, Return, Unreachable)):\n # Each basic block needs to exit somewhere.\n lines.append(' [MISSING BLOCK EXIT OPCODE]')\n return lines", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/pprint.py_format_func_format_modules.return.ops": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/pprint.py_format_func_format_modules.return.ops", "embedding": null, "metadata": {"file_path": "mypyc/ir/pprint.py", "file_name": "pprint.py", "file_type": "text/x-python", "category": "implementation", "start_line": 298, "end_line": 317, "span_ids": ["format_func", "format_modules"], "tokens": 158}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def format_func(fn: FuncIR) -> List[str]:\n lines = []\n cls_prefix = fn.class_name + '.' if fn.class_name else ''\n lines.append('def {}{}({}):'.format(cls_prefix, fn.name,\n ', '.join(arg.name for arg in fn.args)))\n names = generate_names_for_ir(fn.arg_regs, fn.blocks)\n for line in format_registers(fn, names):\n lines.append(' ' + line)\n code = format_blocks(fn.blocks, names)\n lines.extend(code)\n return lines\n\n\ndef format_modules(modules: ModuleIRs) -> List[str]:\n ops = []\n for module in modules.values():\n for fn in module.functions:\n ops.extend(format_func(fn))\n ops.append('')\n return ops", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/pprint.py_generate_names_for_ir_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/pprint.py_generate_names_for_ir_", "embedding": null, "metadata": {"file_path": "mypyc/ir/pprint.py", "file_name": "pprint.py", "file_type": "text/x-python", "category": "implementation", "start_line": 330, "end_line": 385, "span_ids": ["generate_names_for_ir"], "tokens": 348}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_names_for_ir(args: List[Register], blocks: List[BasicBlock]) -> Dict[Value, str]:\n \"\"\"Generate unique names for IR values.\n\n Give names such as 'r5' to temp values in IR which are useful when\n pretty-printing or generating C. Ensure generated names are unique.\n \"\"\"\n names = {} # type: Dict[Value, str]\n used_names = set()\n\n temp_index = 0\n\n for arg in args:\n names[arg] = arg.name\n used_names.add(arg.name)\n\n for block in blocks:\n for op in block.ops:\n values = []\n\n for source in op.sources():\n if source not in names:\n values.append(source)\n\n if isinstance(op, (Assign, AssignMulti)):\n values.append(op.dest)\n elif isinstance(op, ControlOp) or op.is_void:\n continue\n elif op not in names:\n values.append(op)\n\n for value in values:\n if value in names:\n continue\n if isinstance(value, Register) and value.name:\n name = value.name\n elif isinstance(value, Integer):\n continue\n else:\n name = 'r%d' % temp_index\n temp_index += 1\n\n # Append _2, _3, ... if needed to make the name unique.\n if name in used_names:\n n = 2\n while True:\n candidate = '%s_%d' % (name, n)\n if candidate not in used_names:\n name = candidate\n break\n n += 1\n\n names[value] = name\n used_names.add(name)\n\n return names", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py__Builder_class_used_to__SymbolTarget.Union_AssignmentTargetReg": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py__Builder_class_used_to__SymbolTarget.Union_AssignmentTargetReg", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/builder.py", "file_name": "builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 73, "span_ids": ["impl", "UnsupportedException", "IRVisitor", "docstring", "imports:17"], "tokens": 761}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Builder class used to transform a mypy AST to the IR form.\n\nThe IRBuilder class maintains transformation state and provides access\nto various helpers used to implement the transform.\n\nThe top-level transform control logic is in mypyc.irbuild.main.\n\nmypyc.irbuild.visitor.IRBuilderVisitor is used to dispatch based on mypy\nAST node type to code that actually does the bulk of the work. For\nexample, expressions are transformed in mypyc.irbuild.expression and\nfunctions are transformed in mypyc.irbuild.function.\n\"\"\"\n\nfrom typing import Callable, Dict, List, Tuple, Optional, Union, Sequence, Set, Any\nfrom typing_extensions import overload\nfrom mypy.ordered_dict import OrderedDict\n\nfrom mypy.build import Graph\nfrom mypy.nodes import (\n MypyFile, SymbolNode, Statement, OpExpr, IntExpr, NameExpr, LDEF, Var, UnaryExpr,\n CallExpr, IndexExpr, Expression, MemberExpr, RefExpr, Lvalue, TupleExpr,\n TypeInfo, Decorator, OverloadedFuncDef, StarExpr, ComparisonExpr, GDEF, ARG_POS, ARG_NAMED\n)\nfrom mypy.types import (\n Type, Instance, TupleType, UninhabitedType, get_proper_type\n)\nfrom mypy.maptype import map_instance_to_supertype\nfrom mypy.visitor import ExpressionVisitor, StatementVisitor\nfrom mypy.util import split_target\n\nfrom mypyc.common import TEMP_ATTR_NAME, SELF_NAME\nfrom mypyc.irbuild.prebuildvisitor import PreBuildVisitor\nfrom mypyc.ir.ops import (\n BasicBlock, Integer, Value, Register, Op, Assign, Branch, Unreachable, TupleGet, GetAttr,\n SetAttr, LoadStatic, InitStatic, NAMESPACE_MODULE, RaiseStandardError\n)\nfrom mypyc.ir.rtypes import (\n RType, RTuple, RInstance, int_rprimitive, dict_rprimitive,\n none_rprimitive, is_none_rprimitive, object_rprimitive, is_object_rprimitive,\n str_rprimitive, is_tagged, is_list_rprimitive, is_tuple_rprimitive, c_pyssize_t_rprimitive\n)\nfrom mypyc.ir.func_ir import FuncIR, INVALID_FUNC_DEF, RuntimeArg, FuncSignature, FuncDecl\nfrom mypyc.ir.class_ir import ClassIR, NonExtClassInfo\nfrom mypyc.primitives.registry import CFunctionDescription, function_ops\nfrom mypyc.primitives.list_ops import to_list, list_pop_last, list_get_item_unsafe_op\nfrom mypyc.primitives.dict_ops import dict_get_item_op, dict_set_item_op\nfrom mypyc.primitives.generic_ops import py_setattr_op, iter_op, next_op\nfrom mypyc.primitives.misc_ops import import_op, check_unpack_count_op, get_module_dict_op\nfrom mypyc.crash import catch_errors\nfrom mypyc.options import CompilerOptions\nfrom mypyc.errors import Errors\nfrom mypyc.irbuild.nonlocalcontrol import (\n NonlocalControl, BaseNonlocalControl, LoopNonlocalControl, GeneratorNonlocalControl\n)\nfrom mypyc.irbuild.targets import (\n AssignmentTarget, AssignmentTargetRegister, AssignmentTargetIndex, AssignmentTargetAttr,\n AssignmentTargetTuple\n)\nfrom mypyc.irbuild.context import FuncInfo, ImplicitClass\nfrom mypyc.irbuild.mapper import Mapper\nfrom mypyc.irbuild.ll_builder import LowLevelIRBuilder\nfrom mypyc.irbuild.util import is_constant\n\n\nclass IRVisitor(ExpressionVisitor[Value], StatementVisitor[None]):\n pass\n\n\nclass UnsupportedException(Exception):\n pass\n\n\nSymbolTarget = Union[AssignmentTargetRegister, AssignmentTargetAttr]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder._Pass_through_methods_fo_IRBuilder.call_c.return.self_builder_call_c_desc_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder._Pass_through_methods_fo_IRBuilder.call_c.return.self_builder_call_c_desc_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/builder.py", "file_name": "builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 174, "end_line": 264, "span_ids": ["IRBuilder.self", "IRBuilder.false", "IRBuilder.load_module", "IRBuilder.py_call", "IRBuilder.goto", "IRBuilder.add_bool_branch", "IRBuilder.py_get_attr", "IRBuilder.add", "IRBuilder.load_str", "IRBuilder.activate_block", "IRBuilder.translate_is_op", "IRBuilder.none_object", "IRBuilder.call_c", "IRBuilder.none", "IRBuilder.true", "IRBuilder.new_set_op", "IRBuilder.load_native_type_object", "IRBuilder.load_int", "IRBuilder.accept_3", "IRBuilder.goto_and_activate", "IRBuilder.gen_method_call", "IRBuilder.binary_op", "IRBuilder.coerce", "IRBuilder.new_list_op", "IRBuilder.unary_op"], "tokens": 782}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRBuilder:\n\n # Pass through methods for the most common low-level builder ops, for convenience.\n\n def add(self, op: Op) -> Value:\n return self.builder.add(op)\n\n def goto(self, target: BasicBlock) -> None:\n self.builder.goto(target)\n\n def activate_block(self, block: BasicBlock) -> None:\n self.builder.activate_block(block)\n\n def goto_and_activate(self, block: BasicBlock) -> None:\n self.builder.goto_and_activate(block)\n\n def self(self) -> Register:\n return self.builder.self()\n\n def py_get_attr(self, obj: Value, attr: str, line: int) -> Value:\n return self.builder.py_get_attr(obj, attr, line)\n\n def load_str(self, value: str) -> Value:\n return self.builder.load_str(value)\n\n def load_int(self, value: int) -> Value:\n return self.builder.load_int(value)\n\n def unary_op(self, lreg: Value, expr_op: str, line: int) -> Value:\n return self.builder.unary_op(lreg, expr_op, line)\n\n def binary_op(self, lreg: Value, rreg: Value, expr_op: str, line: int) -> Value:\n return self.builder.binary_op(lreg, rreg, expr_op, line)\n\n def coerce(self, src: Value, target_type: RType, line: int, force: bool = False) -> Value:\n return self.builder.coerce(src, target_type, line, force)\n\n def none_object(self) -> Value:\n return self.builder.none_object()\n\n def none(self) -> Value:\n return self.builder.none()\n\n def true(self) -> Value:\n return self.builder.true()\n\n def false(self) -> Value:\n return self.builder.false()\n\n def new_list_op(self, values: List[Value], line: int) -> Value:\n return self.builder.new_list_op(values, line)\n\n def new_set_op(self, values: List[Value], line: int) -> Value:\n return self.builder.new_set_op(values, line)\n\n def translate_is_op(self,\n lreg: Value,\n rreg: Value,\n expr_op: str,\n line: int) -> Value:\n return self.builder.translate_is_op(lreg, rreg, expr_op, line)\n\n def py_call(self,\n function: Value,\n arg_values: List[Value],\n line: int,\n arg_kinds: Optional[List[int]] = None,\n arg_names: Optional[Sequence[Optional[str]]] = None) -> Value:\n return self.builder.py_call(function, arg_values, line, arg_kinds, arg_names)\n\n def add_bool_branch(self, value: Value, true: BasicBlock, false: BasicBlock) -> None:\n self.builder.add_bool_branch(value, true, false)\n\n def load_native_type_object(self, fullname: str) -> Value:\n return self.builder.load_native_type_object(fullname)\n\n def gen_method_call(self,\n base: Value,\n name: str,\n arg_values: List[Value],\n result_type: Optional[RType],\n line: int,\n arg_kinds: Optional[List[int]] = None,\n arg_names: Optional[List[Optional[str]]] = None) -> Value:\n return self.builder.gen_method_call(\n base, name, arg_values, result_type, line, arg_kinds, arg_names\n )\n\n def load_module(self, name: str) -> Value:\n return self.builder.load_module(name)\n\n def call_c(self, desc: CFunctionDescription, args: List[Value], line: int) -> Value:\n return self.builder.call_c(desc, args, line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.int_op_IRBuilder.add_to_non_ext_dict.self_call_c_dict_set_item": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.int_op_IRBuilder.add_to_non_ext_dict.self_call_c_dict_set_item", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/builder.py", "file_name": "builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 266, "end_line": 287, "span_ids": ["IRBuilder.compare_tuples", "IRBuilder.add_to_non_ext_dict", "IRBuilder.int_op", "IRBuilder.builtin_len", "IRBuilder.new_tuple", "IRBuilder.compare_tagged"], "tokens": 273}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRBuilder:\n\n def int_op(self, type: RType, lhs: Value, rhs: Value, op: int, line: int) -> Value:\n return self.builder.int_op(type, lhs, rhs, op, line)\n\n def compare_tagged(self, lhs: Value, rhs: Value, op: str, line: int) -> Value:\n return self.builder.compare_tagged(lhs, rhs, op, line)\n\n def compare_tuples(self, lhs: Value, rhs: Value, op: str, line: int) -> Value:\n return self.builder.compare_tuples(lhs, rhs, op, line)\n\n def builtin_len(self, val: Value, line: int) -> Value:\n return self.builder.builtin_len(val, line)\n\n def new_tuple(self, items: List[Value], line: int) -> Value:\n return self.builder.new_tuple(items, line)\n\n # Helpers for IR building\n\n def add_to_non_ext_dict(self, non_ext: NonExtClassInfo,\n key: str, val: Value, line: int) -> None:\n # Add an attribute entry into the class dict of a non-extension class.\n key_unicode = self.load_str(key)\n self.call_c(dict_set_item_op, [non_ext.dict, key_unicode, val], line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.process_sequence_assignment_IRBuilder.process_sequence_assignment.for_lvalue_value_in_zip_.self_assign_lvalue_value": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.process_sequence_assignment_IRBuilder.process_sequence_assignment.for_lvalue_value_in_zip_.self_assign_lvalue_value", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/builder.py", "file_name": "builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 509, "end_line": 532, "span_ids": ["IRBuilder.process_sequence_assignment"], "tokens": 232}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRBuilder:\n\n def process_sequence_assignment(self,\n target: AssignmentTargetTuple,\n rvalue: Value,\n line: int) -> None:\n \"\"\"Process assignment like 'x, y = s', where s is a variable-length list or tuple.\"\"\"\n # Check the length of sequence.\n expected_len = Integer(len(target.items), c_pyssize_t_rprimitive)\n self.builder.call_c(check_unpack_count_op, [rvalue, expected_len], line)\n\n # Read sequence items.\n values = []\n for i in range(len(target.items)):\n item = target.items[i]\n index = self.builder.load_int(i)\n if is_list_rprimitive(rvalue.type):\n item_value = self.call_c(list_get_item_unsafe_op, [rvalue, index], line)\n else:\n item_value = self.builder.gen_method_call(\n rvalue, '__getitem__', [index], item.type, line)\n values.append(item_value)\n\n # Assign sequence items to the target lvalues.\n for lvalue, value in zip(target.items, values):\n self.assign(lvalue, value, line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.leave_IRBuilder.leave.return.builder_args_runtime_arg": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.leave_IRBuilder.leave.return.builder_args_runtime_arg", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/builder.py", "file_name": "builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 920, "end_line": 929, "span_ids": ["IRBuilder.leave"], "tokens": 114}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRBuilder:\n\n def leave(self) -> Tuple[List[Register], List[RuntimeArg], List[BasicBlock], RType, FuncInfo]:\n builder = self.builders.pop()\n self.symtables.pop()\n runtime_args = self.runtime_args.pop()\n ret_type = self.ret_types.pop()\n fn_info = self.fn_infos.pop()\n self.nonlocal_control.pop()\n self.builder = self.builders[-1]\n self.fn_info = self.fn_infos[-1]\n return builder.args, runtime_args, builder.blocks, ret_type, fn_info", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.enter_method_IRBuilder.enter_method.self_add_argument_SELF_NA": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.enter_method_IRBuilder.enter_method.self_add_argument_SELF_NA", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/builder.py", "file_name": "builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 931, "end_line": 961, "span_ids": ["IRBuilder.enter_method"], "tokens": 271}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRBuilder:\n\n def enter_method(self,\n class_ir: ClassIR,\n name: str,\n ret_type: RType,\n fn_info: Union[FuncInfo, str] = '',\n self_type: Optional[RType] = None) -> None:\n \"\"\"Begin generating IR for a method.\n\n If the method takes arguments, you should immediately afterwards call\n add_argument() for each non-self argument (self is created implicitly).\n\n Call leave_method() to finish the generation of the method.\n\n You can enter multiple methods at a time. They are maintained in a\n stack, and leave_method() leaves the topmost one.\n\n Args:\n class_ir: Add method to this class\n name: Short name of the method\n ret_type: Return type of the method\n fn_info: Optionally, additional information about the method\n self_type: If not None, override default type of the implicit 'self'\n argument (by default, derive type from class_ir)\n \"\"\"\n self.enter(fn_info)\n self.function_name_stack.append(name)\n self.class_ir_stack.append(class_ir)\n self.ret_types[-1] = ret_type\n if self_type is None:\n self_type = RInstance(class_ir)\n self.add_argument(SELF_NAME, self_type)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.add_argument_IRBuilder.leave_method.self_functions_append_ir_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.add_argument_IRBuilder.leave_method.self_functions_append_ir_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/builder.py", "file_name": "builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 963, "end_line": 984, "span_ids": ["IRBuilder.leave_method", "IRBuilder.add_argument"], "tokens": 232}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRBuilder:\n\n def add_argument(self, var: Union[str, Var], typ: RType, kind: int = ARG_POS) -> Register:\n \"\"\"Declare an argument in the current function.\n\n You should use this instead of directly calling add_local() in new code.\n \"\"\"\n if isinstance(var, str):\n var = Var(var)\n reg = self.add_local(var, typ, is_arg=True)\n self.runtime_args[-1].append(RuntimeArg(var.name, typ, kind))\n return reg\n\n def leave_method(self) -> None:\n \"\"\"Finish the generation of IR for a method.\"\"\"\n arg_regs, args, blocks, ret_type, fn_info = self.leave()\n sig = FuncSignature(args, ret_type)\n name = self.function_name_stack.pop()\n class_ir = self.class_ir_stack.pop()\n decl = FuncDecl(name, class_ir.name, self.module_name, sig)\n ir = FuncIR(decl, arg_regs, blocks)\n class_ir.methods[name] = ir\n class_ir.method_decls[name] = ir.decl\n self.functions.append(ir)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.lookup_IRBuilder.add_local.return.reg": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.lookup_IRBuilder.add_local.return.reg", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/builder.py", "file_name": "builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 986, "end_line": 1000, "span_ids": ["IRBuilder.lookup", "IRBuilder.add_local"], "tokens": 140}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRBuilder:\n\n def lookup(self, symbol: SymbolNode) -> SymbolTarget:\n return self.symtables[-1][symbol]\n\n def add_local(self, symbol: SymbolNode, typ: RType, is_arg: bool = False) -> 'Register':\n \"\"\"Add register that represents a symbol to the symbol table.\n\n Args:\n is_arg: is this a function argument\n \"\"\"\n assert isinstance(symbol, SymbolNode)\n reg = Register(typ, symbol.name, is_arg=is_arg, line=symbol.line)\n self.symtables[-1][symbol] = AssignmentTargetRegister(reg)\n if is_arg:\n self.builder.args.append(reg)\n return reg", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.add_local_reg_IRBuilder.node_type.return.self_type_to_rtype_mypy_t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.add_local_reg_IRBuilder.node_type.return.self_type_to_rtype_mypy_t", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/builder.py", "file_name": "builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1002, "end_line": 1033, "span_ids": ["IRBuilder.node_type", "IRBuilder.add_target", "IRBuilder.add_self_to_env", "IRBuilder.add_local_reg", "IRBuilder.type_to_rtype"], "tokens": 290}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRBuilder:\n\n def add_local_reg(self,\n symbol: SymbolNode,\n typ: RType,\n is_arg: bool = False) -> AssignmentTargetRegister:\n \"\"\"Like add_local, but return an assignment target instead of value.\"\"\"\n self.add_local(symbol, typ, is_arg)\n target = self.symtables[-1][symbol]\n assert isinstance(target, AssignmentTargetRegister)\n return target\n\n def add_self_to_env(self, cls: ClassIR) -> AssignmentTargetRegister:\n \"\"\"Low-level function that adds a 'self' argument.\n\n This is only useful if using enter() instead of enter_method().\n \"\"\"\n return self.add_local_reg(Var(SELF_NAME), RInstance(cls), is_arg=True)\n\n def add_target(self, symbol: SymbolNode, target: SymbolTarget) -> SymbolTarget:\n self.symtables[-1][symbol] = target\n return target\n\n def type_to_rtype(self, typ: Optional[Type]) -> RType:\n return self.mapper.type_to_rtype(typ)\n\n def node_type(self, node: Expression) -> RType:\n if isinstance(node, IntExpr):\n # TODO: Don't special case IntExpr\n return int_rprimitive\n if node not in self.types:\n return object_rprimitive\n mypy_type = self.types[node]\n return self.type_to_rtype(mypy_type)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.add_var_to_env_class_IRBuilder.add_var_to_env_class.return.self_add_target_var_attr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.add_var_to_env_class_IRBuilder.add_var_to_env_class.return.self_add_target_var_attr", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/builder.py", "file_name": "builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1035, "end_line": 1053, "span_ids": ["IRBuilder.add_var_to_env_class"], "tokens": 211}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRBuilder:\n\n def add_var_to_env_class(self,\n var: SymbolNode,\n rtype: RType,\n base: Union[FuncInfo, ImplicitClass],\n reassign: bool = False) -> AssignmentTarget:\n # First, define the variable name as an attribute of the environment class, and then\n # construct a target for that attribute.\n self.fn_info.env_class.attributes[var.name] = rtype\n attr_target = AssignmentTargetAttr(base.curr_env_reg, var.name)\n\n if reassign:\n # Read the local definition of the variable, and set the corresponding attribute of\n # the environment class' variable to be that value.\n reg = self.read(self.lookup(var), self.fn_info.fitem.line)\n self.add(SetAttr(base.curr_env_reg, var.name, reg, self.fn_info.fitem.line))\n\n # Override the local definition of the variable to instead point at the variable in\n # the environment class.\n return self.add_target(var, attr_target)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/callable_class.py_add_get_to_callable_class_add_get_to_callable_class.builder_leave_method_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/callable_class.py_add_get_to_callable_class_add_get_to_callable_class.builder_leave_method_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/callable_class.py", "file_name": "callable_class.py", "file_type": "text/x-python", "category": "implementation", "start_line": 103, "end_line": 130, "span_ids": ["add_get_to_callable_class"], "tokens": 233}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_get_to_callable_class(builder: IRBuilder, fn_info: FuncInfo) -> None:\n \"\"\"Generate the '__get__' method for a callable class.\"\"\"\n line = fn_info.fitem.line\n\n builder.enter_method(\n fn_info.callable_class.ir, '__get__', object_rprimitive, fn_info,\n self_type=object_rprimitive\n )\n instance = builder.add_argument('instance', object_rprimitive)\n builder.add_argument('owner', object_rprimitive)\n\n # If accessed through the class, just return the callable\n # object. If accessed through an object, create a new bound\n # instance method object.\n instance_block, class_block = BasicBlock(), BasicBlock()\n comparison = builder.translate_is_op(\n builder.read(instance), builder.none_object(), 'is', line\n )\n builder.add_bool_branch(comparison, class_block, instance_block)\n\n builder.activate_block(class_block)\n builder.add(Return(builder.self()))\n\n builder.activate_block(instance_block)\n builder.add(Return(builder.call_c(method_new_op,\n [builder.self(), builder.read(instance)], line)))\n\n builder.leave_method()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/classdef.py_find_non_ext_metaclass_find_non_ext_metaclass.return.builder_call_c_py_calc_me": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/classdef.py_find_non_ext_metaclass_find_non_ext_metaclass.return.builder_call_c_py_calc_me", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/classdef.py", "file_name": "classdef.py", "file_type": "text/x-python", "category": "implementation", "start_line": 261, "end_line": 278, "span_ids": ["find_non_ext_metaclass"], "tokens": 270}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def find_non_ext_metaclass(builder: IRBuilder, cdef: ClassDef, bases: Value) -> Value:\n \"\"\"Find the metaclass of a class from its defs and bases. \"\"\"\n if cdef.metaclass:\n declared_metaclass = builder.accept(cdef.metaclass)\n else:\n if cdef.info.typeddict_type is not None and builder.options.capi_version >= (3, 9):\n # In Python 3.9, the metaclass for class-based TypedDict is typing._TypedDictMeta.\n # We can't easily calculate it generically, so special case it.\n return builder.get_module_attr('typing', '_TypedDictMeta', cdef.line)\n elif cdef.info.is_named_tuple and builder.options.capi_version >= (3, 9):\n # In Python 3.9, the metaclass for class-based NamedTuple is typing.NamedTupleMeta.\n # We can't easily calculate it generically, so special case it.\n return builder.get_module_attr('typing', 'NamedTupleMeta', cdef.line)\n\n declared_metaclass = builder.add(LoadAddress(type_object_op.type,\n type_object_op.src, cdef.line))\n\n return builder.call_c(py_calc_meta_op, [declared_metaclass, bases], cdef.line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/classdef.py_generate_attr_defaults_generate_attr_defaults.builder_leave_method_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/classdef.py_generate_attr_defaults_generate_attr_defaults.builder_leave_method_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/classdef.py", "file_name": "classdef.py", "file_type": "text/x-python", "category": "implementation", "start_line": 300, "end_line": 350, "span_ids": ["generate_attr_defaults"], "tokens": 442}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_attr_defaults(builder: IRBuilder, cdef: ClassDef) -> None:\n \"\"\"Generate an initialization method for default attr values (from class vars).\"\"\"\n cls = builder.mapper.type_to_ir[cdef.info]\n if cls.builtin_base:\n return\n\n # Pull out all assignments in classes in the mro so we can initialize them\n # TODO: Support nested statements\n default_assignments = []\n for info in reversed(cdef.info.mro):\n if info not in builder.mapper.type_to_ir:\n continue\n for stmt in info.defn.defs.body:\n if (isinstance(stmt, AssignmentStmt)\n and isinstance(stmt.lvalues[0], NameExpr)\n and not is_class_var(stmt.lvalues[0])\n and not isinstance(stmt.rvalue, TempNode)):\n if stmt.lvalues[0].name == '__slots__':\n continue\n\n # Skip type annotated assignments in dataclasses\n if is_dataclass(cdef) and stmt.type:\n continue\n\n default_assignments.append(stmt)\n\n if not default_assignments:\n return\n\n builder.enter_method(cls, '__mypyc_defaults_setup', bool_rprimitive)\n\n self_var = builder.self()\n for stmt in default_assignments:\n lvalue = stmt.lvalues[0]\n assert isinstance(lvalue, NameExpr)\n if not stmt.is_final_def and not is_constant(stmt.rvalue):\n builder.warning('Unsupported default attribute value', stmt.rvalue.line)\n\n # If the attribute is initialized to None and type isn't optional,\n # don't initialize it to anything.\n attr_type = cls.attr_type(lvalue.name)\n if isinstance(stmt.rvalue, RefExpr) and stmt.rvalue.fullname == 'builtins.None':\n if (not is_optional_type(attr_type) and not is_object_rprimitive(attr_type)\n and not is_none_rprimitive(attr_type)):\n continue\n val = builder.coerce(builder.accept(stmt.rvalue), attr_type, stmt.line)\n builder.add(SetAttr(self_var, lvalue.name, val, -1))\n\n builder.add(Return(builder.true()))\n\n builder.leave_method()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/classdef.py_create_ne_from_eq_gen_glue_ne_method.builder_leave_method_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/classdef.py_create_ne_from_eq_gen_glue_ne_method.builder_leave_method_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/classdef.py", "file_name": "classdef.py", "file_type": "text/x-python", "category": "implementation", "start_line": 353, "end_line": 385, "span_ids": ["create_ne_from_eq", "gen_glue_ne_method"], "tokens": 333}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def create_ne_from_eq(builder: IRBuilder, cdef: ClassDef) -> None:\n \"\"\"Create a \"__ne__\" method from a \"__eq__\" method (if only latter exists).\"\"\"\n cls = builder.mapper.type_to_ir[cdef.info]\n if cls.has_method('__eq__') and not cls.has_method('__ne__'):\n gen_glue_ne_method(builder, cls, cdef.line)\n\n\ndef gen_glue_ne_method(builder: IRBuilder, cls: ClassIR, line: int) -> None:\n \"\"\"Generate a \"__ne__\" method from a \"__eq__\" method. \"\"\"\n builder.enter_method(cls, '__ne__', object_rprimitive)\n rhs_arg = builder.add_argument('rhs', object_rprimitive)\n\n # If __eq__ returns NotImplemented, then __ne__ should also\n not_implemented_block, regular_block = BasicBlock(), BasicBlock()\n eqval = builder.add(MethodCall(builder.self(), '__eq__', [rhs_arg], line))\n not_implemented = builder.add(LoadAddress(not_implemented_op.type,\n not_implemented_op.src, line))\n builder.add(Branch(\n builder.translate_is_op(eqval, not_implemented, 'is', line),\n not_implemented_block,\n regular_block,\n Branch.BOOL))\n\n builder.activate_block(regular_block)\n retval = builder.coerce(\n builder.unary_op(eqval, 'not', line), object_rprimitive, line\n )\n builder.add(Return(retval))\n\n builder.activate_block(not_implemented_block)\n builder.add(Return(not_implemented))\n\n builder.leave_method()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_is_range_ref_make_for_loop_generator.if_is_dict_rprimitive_rty.return.for_dict": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_is_range_ref_make_for_loop_generator.if_is_dict_rprimitive_rty.return.for_dict", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/for_helpers.py", "file_name": "for_helpers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 159, "end_line": 193, "span_ids": ["is_range_ref", "make_for_loop_generator"], "tokens": 303}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_range_ref(expr: RefExpr) -> bool:\n return (expr.fullname == 'builtins.range'\n or isinstance(expr.node, TypeAlias) and expr.fullname == 'six.moves.xrange')\n\n\ndef make_for_loop_generator(builder: IRBuilder,\n index: Lvalue,\n expr: Expression,\n body_block: BasicBlock,\n loop_exit: BasicBlock,\n line: int,\n nested: bool = False) -> 'ForGenerator':\n \"\"\"Return helper object for generating a for loop over an iterable.\n\n If \"nested\" is True, this is a nested iterator such as \"e\" in \"enumerate(e)\".\n \"\"\"\n\n rtyp = builder.node_type(expr)\n if is_sequence_rprimitive(rtyp):\n # Special case \"for x in \".\n expr_reg = builder.accept(expr)\n target_type = builder.get_sequence_type(expr)\n\n for_list = ForSequence(builder, index, body_block, loop_exit, line, nested)\n for_list.init(expr_reg, target_type, reverse=False)\n return for_list\n\n if is_dict_rprimitive(rtyp):\n # Special case \"for k in \".\n expr_reg = builder.accept(expr)\n target_type = builder.get_dict_key_type(expr)\n\n for_dict = ForDictionaryKeys(builder, index, body_block, loop_exit, line, nested)\n for_dict.init(expr_reg, target_type)\n return for_dict\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_make_for_loop_generator.if_isinstance_expr_Call_make_for_loop_generator.if_isinstance_expr_Call.if_expr_callee_fullname_.return.for_list": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_make_for_loop_generator.if_isinstance_expr_Call_make_for_loop_generator.if_isinstance_expr_Call.if_expr_callee_fullname_.return.for_list", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/for_helpers.py", "file_name": "for_helpers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 195, "end_line": 257, "span_ids": ["make_for_loop_generator"], "tokens": 723}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def make_for_loop_generator(builder: IRBuilder,\n index: Lvalue,\n expr: Expression,\n body_block: BasicBlock,\n loop_exit: BasicBlock,\n line: int,\n nested: bool = False) -> 'ForGenerator':\n # ... other code\n\n if (isinstance(expr, CallExpr)\n and isinstance(expr.callee, RefExpr)):\n if (is_range_ref(expr.callee)\n and (len(expr.args) <= 2\n or (len(expr.args) == 3\n and builder.extract_int(expr.args[2]) is not None))\n and set(expr.arg_kinds) == {ARG_POS}):\n # Special case \"for x in range(...)\".\n # We support the 3 arg form but only for int literals, since it doesn't\n # seem worth the hassle of supporting dynamically determining which\n # direction of comparison to do.\n if len(expr.args) == 1:\n start_reg = Integer(0) # type: Value\n end_reg = builder.accept(expr.args[0])\n else:\n start_reg = builder.accept(expr.args[0])\n end_reg = builder.accept(expr.args[1])\n if len(expr.args) == 3:\n step = builder.extract_int(expr.args[2])\n assert step is not None\n if step == 0:\n builder.error(\"range() step can't be zero\", expr.args[2].line)\n else:\n step = 1\n\n for_range = ForRange(builder, index, body_block, loop_exit, line, nested)\n for_range.init(start_reg, end_reg, step)\n return for_range\n\n elif (expr.callee.fullname == 'builtins.enumerate'\n and len(expr.args) == 1\n and expr.arg_kinds == [ARG_POS]\n and isinstance(index, TupleExpr)\n and len(index.items) == 2):\n # Special case \"for i, x in enumerate(y)\".\n lvalue1 = index.items[0]\n lvalue2 = index.items[1]\n for_enumerate = ForEnumerate(builder, index, body_block, loop_exit, line,\n nested)\n for_enumerate.init(lvalue1, lvalue2, expr.args[0])\n return for_enumerate\n\n elif (expr.callee.fullname == 'builtins.zip'\n and len(expr.args) >= 2\n and set(expr.arg_kinds) == {ARG_POS}\n and isinstance(index, TupleExpr)\n and len(index.items) == len(expr.args)):\n # Special case \"for x, y in zip(a, b)\".\n for_zip = ForZip(builder, index, body_block, loop_exit, line, nested)\n for_zip.init(index.items, expr.args)\n return for_zip\n\n if (expr.callee.fullname == 'builtins.reversed'\n and len(expr.args) == 1\n and expr.arg_kinds == [ARG_POS]\n and is_sequence_rprimitive(builder.node_type(expr.args[0]))):\n # Special case \"for x in reversed()\".\n expr_reg = builder.accept(expr.args[0])\n target_type = builder.get_sequence_type(expr)\n\n for_list = ForSequence(builder, index, body_block, loop_exit, line, nested)\n for_list.init(expr_reg, target_type, reverse=True)\n return for_list\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py__Internal_functions_gen_func_item.if_builder_fn_info_is_gen.else_.gen_arg_defaults_builder_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py__Internal_functions_gen_func_item.if_builder_fn_info_is_gen.else_.gen_arg_defaults_builder_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/function.py", "file_name": "function.py", "file_type": "text/x-python", "category": "implementation", "start_line": 153, "end_line": 242, "span_ids": ["transform_await_expr", "gen_func_item"], "tokens": 789}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Internal functions\n\n\ndef gen_func_item(builder: IRBuilder,\n fitem: FuncItem,\n name: str,\n sig: FuncSignature,\n cdef: Optional[ClassDef] = None,\n ) -> Tuple[FuncIR, Optional[Value]]:\n \"\"\"Generate and return the FuncIR for a given FuncDef.\n\n If the given FuncItem is a nested function, then we generate a\n callable class representing the function and use that instead of\n the actual function. if the given FuncItem contains a nested\n function, then we generate an environment class so that inner\n nested functions can access the environment of the given FuncDef.\n\n Consider the following nested function:\n\n def a() -> None:\n def b() -> None:\n def c() -> None:\n return None\n return None\n return None\n\n The classes generated would look something like the following.\n\n has pointer to +-------+\n +--------------------------> | a_env |\n | +-------+\n | ^\n | | has pointer to\n +-------+ associated with +-------+\n | b_obj | -------------------> | b_env |\n +-------+ +-------+\n ^\n |\n +-------+ has pointer to |\n | c_obj | --------------------------+\n +-------+\n \"\"\"\n\n # TODO: do something about abstract methods.\n\n func_reg = None # type: Optional[Value]\n\n # We treat lambdas as always being nested because we always generate\n # a class for lambdas, no matter where they are. (It would probably also\n # work to special case toplevel lambdas and generate a non-class function.)\n is_nested = fitem in builder.nested_fitems or isinstance(fitem, LambdaExpr)\n contains_nested = fitem in builder.encapsulating_funcs.keys()\n is_decorated = fitem in builder.fdefs_to_decorators\n in_non_ext = False\n class_name = None\n if cdef:\n ir = builder.mapper.type_to_ir[cdef.info]\n in_non_ext = not ir.is_ext_class\n class_name = cdef.name\n\n builder.enter(FuncInfo(fitem, name, class_name, gen_func_ns(builder),\n is_nested, contains_nested, is_decorated, in_non_ext))\n\n # Functions that contain nested functions need an environment class to store variables that\n # are free in their nested functions. Generator functions need an environment class to\n # store a variable denoting the next instruction to be executed when the __next__ function\n # is called, along with all the variables inside the function itself.\n if builder.fn_info.contains_nested or builder.fn_info.is_generator:\n setup_env_class(builder)\n\n if builder.fn_info.is_nested or builder.fn_info.in_non_ext:\n setup_callable_class(builder)\n\n if builder.fn_info.is_generator:\n # Do a first-pass and generate a function that just returns a generator object.\n gen_generator_func(builder)\n args, _, blocks, ret_type, fn_info = builder.leave()\n func_ir, func_reg = gen_func_ir(builder, args, blocks, sig, fn_info, cdef)\n\n # Re-enter the FuncItem and visit the body of the function this time.\n builder.enter(fn_info)\n setup_env_for_generator_class(builder)\n load_outer_envs(builder, builder.fn_info.generator_class)\n if builder.fn_info.is_nested and isinstance(fitem, FuncDef):\n setup_func_for_recursive_call(builder, fitem, builder.fn_info.generator_class)\n create_switch_for_generator_class(builder)\n add_raise_exception_blocks_to_generator_class(builder, fitem.line)\n else:\n load_env_registers(builder)\n gen_arg_defaults(builder)\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_gen_func_item.None_4_gen_func_item.return._func_ir_func_reg_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/function.py_gen_func_item.None_4_gen_func_item.return._func_ir_func_reg_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/function.py", "file_name": "function.py", "file_type": "text/x-python", "category": "implementation", "start_line": 244, "end_line": 303, "span_ids": ["gen_func_item"], "tokens": 633}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def gen_func_item(builder: IRBuilder,\n fitem: FuncItem,\n name: str,\n sig: FuncSignature,\n cdef: Optional[ClassDef] = None,\n ) -> Tuple[FuncIR, Optional[Value]]:\n # ... other code\n\n if builder.fn_info.contains_nested and not builder.fn_info.is_generator:\n finalize_env_class(builder)\n\n builder.ret_types[-1] = sig.ret_type\n\n # Add all variables and functions that are declared/defined within this\n # function and are referenced in functions nested within this one to this\n # function's environment class so the nested functions can reference\n # them even if they are declared after the nested function's definition.\n # Note that this is done before visiting the body of this function.\n\n env_for_func = builder.fn_info # type: Union[FuncInfo, ImplicitClass]\n if builder.fn_info.is_generator:\n env_for_func = builder.fn_info.generator_class\n elif builder.fn_info.is_nested or builder.fn_info.in_non_ext:\n env_for_func = builder.fn_info.callable_class\n\n if builder.fn_info.fitem in builder.free_variables:\n # Sort the variables to keep things deterministic\n for var in sorted(builder.free_variables[builder.fn_info.fitem],\n key=lambda x: x.name):\n if isinstance(var, Var):\n rtype = builder.type_to_rtype(var.type)\n builder.add_var_to_env_class(var, rtype, env_for_func, reassign=False)\n\n if builder.fn_info.fitem in builder.encapsulating_funcs:\n for nested_fn in builder.encapsulating_funcs[builder.fn_info.fitem]:\n if isinstance(nested_fn, FuncDef):\n # The return type is 'object' instead of an RInstance of the\n # callable class because differently defined functions with\n # the same name and signature across conditional blocks\n # will generate different callable classes, so the callable\n # class that gets instantiated must be generic.\n builder.add_var_to_env_class(\n nested_fn, object_rprimitive, env_for_func, reassign=False\n )\n\n builder.accept(fitem.body)\n builder.maybe_add_implicit_return()\n\n if builder.fn_info.is_generator:\n populate_switch_for_generator_class(builder)\n\n # Hang on to the local symbol table for a while, since we use it\n # to calculate argument defaults below.\n symtable = builder.symtables[-1]\n\n args, _, blocks, ret_type, fn_info = builder.leave()\n\n if fn_info.is_generator:\n add_methods_to_generator_class(\n builder, fn_info, sig, args, blocks, fitem.is_coroutine)\n else:\n func_ir, func_reg = gen_func_ir(builder, args, blocks, sig, fn_info, cdef)\n\n # Evaluate argument defaults in the surrounding scope, since we\n # calculate them *once* when the function definition is evaluated.\n calculate_arg_defaults(builder, fn_info, func_reg, symtable)\n\n return (func_ir, func_reg)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/generator.py_add_iter_to_generator_class_add_next_to_generator_class.builder_leave_method_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/generator.py_add_iter_to_generator_class_add_next_to_generator_class.builder_leave_method_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/generator.py", "file_name": "generator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 158, "end_line": 177, "span_ids": ["add_iter_to_generator_class", "add_next_to_generator_class"], "tokens": 207}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_iter_to_generator_class(builder: IRBuilder, fn_info: FuncInfo) -> None:\n \"\"\"Generates the '__iter__' method for a generator class.\"\"\"\n builder.enter_method(fn_info.generator_class.ir, '__iter__', object_rprimitive, fn_info)\n builder.add(Return(builder.self()))\n builder.leave_method()\n\n\ndef add_next_to_generator_class(builder: IRBuilder,\n fn_info: FuncInfo,\n fn_decl: FuncDecl,\n sig: FuncSignature) -> None:\n \"\"\"Generates the '__next__' method for a generator class.\"\"\"\n builder.enter_method(fn_info.generator_class.ir, '__next__', object_rprimitive, fn_info)\n none_reg = builder.none_object()\n # Call the helper function with error flags set to Py_None, and return that result.\n result = builder.add(Call(fn_decl,\n [builder.self(), none_reg, none_reg, none_reg, none_reg],\n fn_info.fitem.line))\n builder.add(Return(result))\n builder.leave_method()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/generator.py_add_send_to_generator_class_add_send_to_generator_class.builder_leave_method_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/generator.py_add_send_to_generator_class_add_send_to_generator_class.builder_leave_method_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/generator.py", "file_name": "generator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 180, "end_line": 193, "span_ids": ["add_send_to_generator_class"], "tokens": 153}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_send_to_generator_class(builder: IRBuilder,\n fn_info: FuncInfo,\n fn_decl: FuncDecl,\n sig: FuncSignature) -> None:\n \"\"\"Generates the 'send' method for a generator class.\"\"\"\n builder.enter_method(fn_info.generator_class.ir, 'send', object_rprimitive, fn_info)\n arg = builder.add_argument('arg', object_rprimitive)\n none_reg = builder.none_object()\n # Call the helper function with error flags set to Py_None, and return that result.\n result = builder.add(Call(fn_decl,\n [builder.self(), none_reg, none_reg, none_reg, builder.read(arg)],\n fn_info.fitem.line))\n builder.add(Return(result))\n builder.leave_method()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/generator.py_add_throw_to_generator_class_add_throw_to_generator_class.builder_leave_method_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/generator.py_add_throw_to_generator_class_add_throw_to_generator_class.builder_leave_method_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/generator.py", "file_name": "generator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 196, "end_line": 222, "span_ids": ["add_throw_to_generator_class"], "tokens": 272}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_throw_to_generator_class(builder: IRBuilder,\n fn_info: FuncInfo,\n fn_decl: FuncDecl,\n sig: FuncSignature) -> None:\n \"\"\"Generates the 'throw' method for a generator class.\"\"\"\n builder.enter_method(fn_info.generator_class.ir, 'throw', object_rprimitive, fn_info)\n typ = builder.add_argument('type', object_rprimitive)\n val = builder.add_argument('value', object_rprimitive, ARG_OPT)\n tb = builder.add_argument('traceback', object_rprimitive, ARG_OPT)\n\n # Because the value and traceback arguments are optional and hence\n # can be NULL if not passed in, we have to assign them Py_None if\n # they are not passed in.\n none_reg = builder.none_object()\n builder.assign_if_null(val, lambda: none_reg, builder.fn_info.fitem.line)\n builder.assign_if_null(tb, lambda: none_reg, builder.fn_info.fitem.line)\n\n # Call the helper function using the arguments passed in, and return that result.\n result = builder.add(\n Call(\n fn_decl,\n [builder.self(), builder.read(typ), builder.read(val), builder.read(tb), none_reg],\n fn_info.fitem.line\n )\n )\n builder.add(Return(result))\n builder.leave_method()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/generator.py_add_close_to_generator_class_add_await_to_generator_class.builder_leave_method_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/generator.py_add_close_to_generator_class_add_await_to_generator_class.builder_leave_method_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/generator.py", "file_name": "generator.py", "file_type": "text/x-python", "category": "implementation", "start_line": 225, "end_line": 241, "span_ids": ["add_await_to_generator_class", "add_close_to_generator_class"], "tokens": 202}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_close_to_generator_class(builder: IRBuilder, fn_info: FuncInfo) -> None:\n \"\"\"Generates the '__close__' method for a generator class.\"\"\"\n # TODO: Currently this method just triggers a runtime error.\n # We should fill this out (https://github.com/mypyc/mypyc/issues/790).\n builder.enter_method(fn_info.generator_class.ir, 'close', object_rprimitive, fn_info)\n builder.add(RaiseStandardError(RaiseStandardError.RUNTIME_ERROR,\n 'close method on generator classes unimplemented',\n fn_info.fitem.line))\n builder.add(Unreachable())\n builder.leave_method()\n\n\ndef add_await_to_generator_class(builder: IRBuilder, fn_info: FuncInfo) -> None:\n \"\"\"Generates the '__await__' method for a generator class.\"\"\"\n builder.enter_method(fn_info.generator_class.ir, '__await__', object_rprimitive, fn_info)\n builder.add(Return(builder.self()))\n builder.leave_method()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.load_module_LowLevelIRBuilder._Other_primitive_operati": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.load_module_LowLevelIRBuilder._Other_primitive_operati", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/ll_builder.py", "file_name": "ll_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 503, "end_line": 515, "span_ids": ["LowLevelIRBuilder.load_module", "LowLevelIRBuilder.load_native_type_object", "LowLevelIRBuilder.get_native_type"], "tokens": 137}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LowLevelIRBuilder:\n\n def load_module(self, name: str) -> Value:\n return self.add(LoadStatic(object_rprimitive, name, namespace=NAMESPACE_MODULE))\n\n def get_native_type(self, cls: ClassIR) -> Value:\n \"\"\"Load native type object.\"\"\"\n fullname = '%s.%s' % (cls.module_name, cls.name)\n return self.load_native_type_object(fullname)\n\n def load_native_type_object(self, fullname: str) -> Value:\n module, name = fullname.rsplit('.', 1)\n return self.add(LoadStatic(object_rprimitive, name, module, NAMESPACE_TYPE))\n\n # Other primitive operations", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.bool_bitwise_op_LowLevelIRBuilder.unary_not.return.self_int_op_value_type_v": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.bool_bitwise_op_LowLevelIRBuilder.unary_not.return.self_int_op_value_type_v", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/ll_builder.py", "file_name": "ll_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 727, "end_line": 742, "span_ids": ["LowLevelIRBuilder.unary_not", "LowLevelIRBuilder.bool_bitwise_op"], "tokens": 155}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LowLevelIRBuilder:\n\n def bool_bitwise_op(self, lreg: Value, rreg: Value, op: str, line: int) -> Value:\n if op == '&':\n code = IntOp.AND\n elif op == '|':\n code = IntOp.OR\n elif op == '^':\n code = IntOp.XOR\n else:\n assert False, op\n return self.add(IntOp(bool_rprimitive, lreg, rreg, code, line))\n\n def unary_not(self,\n value: Value,\n line: int) -> Value:\n mask = Integer(1, value.type, line)\n return self.int_op(value.type, value, mask, IntOp.XOR, line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.translate_special_method_call_LowLevelIRBuilder.translate_special_method_call.return.call_c_op": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.translate_special_method_call_LowLevelIRBuilder.translate_special_method_call.return.call_c_op", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/ll_builder.py", "file_name": "ll_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1069, "end_line": 1086, "span_ids": ["LowLevelIRBuilder.translate_special_method_call"], "tokens": 167}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LowLevelIRBuilder:\n\n def translate_special_method_call(self,\n base_reg: Value,\n name: str,\n args: List[Value],\n result_type: Optional[RType],\n line: int) -> Optional[Value]:\n \"\"\"Translate a method call which is handled nongenerically.\n\n These are special in the sense that we have code generated specifically for them.\n They tend to be method calls which have equivalents in C that are more direct\n than calling with the PyObject api.\n\n Return None if no translation found; otherwise return the target register.\n \"\"\"\n call_c_ops_candidates = method_call_ops.get(name, [])\n call_c_op = self.matching_call_c(call_c_ops_candidates, [base_reg] + args,\n line, result_type)\n return call_c_op", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_assignment_stmt_transform_assignment_stmt.for_lvalue_in_lvalues_.builder_assign_target_rv": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_transform_assignment_stmt_transform_assignment_stmt.for_lvalue_in_lvalues_.builder_assign_target_rv", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/statement.py", "file_name": "statement.py", "file_type": "text/x-python", "category": "implementation", "start_line": 75, "end_line": 110, "span_ids": ["transform_assignment_stmt"], "tokens": 380}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def transform_assignment_stmt(builder: IRBuilder, stmt: AssignmentStmt) -> None:\n lvalues = stmt.lvalues\n assert len(lvalues) >= 1\n builder.disallow_class_assignments(lvalues, stmt.line)\n first_lvalue = lvalues[0]\n if stmt.type and isinstance(stmt.rvalue, TempNode):\n # This is actually a variable annotation without initializer. Don't generate\n # an assignment but we need to call get_assignment_target since it adds a\n # name binding as a side effect.\n builder.get_assignment_target(first_lvalue, stmt.line)\n return\n\n # Special case multiple assignments like 'x, y = e1, e2'.\n if (isinstance(first_lvalue, (TupleExpr, ListExpr))\n and isinstance(stmt.rvalue, (TupleExpr, ListExpr))\n and len(first_lvalue.items) == len(stmt.rvalue.items)\n and all(is_simple_lvalue(item) for item in first_lvalue.items)\n and len(lvalues) == 1):\n temps = []\n for right in stmt.rvalue.items:\n rvalue_reg = builder.accept(right)\n temp = Register(rvalue_reg.type)\n builder.assign(temp, rvalue_reg, stmt.line)\n temps.append(temp)\n for (left, temp) in zip(first_lvalue.items, temps):\n assignment_target = builder.get_assignment_target(left)\n builder.assign(assignment_target, temp, stmt.line)\n return\n\n line = stmt.rvalue.line\n rvalue_reg = builder.accept(stmt.rvalue)\n if builder.non_function_scope() and stmt.is_final_def:\n builder.init_final_static(first_lvalue, rvalue_reg)\n for lvalue in lvalues:\n target = builder.get_assignment_target(lvalue)\n builder.assign(target, rvalue_reg, line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_is_simple_lvalue_transform_operator_assignment_stmt.builder_assign_target_re": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/statement.py_is_simple_lvalue_transform_operator_assignment_stmt.builder_assign_target_re", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/statement.py", "file_name": "statement.py", "file_type": "text/x-python", "category": "implementation", "start_line": 113, "end_line": 128, "span_ids": ["transform_operator_assignment_stmt", "is_simple_lvalue"], "tokens": 184}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_simple_lvalue(expr: Expression) -> bool:\n return not isinstance(expr, (StarExpr, ListExpr, TupleExpr))\n\n\ndef transform_operator_assignment_stmt(builder: IRBuilder, stmt: OperatorAssignmentStmt) -> None:\n \"\"\"Operator assignment statement such as x += 1\"\"\"\n builder.disallow_class_assignments([stmt.lvalue], stmt.line)\n target = builder.get_assignment_target(stmt.lvalue)\n target_value = builder.read(target, stmt.line)\n rreg = builder.accept(stmt.rvalue)\n # the Python parser strips the '=' from operator assignment statements, so re-add it\n op = stmt.op + '='\n res = builder.binary_op(target_value, rreg, op, stmt.line)\n # usually operator assignments are done in-place\n # but when target doesn't support that we need to manually assign\n builder.assign(target, res, res.line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/targets.py_from_typing_import_List__AssignmentTargetIndex.__init__.self.type.object_rprimitive": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/targets.py_from_typing_import_List__AssignmentTargetIndex.__init__.self.type.object_rprimitive", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/targets.py", "file_name": "targets.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 32, "span_ids": ["AssignmentTargetRegister", "AssignmentTargetIndex.__init__", "AssignmentTarget", "imports", "AssignmentTargetIndex", "AssignmentTargetRegister.__init__"], "tokens": 217}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from typing import List, Optional\n\nfrom mypyc.ir.ops import Value, Register\nfrom mypyc.ir.rtypes import RType, RInstance, object_rprimitive\n\n\nclass AssignmentTarget:\n \"\"\"Abstract base class for assignment targets during IR building.\"\"\"\n\n type = object_rprimitive # type: RType\n\n\nclass AssignmentTargetRegister(AssignmentTarget):\n \"\"\"Register as an assignment target.\n\n This is used for local variables and some temporaries.\n \"\"\"\n\n def __init__(self, register: Register) -> None:\n self.register = register\n self.type = register.type\n\n\nclass AssignmentTargetIndex(AssignmentTarget):\n \"\"\"base[index] as assignment target\"\"\"\n\n def __init__(self, base: Value, index: Value) -> None:\n self.base = base\n self.index = index\n # TODO: object_rprimitive won't be right for user-defined classes. Store the\n # lvalue type in mypy and use a better type to avoid unneeded boxing.\n self.type = object_rprimitive", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/targets.py_AssignmentTargetAttr_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/targets.py_AssignmentTargetAttr_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/targets.py", "file_name": "targets.py", "file_type": "text/x-python", "category": "implementation", "start_line": 35, "end_line": 59, "span_ids": ["AssignmentTargetAttr", "AssignmentTargetTuple", "AssignmentTargetTuple.__init__", "AssignmentTargetAttr.__init__"], "tokens": 181}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class AssignmentTargetAttr(AssignmentTarget):\n \"\"\"obj.attr as assignment target\"\"\"\n\n def __init__(self, obj: Value, attr: str) -> None:\n self.obj = obj\n self.attr = attr\n if isinstance(obj.type, RInstance) and obj.type.class_ir.has_attr(attr):\n # Native attribute reference\n self.obj_type = obj.type # type: RType\n self.type = obj.type.attr_type(attr)\n else:\n # Python attribute reference\n self.obj_type = object_rprimitive\n self.type = object_rprimitive\n\n\nclass AssignmentTargetTuple(AssignmentTarget):\n \"\"\"x, ..., y as assignment target\"\"\"\n\n def __init__(self,\n items: List[AssignmentTarget],\n star_idx: Optional[int] = None) -> None:\n self.items = items\n self.star_idx = star_idx", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/float_ops.py__Primitive_float_ops__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/float_ops.py__Primitive_float_ops__", "embedding": null, "metadata": {"file_path": "mypyc/primitives/float_ops.py", "file_name": "float_ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 26, "span_ids": ["docstring"], "tokens": 140}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Primitive float ops.\"\"\"\n\nfrom mypyc.ir.ops import ERR_MAGIC\nfrom mypyc.ir.rtypes import (\n str_rprimitive, float_rprimitive\n)\nfrom mypyc.primitives.registry import (\n function_op\n)\n\n# float(str)\nfunction_op(\n name='builtins.float',\n arg_types=[str_rprimitive],\n return_type=float_rprimitive,\n c_function_name='PyFloat_FromString',\n error_kind=ERR_MAGIC)\n\n# abs(float)\nfunction_op(\n name='builtins.abs',\n arg_types=[float_rprimitive],\n return_type=float_rprimitive,\n c_function_name='PyNumber_Absolute',\n error_kind=ERR_MAGIC)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/int_ops.py__Arbitrary_precision_in_int_binary_op_CPyT": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/int_ops.py__Arbitrary_precision_in_int_binary_op_CPyT", "embedding": null, "metadata": {"file_path": "mypyc/primitives/int_ops.py", "file_name": "int_ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 95, "span_ids": ["int_binary_op", "impl:6", "impl:7", "docstring"], "tokens": 753}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Arbitrary-precision integer primitive ops.\n\nThese mostly operate on (usually) unboxed integers that use a tagged pointer\nrepresentation (CPyTagged) and correspond to the Python 'int' type.\n\nSee also the documentation for mypyc.rtypes.int_rprimitive.\n\nUse mypyc.ir.ops.IntOp for operations on fixed-width/C integers.\n\"\"\"\n\nfrom typing import Dict, NamedTuple\nfrom mypyc.ir.ops import ERR_NEVER, ERR_MAGIC, ComparisonOp\nfrom mypyc.ir.rtypes import (\n int_rprimitive, bool_rprimitive, float_rprimitive, object_rprimitive,\n str_rprimitive, bit_rprimitive, RType\n)\nfrom mypyc.primitives.registry import (\n load_address_op, c_unary_op, CFunctionDescription, function_op, binary_op, custom_op\n)\n\n# These int constructors produce object_rprimitives that then need to be unboxed\n# I guess unboxing ourselves would save a check and branch though?\n\n# Get the type object for 'builtins.int'.\n# For ordinary calls to int() we use a load_address to the type\nload_address_op(\n name='builtins.int',\n type=object_rprimitive,\n src='PyLong_Type')\n\n# Convert from a float to int. We could do a bit better directly.\nfunction_op(\n name='builtins.int',\n arg_types=[float_rprimitive],\n return_type=object_rprimitive,\n c_function_name='CPyLong_FromFloat',\n error_kind=ERR_MAGIC)\n\n# int(string)\nfunction_op(\n name='builtins.int',\n arg_types=[str_rprimitive],\n return_type=object_rprimitive,\n c_function_name='CPyLong_FromStr',\n error_kind=ERR_MAGIC)\n\n# int(string, base)\nfunction_op(\n name='builtins.int',\n arg_types=[str_rprimitive, int_rprimitive],\n return_type=object_rprimitive,\n c_function_name='CPyLong_FromStrWithBase',\n error_kind=ERR_MAGIC)\n\n# str(n) on ints\nfunction_op(\n name='builtins.str',\n arg_types=[int_rprimitive],\n return_type=str_rprimitive,\n c_function_name='CPyTagged_Str',\n error_kind=ERR_MAGIC,\n priority=2)\n\n# We need a specialization for str on bools also since the int one is wrong...\nfunction_op(\n name='builtins.str',\n arg_types=[bool_rprimitive],\n return_type=str_rprimitive,\n c_function_name='CPyBool_Str',\n error_kind=ERR_MAGIC,\n priority=3)\n\n\ndef int_binary_op(name: str, c_function_name: str,\n return_type: RType = int_rprimitive,\n error_kind: int = ERR_NEVER) -> None:\n binary_op(name=name,\n arg_types=[int_rprimitive, int_rprimitive],\n return_type=return_type,\n c_function_name=c_function_name,\n error_kind=error_kind)\n\n\n# Binary, unary and augmented assignment operations that operate on CPyTagged ints\n# are implemented as C functions.\n\nint_binary_op('+', 'CPyTagged_Add')\nint_binary_op('-', 'CPyTagged_Subtract')\nint_binary_op('*', 'CPyTagged_Multiply')\nint_binary_op('&', 'CPyTagged_And')\nint_binary_op('|', 'CPyTagged_Or')\nint_binary_op('^', 'CPyTagged_Xor')\n# Divide and remainder we honestly propagate errors from because they\n# can raise ZeroDivisionError\nint_binary_op('//', 'CPyTagged_FloorDivide', error_kind=ERR_MAGIC)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/int_ops.py_None_13_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/int_ops.py_None_13_", "embedding": null, "metadata": {"file_path": "mypyc/primitives/int_ops.py", "file_name": "int_ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 96, "end_line": 166, "span_ids": ["impl:27", "int_unary_op", "impl:7"], "tokens": 798}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "int_binary_op('%', 'CPyTagged_Remainder', error_kind=ERR_MAGIC)\n# Negative shift counts raise an exception\nint_binary_op('>>', 'CPyTagged_Rshift', error_kind=ERR_MAGIC)\nint_binary_op('<<', 'CPyTagged_Lshift', error_kind=ERR_MAGIC)\n\n# This should work because assignment operators are parsed differently\n# and the code in irbuild that handles it does the assignment\n# regardless of whether or not the operator works in place anyway.\nint_binary_op('+=', 'CPyTagged_Add')\nint_binary_op('-=', 'CPyTagged_Subtract')\nint_binary_op('*=', 'CPyTagged_Multiply')\nint_binary_op('&=', 'CPyTagged_And')\nint_binary_op('|=', 'CPyTagged_Or')\nint_binary_op('^=', 'CPyTagged_Xor')\nint_binary_op('//=', 'CPyTagged_FloorDivide', error_kind=ERR_MAGIC)\nint_binary_op('%=', 'CPyTagged_Remainder', error_kind=ERR_MAGIC)\nint_binary_op('>>=', 'CPyTagged_Rshift', error_kind=ERR_MAGIC)\nint_binary_op('<<=', 'CPyTagged_Lshift', error_kind=ERR_MAGIC)\n\n\ndef int_unary_op(name: str, c_function_name: str) -> CFunctionDescription:\n return c_unary_op(name=name,\n arg_type=int_rprimitive,\n return_type=int_rprimitive,\n c_function_name=c_function_name,\n error_kind=ERR_NEVER)\n\n\nint_neg_op = int_unary_op('-', 'CPyTagged_Negate')\nint_invert_op = int_unary_op('~', 'CPyTagged_Invert')\n\n# Primitives related to integer comparison operations:\n\n# Description for building int comparison ops\n#\n# Fields:\n# binary_op_variant: identify which IntOp to use when operands are short integers\n# c_func_description: the C function to call when operands are tagged integers\n# c_func_negated: whether to negate the C function call's result\n# c_func_swap_operands: whether to swap lhs and rhs when call the function\nIntComparisonOpDescription = NamedTuple(\n 'IntComparisonOpDescription', [('binary_op_variant', int),\n ('c_func_description', CFunctionDescription),\n ('c_func_negated', bool),\n ('c_func_swap_operands', bool)])\n\n# Equals operation on two boxed tagged integers\nint_equal_ = custom_op(\n arg_types=[int_rprimitive, int_rprimitive],\n return_type=bit_rprimitive,\n c_function_name='CPyTagged_IsEq_',\n error_kind=ERR_NEVER)\n\n# Less than operation on two boxed tagged integers\nint_less_than_ = custom_op(\n arg_types=[int_rprimitive, int_rprimitive],\n return_type=bit_rprimitive,\n c_function_name='CPyTagged_IsLt_',\n error_kind=ERR_NEVER)\n\n# Provide mapping from textual op to short int's op variant and boxed int's description.\n# Note that these are not complete implementations and require extra IR.\nint_comparison_op_mapping = {\n '==': IntComparisonOpDescription(ComparisonOp.EQ, int_equal_, False, False),\n '!=': IntComparisonOpDescription(ComparisonOp.NEQ, int_equal_, True, False),\n '<': IntComparisonOpDescription(ComparisonOp.SLT, int_less_than_, False, False),\n '<=': IntComparisonOpDescription(ComparisonOp.SLE, int_less_than_, True, True),\n '>': IntComparisonOpDescription(ComparisonOp.SGT, int_less_than_, False, True),\n '>=': IntComparisonOpDescription(ComparisonOp.SGE, int_less_than_, True, False),\n} # type: Dict[str, IntComparisonOpDescription]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor_TestFunctionEmitterVisitor.setUp.self.context.EmitterContext_NameGenera": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor_TestFunctionEmitterVisitor.setUp.self.context.EmitterContext_NameGenera", "embedding": null, "metadata": {"file_path": "mypyc/test/test_emitfunc.py", "file_name": "test_emitfunc.py", "file_type": "text/x-python", "category": "test", "start_line": 36, "end_line": 72, "span_ids": ["TestFunctionEmitterVisitor", "TestFunctionEmitterVisitor.setUp"], "tokens": 440}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestFunctionEmitterVisitor(unittest.TestCase):\n \"\"\"Test generation of fragments of C from individual IR ops.\"\"\"\n\n def setUp(self) -> None:\n self.registers = [] # type: List[Register]\n\n def add_local(name: str, rtype: RType) -> Register:\n reg = Register(rtype, name)\n self.registers.append(reg)\n return reg\n\n self.n = add_local('n', int_rprimitive)\n self.m = add_local('m', int_rprimitive)\n self.k = add_local('k', int_rprimitive)\n self.l = add_local('l', list_rprimitive) # noqa\n self.ll = add_local('ll', list_rprimitive)\n self.o = add_local('o', object_rprimitive)\n self.o2 = add_local('o2', object_rprimitive)\n self.d = add_local('d', dict_rprimitive)\n self.b = add_local('b', bool_rprimitive)\n self.s1 = add_local('s1', short_int_rprimitive)\n self.s2 = add_local('s2', short_int_rprimitive)\n self.i32 = add_local('i32', int32_rprimitive)\n self.i32_1 = add_local('i32_1', int32_rprimitive)\n self.i64 = add_local('i64', int64_rprimitive)\n self.i64_1 = add_local('i64_1', int64_rprimitive)\n self.ptr = add_local('ptr', pointer_rprimitive)\n self.t = add_local('t', RTuple([int_rprimitive, bool_rprimitive]))\n self.tt = add_local(\n 'tt', RTuple([RTuple([int_rprimitive, bool_rprimitive]), bool_rprimitive]))\n ir = ClassIR('A', 'mod')\n ir.attributes = OrderedDict([('x', bool_rprimitive), ('y', int_rprimitive)])\n compute_vtable(ir)\n ir.mro = [ir]\n self.r = add_local('r', RInstance(ir))\n\n self.context = EmitterContext(NameGenerator([['mod']]))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor.test_int_op_TestFunctionEmitterVisitor.test_int_op.None_9": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor.test_int_op_TestFunctionEmitterVisitor.test_int_op.None_9", "embedding": null, "metadata": {"file_path": "mypyc/test/test_emitfunc.py", "file_name": "test_emitfunc.py", "file_type": "text/x-python", "category": "test", "start_line": 241, "end_line": 261, "span_ids": ["TestFunctionEmitterVisitor.test_int_op"], "tokens": 485}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestFunctionEmitterVisitor(unittest.TestCase):\n\n def test_int_op(self) -> None:\n self.assert_emit(IntOp(short_int_rprimitive, self.s1, self.s2, IntOp.ADD, 1),\n \"\"\"cpy_r_r0 = cpy_r_s1 + cpy_r_s2;\"\"\")\n self.assert_emit(IntOp(short_int_rprimitive, self.s1, self.s2, IntOp.SUB, 1),\n \"\"\"cpy_r_r0 = cpy_r_s1 - cpy_r_s2;\"\"\")\n self.assert_emit(IntOp(short_int_rprimitive, self.s1, self.s2, IntOp.MUL, 1),\n \"\"\"cpy_r_r0 = cpy_r_s1 * cpy_r_s2;\"\"\")\n self.assert_emit(IntOp(short_int_rprimitive, self.s1, self.s2, IntOp.DIV, 1),\n \"\"\"cpy_r_r0 = cpy_r_s1 / cpy_r_s2;\"\"\")\n self.assert_emit(IntOp(short_int_rprimitive, self.s1, self.s2, IntOp.MOD, 1),\n \"\"\"cpy_r_r0 = cpy_r_s1 % cpy_r_s2;\"\"\")\n self.assert_emit(IntOp(short_int_rprimitive, self.s1, self.s2, IntOp.AND, 1),\n \"\"\"cpy_r_r0 = cpy_r_s1 & cpy_r_s2;\"\"\")\n self.assert_emit(IntOp(short_int_rprimitive, self.s1, self.s2, IntOp.OR, 1),\n \"\"\"cpy_r_r0 = cpy_r_s1 | cpy_r_s2;\"\"\")\n self.assert_emit(IntOp(short_int_rprimitive, self.s1, self.s2, IntOp.XOR, 1),\n \"\"\"cpy_r_r0 = cpy_r_s1 ^ cpy_r_s2;\"\"\")\n self.assert_emit(IntOp(short_int_rprimitive, self.s1, self.s2, IntOp.LEFT_SHIFT, 1),\n \"\"\"cpy_r_r0 = cpy_r_s1 << cpy_r_s2;\"\"\")\n self.assert_emit(IntOp(short_int_rprimitive, self.s1, self.s2, IntOp.RIGHT_SHIFT, 1),\n \"\"\"cpy_r_r0 = cpy_r_s1 >> cpy_r_s2;\"\"\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor.assert_emit_TestFunctionEmitterVisitor.assert_emit.assert_string_arrays_equa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor.assert_emit_TestFunctionEmitterVisitor.assert_emit.assert_string_arrays_equa", "embedding": null, "metadata": {"file_path": "mypyc/test/test_emitfunc.py", "file_name": "test_emitfunc.py", "file_type": "text/x-python", "category": "test", "start_line": 380, "end_line": 403, "span_ids": ["TestFunctionEmitterVisitor.assert_emit"], "tokens": 239}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestFunctionEmitterVisitor(unittest.TestCase):\n\n def assert_emit(self, op: Op, expected: str, next_block: Optional[BasicBlock] = None) -> None:\n block = BasicBlock(0)\n block.ops.append(op)\n value_names = generate_names_for_ir(self.registers, [block])\n emitter = Emitter(self.context, value_names)\n declarations = Emitter(self.context, value_names)\n emitter.fragments = []\n declarations.fragments = []\n\n visitor = FunctionEmitterVisitor(emitter, declarations, 'prog.py', 'prog')\n visitor.next_block = next_block\n\n op.accept(visitor)\n frags = declarations.fragments + emitter.fragments\n actual_lines = [line.strip(' ') for line in frags]\n assert all(line.endswith('\\n') for line in actual_lines)\n actual_lines = [line.rstrip('\\n') for line in actual_lines]\n if not expected.strip():\n expected_lines = []\n else:\n expected_lines = expected.rstrip().split('\\n')\n expected_lines = [line.strip(' ') for line in expected_lines]\n assert_string_arrays_equal(expected_lines, actual_lines,\n msg='Generated code unexpected')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor.assert_emit_binary_op_TestFunctionEmitterVisitor.assert_emit_binary_op.if_op_in_binary_ops_.else_.assert_False_Could_not_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor.assert_emit_binary_op_TestFunctionEmitterVisitor.assert_emit_binary_op.if_op_in_binary_ops_.else_.assert_False_Could_not_", "embedding": null, "metadata": {"file_path": "mypyc/test/test_emitfunc.py", "file_name": "test_emitfunc.py", "file_type": "text/x-python", "category": "test", "start_line": 330, "end_line": 349, "span_ids": ["TestFunctionEmitterVisitor.assert_emit_binary_op"], "tokens": 178}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestFunctionEmitterVisitor(unittest.TestCase):\n\n def assert_emit_binary_op(self,\n op: str,\n dest: Value,\n left: Value,\n right: Value,\n expected: str) -> None:\n if op in binary_ops:\n ops = binary_ops[op]\n for desc in ops:\n if (is_subtype(left.type, desc.arg_types[0])\n and is_subtype(right.type, desc.arg_types[1])):\n args = [left, right]\n if desc.ordering is not None:\n args = [args[i] for i in desc.ordering]\n self.assert_emit(CallC(desc.c_function_name, args, desc.return_type,\n desc.steals, desc.is_borrowed,\n desc.error_kind, 55), expected)\n return\n else:\n assert False, 'Could not find matching op'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_pprint.py_unittest_make_block.return.block": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_pprint.py_unittest_make_block.return.block", "embedding": null, "metadata": {"file_path": "mypyc/test/test_pprint.py", "file_name": "test_pprint.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 16, "span_ids": ["imports", "make_block", "register"], "tokens": 110}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import unittest\nfrom typing import List\n\nfrom mypyc.ir.ops import BasicBlock, Register, Op, Integer, IntOp, Unreachable, Assign\nfrom mypyc.ir.rtypes import int_rprimitive\nfrom mypyc.ir.pprint import generate_names_for_ir\n\n\ndef register(name: str) -> Register:\n return Register(int_rprimitive, 'foo', is_arg=True)\n\n\ndef make_block(ops: List[Op]) -> BasicBlock:\n block = BasicBlock()\n block.ops.extend(ops)\n return block", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_pprint.py_TestGenerateNames_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_pprint.py_TestGenerateNames_", "embedding": null, "metadata": {"file_path": "mypyc/test/test_pprint.py", "file_name": "test_pprint.py", "file_type": "text/x-python", "category": "test", "start_line": 19, "end_line": 42, "span_ids": ["TestGenerateNames.test_assign", "TestGenerateNames.test_arg", "TestGenerateNames.test_empty", "TestGenerateNames.test_int_op", "TestGenerateNames"], "tokens": 238}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestGenerateNames(unittest.TestCase):\n def test_empty(self) -> None:\n assert generate_names_for_ir([], []) == {}\n\n def test_arg(self) -> None:\n reg = register('foo')\n assert generate_names_for_ir([reg], []) == {reg: 'foo'}\n\n def test_int_op(self) -> None:\n n1 = Integer(2)\n n2 = Integer(4)\n op1 = IntOp(int_rprimitive, n1, n2, IntOp.ADD)\n op2 = IntOp(int_rprimitive, op1, n2, IntOp.ADD)\n block = make_block([op1, op2, Unreachable()])\n assert generate_names_for_ir([], [block]) == {op1: 'r0', op2: 'r1'}\n\n def test_assign(self) -> None:\n reg = register('foo')\n n = Integer(2)\n op1 = Assign(reg, n)\n op2 = Assign(reg, n)\n block = make_block([op1, op2])\n assert generate_names_for_ir([reg], [block]) == {reg: 'foo'}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/transform/refcount.py_add_block_add_block.return.block": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/transform/refcount.py_add_block_add_block.return.block", "embedding": null, "metadata": {"file_path": "mypyc/transform/refcount.py", "file_name": "refcount.py", "file_type": "text/x-python", "category": "implementation", "start_line": 225, "end_line": 241, "span_ids": ["add_block"], "tokens": 164}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_block(decincs: DecIncs, cache: BlockCache,\n blocks: List[BasicBlock], label: BasicBlock) -> BasicBlock:\n decs, incs = decincs\n if not decs and not incs:\n return label\n\n # TODO: be able to share *partial* results\n if (label, decincs) in cache:\n return cache[label, decincs]\n\n block = BasicBlock()\n blocks.append(block)\n block.ops.extend(DecRef(reg, is_xdec=xdec) for reg, xdec in decs)\n block.ops.extend(IncRef(reg) for reg in incs)\n block.ops.append(Goto(label))\n cache[label, decincs] = block\n return block", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/transform/refcount.py_make_value_ordering_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/transform/refcount.py_make_value_ordering_", "embedding": null, "metadata": {"file_path": "mypyc/transform/refcount.py", "file_name": "refcount.py", "file_type": "text/x-python", "category": "implementation", "start_line": 244, "end_line": 274, "span_ids": ["make_value_ordering"], "tokens": 211}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def make_value_ordering(ir: FuncIR) -> Dict[Value, int]:\n \"\"\"Create a ordering of values that allows them to be sorted.\n\n This omits registers that are only ever read.\n \"\"\"\n # TODO: Never initialized values??\n result = {} # type: Dict[Value, int]\n n = 0\n\n for arg in ir.arg_regs:\n result[arg] = n\n n += 1\n\n for block in ir.blocks:\n for op in block.ops:\n if (isinstance(op, LoadAddress)\n and isinstance(op.src, Register)\n and op.src not in result):\n # Taking the address of a register allows initialization.\n result[op.src] = n\n n += 1\n if isinstance(op, Assign):\n if op.dest not in result:\n result[op.dest] = n\n n += 1\n elif op not in result:\n result[op] = n\n n += 1\n\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/runtests.py__usr_bin_env_python3_assert_all_cmd_in_cmds_fo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/runtests.py__usr_bin_env_python3_assert_all_cmd_in_cmds_fo", "embedding": null, "metadata": {"file_path": "runtests.py", "file_name": "runtests.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 81, "span_ids": ["docstring:7", "docstring"], "tokens": 688}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "#!/usr/bin/env python3\nimport subprocess\nfrom subprocess import Popen\nfrom sys import argv, exit, executable\n\n# Slow test suites\nCMDLINE = 'PythonCmdline'\nSAMPLES = 'SamplesSuite'\nTYPESHED = 'TypeshedSuite'\nPEP561 = 'PEP561Suite'\nEVALUATION = 'PythonEvaluation'\nDAEMON = 'testdaemon'\nSTUBGEN_CMD = 'StubgenCmdLine'\nSTUBGEN_PY = 'StubgenPythonSuite'\nMYPYC_RUN = 'TestRun'\nMYPYC_RUN_MULTI = 'TestRunMultiFile'\nMYPYC_EXTERNAL = 'TestExternal'\nMYPYC_COMMAND_LINE = 'TestCommandLine'\nERROR_STREAM = 'ErrorStreamSuite'\n\n\nALL_NON_FAST = [\n CMDLINE,\n SAMPLES,\n TYPESHED,\n PEP561,\n EVALUATION,\n DAEMON,\n STUBGEN_CMD,\n STUBGEN_PY,\n MYPYC_RUN,\n MYPYC_RUN_MULTI,\n MYPYC_EXTERNAL,\n MYPYC_COMMAND_LINE,\n ERROR_STREAM,\n]\n\n\n# These must be enabled by explicitly including 'mypyc-extra' on the command line.\nMYPYC_OPT_IN = [MYPYC_RUN, MYPYC_RUN_MULTI]\n\n# We split the pytest run into three parts to improve test\n# parallelization. Each run should have tests that each take a roughly similar\n# time to run.\ncmds = {\n # Self type check\n 'self': [executable, '-m', 'mypy', '--config-file', 'mypy_self_check.ini', '-p', 'mypy'],\n # Lint\n 'lint': ['flake8', '-j0'],\n # Fast test cases only (this is the bulk of the test suite)\n 'pytest-fast': ['pytest', '-q', '-k', 'not (%s)' % ' or '.join(ALL_NON_FAST)],\n # Test cases that invoke mypy (with small inputs)\n 'pytest-cmdline': ['pytest', '-q', '-k', ' or '.join([CMDLINE,\n EVALUATION,\n STUBGEN_CMD,\n STUBGEN_PY])],\n # Test cases that may take seconds to run each\n 'pytest-slow': ['pytest', '-q', '-k', ' or '.join(\n [SAMPLES,\n TYPESHED,\n PEP561,\n DAEMON,\n MYPYC_EXTERNAL,\n MYPYC_COMMAND_LINE,\n ERROR_STREAM])],\n # Test cases to run in typeshed CI\n 'typeshed-ci': ['pytest', '-q', '-k', ' or '.join([CMDLINE,\n EVALUATION,\n SAMPLES,\n TYPESHED])],\n # Mypyc tests that aren't run by default, since they are slow and rarely\n # fail for commits that don't touch mypyc\n 'mypyc-extra': ['pytest', '-q', '-k', ' or '.join(MYPYC_OPT_IN)],\n}\n\n# Stop run immediately if these commands fail\nFAST_FAIL = ['self', 'lint']\n\nDEFAULT_COMMANDS = [cmd for cmd in cmds if cmd not in ('mypyc-extra', 'typeshed-ci')]\n\nassert all(cmd in cmds for cmd in FAST_FAIL)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/runtests.py_run_cmd_wait_background_cmd.return.status": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/runtests.py_run_cmd_wait_background_cmd.return.status", "embedding": null, "metadata": {"file_path": "runtests.py", "file_name": "runtests.py", "file_type": "text/x-python", "category": "implementation", "start_line": 84, "end_line": 114, "span_ids": ["wait_background_cmd", "start_background_cmd", "run_cmd"], "tokens": 218}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def run_cmd(name: str) -> int:\n status = 0\n cmd = cmds[name]\n print('run %s: %s' % (name, cmd))\n proc = subprocess.run(cmd, stderr=subprocess.STDOUT)\n if proc.returncode:\n print('\\nFAILED: %s' % name)\n status = proc.returncode\n if name in FAST_FAIL:\n exit(status)\n return status\n\n\ndef start_background_cmd(name: str) -> Popen:\n cmd = cmds[name]\n proc = subprocess.Popen(cmd,\n stderr=subprocess.STDOUT,\n stdout=subprocess.PIPE)\n return proc\n\n\ndef wait_background_cmd(name: str, proc: Popen) -> int:\n output = proc.communicate()[0]\n status = proc.returncode\n print('run %s: %s' % (name, cmds[name]))\n if status:\n print(output.decode().rstrip())\n print('\\nFAILED: %s' % name)\n if name in FAST_FAIL:\n exit(status)\n return status", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/build_wheel.py__Script_to_build_compil_ROOT_DIR.os_path_dirname_os_path_d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/build_wheel.py__Script_to_build_compil_ROOT_DIR.os_path_dirname_os_path_d", "embedding": null, "metadata": {"file_path": "misc/build_wheel.py", "file_name": "build_wheel.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 36, "span_ids": ["docstring"], "tokens": 255}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Script to build compiled binary wheels that can be uploaded to PyPI.\n\nThe main GitHub workflow where this script is used:\nhttps://github.com/mypyc/mypy_mypyc-wheels/blob/master/.github/workflows/build.yml\n\nThis uses cibuildwheel (https://github.com/joerick/cibuildwheel) to\nbuild the wheels.\n\nUsage:\n\n build_wheel_ci.py --python-version \\\n --output-dir \n\nWheels for the given Python version will be created in the given directory.\nPython version is in form \"39\".\n\nThis works on macOS, Windows and Linux.\n\nYou can test locally by using --extra-opts. macOS example:\n\n mypy/misc/build_wheel_ci.py --python-version 39 --output-dir out --extra-opts=\"--platform macos\"\n\nOther supported values for platform: linux, windows\n\"\"\"\n\nimport argparse\nimport os\nimport subprocess\nimport sys\nfrom typing import Dict\n\n# Clang package we use on Linux\nLLVM_URL = 'https://github.com/mypyc/mypy_mypyc-wheels/releases/download/llvm/llvm-centos-5.tar.gz'\n\n# Mypy repository root\nROOT_DIR = os.path.dirname(os.path.dirname(__file__))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/build_wheel.py_create_environ_create_environ._the_venv_Ew_ew_ew_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/build_wheel.py_create_environ_create_environ._the_venv_Ew_ew_ew_", "embedding": null, "metadata": {"file_path": "misc/build_wheel.py", "file_name": "build_wheel.py", "file_type": "text/x-python", "category": "implementation", "start_line": 39, "end_line": 94, "span_ids": ["create_environ"], "tokens": 708}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def create_environ(python_version: str) -> Dict[str, str]:\n \"\"\"Set up environment variables for cibuildwheel.\"\"\"\n env = os.environ.copy()\n\n env['CIBW_BUILD'] = \"cp{}-*\".format(python_version)\n\n # Don't build 32-bit wheels\n env['CIBW_SKIP'] = \"*-manylinux_i686 *-win32\"\n\n # Apple Silicon support\n # When cross-compiling on Intel, it is not possible to test arm64 and \n # the arm64 part of a universal2 wheel. Warnings will be silenced with\n # following CIBW_TEST_SKIP\n env['CIBW_ARCHS_MACOS'] = \"x86_64 arm64\"\n env['CIBW_TEST_SKIP'] = \"*-macosx_arm64\"\n\n env['CIBW_BUILD_VERBOSITY'] = '1'\n\n # mypy's isolated builds don't specify the requirements mypyc needs, so install\n # requirements and don't use isolated builds. we need to use build-requirements.txt\n # with recent mypy commits to get stub packages needed for compilation.\n #\n # TODO: remove use of mypy-requirements.txt once we no longer need to support\n # building pre modular typeshed releases\n env['CIBW_BEFORE_BUILD'] = \"\"\"\n pip install -r {package}/mypy-requirements.txt &&\n (pip install -r {package}/build-requirements.txt || true)\n \"\"\".replace('\\n', ' ')\n\n # download a copy of clang to use to compile on linux. this was probably built in 2018,\n # speeds up compilation 2x\n env['CIBW_BEFORE_BUILD_LINUX'] = \"\"\"\n (cd / && curl -L %s | tar xzf -) &&\n pip install -r {package}/mypy-requirements.txt &&\n (pip install -r {package}/build-requirements.txt || true)\n \"\"\".replace('\\n', ' ') % LLVM_URL\n\n # the double negative is counterintuitive, https://github.com/pypa/pip/issues/5735\n env['CIBW_ENVIRONMENT'] = 'MYPY_USE_MYPYC=1 MYPYC_OPT_LEVEL=3 PIP_NO_BUILD_ISOLATION=no'\n env['CIBW_ENVIRONMENT_LINUX'] = (\n 'MYPY_USE_MYPYC=1 MYPYC_OPT_LEVEL=3 PIP_NO_BUILD_ISOLATION=no ' +\n 'CC=/opt/llvm/bin/clang'\n )\n env['CIBW_ENVIRONMENT_WINDOWS'] = (\n 'MYPY_USE_MYPYC=1 MYPYC_OPT_LEVEL=2 PIP_NO_BUILD_ISOLATION=no'\n )\n\n # lxml is slow to build wheels for new releases, so allow installing reqs to fail\n # if we failed to install lxml, we'll skip tests, but allow the build to succeed\n env['CIBW_BEFORE_TEST'] = (\n 'pip install -r {project}/mypy/test-requirements.txt || true'\n )\n\n # pytest looks for configuration files in the parent directories of where the tests live.\n # since we are trying to run the tests from their installed location, we copy those into\n # the venv. Ew ew ew.\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/build_wheel.py_create_environ.env_CIBW_TEST_COMMAND__create_environ.return.env": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/build_wheel.py_create_environ.env_CIBW_TEST_COMMAND__create_environ.return.env", "embedding": null, "metadata": {"file_path": "misc/build_wheel.py", "file_name": "build_wheel.py", "file_type": "text/x-python", "category": "implementation", "start_line": 95, "end_line": 116, "span_ids": ["create_environ"], "tokens": 340}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def create_environ(python_version: str) -> Dict[str, str]:\n # ... other code\n env['CIBW_TEST_COMMAND'] = \"\"\"\n ( ! pip list | grep lxml ) || (\n DIR=$(python -c 'import mypy, os; dn = os.path.dirname; print(dn(dn(mypy.__path__[0])))')\n && TEST_DIR=$(python -c 'import mypy.test; print(mypy.test.__path__[0])')\n && cp '{project}/mypy/pytest.ini' '{project}/mypy/conftest.py' $DIR\n && MYPY_TEST_PREFIX='{project}/mypy' pytest $TEST_DIR\n )\n \"\"\".replace('\\n', ' ')\n\n # i ran into some flaky tests on windows, so only run testcheck. it looks like we\n # previously didn't run any tests on windows wheels, so this is a net win.\n env['CIBW_TEST_COMMAND_WINDOWS'] = \"\"\"\n bash -c \"\n ( ! pip list | grep lxml ) || (\n DIR=$(python -c 'import mypy, os; dn = os.path.dirname; print(dn(dn(mypy.__path__[0])))')\n && TEST_DIR=$(python -c 'import mypy.test; print(mypy.test.__path__[0])')\n && cp '{project}/mypy/pytest.ini' '{project}/mypy/conftest.py' $DIR\n && MYPY_TEST_PREFIX='{project}/mypy' pytest $TEST_DIR/testcheck.py\n )\n \"\n \"\"\".replace('\\n', ' ')\n return env", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/build_wheel.py_main_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/build_wheel.py_main_", "embedding": null, "metadata": {"file_path": "misc/build_wheel.py", "file_name": "build_wheel.py", "file_type": "text/x-python", "category": "implementation", "start_line": 119, "end_line": 139, "span_ids": ["impl:5", "main"], "tokens": 188}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def main() -> None:\n parser = argparse.ArgumentParser()\n parser.add_argument('--python-version', required=True, metavar='XY',\n help='Python version (e.g. 38 or 39)')\n parser.add_argument('--output-dir', required=True, metavar='DIR',\n help='Output directory for created wheels')\n parser.add_argument('--extra-opts', default='', metavar='OPTIONS',\n help='Extra options passed to cibuildwheel verbatim')\n args = parser.parse_args()\n python_version = args.python_version\n output_dir = args.output_dir\n extra_opts = args.extra_opts\n environ = create_environ(python_version)\n script = 'python -m cibuildwheel {} --output-dir {} {}'.format(extra_opts, output_dir,\n ROOT_DIR)\n subprocess.check_call(script, shell=True, env=environ)\n\n\nif __name__ == '__main__':\n main()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/sync-typeshed.py__Sync_stdlib_stubs_from_check_state.if_out_.sys_exit_error_Output_o": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/sync-typeshed.py__Sync_stdlib_stubs_from_check_state.if_out_.sys_exit_error_Output_o", "embedding": null, "metadata": {"file_path": "misc/sync-typeshed.py", "file_name": "sync-typeshed.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 27, "span_ids": ["check_state", "docstring"], "tokens": 178}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Sync stdlib stubs from typeshed.\n\nUsage:\n\n python3 misc/sync-typeshed.py [--commit hash] [--typeshed-dir dir]\n\nBy default, sync to the latest typeshed commit.\n\"\"\"\n\nimport argparse\nimport glob\nimport os\nimport shutil\nimport subprocess\nimport sys\nimport tempfile\nimport textwrap\nfrom typing import Optional\n\n\ndef check_state() -> None:\n if not os.path.isfile('README.md'):\n sys.exit('error: The current working directory must be the mypy repository root')\n out = subprocess.check_output(['git', 'status', '-s', os.path.join('mypy', 'typeshed')])\n if out:\n # If there are local changes under mypy/typeshed, they would be lost.\n sys.exit('error: Output of \"git status -s mypy/typeshed\" must be empty')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/sync-typeshed.py_update_typeshed_git_head_commit.return.commit_strip_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/sync-typeshed.py_update_typeshed_git_head_commit.return.commit_strip_", "embedding": null, "metadata": {"file_path": "misc/sync-typeshed.py", "file_name": "sync-typeshed.py", "file_type": "text/x-python", "category": "implementation", "start_line": 30, "end_line": 50, "span_ids": ["update_typeshed", "git_head_commit"], "tokens": 206}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def update_typeshed(typeshed_dir: str, commit: Optional[str]) -> str:\n \"\"\"Update contents of local typeshed copy.\n\n Return the normalized typeshed commit hash.\n \"\"\"\n assert os.path.isdir(os.path.join(typeshed_dir, 'stdlib'))\n assert os.path.isdir(os.path.join(typeshed_dir, 'stubs'))\n if commit:\n subprocess.run(['git', 'checkout', commit], check=True, cwd=typeshed_dir)\n commit = git_head_commit(typeshed_dir)\n stub_dir = os.path.join('mypy', 'typeshed', 'stdlib')\n # Remove existing stubs.\n shutil.rmtree(stub_dir)\n # Copy new stdlib stubs.\n shutil.copytree(os.path.join(typeshed_dir, 'stdlib'), stub_dir)\n return commit\n\n\ndef git_head_commit(repo: str) -> str:\n commit = subprocess.check_output(['git', 'rev-parse', 'HEAD'], cwd=repo).decode('ascii')\n return commit.strip()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/sync-typeshed.py_main_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/misc/sync-typeshed.py_main_", "embedding": null, "metadata": {"file_path": "misc/sync-typeshed.py", "file_name": "sync-typeshed.py", "file_type": "text/x-python", "category": "implementation", "start_line": 53, "end_line": 97, "span_ids": ["impl", "main"], "tokens": 356}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def main() -> None:\n parser = argparse.ArgumentParser()\n parser.add_argument(\n \"--commit\", default=None,\n help=\"Typeshed commit (default to latest master if using a repository clone)\"\n )\n parser.add_argument(\n \"--typeshed-dir\", default=None,\n help=\"Location of typeshed (default to a temporary repository clone)\"\n )\n args = parser.parse_args()\n check_state()\n print('Update contents of mypy/typeshed/stdlib from typeshed? [yN] ', end='')\n answer = input()\n if answer.lower() != 'y':\n sys.exit('Aborting')\n\n if not args.typeshed_dir:\n # Clone typeshed repo if no directory given.\n with tempfile.TemporaryDirectory() as tempdir:\n print('Cloning typeshed in {}...'.format(tempdir))\n subprocess.run(['git', 'clone', 'https://github.com/python/typeshed.git'],\n check=True, cwd=tempdir)\n repo = os.path.join(tempdir, 'typeshed')\n commit = update_typeshed(repo, args.commit)\n else:\n commit = update_typeshed(args.typeshed_dir, args.commit)\n\n assert commit\n\n # Create a commit\n message = textwrap.dedent(\"\"\"\\\n Sync typeshed\n\n Source commit:\n https://github.com/python/typeshed/commit/{commit}\n \"\"\".format(commit=commit))\n subprocess.run(['git', 'add', '--all', os.path.join('mypy', 'typeshed')], check=True)\n subprocess.run(['git', 'commit', '-m', message], check=True)\n print('Created typeshed sync commit.')\n\n\nif __name__ == '__main__':\n main()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py__build__build.try_.finally_.if_os_path_isdir_options_.record_missing_stub_packa": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py__build__build.try_.finally_.if_os_path_isdir_options_.record_missing_stub_packa", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 195, "end_line": 273, "span_ids": ["_build"], "tokens": 627}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _build(sources: List[BuildSource],\n options: Options,\n alt_lib_path: Optional[str],\n flush_errors: Callable[[List[str], bool], None],\n fscache: Optional[FileSystemCache],\n stdout: TextIO,\n stderr: TextIO,\n extra_plugins: Sequence[Plugin],\n ) -> BuildResult:\n # This seems the most reasonable place to tune garbage collection.\n gc.set_threshold(150 * 1000)\n\n data_dir = default_data_dir()\n fscache = fscache or FileSystemCache()\n\n search_paths = compute_search_paths(sources, options, data_dir, alt_lib_path)\n\n reports = None\n if options.report_dirs:\n # Import lazily to avoid slowing down startup.\n from mypy.report import Reports # noqa\n reports = Reports(data_dir, options.report_dirs)\n\n source_set = BuildSourceSet(sources)\n cached_read = fscache.read\n errors = Errors(options.show_error_context,\n options.show_column_numbers,\n options.show_error_codes,\n options.pretty,\n lambda path: read_py_file(path, cached_read, options.python_version),\n options.show_absolute_path,\n options.enabled_error_codes,\n options.disabled_error_codes)\n plugin, snapshot = load_plugins(options, errors, stdout, extra_plugins)\n\n # Add catch-all .gitignore to cache dir if we created it\n cache_dir_existed = os.path.isdir(options.cache_dir)\n\n # Construct a build manager object to hold state during the build.\n #\n # Ignore current directory prefix in error messages.\n manager = BuildManager(data_dir, search_paths,\n ignore_prefix=os.getcwd(),\n source_set=source_set,\n reports=reports,\n options=options,\n version_id=__version__,\n plugin=plugin,\n plugins_snapshot=snapshot,\n errors=errors,\n flush_errors=flush_errors,\n fscache=fscache,\n stdout=stdout,\n stderr=stderr)\n manager.trace(repr(options))\n\n reset_global_state()\n try:\n graph = dispatch(sources, manager, stdout)\n if not options.fine_grained_incremental:\n TypeState.reset_all_subtype_caches()\n return BuildResult(manager, graph)\n finally:\n t0 = time.time()\n manager.metastore.commit()\n manager.add_stats(cache_commit_time=time.time() - t0)\n manager.log(\"Build finished in %.3f seconds with %d modules, and %d errors\" %\n (time.time() - manager.start_time,\n len(manager.modules),\n manager.errors.num_messages()))\n manager.dump_stats()\n if reports is not None:\n # Finish the HTML or XML reports even if CompileError was raised.\n reports.finish()\n if not cache_dir_existed and os.path.isdir(options.cache_dir):\n add_catch_all_gitignore(options.cache_dir)\n exclude_from_backups(options.cache_dir)\n if os.path.isdir(options.cache_dir):\n record_missing_stub_packages(options.cache_dir, manager.missing_stub_packages)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_BuildManager.__init___BuildManager.__init__._type_Dict_str_Tuple_M": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_BuildManager.__init___BuildManager.__init__._type_Dict_str_Tuple_M", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 568, "end_line": 656, "span_ids": ["BuildManager.__init__"], "tokens": 980}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BuildManager:\n\n def __init__(self, data_dir: str,\n search_paths: SearchPaths,\n ignore_prefix: str,\n source_set: BuildSourceSet,\n reports: 'Optional[Reports]',\n options: Options,\n version_id: str,\n plugin: Plugin,\n plugins_snapshot: Dict[str, str],\n errors: Errors,\n flush_errors: Callable[[List[str], bool], None],\n fscache: FileSystemCache,\n stdout: TextIO,\n stderr: TextIO,\n ) -> None:\n self.stats = {} # type: Dict[str, Any] # Values are ints or floats\n self.stdout = stdout\n self.stderr = stderr\n self.start_time = time.time()\n self.data_dir = data_dir\n self.errors = errors\n self.errors.set_ignore_prefix(ignore_prefix)\n self.search_paths = search_paths\n self.source_set = source_set\n self.reports = reports\n self.options = options\n self.version_id = version_id\n self.modules = {} # type: Dict[str, MypyFile]\n self.missing_modules = set() # type: Set[str]\n self.fg_deps_meta = {} # type: Dict[str, FgDepMeta]\n # fg_deps holds the dependencies of every module that has been\n # processed. We store this in BuildManager so that we can compute\n # dependencies as we go, which allows us to free ASTs and type information,\n # saving a ton of memory on net.\n self.fg_deps = {} # type: Dict[str, Set[str]]\n # Always convert the plugin to a ChainedPlugin so that it can be manipulated if needed\n if not isinstance(plugin, ChainedPlugin):\n plugin = ChainedPlugin(options, [plugin])\n self.plugin = plugin\n # Set of namespaces (module or class) that are being populated during semantic\n # analysis and may have missing definitions.\n self.incomplete_namespaces = set() # type: Set[str]\n self.semantic_analyzer = SemanticAnalyzer(\n self.modules,\n self.missing_modules,\n self.incomplete_namespaces,\n self.errors,\n self.plugin)\n self.all_types = {} # type: Dict[Expression, Type] # Enabled by export_types\n self.indirection_detector = TypeIndirectionVisitor()\n self.stale_modules = set() # type: Set[str]\n self.rechecked_modules = set() # type: Set[str]\n self.flush_errors = flush_errors\n has_reporters = reports is not None and reports.reporters\n self.cache_enabled = (options.incremental\n and (not options.fine_grained_incremental\n or options.use_fine_grained_cache)\n and not has_reporters)\n self.fscache = fscache\n self.find_module_cache = FindModuleCache(self.search_paths, self.fscache, self.options)\n self.metastore = create_metastore(options)\n\n # a mapping from source files to their corresponding shadow files\n # for efficient lookup\n self.shadow_map = {} # type: Dict[str, str]\n if self.options.shadow_file is not None:\n self.shadow_map = {source_file: shadow_file\n for (source_file, shadow_file)\n in self.options.shadow_file}\n # a mapping from each file being typechecked to its possible shadow file\n self.shadow_equivalence_map = {} # type: Dict[str, Optional[str]]\n self.plugin = plugin\n self.plugins_snapshot = plugins_snapshot\n self.old_plugins_snapshot = read_plugins_snapshot(self)\n self.quickstart_state = read_quickstart_file(options, self.stdout)\n # Fine grained targets (module top levels and top level functions) processed by\n # the semantic analyzer, used only for testing. Currently used only by the new\n # semantic analyzer.\n self.processed_targets = [] # type: List[str]\n # Missing stub packages encountered.\n self.missing_stub_packages = set() # type: Set[str]\n # Cache for mypy ASTs that have completed semantic analysis\n # pass 1. When multiple files are added to the build in a\n # single daemon increment, only one of the files gets added\n # per step and the others are discarded. This gets repeated\n # until all the files have been added. This means that a\n # new file can be processed O(n**2) times. This cache\n # avoids most of this redundant work.\n self.ast_cache = {} # type: Dict[str, Tuple[MypyFile, List[ErrorInfo]]]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.parse_file_State.parse_file.manager_ast_cache_self_id": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_State.parse_file_State.parse_file.manager_ast_cache_self_id", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1995, "end_line": 2072, "span_ids": ["State.parse_file"], "tokens": 681}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class State:\n\n def parse_file(self) -> None:\n \"\"\"Parse file and run first pass of semantic analysis.\n\n Everything done here is local to the file. Don't depend on imported\n modules in any way. Also record module dependencies based on imports.\n \"\"\"\n if self.tree is not None:\n # The file was already parsed (in __init__()).\n return\n\n manager = self.manager\n\n # Can we reuse a previously parsed AST? This avoids redundant work in daemon.\n cached = self.id in manager.ast_cache\n modules = manager.modules\n if not cached:\n manager.log(\"Parsing %s (%s)\" % (self.xpath, self.id))\n else:\n manager.log(\"Using cached AST for %s (%s)\" % (self.xpath, self.id))\n\n with self.wrap_context():\n source = self.source\n self.source = None # We won't need it again.\n if self.path and source is None:\n try:\n path = manager.maybe_swap_for_shadow_path(self.path)\n source = decode_python_encoding(manager.fscache.read(path),\n manager.options.python_version)\n self.source_hash = manager.fscache.hash_digest(path)\n except IOError as ioerr:\n # ioerr.strerror differs for os.stat failures between Windows and\n # other systems, but os.strerror(ioerr.errno) does not, so we use that.\n # (We want the error messages to be platform-independent so that the\n # tests have predictable output.)\n raise CompileError([\n \"mypy: can't read file '{}': {}\".format(\n self.path, os.strerror(ioerr.errno))],\n module_with_blocker=self.id) from ioerr\n except (UnicodeDecodeError, DecodeError) as decodeerr:\n if self.path.endswith('.pyd'):\n err = \"mypy: stubgen does not support .pyd files: '{}'\".format(self.path)\n else:\n err = \"mypy: can't decode file '{}': {}\".format(self.path, str(decodeerr))\n raise CompileError([err], module_with_blocker=self.id) from decodeerr\n else:\n assert source is not None\n self.source_hash = compute_hash(source)\n\n self.parse_inline_configuration(source)\n if not cached:\n self.tree = manager.parse_file(self.id, self.xpath, source,\n self.ignore_all or self.options.ignore_errors,\n self.options)\n\n else:\n # Reuse a cached AST\n self.tree = manager.ast_cache[self.id][0]\n manager.errors.set_file_ignored_lines(\n self.xpath,\n self.tree.ignored_lines,\n self.ignore_all or self.options.ignore_errors)\n\n if not cached:\n # Make a copy of any errors produced during parse time so that\n # fine-grained mode can repeat them when the module is\n # reprocessed.\n self.early_errors = list(manager.errors.error_info_map.get(self.xpath, []))\n else:\n self.early_errors = manager.ast_cache[self.id][1]\n\n modules[self.id] = self.tree\n\n if not cached:\n self.semantic_analysis_pass1()\n\n self.check_blockers()\n\n manager.ast_cache[self.id] = (self.tree, self.early_errors)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_topsort_topsort.assert_not_data_A_cycli": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_topsort_topsort.assert_not_data_A_cycli", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3227, "end_line": 3273, "span_ids": ["topsort"], "tokens": 362}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def topsort(data: Dict[AbstractSet[str],\n Set[AbstractSet[str]]]) -> Iterable[Set[AbstractSet[str]]]:\n \"\"\"Topological sort.\n\n Args:\n data: A map from SCCs (represented as frozen sets of strings) to\n sets of SCCs, its dependencies. NOTE: This data structure\n is modified in place -- for normalization purposes,\n self-dependencies are removed and entries representing\n orphans are added.\n\n Returns:\n An iterator yielding sets of SCCs that have an equivalent\n ordering. NOTE: The algorithm doesn't care about the internal\n structure of SCCs.\n\n Example:\n Suppose the input has the following structure:\n\n {A: {B, C}, B: {D}, C: {D}}\n\n This is normalized to:\n\n {A: {B, C}, B: {D}, C: {D}, D: {}}\n\n The algorithm will yield the following values:\n\n {D}\n {B, C}\n {A}\n\n From http://code.activestate.com/recipes/577413/.\n \"\"\"\n # TODO: Use a faster algorithm?\n for k, v in data.items():\n v.discard(k) # Ignore self dependencies.\n for item in set.union(*data.values()) - set(data.keys()):\n data[item] = set()\n while True:\n ready = {item for item, dep in data.items() if not dep}\n if not ready:\n break\n yield ready\n data = {item: (dep - ready)\n for item, dep in data.items()\n if item not in ready}\n assert not data, \"A cyclic dependency exists amongst %r\" % data", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_missing_stubs_file_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/build.py_missing_stubs_file_", "embedding": null, "metadata": {"file_path": "mypy/build.py", "file_name": "build.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3276, "end_line": 3294, "span_ids": ["missing_stubs_file", "record_missing_stub_packages"], "tokens": 149}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def missing_stubs_file(cache_dir: str) -> str:\n return os.path.join(cache_dir, 'missing_stubs')\n\n\ndef record_missing_stub_packages(cache_dir: str, missing_stub_packages: Set[str]) -> None:\n \"\"\"Write a file containing missing stub packages.\n\n This allows a subsequent \"mypy --install-types\" run (without other arguments)\n to install missing stub packages.\n \"\"\"\n fnam = missing_stubs_file(cache_dir)\n if missing_stub_packages:\n with open(fnam, 'w') as f:\n for pkg in sorted(missing_stub_packages):\n f.write('%s\\n' % pkg)\n else:\n if os.path.isfile(fnam):\n os.remove(fnam)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py__Mypy_type_checker__from_mypy_maptype_import_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py__Mypy_type_checker__from_mypy_maptype_import_", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 63, "span_ids": ["imports:13", "docstring"], "tokens": 744}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Mypy type checker.\"\"\"\n\nimport itertools\nimport fnmatch\nfrom contextlib import contextmanager\n\nfrom typing import (\n Any, Dict, Set, List, cast, Tuple, TypeVar, Union, Optional, NamedTuple, Iterator,\n Iterable, Sequence, Mapping, Generic, AbstractSet, Callable\n)\nfrom typing_extensions import Final\n\nfrom mypy.errors import Errors, report_internal_error\nfrom mypy.nodes import (\n SymbolTable, Statement, MypyFile, Var, Expression, Lvalue, Node,\n OverloadedFuncDef, FuncDef, FuncItem, FuncBase, TypeInfo,\n ClassDef, Block, AssignmentStmt, NameExpr, MemberExpr, IndexExpr,\n TupleExpr, ListExpr, ExpressionStmt, ReturnStmt, IfStmt,\n WhileStmt, OperatorAssignmentStmt, WithStmt, AssertStmt,\n RaiseStmt, TryStmt, ForStmt, DelStmt, CallExpr, IntExpr, StrExpr,\n UnicodeExpr, OpExpr, UnaryExpr, LambdaExpr, TempNode, SymbolTableNode,\n Context, Decorator, PrintStmt, BreakStmt, PassStmt, ContinueStmt,\n ComparisonExpr, StarExpr, EllipsisExpr, RefExpr, PromoteExpr,\n Import, ImportFrom, ImportAll, ImportBase, TypeAlias,\n ARG_POS, ARG_STAR, LITERAL_TYPE, MDEF, GDEF,\n CONTRAVARIANT, COVARIANT, INVARIANT, TypeVarExpr, AssignmentExpr,\n is_final_node,\n ARG_NAMED)\nfrom mypy import nodes\nfrom mypy.literals import literal, literal_hash, Key\nfrom mypy.typeanal import has_any_from_unimported_type, check_for_explicit_any\nfrom mypy.types import (\n Type, AnyType, CallableType, FunctionLike, Overloaded, TupleType, TypedDictType,\n Instance, NoneType, strip_type, TypeType, TypeOfAny,\n UnionType, TypeVarId, TypeVarType, PartialType, DeletedType, UninhabitedType, TypeVarDef,\n is_named_instance, union_items, TypeQuery, LiteralType,\n is_optional, remove_optional, TypeTranslator, StarType, get_proper_type, ProperType,\n get_proper_types, is_literal_type, TypeAliasType, TypeGuardType)\nfrom mypy.sametypes import is_same_type\nfrom mypy.messages import (\n MessageBuilder, make_inferred_type_note, append_invariance_notes, pretty_seq,\n format_type, format_type_bare, format_type_distinctly, SUGGESTED_TEST_FIXTURES\n)\nimport mypy.checkexpr\nfrom mypy.checkmember import (\n analyze_member_access, analyze_descriptor_access, type_object_type,\n)\nfrom mypy.typeops import (\n map_type_from_supertype, bind_self, erase_to_bound, make_simplified_union,\n erase_def_to_union_or_bound, erase_to_union_or_bound, coerce_to_literal,\n try_getting_str_literals_from_type, try_getting_int_literals_from_type,\n tuple_fallback, is_singleton_type, try_expanding_enum_to_union,\n true_only, false_only, function_type, get_type_vars, custom_special_method,\n is_literal_type_like,\n)\nfrom mypy import message_registry\nfrom mypy.subtypes import (\n is_subtype, is_equivalent, is_proper_subtype, is_more_precise,\n restrict_subtype_away, is_subtype_ignoring_tvars, is_callable_compatible,\n unify_generic_callable, find_member\n)\nfrom mypy.constraints import SUPERTYPE_OF\nfrom mypy.maptype import map_instance_to_supertype", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_from_mypy_typevars_import_PartialTypeScope.NamedTuple_PartialTypeSc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_from_mypy_typevars_import_PartialTypeScope.NamedTuple_PartialTypeSc", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 64, "end_line": 142, "span_ids": ["imports:13", "impl:7"], "tokens": 791}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from mypy.typevars import fill_typevars, has_no_typevars, fill_typevars_with_any\nfrom mypy.semanal import set_callable_name, refers_to_fullname\nfrom mypy.mro import calculate_mro, MroError\nfrom mypy.erasetype import erase_typevars, remove_instance_last_known_values, erase_type\nfrom mypy.expandtype import expand_type, expand_type_by_instance\nfrom mypy.visitor import NodeVisitor\nfrom mypy.join import join_types\nfrom mypy.treetransform import TransformVisitor\nfrom mypy.binder import ConditionalTypeBinder, get_declaration\nfrom mypy.meet import is_overlapping_erased_types, is_overlapping_types\nfrom mypy.options import Options\nfrom mypy.plugin import Plugin, CheckerPluginInterface\nfrom mypy.sharedparse import BINARY_MAGIC_METHODS\nfrom mypy.scope import Scope\nfrom mypy import state, errorcodes as codes\nfrom mypy.traverser import has_return_statement, all_return_statements\nfrom mypy.errorcodes import ErrorCode\nfrom mypy.util import is_typeshed_file\n\nT = TypeVar('T')\n\nDEFAULT_LAST_PASS = 1 # type: Final # Pass numbers start at 0\n\nDeferredNodeType = Union[FuncDef, LambdaExpr, OverloadedFuncDef, Decorator]\nFineGrainedDeferredNodeType = Union[FuncDef, MypyFile, OverloadedFuncDef]\n\n# A node which is postponed to be processed during the next pass.\n# In normal mode one can defer functions and methods (also decorated and/or overloaded)\n# and lambda expressions. Nested functions can't be deferred -- only top-level functions\n# and methods of classes not defined within a function can be deferred.\nDeferredNode = NamedTuple(\n 'DeferredNode',\n [\n ('node', DeferredNodeType),\n ('active_typeinfo', Optional[TypeInfo]), # And its TypeInfo (for semantic analysis\n # self type handling)\n ])\n\n# Same as above, but for fine-grained mode targets. Only top-level functions/methods\n# and module top levels are allowed as such.\nFineGrainedDeferredNode = NamedTuple(\n 'FineGrainedDeferredNode',\n [\n ('node', FineGrainedDeferredNodeType),\n ('active_typeinfo', Optional[TypeInfo]),\n ])\n\n# Data structure returned by find_isinstance_check representing\n# information learned from the truth or falsehood of a condition. The\n# dict maps nodes representing expressions like 'a[0].x' to their\n# refined types under the assumption that the condition has a\n# particular truth value. A value of None means that the condition can\n# never have that truth value.\n\n# NB: The keys of this dict are nodes in the original source program,\n# which are compared by reference equality--effectively, being *the\n# same* expression of the program, not just two identical expressions\n# (such as two references to the same variable). TODO: it would\n# probably be better to have the dict keyed by the nodes' literal_hash\n# field instead.\n\nTypeMap = Optional[Dict[Expression, Type]]\n\n# An object that represents either a precise type or a type with an upper bound;\n# it is important for correct type inference with isinstance.\nTypeRange = NamedTuple(\n 'TypeRange',\n [\n ('item', Type),\n ('is_upper_bound', bool), # False => precise type\n ])\n\n# Keeps track of partial types in a single scope. In fine-grained incremental\n# mode partial types initially defined at the top level cannot be completed in\n# a function, and we use the 'is_function' attribute to enforce this.\nPartialTypeScope = NamedTuple('PartialTypeScope', [('map', Dict[Var, Context]),\n ('is_function', bool),\n ('is_local', bool),\n ])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_member_assignment_TypeChecker.check_member_assignment._And_now_we_in_fact_type": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_member_assignment_TypeChecker.check_member_assignment._And_now_we_in_fact_type", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2988, "end_line": 3059, "span_ids": ["TypeChecker.check_member_assignment"], "tokens": 782}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def check_member_assignment(self, instance_type: Type, attribute_type: Type,\n rvalue: Expression, context: Context) -> Tuple[Type, Type, bool]:\n \"\"\"Type member assignment.\n\n This defers to check_simple_assignment, unless the member expression\n is a descriptor, in which case this checks descriptor semantics as well.\n\n Return the inferred rvalue_type, inferred lvalue_type, and whether to use the binder\n for this assignment.\n\n Note: this method exists here and not in checkmember.py, because we need to take\n care about interaction between binder and __set__().\n \"\"\"\n instance_type = get_proper_type(instance_type)\n attribute_type = get_proper_type(attribute_type)\n # Descriptors don't participate in class-attribute access\n if ((isinstance(instance_type, FunctionLike) and instance_type.is_type_obj()) or\n isinstance(instance_type, TypeType)):\n rvalue_type = self.check_simple_assignment(attribute_type, rvalue, context,\n code=codes.ASSIGNMENT)\n return rvalue_type, attribute_type, True\n\n if not isinstance(attribute_type, Instance):\n # TODO: support __set__() for union types.\n rvalue_type = self.check_simple_assignment(attribute_type, rvalue, context,\n code=codes.ASSIGNMENT)\n return rvalue_type, attribute_type, True\n\n get_type = analyze_descriptor_access(\n instance_type, attribute_type, self.named_type,\n self.msg, context, chk=self)\n if not attribute_type.type.has_readable_member('__set__'):\n # If there is no __set__, we type-check that the assigned value matches\n # the return type of __get__. This doesn't match the python semantics,\n # (which allow you to override the descriptor with any value), but preserves\n # the type of accessing the attribute (even after the override).\n rvalue_type = self.check_simple_assignment(get_type, rvalue, context,\n code=codes.ASSIGNMENT)\n return rvalue_type, get_type, True\n\n dunder_set = attribute_type.type.get_method('__set__')\n if dunder_set is None:\n self.msg.fail(message_registry.DESCRIPTOR_SET_NOT_CALLABLE.format(attribute_type),\n context)\n return AnyType(TypeOfAny.from_error), get_type, False\n\n function = function_type(dunder_set, self.named_type('builtins.function'))\n bound_method = bind_self(function, attribute_type)\n typ = map_instance_to_supertype(attribute_type, dunder_set.info)\n dunder_set_type = expand_type_by_instance(bound_method, typ)\n\n callable_name = self.expr_checker.method_fullname(attribute_type, \"__set__\")\n dunder_set_type = self.expr_checker.transform_callee_type(\n callable_name, dunder_set_type,\n [TempNode(instance_type, context=context), rvalue],\n [nodes.ARG_POS, nodes.ARG_POS],\n context, object_type=attribute_type,\n )\n\n # For non-overloaded setters, the result should be type-checked like a regular assignment.\n # Hence, we first only try to infer the type by using the rvalue as type context.\n type_context = rvalue\n self.msg.disable_errors()\n _, inferred_dunder_set_type = self.expr_checker.check_call(\n dunder_set_type,\n [TempNode(instance_type, context=context), type_context],\n [nodes.ARG_POS, nodes.ARG_POS],\n context, object_type=attribute_type,\n callable_name=callable_name)\n self.msg.enable_errors()\n\n # And now we in fact type check the call, to show errors related to wrong arguments\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_member_assignment._count_etc_replacing__TypeChecker.check_member_assignment.return.rvalue_type_if_infer_else": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.check_member_assignment._count_etc_replacing__TypeChecker.check_member_assignment.return.rvalue_type_if_infer_else", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3060, "end_line": 3084, "span_ids": ["TypeChecker.check_member_assignment"], "tokens": 386}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def check_member_assignment(self, instance_type: Type, attribute_type: Type,\n rvalue: Expression, context: Context) -> Tuple[Type, Type, bool]:\n # count, etc., replacing the type context for non-overloaded setters only.\n inferred_dunder_set_type = get_proper_type(inferred_dunder_set_type)\n if isinstance(inferred_dunder_set_type, CallableType):\n type_context = TempNode(AnyType(TypeOfAny.special_form), context=context)\n self.expr_checker.check_call(\n dunder_set_type,\n [TempNode(instance_type, context=context), type_context],\n [nodes.ARG_POS, nodes.ARG_POS],\n context, object_type=attribute_type,\n callable_name=callable_name)\n\n # In the following cases, a message already will have been recorded in check_call.\n if ((not isinstance(inferred_dunder_set_type, CallableType)) or\n (len(inferred_dunder_set_type.arg_types) < 2)):\n return AnyType(TypeOfAny.from_error), get_type, False\n\n set_type = inferred_dunder_set_type.arg_types[1]\n # Special case: if the rvalue_type is a subtype of both '__get__' and '__set__' types,\n # and '__get__' type is narrower than '__set__', then we invoke the binder to narrow type\n # by this assignment. Technically, this is not safe, but in practice this is\n # what a user expects.\n rvalue_type = self.check_simple_assignment(set_type, rvalue, context,\n code=codes.ASSIGNMENT)\n infer = is_subtype(rvalue_type, get_type) and is_subtype(get_type, set_type)\n return rvalue_type if infer else set_type, get_type, infer", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.find_isinstance_check_helper_TypeChecker.find_isinstance_check_helper.if_is_true_literal_node_.elif_isinstance_node_Cal.if_refers_to_fullname_nod.elif_isinstance_node_call.if_node_callee_type_guard.if_literal_expr_LITER.return._expr_TypeGuardType_node": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.find_isinstance_check_helper_TypeChecker.find_isinstance_check_helper.if_is_true_literal_node_.elif_isinstance_node_Cal.if_refers_to_fullname_nod.elif_isinstance_node_call.if_node_callee_type_guard.if_literal_expr_LITER.return._expr_TypeGuardType_node", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3976, "end_line": 4013, "span_ids": ["TypeChecker.find_isinstance_check_helper"], "tokens": 426}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def find_isinstance_check_helper(self, node: Expression) -> Tuple[TypeMap, TypeMap]:\n type_map = self.type_map\n if is_true_literal(node):\n return {}, None\n elif is_false_literal(node):\n return None, {}\n elif isinstance(node, CallExpr):\n if len(node.args) == 0:\n return {}, {}\n expr = collapse_walrus(node.args[0])\n if refers_to_fullname(node.callee, 'builtins.isinstance'):\n if len(node.args) != 2: # the error will be reported elsewhere\n return {}, {}\n if literal(expr) == LITERAL_TYPE:\n return self.conditional_type_map_with_intersection(\n expr,\n type_map[expr],\n get_isinstance_type(node.args[1], type_map),\n )\n elif refers_to_fullname(node.callee, 'builtins.issubclass'):\n if len(node.args) != 2: # the error will be reported elsewhere\n return {}, {}\n if literal(expr) == LITERAL_TYPE:\n return self.infer_issubclass_maps(node, expr, type_map)\n elif refers_to_fullname(node.callee, 'builtins.callable'):\n if len(node.args) != 1: # the error will be reported elsewhere\n return {}, {}\n if literal(expr) == LITERAL_TYPE:\n vartype = type_map[expr]\n return self.conditional_callable_type_map(expr, vartype)\n elif isinstance(node.callee, RefExpr):\n if node.callee.type_guard is not None:\n # TODO: Follow keyword args or *args, **kwargs\n if node.arg_kinds[0] != nodes.ARG_POS:\n self.fail(\"Type guard requires positional argument\", node)\n return {}, {}\n if literal(expr) == LITERAL_TYPE:\n return {expr: TypeGuardType(node.callee.type_guard)}, {}\n # ... other code\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_call_expr_inner.None_5_ExpressionChecker.visit_call_expr_inner.return.ret_type": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checkexpr.py_ExpressionChecker.visit_call_expr_inner.None_5_ExpressionChecker.visit_call_expr_inner.return.ret_type", "embedding": null, "metadata": {"file_path": "mypy/checkexpr.py", "file_name": "checkexpr.py", "file_type": "text/x-python", "category": "implementation", "start_line": 334, "end_line": 371, "span_ids": ["ExpressionChecker.visit_call_expr_inner"], "tokens": 506}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ExpressionChecker(ExpressionVisitor[Type]):\n\n def visit_call_expr_inner(self, e: CallExpr, allow_none_return: bool = False) -> Type:\n # ... other code\n if isinstance(e.callee, RefExpr):\n # There are two special cases where plugins might act:\n # * A \"static\" reference/alias to a class or function;\n # get_function_hook() will be invoked for these.\n fullname = e.callee.fullname\n if isinstance(e.callee.node, TypeAlias):\n target = get_proper_type(e.callee.node.target)\n if isinstance(target, Instance):\n fullname = target.type.fullname\n # * Call to a method on object that has a full name (see\n # method_fullname() for details on supported objects);\n # get_method_hook() and get_method_signature_hook() will\n # be invoked for these.\n if (fullname is None\n and isinstance(e.callee, MemberExpr)\n and e.callee.expr in self.chk.type_map):\n member = e.callee.name\n object_type = self.chk.type_map[e.callee.expr]\n ret_type = self.check_call_expr_with_callee_type(callee_type, e, fullname,\n object_type, member)\n if isinstance(e.callee, RefExpr) and len(e.args) == 2:\n if e.callee.fullname in ('builtins.isinstance', 'builtins.issubclass'):\n self.check_runtime_protocol_test(e)\n if e.callee.fullname == 'builtins.issubclass':\n self.check_protocol_issubclass(e)\n if isinstance(e.callee, MemberExpr) and e.callee.name == 'format':\n self.check_str_format_call(e)\n ret_type = get_proper_type(ret_type)\n if isinstance(ret_type, UninhabitedType) and not ret_type.ambiguous:\n self.chk.binder.unreachable()\n # Warn on calls to functions that always return None. The check\n # of ret_type is both a common-case optimization and prevents reporting\n # the error in dynamic functions (where it will be Any).\n if (not allow_none_return and isinstance(ret_type, NoneType)\n and self.always_returns_none(e.callee)):\n self.chk.msg.does_not_return_value(callee_type, e)\n return AnyType(TypeOfAny.from_error)\n return ret_type", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_CONNECTION_NAME_process_start_options.return.options": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_CONNECTION_NAME_process_start_options.return.options", "embedding": null, "metadata": {"file_path": "mypy/dmypy_server.py", "file_name": "dmypy_server.py", "file_type": "text/x-python", "category": "implementation", "start_line": 130, "end_line": 146, "span_ids": ["docstring:3", "process_start_options"], "tokens": 172}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "CONNECTION_NAME = 'dmypy' # type: Final\n\n\ndef process_start_options(flags: List[str], allow_sources: bool) -> Options:\n _, options = mypy.main.process_options(\n ['-i'] + flags, require_targets=False, server_options=True\n )\n if options.report_dirs:\n sys.exit(\"dmypy: start/restart cannot generate reports\")\n if options.junit_xml:\n sys.exit(\"dmypy: start/restart does not support --junit-xml; \"\n \"pass it to check/recheck instead\")\n if not options.incremental:\n sys.exit(\"dmypy: start/restart should not disable incremental mode\")\n if options.follow_imports not in ('skip', 'error', 'normal'):\n sys.exit(\"dmypy: follow-imports=silent not supported\")\n return options", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_ignore_suppressed_imports_ChangesAndRemovals.Tuple_ModulePathPairs_Mo": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_ignore_suppressed_imports_ChangesAndRemovals.Tuple_ModulePathPairs_Mo", "embedding": null, "metadata": {"file_path": "mypy/dmypy_server.py", "file_name": "dmypy_server.py", "file_type": "text/x-python", "category": "implementation", "start_line": 149, "end_line": 159, "span_ids": ["ignore_suppressed_imports", "impl:7"], "tokens": 121}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def ignore_suppressed_imports(module: str) -> bool:\n \"\"\"Can we skip looking for newly unsuppressed imports to module?\"\"\"\n # Various submodules of 'encodings' can be suppressed, since it\n # uses module-level '__getattr__'. Skip them since there are many\n # of them, and following imports to them is kind of pointless.\n return module.startswith('encodings.')\n\n\nModulePathPair = Tuple[str, str]\nModulePathPairs = List[ModulePathPair]\nChangesAndRemovals = Tuple[ModulePathPairs, ModulePathPairs]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server.check_Server.check.return.res": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server.check_Server.check.return.res", "embedding": null, "metadata": {"file_path": "mypy/dmypy_server.py", "file_name": "dmypy_server.py", "file_type": "text/x-python", "category": "implementation", "start_line": 380, "end_line": 397, "span_ids": ["Server.check"], "tokens": 195}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Server:\n\n # NOTE: the instance is constructed in the parent process but\n\n def check(self, sources: List[BuildSource],\n is_tty: bool, terminal_width: int) -> Dict[str, Any]:\n \"\"\"Check using fine-grained incremental mode.\n\n If is_tty is True format the output nicely with colors and summary line\n (unless disabled in self.options). Also pass the terminal_width to formatter.\n \"\"\"\n if not self.fine_grained_manager:\n res = self.initialize_fine_grained(sources, is_tty, terminal_width)\n else:\n if not self.following_imports():\n messages = self.fine_grained_increment(sources)\n else:\n messages = self.fine_grained_increment_follow_imports(sources)\n res = self.increment_output(messages, sources, is_tty, terminal_width)\n self.flush_caches()\n self.update_stats(res)\n return res", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server.flush_caches_Server.following_imports.return.self_options_follow_impor": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server.flush_caches_Server.following_imports.return.self_options_follow_impor", "embedding": null, "metadata": {"file_path": "mypy/dmypy_server.py", "file_name": "dmypy_server.py", "file_type": "text/x-python", "category": "implementation", "start_line": 399, "end_line": 414, "span_ids": ["Server.flush_caches", "Server.following_imports", "Server.update_stats"], "tokens": 145}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Server:\n\n # NOTE: the instance is constructed in the parent process but\n\n def flush_caches(self) -> None:\n self.fscache.flush()\n if self.fine_grained_manager:\n self.fine_grained_manager.flush_cache()\n\n def update_stats(self, res: Dict[str, Any]) -> None:\n if self.fine_grained_manager:\n manager = self.fine_grained_manager.manager\n manager.dump_stats()\n res['stats'] = manager.stats\n manager.stats = {}\n\n def following_imports(self) -> bool:\n \"\"\"Are we following imports?\"\"\"\n # TODO: What about silent?\n return self.options.follow_imports == 'normal'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server.find_reachable_changed_modules_Server.direct_imports.return._BuildSource_graph_dep_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server.find_reachable_changed_modules_Server.direct_imports.return._BuildSource_graph_dep_p", "embedding": null, "metadata": {"file_path": "mypy/dmypy_server.py", "file_name": "dmypy_server.py", "file_type": "text/x-python", "category": "implementation", "start_line": 658, "end_line": 706, "span_ids": ["Server.find_reachable_changed_modules", "Server.direct_imports"], "tokens": 412}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Server:\n\n # NOTE: the instance is constructed in the parent process but\n\n def find_reachable_changed_modules(\n self,\n roots: List[BuildSource],\n graph: mypy.build.Graph,\n seen: Set[str],\n changed_paths: AbstractSet[str]) -> Tuple[List[Tuple[str, str]],\n List[BuildSource]]:\n \"\"\"Follow imports within graph from given sources until hitting changed modules.\n\n If we find a changed module, we can't continue following imports as the imports\n may have changed.\n\n Args:\n roots: modules where to start search from\n graph: module graph to use for the search\n seen: modules we've seen before that won't be visited (mutated here!!)\n changed_paths: which paths have changed (stop search here and return any found)\n\n Return (encountered reachable changed modules,\n unchanged files not in sources_set traversed).\n \"\"\"\n changed = []\n new_files = []\n worklist = roots[:]\n seen.update(source.module for source in worklist)\n while worklist:\n nxt = worklist.pop()\n if nxt.module not in seen:\n seen.add(nxt.module)\n new_files.append(nxt)\n if nxt.path in changed_paths:\n assert nxt.path is not None # TODO\n changed.append((nxt.module, nxt.path))\n elif nxt.module in graph:\n state = graph[nxt.module]\n for dep in state.dependencies:\n if dep not in seen:\n seen.add(dep)\n worklist.append(BuildSource(graph[dep].path,\n graph[dep].id))\n return changed, new_files\n\n def direct_imports(self,\n module: Tuple[str, str],\n graph: mypy.build.Graph) -> List[BuildSource]:\n \"\"\"Return the direct imports of module not included in seen.\"\"\"\n state = graph[module[0]]\n return [BuildSource(graph[dep].path, dep)\n for dep in state.dependencies]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server.find_added_suppressed_Server.find_added_suppressed.return.found": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_Server.find_added_suppressed_Server.find_added_suppressed.return.found", "embedding": null, "metadata": {"file_path": "mypy/dmypy_server.py", "file_name": "dmypy_server.py", "file_type": "text/x-python", "category": "implementation", "start_line": 708, "end_line": 755, "span_ids": ["Server.find_added_suppressed"], "tokens": 402}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Server:\n\n # NOTE: the instance is constructed in the parent process but\n\n def find_added_suppressed(self,\n graph: mypy.build.Graph,\n seen: Set[str],\n search_paths: SearchPaths) -> List[Tuple[str, str]]:\n \"\"\"Find suppressed modules that have been added (and not included in seen).\n\n Args:\n seen: reachable modules we've seen before (mutated here!!)\n\n Return suppressed, added modules.\n \"\"\"\n all_suppressed = set()\n for state in graph.values():\n all_suppressed |= state.suppressed_set\n\n # Filter out things that shouldn't actually be considered suppressed.\n #\n # TODO: Figure out why these are treated as suppressed\n all_suppressed = {module\n for module in all_suppressed\n if module not in graph and not ignore_suppressed_imports(module)}\n\n # Optimization: skip top-level packages that are obviously not\n # there, to avoid calling the relatively slow find_module()\n # below too many times.\n packages = {module.split('.', 1)[0] for module in all_suppressed}\n packages = filter_out_missing_top_level_packages(packages, search_paths, self.fscache)\n\n # TODO: Namespace packages\n\n finder = FindModuleCache(search_paths, self.fscache, self.options)\n\n found = []\n\n for module in all_suppressed:\n top_level_pkg = module.split('.', 1)[0]\n if top_level_pkg not in packages:\n # Fast path: non-existent top-level package\n continue\n result = finder.find_module(module, fast_path=True)\n if isinstance(result, str) and module not in seen:\n # When not following imports, we only follow imports to .pyi files.\n if not self.following_imports() and not result.endswith('.pyi'):\n continue\n found.append((module, result))\n seen.add(module)\n\n return found", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_find_all_sources_in_build_fix_module_deps.for_module_state_in_grap.state.suppressed_set.set_new_suppressed_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_find_all_sources_in_build_fix_module_deps.for_module_state_in_grap.state.suppressed_set.set_new_suppressed_", "embedding": null, "metadata": {"file_path": "mypy/dmypy_server.py", "file_name": "dmypy_server.py", "file_type": "text/x-python", "category": "implementation", "start_line": 902, "end_line": 929, "span_ids": ["find_all_sources_in_build", "fix_module_deps"], "tokens": 226}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def find_all_sources_in_build(graph: mypy.build.Graph,\n extra: Sequence[BuildSource] = ()) -> List[BuildSource]:\n result = list(extra)\n seen = set(source.module for source in result)\n for module, state in graph.items():\n if module not in seen:\n result.append(BuildSource(state.path, module))\n return result\n\n\ndef fix_module_deps(graph: mypy.build.Graph) -> None:\n \"\"\"After an incremental update, update module dependencies to reflect the new state.\n\n This can make some suppressed dependencies non-suppressed, and vice versa (if modules\n have been added to or removed from the build).\n \"\"\"\n for module, state in graph.items():\n new_suppressed = []\n new_dependencies = []\n for dep in state.dependencies + state.suppressed:\n if dep in graph:\n new_dependencies.append(dep)\n else:\n new_suppressed.append(dep)\n state.dependencies = new_dependencies\n state.dependencies_set = set(new_dependencies)\n state.suppressed = new_suppressed\n state.suppressed_set = set(new_suppressed)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_filter_out_missing_top_level_packages_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/dmypy_server.py_filter_out_missing_top_level_packages_", "embedding": null, "metadata": {"file_path": "mypy/dmypy_server.py", "file_name": "dmypy_server.py", "file_type": "text/x-python", "category": "implementation", "start_line": 932, "end_line": 969, "span_ids": ["filter_out_missing_top_level_packages"], "tokens": 297}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def filter_out_missing_top_level_packages(packages: Set[str],\n search_paths: SearchPaths,\n fscache: FileSystemCache) -> Set[str]:\n \"\"\"Quickly filter out obviously missing top-level packages.\n\n Return packages with entries that can't be found removed.\n\n This is approximate: some packages that aren't actually valid may be\n included. However, all potentially valid packages must be returned.\n \"\"\"\n # Start with a empty set and add all potential top-level packages.\n found = set()\n paths = (\n search_paths.python_path + search_paths.mypy_path + search_paths.package_path +\n search_paths.typeshed_path\n )\n paths += tuple(os.path.join(p, '@python2') for p in search_paths.typeshed_path)\n for p in paths:\n try:\n entries = fscache.listdir(p)\n except Exception:\n entries = []\n for entry in entries:\n # The code is hand-optimized for mypyc since this may be somewhat\n # performance-critical.\n if entry.endswith('.py'):\n entry = entry[:-3]\n elif entry.endswith('.pyi'):\n entry = entry[:-4]\n elif entry.endswith('-stubs'):\n # Possible PEP 561 stub package\n entry = entry[:-6]\n if entry.endswith('-python2'):\n entry = entry[:-8]\n if entry in packages:\n found.add(entry)\n return found", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/find_sources.py__Routines_for_finding_t_InvalidSourceList._Exception_indicating_a": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/find_sources.py__Routines_for_finding_t_InvalidSourceList._Exception_indicating_a", "embedding": null, "metadata": {"file_path": "mypy/find_sources.py", "file_name": "find_sources.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 17, "span_ids": ["InvalidSourceList", "docstring"], "tokens": 111}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Routines for finding the sources that mypy will check\"\"\"\n\nimport functools\nimport os\n\nfrom typing import List, Sequence, Set, Tuple, Optional\nfrom typing_extensions import Final\n\nfrom mypy.modulefinder import BuildSource, PYTHON_EXTENSIONS, mypy_path, matches_exclude\nfrom mypy.fscache import FileSystemCache\nfrom mypy.options import Options\n\nPY_EXTENSIONS = tuple(PYTHON_EXTENSIONS) # type: Final\n\n\nclass InvalidSourceList(Exception):\n \"\"\"Exception indicating a problem in the list of sources given to mypy.\"\"\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/find_sources.py_create_source_list_create_source_list.return.sources": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/find_sources.py_create_source_list_create_source_list.return.sources", "embedding": null, "metadata": {"file_path": "mypy/find_sources.py", "file_name": "find_sources.py", "file_type": "text/x-python", "category": "implementation", "start_line": 20, "end_line": 47, "span_ids": ["create_source_list"], "tokens": 259}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def create_source_list(paths: Sequence[str], options: Options,\n fscache: Optional[FileSystemCache] = None,\n allow_empty_dir: bool = False) -> List[BuildSource]:\n \"\"\"From a list of source files/directories, makes a list of BuildSources.\n\n Raises InvalidSourceList on errors.\n \"\"\"\n fscache = fscache or FileSystemCache()\n finder = SourceFinder(fscache, options)\n\n sources = []\n for path in paths:\n path = os.path.normpath(path)\n if path.endswith(PY_EXTENSIONS):\n # Can raise InvalidSourceList if a directory doesn't have a valid module name.\n name, base_dir = finder.crawl_up(path)\n sources.append(BuildSource(path, name, None, base_dir))\n elif fscache.isdir(path):\n sub_sources = finder.find_sources_in_dir(path)\n if not sub_sources and not allow_empty_dir:\n raise InvalidSourceList(\n \"There are no .py[i] files in directory '{}'\".format(path)\n )\n sources.extend(sub_sources)\n else:\n mod = os.path.basename(path) if options.scripts_are_modules else None\n sources.append(BuildSource(path, mod, None))\n return sources", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fixup.py_TypeFixer.visit_type_alias_type_TypeFixer.visit_callable_type.if_ct_type_guard_is_not_N.ct_type_guard_accept_self": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fixup.py_TypeFixer.visit_type_alias_type_TypeFixer.visit_callable_type.if_ct_type_guard_is_not_N.ct_type_guard_accept_self", "embedding": null, "metadata": {"file_path": "mypy/fixup.py", "file_name": "fixup.py", "file_type": "text/x-python", "category": "implementation", "start_line": 165, "end_line": 196, "span_ids": ["TypeFixer.visit_callable_type", "TypeFixer.visit_type_alias_type", "TypeFixer.visit_any"], "tokens": 271}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeFixer(TypeVisitor[None]):\n\n def visit_type_alias_type(self, t: TypeAliasType) -> None:\n type_ref = t.type_ref\n if type_ref is None:\n return # We've already been here.\n t.type_ref = None\n t.alias = lookup_qualified_alias(self.modules, type_ref, self.allow_missing)\n for a in t.args:\n a.accept(self)\n\n def visit_any(self, o: Any) -> None:\n pass # Nothing to descend into.\n\n def visit_callable_type(self, ct: CallableType) -> None:\n if ct.fallback:\n ct.fallback.accept(self)\n for argt in ct.arg_types:\n # argt may be None, e.g. for __self in NamedTuple constructors.\n if argt is not None:\n argt.accept(self)\n if ct.ret_type is not None:\n ct.ret_type.accept(self)\n for v in ct.variables:\n if isinstance(v, TypeVarDef):\n if v.values:\n for val in v.values:\n val.accept(self)\n v.upper_bound.accept(self)\n for arg in ct.bound_args:\n if arg:\n arg.accept(self)\n if ct.type_guard is not None:\n ct.type_guard.accept(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fscache.py_FileSystemCache._exists_case_FileSystemCache.exists.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fscache.py_FileSystemCache._exists_case_FileSystemCache.exists.return.True", "embedding": null, "metadata": {"file_path": "mypy/fscache.py", "file_name": "fscache.py", "file_type": "text/x-python", "category": "implementation", "start_line": 227, "end_line": 261, "span_ids": ["FileSystemCache.exists", "FileSystemCache._exists_case", "FileSystemCache.isdir"], "tokens": 277}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@mypyc_attr(allow_interpreted_subclasses=True) # for tests\nclass FileSystemCache:\n\n def _exists_case(self, path: str, prefix: str) -> bool:\n \"\"\"Helper to check path components in case sensitive fashion, up to prefix.\"\"\"\n if path in self.exists_case_cache:\n return self.exists_case_cache[path]\n head, tail = os.path.split(path)\n if not head.startswith(prefix) or not tail:\n # Only perform the check for paths under prefix.\n self.exists_case_cache[path] = True\n return True\n try:\n names = self.listdir(head)\n # This allows one to check file name case sensitively in\n # case-insensitive filesystems.\n res = tail in names\n except OSError:\n res = False\n if res:\n # Also recursively check other path components.\n res = self._exists_case(head, prefix)\n self.exists_case_cache[path] = res\n return res\n\n def isdir(self, path: str) -> bool:\n try:\n st = self.stat(path)\n except OSError:\n return False\n return stat.S_ISDIR(st.st_mode)\n\n def exists(self, path: str) -> bool:\n try:\n self.stat(path)\n except FileNotFoundError:\n return False\n return True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fscache.py_FileSystemCache.read_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/fscache.py_FileSystemCache.read_", "embedding": null, "metadata": {"file_path": "mypy/fscache.py", "file_name": "fscache.py", "file_type": "text/x-python", "category": "implementation", "start_line": 263, "end_line": 309, "span_ids": ["FileSystemCache.hash_digest", "FileSystemCache.read", "copy_os_error", "FileSystemCache.samefile"], "tokens": 359}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@mypyc_attr(allow_interpreted_subclasses=True) # for tests\nclass FileSystemCache:\n\n def read(self, path: str) -> bytes:\n if path in self.read_cache:\n return self.read_cache[path]\n if path in self.read_error_cache:\n raise self.read_error_cache[path]\n\n # Need to stat first so that the contents of file are from no\n # earlier instant than the mtime reported by self.stat().\n self.stat(path)\n\n dirname, basename = os.path.split(path)\n dirname = os.path.normpath(dirname)\n # Check the fake cache.\n if basename == '__init__.py' and dirname in self.fake_package_cache:\n data = b''\n else:\n try:\n with open(path, 'rb') as f:\n data = f.read()\n except OSError as err:\n self.read_error_cache[path] = err\n raise\n\n self.read_cache[path] = data\n self.hash_cache[path] = hash_digest(data)\n return data\n\n def hash_digest(self, path: str) -> str:\n if path not in self.hash_cache:\n self.read(path)\n return self.hash_cache[path]\n\n def samefile(self, f1: str, f2: str) -> bool:\n s1 = self.stat(f1)\n s2 = self.stat(f2)\n return os.path.samestat(s1, s2)\n\n\ndef copy_os_error(e: OSError) -> OSError:\n new = OSError(*e.args)\n new.errno = e.errno\n new.strerror = e.strerror\n new.filename = e.filename\n if e.filename2:\n new.filename2 = e.filename2\n return new", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/git.py__Git_utilities__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/git.py__Git_utilities__", "embedding": null, "metadata": {"file_path": "mypy/git.py", "file_name": "git.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 39, "span_ids": ["have_git", "has_extra_files", "git_revision", "docstring", "is_dirty", "is_git_repo"], "tokens": 277}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Git utilities.\"\"\"\n\n# Used also from setup.py, so don't pull in anything additional here (like mypy or typing):\nimport os\nimport subprocess\n\n\ndef is_git_repo(dir: str) -> bool:\n \"\"\"Is the given directory version-controlled with git?\"\"\"\n return os.path.exists(os.path.join(dir, \".git\"))\n\n\ndef have_git() -> bool:\n \"\"\"Can we run the git executable?\"\"\"\n try:\n subprocess.check_output([\"git\", \"--help\"])\n return True\n except subprocess.CalledProcessError:\n return False\n except OSError:\n return False\n\n\ndef git_revision(dir: str) -> bytes:\n \"\"\"Get the SHA-1 of the HEAD of a git repository.\"\"\"\n return subprocess.check_output([\"git\", \"rev-parse\", \"HEAD\"], cwd=dir).strip()\n\n\ndef is_dirty(dir: str) -> bool:\n \"\"\"Check whether a git repository has uncommitted changes.\"\"\"\n output = subprocess.check_output([\"git\", \"status\", \"-uno\", \"--porcelain\"], cwd=dir)\n return output.strip() != b\"\"\n\n\ndef has_extra_files(dir: str) -> bool:\n \"\"\"Check whether a git repository has untracked files.\"\"\"\n output = subprocess.check_output([\"git\", \"clean\", \"--dry-run\", \"-d\"], cwd=dir)\n return output.strip() != b\"\"", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_process_options.other_group_add_argument__process_options.None_78": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_process_options.other_group_add_argument__process_options.None_78", "embedding": null, "metadata": {"file_path": "mypy/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 735, "end_line": 787, "span_ids": ["process_options"], "tokens": 781}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def process_options(args: List[str],\n stdout: Optional[TextIO] = None,\n stderr: Optional[TextIO] = None,\n require_targets: bool = True,\n server_options: bool = False,\n fscache: Optional[FileSystemCache] = None,\n program: str = 'mypy',\n header: str = HEADER,\n ) -> Tuple[List[BuildSource], Options]:\n # ... other code\n other_group.add_argument(\n '--quickstart-file', help=argparse.SUPPRESS)\n other_group.add_argument(\n '--junit-xml', help=\"Write junit.xml to the given file\")\n other_group.add_argument(\n '--find-occurrences', metavar='CLASS.MEMBER',\n dest='special-opts:find_occurrences',\n help=\"Print out all usages of a class member (experimental)\")\n other_group.add_argument(\n '--scripts-are-modules', action='store_true',\n help=\"Script x becomes module x instead of __main__\")\n\n add_invertible_flag('--install-types', default=False, strict_flag=False,\n help=\"Install detected missing library stub packages using pip\",\n group=other_group)\n\n if server_options:\n # TODO: This flag is superfluous; remove after a short transition (2018-03-16)\n other_group.add_argument(\n '--experimental', action='store_true', dest='fine_grained_incremental',\n help=\"Enable fine-grained incremental mode\")\n other_group.add_argument(\n '--use-fine-grained-cache', action='store_true',\n help=\"Use the cache in fine-grained incremental mode\")\n\n # hidden options\n parser.add_argument(\n '--stats', action='store_true', dest='dump_type_stats', help=argparse.SUPPRESS)\n parser.add_argument(\n '--inferstats', action='store_true', dest='dump_inference_stats',\n help=argparse.SUPPRESS)\n parser.add_argument(\n '--dump-build-stats', action='store_true',\n help=argparse.SUPPRESS)\n # --debug-cache will disable any cache-related compressions/optimizations,\n # which will make the cache writing process output pretty-printed JSON (which\n # is easier to debug).\n parser.add_argument('--debug-cache', action='store_true', help=argparse.SUPPRESS)\n # --dump-deps will dump all fine-grained dependencies to stdout\n parser.add_argument('--dump-deps', action='store_true', help=argparse.SUPPRESS)\n # --dump-graph will dump the contents of the graph of SCCs and exit.\n parser.add_argument('--dump-graph', action='store_true', help=argparse.SUPPRESS)\n # --semantic-analysis-only does exactly that.\n parser.add_argument('--semantic-analysis-only', action='store_true', help=argparse.SUPPRESS)\n # --local-partial-types disallows partial types spanning module top level and a function\n # (implicitly defined in fine-grained incremental mode)\n parser.add_argument('--local-partial-types', action='store_true', help=argparse.SUPPRESS)\n # --logical-deps adds some more dependencies that are not semantically needed, but\n # may be helpful to determine relative importance of classes and functions for overall\n # type precision in a code base. It also _removes_ some deps, so this flag should be never\n # used except for generating code stats. This also automatically enables --cache-fine-grained.\n # NOTE: This is an experimental option that may be modified or removed at any time.\n parser.add_argument('--logical-deps', action='store_true', help=argparse.SUPPRESS)\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_process_options._bazel_changes_some_be_process_options._This_lets_config_fil": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_process_options._bazel_changes_some_be_process_options._This_lets_config_fil", "embedding": null, "metadata": {"file_path": "mypy/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 788, "end_line": 845, "span_ids": ["process_options"], "tokens": 766}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def process_options(args: List[str],\n stdout: Optional[TextIO] = None,\n stderr: Optional[TextIO] = None,\n require_targets: bool = True,\n server_options: bool = False,\n fscache: Optional[FileSystemCache] = None,\n program: str = 'mypy',\n header: str = HEADER,\n ) -> Tuple[List[BuildSource], Options]:\n # --bazel changes some behaviors for use with Bazel (https://bazel.build).\n parser.add_argument('--bazel', action='store_true', help=argparse.SUPPRESS)\n # --package-root adds a directory below which directories are considered\n # packages even without __init__.py. May be repeated.\n parser.add_argument('--package-root', metavar='ROOT', action='append', default=[],\n help=argparse.SUPPRESS)\n # --cache-map FILE ... gives a mapping from source files to cache files.\n # Each triple of arguments is a source file, a cache meta file, and a cache data file.\n # Modules not mentioned in the file will go through cache_dir.\n # Must be followed by another flag or by '--' (and then only file args may follow).\n parser.add_argument('--cache-map', nargs='+', dest='special-opts:cache_map',\n help=argparse.SUPPRESS)\n # PEP 612 support is a work in progress, hide it from users\n parser.add_argument('--wip-pep-612', action=\"store_true\", help=argparse.SUPPRESS)\n\n # options specifying code to check\n code_group = parser.add_argument_group(\n title=\"Running code\",\n description=\"Specify the code you want to type check. For more details, see \"\n \"mypy.readthedocs.io/en/stable/running_mypy.html#running-mypy\")\n add_invertible_flag(\n '--explicit-package-bases', default=False,\n help=\"Use current directory and MYPYPATH to determine module names of files passed\",\n group=code_group)\n code_group.add_argument(\n \"--exclude\",\n metavar=\"PATTERN\",\n default=\"\",\n help=(\n \"Regular expression to match file names, directory names or paths which mypy should \"\n \"ignore while recursively discovering files to check, e.g. --exclude '/setup\\\\.py$'\"\n )\n )\n code_group.add_argument(\n '-m', '--module', action='append', metavar='MODULE',\n default=[],\n dest='special-opts:modules',\n help=\"Type-check module; can repeat for more modules\")\n code_group.add_argument(\n '-p', '--package', action='append', metavar='PACKAGE',\n default=[],\n dest='special-opts:packages',\n help=\"Type-check package recursively; can be repeated\")\n code_group.add_argument(\n '-c', '--command', action='append', metavar='PROGRAM_TEXT',\n dest='special-opts:command',\n help=\"Type-check program passed in as string\")\n code_group.add_argument(\n metavar='files', nargs='*', dest='special-opts:files',\n help=\"Type-check given files or directories\")\n\n # Parse arguments once into a dummy namespace so we can get the\n # filename for the config file and know if the user requested all strict options.\n dummy = argparse.Namespace()\n parser.parse_args(args, dummy)\n config_file = dummy.config_file\n # Don't explicitly test if \"config_file is not None\" for this check.\n # This lets `--config-file=` (an empty string) be used to disable all config files.\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_process_options.if_config_file_and_not_os_process_options.options_disabled_error_co": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_process_options.if_config_file_and_not_os_process_options.options_disabled_error_co", "embedding": null, "metadata": {"file_path": "mypy/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 845, "end_line": 920, "span_ids": ["process_options"], "tokens": 811}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def process_options(args: List[str],\n stdout: Optional[TextIO] = None,\n stderr: Optional[TextIO] = None,\n require_targets: bool = True,\n server_options: bool = False,\n fscache: Optional[FileSystemCache] = None,\n program: str = 'mypy',\n header: str = HEADER,\n ) -> Tuple[List[BuildSource], Options]:\n # ... other code\n if config_file and not os.path.exists(config_file):\n parser.error(\"Cannot find config file '%s'\" % config_file)\n\n options = Options()\n\n def set_strict_flags() -> None:\n for dest, value in strict_flag_assignments:\n setattr(options, dest, value)\n\n # Parse config file first, so command line can override.\n parse_config_file(options, set_strict_flags, config_file, stdout, stderr)\n\n # Set strict flags before parsing (if strict mode enabled), so other command\n # line options can override.\n if getattr(dummy, 'special-opts:strict'): # noqa\n set_strict_flags()\n\n # Override cache_dir if provided in the environment\n environ_cache_dir = os.getenv('MYPY_CACHE_DIR', '')\n if environ_cache_dir.strip():\n options.cache_dir = environ_cache_dir\n options.cache_dir = os.path.expanduser(options.cache_dir)\n\n # Parse command line for real, using a split namespace.\n special_opts = argparse.Namespace()\n parser.parse_args(args, SplitNamespace(options, special_opts, 'special-opts:'))\n\n # The python_version is either the default, which can be overridden via a config file,\n # or stored in special_opts and is passed via the command line.\n options.python_version = special_opts.python_version or options.python_version\n try:\n infer_python_executable(options, special_opts)\n except PythonExecutableInferenceError as e:\n parser.error(str(e))\n\n if special_opts.no_executable or options.no_site_packages:\n options.python_executable = None\n\n # Paths listed in the config file will be ignored if any paths, modules or packages\n # are passed on the command line.\n if options.files and not (special_opts.files or special_opts.packages or special_opts.modules):\n special_opts.files = options.files\n\n # Check for invalid argument combinations.\n if require_targets:\n code_methods = sum(bool(c) for c in [special_opts.modules + special_opts.packages,\n special_opts.command,\n special_opts.files])\n if code_methods == 0 and not options.install_types:\n parser.error(\"Missing target module, package, files, or command.\")\n elif code_methods > 1:\n parser.error(\"May only specify one of: module/package, files, or command.\")\n if options.explicit_package_bases and not options.namespace_packages:\n parser.error(\n \"Can only use --explicit-package-bases with --namespace-packages, since otherwise \"\n \"examining __init__.py's is sufficient to determine module names for files\"\n )\n\n # Check for overlapping `--always-true` and `--always-false` flags.\n overlap = set(options.always_true) & set(options.always_false)\n if overlap:\n parser.error(\"You can't make a variable always true and always false (%s)\" %\n ', '.join(sorted(overlap)))\n\n # Process `--enable-error-code` and `--disable-error-code` flags\n disabled_codes = set(options.disable_error_code)\n enabled_codes = set(options.enable_error_code)\n\n valid_error_codes = set(error_codes.keys())\n\n invalid_codes = (enabled_codes | disabled_codes) - valid_error_codes\n if invalid_codes:\n parser.error(\"Invalid error code(s): %s\" %\n ', '.join(sorted(invalid_codes)))\n\n options.disabled_error_codes |= {error_codes[code] for code in disabled_codes}\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_process_options.options_enabled_error_cod_process_options.if_special_opts_modules_.else_.return.targets_options": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_process_options.options_enabled_error_cod_process_options.if_special_opts_modules_.else_.return.targets_options", "embedding": null, "metadata": {"file_path": "mypy/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 921, "end_line": 994, "span_ids": ["process_options"], "tokens": 814}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def process_options(args: List[str],\n stdout: Optional[TextIO] = None,\n stderr: Optional[TextIO] = None,\n require_targets: bool = True,\n server_options: bool = False,\n fscache: Optional[FileSystemCache] = None,\n program: str = 'mypy',\n header: str = HEADER,\n ) -> Tuple[List[BuildSource], Options]:\n # ... other code\n general_group.add_argument(\n '-V', '--version', action=CapturableVersionAction,\n version='%(prog)s ' + __version__,\n help=\"Show program's version number and exit\",\n stdout=stdout)\n # ... other code\n options.enabled_error_codes |= {error_codes[code] for code in enabled_codes}\n\n # Enabling an error code always overrides disabling\n options.disabled_error_codes -= options.enabled_error_codes\n\n # Set build flags.\n if options.strict_optional_whitelist is not None:\n # TODO: Deprecate, then kill this flag\n options.strict_optional = True\n if special_opts.find_occurrences:\n state.find_occurrences = special_opts.find_occurrences.split('.')\n assert state.find_occurrences is not None\n if len(state.find_occurrences) < 2:\n parser.error(\"Can only find occurrences of class members.\")\n if len(state.find_occurrences) != 2:\n parser.error(\"Can only find occurrences of non-nested class members.\")\n\n # Set reports.\n for flag, val in vars(special_opts).items():\n if flag.endswith('_report') and val is not None:\n report_type = flag[:-7].replace('_', '-')\n report_dir = val\n options.report_dirs[report_type] = report_dir\n\n # Process --package-root.\n if options.package_root:\n process_package_roots(fscache, parser, options)\n\n # Process --cache-map.\n if special_opts.cache_map:\n if options.sqlite_cache:\n parser.error(\"--cache-map is incompatible with --sqlite-cache\")\n\n process_cache_map(parser, special_opts, options)\n\n # Let logical_deps imply cache_fine_grained (otherwise the former is useless).\n if options.logical_deps:\n options.cache_fine_grained = True\n\n # Set target.\n if special_opts.modules + special_opts.packages:\n options.build_type = BuildType.MODULE\n egg_dirs, site_packages = get_site_packages_dirs(options.python_executable)\n search_paths = SearchPaths((os.getcwd(),),\n tuple(mypy_path() + options.mypy_path),\n tuple(egg_dirs + site_packages),\n ())\n targets = []\n # TODO: use the same cache that the BuildManager will\n cache = FindModuleCache(search_paths, fscache, options)\n for p in special_opts.packages:\n if os.sep in p or os.altsep and os.altsep in p:\n fail(\"Package name '{}' cannot have a slash in it.\".format(p),\n stderr, options)\n p_targets = cache.find_modules_recursive(p)\n if not p_targets:\n fail(\"Can't find package '{}'\".format(p), stderr, options)\n targets.extend(p_targets)\n for m in special_opts.modules:\n targets.append(BuildSource(None, m, None))\n return targets, options\n elif special_opts.command:\n options.build_type = BuildType.PROGRAM_TEXT\n targets = [BuildSource(None, None, '\\n'.join(special_opts.command))]\n return targets, options\n else:\n try:\n targets = create_source_list(special_opts.files, options, fscache)\n # Variable named e2 instead of e to work around mypyc bug #620\n # which causes issues when using the same variable to catch\n # exceptions of different types.\n except InvalidSourceList as e2:\n fail(str(e2), stderr, options)\n return targets, options", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_maybe_write_junit_xml_fail.sys_exit_2_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_maybe_write_junit_xml_fail.sys_exit_2_", "embedding": null, "metadata": {"file_path": "mypy/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1054, "end_line": 1065, "span_ids": ["maybe_write_junit_xml", "fail"], "tokens": 139}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def maybe_write_junit_xml(td: float, serious: bool, messages: List[str], options: Options) -> None:\n if options.junit_xml:\n py_version = '{}_{}'.format(options.python_version[0], options.python_version[1])\n util.write_junit_xml(\n td, serious, messages, options.junit_xml, py_version, options.platform)\n\n\ndef fail(msg: str, stderr: TextIO, options: Options) -> None:\n \"\"\"Fail with a serious error.\"\"\"\n stderr.write('%s\\n' % msg)\n maybe_write_junit_xml(0.0, serious=True, messages=[msg], options=options)\n sys.exit(2)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_install_types_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/main.py_install_types_", "embedding": null, "metadata": {"file_path": "mypy/main.py", "file_name": "main.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1068, "end_line": 1094, "span_ids": ["install_types"], "tokens": 253}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def install_types(cache_dir: str,\n formatter: util.FancyFormatter,\n after_run: bool = False) -> None:\n \"\"\"Install stub packages using pip if some missing stubs were detected.\"\"\"\n if not os.path.isdir(cache_dir):\n sys.stderr.write(\n \"Error: no mypy cache directory (you must enable incremental mode)\\n\")\n sys.exit(2)\n fnam = build.missing_stubs_file(cache_dir)\n if not os.path.isfile(fnam):\n # If there are no missing stubs, generate no output.\n return\n with open(fnam) as f:\n packages = [line.strip() for line in f.readlines()]\n if after_run:\n print()\n print('Installing missing stub packages:')\n cmd = [sys.executable, '-m', 'pip', 'install'] + packages\n print(formatter.style(' '.join(cmd), 'none', bold=True))\n print()\n x = input('Install? [yN] ')\n if not x.strip() or not x.lower().startswith('y'):\n print(formatter.style('mypy: Skipping installation', 'red', bold=True))\n sys.exit(2)\n print()\n subprocess.run(cmd)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.incompatible_argument_note_MessageBuilder.incompatible_argument_note.if_isinstance_callee_typ.if_call_.self_note_call_original_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.incompatible_argument_note_MessageBuilder.incompatible_argument_note.if_isinstance_callee_typ.if_call_.self_note_call_original_c", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 570, "end_line": 590, "span_ids": ["MessageBuilder.incompatible_argument_note"], "tokens": 224}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MessageBuilder:\n\n def incompatible_argument_note(self,\n original_caller_type: ProperType,\n callee_type: ProperType,\n context: Context,\n code: Optional[ErrorCode]) -> None:\n if isinstance(original_caller_type, (Instance, TupleType, TypedDictType)):\n if isinstance(callee_type, Instance) and callee_type.type.is_protocol:\n self.report_protocol_problems(original_caller_type, callee_type,\n context, code=code)\n if isinstance(callee_type, UnionType):\n for item in callee_type.items:\n item = get_proper_type(item)\n if isinstance(item, Instance) and item.type.is_protocol:\n self.report_protocol_problems(original_caller_type, item,\n context, code=code)\n if (isinstance(callee_type, CallableType) and\n isinstance(original_caller_type, Instance)):\n call = find_member('__call__', original_caller_type, original_caller_type,\n is_operator=True)\n if call:\n self.note_call(original_caller_type, call, context, code=code)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.invalid_index_type_MessageBuilder.too_few_arguments.self_fail_msg_context_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_MessageBuilder.invalid_index_type_MessageBuilder.too_few_arguments.self_fail_msg_context_c", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 592, "end_line": 617, "span_ids": ["MessageBuilder.too_few_arguments", "MessageBuilder.invalid_index_type"], "tokens": 311}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MessageBuilder:\n\n def invalid_index_type(self, index_type: Type, expected_type: Type, base_str: str,\n context: Context, *, code: ErrorCode) -> None:\n index_str, expected_str = format_type_distinctly(index_type, expected_type)\n self.fail('Invalid index type {} for {}; expected type {}'.format(\n index_str, base_str, expected_str), context, code=code)\n\n def too_few_arguments(self, callee: CallableType, context: Context,\n argument_names: Optional[Sequence[Optional[str]]]) -> None:\n if argument_names is not None:\n num_positional_args = sum(k is None for k in argument_names)\n arguments_left = callee.arg_names[num_positional_args:callee.min_args]\n diff = [k for k in arguments_left if k not in argument_names]\n if len(diff) == 1:\n msg = 'Missing positional argument'\n else:\n msg = 'Missing positional arguments'\n callee_name = callable_name(callee)\n if callee_name is not None and diff and all(d is not None for d in diff):\n args = '\", \"'.join(cast(List[str], diff))\n msg += ' \"{}\" in call to {}'.format(args, callee_name)\n else:\n msg = 'Too few arguments' + for_function(callee)\n\n else:\n msg = 'Too few arguments' + for_function(callee)\n self.fail(msg, context, code=codes.CALL_ARG)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py__Low_level_infrastructu_PYTHON2_STUB_DIR._python2_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py__Low_level_infrastructu_PYTHON2_STUB_DIR._python2_", "embedding": null, "metadata": {"file_path": "mypy/modulefinder.py", "file_name": "modulefinder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 38, "span_ids": ["docstring"], "tokens": 277}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Low-level infrastructure to find modules.\n\nThis builds on fscache.py; find_sources.py builds on top of this.\n\"\"\"\n\nimport ast\nimport collections\nimport functools\nimport os\nimport re\nimport subprocess\nimport sys\nfrom enum import Enum\n\nfrom typing import Dict, Iterator, List, NamedTuple, Optional, Set, Tuple, Union\nfrom typing_extensions import Final\n\nfrom mypy.fscache import FileSystemCache\nfrom mypy.options import Options\nfrom mypy.stubinfo import legacy_bundled_packages\nfrom mypy import sitepkgs\n\n# Paths to be searched in find_module().\nSearchPaths = NamedTuple(\n 'SearchPaths',\n [('python_path', Tuple[str, ...]), # where user code is found\n ('mypy_path', Tuple[str, ...]), # from $MYPYPATH or config variable\n ('package_path', Tuple[str, ...]), # from get_site_packages_dirs()\n ('typeshed_path', Tuple[str, ...]), # paths in typeshed\n ])\n\n# Package dirs are a two-tuple of path to search and whether to verify the module\nOnePackageDir = Tuple[str, bool]\nPackageDirs = List[OnePackageDir]\n\nPYTHON_EXTENSIONS = ['.pyi', '.py'] # type: Final\n\nPYTHON2_STUB_DIR = '@python2'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_None_4_ModuleNotFoundReason.STUBS_NOT_INSTALLED.3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_None_4_ModuleNotFoundReason.STUBS_NOT_INSTALLED.3", "embedding": null, "metadata": {"file_path": "mypy/modulefinder.py", "file_name": "modulefinder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 38, "end_line": 60, "span_ids": ["ModuleNotFoundReason", "docstring"], "tokens": 225}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": " # type: Final\n\n\n# TODO: Consider adding more reasons here?\n# E.g. if we deduce a module would likely be found if the user were\n# to set the --namespace-packages flag.\nclass ModuleNotFoundReason(Enum):\n # The module was not found: we found neither stubs nor a plausible code\n # implementation (with or without a py.typed file).\n NOT_FOUND = 0\n\n # The implementation for this module plausibly exists (e.g. we\n # found a matching folder or *.py file), but either the parent package\n # did not contain a py.typed file or we were unable to find a\n # corresponding *-stubs package.\n FOUND_WITHOUT_TYPE_HINTS = 1\n\n # The module was not found in the current working directory, but\n # was able to be found in the parent directory.\n WRONG_WORKING_DIRECTORY = 2\n\n # Stub PyPI package (typically types-pkgname) known to exist but not installed.\n STUBS_NOT_INSTALLED = 3", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_ModuleNotFoundReason.error_message_templates_ModuleNotFoundReason.error_message_templates.return.msg_notes": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_ModuleNotFoundReason.error_message_templates_ModuleNotFoundReason.error_message_templates.return.msg_notes", "embedding": null, "metadata": {"file_path": "mypy/modulefinder.py", "file_name": "modulefinder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 62, "end_line": 83, "span_ids": ["ModuleNotFoundReason.error_message_templates"], "tokens": 294}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class ModuleNotFoundReason(Enum):\n # The module was not found: we found neither stubs nor a plausible code\n\n def error_message_templates(self) -> Tuple[str, List[str]]:\n doc_link = \"See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports\"\n if self is ModuleNotFoundReason.NOT_FOUND:\n msg = 'Cannot find implementation or library stub for module named \"{module}\"'\n notes = [doc_link]\n elif self is ModuleNotFoundReason.WRONG_WORKING_DIRECTORY:\n msg = 'Cannot find implementation or library stub for module named \"{module}\"'\n notes = [\"You may be running mypy in a subpackage, \"\n \"mypy should be run on the package root\"]\n elif self is ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS:\n msg = 'Skipping analyzing \"{module}\": found module but no type hints or library stubs'\n notes = [doc_link]\n elif self is ModuleNotFoundReason.STUBS_NOT_INSTALLED:\n msg = (\n 'Library stubs not installed for \"{module}\" (or incompatible with Python {pyver})'\n )\n notes = ['Hint: \"python3 -m pip install {stub_dist}\"',\n '(or run \"mypy --install-types\" to install all missing stub packages)',\n doc_link]\n else:\n assert False\n return msg, notes", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py__If_we_found_the_module__BuildSource.__repr__.return._BuildSource_path_r_mod": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py__If_we_found_the_module__BuildSource.__repr__.return._BuildSource_path_r_mod", "embedding": null, "metadata": {"file_path": "mypy/modulefinder.py", "file_name": "modulefinder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 86, "end_line": 106, "span_ids": ["impl:11", "BuildSource", "ModuleNotFoundReason.error_message_templates", "BuildSource.__repr__", "BuildSource.__init__"], "tokens": 232}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# If we found the module, returns the path to the module as a str.\n# Otherwise, returns the reason why the module wasn't found.\nModuleSearchResult = Union[str, ModuleNotFoundReason]\n\n\nclass BuildSource:\n \"\"\"A single source file.\"\"\"\n\n def __init__(self, path: Optional[str], module: Optional[str],\n text: Optional[str] = None, base_dir: Optional[str] = None) -> None:\n self.path = path # File where it's found (e.g. 'xxx/yyy/foo/bar.py')\n self.module = module or '__main__' # Module name (e.g. 'foo.bar')\n self.text = text # Source code, if initially supplied, else None\n self.base_dir = base_dir # Directory where the package is rooted (e.g. 'xxx/yyy')\n\n def __repr__(self) -> str:\n return 'BuildSource(path=%r, module=%r, has_text=%s, base_dir=%r)' % (\n self.path,\n self.module,\n self.text is not None,\n self.base_dir)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_FindModuleCache._find_module_non_stub_helper_FindModuleCache._find_module_non_stub_helper.if_components_0_in_legac.else_.return.ModuleNotFoundReason_NOT_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_FindModuleCache._find_module_non_stub_helper_FindModuleCache._find_module_non_stub_helper.if_components_0_in_legac.else_.return.ModuleNotFoundReason_NOT_", "embedding": null, "metadata": {"file_path": "mypy/modulefinder.py", "file_name": "modulefinder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 211, "end_line": 227, "span_ids": ["FindModuleCache._find_module_non_stub_helper"], "tokens": 195}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FindModuleCache:\n\n def _find_module_non_stub_helper(self, components: List[str],\n pkg_dir: str) -> Union[OnePackageDir, ModuleNotFoundReason]:\n plausible_match = False\n dir_path = pkg_dir\n for index, component in enumerate(components):\n dir_path = os.path.join(dir_path, component)\n if self.fscache.isfile(os.path.join(dir_path, 'py.typed')):\n return os.path.join(pkg_dir, *components[:-1]), index == 0\n elif not plausible_match and (self.fscache.isdir(dir_path)\n or self.fscache.isfile(dir_path + \".py\")):\n plausible_match = True\n if components[0] in legacy_bundled_packages:\n return ModuleNotFoundReason.STUBS_NOT_INSTALLED\n elif plausible_match:\n return ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS\n else:\n return ModuleNotFoundReason.NOT_FOUND", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_FindModuleCache._find_module_FindModuleCache._find_module.candidate_base_dirs.self_find_lib_path_dirs_i": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_FindModuleCache._find_module_FindModuleCache._find_module.candidate_base_dirs.self_find_lib_path_dirs_i", "embedding": null, "metadata": {"file_path": "mypy/modulefinder.py", "file_name": "modulefinder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 251, "end_line": 314, "span_ids": ["FindModuleCache._find_module"], "tokens": 813}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FindModuleCache:\n\n def _find_module(self, id: str, use_typeshed: bool) -> ModuleSearchResult:\n fscache = self.fscache\n\n # If we're looking for a module like 'foo.bar.baz', it's likely that most of the\n # many elements of lib_path don't even have a subdirectory 'foo/bar'. Discover\n # that only once and cache it for when we look for modules like 'foo.bar.blah'\n # that will require the same subdirectory.\n components = id.split('.')\n dir_chain = os.sep.join(components[:-1]) # e.g., 'foo/bar'\n\n # We have two sets of folders so that we collect *all* stubs folders and\n # put them in the front of the search path\n third_party_inline_dirs = [] # type: PackageDirs\n third_party_stubs_dirs = [] # type: PackageDirs\n found_possible_third_party_missing_type_hints = False\n need_installed_stubs = False\n # Third-party stub/typed packages\n for pkg_dir in self.search_paths.package_path:\n stub_name = components[0] + '-stubs'\n stub_dir = os.path.join(pkg_dir, stub_name)\n if self.python2:\n alt_stub_name = components[0] + '-python2-stubs'\n alt_stub_dir = os.path.join(pkg_dir, alt_stub_name)\n if fscache.isdir(alt_stub_dir):\n stub_name = alt_stub_name\n stub_dir = alt_stub_dir\n if fscache.isdir(stub_dir) and self._is_compatible_stub_package(stub_dir):\n stub_typed_file = os.path.join(stub_dir, 'py.typed')\n stub_components = [stub_name] + components[1:]\n path = os.path.join(pkg_dir, *stub_components[:-1])\n if fscache.isdir(path):\n if fscache.isfile(stub_typed_file):\n # Stub packages can have a py.typed file, which must include\n # 'partial\\n' to make the package partial\n # Partial here means that mypy should look at the runtime\n # package if installed.\n if fscache.read(stub_typed_file).decode().strip() == 'partial':\n runtime_path = os.path.join(pkg_dir, dir_chain)\n third_party_inline_dirs.append((runtime_path, True))\n # if the package is partial, we don't verify the module, as\n # the partial stub package may not have a __init__.pyi\n third_party_stubs_dirs.append((path, False))\n else:\n # handle the edge case where people put a py.typed file\n # in a stub package, but it isn't partial\n third_party_stubs_dirs.append((path, True))\n else:\n third_party_stubs_dirs.append((path, True))\n non_stub_match = self._find_module_non_stub_helper(components, pkg_dir)\n if isinstance(non_stub_match, ModuleNotFoundReason):\n if non_stub_match is ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS:\n found_possible_third_party_missing_type_hints = True\n elif non_stub_match is ModuleNotFoundReason.STUBS_NOT_INSTALLED:\n need_installed_stubs = True\n else:\n third_party_inline_dirs.append(non_stub_match)\n self._update_ns_ancestors(components, non_stub_match)\n if self.options and self.options.use_builtins_fixtures:\n # Everything should be in fixtures.\n third_party_inline_dirs.clear()\n third_party_stubs_dirs.clear()\n found_possible_third_party_missing_type_hints = False\n python_mypy_path = self.search_paths.mypy_path + self.search_paths.python_path\n candidate_base_dirs = self.find_lib_path_dirs(id, python_mypy_path)\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_FindModuleCache._find_module.if_use_typeshed__FindModuleCache._find_module.None_30": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_FindModuleCache._find_module.if_use_typeshed__FindModuleCache._find_module.None_30", "embedding": null, "metadata": {"file_path": "mypy/modulefinder.py", "file_name": "modulefinder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 315, "end_line": 383, "span_ids": ["FindModuleCache._find_module"], "tokens": 847}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FindModuleCache:\n\n def _find_module(self, id: str, use_typeshed: bool) -> ModuleSearchResult:\n # ... other code\n if use_typeshed:\n # Search for stdlib stubs in typeshed before installed\n # stubs to avoid picking up backports (dataclasses, for\n # example) when the library is included in stdlib.\n candidate_base_dirs += self.find_lib_path_dirs(id, self.search_paths.typeshed_path)\n candidate_base_dirs += third_party_stubs_dirs + third_party_inline_dirs\n\n # If we're looking for a module like 'foo.bar.baz', then candidate_base_dirs now\n # contains just the subdirectories 'foo/bar' that actually exist under the\n # elements of lib_path. This is probably much shorter than lib_path itself.\n # Now just look for 'baz.pyi', 'baz/__init__.py', etc., inside those directories.\n seplast = os.sep + components[-1] # so e.g. '/baz'\n sepinit = os.sep + '__init__'\n near_misses = [] # Collect near misses for namespace mode (see below).\n for base_dir, verify in candidate_base_dirs:\n base_path = base_dir + seplast # so e.g. '/usr/lib/python3.4/foo/bar/baz'\n has_init = False\n dir_prefix = base_dir\n for _ in range(len(components) - 1):\n dir_prefix = os.path.dirname(dir_prefix)\n # Prefer package over module, i.e. baz/__init__.py* over baz.py*.\n for extension in PYTHON_EXTENSIONS:\n path = base_path + sepinit + extension\n suffix = '-stubs'\n if self.python2:\n if os.path.isdir(base_path + '-python2-stubs'):\n suffix = '-python2-stubs'\n path_stubs = base_path + suffix + sepinit + extension\n if fscache.isfile_case(path, dir_prefix):\n has_init = True\n if verify and not verify_module(fscache, id, path, dir_prefix):\n near_misses.append((path, dir_prefix))\n continue\n return path\n elif fscache.isfile_case(path_stubs, dir_prefix):\n if verify and not verify_module(fscache, id, path_stubs, dir_prefix):\n near_misses.append((path_stubs, dir_prefix))\n continue\n return path_stubs\n\n # In namespace mode, register a potential namespace package\n if self.options and self.options.namespace_packages:\n if fscache.isdir(base_path) and not has_init:\n near_misses.append((base_path, dir_prefix))\n\n # No package, look for module.\n for extension in PYTHON_EXTENSIONS:\n path = base_path + extension\n if fscache.isfile_case(path, dir_prefix):\n if verify and not verify_module(fscache, id, path, dir_prefix):\n near_misses.append((path, dir_prefix))\n continue\n return path\n\n # In namespace mode, re-check those entries that had 'verify'.\n # Assume search path entries xxx, yyy and zzz, and we're\n # looking for foo.bar.baz. Suppose near_misses has:\n #\n # - xxx/foo/bar/baz.py\n # - yyy/foo/bar/baz/__init__.py\n # - zzz/foo/bar/baz.pyi\n #\n # If any of the foo directories has __init__.py[i], it wins.\n # Else, we look for foo/bar/__init__.py[i], etc. If there are\n # none, the first hit wins. Note that this does not take into\n # account whether the lowest-level module is a file (baz.py),\n # a package (baz/__init__.py), or a stub file (baz.pyi) -- for\n # these the first one encountered along the search path wins.\n #\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_FindModuleCache._find_module._The_helper_function_hig_FindModuleCache._find_module.if_need_installed_stubs_.else_.return.ModuleNotFoundReason_NOT_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_FindModuleCache._find_module._The_helper_function_hig_FindModuleCache._find_module.if_need_installed_stubs_.else_.return.ModuleNotFoundReason_NOT_", "embedding": null, "metadata": {"file_path": "mypy/modulefinder.py", "file_name": "modulefinder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 384, "end_line": 409, "span_ids": ["FindModuleCache._find_module"], "tokens": 325}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FindModuleCache:\n\n def _find_module(self, id: str, use_typeshed: bool) -> ModuleSearchResult:\n # The helper function highest_init_level() returns an int that\n # indicates the highest level at which a __init__.py[i] file\n # is found; if no __init__ was found it returns 0, if we find\n # only foo/bar/__init__.py it returns 1, and if we have\n # foo/__init__.py it returns 2 (regardless of what's in\n # foo/bar). It doesn't look higher than that.\n if self.options and self.options.namespace_packages and near_misses:\n levels = [highest_init_level(fscache, id, path, dir_prefix)\n for path, dir_prefix in near_misses]\n index = levels.index(max(levels))\n return near_misses[index][0]\n\n # Finally, we may be asked to produce an ancestor for an\n # installed package with a py.typed marker that is a\n # subpackage of a namespace package. We only fess up to these\n # if we would otherwise return \"not found\".\n ancestor = self.ns_ancestors.get(id)\n if ancestor is not None:\n return ancestor\n\n if need_installed_stubs:\n return ModuleNotFoundReason.STUBS_NOT_INSTALLED\n elif found_possible_third_party_missing_type_hints:\n return ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS\n else:\n return ModuleNotFoundReason.NOT_FOUND", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_FindModuleCache._is_compatible_stub_package_FindModuleCache._is_compatible_stub_package.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_FindModuleCache._is_compatible_stub_package_FindModuleCache._is_compatible_stub_package.return.True", "embedding": null, "metadata": {"file_path": "mypy/modulefinder.py", "file_name": "modulefinder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 411, "end_line": 427, "span_ids": ["FindModuleCache._is_compatible_stub_package"], "tokens": 161}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FindModuleCache:\n\n def _is_compatible_stub_package(self, stub_dir: str) -> bool:\n \"\"\"Does a stub package support the target Python version?\n\n Stub packages may contain a metadata file which specifies\n whether the stubs are compatible with Python 2 and 3.\n \"\"\"\n metadata_fnam = os.path.join(stub_dir, 'METADATA.toml')\n if os.path.isfile(metadata_fnam):\n # Delay import for a possible minor performance win.\n import toml\n with open(metadata_fnam, 'r') as f:\n metadata = toml.load(f)\n if self.python2:\n return bool(metadata.get('python2', False))\n else:\n return bool(metadata.get('python3', True))\n return True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_matches_exclude_verify_module.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_matches_exclude_verify_module.return.True", "embedding": null, "metadata": {"file_path": "mypy/modulefinder.py", "file_name": "modulefinder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 481, "end_line": 504, "span_ids": ["verify_module", "matches_exclude"], "tokens": 227}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def matches_exclude(subpath: str, exclude: str, fscache: FileSystemCache, verbose: bool) -> bool:\n if not exclude:\n return False\n subpath_str = os.path.relpath(subpath).replace(os.sep, \"/\")\n if fscache.isdir(subpath):\n subpath_str += \"/\"\n if re.search(exclude, subpath_str):\n if verbose:\n print(\"TRACE: Excluding {}\".format(subpath_str), file=sys.stderr)\n return True\n return False\n\n\ndef verify_module(fscache: FileSystemCache, id: str, path: str, prefix: str) -> bool:\n \"\"\"Check that all packages containing id have a __init__ file.\"\"\"\n if path.endswith(('__init__.py', '__init__.pyi')):\n path = os.path.dirname(path)\n for i in range(id.count('.')):\n path = os.path.dirname(path)\n if not any(fscache.isfile_case(os.path.join(path, '__init__{}'.format(extension)),\n prefix)\n for extension in PYTHON_EXTENSIONS):\n return False\n return True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_compute_search_paths.for_site_dir_in_site_pack_compute_search_paths.return.SearchPaths_python_path_t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_compute_search_paths.for_site_dir_in_site_pack_compute_search_paths.return.SearchPaths_python_path_t", "embedding": null, "metadata": {"file_path": "mypy/modulefinder.py", "file_name": "modulefinder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 693, "end_line": 711, "span_ids": ["compute_search_paths"], "tokens": 276}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def compute_search_paths(sources: List[BuildSource],\n options: Options,\n data_dir: str,\n alt_lib_path: Optional[str] = None) -> SearchPaths:\n # ... other code\n for site_dir in site_packages:\n assert site_dir not in lib_path\n if (site_dir in mypypath or\n any(p.startswith(site_dir + os.path.sep) for p in mypypath) or\n os.path.altsep and any(p.startswith(site_dir + os.path.altsep) for p in mypypath)):\n print(\"{} is in the MYPYPATH. Please remove it.\".format(site_dir), file=sys.stderr)\n print(\"See https://mypy.readthedocs.io/en/stable/running_mypy.html\"\n \"#how-mypy-handles-imports for more info\", file=sys.stderr)\n sys.exit(1)\n elif site_dir in python_path:\n print(\"{} is in the PYTHONPATH. Please change directory\"\n \" so it is not.\".format(site_dir),\n file=sys.stderr)\n sys.exit(1)\n\n return SearchPaths(python_path=tuple(reversed(python_path)),\n mypy_path=tuple(mypypath),\n package_path=tuple(egg_dirs + site_packages),\n typeshed_path=tuple(lib_path))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_RefExpr_RefExpr.__init__._type_Optional_mypy_typ": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/nodes.py_RefExpr_RefExpr.__init__._type_Optional_mypy_typ", "embedding": null, "metadata": {"file_path": "mypy/nodes.py", "file_name": "nodes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1448, "end_line": 1472, "span_ids": ["RefExpr.__init__", "RefExpr"], "tokens": 268}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RefExpr(Expression):\n \"\"\"Abstract base class for name-like constructs\"\"\"\n\n __slots__ = ('kind', 'node', 'fullname', 'is_new_def', 'is_inferred_def', 'is_alias_rvalue',\n 'type_guard')\n\n def __init__(self) -> None:\n super().__init__()\n # LDEF/GDEF/MDEF/... (None if not available)\n self.kind = None # type: Optional[int]\n # Var, FuncDef or TypeInfo that describes this\n self.node = None # type: Optional[SymbolNode]\n # Fully qualified name (or name if not global)\n self.fullname = None # type: Optional[str]\n # Does this define a new name?\n self.is_new_def = False\n # Does this define a new name with inferred type?\n #\n # For members, after semantic analysis, this does not take base\n # classes into consideration at all; the type checker deals with these.\n self.is_inferred_def = False\n # Is this expression appears as an rvalue of a valid type alias definition?\n self.is_alias_rvalue = False\n # Cache type guard from callable_type.type_guard\n self.type_guard = None # type: Optional[mypy.types.Type]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/options.py_Options._Options_collected_from_Options.__init__.self.raise_exceptions.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/options.py_Options._Options_collected_from_Options.__init__.self.raise_exceptions.False", "embedding": null, "metadata": {"file_path": "mypy/options.py", "file_name": "options.py", "file_type": "text/x-python", "category": "implementation", "start_line": 64, "end_line": 258, "span_ids": ["Options.__init__", "Options"], "tokens": 1787}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Options:\n \"\"\"Options collected from flags.\"\"\"\n\n def __init__(self) -> None:\n # Cache for clone_for_module()\n self._per_module_cache = None # type: Optional[Dict[str, Options]]\n\n # -- build options --\n self.build_type = BuildType.STANDARD\n self.python_version = sys.version_info[:2] # type: Tuple[int, int]\n # The executable used to search for PEP 561 packages. If this is None,\n # then mypy does not search for PEP 561 packages.\n self.python_executable = sys.executable # type: Optional[str]\n self.platform = sys.platform\n self.custom_typing_module = None # type: Optional[str]\n self.custom_typeshed_dir = None # type: Optional[str]\n self.mypy_path = [] # type: List[str]\n self.report_dirs = {} # type: Dict[str, str]\n # Show errors in PEP 561 packages/site-packages modules\n self.no_silence_site_packages = False\n self.no_site_packages = False\n self.ignore_missing_imports = False\n self.follow_imports = 'normal' # normal|silent|skip|error\n # Whether to respect the follow_imports setting even for stub files.\n # Intended to be used for disabling specific stubs.\n self.follow_imports_for_stubs = False\n # PEP 420 namespace packages\n # This allows definitions of packages without __init__.py and allows packages to span\n # multiple directories. This flag affects both import discovery and the association of\n # input files/modules/packages to the relevant file and fully qualified module name.\n self.namespace_packages = False\n # Use current directory and MYPYPATH to determine fully qualified module names of files\n # passed by automatically considering their subdirectories as packages. This is only\n # relevant if namespace packages are enabled, since otherwise examining __init__.py's is\n # sufficient to determine module names for files. As a possible alternative, add a single\n # top-level __init__.py to your packages.\n self.explicit_package_bases = False\n # File names, directory names or subpaths to avoid checking\n self.exclude = \"\" # type: str\n\n # disallow_any options\n self.disallow_any_generics = False\n self.disallow_any_unimported = False\n self.disallow_any_expr = False\n self.disallow_any_decorated = False\n self.disallow_any_explicit = False\n\n # Disallow calling untyped functions from typed ones\n self.disallow_untyped_calls = False\n\n # Disallow defining untyped (or incompletely typed) functions\n self.disallow_untyped_defs = False\n\n # Disallow defining incompletely typed functions\n self.disallow_incomplete_defs = False\n\n # Type check unannotated functions\n self.check_untyped_defs = False\n\n # Disallow decorating typed functions with untyped decorators\n self.disallow_untyped_decorators = False\n\n # Disallow subclassing values of type 'Any'\n self.disallow_subclassing_any = False\n\n # Also check typeshed for missing annotations\n self.warn_incomplete_stub = False\n\n # Warn about casting an expression to its inferred type\n self.warn_redundant_casts = False\n\n # Warn about falling off the end of a function returning non-None\n self.warn_no_return = True\n\n # Warn about returning objects of type Any when the function is\n # declared with a precise type\n self.warn_return_any = False\n\n # Warn about unused '# type: ignore' comments\n self.warn_unused_ignores = False\n\n # Warn about unused '[mypy-] config sections\n self.warn_unused_configs = False\n\n # Files in which to ignore all non-fatal errors\n self.ignore_errors = False\n\n # Apply strict None checking\n self.strict_optional = True\n\n # Show \"note: In function \"foo\":\" messages.\n self.show_error_context = False\n\n # Use nicer output (when possible).\n self.color_output = True\n self.error_summary = True\n\n # Files in which to allow strict-Optional related errors\n # TODO: Kill this in favor of show_none_errors\n self.strict_optional_whitelist = None # type: Optional[List[str]]\n\n # Alternate way to show/hide strict-None-checking related errors\n self.show_none_errors = True\n\n # Don't assume arguments with default values of None are Optional\n self.no_implicit_optional = False\n\n # Don't re-export names unless they are imported with `from ... as ...`\n self.implicit_reexport = True\n\n # Suppress toplevel errors caused by missing annotations\n self.allow_untyped_globals = False\n\n # Allow variable to be redefined with an arbitrary type in the same block\n # and the same nesting level as the initialization\n self.allow_redefinition = False\n\n # Prohibit equality, identity, and container checks for non-overlapping types.\n # This makes 1 == '1', 1 in ['1'], and 1 is '1' errors.\n self.strict_equality = False\n\n # Report an error for any branches inferred to be unreachable as a result of\n # type analysis.\n self.warn_unreachable = False\n\n # Variable names considered True\n self.always_true = [] # type: List[str]\n\n # Variable names considered False\n self.always_false = [] # type: List[str]\n\n # Error codes to disable\n self.disable_error_code = [] # type: List[str]\n self.disabled_error_codes = set() # type: Set[ErrorCode]\n\n # Error codes to enable\n self.enable_error_code = [] # type: List[str]\n self.enabled_error_codes = set() # type: Set[ErrorCode]\n\n # Use script name instead of __main__\n self.scripts_are_modules = False\n\n # Config file name\n self.config_file = None # type: Optional[str]\n\n # A filename containing a JSON mapping from filenames to\n # mtime/size/hash arrays, used to avoid having to recalculate\n # source hashes as often.\n self.quickstart_file = None # type: Optional[str]\n\n # A comma-separated list of files/directories for mypy to type check;\n # supports globbing\n self.files = None # type: Optional[List[str]]\n\n # Write junit.xml to given file\n self.junit_xml = None # type: Optional[str]\n\n # Caching and incremental checking options\n self.incremental = True\n self.cache_dir = defaults.CACHE_DIR\n self.sqlite_cache = False\n self.debug_cache = False\n self.skip_version_check = False\n self.skip_cache_mtime_checks = False\n self.fine_grained_incremental = False\n # Include fine-grained dependencies in written cache files\n self.cache_fine_grained = False\n # Read cache files in fine-grained incremental mode (cache must include dependencies)\n self.use_fine_grained_cache = False\n\n # Tune certain behaviors when being used as a front-end to mypyc. Set per-module\n # in modules being compiled. Not in the config file or command line.\n self.mypyc = False\n\n # Disable the memory optimization of freeing ASTs when\n # possible. This isn't exposed as a command line option\n # because it is intended for software integrating with\n # mypy. (Like mypyc.)\n self.preserve_asts = False\n\n # PEP 612 support is a work in progress, hide it from users\n self.wip_pep_612 = False\n\n # Paths of user plugins\n self.plugins = [] # type: List[str]\n\n # Per-module options (raw)\n self.per_module_options = OrderedDict() # type: OrderedDict[str, Dict[str, object]]\n self._glob_options = [] # type: List[Tuple[str, Pattern[str]]]\n self.unused_configs = set() # type: Set[str]\n\n # -- development options --\n self.verbosity = 0 # More verbose messages (for troubleshooting)\n self.pdb = False\n self.show_traceback = False\n self.raise_exceptions = False\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/options.py_Options.__init__.self.dump_type_stats_Options.__init__.self.install_types.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/options.py_Options.__init__.self.dump_type_stats_Options.__init__.self.install_types.False", "embedding": null, "metadata": {"file_path": "mypy/options.py", "file_name": "options.py", "file_type": "text/x-python", "category": "implementation", "start_line": 259, "end_line": 297, "span_ids": ["Options.__init__"], "tokens": 415}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Options:\n\n def __init__(self) -> None:\n # ... other code\n self.dump_type_stats = False\n self.dump_inference_stats = False\n self.dump_build_stats = False\n\n # -- test options --\n # Stop after the semantic analysis phase\n self.semantic_analysis_only = False\n\n # Use stub builtins fixtures to speed up tests\n self.use_builtins_fixtures = False\n\n # -- experimental options --\n self.shadow_file = None # type: Optional[List[List[str]]]\n self.show_column_numbers = False # type: bool\n self.show_error_codes = False\n # Use soft word wrap and show trimmed source snippets with error location markers.\n self.pretty = False\n self.dump_graph = False\n self.dump_deps = False\n self.logical_deps = False\n # If True, partial types can't span a module top level and a function\n self.local_partial_types = False\n # Some behaviors are changed when using Bazel (https://bazel.build).\n self.bazel = False\n # If True, export inferred types for all expressions as BuildResult.types\n self.export_types = False\n # List of package roots -- directories under these are packages even\n # if they don't have __init__.py.\n self.package_root = [] # type: List[str]\n self.cache_map = {} # type: Dict[str, Tuple[str, str]]\n # Don't properly free objects on exit, just kill the current process.\n self.fast_exit = False\n # Used to transform source code before parsing if not None\n # TODO: Make the type precise (AnyStr -> AnyStr)\n self.transform_source = None # type: Optional[Callable[[Any], Any]]\n # Print full path to each file in the report.\n self.show_absolute_path = False # type: bool\n # Install missing stub packages if True\n self.install_types = False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_FineGrainedBuildManager.trigger_FineGrainedBuildManager.flush_cache.self_manager_ast_cache_cl": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/server/update.py_FineGrainedBuildManager.trigger_FineGrainedBuildManager.flush_cache.self_manager_ast_cache_cl", "embedding": null, "metadata": {"file_path": "mypy/server/update.py", "file_name": "update.py", "file_type": "text/x-python", "category": "implementation", "start_line": 277, "end_line": 297, "span_ids": ["FineGrainedBuildManager.flush_cache", "FineGrainedBuildManager.trigger"], "tokens": 170}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FineGrainedBuildManager:\n\n def trigger(self, target: str) -> List[str]:\n \"\"\"Trigger a specific target explicitly.\n\n This is intended for use by the suggestions engine.\n \"\"\"\n self.manager.errors.reset()\n changed_modules = propagate_changes_using_dependencies(\n self.manager, self.graph, self.deps, set(), set(),\n self.previous_targets_with_errors | {target}, [])\n # Preserve state needed for the next update.\n self.previous_targets_with_errors = self.manager.errors.targets()\n self.previous_messages = self.manager.errors.new_messages()[:]\n return self.update(changed_modules, [])\n\n def flush_cache(self) -> None:\n \"\"\"Flush AST cache.\n\n This needs to be called after each increment, or file changes won't\n be detected reliably.\n \"\"\"\n self.manager.ast_cache.clear()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubdoc.py_infer_arg_sig_from_anon_docstring_infer_ret_type_sig_from_anon_docstring.return.infer_ret_type_sig_from_d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubdoc.py_infer_arg_sig_from_anon_docstring_infer_ret_type_sig_from_anon_docstring.return.infer_ret_type_sig_from_d", "embedding": null, "metadata": {"file_path": "mypy/stubdoc.py", "file_name": "stubdoc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 243, "end_line": 261, "span_ids": ["infer_ret_type_sig_from_docstring", "infer_arg_sig_from_anon_docstring", "infer_ret_type_sig_from_anon_docstring"], "tokens": 220}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def infer_arg_sig_from_anon_docstring(docstr: str) -> List[ArgSig]:\n \"\"\"Convert signature in form of \"(self: TestClass, arg0: str='ada')\" to List[TypedArgList].\"\"\"\n ret = infer_sig_from_docstring(\"stub\" + docstr, \"stub\")\n if ret:\n return ret[0].args\n return []\n\n\ndef infer_ret_type_sig_from_docstring(docstr: str, name: str) -> Optional[str]:\n \"\"\"Convert signature in form of \"func(self: TestClass, arg0) -> int\" to their return type.\"\"\"\n ret = infer_sig_from_docstring(docstr, name)\n if ret:\n return ret[0].ret_type\n return None\n\n\ndef infer_ret_type_sig_from_anon_docstring(docstr: str) -> Optional[str]:\n \"\"\"Convert signature in form of \"(self: TestClass, arg0) -> int\" to their return type.\"\"\"\n return infer_ret_type_sig_from_docstring(\"stub\" + docstr.strip(), \"stub\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubSource_StubSource.path.return.self_source_path": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubSource_StubSource.path.return.self_source_path", "embedding": null, "metadata": {"file_path": "mypy/stubgen.py", "file_name": "stubgen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 195, "end_line": 213, "span_ids": ["StubSource.__init__", "StubSource.path", "StubSource.module", "StubSource"], "tokens": 150}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubSource:\n \"\"\"A single source for stub: can be a Python or C module.\n\n A simple extension of BuildSource that also carries the AST and\n the value of __all__ detected at runtime.\n \"\"\"\n def __init__(self, module: str, path: Optional[str] = None,\n runtime_all: Optional[List[str]] = None) -> None:\n self.source = BuildSource(path, module, None)\n self.runtime_all = runtime_all\n self.ast = None # type: Optional[MypyFile]\n\n @property\n def module(self) -> str:\n return self.source.module\n\n @property\n def path(self) -> Optional[str]:\n return self.source.path", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.visit_overloaded_func_def_StubGenerator.visit_overloaded_func_def.for_item_in_o_items_.if_not_overload_chain_.else_.self_clear_decorators_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.visit_overloaded_func_def_StubGenerator.visit_overloaded_func_def.for_item_in_o_items_.if_not_overload_chain_.else_.self_clear_decorators_", "embedding": null, "metadata": {"file_path": "mypy/stubgen.py", "file_name": "stubgen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 570, "end_line": 590, "span_ids": ["StubGenerator.visit_overloaded_func_def"], "tokens": 193}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubGenerator(mypy.traverser.TraverserVisitor):\n\n def visit_overloaded_func_def(self, o: OverloadedFuncDef) -> None:\n \"\"\"@property with setters and getters, or @overload chain\"\"\"\n overload_chain = False\n for item in o.items:\n if not isinstance(item, Decorator):\n continue\n\n if self.is_private_name(item.func.name, item.func.fullname):\n continue\n\n is_abstract, is_overload = self.process_decorator(item)\n\n if not overload_chain:\n self.visit_func_def(item.func, is_abstract=is_abstract, is_overload=is_overload)\n if is_overload:\n overload_chain = True\n elif overload_chain and is_overload:\n self.visit_func_def(item.func, is_abstract=is_abstract, is_overload=is_overload)\n else:\n # skip the overload implementation and clear the decorator we just processed\n self.clear_decorators()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.visit_decorator_StubGenerator.process_decorator.return.is_abstract_is_overload": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.visit_decorator_StubGenerator.process_decorator.return.is_abstract_is_overload", "embedding": null, "metadata": {"file_path": "mypy/stubgen.py", "file_name": "stubgen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 673, "end_line": 700, "span_ids": ["StubGenerator.visit_decorator", "StubGenerator.process_decorator"], "tokens": 286}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubGenerator(mypy.traverser.TraverserVisitor):\n\n def visit_decorator(self, o: Decorator) -> None:\n if self.is_private_name(o.func.name, o.func.fullname):\n return\n\n is_abstract, _ = self.process_decorator(o)\n self.visit_func_def(o.func, is_abstract=is_abstract)\n\n def process_decorator(self, o: Decorator) -> Tuple[bool, bool]:\n \"\"\"Process a series of decorataors.\n\n Only preserve certain special decorators such as @abstractmethod.\n\n Return a pair of booleans:\n - True if any of the decorators makes a method abstract.\n - True if any of the decorators is typing.overload.\n \"\"\"\n is_abstract = False\n is_overload = False\n for decorator in o.original_decorators:\n if isinstance(decorator, NameExpr):\n i_is_abstract, i_is_overload = self.process_name_expr_decorator(decorator, o)\n is_abstract = is_abstract or i_is_abstract\n is_overload = is_overload or i_is_overload\n elif isinstance(decorator, MemberExpr):\n i_is_abstract, i_is_overload = self.process_member_expr_decorator(decorator, o)\n is_abstract = is_abstract or i_is_abstract\n is_overload = is_overload or i_is_overload\n return is_abstract, is_overload", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.process_member_expr_decorator_StubGenerator.process_member_expr_decorator.return.is_abstract_is_overload": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgen.py_StubGenerator.process_member_expr_decorator_StubGenerator.process_member_expr_decorator.return.is_abstract_is_overload", "embedding": null, "metadata": {"file_path": "mypy/stubgen.py", "file_name": "stubgen.py", "file_type": "text/x-python", "category": "implementation", "start_line": 740, "end_line": 791, "span_ids": ["StubGenerator.process_member_expr_decorator"], "tokens": 550}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubGenerator(mypy.traverser.TraverserVisitor):\n\n def process_member_expr_decorator(self, expr: MemberExpr, context: Decorator) -> Tuple[bool,\n bool]:\n \"\"\"Process a function decorator of form @foo.bar.\n\n Only preserve certain special decorators such as @abstractmethod.\n\n Return a pair of booleans:\n - True if the decorator makes a method abstract.\n - True if the decorator is typing.overload.\n \"\"\"\n is_abstract = False\n is_overload = False\n if expr.name == 'setter' and isinstance(expr.expr, NameExpr):\n self.add_decorator('%s.setter' % expr.expr.name)\n elif (isinstance(expr.expr, NameExpr) and\n (expr.expr.name == 'abc' or\n self.import_tracker.reverse_alias.get(expr.expr.name) == 'abc') and\n expr.name in ('abstractmethod', 'abstractproperty')):\n if expr.name == 'abstractproperty':\n self.import_tracker.require_name(expr.expr.name)\n self.add_decorator('%s' % ('property'))\n self.add_decorator('%s.%s' % (expr.expr.name, 'abstractmethod'))\n else:\n self.import_tracker.require_name(expr.expr.name)\n self.add_decorator('%s.%s' % (expr.expr.name, expr.name))\n is_abstract = True\n elif expr.name == 'coroutine':\n if (isinstance(expr.expr, MemberExpr) and\n expr.expr.name == 'coroutines' and\n isinstance(expr.expr.expr, NameExpr) and\n (expr.expr.expr.name == 'asyncio' or\n self.import_tracker.reverse_alias.get(expr.expr.expr.name) ==\n 'asyncio')):\n self.add_coroutine_decorator(context.func,\n '%s.coroutines.coroutine' %\n (expr.expr.expr.name,),\n expr.expr.expr.name)\n elif (isinstance(expr.expr, NameExpr) and\n (expr.expr.name in ('asyncio', 'types') or\n self.import_tracker.reverse_alias.get(expr.expr.name) in\n ('asyncio', 'asyncio.coroutines', 'types'))):\n self.add_coroutine_decorator(context.func,\n expr.expr.name + '.coroutine',\n expr.expr.name)\n elif (isinstance(expr.expr, NameExpr) and\n (expr.expr.name == 'typing' or\n self.import_tracker.reverse_alias.get(expr.expr.name) == 'typing') and\n expr.name == 'overload'):\n self.import_tracker.require_name(expr.expr.name)\n self.add_decorator('%s.%s' % (expr.expr.name, 'overload'))\n is_overload = True\n return is_abstract, is_overload", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgenc.py_add_typing_import_is_pybind11_overloaded_function_docstring.return.docstr_startswith_ar": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgenc.py_add_typing_import_is_pybind11_overloaded_function_docstring.return.docstr_startswith_ar", "embedding": null, "metadata": {"file_path": "mypy/stubgenc.py", "file_name": "stubgenc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 95, "end_line": 136, "span_ids": ["add_typing_import", "is_c_classmethod", "is_c_property", "is_c_method", "is_pybind11_overloaded_function_docstring", "is_c_type", "is_c_function", "is_c_property_readonly"], "tokens": 329}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_typing_import(output: List[str]) -> List[str]:\n \"\"\"Add typing imports for collections/types that occur in the generated stub.\"\"\"\n names = []\n for name in _DEFAULT_TYPING_IMPORTS:\n if any(re.search(r'\\b%s\\b' % name, line) for line in output):\n names.append(name)\n if names:\n return ['from typing import %s' % ', '.join(names), ''] + output\n else:\n return output[:]\n\n\ndef is_c_function(obj: object) -> bool:\n return inspect.isbuiltin(obj) or type(obj) is type(ord)\n\n\ndef is_c_method(obj: object) -> bool:\n return inspect.ismethoddescriptor(obj) or type(obj) in (type(str.index),\n type(str.__add__),\n type(str.__new__))\n\n\ndef is_c_classmethod(obj: object) -> bool:\n return inspect.isbuiltin(obj) or type(obj).__name__ in ('classmethod',\n 'classmethod_descriptor')\n\n\ndef is_c_property(obj: object) -> bool:\n return inspect.isdatadescriptor(obj) and hasattr(obj, 'fget')\n\n\ndef is_c_property_readonly(prop: Any) -> bool:\n return prop.fset is None\n\n\ndef is_c_type(obj: object) -> bool:\n return inspect.isclass(obj) or type(obj) is type(int)\n\n\ndef is_pybind11_overloaded_function_docstring(docstr: str, name: str) -> bool:\n return docstr.startswith(\"{}(*args, **kwargs)\\n\".format(name) +\n \"Overloaded function.\\n\\n\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgenc.py_strip_or_import_is_static_property.return.type_obj___name___py": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgenc.py_strip_or_import_is_static_property.return.type_obj___name___py", "embedding": null, "metadata": {"file_path": "mypy/stubgenc.py", "file_name": "stubgenc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 213, "end_line": 248, "span_ids": ["strip_or_import", "is_static_property"], "tokens": 320}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def strip_or_import(typ: str, module: ModuleType, imports: List[str]) -> str:\n \"\"\"Strips unnecessary module names from typ.\n\n If typ represents a type that is inside module or is a type coming from builtins, remove\n module declaration from it. Return stripped name of the type.\n\n Arguments:\n typ: name of the type\n module: in which this type is used\n imports: list of import statements (may be modified during the call)\n \"\"\"\n stripped_type = typ\n if any(c in typ for c in '[,'):\n for subtyp in re.split(r'[\\[,\\]]', typ):\n strip_or_import(subtyp.strip(), module, imports)\n if module:\n stripped_type = re.sub(\n r'(^|[\\[, ]+)' + re.escape(module.__name__ + '.'),\n r'\\1',\n typ,\n )\n elif module and typ.startswith(module.__name__ + '.'):\n stripped_type = typ[len(module.__name__) + 1:]\n elif '.' in typ:\n arg_module = typ[:typ.rindex('.')]\n if arg_module == 'builtins':\n stripped_type = typ[len('builtins') + 1:]\n else:\n imports.append('import %s' % (arg_module,))\n if stripped_type == 'NoneType':\n stripped_type = 'None'\n return stripped_type\n\n\ndef is_static_property(obj: object) -> bool:\n return type(obj).__name__ == 'pybind11_static_property'", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgenc.py_generate_c_property_stub_generate_c_property_stub.if_is_static_property_obj.else_regular_property.if_readonly_.else_.rw_properties_append_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgenc.py_generate_c_property_stub_generate_c_property_stub.if_is_static_property_obj.else_regular_property.if_readonly_.else_.rw_properties_append_", "embedding": null, "metadata": {"file_path": "mypy/stubgenc.py", "file_name": "stubgenc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 251, "end_line": 294, "span_ids": ["generate_c_property_stub"], "tokens": 376}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_c_property_stub(name: str, obj: object,\n static_properties: List[str],\n rw_properties: List[str],\n ro_properties: List[str], readonly: bool,\n module: Optional[ModuleType] = None,\n imports: Optional[List[str]] = None) -> None:\n \"\"\"Generate property stub using introspection of 'obj'.\n\n Try to infer type from docstring, append resulting lines to 'output'.\n \"\"\"\n\n def infer_prop_type(docstr: Optional[str]) -> Optional[str]:\n \"\"\"Infer property type from docstring or docstring signature.\"\"\"\n if docstr is not None:\n inferred = infer_ret_type_sig_from_anon_docstring(docstr)\n if not inferred:\n inferred = infer_ret_type_sig_from_docstring(docstr, name)\n if not inferred:\n inferred = infer_prop_type_from_docstring(docstr)\n return inferred\n else:\n return None\n\n inferred = infer_prop_type(getattr(obj, '__doc__', None))\n if not inferred:\n fget = getattr(obj, 'fget', None)\n inferred = infer_prop_type(getattr(fget, '__doc__', None))\n if not inferred:\n inferred = 'Any'\n\n if module is not None and imports is not None:\n inferred = strip_or_import(inferred, module, imports)\n\n if is_static_property(obj):\n trailing_comment = \" # read-only\" if readonly else \"\"\n static_properties.append(\n '{}: ClassVar[{}] = ...{}'.format(name, inferred, trailing_comment)\n )\n else: # regular property\n if readonly:\n ro_properties.append('@property')\n ro_properties.append('def {}(self) -> {}: ...'.format(name, inferred))\n else:\n rw_properties.append('{}: {}'.format(name, inferred))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgenc.py_generate_c_type_stub_generate_c_type_stub.if_bases_.else_.bases_str._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgenc.py_generate_c_type_stub_generate_c_type_stub.if_bases_.else_.bases_str._", "embedding": null, "metadata": {"file_path": "mypy/stubgenc.py", "file_name": "stubgenc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 297, "end_line": 379, "span_ids": ["generate_c_type_stub"], "tokens": 817}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_c_type_stub(module: ModuleType,\n class_name: str,\n obj: type,\n output: List[str],\n imports: List[str],\n sigs: Optional[Dict[str, str]] = None,\n class_sigs: Optional[Dict[str, str]] = None) -> None:\n \"\"\"Generate stub for a single class using runtime introspection.\n\n The result lines will be appended to 'output'. If necessary, any\n required names will be added to 'imports'.\n \"\"\"\n # typeshed gives obj.__dict__ the not quite correct type Dict[str, Any]\n # (it could be a mappingproxy!), which makes mypyc mad, so obfuscate it.\n obj_dict = getattr(obj, '__dict__') # type: Mapping[str, Any] # noqa\n items = sorted(obj_dict.items(), key=lambda x: method_name_sort_key(x[0]))\n methods = [] # type: List[str]\n types = [] # type: List[str]\n static_properties = [] # type: List[str]\n rw_properties = [] # type: List[str]\n ro_properties = [] # type: List[str]\n done = set() # type: Set[str]\n for attr, value in items:\n if is_c_method(value) or is_c_classmethod(value):\n done.add(attr)\n if not is_skipped_attribute(attr):\n if attr == '__new__':\n # TODO: We should support __new__.\n if '__init__' in obj_dict:\n # Avoid duplicate functions if both are present.\n # But is there any case where .__new__() has a\n # better signature than __init__() ?\n continue\n attr = '__init__'\n if is_c_classmethod(value):\n methods.append('@classmethod')\n self_var = 'cls'\n else:\n self_var = 'self'\n generate_c_function_stub(module, attr, value, methods, imports=imports,\n self_var=self_var, sigs=sigs, class_name=class_name,\n class_sigs=class_sigs)\n elif is_c_property(value):\n done.add(attr)\n generate_c_property_stub(attr, value, static_properties, rw_properties, ro_properties,\n is_c_property_readonly(value),\n module=module, imports=imports)\n elif is_c_type(value):\n generate_c_type_stub(module, attr, value, types, imports=imports, sigs=sigs,\n class_sigs=class_sigs)\n done.add(attr)\n\n for attr, value in items:\n if is_skipped_attribute(attr):\n continue\n if attr not in done:\n static_properties.append('%s: ClassVar[%s] = ...' % (\n attr, strip_or_import(get_type_fullname(type(value)), module, imports)))\n all_bases = type.mro(obj)\n if all_bases[-1] is object:\n # TODO: Is this always object?\n del all_bases[-1]\n # remove pybind11_object. All classes generated by pybind11 have pybind11_object in their MRO,\n # which only overrides a few functions in object type\n if all_bases and all_bases[-1].__name__ == 'pybind11_object':\n del all_bases[-1]\n # remove the class itself\n all_bases = all_bases[1:]\n # Remove base classes of other bases as redundant.\n bases = [] # type: List[type]\n for base in all_bases:\n if not any(issubclass(b, base) for b in bases):\n bases.append(base)\n if bases:\n bases_str = '(%s)' % ', '.join(\n strip_or_import(\n get_type_fullname(base),\n module,\n imports\n ) for base in bases\n )\n else:\n bases_str = ''\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgenc.py_generate_c_type_stub.if_types_or_static_proper_generate_c_type_stub.if_types_or_static_proper.else_.output_append_class_s_s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgenc.py_generate_c_type_stub.if_types_or_static_proper_generate_c_type_stub.if_types_or_static_proper.else_.output_append_class_s_s", "embedding": null, "metadata": {"file_path": "mypy/stubgenc.py", "file_name": "stubgenc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 380, "end_line": 396, "span_ids": ["generate_c_type_stub"], "tokens": 241}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_c_type_stub(module: ModuleType,\n class_name: str,\n obj: type,\n output: List[str],\n imports: List[str],\n sigs: Optional[Dict[str, str]] = None,\n class_sigs: Optional[Dict[str, str]] = None) -> None:\n # ... other code\n if types or static_properties or rw_properties or methods or ro_properties:\n output.append('class %s%s:' % (class_name, bases_str))\n for line in types:\n if output and output[-1] and \\\n not output[-1].startswith('class') and line.startswith('class'):\n output.append('')\n output.append(' ' + line)\n for line in static_properties:\n output.append(' %s' % line)\n for line in rw_properties:\n output.append(' %s' % line)\n for line in methods:\n output.append(' %s' % line)\n for line in ro_properties:\n output.append(' %s' % line)\n else:\n output.append('class %s%s: ...' % (class_name, bases_str))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgenc.py_get_type_fullname_is_skipped_attribute.return._attr_in___getattribute": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubgenc.py_get_type_fullname_is_skipped_attribute.return._attr_in___getattribute", "embedding": null, "metadata": {"file_path": "mypy/stubgenc.py", "file_name": "stubgenc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 399, "end_line": 428, "span_ids": ["get_type_fullname", "is_skipped_attribute", "is_pybind_skipped_attribute", "method_name_sort_key"], "tokens": 219}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_type_fullname(typ: type) -> str:\n return '%s.%s' % (typ.__module__, getattr(typ, '__qualname__', typ.__name__))\n\n\ndef method_name_sort_key(name: str) -> Tuple[int, str]:\n \"\"\"Sort methods in classes in a typical order.\n\n I.e.: constructor, normal methods, special methods.\n \"\"\"\n if name in ('__new__', '__init__'):\n return 0, name\n if name.startswith('__') and name.endswith('__'):\n return 2, name\n return 1, name\n\n\ndef is_pybind_skipped_attribute(attr: str) -> bool:\n return attr.startswith(\"__pybind11_module_local_\")\n\n\ndef is_skipped_attribute(attr: str) -> bool:\n return (attr in ('__getattribute__',\n '__str__',\n '__repr__',\n '__doc__',\n '__dict__',\n '__module__',\n '__weakref__') # For pickling\n or is_pybind_skipped_attribute(attr)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubinfo.py_legacy_bundled_packages_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubinfo.py_legacy_bundled_packages_", "embedding": null, "metadata": {"file_path": "mypy/stubinfo.py", "file_name": "stubinfo.py", "file_type": "text/x-python", "category": "implementation", "start_line": 4, "end_line": 86, "span_ids": ["docstring"], "tokens": 875}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "legacy_bundled_packages = {\n 'aiofiles': 'types-aiofiles',\n 'atomicwrites': 'types-atomicwrites',\n 'attr': 'types-attrs',\n 'backports': 'types-backports',\n 'backports_abc': 'types-backports_abc',\n 'bleach': 'types-bleach',\n 'boto': 'types-boto',\n 'cachetools': 'types-cachetools',\n 'certifi': 'types-certifi',\n 'characteristic': 'types-characteristic',\n 'chardet': 'types-chardet',\n 'click': 'types-click',\n 'click_spinner': 'types-click-spinner',\n 'concurrent': 'types-futures',\n 'contextvars': 'types-contextvars',\n 'croniter': 'types-croniter',\n 'Crypto': 'types-pycrypto',\n 'cryptography': 'types-cryptography',\n 'dataclasses': 'types-dataclasses',\n 'dateparser': 'types-dateparser',\n 'datetimerange': 'types-DateTimeRange',\n 'dateutil': 'types-python-dateutil',\n 'decorator': 'types-decorator',\n 'deprecated': 'types-Deprecated',\n 'docutils': 'types-docutils',\n 'emoji': 'types-emoji',\n 'enum': 'types-enum34',\n 'fb303': 'types-fb303',\n 'filelock': 'types-filelock',\n 'first': 'types-first',\n 'flask': 'types-Flask',\n 'freezegun': 'types-freezegun',\n 'frozendict': 'types-frozendict',\n 'geoip2': 'types-geoip2',\n 'gflags': 'types-python-gflags',\n 'google': 'types-protobuf',\n 'ipaddress': 'types-ipaddress',\n 'itsdangerous': 'types-itsdangerous',\n 'jinja2': 'types-Jinja2',\n 'jwt': 'types-jwt',\n 'kazoo': 'types-kazoo',\n 'markdown': 'types-Markdown',\n 'markupsafe': 'types-MarkupSafe',\n 'maxminddb': 'types-maxminddb',\n 'mock': 'types-mock',\n 'mypy_extensions': 'types-mypy-extensions',\n 'OpenSSL': 'types-openssl-python',\n 'orjson': 'types-orjson',\n 'paramiko': 'types-paramiko',\n 'pathlib2': 'types-pathlib2',\n 'pkg_resources': 'types-pkg_resources',\n 'polib': 'types-polib',\n 'pycurl': 'types-pycurl',\n 'pymssql': 'types-pymssql',\n 'pymysql': 'types-PyMySQL',\n 'pynamodb': 'types-pynamodb',\n 'pyre_extensions': 'types-pyre-extensions',\n 'pyrfc3339': 'types-pyRFC3339',\n 'python2': 'types-six',\n 'pytz': 'types-pytz',\n 'pyVmomi': 'types-pyvmomi',\n 'redis': 'types-redis',\n 'requests': 'types-requests',\n 'retry': 'types-retry',\n 'routes': 'types-Routes',\n 'scribe': 'types-scribe',\n 'simplejson': 'types-simplejson',\n 'singledispatch': 'types-singledispatch',\n 'six': 'types-six',\n 'slugify': 'types-python-slugify',\n 'tabulate': 'types-tabulate',\n 'termcolor': 'types-termcolor',\n 'toml': 'types-toml',\n 'tornado': 'types-tornado',\n 'typed_ast': 'types-typed-ast',\n 'tzlocal': 'types-tzlocal',\n 'ujson': 'types-ujson',\n 'waitress': 'types-waitress',\n 'werkzeug': 'types-Werkzeug',\n 'yaml': 'types-PyYAML',\n}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py__verify_arg_default_value_maybe_strip_cls.return.args": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/stubtest.py__verify_arg_default_value_maybe_strip_cls.return.args", "embedding": null, "metadata": {"file_path": "mypy/stubtest.py", "file_name": "stubtest.py", "file_type": "text/x-python", "category": "implementation", "start_line": 338, "end_line": 386, "span_ids": ["maybe_strip_cls", "_verify_arg_default_value"], "tokens": 464}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _verify_arg_default_value(\n stub_arg: nodes.Argument, runtime_arg: inspect.Parameter\n) -> Iterator[str]:\n \"\"\"Checks whether argument default values are compatible.\"\"\"\n if runtime_arg.default != inspect.Parameter.empty:\n if stub_arg.kind not in (nodes.ARG_OPT, nodes.ARG_NAMED_OPT):\n yield (\n 'runtime argument \"{}\" has a default value but stub argument does not'.format(\n runtime_arg.name\n )\n )\n else:\n runtime_type = get_mypy_type_of_runtime_value(runtime_arg.default)\n # Fallback to the type annotation type if var type is missing. The type annotation\n # is an UnboundType, but I don't know enough to know what the pros and cons here are.\n # UnboundTypes have ugly question marks following them, so default to var type.\n # Note we do this same fallback when constructing signatures in from_overloadedfuncdef\n stub_type = stub_arg.variable.type or stub_arg.type_annotation\n if isinstance(stub_type, mypy.types.TypeVarType):\n stub_type = stub_type.upper_bound\n if (\n runtime_type is not None\n and stub_type is not None\n # Avoid false positives for marker objects\n and type(runtime_arg.default) != object\n and not is_subtype_helper(runtime_type, stub_type)\n ):\n yield (\n 'runtime argument \"{}\" has a default value of type {}, '\n \"which is incompatible with stub argument type {}\".format(\n runtime_arg.name, runtime_type, stub_type\n )\n )\n else:\n if stub_arg.kind in (nodes.ARG_OPT, nodes.ARG_NAMED_OPT):\n yield (\n 'stub argument \"{}\" has a default value but runtime argument does not'.format(\n stub_arg.variable.name\n )\n )\n\n\ndef maybe_strip_cls(name: str, args: List[nodes.Argument]) -> List[nodes.Argument]:\n if name in (\"__init_subclass__\", \"__class_getitem__\"):\n # These are implicitly classmethods. If the stub chooses not to have @classmethod, we\n # should remove the cls argument\n if args[0].variable.name == \"cls\":\n return args[1:]\n return args", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/test_find_sources.py_os_FakeFSCache.init_under_package_root.return.False": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/test_find_sources.py_os_FakeFSCache.init_under_package_root.return.False", "embedding": null, "metadata": {"file_path": "mypy/test/test_find_sources.py", "file_name": "test_find_sources.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 33, "span_ids": ["FakeFSCache.isdir", "FakeFSCache.isfile", "imports", "FakeFSCache.listdir", "FakeFSCache.init_under_package_root", "FakeFSCache.__init__", "FakeFSCache"], "tokens": 248}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os\nimport pytest\nimport shutil\nimport tempfile\nimport unittest\nfrom typing import List, Optional, Set, Tuple\n\nfrom mypy.find_sources import InvalidSourceList, SourceFinder, create_source_list\nfrom mypy.fscache import FileSystemCache\nfrom mypy.modulefinder import BuildSource\nfrom mypy.options import Options\nfrom mypy.modulefinder import BuildSource\n\n\nclass FakeFSCache(FileSystemCache):\n def __init__(self, files: Set[str]) -> None:\n self.files = {os.path.abspath(f) for f in files}\n\n def isfile(self, file: str) -> bool:\n return file in self.files\n\n def isdir(self, dir: str) -> bool:\n if not dir.endswith(os.sep):\n dir += os.sep\n return any(f.startswith(dir) for f in self.files)\n\n def listdir(self, dir: str) -> List[str]:\n if not dir.endswith(os.sep):\n dir += os.sep\n return list(set(f[len(dir):].split(os.sep)[0] for f in self.files if f.startswith(dir)))\n\n def init_under_package_root(self, file: str) -> bool:\n return False", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/test_find_sources.py_SourceFinderSuite.test_find_sources_in_dir_no_namespace_SourceFinderSuite.test_find_sources_in_dir_no_namespace.assert_find_sources_in_di": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/test_find_sources.py_SourceFinderSuite.test_find_sources_in_dir_no_namespace_SourceFinderSuite.test_find_sources_in_dir_no_namespace.assert_find_sources_in_di", "embedding": null, "metadata": {"file_path": "mypy/test/test_find_sources.py", "file_name": "test_find_sources.py", "file_type": "text/x-python", "category": "test", "start_line": 195, "end_line": 213, "span_ids": ["SourceFinderSuite.test_find_sources_in_dir_no_namespace"], "tokens": 170}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SourceFinderSuite(unittest.TestCase):\n\n def test_find_sources_in_dir_no_namespace(self) -> None:\n options = Options()\n options.namespace_packages = False\n\n files = {\n \"/pkg/a1/b/c/d/e.py\",\n \"/pkg/a1/b/f.py\",\n \"/pkg/a2/__init__.py\",\n \"/pkg/a2/b/c/d/e.py\",\n \"/pkg/a2/b/f.py\",\n }\n finder = SourceFinder(FakeFSCache(files), options)\n assert find_sources_in_dir(finder, \"/\") == [\n (\"a2\", \"/pkg\"),\n (\"e\", \"/pkg/a1/b/c/d\"),\n (\"e\", \"/pkg/a2/b/c/d\"),\n (\"f\", \"/pkg/a1/b\"),\n (\"f\", \"/pkg/a2/b\"),\n ]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/test_find_sources.py_SourceFinderSuite.test_find_sources_in_dir_namespace_SourceFinderSuite.test_find_sources_in_dir_namespace.assert_find_sources_in_di": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/test_find_sources.py_SourceFinderSuite.test_find_sources_in_dir_namespace_SourceFinderSuite.test_find_sources_in_dir_namespace.assert_find_sources_in_di", "embedding": null, "metadata": {"file_path": "mypy/test/test_find_sources.py", "file_name": "test_find_sources.py", "file_type": "text/x-python", "category": "test", "start_line": 215, "end_line": 233, "span_ids": ["SourceFinderSuite.test_find_sources_in_dir_namespace"], "tokens": 169}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SourceFinderSuite(unittest.TestCase):\n\n def test_find_sources_in_dir_namespace(self) -> None:\n options = Options()\n options.namespace_packages = True\n\n files = {\n \"/pkg/a1/b/c/d/e.py\",\n \"/pkg/a1/b/f.py\",\n \"/pkg/a2/__init__.py\",\n \"/pkg/a2/b/c/d/e.py\",\n \"/pkg/a2/b/f.py\",\n }\n finder = SourceFinder(FakeFSCache(files), options)\n assert find_sources_in_dir(finder, \"/\") == [\n (\"a2\", \"/pkg\"),\n (\"a2.b.c.d.e\", \"/pkg\"),\n (\"a2.b.f\", \"/pkg\"),\n (\"e\", \"/pkg/a1/b/c/d\"),\n (\"f\", \"/pkg/a1/b\"),\n ]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/test_find_sources.py_SourceFinderSuite.test_find_sources_in_dir_namespace_explicit_base_SourceFinderSuite.test_find_sources_in_dir_namespace_multi_dir.assert_find_sources_in_di": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/test_find_sources.py_SourceFinderSuite.test_find_sources_in_dir_namespace_explicit_base_SourceFinderSuite.test_find_sources_in_dir_namespace_multi_dir.assert_find_sources_in_di", "embedding": null, "metadata": {"file_path": "mypy/test/test_find_sources.py", "file_name": "test_find_sources.py", "file_type": "text/x-python", "category": "test", "start_line": 235, "end_line": 274, "span_ids": ["SourceFinderSuite.test_find_sources_in_dir_namespace_explicit_base", "SourceFinderSuite.test_find_sources_in_dir_namespace_multi_dir"], "tokens": 382}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SourceFinderSuite(unittest.TestCase):\n\n def test_find_sources_in_dir_namespace_explicit_base(self) -> None:\n options = Options()\n options.namespace_packages = True\n options.explicit_package_bases = True\n options.mypy_path = [\"/\"]\n\n files = {\n \"/pkg/a1/b/c/d/e.py\",\n \"/pkg/a1/b/f.py\",\n \"/pkg/a2/__init__.py\",\n \"/pkg/a2/b/c/d/e.py\",\n \"/pkg/a2/b/f.py\",\n }\n finder = SourceFinder(FakeFSCache(files), options)\n assert find_sources_in_dir(finder, \"/\") == [\n (\"pkg.a1.b.c.d.e\", \"/\"),\n (\"pkg.a1.b.f\", \"/\"),\n (\"pkg.a2\", \"/\"),\n (\"pkg.a2.b.c.d.e\", \"/\"),\n (\"pkg.a2.b.f\", \"/\"),\n ]\n\n options.mypy_path = [\"/pkg\"]\n finder = SourceFinder(FakeFSCache(files), options)\n assert find_sources_in_dir(finder, \"/\") == [\n (\"a1.b.c.d.e\", \"/pkg\"),\n (\"a1.b.f\", \"/pkg\"),\n (\"a2\", \"/pkg\"),\n (\"a2.b.c.d.e\", \"/pkg\"),\n (\"a2.b.f\", \"/pkg\"),\n ]\n\n def test_find_sources_in_dir_namespace_multi_dir(self) -> None:\n options = Options()\n options.namespace_packages = True\n options.explicit_package_bases = True\n options.mypy_path = [\"/a\", \"/b\"]\n\n finder = SourceFinder(FakeFSCache({\"/a/pkg/a.py\", \"/b/pkg/b.py\"}), options)\n assert find_sources_in_dir(finder, \"/\") == [(\"pkg.a\", \"/a\"), (\"pkg.b\", \"/b\")]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/test_find_sources.py_SourceFinderSuite.test_find_sources_exclude_SourceFinderSuite.test_find_sources_exclude.fscache_13.FakeFSCache_files_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/test_find_sources.py_SourceFinderSuite.test_find_sources_exclude_SourceFinderSuite.test_find_sources_exclude.fscache_13.FakeFSCache_files_", "embedding": null, "metadata": {"file_path": "mypy/test/test_find_sources.py", "file_name": "test_find_sources.py", "file_type": "text/x-python", "category": "test", "start_line": 276, "end_line": 352, "span_ids": ["SourceFinderSuite.test_find_sources_exclude"], "tokens": 794}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SourceFinderSuite(unittest.TestCase):\n\n def test_find_sources_exclude(self) -> None:\n options = Options()\n options.namespace_packages = True\n\n # default\n for excluded_dir in [\"site-packages\", \".whatever\", \"node_modules\", \".x/.z\"]:\n fscache = FakeFSCache({\"/dir/a.py\", \"/dir/venv/{}/b.py\".format(excluded_dir)})\n assert find_sources([\"/\"], options, fscache) == [(\"a\", \"/dir\")]\n with pytest.raises(InvalidSourceList):\n find_sources([\"/dir/venv/\"], options, fscache)\n assert find_sources([\"/dir/venv/{}\".format(excluded_dir)], options, fscache) == [\n (\"b\", \"/dir/venv/{}\".format(excluded_dir))\n ]\n assert find_sources([\"/dir/venv/{}/b.py\".format(excluded_dir)], options, fscache) == [\n (\"b\", \"/dir/venv/{}\".format(excluded_dir))\n ]\n\n files = {\n \"/pkg/a1/b/c/d/e.py\",\n \"/pkg/a1/b/f.py\",\n \"/pkg/a2/__init__.py\",\n \"/pkg/a2/b/c/d/e.py\",\n \"/pkg/a2/b/f.py\",\n }\n\n # file name\n options.exclude = r\"/f\\.py$\"\n fscache = FakeFSCache(files)\n assert find_sources([\"/\"], options, fscache) == [\n (\"a2\", \"/pkg\"),\n (\"a2.b.c.d.e\", \"/pkg\"),\n (\"e\", \"/pkg/a1/b/c/d\"),\n ]\n assert find_sources([\"/pkg/a1/b/f.py\"], options, fscache) == [('f', '/pkg/a1/b')]\n assert find_sources([\"/pkg/a2/b/f.py\"], options, fscache) == [('a2.b.f', '/pkg')]\n\n # directory name\n options.exclude = \"/a1/\"\n fscache = FakeFSCache(files)\n assert find_sources([\"/\"], options, fscache) == [\n (\"a2\", \"/pkg\"),\n (\"a2.b.c.d.e\", \"/pkg\"),\n (\"a2.b.f\", \"/pkg\"),\n ]\n with pytest.raises(InvalidSourceList):\n find_sources([\"/pkg/a1\"], options, fscache)\n with pytest.raises(InvalidSourceList):\n find_sources([\"/pkg/a1/\"], options, fscache)\n with pytest.raises(InvalidSourceList):\n find_sources([\"/pkg/a1/b\"], options, fscache)\n\n options.exclude = \"/a1/$\"\n assert find_sources([\"/pkg/a1\"], options, fscache) == [\n ('e', '/pkg/a1/b/c/d'), ('f', '/pkg/a1/b')\n ]\n\n # paths\n options.exclude = \"/pkg/a1/\"\n fscache = FakeFSCache(files)\n assert find_sources([\"/\"], options, fscache) == [\n (\"a2\", \"/pkg\"),\n (\"a2.b.c.d.e\", \"/pkg\"),\n (\"a2.b.f\", \"/pkg\"),\n ]\n with pytest.raises(InvalidSourceList):\n find_sources([\"/pkg/a1\"], options, fscache)\n\n options.exclude = \"/(a1|a3)/\"\n fscache = FakeFSCache(files)\n assert find_sources([\"/\"], options, fscache) == [\n (\"a2\", \"/pkg\"),\n (\"a2.b.c.d.e\", \"/pkg\"),\n (\"a2.b.f\", \"/pkg\"),\n ]\n\n options.exclude = \"b/c/\"\n fscache = FakeFSCache(files)\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/test_find_sources.py_SourceFinderSuite.test_find_sources_exclude.None_7_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/test_find_sources.py_SourceFinderSuite.test_find_sources_exclude.None_7_", "embedding": null, "metadata": {"file_path": "mypy/test/test_find_sources.py", "file_name": "test_find_sources.py", "file_type": "text/x-python", "category": "test", "start_line": 353, "end_line": 376, "span_ids": ["SourceFinderSuite.test_find_sources_exclude"], "tokens": 248}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SourceFinderSuite(unittest.TestCase):\n\n def test_find_sources_exclude(self) -> None:\n # ... other code\n assert find_sources([\"/\"], options, fscache) == [\n (\"a2\", \"/pkg\"),\n (\"a2.b.f\", \"/pkg\"),\n (\"f\", \"/pkg/a1/b\"),\n ]\n\n # nothing should be ignored as a result of this\n options.exclude = \"|\".join((\n \"/pkg/a/\", \"/2\", \"/1\", \"/pk/\", \"/kg\", \"/g.py\", \"/bc\", \"/xxx/pkg/a2/b/f.py\"\n \"xxx/pkg/a2/b/f.py\",\n ))\n fscache = FakeFSCache(files)\n assert len(find_sources([\"/\"], options, fscache)) == len(files)\n\n files = {\n \"pkg/a1/b/c/d/e.py\",\n \"pkg/a1/b/f.py\",\n \"pkg/a2/__init__.py\",\n \"pkg/a2/b/c/d/e.py\",\n \"pkg/a2/b/f.py\",\n }\n fscache = FakeFSCache(files)\n assert len(find_sources([\".\"], options, fscache)) == len(files)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testcheck.py_TypeCheckSuite.run_case_once_TypeCheckSuite.run_case_once.if_output_a_and_testca.update_testcase_output_te": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testcheck.py_TypeCheckSuite.run_case_once_TypeCheckSuite.run_case_once.if_output_a_and_testca.update_testcase_output_te", "embedding": null, "metadata": {"file_path": "mypy/test/testcheck.py", "file_name": "testcheck.py", "file_type": "text/x-python", "category": "test", "start_line": 137, "end_line": 233, "span_ids": ["TypeCheckSuite.run_case_once"], "tokens": 842}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeCheckSuite(DataSuite):\n\n def run_case_once(self, testcase: DataDrivenTestCase,\n operations: List[FileOperation] = [],\n incremental_step: int = 0) -> None:\n original_program_text = '\\n'.join(testcase.input)\n module_data = self.parse_module(original_program_text, incremental_step)\n\n # Unload already loaded plugins, they may be updated.\n for file, _ in testcase.files:\n module = module_from_path(file)\n if module.endswith('_plugin') and module in sys.modules:\n del sys.modules[module]\n if incremental_step == 0 or incremental_step == 1:\n # In run 1, copy program text to program file.\n for module_name, program_path, program_text in module_data:\n if module_name == '__main__':\n with open(program_path, 'w', encoding='utf8') as f:\n f.write(program_text)\n break\n elif incremental_step > 1:\n # In runs 2+, copy *.[num] files to * files.\n for op in operations:\n if isinstance(op, UpdateFile):\n # Modify/create file\n copy_and_fudge_mtime(op.source_path, op.target_path)\n else:\n # Delete file/directory\n path = op.path\n if os.path.isdir(path):\n # Sanity check to avoid unexpected deletions\n assert path.startswith('tmp')\n shutil.rmtree(path)\n # Use retries to work around potential flakiness on Windows (AppVeyor).\n retry_on_error(lambda: os.remove(path))\n\n # Parse options after moving files (in case mypy.ini is being moved).\n options = parse_options(original_program_text, testcase, incremental_step)\n options.use_builtins_fixtures = True\n options.show_traceback = True\n\n # Enable some options automatically based on test file name.\n if 'optional' in testcase.file:\n options.strict_optional = True\n if 'columns' in testcase.file:\n options.show_column_numbers = True\n if 'errorcodes' in testcase.file:\n options.show_error_codes = True\n\n if incremental_step and options.incremental:\n # Don't overwrite # flags: --no-incremental in incremental test cases\n options.incremental = True\n else:\n options.incremental = False\n # Don't waste time writing cache unless we are specifically looking for it\n if not testcase.writescache:\n options.cache_dir = os.devnull\n\n sources = []\n for module_name, program_path, program_text in module_data:\n # Always set to none so we're forced to reread the module in incremental mode\n sources.append(BuildSource(program_path, module_name,\n None if incremental_step else program_text))\n\n plugin_dir = os.path.join(test_data_prefix, 'plugins')\n sys.path.insert(0, plugin_dir)\n\n res = None\n try:\n res = build.build(sources=sources,\n options=options,\n alt_lib_path=test_temp_dir)\n a = res.errors\n except CompileError as e:\n a = e.messages\n finally:\n assert sys.path[0] == plugin_dir\n del sys.path[0]\n\n if testcase.normalize_output:\n a = normalize_error_messages(a)\n\n # Make sure error messages match\n if incremental_step == 0:\n # Not incremental\n msg = 'Unexpected type checker output ({}, line {})'\n output = testcase.output\n elif incremental_step == 1:\n msg = 'Unexpected type checker output in incremental, run 1 ({}, line {})'\n output = testcase.output\n elif incremental_step > 1:\n msg = ('Unexpected type checker output in incremental, run {}'.format(\n incremental_step) + ' ({}, line {})')\n output = testcase.output2.get(incremental_step, [])\n else:\n raise AssertionError()\n\n if output != a and testcase.config.getoption('--update-data', False):\n update_testcase_output(testcase, a)\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testcheck.py_TypeCheckSuite.run_case_once.assert_string_arrays_equa_TypeCheckSuite.run_case_once.if_testcase_output_files_.check_test_output_files_t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testcheck.py_TypeCheckSuite.run_case_once.assert_string_arrays_equa_TypeCheckSuite.run_case_once.if_testcase_output_files_.check_test_output_files_t", "embedding": null, "metadata": {"file_path": "mypy/test/testcheck.py", "file_name": "testcheck.py", "file_type": "text/x-python", "category": "test", "start_line": 234, "end_line": 265, "span_ids": ["TypeCheckSuite.run_case_once"], "tokens": 360}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeCheckSuite(DataSuite):\n\n def run_case_once(self, testcase: DataDrivenTestCase,\n operations: List[FileOperation] = [],\n incremental_step: int = 0) -> None:\n # ... other code\n assert_string_arrays_equal(output, a, msg.format(testcase.file, testcase.line))\n\n if res:\n if options.cache_dir != os.devnull:\n self.verify_cache(module_data, res.errors, res.manager, res.graph)\n\n name = 'targets'\n if incremental_step:\n name += str(incremental_step + 1)\n expected = testcase.expected_fine_grained_targets.get(incremental_step + 1)\n actual = res.manager.processed_targets\n # Skip the initial builtin cycle.\n actual = [t for t in actual\n if not any(t.startswith(mod)\n for mod in core_modules + ['mypy_extensions'])]\n if expected is not None:\n assert_target_equivalence(name, expected, actual)\n if incremental_step > 1:\n suffix = '' if incremental_step == 2 else str(incremental_step - 1)\n expected_rechecked = testcase.expected_rechecked_modules.get(incremental_step - 1)\n if expected_rechecked is not None:\n assert_module_equivalence(\n 'rechecked' + suffix,\n expected_rechecked, res.manager.rechecked_modules)\n expected_stale = testcase.expected_stale_modules.get(incremental_step - 1)\n if expected_stale is not None:\n assert_module_equivalence(\n 'stale' + suffix,\n expected_stale, res.manager.stale_modules)\n\n if testcase.output_files:\n check_test_output_files(testcase, incremental_step, strip_prefix='tmp/')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testdaemon.py_run_cmd_run_cmd.try_.except_subprocess_CalledP.return.err_returncode_err_outpu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testdaemon.py_run_cmd_run_cmd.try_.except_subprocess_CalledP.return.err_returncode_err_outpu", "embedding": null, "metadata": {"file_path": "mypy/test/testdaemon.py", "file_name": "testdaemon.py", "file_type": "text/x-python", "category": "test", "start_line": 80, "end_line": 96, "span_ids": ["run_cmd"], "tokens": 141}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def run_cmd(input: str) -> Tuple[int, str]:\n if input.startswith('dmypy '):\n input = sys.executable + ' -m mypy.' + input\n if input.startswith('mypy '):\n input = sys.executable + ' -m' + input\n env = os.environ.copy()\n env['PYTHONPATH'] = PREFIX\n try:\n output = subprocess.check_output(input,\n shell=True,\n stderr=subprocess.STDOUT,\n universal_newlines=True,\n cwd=test_temp_dir,\n env=env)\n return 0, output\n except subprocess.CalledProcessError as err:\n return err.returncode, err.output", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testdaemon.py_DaemonUtilitySuite_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testdaemon.py_DaemonUtilitySuite_", "embedding": null, "metadata": {"file_path": "mypy/test/testdaemon.py", "file_name": "testdaemon.py", "file_type": "text/x-python", "category": "test", "start_line": 99, "end_line": 134, "span_ids": ["DaemonUtilitySuite", "DaemonUtilitySuite.test_filter_out_missing_top_level_packages", "DaemonUtilitySuite.make_file"], "tokens": 383}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DaemonUtilitySuite(unittest.TestCase):\n \"\"\"Unit tests for helpers\"\"\"\n\n def test_filter_out_missing_top_level_packages(self) -> None:\n with tempfile.TemporaryDirectory() as td:\n self.make_file(td, 'base/a/')\n self.make_file(td, 'base/b.py')\n self.make_file(td, 'base/c.pyi')\n self.make_file(td, 'base/missing.txt')\n self.make_file(td, 'typeshed/d.pyi')\n self.make_file(td, 'typeshed/@python2/e')\n self.make_file(td, 'pkg1/f-stubs')\n self.make_file(td, 'pkg2/g-python2-stubs')\n self.make_file(td, 'mpath/sub/long_name/')\n\n def makepath(p: str) -> str:\n return os.path.join(td, p)\n\n search = SearchPaths(python_path=(makepath('base'),),\n mypy_path=(makepath('mpath/sub'),),\n package_path=(makepath('pkg1'), makepath('pkg2')),\n typeshed_path=(makepath('typeshed'),))\n fscache = FileSystemCache()\n res = filter_out_missing_top_level_packages(\n {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'long_name', 'ff', 'missing'},\n search,\n fscache)\n assert res == {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'long_name'}\n\n def make_file(self, base: str, path: str) -> None:\n fullpath = os.path.join(base, path)\n os.makedirs(os.path.dirname(fullpath), exist_ok=True)\n if not path.endswith('/'):\n with open(fullpath, 'w') as f:\n f.write('# test file')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testfscache.py__Unit_tests_for_file_sy_TestFileSystemCache.test_isfile_case_1.None_1.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testfscache.py__Unit_tests_for_file_sy_TestFileSystemCache.test_isfile_case_1.None_1.None_3", "embedding": null, "metadata": {"file_path": "mypy/test/testfscache.py", "file_name": "testfscache.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 41, "span_ids": ["TestFileSystemCache.tearDown", "docstring", "TestFileSystemCache.setUp", "TestFileSystemCache.test_isfile_case_1", "TestFileSystemCache"], "tokens": 317}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Unit tests for file system cache.\"\"\"\n\nimport os\nimport shutil\nimport sys\nimport tempfile\nimport unittest\nfrom typing import Optional\n\nfrom mypy.fscache import FileSystemCache\n\n\nclass TestFileSystemCache(unittest.TestCase):\n def setUp(self) -> None:\n self.tempdir = tempfile.mkdtemp()\n self.oldcwd = os.getcwd()\n os.chdir(self.tempdir)\n self.fscache = FileSystemCache()\n\n def tearDown(self) -> None:\n os.chdir(self.oldcwd)\n shutil.rmtree(self.tempdir)\n\n def test_isfile_case_1(self) -> None:\n self.make_file('bar.py')\n self.make_file('pkg/sub_package/__init__.py')\n self.make_file('pkg/sub_package/foo.py')\n # Run twice to test both cached and non-cached code paths.\n for i in range(2):\n assert self.isfile_case('bar.py')\n assert self.isfile_case('pkg/sub_package/__init__.py')\n assert self.isfile_case('pkg/sub_package/foo.py')\n assert not self.isfile_case('non_existent.py')\n assert not self.isfile_case('pkg/non_existent.py')\n assert not self.isfile_case('pkg/')\n assert not self.isfile_case('bar.py/')\n for i in range(2):\n assert not self.isfile_case('Bar.py')\n assert not self.isfile_case('pkg/sub_package/__init__.PY')\n assert not self.isfile_case('pkg/Sub_Package/foo.py')\n assert not self.isfile_case('Pkg/sub_package/foo.py')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testfscache.py_TestFileSystemCache.test_isfile_case_2_TestFileSystemCache.test_isfile_case_2.None_1.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testfscache.py_TestFileSystemCache.test_isfile_case_2_TestFileSystemCache.test_isfile_case_2.None_1.None_4", "embedding": null, "metadata": {"file_path": "mypy/test/testfscache.py", "file_name": "testfscache.py", "file_type": "text/x-python", "category": "test", "start_line": 43, "end_line": 59, "span_ids": ["TestFileSystemCache.test_isfile_case_2"], "tokens": 213}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestFileSystemCache(unittest.TestCase):\n\n def test_isfile_case_2(self) -> None:\n self.make_file('bar.py')\n self.make_file('pkg/sub_package/__init__.py')\n self.make_file('pkg/sub_package/foo.py')\n # Run twice to test both cached and non-cached code paths.\n # This reverses the order of checks from test_isfile_case_1.\n for i in range(2):\n assert not self.isfile_case('Bar.py')\n assert not self.isfile_case('pkg/sub_package/__init__.PY')\n assert not self.isfile_case('pkg/Sub_Package/foo.py')\n assert not self.isfile_case('Pkg/sub_package/foo.py')\n for i in range(2):\n assert self.isfile_case('bar.py')\n assert self.isfile_case('pkg/sub_package/__init__.py')\n assert self.isfile_case('pkg/sub_package/foo.py')\n assert not self.isfile_case('non_existent.py')\n assert not self.isfile_case('pkg/non_existent.py')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testfscache.py_TestFileSystemCache.test_isfile_case_3_TestFileSystemCache.test_isfile_case_3.for_i_in_range_2_.None_8": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testfscache.py_TestFileSystemCache.test_isfile_case_3_TestFileSystemCache.test_isfile_case_3.for_i_in_range_2_.None_8", "embedding": null, "metadata": {"file_path": "mypy/test/testfscache.py", "file_name": "testfscache.py", "file_type": "text/x-python", "category": "test", "start_line": 61, "end_line": 75, "span_ids": ["TestFileSystemCache.test_isfile_case_3"], "tokens": 188}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestFileSystemCache(unittest.TestCase):\n\n def test_isfile_case_3(self) -> None:\n self.make_file('bar.py')\n self.make_file('pkg/sub_package/__init__.py')\n self.make_file('pkg/sub_package/foo.py')\n # Run twice to test both cached and non-cached code paths.\n for i in range(2):\n assert self.isfile_case('bar.py')\n assert not self.isfile_case('non_existent.py')\n assert not self.isfile_case('pkg/non_existent.py')\n assert not self.isfile_case('Bar.py')\n assert not self.isfile_case('pkg/sub_package/__init__.PY')\n assert not self.isfile_case('pkg/Sub_Package/foo.py')\n assert not self.isfile_case('Pkg/sub_package/foo.py')\n assert self.isfile_case('pkg/sub_package/__init__.py')\n assert self.isfile_case('pkg/sub_package/foo.py')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testfscache.py_TestFileSystemCache.test_isfile_case_other_directory_TestFileSystemCache.test_isfile_case_other_directory.with_tempfile_TemporaryDi.if_sys_platform_in_win3.assert_self_isfile_case_o": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testfscache.py_TestFileSystemCache.test_isfile_case_other_directory_TestFileSystemCache.test_isfile_case_other_directory.with_tempfile_TemporaryDi.if_sys_platform_in_win3.assert_self_isfile_case_o", "embedding": null, "metadata": {"file_path": "mypy/test/testfscache.py", "file_name": "testfscache.py", "file_type": "text/x-python", "category": "test", "start_line": 77, "end_line": 88, "span_ids": ["TestFileSystemCache.test_isfile_case_other_directory"], "tokens": 172}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestFileSystemCache(unittest.TestCase):\n\n def test_isfile_case_other_directory(self) -> None:\n self.make_file('bar.py')\n with tempfile.TemporaryDirectory() as other:\n self.make_file('other_dir.py', base=other)\n self.make_file('pkg/other_dir.py', base=other)\n assert self.isfile_case(os.path.join(other, 'other_dir.py'))\n assert not self.isfile_case(os.path.join(other, 'Other_Dir.py'))\n assert not self.isfile_case(os.path.join(other, 'bar.py'))\n if sys.platform in ('win32', 'darwin'):\n # We only check case for directories under our prefix, and since\n # this path is not under the prefix, case difference is fine.\n assert self.isfile_case(os.path.join(other, 'PKG/other_dir.py'))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testfscache.py_TestFileSystemCache.make_file_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testfscache.py_TestFileSystemCache.make_file_", "embedding": null, "metadata": {"file_path": "mypy/test/testfscache.py", "file_name": "testfscache.py", "file_type": "text/x-python", "category": "test", "start_line": 90, "end_line": 101, "span_ids": ["TestFileSystemCache.make_file", "TestFileSystemCache.isfile_case"], "tokens": 126}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestFileSystemCache(unittest.TestCase):\n\n def make_file(self, path: str, base: Optional[str] = None) -> None:\n if base is None:\n base = self.tempdir\n fullpath = os.path.join(base, path)\n os.makedirs(os.path.dirname(fullpath), exist_ok=True)\n if not path.endswith('/'):\n with open(fullpath, 'w') as f:\n f.write('# test file')\n\n def isfile_case(self, path: str) -> bool:\n return self.fscache.isfile_case(os.path.join(self.tempdir, path), self.tempdir)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsamples.py_os.path_SamplesSuite.test_samples.for_f_in_find_files_os_pa.run_mypy_mypy_args_f_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsamples.py_os.path_SamplesSuite.test_samples.for_f_in_find_files_os_pa.run_mypy_mypy_args_f_", "embedding": null, "metadata": {"file_path": "mypy/test/testsamples.py", "file_name": "testsamples.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 16, "span_ids": ["imports", "SamplesSuite.test_samples", "SamplesSuite"], "tokens": 139}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import os.path\nfrom typing import List, Set\n\nfrom mypy.test.helpers import Suite, run_mypy\n\n\nclass SamplesSuite(Suite):\n \"\"\"Test that we can type check some sample code.\"\"\"\n\n def test_samples(self) -> None:\n for f in find_files(os.path.join('test-data', 'samples'), suffix='.py'):\n mypy_args = ['--no-strict-optional']\n if f == os.path.join('test-data', 'samples', 'crawl2.py'):\n # This test requires 3.5 for async functions\n mypy_args.append('--python-version=3.5')\n run_mypy(mypy_args + [f])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsamples.py_SamplesSuite.test_stdlibsamples_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testsamples.py_SamplesSuite.test_stdlibsamples_", "embedding": null, "metadata": {"file_path": "mypy/test/testsamples.py", "file_name": "testsamples.py", "file_type": "text/x-python", "category": "test", "start_line": 18, "end_line": 36, "span_ids": ["find_files", "SamplesSuite.test_stdlibsamples"], "tokens": 200}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class SamplesSuite(Suite):\n\n def test_stdlibsamples(self) -> None:\n seen = set() # type: Set[str]\n stdlibsamples_dir = os.path.join('test-data', 'stdlib-samples', '3.2', 'test')\n modules = [] # type: List[str]\n for f in find_files(stdlibsamples_dir, prefix='test_', suffix='.py'):\n if f not in seen:\n seen.add(f)\n modules.append(f)\n if modules:\n # TODO: Remove need for --no-strict-optional\n run_mypy(['--no-strict-optional', '--platform=linux'] + modules)\n\n\ndef find_files(base: str, prefix: str = '', suffix: str = '') -> List[str]:\n return [os.path.join(root, f)\n for root, dirs, files in os.walk(base)\n for f in files\n if f.startswith(prefix) and f.endswith(suffix)]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenPythonSuite.parse_flags_TestClass.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgenPythonSuite.parse_flags_TestClass.pass", "embedding": null, "metadata": {"file_path": "mypy/test/teststubgen.py", "file_name": "teststubgen.py", "file_type": "text/x-python", "category": "test", "start_line": 595, "end_line": 633, "span_ids": ["TestClass", "impl", "StubgenPythonSuite.parse_flags", "StubgenPythonSuite.add_file", "TestBaseClass", "StubgenPythonSuite.parse_modules"], "tokens": 277}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubgenPythonSuite(DataSuite):\n\n def parse_flags(self, program_text: str, extra: List[str]) -> Options:\n flags = re.search('# flags: (.*)$', program_text, flags=re.MULTILINE)\n if flags:\n flag_list = flags.group(1).split()\n else:\n flag_list = []\n options = parse_options(flag_list + extra)\n if '--verbose' not in flag_list:\n options.quiet = True\n else:\n options.verbose = True\n return options\n\n def parse_modules(self, program_text: str) -> List[str]:\n modules = re.search('# modules: (.*)$', program_text, flags=re.MULTILINE)\n if modules:\n return modules.group(1).split()\n else:\n return ['main']\n\n def add_file(self, path: str, result: List[str], header: bool) -> None:\n if not os.path.exists(path):\n result.append('<%s was not generated>' % path.replace('\\\\', '/'))\n return\n if header:\n result.append('# {}'.format(path[4:]))\n with open(path, encoding='utf8') as file:\n result.extend(file.read().splitlines())\n\n\nself_arg = ArgSig(name='self')\n\n\nclass TestBaseClass:\n pass\n\n\nclass TestClass(TestBaseClass):\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgencSuite.test_generate_c_type_inheritance_StubgencSuite.test_generate_c_type_inheritance_builtin_type.assert_equal_imports_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubgen.py_StubgencSuite.test_generate_c_type_inheritance_StubgencSuite.test_generate_c_type_inheritance_builtin_type.assert_equal_imports_", "embedding": null, "metadata": {"file_path": "mypy/test/teststubgen.py", "file_name": "teststubgen.py", "file_type": "text/x-python", "category": "test", "start_line": 681, "end_line": 721, "span_ids": ["StubgencSuite.test_generate_c_type_inheritance_other_module", "StubgencSuite.test_generate_c_type_inheritance_builtin_type", "StubgencSuite.test_generate_c_type_inheritance_same_module", "StubgencSuite.test_generate_c_type_inheritance"], "tokens": 383}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class StubgencSuite(unittest.TestCase):\n\n def test_generate_c_type_inheritance(self) -> None:\n class TestClass(KeyError):\n pass\n\n output = [] # type: List[str]\n imports = [] # type: List[str]\n mod = ModuleType('module, ')\n generate_c_type_stub(mod, 'C', TestClass, output, imports)\n assert_equal(output, ['class C(KeyError): ...', ])\n assert_equal(imports, [])\n\n def test_generate_c_type_inheritance_same_module(self) -> None:\n output = [] # type: List[str]\n imports = [] # type: List[str]\n mod = ModuleType(TestBaseClass.__module__, '')\n generate_c_type_stub(mod, 'C', TestClass, output, imports)\n assert_equal(output, ['class C(TestBaseClass): ...', ])\n assert_equal(imports, [])\n\n def test_generate_c_type_inheritance_other_module(self) -> None:\n import argparse\n\n class TestClass(argparse.Action):\n pass\n\n output = [] # type: List[str]\n imports = [] # type: List[str]\n mod = ModuleType('module', '')\n generate_c_type_stub(mod, 'C', TestClass, output, imports)\n assert_equal(output, ['class C(argparse.Action): ...', ])\n assert_equal(imports, ['import argparse'])\n\n def test_generate_c_type_inheritance_builtin_type(self) -> None:\n class TestClass(type):\n pass\n output = [] # type: List[str]\n imports = [] # type: List[str]\n mod = ModuleType('module', '')\n generate_c_type_stub(mod, 'C', TestClass, output, imports)\n assert_equal(output, ['class C(type): ...', ])\n assert_equal(imports, [])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/traverser.py_TraverserVisitor.visit_try_stmt_TraverserVisitor.visit_generator_expr.o_left_expr_accept_self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/traverser.py_TraverserVisitor.visit_try_stmt_TraverserVisitor.visit_generator_expr.o_left_expr_accept_self_", "embedding": null, "metadata": {"file_path": "mypy/traverser.py", "file_name": "traverser.py", "file_type": "text/x-python", "category": "implementation", "start_line": 136, "end_line": 241, "span_ids": ["TraverserVisitor.visit_member_expr", "TraverserVisitor.visit_list_expr", "TraverserVisitor.visit_assignment_expr", "TraverserVisitor.visit_set_expr", "TraverserVisitor.visit_reveal_expr", "TraverserVisitor.visit_unary_expr", "TraverserVisitor.visit_slice_expr", "TraverserVisitor.visit_yield_from_expr", "TraverserVisitor.visit_try_stmt", "TraverserVisitor.visit_comparison_expr", "TraverserVisitor.visit_cast_expr", "TraverserVisitor.visit_call_expr", "TraverserVisitor.visit_index_expr", "TraverserVisitor.visit_generator_expr", "TraverserVisitor.visit_dict_expr", "TraverserVisitor.visit_op_expr", "TraverserVisitor.visit_yield_expr", "TraverserVisitor.visit_with_stmt", "TraverserVisitor.visit_tuple_expr"], "tokens": 783}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@mypyc_attr(allow_interpreted_subclasses=True)\nclass TraverserVisitor(NodeVisitor[None]):\n\n def visit_try_stmt(self, o: TryStmt) -> None:\n o.body.accept(self)\n for i in range(len(o.types)):\n tp = o.types[i]\n if tp is not None:\n tp.accept(self)\n o.handlers[i].accept(self)\n for v in o.vars:\n if v is not None:\n v.accept(self)\n if o.else_body is not None:\n o.else_body.accept(self)\n if o.finally_body is not None:\n o.finally_body.accept(self)\n\n def visit_with_stmt(self, o: WithStmt) -> None:\n for i in range(len(o.expr)):\n o.expr[i].accept(self)\n targ = o.target[i]\n if targ is not None:\n targ.accept(self)\n o.body.accept(self)\n\n def visit_member_expr(self, o: MemberExpr) -> None:\n o.expr.accept(self)\n\n def visit_yield_from_expr(self, o: YieldFromExpr) -> None:\n o.expr.accept(self)\n\n def visit_yield_expr(self, o: YieldExpr) -> None:\n if o.expr:\n o.expr.accept(self)\n\n def visit_call_expr(self, o: CallExpr) -> None:\n for a in o.args:\n a.accept(self)\n o.callee.accept(self)\n if o.analyzed:\n o.analyzed.accept(self)\n\n def visit_op_expr(self, o: OpExpr) -> None:\n o.left.accept(self)\n o.right.accept(self)\n\n def visit_comparison_expr(self, o: ComparisonExpr) -> None:\n for operand in o.operands:\n operand.accept(self)\n\n def visit_slice_expr(self, o: SliceExpr) -> None:\n if o.begin_index is not None:\n o.begin_index.accept(self)\n if o.end_index is not None:\n o.end_index.accept(self)\n if o.stride is not None:\n o.stride.accept(self)\n\n def visit_cast_expr(self, o: CastExpr) -> None:\n o.expr.accept(self)\n\n def visit_reveal_expr(self, o: RevealExpr) -> None:\n if o.kind == REVEAL_TYPE:\n assert o.expr is not None\n o.expr.accept(self)\n else:\n # RevealLocalsExpr doesn't have an inner expression\n pass\n\n def visit_assignment_expr(self, o: AssignmentExpr) -> None:\n o.target.accept(self)\n o.value.accept(self)\n\n def visit_unary_expr(self, o: UnaryExpr) -> None:\n o.expr.accept(self)\n\n def visit_list_expr(self, o: ListExpr) -> None:\n for item in o.items:\n item.accept(self)\n\n def visit_tuple_expr(self, o: TupleExpr) -> None:\n for item in o.items:\n item.accept(self)\n\n def visit_dict_expr(self, o: DictExpr) -> None:\n for k, v in o.items:\n if k is not None:\n k.accept(self)\n v.accept(self)\n\n def visit_set_expr(self, o: SetExpr) -> None:\n for item in o.items:\n item.accept(self)\n\n def visit_index_expr(self, o: IndexExpr) -> None:\n o.base.accept(self)\n o.index.accept(self)\n if o.analyzed:\n o.analyzed.accept(self)\n\n def visit_generator_expr(self, o: GeneratorExpr) -> None:\n for index, sequence, conditions in zip(o.indices, o.sequences,\n o.condlists):\n sequence.accept(self)\n index.accept(self)\n for cond in conditions:\n cond.accept(self)\n o.left_expr.accept(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/traverser.py_TraverserVisitor.visit_dictionary_comprehension_TraverserVisitor.visit_exec_stmt.if_o_locals_.o_locals_accept_self_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/traverser.py_TraverserVisitor.visit_dictionary_comprehension_TraverserVisitor.visit_exec_stmt.if_o_locals_.o_locals_accept_self_", "embedding": null, "metadata": {"file_path": "mypy/traverser.py", "file_name": "traverser.py", "file_type": "text/x-python", "category": "implementation", "start_line": 243, "end_line": 299, "span_ids": ["TraverserVisitor.visit_conditional_expr", "TraverserVisitor.visit_await_expr", "TraverserVisitor.visit_type_application", "TraverserVisitor.visit_print_stmt", "TraverserVisitor.visit_set_comprehension", "TraverserVisitor.visit_backquote_expr", "TraverserVisitor.visit_super_expr", "TraverserVisitor.visit_list_comprehension", "TraverserVisitor.visit_exec_stmt", "TraverserVisitor.visit_dictionary_comprehension", "TraverserVisitor.visit_import", "TraverserVisitor.visit_star_expr", "TraverserVisitor.visit_lambda_expr", "TraverserVisitor.visit_import_from"], "tokens": 439}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@mypyc_attr(allow_interpreted_subclasses=True)\nclass TraverserVisitor(NodeVisitor[None]):\n\n def visit_dictionary_comprehension(self, o: DictionaryComprehension) -> None:\n for index, sequence, conditions in zip(o.indices, o.sequences,\n o.condlists):\n sequence.accept(self)\n index.accept(self)\n for cond in conditions:\n cond.accept(self)\n o.key.accept(self)\n o.value.accept(self)\n\n def visit_list_comprehension(self, o: ListComprehension) -> None:\n o.generator.accept(self)\n\n def visit_set_comprehension(self, o: SetComprehension) -> None:\n o.generator.accept(self)\n\n def visit_conditional_expr(self, o: ConditionalExpr) -> None:\n o.cond.accept(self)\n o.if_expr.accept(self)\n o.else_expr.accept(self)\n\n def visit_type_application(self, o: TypeApplication) -> None:\n o.expr.accept(self)\n\n def visit_lambda_expr(self, o: LambdaExpr) -> None:\n self.visit_func(o)\n\n def visit_star_expr(self, o: StarExpr) -> None:\n o.expr.accept(self)\n\n def visit_backquote_expr(self, o: BackquoteExpr) -> None:\n o.expr.accept(self)\n\n def visit_await_expr(self, o: AwaitExpr) -> None:\n o.expr.accept(self)\n\n def visit_super_expr(self, o: SuperExpr) -> None:\n o.call.accept(self)\n\n def visit_import(self, o: Import) -> None:\n for a in o.assignments:\n a.accept(self)\n\n def visit_import_from(self, o: ImportFrom) -> None:\n for a in o.assignments:\n a.accept(self)\n\n def visit_print_stmt(self, o: PrintStmt) -> None:\n for arg in o.args:\n arg.accept(self)\n\n def visit_exec_stmt(self, o: ExecStmt) -> None:\n o.expr.accept(self)\n if o.globals:\n o.globals.accept(self)\n if o.locals:\n o.locals.accept(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.visit_callable_type_TypeAnalyser.visit_callable_type.return.ret": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.visit_callable_type_TypeAnalyser.visit_callable_type.return.ret", "embedding": null, "metadata": {"file_path": "mypy/typeanal.py", "file_name": "typeanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 523, "end_line": 540, "span_ids": ["TypeAnalyser.visit_callable_type"], "tokens": 207}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeAnalyser(SyntheticTypeVisitor[Type], TypeAnalyzerPluginInterface):\n\n def visit_callable_type(self, t: CallableType, nested: bool = True) -> Type:\n # Every Callable can bind its own type variables, if they're not in the outer scope\n with self.tvar_scope_frame():\n if self.defining_alias:\n variables = t.variables\n else:\n variables = self.bind_function_type_variables(t, t)\n special = self.anal_type_guard(t.ret_type)\n ret = t.copy_modified(arg_types=self.anal_array(t.arg_types, nested=nested),\n ret_type=self.anal_type(t.ret_type, nested=nested),\n # If the fallback isn't filled in yet,\n # its type will be the falsey FakeInfo\n fallback=(t.fallback if t.fallback.type\n else self.named_type('builtins.function')),\n variables=self.anal_var_defs(variables),\n type_guard=special,\n )\n return ret", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.anal_type_guard_TypeAnalyser.visit_overloaded.return.t": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeanal.py_TypeAnalyser.anal_type_guard_TypeAnalyser.visit_overloaded.return.t", "embedding": null, "metadata": {"file_path": "mypy/typeanal.py", "file_name": "typeanal.py", "file_type": "text/x-python", "category": "implementation", "start_line": 542, "end_line": 564, "span_ids": ["TypeAnalyser.visit_overloaded", "TypeAnalyser.anal_type_guard", "TypeAnalyser.anal_type_guard_arg"], "tokens": 272}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeAnalyser(SyntheticTypeVisitor[Type], TypeAnalyzerPluginInterface):\n\n def anal_type_guard(self, t: Type) -> Optional[Type]:\n if isinstance(t, UnboundType):\n sym = self.lookup_qualified(t.name, t)\n if sym is not None and sym.node is not None:\n return self.anal_type_guard_arg(t, sym.node.fullname)\n # TODO: What if it's an Instance? Then use t.type.fullname?\n return None\n\n def anal_type_guard_arg(self, t: UnboundType, fullname: str) -> Optional[Type]:\n if fullname in ('typing_extensions.TypeGuard', 'typing.TypeGuard'):\n if len(t.args) != 1:\n self.fail(\"TypeGuard must have exactly one type argument\", t)\n return AnyType(TypeOfAny.from_error)\n return self.anal_type(t.args[0])\n return None\n\n def visit_overloaded(self, t: Overloaded) -> Type:\n # Overloaded types are manually constructed in semanal.py by analyzing the\n # AST and combining together the Callable types this visitor converts.\n #\n # So if we're ever asked to reanalyze an Overloaded type, we know it's\n # fine to just return it as-is.\n return t", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypeGuardType_TypeVarId.is_meta_var.return.self_meta_level_0": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_TypeGuardType_TypeVarId.is_meta_var.return.self_meta_level_0", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 273, "end_line": 338, "span_ids": ["ProperType", "TypeGuardType.__repr__", "TypeVarId.__ne__", "TypeVarId.is_meta_var", "TypeVarId.new", "TypeGuardType.__init__", "TypeVarId.__hash__", "TypeVarId", "TypeVarId.__eq__", "TypeVarId.__repr__", "TypeVarId.__init__", "TypeGuardType"], "tokens": 541}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeGuardType(Type):\n \"\"\"Only used by find_instance_check() etc.\"\"\"\n def __init__(self, type_guard: Type):\n super().__init__(line=type_guard.line, column=type_guard.column)\n self.type_guard = type_guard\n\n def __repr__(self) -> str:\n return \"TypeGuard({})\".format(self.type_guard)\n\n\nclass ProperType(Type):\n \"\"\"Not a type alias.\n\n Every type except TypeAliasType must inherit from this type.\n \"\"\"\n\n\nclass TypeVarId:\n # A type variable is uniquely identified by its raw id and meta level.\n\n # For plain variables (type parameters of generic classes and\n # functions) raw ids are allocated by semantic analysis, using\n # positive ids 1, 2, ... for generic class parameters and negative\n # ids -1, ... for generic function type arguments. This convention\n # is only used to keep type variable ids distinct when allocating\n # them; the type checker makes no distinction between class and\n # function type variables.\n\n # Metavariables are allocated unique ids starting from 1.\n raw_id = 0 # type: int\n\n # Level of the variable in type inference. Currently either 0 for\n # declared types, or 1 for type inference metavariables.\n meta_level = 0 # type: int\n\n # Class variable used for allocating fresh ids for metavariables.\n next_raw_id = 1 # type: ClassVar[int]\n\n def __init__(self, raw_id: int, meta_level: int = 0) -> None:\n self.raw_id = raw_id\n self.meta_level = meta_level\n\n @staticmethod\n def new(meta_level: int) -> 'TypeVarId':\n raw_id = TypeVarId.next_raw_id\n TypeVarId.next_raw_id += 1\n return TypeVarId(raw_id, meta_level)\n\n def __repr__(self) -> str:\n return self.raw_id.__repr__()\n\n def __eq__(self, other: object) -> bool:\n if isinstance(other, TypeVarId):\n return (self.raw_id == other.raw_id and\n self.meta_level == other.meta_level)\n else:\n return False\n\n def __ne__(self, other: object) -> bool:\n return not (self == other)\n\n def __hash__(self) -> int:\n return hash((self.raw_id, self.meta_level))\n\n def is_meta_var(self) -> bool:\n return self.meta_level > 0", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_CallableType.__init___CallableType.__init__.self.type_guard.type_guard": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/types.py_CallableType.__init___CallableType.__init__.self.type_guard.type_guard", "embedding": null, "metadata": {"file_path": "mypy/types.py", "file_name": "types.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1021, "end_line": 1073, "span_ids": ["CallableType.__init__"], "tokens": 486}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class CallableType(FunctionLike):\n\n def __init__(self,\n arg_types: Sequence[Type],\n arg_kinds: List[int],\n arg_names: Sequence[Optional[str]],\n ret_type: Type,\n fallback: Instance,\n name: Optional[str] = None,\n definition: Optional[SymbolNode] = None,\n variables: Optional[Sequence[TypeVarLikeDef]] = None,\n line: int = -1,\n column: int = -1,\n is_ellipsis_args: bool = False,\n implicit: bool = False,\n special_sig: Optional[str] = None,\n from_type_type: bool = False,\n bound_args: Sequence[Optional[Type]] = (),\n def_extras: Optional[Dict[str, Any]] = None,\n type_guard: Optional[Type] = None,\n ) -> None:\n super().__init__(line, column)\n assert len(arg_types) == len(arg_kinds) == len(arg_names)\n if variables is None:\n variables = []\n self.arg_types = list(arg_types)\n self.arg_kinds = arg_kinds\n self.arg_names = list(arg_names)\n self.min_args = arg_kinds.count(ARG_POS)\n self.ret_type = ret_type\n self.fallback = fallback\n assert not name or ' str:\n \"\"\"Format a short summary in case of errors.\"\"\"\n\n msg = 'Found {} error{} in {} file{}'.format(\n n_errors, 's' if n_errors != 1 else '',\n n_files, 's' if n_files != 1 else ''\n )\n if blockers:\n msg += ' (errors prevented further checking)'\n else:\n msg += ' (checked {} source file{})'.format(n_sources, 's' if n_sources != 1 else '')\n if not use_color:\n return msg\n return self.style(msg, 'red', bold=True)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_is_typeshed_file_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/util.py_is_typeshed_file_", "embedding": null, "metadata": {"file_path": "mypy/util.py", "file_name": "util.py", "file_type": "text/x-python", "category": "implementation", "start_line": 703, "end_line": 714, "span_ids": ["is_typeshed_file", "is_stub_package_file"], "tokens": 110}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_typeshed_file(file: str) -> bool:\n # gross, but no other clear way to tell\n return 'typeshed' in os.path.abspath(file).split(os.sep)\n\n\ndef is_stub_package_file(file: str) -> bool:\n # Use hacky heuristics to check whether file is part of a PEP 561 stub package.\n if not file.endswith('.pyi'):\n return False\n return any(component.endswith('-stubs')\n for component in os.path.abspath(file).split(os.sep))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/visitor.py_NodeVisitor_NodeVisitor.visit_exec_stmt.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/visitor.py_NodeVisitor_NodeVisitor.visit_exec_stmt.pass", "embedding": null, "metadata": {"file_path": "mypy/visitor.py", "file_name": "visitor.py", "file_type": "text/x-python", "category": "implementation", "start_line": 314, "end_line": 430, "span_ids": ["NodeVisitor.visit_expression_stmt", "NodeVisitor.visit_return_stmt", "NodeVisitor.visit_try_stmt", "NodeVisitor.visit_class_def", "NodeVisitor.visit_del_stmt", "NodeVisitor.visit_raise_stmt", "NodeVisitor", "NodeVisitor.visit_var", "NodeVisitor.visit_if_stmt", "NodeVisitor.visit_assignment_stmt", "NodeVisitor.visit_import_all", "NodeVisitor.visit_operator_assignment_stmt", "NodeVisitor.visit_mypy_file", "NodeVisitor.visit_continue_stmt", "NodeVisitor.visit_global_decl", "NodeVisitor.visit_type_alias", "NodeVisitor.visit_import_from", "NodeVisitor.visit_print_stmt", "NodeVisitor.visit_for_stmt", "NodeVisitor.visit_placeholder_node", "NodeVisitor.visit_overloaded_func_def", "NodeVisitor.visit_while_stmt", "NodeVisitor.visit_with_stmt", "NodeVisitor.visit_func_def", "NodeVisitor.visit_import", "NodeVisitor.visit_exec_stmt", "NodeVisitor.visit_decorator", "NodeVisitor.visit_pass_stmt", "NodeVisitor.visit_break_stmt", "NodeVisitor.visit_nonlocal_decl", "NodeVisitor.visit_assert_stmt", "NodeVisitor.visit_block"], "tokens": 853}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@trait\n@mypyc_attr(allow_interpreted_subclasses=True)\nclass NodeVisitor(Generic[T], ExpressionVisitor[T], StatementVisitor[T]):\n \"\"\"Empty base class for parse tree node visitors.\n\n The T type argument specifies the return type of the visit\n methods. As all methods defined here return None by default,\n subclasses do not always need to override all the methods.\n\n TODO make the default return value explicit\n \"\"\"\n\n # Not in superclasses:\n\n def visit_mypy_file(self, o: 'mypy.nodes.MypyFile') -> T:\n pass\n\n # TODO: We have a visit_var method, but no visit_typeinfo or any\n # other non-Statement SymbolNode (accepting those will raise a\n # runtime error). Maybe this should be resolved in some direction.\n def visit_var(self, o: 'mypy.nodes.Var') -> T:\n pass\n\n # Module structure\n\n def visit_import(self, o: 'mypy.nodes.Import') -> T:\n pass\n\n def visit_import_from(self, o: 'mypy.nodes.ImportFrom') -> T:\n pass\n\n def visit_import_all(self, o: 'mypy.nodes.ImportAll') -> T:\n pass\n\n # Definitions\n\n def visit_func_def(self, o: 'mypy.nodes.FuncDef') -> T:\n pass\n\n def visit_overloaded_func_def(self,\n o: 'mypy.nodes.OverloadedFuncDef') -> T:\n pass\n\n def visit_class_def(self, o: 'mypy.nodes.ClassDef') -> T:\n pass\n\n def visit_global_decl(self, o: 'mypy.nodes.GlobalDecl') -> T:\n pass\n\n def visit_nonlocal_decl(self, o: 'mypy.nodes.NonlocalDecl') -> T:\n pass\n\n def visit_decorator(self, o: 'mypy.nodes.Decorator') -> T:\n pass\n\n def visit_type_alias(self, o: 'mypy.nodes.TypeAlias') -> T:\n pass\n\n def visit_placeholder_node(self, o: 'mypy.nodes.PlaceholderNode') -> T:\n pass\n\n # Statements\n\n def visit_block(self, o: 'mypy.nodes.Block') -> T:\n pass\n\n def visit_expression_stmt(self, o: 'mypy.nodes.ExpressionStmt') -> T:\n pass\n\n def visit_assignment_stmt(self, o: 'mypy.nodes.AssignmentStmt') -> T:\n pass\n\n def visit_operator_assignment_stmt(self,\n o: 'mypy.nodes.OperatorAssignmentStmt') -> T:\n pass\n\n def visit_while_stmt(self, o: 'mypy.nodes.WhileStmt') -> T:\n pass\n\n def visit_for_stmt(self, o: 'mypy.nodes.ForStmt') -> T:\n pass\n\n def visit_return_stmt(self, o: 'mypy.nodes.ReturnStmt') -> T:\n pass\n\n def visit_assert_stmt(self, o: 'mypy.nodes.AssertStmt') -> T:\n pass\n\n def visit_del_stmt(self, o: 'mypy.nodes.DelStmt') -> T:\n pass\n\n def visit_if_stmt(self, o: 'mypy.nodes.IfStmt') -> T:\n pass\n\n def visit_break_stmt(self, o: 'mypy.nodes.BreakStmt') -> T:\n pass\n\n def visit_continue_stmt(self, o: 'mypy.nodes.ContinueStmt') -> T:\n pass\n\n def visit_pass_stmt(self, o: 'mypy.nodes.PassStmt') -> T:\n pass\n\n def visit_raise_stmt(self, o: 'mypy.nodes.RaiseStmt') -> T:\n pass\n\n def visit_try_stmt(self, o: 'mypy.nodes.TryStmt') -> T:\n pass\n\n def visit_with_stmt(self, o: 'mypy.nodes.WithStmt') -> T:\n pass\n\n def visit_print_stmt(self, o: 'mypy.nodes.PrintStmt') -> T:\n pass\n\n def visit_exec_stmt(self, o: 'mypy.nodes.ExecStmt') -> T:\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/visitor.py_NodeVisitor._Expressions_default_no_NodeVisitor.visit_type_var_expr.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/visitor.py_NodeVisitor._Expressions_default_no_NodeVisitor.visit_type_var_expr.pass", "embedding": null, "metadata": {"file_path": "mypy/visitor.py", "file_name": "visitor.py", "file_type": "text/x-python", "category": "implementation", "start_line": 432, "end_line": 537, "span_ids": ["NodeVisitor.visit_list_comprehension", "NodeVisitor.visit_call_expr", "NodeVisitor.visit_lambda_expr", "NodeVisitor.visit_complex_expr", "NodeVisitor.visit_reveal_expr", "NodeVisitor.visit_unicode_expr", "NodeVisitor.visit_dictionary_comprehension", "NodeVisitor.visit_type_var_expr", "NodeVisitor.visit_generator_expr", "NodeVisitor.visit_assignment_expr", "NodeVisitor.visit_cast_expr", "NodeVisitor.visit_float_expr", "NodeVisitor.visit_type_application", "NodeVisitor.visit_slice_expr", "NodeVisitor.visit_yield_expr", "NodeVisitor.visit_str_expr", "NodeVisitor.visit_dict_expr", "NodeVisitor.visit_conditional_expr", "NodeVisitor.visit_star_expr", "NodeVisitor.visit_name_expr", "NodeVisitor.visit_int_expr", "NodeVisitor.visit_member_expr", "NodeVisitor.visit_unary_expr", "NodeVisitor.visit_yield_from_expr", "NodeVisitor.visit_list_expr", "NodeVisitor.visit_tuple_expr", "NodeVisitor.visit_ellipsis", "NodeVisitor.visit_set_expr", "NodeVisitor.visit_super_expr", "NodeVisitor.visit_index_expr", "NodeVisitor.visit_exec_stmt", "NodeVisitor.visit_bytes_expr", "NodeVisitor.visit_set_comprehension", "NodeVisitor.visit_backquote_expr", "NodeVisitor.visit_op_expr", "NodeVisitor.visit_comparison_expr"], "tokens": 847}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@trait\n@mypyc_attr(allow_interpreted_subclasses=True)\nclass NodeVisitor(Generic[T], ExpressionVisitor[T], StatementVisitor[T]):\n\n # Expressions (default no-op implementation)\n\n def visit_int_expr(self, o: 'mypy.nodes.IntExpr') -> T:\n pass\n\n def visit_str_expr(self, o: 'mypy.nodes.StrExpr') -> T:\n pass\n\n def visit_bytes_expr(self, o: 'mypy.nodes.BytesExpr') -> T:\n pass\n\n def visit_unicode_expr(self, o: 'mypy.nodes.UnicodeExpr') -> T:\n pass\n\n def visit_float_expr(self, o: 'mypy.nodes.FloatExpr') -> T:\n pass\n\n def visit_complex_expr(self, o: 'mypy.nodes.ComplexExpr') -> T:\n pass\n\n def visit_ellipsis(self, o: 'mypy.nodes.EllipsisExpr') -> T:\n pass\n\n def visit_star_expr(self, o: 'mypy.nodes.StarExpr') -> T:\n pass\n\n def visit_name_expr(self, o: 'mypy.nodes.NameExpr') -> T:\n pass\n\n def visit_member_expr(self, o: 'mypy.nodes.MemberExpr') -> T:\n pass\n\n def visit_yield_from_expr(self, o: 'mypy.nodes.YieldFromExpr') -> T:\n pass\n\n def visit_yield_expr(self, o: 'mypy.nodes.YieldExpr') -> T:\n pass\n\n def visit_call_expr(self, o: 'mypy.nodes.CallExpr') -> T:\n pass\n\n def visit_op_expr(self, o: 'mypy.nodes.OpExpr') -> T:\n pass\n\n def visit_comparison_expr(self, o: 'mypy.nodes.ComparisonExpr') -> T:\n pass\n\n def visit_cast_expr(self, o: 'mypy.nodes.CastExpr') -> T:\n pass\n\n def visit_reveal_expr(self, o: 'mypy.nodes.RevealExpr') -> T:\n pass\n\n def visit_super_expr(self, o: 'mypy.nodes.SuperExpr') -> T:\n pass\n\n def visit_assignment_expr(self, o: 'mypy.nodes.AssignmentExpr') -> T:\n pass\n\n def visit_unary_expr(self, o: 'mypy.nodes.UnaryExpr') -> T:\n pass\n\n def visit_list_expr(self, o: 'mypy.nodes.ListExpr') -> T:\n pass\n\n def visit_dict_expr(self, o: 'mypy.nodes.DictExpr') -> T:\n pass\n\n def visit_tuple_expr(self, o: 'mypy.nodes.TupleExpr') -> T:\n pass\n\n def visit_set_expr(self, o: 'mypy.nodes.SetExpr') -> T:\n pass\n\n def visit_index_expr(self, o: 'mypy.nodes.IndexExpr') -> T:\n pass\n\n def visit_type_application(self, o: 'mypy.nodes.TypeApplication') -> T:\n pass\n\n def visit_lambda_expr(self, o: 'mypy.nodes.LambdaExpr') -> T:\n pass\n\n def visit_list_comprehension(self, o: 'mypy.nodes.ListComprehension') -> T:\n pass\n\n def visit_set_comprehension(self, o: 'mypy.nodes.SetComprehension') -> T:\n pass\n\n def visit_dictionary_comprehension(self, o: 'mypy.nodes.DictionaryComprehension') -> T:\n pass\n\n def visit_generator_expr(self, o: 'mypy.nodes.GeneratorExpr') -> T:\n pass\n\n def visit_slice_expr(self, o: 'mypy.nodes.SliceExpr') -> T:\n pass\n\n def visit_conditional_expr(self, o: 'mypy.nodes.ConditionalExpr') -> T:\n pass\n\n def visit_backquote_expr(self, o: 'mypy.nodes.BackquoteExpr') -> T:\n pass\n\n def visit_type_var_expr(self, o: 'mypy.nodes.TypeVarExpr') -> T:\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/visitor.py_NodeVisitor.visit_paramspec_expr_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/visitor.py_NodeVisitor.visit_paramspec_expr_", "embedding": null, "metadata": {"file_path": "mypy/visitor.py", "file_name": "visitor.py", "file_type": "text/x-python", "category": "implementation", "start_line": 539, "end_line": 565, "span_ids": ["NodeVisitor.visit_paramspec_expr", "NodeVisitor.visit_temp_node", "NodeVisitor.visit_enum_call_expr", "NodeVisitor.visit_await_expr", "NodeVisitor.visit_namedtuple_expr", "NodeVisitor.visit_newtype_expr", "NodeVisitor.visit__promote_expr", "NodeVisitor.visit_typeddict_expr", "NodeVisitor.visit_type_alias_expr"], "tokens": 248}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@trait\n@mypyc_attr(allow_interpreted_subclasses=True)\nclass NodeVisitor(Generic[T], ExpressionVisitor[T], StatementVisitor[T]):\n\n def visit_paramspec_expr(self, o: 'mypy.nodes.ParamSpecExpr') -> T:\n pass\n\n def visit_type_alias_expr(self, o: 'mypy.nodes.TypeAliasExpr') -> T:\n pass\n\n def visit_namedtuple_expr(self, o: 'mypy.nodes.NamedTupleExpr') -> T:\n pass\n\n def visit_enum_call_expr(self, o: 'mypy.nodes.EnumCallExpr') -> T:\n pass\n\n def visit_typeddict_expr(self, o: 'mypy.nodes.TypedDictExpr') -> T:\n pass\n\n def visit_newtype_expr(self, o: 'mypy.nodes.NewTypeExpr') -> T:\n pass\n\n def visit__promote_expr(self, o: 'mypy.nodes.PromoteExpr') -> T:\n pass\n\n def visit_await_expr(self, o: 'mypy.nodes.AwaitExpr') -> T:\n pass\n\n def visit_temp_node(self, o: 'mypy.nodes.TempNode') -> T:\n pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py__Utilities_for_emitting_from_mypyc_codegen_litera": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py__Utilities_for_emitting_from_mypyc_codegen_litera", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emit.py", "file_name": "emit.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 24, "span_ids": ["docstring"], "tokens": 268}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Utilities for emitting C code.\"\"\"\n\nfrom mypy.ordered_dict import OrderedDict\nfrom typing import List, Set, Dict, Optional, Callable, Union, Tuple\nimport sys\n\nfrom mypyc.common import (\n REG_PREFIX, ATTR_PREFIX, STATIC_PREFIX, TYPE_PREFIX, NATIVE_PREFIX,\n FAST_ISINSTANCE_MAX_SUBCLASSES, use_vectorcall\n)\nfrom mypyc.ir.ops import BasicBlock, Value\nfrom mypyc.ir.rtypes import (\n RType, RTuple, RInstance, RUnion, RPrimitive,\n is_float_rprimitive, is_bool_rprimitive, is_int_rprimitive, is_short_int_rprimitive,\n is_list_rprimitive, is_dict_rprimitive, is_set_rprimitive, is_tuple_rprimitive,\n is_none_rprimitive, is_object_rprimitive, object_rprimitive, is_str_rprimitive,\n int_rprimitive, is_optional_type, optional_value_type, is_int32_rprimitive,\n is_int64_rprimitive, is_bit_rprimitive\n)\nfrom mypyc.ir.func_ir import FuncDecl\nfrom mypyc.ir.class_ir import ClassIR, all_concrete_classes\nfrom mypyc.namegen import NameGenerator, exported_name\nfrom mypyc.sametype import is_same_type\nfrom mypyc.codegen.literals import Literals", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_EmitterContext_EmitterContext.__init__.self.literals.Literals_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_EmitterContext_EmitterContext.__init__.self.literals.Literals_", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emit.py", "file_name": "emit.py", "file_type": "text/x-python", "category": "implementation", "start_line": 57, "end_line": 88, "span_ids": ["EmitterContext", "EmitterContext.__init__"], "tokens": 269}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class EmitterContext:\n \"\"\"Shared emitter state for a compilation group.\"\"\"\n\n def __init__(self,\n names: NameGenerator,\n group_name: Optional[str] = None,\n group_map: Optional[Dict[str, Optional[str]]] = None,\n ) -> None:\n \"\"\"Setup shared emitter state.\n\n Args:\n names: The name generator to use\n group_map: Map from module names to group name\n group_name: Current group name\n \"\"\"\n self.temp_counter = 0\n self.names = names\n self.group_name = group_name\n self.group_map = group_map or {}\n # Groups that this group depends on\n self.group_deps = set() # type: Set[str]\n\n # The map below is used for generating declarations and\n # definitions at the top of the C file. The main idea is that they can\n # be generated at any time during the emit phase.\n\n # A map of a C identifier to whatever the C identifier declares. Currently this is\n # used for declaring structs and the key corresponds to the name of the struct.\n # The declaration contains the body of the struct.\n self.declarations = OrderedDict() # type: Dict[str, HeaderDeclaration]\n\n self.literals = Literals()", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_class.if_cl_has_dict__generate_class.None_14.generate_getseters_cl_em": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py_generate_class.if_cl_has_dict__generate_class.None_14.generate_getseters_cl_em", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitclass.py", "file_name": "emitclass.py", "file_type": "text/x-python", "category": "implementation", "start_line": 192, "end_line": 276, "span_ids": ["generate_class"], "tokens": 865}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_class(cl: ClassIR, module: str, emitter: Emitter) -> None:\n # ... other code\n if cl.has_dict:\n # __dict__ lives right after the struct and __weakref__ lives right after that\n # TODO: They should get members in the struct instead of doing this nonsense.\n weak_offset = '{} + sizeof(PyObject *)'.format(base_size)\n emitter.emit_lines(\n 'PyMemberDef {}[] = {{'.format(members_name),\n '{{\"__dict__\", T_OBJECT_EX, {}, 0, NULL}},'.format(base_size),\n '{{\"__weakref__\", T_OBJECT_EX, {}, 0, NULL}},'.format(weak_offset),\n '{0}',\n '};',\n )\n\n fields['tp_members'] = members_name\n fields['tp_basicsize'] = '{} + 2*sizeof(PyObject *)'.format(base_size)\n fields['tp_dictoffset'] = base_size\n fields['tp_weaklistoffset'] = weak_offset\n else:\n fields['tp_basicsize'] = base_size\n\n if generate_full:\n # Declare setup method that allocates and initializes an object. type is the\n # type of the class being initialized, which could be another class if there\n # is an interpreted subclass.\n emitter.emit_line('static PyObject *{}(PyTypeObject *type);'.format(setup_name))\n assert cl.ctor is not None\n emitter.emit_line(native_function_header(cl.ctor, emitter) + ';')\n\n emit_line()\n generate_new_for_class(cl, new_name, vtable_name, setup_name, emitter)\n emit_line()\n generate_traverse_for_class(cl, traverse_name, emitter)\n emit_line()\n generate_clear_for_class(cl, clear_name, emitter)\n emit_line()\n generate_dealloc_for_class(cl, dealloc_name, clear_name, emitter)\n emit_line()\n\n if cl.allow_interpreted_subclasses:\n shadow_vtable_name = generate_vtables(\n cl, vtable_setup_name + \"_shadow\", vtable_name + \"_shadow\", emitter, shadow=True\n ) # type: Optional[str]\n emit_line()\n else:\n shadow_vtable_name = None\n vtable_name = generate_vtables(cl, vtable_setup_name, vtable_name, emitter, shadow=False)\n emit_line()\n if needs_getseters:\n generate_getseter_declarations(cl, emitter)\n emit_line()\n generate_getseters_table(cl, getseters_name, emitter)\n emit_line()\n\n if cl.is_trait:\n generate_new_for_trait(cl, new_name, emitter)\n\n generate_methods_table(cl, methods_name, emitter)\n emit_line()\n\n flags = ['Py_TPFLAGS_DEFAULT', 'Py_TPFLAGS_HEAPTYPE', 'Py_TPFLAGS_BASETYPE']\n if generate_full:\n flags.append('Py_TPFLAGS_HAVE_GC')\n if cl.has_method('__call__') and emitter.use_vectorcall():\n fields['tp_vectorcall_offset'] = 'offsetof({}, vectorcall)'.format(\n cl.struct_name(emitter.names))\n flags.append('_Py_TPFLAGS_HAVE_VECTORCALL')\n fields['tp_flags'] = ' | '.join(flags)\n\n emitter.emit_line(\"static PyTypeObject {}_template_ = {{\".format(emitter.type_struct_name(cl)))\n emitter.emit_line(\"PyVarObject_HEAD_INIT(NULL, 0)\")\n for field, value in fields.items():\n emitter.emit_line(\".{} = {},\".format(field, value))\n emitter.emit_line(\"};\")\n emitter.emit_line(\"static PyTypeObject *{t}_template = &{t}_template_;\".format(\n t=emitter.type_struct_name(cl)))\n\n emitter.emit_line()\n if generate_full:\n generate_setup_for_class(\n cl, setup_name, defaults_fn, vtable_name, shadow_vtable_name, emitter)\n emitter.emit_line()\n generate_constructor_for_class(\n cl, cl.ctor, init_fn, setup_name, vtable_name, emitter)\n emitter.emit_line()\n if needs_getseters:\n generate_getseters(cl, emitter)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.visit_load_literal_FunctionEmitterVisitor.visit_load_literal.if_not_is_int_rprimitive_.else_.self_emit_line_s_CPy": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.visit_load_literal_FunctionEmitterVisitor.visit_load_literal.if_not_is_int_rprimitive_.else_.self_emit_line_s_CPy", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitfunc.py", "file_name": "emitfunc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 177, "end_line": 188, "span_ids": ["FunctionEmitterVisitor.visit_load_literal"], "tokens": 156}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FunctionEmitterVisitor(OpVisitor[None]):\n\n def visit_load_literal(self, op: LoadLiteral) -> None:\n index = self.literals.literal_index(op.value)\n s = repr(op.value)\n if not any(x in s for x in ('/*', '*/', '\\0')):\n ann = ' /* %s */' % s\n else:\n ann = ''\n if not is_int_rprimitive(op.type):\n self.emit_line('%s = CPyStatics[%d];%s' % (self.reg(op), index, ann))\n else:\n self.emit_line('%s = (CPyTagged)CPyStatics[%d] | 1;%s' % (\n self.reg(op), index, ann))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py__Generate_C_code_for_a__FileContents.List_Tuple_str_str_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py__Generate_C_code_for_a__FileContents.List_Tuple_str_str_", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitmodule.py", "file_name": "emitmodule.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 75, "span_ids": ["docstring:8", "docstring"], "tokens": 764}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Generate C code for a Python C extension module from Python source code.\"\"\"\n\n# FIXME: Basically nothing in this file operates on the level of a\n# single module and it should be renamed.\n\nimport os\nimport json\nfrom mypy.ordered_dict import OrderedDict\nfrom typing import List, Tuple, Dict, Iterable, Set, TypeVar, Optional\n\nfrom mypy.nodes import MypyFile\nfrom mypy.build import (\n BuildSource, BuildResult, State, build, sorted_components, get_cache_names,\n create_metastore, compute_hash,\n)\nfrom mypy.errors import CompileError\nfrom mypy.options import Options\nfrom mypy.plugin import Plugin, ReportConfigContext\nfrom mypy.fscache import FileSystemCache\nfrom mypy.util import hash_digest\n\nfrom mypyc.irbuild.main import build_ir\nfrom mypyc.irbuild.prepare import load_type_map\nfrom mypyc.irbuild.mapper import Mapper\nfrom mypyc.common import (\n PREFIX, TOP_LEVEL_NAME, MODULE_PREFIX, RUNTIME_C_FILES, use_fastcall,\n use_vectorcall, shared_lib_name,\n)\nfrom mypyc.codegen.cstring import c_string_initializer\nfrom mypyc.codegen.literals import Literals\nfrom mypyc.codegen.emit import EmitterContext, Emitter, HeaderDeclaration\nfrom mypyc.codegen.emitfunc import generate_native_function, native_function_header\nfrom mypyc.codegen.emitclass import generate_class_type_decl, generate_class\nfrom mypyc.codegen.emitwrapper import (\n generate_wrapper_function, wrapper_function_header,\n generate_legacy_wrapper_function, legacy_wrapper_function_header,\n)\nfrom mypyc.ir.ops import DeserMaps, LoadLiteral\nfrom mypyc.ir.rtypes import RType, RTuple\nfrom mypyc.ir.func_ir import FuncIR\nfrom mypyc.ir.class_ir import ClassIR\nfrom mypyc.ir.module_ir import ModuleIR, ModuleIRs, deserialize_modules\nfrom mypyc.options import CompilerOptions\nfrom mypyc.transform.uninit import insert_uninit_checks\nfrom mypyc.transform.refcount import insert_ref_count_opcodes\nfrom mypyc.transform.exceptions import insert_exception_handling\nfrom mypyc.namegen import NameGenerator, exported_name\nfrom mypyc.errors import Errors\n\n\n# All of the modules being compiled are divided into \"groups\". A group\n# is a set of modules that are placed into the same shared library.\n# Two common configurations are that every module is placed in a group\n# by itself (fully separate compilation) and that every module is\n# placed in the same group (fully whole-program compilation), but we\n# support finer-grained control of the group as well.\n#\n# In fully whole-program compilation, we will generate N+1 extension\n# modules: one shim per module and one shared library containing all\n# the actual code.\n# In fully separate compilation, we (unfortunately) will generate 2*N\n# extension modules: one shim per module and also one library containing\n# each module's actual code. (This might be fixable in the future,\n# but allows a clean separation between setup of the export tables\n# (see generate_export_table) and running module top levels.)\n#\n# A group is represented as a list of BuildSources containing all of\n# its modules along with the name of the group. (Which can be None\n# only if we are compiling only a single group with a single file in it\n# and not using shared libraries).\nGroup = Tuple[List[BuildSource], Optional[str]]\nGroups = List[Group]\n\n# A list of (file name, file contents) pairs.\nFileContents = List[Tuple[str, str]]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_MarkedDeclaration_MypycPlugin.__init__.self.metastore.create_metastore_options_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_MarkedDeclaration_MypycPlugin.__init__.self.metastore.create_metastore_options_", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitmodule.py", "file_name": "emitmodule.py", "file_type": "text/x-python", "category": "implementation", "start_line": 78, "end_line": 107, "span_ids": ["MarkedDeclaration.__init__", "MypycPlugin", "MarkedDeclaration", "MypycPlugin.__init__"], "tokens": 289}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class MarkedDeclaration:\n \"\"\"Add a mark, useful for topological sort.\"\"\"\n def __init__(self, declaration: HeaderDeclaration, mark: bool) -> None:\n self.declaration = declaration\n self.mark = False\n\n\nclass MypycPlugin(Plugin):\n \"\"\"Plugin for making mypyc interoperate properly with mypy incremental mode.\n\n Basically the point of this plugin is to force mypy to recheck things\n based on the demands of mypyc in a couple situations:\n * Any modules in the same group must be compiled together, so we\n tell mypy that modules depend on all their groupmates.\n * If the IR metadata is missing or stale or any of the generated\n C source files associated missing or stale, then we need to\n recompile the module so we mark it as stale.\n \"\"\"\n\n def __init__(\n self, options: Options, compiler_options: CompilerOptions, groups: Groups) -> None:\n super().__init__(options)\n self.group_map = {} # type: Dict[str, Tuple[Optional[str], List[str]]]\n for sources, name in groups:\n modules = sorted(source.module for source in sources)\n for id in modules:\n self.group_map[id] = (name, modules)\n\n self.compiler_options = compiler_options\n self.metastore = create_metastore(options)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_generate_function_declaration_generate_function_declaration.if_fn_name_TOP_LEVEL_N.if_is_fastcall_supported_.else_.emitter_context_declarati": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_generate_function_declaration_generate_function_declaration.if_fn_name_TOP_LEVEL_N.if_is_fastcall_supported_.else_.emitter_context_declarati", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitmodule.py", "file_name": "emitmodule.py", "file_type": "text/x-python", "category": "implementation", "start_line": 419, "end_line": 429, "span_ids": ["generate_function_declaration"], "tokens": 147}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_function_declaration(fn: FuncIR, emitter: Emitter) -> None:\n emitter.context.declarations[emitter.native_function_name(fn.decl)] = HeaderDeclaration(\n '{};'.format(native_function_header(fn.decl, emitter)),\n needs_export=True)\n if fn.name != TOP_LEVEL_NAME:\n if is_fastcall_supported(fn, emitter.capi_version):\n emitter.context.declarations[PREFIX + fn.cname(emitter.names)] = HeaderDeclaration(\n '{};'.format(wrapper_function_header(fn, emitter.names)))\n else:\n emitter.context.declarations[PREFIX + fn.cname(emitter.names)] = HeaderDeclaration(\n '{};'.format(legacy_wrapper_function_header(fn, emitter.names)))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_pointerize_group_dir.return.os_sep_join_group_name_sp": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_pointerize_group_dir.return.os_sep_join_group_name_sp", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitmodule.py", "file_name": "emitmodule.py", "file_type": "text/x-python", "category": "implementation", "start_line": 432, "end_line": 445, "span_ids": ["pointerize", "group_dir"], "tokens": 159}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def pointerize(decl: str, name: str) -> str:\n \"\"\"Given a C decl and its name, modify it to be a declaration to a pointer.\"\"\"\n # This doesn't work in general but does work for all our types...\n if '(' in decl:\n # Function pointer. Stick an * in front of the name and wrap it in parens.\n return decl.replace(name, '(*{})'.format(name))\n else:\n # Non-function pointer. Just stick an * in front of the name.\n return decl.replace(name, '*{}'.format(name))\n\n\ndef group_dir(group_name: str) -> str:\n \"\"\"Given a group name, return the relative directory path for it. \"\"\"\n return os.sep.join(group_name.split('.')[:-1])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_GroupGenerator.generate_literal_tables_GroupGenerator.generate_literal_tables.None_6": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_GroupGenerator.generate_literal_tables_GroupGenerator.generate_literal_tables.None_6", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitmodule.py", "file_name": "emitmodule.py", "file_type": "text/x-python", "category": "implementation", "start_line": 621, "end_line": 648, "span_ids": ["GroupGenerator.generate_literal_tables"], "tokens": 377}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GroupGenerator:\n\n def generate_literal_tables(self) -> None:\n \"\"\"Generate tables containing descriptions of Python literals to construct.\n\n We will store the constructed literals in a single array that contains\n literals of all types. This way we can refer to an arbitrary literal by\n its index.\n \"\"\"\n literals = self.context.literals\n # During module initialization we store all the constructed objects here\n self.declare_global('PyObject *[%d]' % literals.num_literals(), 'CPyStatics')\n # Descriptions of str literals\n init_str = c_string_array_initializer(literals.encoded_str_values())\n self.declare_global('const char * const []', 'CPyLit_Str', initializer=init_str)\n # Descriptions of bytes literals\n init_bytes = c_string_array_initializer(literals.encoded_bytes_values())\n self.declare_global('const char * const []', 'CPyLit_Bytes', initializer=init_bytes)\n # Descriptions of int literals\n init_int = c_string_array_initializer(literals.encoded_int_values())\n self.declare_global('const char * const []', 'CPyLit_Int', initializer=init_int)\n # Descriptions of float literals\n init_floats = c_array_initializer(literals.encoded_float_values())\n self.declare_global('const double []', 'CPyLit_Float', initializer=init_floats)\n # Descriptions of complex literals\n init_complex = c_array_initializer(literals.encoded_complex_values())\n self.declare_global('const double []', 'CPyLit_Complex', initializer=init_complex)\n # Descriptions of tuple literals\n init_tuple = c_array_initializer(literals.encoded_tuple_values())\n self.declare_global('const int []', 'CPyLit_Tuple', initializer=init_tuple)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_GroupGenerator.generate_globals_init_GroupGenerator.generate_globals_init.None_3": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_GroupGenerator.generate_globals_init_GroupGenerator.generate_globals_init.None_3", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitmodule.py", "file_name": "emitmodule.py", "file_type": "text/x-python", "category": "implementation", "start_line": 808, "end_line": 831, "span_ids": ["GroupGenerator.generate_globals_init"], "tokens": 195}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GroupGenerator:\n\n def generate_globals_init(self, emitter: Emitter) -> None:\n emitter.emit_lines(\n '',\n 'int CPyGlobalsInit(void)',\n '{',\n 'static int is_initialized = 0;',\n 'if (is_initialized) return 0;',\n ''\n )\n\n emitter.emit_line('CPy_Init();')\n for symbol, fixup in self.simple_inits:\n emitter.emit_line('{} = {};'.format(symbol, fixup))\n\n values = 'CPyLit_Str, CPyLit_Bytes, CPyLit_Int, CPyLit_Float, CPyLit_Complex, CPyLit_Tuple'\n emitter.emit_lines('if (CPyStatics_Initialize(CPyStatics, {}) < 0) {{'.format(values),\n 'return -1;',\n '}')\n\n emitter.emit_lines(\n 'is_initialized = 1;',\n 'return 0;',\n '}',\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_GroupGenerator.declare_global_GroupGenerator.declare_global.if_name_not_in_self_conte.self_context_declarations": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_GroupGenerator.declare_global_GroupGenerator.declare_global.if_name_not_in_self_conte.self_context_declarations", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitmodule.py", "file_name": "emitmodule.py", "file_type": "text/x-python", "category": "implementation", "start_line": 964, "end_line": 981, "span_ids": ["GroupGenerator.declare_global"], "tokens": 151}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GroupGenerator:\n\n def declare_global(self, type_spaced: str, name: str,\n *,\n initializer: Optional[str] = None) -> None:\n if '[' not in type_spaced:\n base = '{}{}'.format(type_spaced, name)\n else:\n a, b = type_spaced.split('[', 1)\n base = '{}{}[{}'.format(a, name, b)\n\n if not initializer:\n defn = None\n else:\n defn = ['{} = {};'.format(base, initializer)]\n if name not in self.context.declarations:\n self.context.declarations[name] = HeaderDeclaration(\n '{};'.format(base),\n defn=defn,\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_GroupGenerator.declare_internal_globals_GroupGenerator.declare_module.self_simple_inits_append_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_GroupGenerator.declare_internal_globals_GroupGenerator.declare_module.self_simple_inits_append_", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitmodule.py", "file_name": "emitmodule.py", "file_type": "text/x-python", "category": "implementation", "start_line": 983, "end_line": 999, "span_ids": ["GroupGenerator.module_internal_static_name", "GroupGenerator.declare_internal_globals", "GroupGenerator.declare_module"], "tokens": 235}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class GroupGenerator:\n\n def declare_internal_globals(self, module_name: str, emitter: Emitter) -> None:\n static_name = emitter.static_name('globals', module_name)\n self.declare_global('PyObject *', static_name)\n\n def module_internal_static_name(self, module_name: str, emitter: Emitter) -> str:\n return emitter.static_name(module_name + '_internal', None, prefix=MODULE_PREFIX)\n\n def declare_module(self, module_name: str, emitter: Emitter) -> None:\n # We declare two globals for each module:\n # one used internally in the implementation of module init to cache results\n # and prevent infinite recursion in import cycles, and one used\n # by other modules to refer to it.\n internal_static_name = self.module_internal_static_name(module_name, emitter)\n self.declare_global('CPyModule *', internal_static_name, initializer='NULL')\n static_name = emitter.static_name(module_name, None, prefix=MODULE_PREFIX)\n self.declare_global('CPyModule *', static_name)\n self.simple_inits.append((static_name, 'Py_None'))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_T_collect_literals.for_block_in_fn_blocks_.for_op_in_block_ops_.if_isinstance_op_LoadLit.literals_record_literal_o": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_T_collect_literals.for_block_in_fn_blocks_.for_op_in_block_ops_.if_isinstance_op_LoadLit.literals_record_literal_o", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitmodule.py", "file_name": "emitmodule.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1044, "end_line": 1090, "span_ids": ["is_fastcall_supported", "toposort", "impl:7", "collect_literals"], "tokens": 305}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "T = TypeVar('T')\n\n\ndef toposort(deps: Dict[T, Set[T]]) -> List[T]:\n \"\"\"Topologically sort a dict from item to dependencies.\n\n This runs in O(V + E).\n \"\"\"\n result = []\n visited = set() # type: Set[T]\n\n def visit(item: T) -> None:\n if item in visited:\n return\n\n for child in deps[item]:\n visit(child)\n\n result.append(item)\n visited.add(item)\n\n for item in deps:\n visit(item)\n\n return result\n\n\ndef is_fastcall_supported(fn: FuncIR, capi_version: Tuple[int, int]) -> bool:\n if fn.class_name is not None:\n if fn.name == '__call__':\n # We can use vectorcalls (PEP 590) when supported\n return use_vectorcall(capi_version)\n # TODO: Support fastcall for __init__.\n return use_fastcall(capi_version) and fn.name != '__init__'\n return use_fastcall(capi_version)\n\n\ndef collect_literals(fn: FuncIR, literals: Literals) -> None:\n \"\"\"Store all Python literal object refs in fn.\n\n Collecting literals must happen only after we have the final IR.\n This way we won't include literals that have been optimized away.\n \"\"\"\n for block in fn.blocks:\n for op in block.ops:\n if isinstance(op, LoadLiteral):\n literals.record_literal(op.value)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_c_array_initializer_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitmodule.py_c_array_initializer_", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitmodule.py", "file_name": "emitmodule.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1093, "end_line": 1131, "span_ids": ["c_array_initializer", "c_string_array_initializer"], "tokens": 297}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def c_array_initializer(components: List[str]) -> str:\n \"\"\"Construct an initializer for a C array variable.\n\n Components are C expressions valid in an initializer.\n\n For example, if components are [\"1\", \"2\"], the result\n would be \"{1, 2}\", which can be used like this:\n\n int a[] = {1, 2};\n\n If the result is long, split it into multiple lines.\n \"\"\"\n res = []\n current = [] # type: List[str]\n cur_len = 0\n for c in components:\n if not current or cur_len + 2 + len(c) < 70:\n current.append(c)\n cur_len += len(c) + 2\n else:\n res.append(', '.join(current))\n current = [c]\n cur_len = len(c)\n if not res:\n # Result fits on a single line\n return '{%s}' % ', '.join(current)\n # Multi-line result\n res.append(', '.join(current))\n return '{\\n ' + ',\\n '.join(res) + '\\n}'\n\n\ndef c_string_array_initializer(components: List[bytes]) -> str:\n result = []\n result.append('{\\n')\n for s in components:\n result.append(' ' + c_string_initializer(s) + ',\\n')\n result.append('}')\n return ''.join(result)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitwrapper.py__Generate_CPython_API_w_wrapper_function_header.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitwrapper.py__Generate_CPython_API_w_wrapper_function_header.return._", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitwrapper.py", "file_name": "emitwrapper.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 55, "span_ids": ["wrapper_function_header", "docstring"], "tokens": 504}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Generate CPython API wrapper functions for native functions.\n\nThe wrapper functions are used by the CPython runtime when calling\nnative functions from interpreted code, and when the called function\ncan't be determined statically in compiled code. They validate, match,\nunbox and type check function arguments, and box return values as\nneeded. All wrappers accept and return 'PyObject *' (boxed) values.\n\nThe wrappers aren't used for most calls between two native functions\nor methods in a single compilation unit.\n\"\"\"\n\nfrom typing import List, Optional\n\nfrom mypy.nodes import ARG_POS, ARG_OPT, ARG_NAMED_OPT, ARG_NAMED, ARG_STAR, ARG_STAR2\n\nfrom mypyc.common import PREFIX, NATIVE_PREFIX, DUNDER_PREFIX, use_vectorcall\nfrom mypyc.codegen.emit import Emitter\nfrom mypyc.ir.rtypes import (\n RType, is_object_rprimitive, is_int_rprimitive, is_bool_rprimitive, object_rprimitive\n)\nfrom mypyc.ir.func_ir import FuncIR, RuntimeArg, FUNC_STATICMETHOD\nfrom mypyc.ir.class_ir import ClassIR\nfrom mypyc.namegen import NameGenerator\n\n\n# Generic vectorcall wrapper functions (Python 3.7+)\n#\n# A wrapper function has a signature like this:\n#\n# PyObject *fn(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)\n#\n# The function takes a self object, pointer to an array of arguments,\n# the number of positional arguments, and a tuple of keyword argument\n# names (that are stored starting in args[nargs]).\n#\n# It returns the returned object, or NULL on an exception.\n#\n# These are more efficient than legacy wrapper functions, since\n# usually no tuple or dict objects need to be created for the\n# arguments. Vectorcalls also use pre-constructed str objects for\n# keyword argument names and other pre-computed information, instead\n# of processing the argument format string on each call.\n\n\ndef wrapper_function_header(fn: FuncIR, names: NameGenerator) -> str:\n \"\"\"Return header of a vectorcall wrapper function.\n\n See comment above for a summary of the arguments.\n \"\"\"\n return (\n 'PyObject *{prefix}{name}('\n 'PyObject *self, PyObject *const *args, size_t nargs, PyObject *kwnames)').format(\n prefix=PREFIX,\n name=fn.cname(names))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitwrapper.py_generate_traceback_code_generate_traceback_code.return.traceback_code": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitwrapper.py_generate_traceback_code_generate_traceback_code.return.traceback_code", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitwrapper.py", "file_name": "emitwrapper.py", "file_type": "text/x-python", "category": "implementation", "start_line": 58, "end_line": 73, "span_ids": ["generate_traceback_code"], "tokens": 178}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_traceback_code(fn: FuncIR,\n emitter: Emitter,\n source_path: str,\n module_name: str) -> str:\n # If we hit an error while processing arguments, then we emit a\n # traceback frame to make it possible to debug where it happened.\n # Unlike traceback frames added for exceptions seen in IR, we do this\n # even if there is no `traceback_name`. This is because the error will\n # have originated here and so we need it in the traceback.\n globals_static = emitter.static_name('globals', module_name)\n traceback_code = 'CPy_AddTraceback(\"%s\", \"%s\", %d, %s);' % (\n source_path.replace(\"\\\\\", \"\\\\\\\\\"),\n fn.traceback_name or fn.name,\n fn.line,\n globals_static)\n return traceback_code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitwrapper.py_make_arg_groups_make_static_kwlist.return._static_const_char_cons": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitwrapper.py_make_arg_groups_make_static_kwlist.return._static_const_char_cons", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitwrapper.py", "file_name": "emitwrapper.py", "file_type": "text/x-python", "category": "implementation", "start_line": 76, "end_line": 88, "span_ids": ["make_arg_groups", "make_static_kwlist", "reorder_arg_groups"], "tokens": 168}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def make_arg_groups(args: List[RuntimeArg]) -> List[List[RuntimeArg]]:\n \"\"\"Group arguments by kind.\"\"\"\n return [[arg for arg in args if arg.kind == k] for k in range(ARG_NAMED_OPT + 1)]\n\n\ndef reorder_arg_groups(groups: List[List[RuntimeArg]]) -> List[RuntimeArg]:\n \"\"\"Reorder argument groups to match their order in a format string.\"\"\"\n return groups[ARG_POS] + groups[ARG_OPT] + groups[ARG_NAMED_OPT] + groups[ARG_NAMED]\n\n\ndef make_static_kwlist(args: List[RuntimeArg]) -> str:\n arg_names = ''.join('\"{}\", '.format(arg.name) for arg in args)\n return 'static const char * const kwlist[] = {{{}0}};'.format(arg_names)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitwrapper.py_generate_wrapper_function_generate_wrapper_function.None_5": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitwrapper.py_generate_wrapper_function_generate_wrapper_function.None_5", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitwrapper.py", "file_name": "emitwrapper.py", "file_type": "text/x-python", "category": "implementation", "start_line": 121, "end_line": 187, "span_ids": ["generate_wrapper_function"], "tokens": 747}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_wrapper_function(fn: FuncIR,\n emitter: Emitter,\n source_path: str,\n module_name: str) -> None:\n \"\"\"Generate a CPython-compatible vectorcall wrapper for a native function.\n\n In particular, this handles unboxing the arguments, calling the native function, and\n then boxing the return value.\n \"\"\"\n emitter.emit_line('{} {{'.format(wrapper_function_header(fn, emitter.names)))\n\n # If fn is a method, then the first argument is a self param\n real_args = list(fn.args)\n if fn.class_name and not fn.decl.kind == FUNC_STATICMETHOD:\n arg = real_args.pop(0)\n emitter.emit_line('PyObject *obj_{} = self;'.format(arg.name))\n\n # Need to order args as: required, optional, kwonly optional, kwonly required\n # This is because CPyArg_ParseStackAndKeywords format string requires\n # them grouped in that way.\n groups = make_arg_groups(real_args)\n reordered_args = reorder_arg_groups(groups)\n\n emitter.emit_line(make_static_kwlist(reordered_args))\n fmt = make_format_string(fn.name, groups)\n # Define the arguments the function accepts (but no types yet)\n emitter.emit_line('static CPyArg_Parser parser = {{\"{}\", kwlist, 0}};'.format(fmt))\n\n for arg in real_args:\n emitter.emit_line('PyObject *obj_{}{};'.format(\n arg.name, ' = NULL' if arg.optional else ''))\n\n cleanups = ['CPy_DECREF(obj_{});'.format(arg.name)\n for arg in groups[ARG_STAR] + groups[ARG_STAR2]]\n\n arg_ptrs = [] # type: List[str]\n if groups[ARG_STAR] or groups[ARG_STAR2]:\n arg_ptrs += ['&obj_{}'.format(groups[ARG_STAR][0].name) if groups[ARG_STAR] else 'NULL']\n arg_ptrs += ['&obj_{}'.format(groups[ARG_STAR2][0].name) if groups[ARG_STAR2] else 'NULL']\n arg_ptrs += ['&obj_{}'.format(arg.name) for arg in reordered_args]\n\n if fn.name == '__call__' and use_vectorcall(emitter.capi_version):\n nargs = 'PyVectorcall_NARGS(nargs)'\n else:\n nargs = 'nargs'\n parse_fn = 'CPyArg_ParseStackAndKeywords'\n # Special case some common signatures\n if len(real_args) == 0:\n # No args\n parse_fn = 'CPyArg_ParseStackAndKeywordsNoArgs'\n elif len(real_args) == 1 and len(groups[ARG_POS]) == 1:\n # Single positional arg\n parse_fn = 'CPyArg_ParseStackAndKeywordsOneArg'\n elif len(real_args) == len(groups[ARG_POS]) + len(groups[ARG_OPT]):\n # No keyword-only args, *args or **kwargs\n parse_fn = 'CPyArg_ParseStackAndKeywordsSimple'\n emitter.emit_lines(\n 'if (!{}(args, {}, kwnames, &parser{})) {{'.format(\n parse_fn, nargs, ''.join(', ' + n for n in arg_ptrs)),\n 'return NULL;',\n '}')\n traceback_code = generate_traceback_code(fn, emitter, source_path, module_name)\n generate_wrapper_core(fn, emitter, groups[ARG_OPT] + groups[ARG_NAMED_OPT],\n cleanups=cleanups,\n traceback_code=traceback_code)\n\n emitter.emit_line('}')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitwrapper.py__Legacy_generic_wrapper__legacy_wrapper_function_header.return._PyObject_prefix_name_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitwrapper.py__Legacy_generic_wrapper__legacy_wrapper_function_header.return._PyObject_prefix_name_", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitwrapper.py", "file_name": "emitwrapper.py", "file_type": "text/x-python", "category": "implementation", "start_line": 188, "end_line": 199, "span_ids": ["legacy_wrapper_function_header", "generate_wrapper_function"], "tokens": 106}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Legacy generic wrapper functions\n#\n# These take a self object, a Python tuple of positional arguments,\n# and a dict of keyword arguments. These are a lot slower than\n# vectorcall wrappers, especially in calls involving keyword\n# arguments.\n\n\ndef legacy_wrapper_function_header(fn: FuncIR, names: NameGenerator) -> str:\n return 'PyObject *{prefix}{name}(PyObject *self, PyObject *args, PyObject *kw)'.format(\n prefix=PREFIX,\n name=fn.cname(names))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitwrapper.py_generate_legacy_wrapper_function_generate_legacy_wrapper_function.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitwrapper.py_generate_legacy_wrapper_function_generate_legacy_wrapper_function.None_4", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitwrapper.py", "file_name": "emitwrapper.py", "file_type": "text/x-python", "category": "implementation", "start_line": 204, "end_line": 251, "span_ids": ["generate_legacy_wrapper_function"], "tokens": 529}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def generate_legacy_wrapper_function(fn: FuncIR,\n emitter: Emitter,\n source_path: str,\n module_name: str) -> None:\n \"\"\"Generates a CPython-compatible legacy wrapper for a native function.\n\n In particular, this handles unboxing the arguments, calling the native function, and\n then boxing the return value.\n \"\"\"\n emitter.emit_line('{} {{'.format(legacy_wrapper_function_header(fn, emitter.names)))\n\n # If fn is a method, then the first argument is a self param\n real_args = list(fn.args)\n if fn.class_name and not fn.decl.kind == FUNC_STATICMETHOD:\n arg = real_args.pop(0)\n emitter.emit_line('PyObject *obj_{} = self;'.format(arg.name))\n\n # Need to order args as: required, optional, kwonly optional, kwonly required\n # This is because CPyArg_ParseTupleAndKeywords format string requires\n # them grouped in that way.\n groups = make_arg_groups(real_args)\n reordered_args = reorder_arg_groups(groups)\n\n emitter.emit_line(make_static_kwlist(reordered_args))\n for arg in real_args:\n emitter.emit_line('PyObject *obj_{}{};'.format(\n arg.name, ' = NULL' if arg.optional else ''))\n\n cleanups = ['CPy_DECREF(obj_{});'.format(arg.name)\n for arg in groups[ARG_STAR] + groups[ARG_STAR2]]\n\n arg_ptrs = [] # type: List[str]\n if groups[ARG_STAR] or groups[ARG_STAR2]:\n arg_ptrs += ['&obj_{}'.format(groups[ARG_STAR][0].name) if groups[ARG_STAR] else 'NULL']\n arg_ptrs += ['&obj_{}'.format(groups[ARG_STAR2][0].name) if groups[ARG_STAR2] else 'NULL']\n arg_ptrs += ['&obj_{}'.format(arg.name) for arg in reordered_args]\n\n emitter.emit_lines(\n 'if (!CPyArg_ParseTupleAndKeywords(args, kw, \"{}\", \"{}\", kwlist{})) {{'.format(\n make_format_string(None, groups), fn.name, ''.join(', ' + n for n in arg_ptrs)),\n 'return NULL;',\n '}')\n traceback_code = generate_traceback_code(fn, emitter, source_path, module_name)\n generate_wrapper_core(fn, emitter, groups[ARG_OPT] + groups[ARG_NAMED_OPT],\n cleanups=cleanups,\n traceback_code=traceback_code)\n\n emitter.emit_line('}')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitwrapper.py__Specialized_wrapper_fun_RICHCOMPARE_OPS._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitwrapper.py__Specialized_wrapper_fun_RICHCOMPARE_OPS._", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitwrapper.py", "file_name": "emitwrapper.py", "file_type": "text/x-python", "category": "implementation", "start_line": 252, "end_line": 279, "span_ids": ["generate_legacy_wrapper_function", "generate_dunder_wrapper", "impl"], "tokens": 233}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Specialized wrapper functions\n\n\ndef generate_dunder_wrapper(cl: ClassIR, fn: FuncIR, emitter: Emitter) -> str:\n \"\"\"Generates a wrapper for native __dunder__ methods to be able to fit into the mapping\n protocol slot. This specifically means that the arguments are taken as *PyObjects and returned\n as *PyObjects.\n \"\"\"\n input_args = ', '.join('PyObject *obj_{}'.format(arg.name) for arg in fn.args)\n name = '{}{}{}'.format(DUNDER_PREFIX, fn.name, cl.name_prefix(emitter.names))\n emitter.emit_line('static PyObject *{name}({input_args}) {{'.format(\n name=name,\n input_args=input_args,\n ))\n generate_wrapper_core(fn, emitter)\n emitter.emit_line('}')\n\n return name\n\n\nRICHCOMPARE_OPS = {\n '__lt__': 'Py_LT',\n '__gt__': 'Py_GT',\n '__le__': 'Py_LE',\n '__ge__': 'Py_GE',\n '__eq__': 'Py_EQ',\n '__ne__': 'Py_NE',\n}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitwrapper.py__Helpers_generate_wrapper_core.if_use_goto_.emitter_emit_lines_retur": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitwrapper.py__Helpers_generate_wrapper_core.if_use_goto_.emitter_emit_lines_retur", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitwrapper.py", "file_name": "emitwrapper.py", "file_type": "text/x-python", "category": "implementation", "start_line": 371, "end_line": 421, "span_ids": ["generate_wrapper_core", "generate_bool_wrapper"], "tokens": 526}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Helpers\n\n\ndef generate_wrapper_core(fn: FuncIR, emitter: Emitter,\n optional_args: Optional[List[RuntimeArg]] = None,\n arg_names: Optional[List[str]] = None,\n cleanups: Optional[List[str]] = None,\n traceback_code: Optional[str] = None) -> None:\n \"\"\"Generates the core part of a wrapper function for a native function.\n\n This expects each argument as a PyObject * named obj_{arg} as a precondition.\n It converts the PyObject *s to the necessary types, checking and unboxing if necessary,\n makes the call, then boxes the result if necessary and returns it.\n \"\"\"\n\n optional_args = optional_args or []\n cleanups = cleanups or []\n use_goto = bool(cleanups or traceback_code)\n error_code = 'return NULL;' if not use_goto else 'goto fail;'\n\n arg_names = arg_names or [arg.name for arg in fn.args]\n for arg_name, arg in zip(arg_names, fn.args):\n # Suppress the argument check for *args/**kwargs, since we know it must be right.\n typ = arg.type if arg.kind not in (ARG_STAR, ARG_STAR2) else object_rprimitive\n generate_arg_check(arg_name, typ, emitter, error_code, arg in optional_args)\n native_args = ', '.join('arg_{}'.format(arg) for arg in arg_names)\n if fn.ret_type.is_unboxed or use_goto:\n # TODO: The Py_RETURN macros return the correct PyObject * with reference count handling.\n # Are they relevant?\n emitter.emit_line('{}retval = {}{}({});'.format(emitter.ctype_spaced(fn.ret_type),\n NATIVE_PREFIX,\n fn.cname(emitter.names),\n native_args))\n emitter.emit_lines(*cleanups)\n if fn.ret_type.is_unboxed:\n emitter.emit_error_check('retval', fn.ret_type, 'return NULL;')\n emitter.emit_box('retval', 'retbox', fn.ret_type, declare_dest=True)\n\n emitter.emit_line('return {};'.format('retbox' if fn.ret_type.is_unboxed else 'retval'))\n else:\n emitter.emit_line('return {}{}({});'.format(NATIVE_PREFIX,\n fn.cname(emitter.names),\n native_args))\n # TODO: Tracebacks?\n\n if use_goto:\n emitter.emit_label('fail')\n emitter.emit_lines(*cleanups)\n if traceback_code:\n emitter.emit_lines(traceback_code)\n emitter.emit_lines('return NULL;')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/literals.py_from_typing_import_Dict__Literals.__init__._type_Dict_Tuple_object": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/literals.py_from_typing_import_Dict__Literals.__init__._type_Dict_Tuple_object", "embedding": null, "metadata": {"file_path": "mypyc/codegen/literals.py", "file_name": "literals.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 25, "span_ids": ["imports", "Literals", "Literals.__init__"], "tokens": 246}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from typing import Dict, List, Union, Tuple, Any, cast\n\nfrom typing_extensions import Final\n\n\n# Supported Python literal types. All tuple items must have supported\n# literal types as well, but we can't represent the type precisely.\nLiteralValue = Union[str, bytes, int, bool, float, complex, Tuple[object, ...], None]\n\n\n# Some literals are singletons and handled specially (None, False and True)\nNUM_SINGLETONS = 3 # type: Final\n\n\nclass Literals:\n \"\"\"Collection of literal values used in a compilation group and related helpers.\"\"\"\n\n def __init__(self) -> None:\n # Each dict maps value to literal index (0, 1, ...)\n self.str_literals = {} # type: Dict[str, int]\n self.bytes_literals = {} # type: Dict[bytes, int]\n self.int_literals = {} # type: Dict[int, int]\n self.float_literals = {} # type: Dict[float, int]\n self.complex_literals = {} # type: Dict[complex, int]\n self.tuple_literals = {} # type: Dict[Tuple[object, ...], int]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/literals.py_Literals.record_literal_Literals.record_literal.if_isinstance_value_str_.else_.assert_False_invalid_li": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/literals.py_Literals.record_literal_Literals.record_literal.if_isinstance_value_str_.else_.assert_False_invalid_li", "embedding": null, "metadata": {"file_path": "mypyc/codegen/literals.py", "file_name": "literals.py", "file_type": "text/x-python", "category": "implementation", "start_line": 27, "end_line": 59, "span_ids": ["Literals.record_literal"], "tokens": 293}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Literals:\n\n def record_literal(self, value: LiteralValue) -> None:\n \"\"\"Ensure that the literal value is available in generated code.\"\"\"\n if value is None or value is True or value is False:\n # These are special cased and always present\n return\n if isinstance(value, str):\n str_literals = self.str_literals\n if value not in str_literals:\n str_literals[value] = len(str_literals)\n elif isinstance(value, bytes):\n bytes_literals = self.bytes_literals\n if value not in bytes_literals:\n bytes_literals[value] = len(bytes_literals)\n elif isinstance(value, int):\n int_literals = self.int_literals\n if value not in int_literals:\n int_literals[value] = len(int_literals)\n elif isinstance(value, float):\n float_literals = self.float_literals\n if value not in float_literals:\n float_literals[value] = len(float_literals)\n elif isinstance(value, complex):\n complex_literals = self.complex_literals\n if value not in complex_literals:\n complex_literals[value] = len(complex_literals)\n elif isinstance(value, tuple):\n tuple_literals = self.tuple_literals\n if value not in tuple_literals:\n for item in value:\n self.record_literal(cast(Any, item))\n tuple_literals[value] = len(tuple_literals)\n else:\n assert False, 'invalid literal: %r' % value", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/literals.py_Literals.literal_index_Literals.literal_index.assert_False_invalid_li": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/literals.py_Literals.literal_index_Literals.literal_index.assert_False_invalid_li", "embedding": null, "metadata": {"file_path": "mypyc/codegen/literals.py", "file_name": "literals.py", "file_type": "text/x-python", "category": "implementation", "start_line": 61, "end_line": 89, "span_ids": ["Literals.literal_index"], "tokens": 250}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Literals:\n\n def literal_index(self, value: LiteralValue) -> int:\n \"\"\"Return the index to the literals array for given value.\"\"\"\n # The array contains first None and booleans, followed by all str values,\n # followed by bytes values, etc.\n if value is None:\n return 0\n elif value is False:\n return 1\n elif value is True:\n return 2\n n = NUM_SINGLETONS\n if isinstance(value, str):\n return n + self.str_literals[value]\n n += len(self.str_literals)\n if isinstance(value, bytes):\n return n + self.bytes_literals[value]\n n += len(self.bytes_literals)\n if isinstance(value, int):\n return n + self.int_literals[value]\n n += len(self.int_literals)\n if isinstance(value, float):\n return n + self.float_literals[value]\n n += len(self.float_literals)\n if isinstance(value, complex):\n return n + self.complex_literals[value]\n n += len(self.complex_literals)\n if isinstance(value, tuple):\n return n + self.tuple_literals[value]\n assert False, 'invalid literal: %r' % value", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/literals.py_Literals.num_literals_Literals.encoded_complex_values.return._encode_complex_values_se": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/literals.py_Literals.num_literals_Literals.encoded_complex_values.return._encode_complex_values_se", "embedding": null, "metadata": {"file_path": "mypyc/codegen/literals.py", "file_name": "literals.py", "file_type": "text/x-python", "category": "implementation", "start_line": 91, "end_line": 113, "span_ids": ["Literals.encoded_float_values", "Literals.encoded_bytes_values", "Literals.num_literals", "Literals.encoded_complex_values", "Literals.encoded_str_values", "Literals.encoded_int_values"], "tokens": 202}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Literals:\n\n def num_literals(self) -> int:\n # The first three are for None, True and False\n return (NUM_SINGLETONS + len(self.str_literals) + len(self.bytes_literals) +\n len(self.int_literals) + len(self.float_literals) + len(self.complex_literals) +\n len(self.tuple_literals))\n\n # The following methods return the C encodings of literal values\n # of different types\n\n def encoded_str_values(self) -> List[bytes]:\n return _encode_str_values(self.str_literals)\n\n def encoded_int_values(self) -> List[bytes]:\n return _encode_int_values(self.int_literals)\n\n def encoded_bytes_values(self) -> List[bytes]:\n return _encode_bytes_values(self.bytes_literals)\n\n def encoded_float_values(self) -> List[str]:\n return _encode_float_values(self.float_literals)\n\n def encoded_complex_values(self) -> List[str]:\n return _encode_complex_values(self.complex_literals)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/literals.py_Literals.encoded_tuple_values_Literals.encoded_tuple_values.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/literals.py_Literals.encoded_tuple_values_Literals.encoded_tuple_values.return.result", "embedding": null, "metadata": {"file_path": "mypyc/codegen/literals.py", "file_name": "literals.py", "file_type": "text/x-python", "category": "implementation", "start_line": 115, "end_line": 141, "span_ids": ["Literals.encoded_tuple_values"], "tokens": 177}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Literals:\n\n def encoded_tuple_values(self) -> List[str]:\n \"\"\"Encode tuple values into a C array.\n\n The format of the result is like this:\n\n \n \n \n ...\n \n \n ...\n \"\"\"\n values = self.tuple_literals\n value_by_index = {}\n for value, index in values.items():\n value_by_index[index] = value\n result = []\n num = len(values)\n result.append(str(num))\n for i in range(num):\n value = value_by_index[i]\n result.append(str(len(value)))\n for item in value:\n index = self.literal_index(cast(Any, item))\n result.append(str(index))\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/literals.py__encode_str_values__encode_str_values.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/literals.py__encode_str_values__encode_str_values.return.result", "embedding": null, "metadata": {"file_path": "mypyc/codegen/literals.py", "file_name": "literals.py", "file_type": "text/x-python", "category": "implementation", "start_line": 144, "end_line": 164, "span_ids": ["_encode_str_values"], "tokens": 179}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _encode_str_values(values: Dict[str, int]) -> List[bytes]:\n value_by_index = {}\n for value, index in values.items():\n value_by_index[index] = value\n result = []\n line = [] # type: List[bytes]\n line_len = 0\n for i in range(len(values)):\n value = value_by_index[i]\n c_literal = format_str_literal(value)\n c_len = len(c_literal)\n if line_len > 0 and line_len + c_len > 70:\n result.append(format_int(len(line)) + b''.join(line))\n line = []\n line_len = 0\n line.append(c_literal)\n line_len += c_len\n if line:\n result.append(format_int(len(line)) + b''.join(line))\n result.append(b'')\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/literals.py__encode_bytes_values__encode_bytes_values.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/literals.py__encode_bytes_values__encode_bytes_values.return.result", "embedding": null, "metadata": {"file_path": "mypyc/codegen/literals.py", "file_name": "literals.py", "file_type": "text/x-python", "category": "implementation", "start_line": 167, "end_line": 187, "span_ids": ["_encode_bytes_values"], "tokens": 186}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _encode_bytes_values(values: Dict[bytes, int]) -> List[bytes]:\n value_by_index = {}\n for value, index in values.items():\n value_by_index[index] = value\n result = []\n line = [] # type: List[bytes]\n line_len = 0\n for i in range(len(values)):\n value = value_by_index[i]\n c_init = format_int(len(value))\n c_len = len(c_init) + len(value)\n if line_len > 0 and line_len + c_len > 70:\n result.append(format_int(len(line)) + b''.join(line))\n line = []\n line_len = 0\n line.append(c_init + value)\n line_len += c_len\n if line:\n result.append(format_int(len(line)) + b''.join(line))\n result.append(b'')\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/literals.py_format_int_format_str_literal.return.format_int_len_utf8_u": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/literals.py_format_int_format_str_literal.return.format_int_len_utf8_u", "embedding": null, "metadata": {"file_path": "mypyc/codegen/literals.py", "file_name": "literals.py", "file_type": "text/x-python", "category": "implementation", "start_line": 190, "end_line": 207, "span_ids": ["format_str_literal", "format_int"], "tokens": 145}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def format_int(n: int) -> bytes:\n \"\"\"Format an integer using a variable-length binary encoding.\"\"\"\n if n < 128:\n a = [n]\n else:\n a = []\n while n > 0:\n a.insert(0, n & 0x7f)\n n >>= 7\n for i in range(len(a) - 1):\n # If the highest bit is set, more 7-bit digits follow\n a[i] |= 0x80\n return bytes(a)\n\n\ndef format_str_literal(s: str) -> bytes:\n utf8 = s.encode('utf-8')\n return format_int(len(utf8)) + utf8", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/literals.py__encode_int_values__encode_int_values.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/literals.py__encode_int_values__encode_int_values.return.result", "embedding": null, "metadata": {"file_path": "mypyc/codegen/literals.py", "file_name": "literals.py", "file_type": "text/x-python", "category": "implementation", "start_line": 210, "end_line": 233, "span_ids": ["_encode_int_values"], "tokens": 202}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _encode_int_values(values: Dict[int, int]) -> List[bytes]:\n \"\"\"Encode int values into C strings.\n\n Values are stored in base 10 and separated by 0 bytes.\n \"\"\"\n value_by_index = {}\n for value, index in values.items():\n value_by_index[index] = value\n result = []\n line = [] # type: List[bytes]\n line_len = 0\n for i in range(len(values)):\n value = value_by_index[i]\n encoded = b'%d' % value\n if line_len > 0 and line_len + len(encoded) > 70:\n result.append(format_int(len(line)) + b'\\0'.join(line))\n line = []\n line_len = 0\n line.append(encoded)\n line_len += len(encoded)\n if line:\n result.append(format_int(len(line)) + b'\\0'.join(line))\n result.append(b'')\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/literals.py_float_to_c__encode_float_values.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/literals.py_float_to_c__encode_float_values.return.result", "embedding": null, "metadata": {"file_path": "mypyc/codegen/literals.py", "file_name": "literals.py", "file_type": "text/x-python", "category": "implementation", "start_line": 236, "end_line": 260, "span_ids": ["float_to_c", "_encode_float_values"], "tokens": 166}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def float_to_c(x: float) -> str:\n \"\"\"Return C literal representation of a float value.\"\"\"\n s = str(x)\n if s == 'inf':\n return 'INFINITY'\n elif s == '-inf':\n return '-INFINITY'\n return s\n\n\ndef _encode_float_values(values: Dict[float, int]) -> List[str]:\n \"\"\"Encode float values into a C array values.\n\n The result contains the number of values followed by individual values.\n \"\"\"\n value_by_index = {}\n for value, index in values.items():\n value_by_index[index] = value\n result = []\n num = len(values)\n result.append(str(num))\n for i in range(num):\n value = value_by_index[i]\n result.append(float_to_c(value))\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/literals.py__encode_complex_values_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/literals.py__encode_complex_values_", "embedding": null, "metadata": {"file_path": "mypyc/codegen/literals.py", "file_name": "literals.py", "file_type": "text/x-python", "category": "implementation", "start_line": 263, "end_line": 280, "span_ids": ["_encode_complex_values"], "tokens": 125}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _encode_complex_values(values: Dict[complex, int]) -> List[str]:\n \"\"\"Encode float values into a C array values.\n\n The result contains the number of values followed by pairs of doubles\n representing complex numbers.\n \"\"\"\n value_by_index = {}\n for value, index in values.items():\n value_by_index[index] = value\n result = []\n num = len(values)\n result.append(str(num))\n for i in range(num):\n value = value_by_index[i]\n result.append(float_to_c(value.real))\n result.append(float_to_c(value.imag))\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_LoadLiteral_LoadLiteral.accept.return.visitor_visit_load_litera": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_LoadLiteral_LoadLiteral.accept.return.visitor_visit_load_litera", "embedding": null, "metadata": {"file_path": "mypyc/ir/ops.py", "file_name": "ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 497, "end_line": 528, "span_ids": ["LoadLiteral.sources", "LoadLiteral.__init__", "LoadLiteral", "LoadLiteral.accept"], "tokens": 266}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LoadLiteral(RegisterOp):\n \"\"\"Load a Python literal object (dest = 'foo' / b'foo' / ...).\n\n This is used to load a static PyObject * value corresponding to\n a literal of one of the supported types.\n\n Tuple literals must contain only valid literal values as items.\n\n NOTE: You can use this to load boxed (Python) int objects. Use\n Integer to load unboxed, tagged integers or fixed-width,\n low-level integers.\n\n For int literals, both int_rprimitive (CPyTagged) and\n object_primitive (PyObject *) are supported as rtype. However,\n when using int_rprimitive, the value must *not* be small enough\n to fit in an unboxed integer.\n \"\"\"\n\n error_kind = ERR_NEVER\n is_borrowed = True\n\n def __init__(self,\n value: Union[None, str, bytes, bool, int, float, complex, Tuple[object, ...]],\n rtype: RType) -> None:\n self.value = value\n self.type = rtype\n\n def sources(self) -> List[Value]:\n return []\n\n def accept(self, visitor: 'OpVisitor[T]') -> T:\n return visitor.visit_load_literal(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/pprint.py_IRPrettyPrintVisitor.visit_raise_standard_error_IRPrettyPrintVisitor.visit_raise_standard_error.if_op_value_is_not_None_.else_.return.self_format_r_raise_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/pprint.py_IRPrettyPrintVisitor.visit_raise_standard_error_IRPrettyPrintVisitor.visit_raise_standard_error.if_op_value_is_not_None_.else_.return.self_format_r_raise_", "embedding": null, "metadata": {"file_path": "mypyc/ir/pprint.py", "file_name": "pprint.py", "file_type": "text/x-python", "category": "implementation", "start_line": 135, "end_line": 144, "span_ids": ["IRPrettyPrintVisitor.visit_raise_standard_error"], "tokens": 133}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRPrettyPrintVisitor(OpVisitor[str]):\n\n def visit_raise_standard_error(self, op: RaiseStandardError) -> str:\n if op.value is not None:\n if isinstance(op.value, str):\n return self.format('%r = raise %s(%s)', op, op.class_name, repr(op.value))\n elif isinstance(op.value, Value):\n return self.format('%r = raise %s(%r)', op, op.class_name, op.value)\n else:\n assert False, 'value type must be either str or Value'\n else:\n return self.format('%r = raise %s', op, op.class_name)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder._Loading_various_values_LowLevelIRBuilder.load_complex.return.self_add_LoadLiteral_valu": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder._Loading_various_values_LowLevelIRBuilder.load_complex.return.self_add_LoadLiteral_valu", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/ll_builder.py", "file_name": "ll_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 432, "end_line": 475, "span_ids": ["LowLevelIRBuilder.load_float", "LowLevelIRBuilder.load_str", "LowLevelIRBuilder.union_method_call", "LowLevelIRBuilder.none", "LowLevelIRBuilder.load_int", "LowLevelIRBuilder.load_bytes", "LowLevelIRBuilder.true", "LowLevelIRBuilder.load_complex", "LowLevelIRBuilder.none_object", "LowLevelIRBuilder.false"], "tokens": 383}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LowLevelIRBuilder:\n\n # Loading various values\n\n def none(self) -> Value:\n \"\"\"Load unboxed None value (type: none_rprimitive).\"\"\"\n return Integer(1, none_rprimitive)\n\n def true(self) -> Value:\n \"\"\"Load unboxed True value (type: bool_rprimitive).\"\"\"\n return Integer(1, bool_rprimitive)\n\n def false(self) -> Value:\n \"\"\"Load unboxed False value (type: bool_rprimitive).\"\"\"\n return Integer(0, bool_rprimitive)\n\n def none_object(self) -> Value:\n \"\"\"Load Python None value (type: object_rprimitive).\"\"\"\n return self.add(LoadAddress(none_object_op.type, none_object_op.src, line=-1))\n\n def load_int(self, value: int) -> Value:\n \"\"\"Load a tagged (Python) integer literal value.\"\"\"\n if abs(value) > MAX_LITERAL_SHORT_INT:\n return self.add(LoadLiteral(value, int_rprimitive))\n else:\n return Integer(value)\n\n def load_float(self, value: float) -> Value:\n \"\"\"Load a float literal value.\"\"\"\n return self.add(LoadLiteral(value, float_rprimitive))\n\n def load_str(self, value: str) -> Value:\n \"\"\"Load a str literal value.\n\n This is useful for more than just str literals; for example, method calls\n also require a PyObject * form for the name of the method.\n \"\"\"\n return self.add(LoadLiteral(value, str_rprimitive))\n\n def load_bytes(self, value: bytes) -> Value:\n \"\"\"Load a bytes literal value.\"\"\"\n return self.add(LoadLiteral(value, object_rprimitive))\n\n def load_complex(self, value: complex) -> Value:\n \"\"\"Load a complex literal value.\"\"\"\n return self.add(LoadLiteral(value, object_rprimitive))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/mapper.py_Mapper_Mapper.__init__._type_Dict_SymbolNode_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/mapper.py_Mapper_Mapper.__init__._type_Dict_SymbolNode_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/mapper.py", "file_name": "mapper.py", "file_type": "text/x-python", "category": "implementation", "start_line": 21, "end_line": 34, "span_ids": ["Mapper", "Mapper.__init__"], "tokens": 125}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Mapper:\n \"\"\"Keep track of mappings from mypy concepts to IR concepts.\n\n For example, we keep track of how the mypy TypeInfos of compiled\n classes map to class IR objects.\n\n This state is shared across all modules being compiled in all\n compilation groups.\n \"\"\"\n\n def __init__(self, group_map: Dict[str, Optional[str]]) -> None:\n self.group_map = group_map\n self.type_to_ir = {} # type: Dict[TypeInfo, ClassIR]\n self.func_to_decl = {} # type: Dict[SymbolNode, FuncDecl]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/mapper.py_Mapper.get_arg_rtype_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/mapper.py_Mapper.get_arg_rtype_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/mapper.py", "file_name": "mapper.py", "file_type": "text/x-python", "category": "implementation", "start_line": 111, "end_line": 143, "span_ids": ["Mapper.fdef_to_sig", "Mapper.get_arg_rtype"], "tokens": 349}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Mapper:\n\n def get_arg_rtype(self, typ: Type, kind: int) -> RType:\n if kind == ARG_STAR:\n return tuple_rprimitive\n elif kind == ARG_STAR2:\n return dict_rprimitive\n else:\n return self.type_to_rtype(typ)\n\n def fdef_to_sig(self, fdef: FuncDef) -> FuncSignature:\n if isinstance(fdef.type, CallableType):\n arg_types = [self.get_arg_rtype(typ, kind)\n for typ, kind in zip(fdef.type.arg_types, fdef.type.arg_kinds)]\n ret = self.type_to_rtype(fdef.type.ret_type)\n else:\n # Handle unannotated functions\n arg_types = [object_rprimitive for arg in fdef.arguments]\n # We at least know the return type for __init__ methods will be None.\n is_init_method = fdef.name == '__init__' and bool(fdef.info)\n if is_init_method:\n ret = none_rprimitive\n else:\n ret = object_rprimitive\n\n args = [RuntimeArg(arg_name, arg_type, arg_kind)\n for arg_name, arg_kind, arg_type in zip(fdef.arg_names, fdef.arg_kinds, arg_types)]\n\n # We force certain dunder methods to return objects to support letting them\n # return NotImplemented. It also avoids some pointless boxing and unboxing,\n # since tp_richcompare needs an object anyways.\n if fdef.name in ('__eq__', '__ne__', '__lt__', '__gt__', '__le__', '__ge__'):\n ret = object_rprimitive\n return FuncSignature(args, ret)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/str_ops.py__Primitive_str_ops___str_begin_end_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/str_ops.py__Primitive_str_ops___str_begin_end_", "embedding": null, "metadata": {"file_path": "mypyc/primitives/str_ops.py", "file_name": "str_ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 106, "span_ids": ["impl:14", "docstring"], "tokens": 747}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Primitive str ops.\"\"\"\n\nfrom typing import List, Tuple\n\nfrom mypyc.ir.ops import ERR_MAGIC, ERR_NEVER\nfrom mypyc.ir.rtypes import (\n RType, object_rprimitive, str_rprimitive, int_rprimitive, list_rprimitive,\n c_int_rprimitive, pointer_rprimitive, bool_rprimitive, bit_rprimitive\n)\nfrom mypyc.primitives.registry import (\n method_op, binary_op, function_op,\n load_address_op, custom_op\n)\n\n\n# Get the 'str' type object.\nload_address_op(\n name='builtins.str',\n type=object_rprimitive,\n src='PyUnicode_Type')\n\n# str(obj)\nfunction_op(\n name='builtins.str',\n arg_types=[object_rprimitive],\n return_type=str_rprimitive,\n c_function_name='PyObject_Str',\n error_kind=ERR_MAGIC)\n\n# str1 + str2\nbinary_op(name='+',\n arg_types=[str_rprimitive, str_rprimitive],\n return_type=str_rprimitive,\n c_function_name='PyUnicode_Concat',\n error_kind=ERR_MAGIC)\n\n# str.join(obj)\nmethod_op(\n name='join',\n arg_types=[str_rprimitive, object_rprimitive],\n return_type=str_rprimitive,\n c_function_name='PyUnicode_Join',\n error_kind=ERR_MAGIC\n)\n\n# str.startswith(str)\nmethod_op(\n name='startswith',\n arg_types=[str_rprimitive, str_rprimitive],\n return_type=bool_rprimitive,\n c_function_name='CPyStr_Startswith',\n error_kind=ERR_NEVER\n)\n\n# str.endswith(str)\nmethod_op(\n name='endswith',\n arg_types=[str_rprimitive, str_rprimitive],\n return_type=bool_rprimitive,\n c_function_name='CPyStr_Endswith',\n error_kind=ERR_NEVER\n)\n\n# str[index] (for an int index)\nmethod_op(\n name='__getitem__',\n arg_types=[str_rprimitive, int_rprimitive],\n return_type=str_rprimitive,\n c_function_name='CPyStr_GetItem',\n error_kind=ERR_MAGIC\n)\n\n# str.split(...)\nstr_split_types = [str_rprimitive, str_rprimitive, int_rprimitive] # type: List[RType]\nstr_split_functions = ['PyUnicode_Split', 'PyUnicode_Split', 'CPyStr_Split']\nstr_split_constants = [[(0, pointer_rprimitive), (-1, c_int_rprimitive)],\n [(-1, c_int_rprimitive)],\n []] \\\n # type: List[List[Tuple[int, RType]]]\nfor i in range(len(str_split_types)):\n method_op(\n name='split',\n arg_types=str_split_types[0:i+1],\n return_type=list_rprimitive,\n c_function_name=str_split_functions[i],\n extra_int_constants=str_split_constants[i],\n error_kind=ERR_MAGIC)\n\n# str1 += str2\n#\n# PyUnicodeAppend makes an effort to reuse the LHS when the refcount\n# is 1. This is super dodgy but oh well, the interpreter does it.\nbinary_op(name='+=',\n arg_types=[str_rprimitive, str_rprimitive],\n return_type=str_rprimitive,\n c_function_name='CPyStr_Append',\n error_kind=ERR_MAGIC,\n steals=[True, False])\n\nunicode_compare = custom_op(\n arg_types=[str_rprimitive, str_rprimitive],\n return_type=c_int_rprimitive,\n c_function_name='PyUnicode_Compare',\n error_kind=ERR_NEVER)\n\n# str[begin:end]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/str_ops.py_str_slice_op_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/str_ops.py_str_slice_op_", "embedding": null, "metadata": {"file_path": "mypyc/primitives/str_ops.py", "file_name": "str_ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 107, "end_line": 137, "span_ids": ["impl:14"], "tokens": 238}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "str_slice_op = custom_op(\n arg_types=[str_rprimitive, int_rprimitive, int_rprimitive],\n return_type=object_rprimitive,\n c_function_name='CPyStr_GetSlice',\n error_kind=ERR_MAGIC)\n\n# str.replace(old, new)\nmethod_op(\n name='replace',\n arg_types=[str_rprimitive, str_rprimitive, str_rprimitive],\n return_type=str_rprimitive,\n c_function_name=\"PyUnicode_Replace\",\n error_kind=ERR_MAGIC,\n extra_int_constants=[(-1, c_int_rprimitive)])\n\n# str.replace(old, new, count)\nmethod_op(\n name='replace',\n arg_types=[str_rprimitive, str_rprimitive, str_rprimitive, int_rprimitive],\n return_type=str_rprimitive,\n c_function_name=\"CPyStr_Replace\",\n error_kind=ERR_MAGIC)\n\n# check if a string is true (isn't an empty string)\nstr_check_if_true = custom_op(\n arg_types=[str_rprimitive],\n return_type=bit_rprimitive,\n c_function_name=\"CPyStr_IsTrue\",\n error_kind=ERR_NEVER,\n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_literals.py__Test_code_geneneration_TestLiterals.test_format_str_literal.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_literals.py__Test_code_geneneration_TestLiterals.test_format_str_literal.None_4", "embedding": null, "metadata": {"file_path": "mypyc/test/test_literals.py", "file_name": "test_literals.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 16, "span_ids": ["TestLiterals", "TestLiterals.test_format_str_literal", "docstring"], "tokens": 176}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Test code geneneration for literals.\"\"\"\n\nimport unittest\n\nfrom mypyc.codegen.literals import (\n Literals, format_str_literal, _encode_str_values, _encode_bytes_values, _encode_int_values\n)\n\n\nclass TestLiterals(unittest.TestCase):\n def test_format_str_literal(self) -> None:\n assert format_str_literal('') == b'\\x00'\n assert format_str_literal('xyz') == b'\\x03xyz'\n assert format_str_literal('x' * 127) == b'\\x7f' + b'x' * 127\n assert format_str_literal('x' * 128) == b'\\x81\\x00' + b'x' * 128\n assert format_str_literal('x' * 131) == b'\\x81\\x03' + b'x' * 131", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_literals.py_TestLiterals.test_encode_str_values_TestLiterals.test_encode_str_values.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_literals.py_TestLiterals.test_encode_str_values_TestLiterals.test_encode_str_values.None_4", "embedding": null, "metadata": {"file_path": "mypyc/test/test_literals.py", "file_name": "test_literals.py", "file_type": "text/x-python", "category": "test", "start_line": 18, "end_line": 30, "span_ids": ["TestLiterals.test_encode_str_values"], "tokens": 184}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestLiterals(unittest.TestCase):\n\n def test_encode_str_values(self) -> None:\n assert _encode_str_values({}) == [b'']\n assert _encode_str_values({'foo': 0}) == [b'\\x01\\x03foo', b'']\n assert _encode_str_values({'foo': 0, 'b': 1}) == [b'\\x02\\x03foo\\x01b', b'']\n assert _encode_str_values({'foo': 0, 'x' * 70: 1}) == [\n b'\\x01\\x03foo',\n bytes([1, 70]) + b'x' * 70,\n b''\n ]\n assert _encode_str_values({'y' * 100: 0}) == [\n bytes([1, 100]) + b'y' * 100,\n b''\n ]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_literals.py_TestLiterals.test_encode_bytes_values_TestLiterals.test_encode_bytes_values.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_literals.py_TestLiterals.test_encode_bytes_values_TestLiterals.test_encode_bytes_values.None_4", "embedding": null, "metadata": {"file_path": "mypyc/test/test_literals.py", "file_name": "test_literals.py", "file_type": "text/x-python", "category": "test", "start_line": 32, "end_line": 44, "span_ids": ["TestLiterals.test_encode_bytes_values"], "tokens": 192}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestLiterals(unittest.TestCase):\n\n def test_encode_bytes_values(self) -> None:\n assert _encode_bytes_values({}) == [b'']\n assert _encode_bytes_values({b'foo': 0}) == [b'\\x01\\x03foo', b'']\n assert _encode_bytes_values({b'foo': 0, b'b': 1}) == [b'\\x02\\x03foo\\x01b', b'']\n assert _encode_bytes_values({b'foo': 0, b'x' * 70: 1}) == [\n b'\\x01\\x03foo',\n bytes([1, 70]) + b'x' * 70,\n b''\n ]\n assert _encode_bytes_values({b'y' * 100: 0}) == [\n bytes([1, 100]) + b'y' * 100,\n b''\n ]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_literals.py_TestLiterals.test_encode_int_values_TestLiterals.test_simple_literal_index.None_4": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_literals.py_TestLiterals.test_encode_int_values_TestLiterals.test_simple_literal_index.None_4", "embedding": null, "metadata": {"file_path": "mypyc/test/test_literals.py", "file_name": "test_literals.py", "file_type": "text/x-python", "category": "test", "start_line": 46, "end_line": 71, "span_ids": ["TestLiterals.test_encode_int_values", "TestLiterals.test_simple_literal_index"], "tokens": 290}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestLiterals(unittest.TestCase):\n\n def test_encode_int_values(self) -> None:\n assert _encode_int_values({}) == [b'']\n assert _encode_int_values({123: 0}) == [b'\\x01123', b'']\n assert _encode_int_values({123: 0, 9: 1}) == [b'\\x02123\\x009', b'']\n assert _encode_int_values({123: 0, 45: 1, 5 * 10**70: 2}) == [\n b'\\x02123\\x0045',\n b'\\x015' + b'0' * 70,\n b''\n ]\n assert _encode_int_values({6 * 10**100: 0}) == [\n b'\\x016' + b'0' * 100,\n b''\n ]\n\n def test_simple_literal_index(self) -> None:\n lit = Literals()\n lit.record_literal(1)\n lit.record_literal('y')\n lit.record_literal(True)\n lit.record_literal(None)\n lit.record_literal(False)\n assert lit.literal_index(None) == 0\n assert lit.literal_index(False) == 1\n assert lit.literal_index(True) == 2\n assert lit.literal_index('y') == 3\n assert lit.literal_index(1) == 4", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_literals.py_TestLiterals.test_tuple_literal_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_literals.py_TestLiterals.test_tuple_literal_", "embedding": null, "metadata": {"file_path": "mypyc/test/test_literals.py", "file_name": "test_literals.py", "file_type": "text/x-python", "category": "test", "start_line": 73, "end_line": 88, "span_ids": ["TestLiterals.test_tuple_literal"], "tokens": 197}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestLiterals(unittest.TestCase):\n\n def test_tuple_literal(self) -> None:\n lit = Literals()\n lit.record_literal((1, 'y', None, (b'a', 'b')))\n lit.record_literal((b'a', 'b'))\n lit.record_literal(())\n assert lit.literal_index((b'a', 'b')) == 7\n assert lit.literal_index((1, 'y', None, (b'a', 'b'))) == 8\n assert lit.literal_index(()) == 9\n print(lit.encoded_tuple_values())\n assert lit.encoded_tuple_values() == [\n '3', # Number of tuples\n '2', '5', '4', # First tuple (length=2)\n '4', '6', '3', '0', '7', # Second tuple (length=4)\n '0', # Third tuple (length=0)\n ]", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test-data/fixtures/ir.py_str_str.replace.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test-data/fixtures/ir.py_str_str.replace.pass", "embedding": null, "metadata": {"file_path": "mypyc/test-data/fixtures/ir.py", "file_name": "ir.py", "file_type": "text/x-python", "category": "implementation", "start_line": 53, "end_line": 78, "span_ids": ["str.upper", "str.strip", "str.__le__", "str.__add__", "str.__iter__", "str.__lt__", "str.__getitem__", "str.join", "str.replace", "str.__getitem___8", "str.__eq__", "str.format", "str.__init__", "str.__contains__", "str.startswith", "str", "str.__ge__", "str.endswith", "str.__gt__", "str.split", "str.__ne__", "str.__init___1"], "tokens": 381}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class str:\n @overload\n def __init__(self) -> None: pass\n @overload\n def __init__(self, x: object) -> None: pass\n def __add__(self, x: str) -> str: pass\n def __eq__(self, x: object) -> bool: pass\n def __ne__(self, x: object) -> bool: pass\n def __lt__(self, x: str) -> bool: ...\n def __le__(self, x: str) -> bool: ...\n def __gt__(self, x: str) -> bool: ...\n def __ge__(self, x: str) -> bool: ...\n @overload\n def __getitem__(self, i: int) -> str: pass\n @overload\n def __getitem__(self, i: slice) -> str: pass\n def __contains__(self, item: str) -> bool: pass\n def __iter__(self) -> Iterator[str]: ...\n def split(self, sep: Optional[str] = None, max: Optional[int] = None) -> List[str]: pass\n def strip (self, item: str) -> str: pass\n def join(self, x: Iterable[str]) -> str: pass\n def format(self, *args: Any, **kwargs: Any) -> str: ...\n def upper(self) -> str: pass\n def startswith(self, x: str, start: int=..., end: int=...) -> bool: pass\n def endswith(self, x: str, start: int=..., end: int=...) -> bool: pass\n def replace(self, old: str, new: str, maxcount: Optional[int] = None) -> str: pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test-data/fixtures/ir.py_list_list.index.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test-data/fixtures/ir.py_list_list.index.pass", "embedding": null, "metadata": {"file_path": "mypyc/test-data/fixtures/ir.py", "file_name": "ir.py", "file_type": "text/x-python", "category": "implementation", "start_line": 130, "end_line": 151, "span_ids": ["list.__iter__", "list.__getitem___1", "list", "list.append", "list.__contains__", "list.__delitem__", "list.reverse", "list.index", "list.__init__", "list.pop", "list.sort", "list.__rmul__", "list.count", "list.extend", "list.__getitem__", "list.remove", "list.__mul__", "list.__setitem__", "list.insert", "list.__len__"], "tokens": 311}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class list(Generic[T], Sequence[T], Iterable[T]):\n def __init__(self, i: Optional[Iterable[T]] = None) -> None: pass\n @overload\n def __getitem__(self, i: int) -> T: ...\n @overload\n def __getitem__(self, s: slice) -> List[T]: ...\n def __setitem__(self, i: int, o: T) -> None: pass\n def __delitem__(self, i: int) -> None: pass\n def __mul__(self, i: int) -> List[T]: pass\n def __rmul__(self, i: int) -> List[T]: pass\n def __iter__(self) -> Iterator[T]: pass\n def __len__(self) -> int: pass\n def __contains__(self, item: object) -> int: ...\n def append(self, x: T) -> None: pass\n def pop(self, i: int = -1) -> T: pass\n def count(self, T) -> int: pass\n def extend(self, l: Iterable[T]) -> None: pass\n def insert(self, i: int, x: T) -> None: pass\n def sort(self) -> None: pass\n def reverse(self) -> None: pass\n def remove(self, o: T) -> None: pass\n def index(self, o: T) -> int: pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py_BaseAnalysisVisitor_BaseAnalysisVisitor.visit_keep_alive.return.self_visit_register_op_op": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/analysis/dataflow.py_BaseAnalysisVisitor_BaseAnalysisVisitor.visit_keep_alive.return.self_visit_register_op_op", "embedding": null, "metadata": {"file_path": "mypyc/analysis/dataflow.py", "file_name": "dataflow.py", "file_type": "text/x-python", "category": "implementation", "start_line": 143, "end_line": 230, "span_ids": ["BaseAnalysisVisitor.visit_load_mem", "BaseAnalysisVisitor.visit_keep_alive", "BaseAnalysisVisitor.visit_box", "BaseAnalysisVisitor.visit_tuple_set", "BaseAnalysisVisitor.visit_get_element_ptr", "BaseAnalysisVisitor.visit_call_c", "BaseAnalysisVisitor.visit_set_mem", "BaseAnalysisVisitor.visit_tuple_get", "BaseAnalysisVisitor.visit_raise_standard_error", "BaseAnalysisVisitor.visit_unbox", "BaseAnalysisVisitor.visit_cast", "BaseAnalysisVisitor.visit_truncate", "BaseAnalysisVisitor.visit_comparison_op", "BaseAnalysisVisitor.visit_goto", "BaseAnalysisVisitor.visit_call", "BaseAnalysisVisitor.visit_assign_multi", "BaseAnalysisVisitor.visit_load_static", "BaseAnalysisVisitor.visit_int_op", "BaseAnalysisVisitor", "BaseAnalysisVisitor.visit_load_literal", "BaseAnalysisVisitor.visit_register_op", "BaseAnalysisVisitor.visit_load_global", "BaseAnalysisVisitor.visit_load_address", "BaseAnalysisVisitor.visit_get_attr", "BaseAnalysisVisitor.visit_assign", "BaseAnalysisVisitor.visit_init_static", "BaseAnalysisVisitor.visit_method_call", "BaseAnalysisVisitor.visit_load_error_value", "BaseAnalysisVisitor.visit_set_attr"], "tokens": 706}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class BaseAnalysisVisitor(OpVisitor[GenAndKill]):\n def visit_goto(self, op: Goto) -> GenAndKill:\n return set(), set()\n\n @abstractmethod\n def visit_register_op(self, op: RegisterOp) -> GenAndKill:\n raise NotImplementedError\n\n @abstractmethod\n def visit_assign(self, op: Assign) -> GenAndKill:\n raise NotImplementedError\n\n @abstractmethod\n def visit_assign_multi(self, op: AssignMulti) -> GenAndKill:\n raise NotImplementedError\n\n @abstractmethod\n def visit_set_mem(self, op: SetMem) -> GenAndKill:\n raise NotImplementedError\n\n def visit_call(self, op: Call) -> GenAndKill:\n return self.visit_register_op(op)\n\n def visit_method_call(self, op: MethodCall) -> GenAndKill:\n return self.visit_register_op(op)\n\n def visit_load_error_value(self, op: LoadErrorValue) -> GenAndKill:\n return self.visit_register_op(op)\n\n def visit_load_literal(self, op: LoadLiteral) -> GenAndKill:\n return self.visit_register_op(op)\n\n def visit_get_attr(self, op: GetAttr) -> GenAndKill:\n return self.visit_register_op(op)\n\n def visit_set_attr(self, op: SetAttr) -> GenAndKill:\n return self.visit_register_op(op)\n\n def visit_load_static(self, op: LoadStatic) -> GenAndKill:\n return self.visit_register_op(op)\n\n def visit_init_static(self, op: InitStatic) -> GenAndKill:\n return self.visit_register_op(op)\n\n def visit_tuple_get(self, op: TupleGet) -> GenAndKill:\n return self.visit_register_op(op)\n\n def visit_tuple_set(self, op: TupleSet) -> GenAndKill:\n return self.visit_register_op(op)\n\n def visit_box(self, op: Box) -> GenAndKill:\n return self.visit_register_op(op)\n\n def visit_unbox(self, op: Unbox) -> GenAndKill:\n return self.visit_register_op(op)\n\n def visit_cast(self, op: Cast) -> GenAndKill:\n return self.visit_register_op(op)\n\n def visit_raise_standard_error(self, op: RaiseStandardError) -> GenAndKill:\n return self.visit_register_op(op)\n\n def visit_call_c(self, op: CallC) -> GenAndKill:\n return self.visit_register_op(op)\n\n def visit_truncate(self, op: Truncate) -> GenAndKill:\n return self.visit_register_op(op)\n\n def visit_load_global(self, op: LoadGlobal) -> GenAndKill:\n return self.visit_register_op(op)\n\n def visit_int_op(self, op: IntOp) -> GenAndKill:\n return self.visit_register_op(op)\n\n def visit_comparison_op(self, op: ComparisonOp) -> GenAndKill:\n return self.visit_register_op(op)\n\n def visit_load_mem(self, op: LoadMem) -> GenAndKill:\n return self.visit_register_op(op)\n\n def visit_get_element_ptr(self, op: GetElementPtr) -> GenAndKill:\n return self.visit_register_op(op)\n\n def visit_load_address(self, op: LoadAddress) -> GenAndKill:\n return self.visit_register_op(op)\n\n def visit_keep_alive(self, op: KeepAlive) -> GenAndKill:\n return self.visit_register_op(op)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.use_vectorcall_Emitter.emit_undefined_attr_check.self_emit_line_if_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emit.py_Emitter.use_vectorcall_Emitter.emit_undefined_attr_check.self_emit_line_if_", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emit.py", "file_name": "emit.py", "file_type": "text/x-python", "category": "implementation", "start_line": 261, "end_line": 277, "span_ids": ["Emitter.use_vectorcall", "Emitter.emit_undefined_attr_check"], "tokens": 157}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Emitter:\n\n def use_vectorcall(self) -> bool:\n return use_vectorcall(self.capi_version)\n\n def emit_undefined_attr_check(self, rtype: RType, attr_expr: str,\n compare: str,\n unlikely: bool = False) -> None:\n if isinstance(rtype, RTuple):\n check = '({})'.format(self.tuple_undefined_check_cond(\n rtype, attr_expr, self.c_undefined_value, compare)\n )\n else:\n check = '({} {} {})'.format(\n attr_expr, compare, self.c_undefined_value(rtype)\n )\n if unlikely:\n check = '(unlikely{})'.format(check)\n self.emit_line('if {} {{'.format(check))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py__Code_generation_for_na_generate_call_wrapper.if_emitter_use_vectorcall.else_.return.wrapper_slot_cl_fn_emit": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitclass.py__Code_generation_for_na_generate_call_wrapper.if_emitter_use_vectorcall.else_.return.wrapper_slot_cl_fn_emit", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitclass.py", "file_name": "emitclass.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 80, "span_ids": ["wrapper_slot", "native_slot", "impl", "docstring", "generate_call_wrapper"], "tokens": 761}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Code generation for native classes and related wrappers.\"\"\"\n\nfrom typing import Optional, List, Tuple, Dict, Callable, Mapping, Set\n\nfrom mypy.ordered_dict import OrderedDict\n\nfrom mypyc.common import PREFIX, NATIVE_PREFIX, REG_PREFIX, use_fastcall\nfrom mypyc.codegen.emit import Emitter, HeaderDeclaration\nfrom mypyc.codegen.emitfunc import native_function_header\nfrom mypyc.codegen.emitwrapper import (\n generate_dunder_wrapper, generate_hash_wrapper, generate_richcompare_wrapper,\n generate_bool_wrapper, generate_get_wrapper,\n)\nfrom mypyc.ir.rtypes import RType, RTuple, object_rprimitive\nfrom mypyc.ir.func_ir import FuncIR, FuncDecl, FUNC_STATICMETHOD, FUNC_CLASSMETHOD\nfrom mypyc.ir.class_ir import ClassIR, VTableEntries\nfrom mypyc.sametype import is_same_type\nfrom mypyc.namegen import NameGenerator\n\n\ndef native_slot(cl: ClassIR, fn: FuncIR, emitter: Emitter) -> str:\n return '{}{}'.format(NATIVE_PREFIX, fn.cname(emitter.names))\n\n\ndef wrapper_slot(cl: ClassIR, fn: FuncIR, emitter: Emitter) -> str:\n return '{}{}'.format(PREFIX, fn.cname(emitter.names))\n\n\n# We maintain a table from dunder function names to struct slots they\n# correspond to and functions that generate a wrapper (if necessary)\n# and return the function name to stick in the slot.\n# TODO: Add remaining dunder methods\nSlotGenerator = Callable[[ClassIR, FuncIR, Emitter], str]\nSlotTable = Mapping[str, Tuple[str, SlotGenerator]]\n\nSLOT_DEFS = {\n '__init__': ('tp_init', lambda c, t, e: generate_init_for_class(c, t, e)),\n '__call__': ('tp_call', lambda c, t, e: generate_call_wrapper(c, t, e)),\n '__str__': ('tp_str', native_slot),\n '__repr__': ('tp_repr', native_slot),\n '__next__': ('tp_iternext', native_slot),\n '__iter__': ('tp_iter', native_slot),\n '__hash__': ('tp_hash', generate_hash_wrapper),\n '__get__': ('tp_descr_get', generate_get_wrapper),\n} # type: SlotTable\n\nAS_MAPPING_SLOT_DEFS = {\n '__getitem__': ('mp_subscript', generate_dunder_wrapper),\n} # type: SlotTable\n\nAS_NUMBER_SLOT_DEFS = {\n '__bool__': ('nb_bool', generate_bool_wrapper),\n} # type: SlotTable\n\nAS_ASYNC_SLOT_DEFS = {\n '__await__': ('am_await', native_slot),\n '__aiter__': ('am_aiter', native_slot),\n '__anext__': ('am_anext', native_slot),\n} # type: SlotTable\n\nSIDE_TABLES = [\n ('as_mapping', 'PyMappingMethods', AS_MAPPING_SLOT_DEFS),\n ('as_number', 'PyNumberMethods', AS_NUMBER_SLOT_DEFS),\n ('as_async', 'PyAsyncMethods', AS_ASYNC_SLOT_DEFS),\n]\n\n# Slots that need to always be filled in because they don't get\n# inherited right.\nALWAYS_FILL = {\n '__hash__',\n}\n\n\ndef generate_call_wrapper(cl: ClassIR, fn: FuncIR, emitter: Emitter) -> str:\n if emitter.use_vectorcall():\n # Use vectorcall wrapper if supported (PEP 590).\n return 'PyVectorcall_Call'\n else:\n # On older Pythons use the legacy wrapper.\n return wrapper_slot(cl, fn, emitter)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor_FunctionEmitterVisitor.visit_goto.if_op_label_is_not_self_n.self_emit_line_goto_s_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor_FunctionEmitterVisitor.visit_goto.if_op_label_is_not_self_n.self_emit_line_goto_s_", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitfunc.py", "file_name": "emitfunc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 96, "end_line": 115, "span_ids": ["FunctionEmitterVisitor", "FunctionEmitterVisitor.__init__", "FunctionEmitterVisitor.visit_goto", "FunctionEmitterVisitor.temp_name"], "tokens": 161}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FunctionEmitterVisitor(OpVisitor[None]):\n def __init__(self,\n emitter: Emitter,\n declarations: Emitter,\n source_path: str,\n module_name: str) -> None:\n self.emitter = emitter\n self.names = emitter.names\n self.declarations = declarations\n self.source_path = source_path\n self.module_name = module_name\n self.literals = emitter.context.literals\n self.next_block = None # type: Optional[BasicBlock]\n\n def temp_name(self) -> str:\n return self.emitter.temp_name()\n\n def visit_goto(self, op: Goto) -> None:\n if op.label is not self.next_block:\n self.emit_line('goto %s;' % self.label(op.label))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.visit_branch_FunctionEmitterVisitor.visit_branch.if_false_is_self_next_blo.else_.self_emit_lines_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.visit_branch_FunctionEmitterVisitor.visit_branch.if_false_is_self_next_blo.else_.self_emit_lines_", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitfunc.py", "file_name": "emitfunc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 117, "end_line": 167, "span_ids": ["FunctionEmitterVisitor.visit_branch"], "tokens": 415}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FunctionEmitterVisitor(OpVisitor[None]):\n\n def visit_branch(self, op: Branch) -> None:\n true, false = op.true, op.false\n negated = op.negated\n if true is self.next_block and op.traceback_entry is None:\n # Switch true/false since it avoids an else block.\n true, false = false, true\n negated = not negated\n\n neg = '!' if negated else ''\n cond = ''\n if op.op == Branch.BOOL:\n expr_result = self.reg(op.value)\n cond = '{}{}'.format(neg, expr_result)\n elif op.op == Branch.IS_ERROR:\n typ = op.value.type\n compare = '!=' if negated else '=='\n if isinstance(typ, RTuple):\n # TODO: What about empty tuple?\n cond = self.emitter.tuple_undefined_check_cond(typ,\n self.reg(op.value),\n self.c_error_value,\n compare)\n else:\n cond = '{} {} {}'.format(self.reg(op.value),\n compare,\n self.c_error_value(typ))\n else:\n assert False, \"Invalid branch\"\n\n # For error checks, tell the compiler the branch is unlikely\n if op.traceback_entry is not None or op.rare:\n cond = 'unlikely({})'.format(cond)\n\n if false is self.next_block:\n if op.traceback_entry is None:\n self.emit_line('if ({}) goto {};'.format(cond, self.label(true)))\n else:\n self.emit_line('if ({}) {{'.format(cond))\n self.emit_traceback(op)\n self.emit_lines(\n 'goto %s;' % self.label(true),\n '}'\n )\n else:\n self.emit_line('if ({}) {{'.format(cond))\n self.emit_traceback(op)\n self.emit_lines(\n 'goto %s;' % self.label(true),\n '} else',\n ' goto %s;' % self.label(false)\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.visit_assign_FunctionEmitterVisitor.visit_assign_multi.self_emit_line_s_s_d_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.visit_assign_FunctionEmitterVisitor.visit_assign_multi.self_emit_line_s_s_d_", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitfunc.py", "file_name": "emitfunc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 184, "end_line": 202, "span_ids": ["FunctionEmitterVisitor.visit_assign", "FunctionEmitterVisitor.visit_assign_multi"], "tokens": 200}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FunctionEmitterVisitor(OpVisitor[None]):\n\n def visit_assign(self, op: Assign) -> None:\n dest = self.reg(op.dest)\n src = self.reg(op.src)\n # clang whines about self assignment (which we might generate\n # for some casts), so don't emit it.\n if dest != src:\n self.emit_line('%s = %s;' % (dest, src))\n\n def visit_assign_multi(self, op: AssignMulti) -> None:\n typ = op.dest.type\n assert isinstance(typ, RArray)\n dest = self.reg(op.dest)\n # RArray values can only be assigned to once, so we can always\n # declare them on initialization.\n self.emit_line('%s%s[%d] = {%s};' % (\n self.emitter.ctype_spaced(typ.item_type),\n dest,\n len(op.src),\n ', '.join(self.reg(s) for s in op.src)))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.visit_load_error_value_FunctionEmitterVisitor.visit_load_error_value.if_isinstance_op_type_RT.else_.self_emit_line_s_s_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitfunc.py_FunctionEmitterVisitor.visit_load_error_value_FunctionEmitterVisitor.visit_load_error_value.if_isinstance_op_type_RT.else_.self_emit_line_s_s_", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitfunc.py", "file_name": "emitfunc.py", "file_type": "text/x-python", "category": "implementation", "start_line": 204, "end_line": 212, "span_ids": ["FunctionEmitterVisitor.visit_load_error_value"], "tokens": 135}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FunctionEmitterVisitor(OpVisitor[None]):\n\n def visit_load_error_value(self, op: LoadErrorValue) -> None:\n if isinstance(op.type, RTuple):\n values = [self.c_undefined_value(item) for item in op.type.types]\n tmp = self.temp_name()\n self.emit_line('%s %s = { %s };' % (self.ctype(op.type), tmp, ', '.join(values)))\n self.emit_line('%s = %s;' % (self.reg(op), tmp))\n else:\n self.emit_line('%s = %s;' % (self.reg(op),\n self.c_error_value(op.type)))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitwrapper.py_make_format_string_make_format_string.return.format": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/codegen/emitwrapper.py_make_format_string_make_format_string.return.format", "embedding": null, "metadata": {"file_path": "mypyc/codegen/emitwrapper.py", "file_name": "emitwrapper.py", "file_type": "text/x-python", "category": "implementation", "start_line": 91, "end_line": 118, "span_ids": ["make_format_string"], "tokens": 286}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def make_format_string(func_name: Optional[str], groups: List[List[RuntimeArg]]) -> str:\n \"\"\"Return a format string that specifies the accepted arguments.\n\n The format string is an extended subset of what is supported by\n PyArg_ParseTupleAndKeywords(). Only the type 'O' is used, and we\n also support some extensions:\n\n - Required keyword-only arguments are introduced after '@'\n - If the function receives *args or **kwargs, we add a '%' prefix\n\n Each group requires the previous groups' delimiters to be present\n first.\n\n These are used by both vectorcall and legacy wrapper functions.\n \"\"\"\n format = ''\n if groups[ARG_STAR] or groups[ARG_STAR2]:\n format += '%'\n format += 'O' * len(groups[ARG_POS])\n if groups[ARG_OPT] or groups[ARG_NAMED_OPT] or groups[ARG_NAMED]:\n format += '|' + 'O' * len(groups[ARG_OPT])\n if groups[ARG_NAMED_OPT] or groups[ARG_NAMED]:\n format += '$' + 'O' * len(groups[ARG_NAMED_OPT])\n if groups[ARG_NAMED]:\n format += '@' + 'O' * len(groups[ARG_NAMED])\n if func_name is not None:\n format += ':{}'.format(func_name)\n return format", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/common.py_sys_decorator_helper_name.return.___mypyc___decorator_hel": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/common.py_sys_decorator_helper_name.return.___mypyc___decorator_hel", "embedding": null, "metadata": {"file_path": "mypyc/common.py", "file_name": "common.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 73, "span_ids": ["imports", "impl:41", "decorator_helper_name"], "tokens": 741}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "import sys\nfrom typing import Dict, Any, Tuple\nimport sys\n\nfrom typing_extensions import Final\n\nPREFIX = 'CPyPy_' # type: Final # Python wrappers\nNATIVE_PREFIX = 'CPyDef_' # type: Final # Native functions etc.\nDUNDER_PREFIX = 'CPyDunder_' # type: Final # Wrappers for exposing dunder methods to the API\nREG_PREFIX = 'cpy_r_' # type: Final # Registers\nSTATIC_PREFIX = 'CPyStatic_' # type: Final # Static variables (for literals etc.)\nTYPE_PREFIX = 'CPyType_' # type: Final # Type object struct\nMODULE_PREFIX = 'CPyModule_' # type: Final # Cached modules\nATTR_PREFIX = '_' # type: Final # Attributes\n\nENV_ATTR_NAME = '__mypyc_env__' # type: Final\nNEXT_LABEL_ATTR_NAME = '__mypyc_next_label__' # type: Final\nTEMP_ATTR_NAME = '__mypyc_temp__' # type: Final\nLAMBDA_NAME = '__mypyc_lambda__' # type: Final\nPROPSET_PREFIX = '__mypyc_setter__' # type: Final\nSELF_NAME = '__mypyc_self__' # type: Final\n\n# Max short int we accept as a literal is based on 32-bit platforms,\n# so that we can just always emit the same code.\n\nTOP_LEVEL_NAME = '__top_level__' # type: Final # Special function representing module top level\n\n# Maximal number of subclasses for a class to trigger fast path in isinstance() checks.\nFAST_ISINSTANCE_MAX_SUBCLASSES = 2 # type: Final\n\nIS_32_BIT_PLATFORM = sys.maxsize < (1 << 31) # type: Final\n\nPLATFORM_SIZE = 4 if IS_32_BIT_PLATFORM else 8\n\n# Python 3.5 on macOS uses a hybrid 32/64-bit build that requires some workarounds.\n# The same generated C will be compiled in both 32 and 64 bit modes when building mypy\n# wheels (for an unknown reason).\n#\n# Note that we use \"in ['darwin']\" because of https://github.com/mypyc/mypyc/issues/761.\nIS_MIXED_32_64_BIT_BUILD = sys.platform in ['darwin'] and sys.version_info < (3, 6) # type: Final\n\n# Maximum value for a short tagged integer.\nMAX_SHORT_INT = sys.maxsize >> 1 # type: Final\n\n# Maximum value for a short tagged integer represented as a C integer literal.\n#\n# Note: Assume that the compiled code uses the same bit width as mypyc, except for\n# Python 3.5 on macOS.\nMAX_LITERAL_SHORT_INT = (sys.maxsize >> 1 if not IS_MIXED_32_64_BIT_BUILD\n else 2**30 - 1) # type: Final\n\n# Runtime C library files\nRUNTIME_C_FILES = [\n 'init.c',\n 'getargs.c',\n 'getargsfast.c',\n 'int_ops.c',\n 'list_ops.c',\n 'dict_ops.c',\n 'str_ops.c',\n 'set_ops.c',\n 'tuple_ops.c',\n 'exc_ops.c',\n 'misc_ops.c',\n 'generic_ops.c',\n] # type: Final\n\n\nJsonDict = Dict[str, Any]\n\n\ndef decorator_helper_name(func_name: str) -> str:\n return '__mypyc_{}_decorator_helper__'.format(func_name)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/common.py_shared_lib_name_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/common.py_shared_lib_name_", "embedding": null, "metadata": {"file_path": "mypyc/common.py", "file_name": "common.py", "file_type": "text/x-python", "category": "implementation", "start_line": 76, "end_line": 103, "span_ids": ["use_fastcall", "use_vectorcall", "short_name", "shared_lib_name", "use_method_vectorcall"], "tokens": 231}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def shared_lib_name(group_name: str) -> str:\n \"\"\"Given a group name, return the actual name of its extension module.\n\n (This just adds a suffix to the final component.)\n \"\"\"\n return '{}__mypyc'.format(group_name)\n\n\ndef short_name(name: str) -> str:\n if name.startswith('builtins.'):\n return name[9:]\n return name\n\n\ndef use_fastcall(capi_version: Tuple[int, int]) -> bool:\n # We can use METH_FASTCALL for faster wrapper functions on Python 3.7+.\n return capi_version >= (3, 7)\n\n\ndef use_vectorcall(capi_version: Tuple[int, int]) -> bool:\n # We can use vectorcalls to make calls on Python 3.8+ (PEP 590).\n return capi_version >= (3, 8)\n\n\ndef use_method_vectorcall(capi_version: Tuple[int, int]) -> bool:\n # We can use a dedicated vectorcall API to call methods on Python 3.9+.\n return capi_version >= (3, 9)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/func_ir.py__Intermediate_represent_from_mypyc_namegen_import": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/func_ir.py__Intermediate_represent_from_mypyc_namegen_import", "embedding": null, "metadata": {"file_path": "mypyc/ir/func_ir.py", "file_name": "func_ir.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 13, "span_ids": ["docstring"], "tokens": 106}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Intermediate representation of functions.\"\"\"\n\nfrom typing import List, Optional, Sequence\nfrom typing_extensions import Final\n\nfrom mypy.nodes import FuncDef, Block, ARG_POS, ARG_OPT, ARG_NAMED_OPT\n\nfrom mypyc.common import JsonDict\nfrom mypyc.ir.ops import (\n DeserMaps, BasicBlock, Value, Register, Assign, AssignMulti, ControlOp, LoadAddress\n)\nfrom mypyc.ir.rtypes import RType, deserialize_type\nfrom mypyc.namegen import NameGenerator", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/func_ir.py_RuntimeArg_RuntimeArg.deserialize.return.RuntimeArg_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/func_ir.py_RuntimeArg_RuntimeArg.deserialize.return.RuntimeArg_", "embedding": null, "metadata": {"file_path": "mypyc/ir/func_ir.py", "file_name": "func_ir.py", "file_type": "text/x-python", "category": "implementation", "start_line": 16, "end_line": 43, "span_ids": ["RuntimeArg.serialize", "RuntimeArg.__repr__", "RuntimeArg.optional", "RuntimeArg.__init__", "RuntimeArg", "RuntimeArg.deserialize"], "tokens": 222}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class RuntimeArg:\n \"\"\"Description of a function argument in IR.\n\n Argument kind is one of ARG_* constants defined in mypy.nodes.\n \"\"\"\n\n def __init__(self, name: str, typ: RType, kind: int = ARG_POS) -> None:\n self.name = name\n self.type = typ\n self.kind = kind\n\n @property\n def optional(self) -> bool:\n return self.kind == ARG_OPT or self.kind == ARG_NAMED_OPT\n\n def __repr__(self) -> str:\n return 'RuntimeArg(name=%s, type=%s, optional=%r)' % (self.name, self.type, self.optional)\n\n def serialize(self) -> JsonDict:\n return {'name': self.name, 'type': self.type.serialize(), 'kind': self.kind}\n\n @classmethod\n def deserialize(cls, data: JsonDict, ctx: DeserMaps) -> 'RuntimeArg':\n return RuntimeArg(\n data['name'],\n deserialize_type(data['type'], ctx),\n data['kind'],\n )", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_AssignMulti_AssignMulti.accept.return.visitor_visit_assign_mult": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_AssignMulti_AssignMulti.accept.return.visitor_visit_assign_mult", "embedding": null, "metadata": {"file_path": "mypyc/ir/ops.py", "file_name": "ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 231, "end_line": 259, "span_ids": ["AssignMulti.sources", "AssignMulti.stolen", "AssignMulti.__init__", "AssignMulti.accept", "AssignMulti"], "tokens": 212}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class AssignMulti(Op):\n \"\"\"Assign multiple values to a Register (dest = src1, src2, ...).\n\n This is used to initialize RArray values. It's provided to avoid\n very verbose IR for common vectorcall operations.\n\n Note that this interacts atypically with reference counting. We\n assume that each RArray register is initialized exactly once\n with this op.\n \"\"\"\n\n error_kind = ERR_NEVER\n\n def __init__(self, dest: Register, src: List[Value], line: int = -1) -> None:\n super().__init__(line)\n assert src\n assert isinstance(dest.type, RArray)\n assert dest.type.length == len(src)\n self.src = src\n self.dest = dest\n\n def sources(self) -> List[Value]:\n return self.src[:]\n\n def stolen(self) -> List[Value]:\n return []\n\n def accept(self, visitor: 'OpVisitor[T]') -> T:\n return visitor.visit_assign_multi(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_KeepAlive_KeepAlive.accept.return.visitor_visit_keep_alive_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_KeepAlive_KeepAlive.accept.return.visitor_visit_keep_alive_", "embedding": null, "metadata": {"file_path": "mypyc/ir/ops.py", "file_name": "ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1156, "end_line": 1184, "span_ids": ["KeepAlive.__init__", "KeepAlive.accept", "KeepAlive.sources", "KeepAlive"], "tokens": 208}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class KeepAlive(RegisterOp):\n \"\"\"A no-op operation that ensures source values aren't freed.\n\n This is sometimes useful to avoid decref when a reference is still\n being held but not seen by the compiler.\n\n A typical use case is like this (C-like pseudocode):\n\n ptr = &x.item\n r = *ptr\n keep_alive x # x must not be freed here\n # x may be freed here\n\n If we didn't have \"keep_alive x\", x could be freed immediately\n after taking the address of 'item', resulting in a read after free\n on the second line.\n \"\"\"\n\n error_kind = ERR_NEVER\n\n def __init__(self, src: List[Value]) -> None:\n assert src\n self.src = src\n\n def sources(self) -> List[Value]:\n return self.src[:]\n\n def accept(self, visitor: 'OpVisitor[T]') -> T:\n return visitor.visit_keep_alive(self)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_OpVisitor_OpVisitor.visit_keep_alive.raise_NotImplementedError": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/ops.py_OpVisitor_OpVisitor.visit_keep_alive.raise_NotImplementedError", "embedding": null, "metadata": {"file_path": "mypyc/ir/ops.py", "file_name": "ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1187, "end_line": 1315, "span_ids": ["OpVisitor.visit_inc_ref", "OpVisitor.visit_box", "OpVisitor.visit_comparison_op", "OpVisitor.visit_keep_alive", "OpVisitor.visit_load_literal", "OpVisitor.visit_set_attr", "OpVisitor.visit_method_call", "OpVisitor.visit_load_mem", "OpVisitor.visit_set_mem", "OpVisitor.visit_branch", "OpVisitor.visit_get_attr", "OpVisitor.visit_return", "OpVisitor.visit_raise_standard_error", "OpVisitor.visit_init_static", "OpVisitor.visit_assign", "OpVisitor", "OpVisitor.visit_load_address", "OpVisitor.visit_goto", "OpVisitor.visit_assign_multi", "OpVisitor.visit_truncate", "OpVisitor.visit_unreachable", "OpVisitor.visit_load_static", "OpVisitor.visit_call", "OpVisitor.visit_tuple_set", "OpVisitor.visit_unbox", "OpVisitor.visit_tuple_get", "OpVisitor.visit_load_error_value", "OpVisitor.visit_cast", "OpVisitor.visit_get_element_ptr", "OpVisitor.visit_int_op", "OpVisitor.visit_dec_ref", "OpVisitor.visit_load_global", "OpVisitor.visit_call_c"], "tokens": 744}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@trait\nclass OpVisitor(Generic[T]):\n \"\"\"Generic visitor over ops (uses the visitor design pattern).\"\"\"\n\n @abstractmethod\n def visit_goto(self, op: Goto) -> T:\n raise NotImplementedError\n\n @abstractmethod\n def visit_branch(self, op: Branch) -> T:\n raise NotImplementedError\n\n @abstractmethod\n def visit_return(self, op: Return) -> T:\n raise NotImplementedError\n\n @abstractmethod\n def visit_unreachable(self, op: Unreachable) -> T:\n raise NotImplementedError\n\n @abstractmethod\n def visit_assign(self, op: Assign) -> T:\n raise NotImplementedError\n\n @abstractmethod\n def visit_assign_multi(self, op: AssignMulti) -> T:\n raise NotImplementedError\n\n @abstractmethod\n def visit_load_error_value(self, op: LoadErrorValue) -> T:\n raise NotImplementedError\n\n @abstractmethod\n def visit_load_literal(self, op: LoadLiteral) -> T:\n raise NotImplementedError\n\n @abstractmethod\n def visit_get_attr(self, op: GetAttr) -> T:\n raise NotImplementedError\n\n @abstractmethod\n def visit_set_attr(self, op: SetAttr) -> T:\n raise NotImplementedError\n\n @abstractmethod\n def visit_load_static(self, op: LoadStatic) -> T:\n raise NotImplementedError\n\n @abstractmethod\n def visit_init_static(self, op: InitStatic) -> T:\n raise NotImplementedError\n\n @abstractmethod\n def visit_tuple_get(self, op: TupleGet) -> T:\n raise NotImplementedError\n\n @abstractmethod\n def visit_tuple_set(self, op: TupleSet) -> T:\n raise NotImplementedError\n\n def visit_inc_ref(self, op: IncRef) -> T:\n raise NotImplementedError\n\n def visit_dec_ref(self, op: DecRef) -> T:\n raise NotImplementedError\n\n @abstractmethod\n def visit_call(self, op: Call) -> T:\n raise NotImplementedError\n\n @abstractmethod\n def visit_method_call(self, op: MethodCall) -> T:\n raise NotImplementedError\n\n @abstractmethod\n def visit_cast(self, op: Cast) -> T:\n raise NotImplementedError\n\n @abstractmethod\n def visit_box(self, op: Box) -> T:\n raise NotImplementedError\n\n @abstractmethod\n def visit_unbox(self, op: Unbox) -> T:\n raise NotImplementedError\n\n @abstractmethod\n def visit_raise_standard_error(self, op: RaiseStandardError) -> T:\n raise NotImplementedError\n\n @abstractmethod\n def visit_call_c(self, op: CallC) -> T:\n raise NotImplementedError\n\n @abstractmethod\n def visit_truncate(self, op: Truncate) -> T:\n raise NotImplementedError\n\n @abstractmethod\n def visit_load_global(self, op: LoadGlobal) -> T:\n raise NotImplementedError\n\n @abstractmethod\n def visit_int_op(self, op: IntOp) -> T:\n raise NotImplementedError\n\n @abstractmethod\n def visit_comparison_op(self, op: ComparisonOp) -> T:\n raise NotImplementedError\n\n @abstractmethod\n def visit_load_mem(self, op: LoadMem) -> T:\n raise NotImplementedError\n\n @abstractmethod\n def visit_set_mem(self, op: SetMem) -> T:\n raise NotImplementedError\n\n @abstractmethod\n def visit_get_element_ptr(self, op: GetElementPtr) -> T:\n raise NotImplementedError\n\n @abstractmethod\n def visit_load_address(self, op: LoadAddress) -> T:\n raise NotImplementedError\n\n @abstractmethod\n def visit_keep_alive(self, op: KeepAlive) -> T:\n raise NotImplementedError", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/pprint.py_IRPrettyPrintVisitor.visit_return_IRPrettyPrintVisitor.visit_dec_ref.return.s": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/pprint.py_IRPrettyPrintVisitor.visit_return_IRPrettyPrintVisitor.visit_dec_ref.return.s", "embedding": null, "metadata": {"file_path": "mypyc/ir/pprint.py", "file_name": "pprint.py", "file_type": "text/x-python", "category": "implementation", "start_line": 51, "end_line": 114, "span_ids": ["IRPrettyPrintVisitor.visit_assign_multi", "IRPrettyPrintVisitor.visit_load_literal", "IRPrettyPrintVisitor.visit_unreachable", "IRPrettyPrintVisitor.visit_init_static", "IRPrettyPrintVisitor.visit_tuple_get", "IRPrettyPrintVisitor.visit_assign", "IRPrettyPrintVisitor.visit_inc_ref", "IRPrettyPrintVisitor.visit_load_error_value", "IRPrettyPrintVisitor.visit_dec_ref", "IRPrettyPrintVisitor.visit_get_attr", "IRPrettyPrintVisitor.visit_load_static", "IRPrettyPrintVisitor.visit_tuple_set", "IRPrettyPrintVisitor.visit_return", "IRPrettyPrintVisitor.visit_set_attr"], "tokens": 727}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRPrettyPrintVisitor(OpVisitor[str]):\n\n def visit_return(self, op: Return) -> str:\n return self.format('return %r', op.value)\n\n def visit_unreachable(self, op: Unreachable) -> str:\n return \"unreachable\"\n\n def visit_assign(self, op: Assign) -> str:\n return self.format('%r = %r', op.dest, op.src)\n\n def visit_assign_multi(self, op: AssignMulti) -> str:\n return self.format('%r = [%s]',\n op.dest,\n ', '.join(self.format('%r', v) for v in op.src))\n\n def visit_load_error_value(self, op: LoadErrorValue) -> str:\n return self.format('%r = :: %s', op, op.type)\n\n def visit_load_literal(self, op: LoadLiteral) -> str:\n prefix = ''\n # For values that have a potential unboxed representation, make\n # it explicit that this is a Python object.\n if isinstance(op.value, int):\n prefix = 'object '\n return self.format('%r = %s%s', op, prefix, repr(op.value))\n\n def visit_get_attr(self, op: GetAttr) -> str:\n return self.format('%r = %r.%s', op, op.obj, op.attr)\n\n def visit_set_attr(self, op: SetAttr) -> str:\n return self.format('%r.%s = %r; %r = is_error', op.obj, op.attr, op.src, op)\n\n def visit_load_static(self, op: LoadStatic) -> str:\n ann = ' ({})'.format(repr(op.ann)) if op.ann else ''\n name = op.identifier\n if op.module_name is not None:\n name = '{}.{}'.format(op.module_name, name)\n return self.format('%r = %s :: %s%s', op, name, op.namespace, ann)\n\n def visit_init_static(self, op: InitStatic) -> str:\n name = op.identifier\n if op.module_name is not None:\n name = '{}.{}'.format(op.module_name, name)\n return self.format('%s = %r :: %s', name, op.value, op.namespace)\n\n def visit_tuple_get(self, op: TupleGet) -> str:\n return self.format('%r = %r[%d]', op, op.src, op.index)\n\n def visit_tuple_set(self, op: TupleSet) -> str:\n item_str = ', '.join(self.format('%r', item) for item in op.items)\n return self.format('%r = (%s)', op, item_str)\n\n def visit_inc_ref(self, op: IncRef) -> str:\n s = self.format('inc_ref %r', op.src)\n # TODO: Remove bool check (it's unboxed)\n if is_bool_rprimitive(op.src.type) or is_int_rprimitive(op.src.type):\n s += ' :: {}'.format(short_name(op.src.type.name))\n return s\n\n def visit_dec_ref(self, op: DecRef) -> str:\n s = self.format('%sdec_ref %r', 'x' if op.is_xdec else '', op.src)\n # TODO: Remove bool check (it's unboxed)\n if is_bool_rprimitive(op.src.type) or is_int_rprimitive(op.src.type):\n s += ' :: {}'.format(short_name(op.src.type.name))\n return s", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/pprint.py_IRPrettyPrintVisitor.visit_call_IRPrettyPrintVisitor.visit_unbox.return.self_format_r_unbox_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/ir/pprint.py_IRPrettyPrintVisitor.visit_call_IRPrettyPrintVisitor.visit_unbox.return.self_format_r_unbox_", "embedding": null, "metadata": {"file_path": "mypyc/ir/pprint.py", "file_name": "pprint.py", "file_type": "text/x-python", "category": "implementation", "start_line": 116, "end_line": 139, "span_ids": ["IRPrettyPrintVisitor.visit_box", "IRPrettyPrintVisitor.visit_call", "IRPrettyPrintVisitor.visit_unbox", "IRPrettyPrintVisitor.visit_cast", "IRPrettyPrintVisitor.visit_method_call"], "tokens": 287}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRPrettyPrintVisitor(OpVisitor[str]):\n\n def visit_call(self, op: Call) -> str:\n args = ', '.join(self.format('%r', arg) for arg in op.args)\n # TODO: Display long name?\n short_name = op.fn.shortname\n s = '%s(%s)' % (short_name, args)\n if not op.is_void:\n s = self.format('%r = ', op) + s\n return s\n\n def visit_method_call(self, op: MethodCall) -> str:\n args = ', '.join(self.format('%r', arg) for arg in op.args)\n s = self.format('%r.%s(%s)', op.obj, op.method, args)\n if not op.is_void:\n s = self.format('%r = ', op) + s\n return s\n\n def visit_cast(self, op: Cast) -> str:\n return self.format('%r = cast(%s, %r)', op, op.type, op.src)\n\n def visit_box(self, op: Box) -> str:\n return self.format('%r = box(%s, %r)', op, op.src.type, op.src)\n\n def visit_unbox(self, op: Unbox) -> str:\n return self.format('%r = unbox(%s, %r)', op, op.type, op.src)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.get_module_IRBuilder.get_module_attr.return.self_py_get_attr_module_o": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.get_module_IRBuilder.get_module_attr.return.self_py_get_attr_module_o", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/builder.py", "file_name": "builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 302, "end_line": 319, "span_ids": ["IRBuilder.get_module_attr", "IRBuilder.get_module"], "tokens": 199}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRBuilder:\n\n def get_module(self, module: str, line: int) -> Value:\n # Python 3.7 has a nice 'PyImport_GetModule' function that we can't use :(\n mod_dict = self.call_c(get_module_dict_op, [], line)\n # Get module object from modules dict.\n return self.call_c(dict_get_item_op,\n [mod_dict, self.load_str(module)], line)\n\n def get_module_attr(self, module: str, attr: str, line: int) -> Value:\n \"\"\"Look up an attribute of a module without storing it in the local namespace.\n\n For example, get_module_attr('typing', 'TypedDict', line) results in\n the value of 'typing.TypedDict'.\n\n Import the module if needed.\n \"\"\"\n self.gen_import(module, line)\n module_obj = self.get_module(module, line)\n return self.py_get_attr(module_obj, attr, line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.disallow_class_assignments_IRBuilder.non_function_scope.return.len_self_fn_infos_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.disallow_class_assignments_IRBuilder.non_function_scope.return.len_self_fn_infos_2", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/builder.py", "file_name": "builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 348, "end_line": 365, "span_ids": ["IRBuilder.disallow_class_assignments", "IRBuilder.non_function_scope"], "tokens": 194}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRBuilder:\n\n def disallow_class_assignments(self, lvalues: List[Lvalue], line: int) -> None:\n # Some best-effort attempts to disallow assigning to class\n # variables that aren't marked ClassVar, since we blatantly\n # miscompile the interaction between instance and class\n # variables.\n for lvalue in lvalues:\n if (isinstance(lvalue, MemberExpr)\n and isinstance(lvalue.expr, RefExpr)\n and isinstance(lvalue.expr.node, TypeInfo)):\n var = lvalue.expr.node[lvalue.name].node\n if isinstance(var, Var) and not var.is_classvar:\n self.error(\n \"Only class variables defined as ClassVar can be assigned to\",\n line)\n\n def non_function_scope(self) -> bool:\n # Currently the stack always has at least two items: dummy and top-level.\n return len(self.fn_infos) <= 2", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.init_final_static_IRBuilder.init_final_static.if_lvalue_node_final_valu.self_add_InitStatic_coerc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/builder.py_IRBuilder.init_final_static_IRBuilder.init_final_static.if_lvalue_node_final_valu.self_add_InitStatic_coerc", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/builder.py", "file_name": "builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 367, "end_line": 383, "span_ids": ["IRBuilder.init_final_static"], "tokens": 177}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class IRBuilder:\n\n def init_final_static(self,\n lvalue: Lvalue,\n rvalue_reg: Value,\n class_name: Optional[str] = None,\n *,\n type_override: Optional[RType] = None) -> None:\n assert isinstance(lvalue, NameExpr)\n assert isinstance(lvalue.node, Var)\n if lvalue.node.final_value is None:\n if class_name is None:\n name = lvalue.name\n else:\n name = '{}.{}'.format(class_name, lvalue.name)\n assert name is not None, \"Full name not set for variable\"\n coerced = self.coerce(rvalue_reg, type_override or self.node_type(lvalue), lvalue.line)\n self.final_names.append((name, coerced.type))\n self.add(InitStatic(coerced, name, self.module_name))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/classdef.py_transform_class_def_transform_class_def._type_List_Tuple_Lvalue": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/classdef.py_transform_class_def_transform_class_def._type_List_Tuple_Lvalue", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/classdef.py", "file_name": "classdef.py", "file_type": "text/x-python", "category": "implementation", "start_line": 33, "end_line": 80, "span_ids": ["transform_class_def"], "tokens": 571}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def transform_class_def(builder: IRBuilder, cdef: ClassDef) -> None:\n \"\"\"Create IR for a class definition.\n\n This can generate both extension (native) and non-extension\n classes. These are generated in very different ways. In the\n latter case we construct a Python type object at runtime by doing\n the equivalent of \"type(name, bases, dict)\" in IR. Extension\n classes are defined via C structs that are generated later in\n mypyc.codegen.emitclass.\n\n This is the main entry point to this module.\n \"\"\"\n ir = builder.mapper.type_to_ir[cdef.info]\n\n # We do this check here because the base field of parent\n # classes aren't necessarily populated yet at\n # prepare_class_def time.\n if any(ir.base_mro[i].base != ir. base_mro[i + 1] for i in range(len(ir.base_mro) - 1)):\n builder.error(\"Non-trait MRO must be linear\", cdef.line)\n\n if ir.allow_interpreted_subclasses:\n for parent in ir.mro:\n if not parent.allow_interpreted_subclasses:\n builder.error(\n 'Base class \"{}\" does not allow interpreted subclasses'.format(\n parent.fullname), cdef.line)\n\n # Currently, we only create non-extension classes for classes that are\n # decorated or inherit from Enum. Classes decorated with @trait do not\n # apply here, and are handled in a different way.\n if ir.is_ext_class:\n # If the class is not decorated, generate an extension class for it.\n type_obj = allocate_class(builder, cdef) # type: Optional[Value]\n non_ext = None # type: Optional[NonExtClassInfo]\n dataclass_non_ext = dataclass_non_ext_info(builder, cdef)\n else:\n non_ext_bases = populate_non_ext_bases(builder, cdef)\n non_ext_metaclass = find_non_ext_metaclass(builder, cdef, non_ext_bases)\n non_ext_dict = setup_non_ext_dict(builder, cdef, non_ext_metaclass, non_ext_bases)\n # We populate __annotations__ for non-extension classes\n # because dataclasses uses it to determine which attributes to compute on.\n # TODO: Maybe generate more precise types for annotations\n non_ext_anns = builder.call_c(dict_new_op, [], cdef.line)\n non_ext = NonExtClassInfo(non_ext_dict, non_ext_bases, non_ext_anns, non_ext_metaclass)\n dataclass_non_ext = None\n type_obj = None\n\n attrs_to_cache = [] # type: List[Tuple[Lvalue, RType]]\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/classdef.py_add_non_ext_class_attr_add_non_ext_class_attr.if_not_isinstance_stmt_rv.if_.attr_to_cache_append_lva": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/classdef.py_add_non_ext_class_attr_add_non_ext_class_attr.if_not_isinstance_stmt_rv.if_.attr_to_cache_append_lva", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/classdef.py", "file_name": "classdef.py", "file_type": "text/x-python", "category": "implementation", "start_line": 298, "end_line": 329, "span_ids": ["add_non_ext_class_attr"], "tokens": 377}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def add_non_ext_class_attr(builder: IRBuilder,\n non_ext: NonExtClassInfo,\n lvalue: NameExpr,\n stmt: AssignmentStmt,\n cdef: ClassDef,\n attr_to_cache: List[Tuple[Lvalue, RType]]) -> None:\n \"\"\"Add a class attribute to __annotations__ of a non-extension class.\n\n If the attribute is initialized with a value, also add it to __dict__.\n \"\"\"\n # We populate __annotations__ because dataclasses uses it to determine\n # which attributes to compute on.\n # TODO: Maybe generate more precise types for annotations\n key = builder.load_str(lvalue.name)\n typ = builder.add(LoadAddress(type_object_op.type, type_object_op.src, stmt.line))\n builder.call_c(dict_set_item_op, [non_ext.anns, key, typ], stmt.line)\n\n # Only add the attribute to the __dict__ if the assignment is of the form:\n # x: type = value (don't add attributes of the form 'x: type' to the __dict__).\n if not isinstance(stmt.rvalue, TempNode):\n rvalue = builder.accept(stmt.rvalue)\n builder.add_to_non_ext_dict(non_ext, lvalue.name, rvalue, stmt.line)\n # We cache enum attributes to speed up enum attribute lookup since they\n # are final.\n if (\n cdef.info.bases\n and cdef.info.bases[0].type.fullname == 'enum.Enum'\n # Skip \"_order_\" and \"__order__\", since Enum will remove it\n and lvalue.name not in ('_order_', '__order__')\n ):\n # Enum values are always boxed, so use object_rprimitive.\n attr_to_cache.append((lvalue, object_rprimitive))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py__Comprehensions_transform_dictionary_comprehension.return.d": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/expression.py__Comprehensions_transform_dictionary_comprehension.return.d", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/expression.py", "file_name": "expression.py", "file_type": "text/x-python", "category": "implementation", "start_line": 654, "end_line": 675, "span_ids": ["transform_dictionary_comprehension", "_visit_display", "transform_list_comprehension", "transform_set_comprehension"], "tokens": 187}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Comprehensions\n\n\ndef transform_list_comprehension(builder: IRBuilder, o: ListComprehension) -> Value:\n return translate_list_comprehension(builder, o.generator)\n\n\ndef transform_set_comprehension(builder: IRBuilder, o: SetComprehension) -> Value:\n return translate_set_comprehension(builder, o.generator)\n\n\ndef transform_dictionary_comprehension(builder: IRBuilder, o: DictionaryComprehension) -> Value:\n d = builder.call_c(dict_new_op, [], o.line)\n loop_params = list(zip(o.indices, o.sequences, o.condlists))\n\n def gen_inner_stmts() -> None:\n k = builder.accept(o.key)\n v = builder.accept(o.value)\n builder.call_c(dict_set_item_op, [d, k, v], o.line)\n\n comprehension_helper(builder, loop_params, gen_inner_stmts, o.line)\n return d", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_for_loop_helper_with_index_for_loop_helper_with_index.builder_activate_block_ex": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_for_loop_helper_with_index_for_loop_helper_with_index.builder_activate_block_ex", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/for_helpers.py", "file_name": "for_helpers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 90, "end_line": 131, "span_ids": ["for_loop_helper_with_index"], "tokens": 298}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def for_loop_helper_with_index(builder: IRBuilder, index: Lvalue, expr: Expression,\n body_insts: Callable[[Value], None], line: int) -> None:\n \"\"\"Generate IR for a sequence iteration.\n\n This function only works for sequence type. Compared to for_loop_helper,\n it would feed iteration index to body_insts.\n\n Args:\n index: the loop index Lvalue\n expr: the expression to iterate over\n body_insts: a function that generates the body of the loop.\n It needs a index as parameter.\n \"\"\"\n expr_reg = builder.accept(expr)\n assert is_sequence_rprimitive(expr_reg.type)\n target_type = builder.get_sequence_type(expr)\n\n body_block = BasicBlock()\n step_block = BasicBlock()\n exit_block = BasicBlock()\n condition_block = BasicBlock()\n\n for_gen = ForSequence(builder, index, body_block, exit_block, line, False)\n for_gen.init(expr_reg, target_type, reverse=False)\n\n builder.push_loop_stack(step_block, exit_block)\n\n builder.goto_and_activate(condition_block)\n for_gen.gen_condition()\n\n builder.activate_block(body_block)\n for_gen.begin_body()\n body_insts(builder.read(for_gen.index_target))\n\n builder.goto_and_activate(step_block)\n for_gen.gen_step()\n builder.goto(condition_block)\n\n for_gen.add_cleanup(exit_block)\n builder.pop_loop_stack()\n\n builder.activate_block(exit_block)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_translate_list_comprehension_translate_set_comprehension.return.set_ops": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_translate_list_comprehension_translate_set_comprehension.return.set_ops", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/for_helpers.py", "file_name": "for_helpers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 182, "end_line": 211, "span_ids": ["translate_set_comprehension", "translate_list_comprehension"], "tokens": 273}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def translate_list_comprehension(builder: IRBuilder, gen: GeneratorExpr) -> Value:\n # Try simplest list comprehension, otherwise fall back to general one\n val = sequence_from_generator_preallocate_helper(\n builder, gen,\n empty_op_llbuilder=builder.builder.new_list_op_with_length,\n set_item_op=new_list_set_item_op)\n if val is not None:\n return val\n\n list_ops = builder.new_list_op([], gen.line)\n loop_params = list(zip(gen.indices, gen.sequences, gen.condlists))\n\n def gen_inner_stmts() -> None:\n e = builder.accept(gen.left_expr)\n builder.call_c(list_append_op, [list_ops, e], gen.line)\n\n comprehension_helper(builder, loop_params, gen_inner_stmts, gen.line)\n return list_ops\n\n\ndef translate_set_comprehension(builder: IRBuilder, gen: GeneratorExpr) -> Value:\n set_ops = builder.new_set_op([], gen.line)\n loop_params = list(zip(gen.indices, gen.sequences, gen.condlists))\n\n def gen_inner_stmts() -> None:\n e = builder.accept(gen.left_expr)\n builder.call_c(set_add_op, [set_ops, e], gen.line)\n\n comprehension_helper(builder, loop_params, gen_inner_stmts, gen.line)\n return set_ops", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_comprehension_helper_comprehension_helper.handle_loop.for_loop_helper_builder_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_comprehension_helper_comprehension_helper.handle_loop.for_loop_helper_builder_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/for_helpers.py", "file_name": "for_helpers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 158, "end_line": 181, "span_ids": ["comprehension_helper"], "tokens": 269}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def comprehension_helper(builder: IRBuilder,\n loop_params: List[Tuple[Lvalue, Expression, List[Expression]]],\n gen_inner_stmts: Callable[[], None],\n line: int) -> None:\n \"\"\"Helper function for list comprehensions.\n\n Args:\n loop_params: a list of (index, expr, [conditions]) tuples defining nested loops:\n - \"index\" is the Lvalue indexing that loop;\n - \"expr\" is the expression for the object to be iterated over;\n - \"conditions\" is a list of conditions, evaluated in order with short-circuiting,\n that must all be true for the loop body to be executed\n gen_inner_stmts: function to generate the IR for the body of the innermost loop\n \"\"\"\n def handle_loop(loop_params: List[Tuple[Lvalue, Expression, List[Expression]]]) -> None:\n \"\"\"Generate IR for a loop.\n\n Given a list of (index, expression, [conditions]) tuples, generate IR\n for the nested loops the list defines.\n \"\"\"\n index, expr, conds = loop_params[0]\n for_loop_helper(builder, index, expr,\n lambda: loop_contents(conds, loop_params[1:]),\n None, line)\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder._py_vector_call_LowLevelIRBuilder._py_vector_call.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder._py_vector_call_LowLevelIRBuilder._py_vector_call.return.None", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/ll_builder.py", "file_name": "ll_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 313, "end_line": 347, "span_ids": ["LowLevelIRBuilder._py_vector_call"], "tokens": 364}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LowLevelIRBuilder:\n\n def _py_vector_call(self,\n function: Value,\n arg_values: List[Value],\n line: int,\n arg_kinds: Optional[List[int]] = None,\n arg_names: Optional[Sequence[Optional[str]]] = None) -> Optional[Value]:\n \"\"\"Call function using the vectorcall API if possible.\n\n Return the return value if successful. Return None if a non-vectorcall\n API should be used instead.\n \"\"\"\n # We can do this if all args are positional or named (no *args or **kwargs).\n if arg_kinds is None or all(kind in (ARG_POS, ARG_NAMED) for kind in arg_kinds):\n if arg_values:\n # Create a C array containing all arguments as boxed values.\n array = Register(RArray(object_rprimitive, len(arg_values)))\n coerced_args = [self.coerce(arg, object_rprimitive, line) for arg in arg_values]\n self.add(AssignMulti(array, coerced_args))\n arg_ptr = self.add(LoadAddress(object_pointer_rprimitive, array))\n else:\n arg_ptr = Integer(0, object_pointer_rprimitive)\n num_pos = num_positional_args(arg_values, arg_kinds)\n keywords = self._vectorcall_keywords(arg_names)\n value = self.call_c(py_vectorcall_op, [function,\n arg_ptr,\n Integer(num_pos, c_size_t_rprimitive),\n keywords],\n line)\n if arg_values:\n # Make sure arguments won't be freed until after the call.\n # We need this because RArray doesn't support automatic\n # memory management.\n self.add(KeepAlive(coerced_args))\n return value\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder._vectorcall_keywords_LowLevelIRBuilder.py_method_call.if_arg_kinds_is_None_or_a.else_.return.self_py_call_method_arg_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder._vectorcall_keywords_LowLevelIRBuilder.py_method_call.if_arg_kinds_is_None_or_a.else_.return.self_py_call_method_arg_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/ll_builder.py", "file_name": "ll_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 349, "end_line": 382, "span_ids": ["LowLevelIRBuilder.py_method_call", "LowLevelIRBuilder._vectorcall_keywords"], "tokens": 358}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LowLevelIRBuilder:\n\n def _vectorcall_keywords(self, arg_names: Optional[Sequence[Optional[str]]]) -> Value:\n \"\"\"Return a reference to a tuple literal with keyword argument names.\n\n Return null pointer if there are no keyword arguments.\n \"\"\"\n if arg_names:\n kw_list = [name for name in arg_names if name is not None]\n if kw_list:\n return self.add(LoadLiteral(tuple(kw_list), object_rprimitive))\n return Integer(0, object_rprimitive)\n\n def py_method_call(self,\n obj: Value,\n method_name: str,\n arg_values: List[Value],\n line: int,\n arg_kinds: Optional[List[int]],\n arg_names: Optional[Sequence[Optional[str]]]) -> Value:\n \"\"\"Call a Python method (non-native and slow).\"\"\"\n if use_method_vectorcall(self.options.capi_version):\n # More recent Python versions support faster vectorcalls.\n result = self._py_vector_method_call(\n obj, method_name, arg_values, line, arg_kinds, arg_names)\n if result is not None:\n return result\n\n if arg_kinds is None or all(kind == ARG_POS for kind in arg_kinds):\n # Use legacy method call API\n method_name_reg = self.load_str(method_name)\n return self.call_c(py_method_call_op, [obj, method_name_reg] + arg_values, line)\n else:\n # Use py_call since it supports keyword arguments (and vectorcalls).\n method = self.py_get_attr(obj, method_name, line)\n return self.py_call(method, arg_values, line, arg_kinds=arg_kinds, arg_names=arg_names)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder._py_vector_method_call_LowLevelIRBuilder.call.return.self_add_Call_decl_args_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder._py_vector_method_call_LowLevelIRBuilder.call.return.self_add_Call_decl_args_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/ll_builder.py", "file_name": "ll_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 384, "end_line": 430, "span_ids": ["LowLevelIRBuilder.call", "LowLevelIRBuilder._py_vector_method_call"], "tokens": 454}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LowLevelIRBuilder:\n\n def _py_vector_method_call(self,\n obj: Value,\n method_name: str,\n arg_values: List[Value],\n line: int,\n arg_kinds: Optional[List[int]],\n arg_names: Optional[Sequence[Optional[str]]]) -> Optional[Value]:\n \"\"\"Call method using the vectorcall API if possible.\n\n Return the return value if successful. Return None if a non-vectorcall\n API should be used instead.\n \"\"\"\n if arg_kinds is None or all(kind in (ARG_POS, ARG_NAMED) for kind in arg_kinds):\n method_name_reg = self.load_str(method_name)\n array = Register(RArray(object_rprimitive, len(arg_values) + 1))\n self_arg = self.coerce(obj, object_rprimitive, line)\n coerced_args = [self_arg] + [self.coerce(arg, object_rprimitive, line)\n for arg in arg_values]\n self.add(AssignMulti(array, coerced_args))\n arg_ptr = self.add(LoadAddress(object_pointer_rprimitive, array))\n num_pos = num_positional_args(arg_values, arg_kinds)\n keywords = self._vectorcall_keywords(arg_names)\n value = self.call_c(py_vectorcall_method_op,\n [method_name_reg,\n arg_ptr,\n Integer((num_pos + 1) | PY_VECTORCALL_ARGUMENTS_OFFSET,\n c_size_t_rprimitive),\n keywords],\n line)\n # Make sure arguments won't be freed until after the call.\n # We need this because RArray doesn't support automatic\n # memory management.\n self.add(KeepAlive(coerced_args))\n return value\n return None\n\n def call(self,\n decl: FuncDecl,\n args: Sequence[Value],\n arg_kinds: List[int],\n arg_names: Sequence[Optional[str]],\n line: int) -> Value:\n \"\"\"Call a native function.\"\"\"\n # Normalize args to positionals.\n args = self.native_args_to_positional(\n args, arg_kinds, arg_names, decl.sig, line)\n return self.add(Call(decl, args, line))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.builtin_len_LowLevelIRBuilder.builtin_len.if_is_list_rprimitive_typ.else_.if_use_pyssize_t_.else_.return.self_call_c_generic_len_o": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.builtin_len_LowLevelIRBuilder.builtin_len.if_is_list_rprimitive_typ.else_.if_use_pyssize_t_.else_.return.self_call_c_generic_len_o", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/ll_builder.py", "file_name": "ll_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1085, "end_line": 1119, "span_ids": ["LowLevelIRBuilder.builtin_len"], "tokens": 393}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LowLevelIRBuilder:\n\n def builtin_len(self, val: Value, line: int,\n use_pyssize_t: bool = False) -> Value:\n \"\"\"Return short_int_rprimitive by default.\"\"\"\n typ = val.type\n if is_list_rprimitive(typ) or is_tuple_rprimitive(typ):\n elem_address = self.add(GetElementPtr(val, PyVarObject, 'ob_size'))\n size_value = self.add(LoadMem(c_pyssize_t_rprimitive, elem_address))\n self.add(KeepAlive([val]))\n if use_pyssize_t:\n return size_value\n offset = Integer(1, c_pyssize_t_rprimitive, line)\n return self.int_op(short_int_rprimitive, size_value, offset,\n IntOp.LEFT_SHIFT, line)\n elif is_dict_rprimitive(typ):\n size_value = self.call_c(dict_size_op, [val], line)\n if use_pyssize_t:\n return size_value\n offset = Integer(1, c_pyssize_t_rprimitive, line)\n return self.int_op(short_int_rprimitive, size_value, offset,\n IntOp.LEFT_SHIFT, line)\n elif is_set_rprimitive(typ):\n elem_address = self.add(GetElementPtr(val, PySetObject, 'used'))\n size_value = self.add(LoadMem(c_pyssize_t_rprimitive, elem_address))\n self.add(KeepAlive([val]))\n if use_pyssize_t:\n return size_value\n offset = Integer(1, c_pyssize_t_rprimitive, line)\n return self.int_op(short_int_rprimitive, size_value, offset,\n IntOp.LEFT_SHIFT, line)\n # generic case\n else:\n if use_pyssize_t:\n return self.call_c(generic_ssize_t_len_op, [val], line)\n else:\n return self.call_c(generic_len_op, [val], line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.new_tuple_LowLevelIRBuilder._Internal_helpers": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.new_tuple_LowLevelIRBuilder._Internal_helpers", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/ll_builder.py", "file_name": "ll_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1138, "end_line": 1156, "span_ids": ["LowLevelIRBuilder.new_tuple", "LowLevelIRBuilder.new_tuple_with_length"], "tokens": 195}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LowLevelIRBuilder:\n\n def new_tuple(self, items: List[Value], line: int) -> Value:\n size = Integer(len(items), c_pyssize_t_rprimitive) # type: Value\n return self.call_c(new_tuple_op, [size] + items, line)\n\n def new_tuple_with_length(self, length: Value, line: int) -> Value:\n \"\"\"This function returns an uninitialized tuple.\n\n If the length is non-zero, the caller must initialize the tuple, before\n it can be made visible to user code -- otherwise the tuple object is broken.\n You might need further initialization with `new_tuple_set_item_op` op.\n\n Args:\n length: desired length of the new tuple. The rtype should be\n c_pyssize_t_rprimitive\n line: line number\n \"\"\"\n return self.call_c(new_tuple_with_length_op, [length], line)\n\n # Internal helpers", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/specialize.py_translate_set_from_generator_call_translate_set_from_generator_call.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/specialize.py_translate_set_from_generator_call_translate_set_from_generator_call.return.None", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/specialize.py", "file_name": "specialize.py", "file_type": "text/x-python", "category": "implementation", "start_line": 115, "end_line": 124, "span_ids": ["translate_set_from_generator_call"], "tokens": 115}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "@specialize_function('builtins.set')\ndef translate_set_from_generator_call(\n builder: IRBuilder, expr: CallExpr, callee: RefExpr) -> Optional[Value]:\n # Special case for set creation from a generator\uff1a\n # set(f(...) for ... in iterator/nested_generators...)\n if (len(expr.args) == 1\n and expr.arg_kinds[0] == ARG_POS\n and isinstance(expr.args[0], GeneratorExpr)):\n return translate_set_comprehension(builder, expr.args[0])\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/util.py_is_extension_class_is_extension_class.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/util.py_is_extension_class_is_extension_class.return.True", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/util.py", "file_name": "util.py", "file_type": "text/x-python", "category": "implementation", "start_line": 77, "end_line": 92, "span_ids": ["is_extension_class"], "tokens": 133}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_extension_class(cdef: ClassDef) -> bool:\n if any(\n not is_trait_decorator(d)\n and not is_dataclass_decorator(d)\n and not get_mypyc_attr_call(d)\n for d in cdef.decorators\n ):\n return False\n if cdef.info.typeddict_type:\n return False\n if cdef.info.is_named_tuple:\n return False\n if (cdef.info.metaclass_type and cdef.info.metaclass_type.type.fullname not in (\n 'abc.ABCMeta', 'typing.TypingMeta', 'typing.GenericMeta')):\n return False\n return True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/util.py_get_func_def_concrete_arg_kind.if_kind_ARG_OPT_.else_.return.kind": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/util.py_get_func_def_concrete_arg_kind.if_kind_ARG_OPT_.else_.return.kind", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/util.py", "file_name": "util.py", "file_type": "text/x-python", "category": "implementation", "start_line": 93, "end_line": 109, "span_ids": ["get_func_def", "concrete_arg_kind"], "tokens": 121}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def get_func_def(op: Union[FuncDef, Decorator, OverloadedFuncDef]) -> FuncDef:\n if isinstance(op, OverloadedFuncDef):\n assert op.impl\n op = op.impl\n if isinstance(op, Decorator):\n op = op.func\n return op\n\n\ndef concrete_arg_kind(kind: int) -> int:\n \"\"\"Find the concrete version of an arg kind that is being passed.\"\"\"\n if kind == ARG_OPT:\n return ARG_POS\n elif kind == ARG_NAMED_OPT:\n return ARG_NAMED\n else:\n return kind", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/generic_ops.py__Fallback_primitive_ope_None_2.binary_op_name_op_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/generic_ops.py__Fallback_primitive_ope_None_2.binary_op_name_op_", "embedding": null, "metadata": {"file_path": "mypyc/primitives/generic_ops.py", "file_name": "generic_ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 74, "span_ids": ["impl:5", "docstring"], "tokens": 709}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Fallback primitive operations that operate on 'object' operands.\n\nThese just call the relevant Python C API function or a thin wrapper\naround an API function. Most of these also have faster, specialized\nops that operate on some more specific types.\n\nMany of these ops are given a low priority (0) so that specialized ops\nwill take precedence. If your specialized op doesn't seem to be used,\ncheck that the priorities are configured properly.\n\"\"\"\n\nfrom mypyc.ir.ops import ERR_NEVER, ERR_MAGIC\nfrom mypyc.ir.rtypes import (\n object_rprimitive, int_rprimitive, bool_rprimitive, c_int_rprimitive, pointer_rprimitive,\n object_pointer_rprimitive, c_size_t_rprimitive, c_pyssize_t_rprimitive\n)\nfrom mypyc.primitives.registry import (\n binary_op, c_unary_op, method_op, function_op, custom_op, ERR_NEG_INT\n)\n\n\n# Binary operations\n\nfor op, opid in [('==', 2), # PY_EQ\n ('!=', 3), # PY_NE\n ('<', 0), # PY_LT\n ('<=', 1), # PY_LE\n ('>', 4), # PY_GT\n ('>=', 5)]: # PY_GE\n # The result type is 'object' since that's what PyObject_RichCompare returns.\n binary_op(name=op,\n arg_types=[object_rprimitive, object_rprimitive],\n return_type=object_rprimitive,\n c_function_name='PyObject_RichCompare',\n error_kind=ERR_MAGIC,\n extra_int_constants=[(opid, c_int_rprimitive)],\n priority=0)\n\nfor op, funcname in [('+', 'PyNumber_Add'),\n ('-', 'PyNumber_Subtract'),\n ('*', 'PyNumber_Multiply'),\n ('//', 'PyNumber_FloorDivide'),\n ('/', 'PyNumber_TrueDivide'),\n ('%', 'PyNumber_Remainder'),\n ('<<', 'PyNumber_Lshift'),\n ('>>', 'PyNumber_Rshift'),\n ('&', 'PyNumber_And'),\n ('^', 'PyNumber_Xor'),\n ('|', 'PyNumber_Or')]:\n binary_op(name=op,\n arg_types=[object_rprimitive, object_rprimitive],\n return_type=object_rprimitive,\n c_function_name=funcname,\n error_kind=ERR_MAGIC,\n priority=0)\n\nfor op, funcname in [('+=', 'PyNumber_InPlaceAdd'),\n ('-=', 'PyNumber_InPlaceSubtract'),\n ('*=', 'PyNumber_InPlaceMultiply'),\n ('@=', 'PyNumber_InPlaceMatrixMultiply'),\n ('//=', 'PyNumber_InPlaceFloorDivide'),\n ('/=', 'PyNumber_InPlaceTrueDivide'),\n ('%=', 'PyNumber_InPlaceRemainder'),\n ('<<=', 'PyNumber_InPlaceLshift'),\n ('>>=', 'PyNumber_InPlaceRshift'),\n ('&=', 'PyNumber_InPlaceAnd'),\n ('^=', 'PyNumber_InPlaceXor'),\n ('|=', 'PyNumber_InPlaceOr')]:\n binary_op(name=op,\n arg_types=[object_rprimitive, object_rprimitive],\n return_type=object_rprimitive,\n c_function_name=funcname,\n error_kind=ERR_MAGIC,\n priority=0)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/generic_ops.py_binary_op_name___del_obj_attr": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/generic_ops.py_binary_op_name___del_obj_attr", "embedding": null, "metadata": {"file_path": "mypyc/primitives/generic_ops.py", "file_name": "generic_ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 76, "end_line": 181, "span_ids": ["impl:13", "impl:5"], "tokens": 732}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "binary_op(name='**',\n arg_types=[object_rprimitive, object_rprimitive],\n return_type=object_rprimitive,\n error_kind=ERR_MAGIC,\n c_function_name='CPyNumber_Power',\n priority=0)\n\nbinary_op(\n name='in',\n arg_types=[object_rprimitive, object_rprimitive],\n return_type=c_int_rprimitive,\n c_function_name='PySequence_Contains',\n error_kind=ERR_NEG_INT,\n truncated_type=bool_rprimitive,\n ordering=[1, 0],\n priority=0)\n\n\n# Unary operations\n\nfor op, funcname in [('-', 'PyNumber_Negative'),\n ('+', 'PyNumber_Positive'),\n ('~', 'PyNumber_Invert')]:\n c_unary_op(name=op,\n arg_type=object_rprimitive,\n return_type=object_rprimitive,\n c_function_name=funcname,\n error_kind=ERR_MAGIC,\n priority=0)\n\nc_unary_op(\n name='not',\n arg_type=object_rprimitive,\n return_type=c_int_rprimitive,\n c_function_name='PyObject_Not',\n error_kind=ERR_NEG_INT,\n truncated_type=bool_rprimitive,\n priority=0)\n\n# obj1[obj2]\nmethod_op(name='__getitem__',\n arg_types=[object_rprimitive, object_rprimitive],\n return_type=object_rprimitive,\n c_function_name='PyObject_GetItem',\n error_kind=ERR_MAGIC,\n priority=0)\n\n# obj1[obj2] = obj3\nmethod_op(\n name='__setitem__',\n arg_types=[object_rprimitive, object_rprimitive, object_rprimitive],\n return_type=c_int_rprimitive,\n c_function_name='PyObject_SetItem',\n error_kind=ERR_NEG_INT,\n priority=0)\n\n# del obj1[obj2]\nmethod_op(\n name='__delitem__',\n arg_types=[object_rprimitive, object_rprimitive],\n return_type=c_int_rprimitive,\n c_function_name='PyObject_DelItem',\n error_kind=ERR_NEG_INT,\n priority=0)\n\n# hash(obj)\nfunction_op(\n name='builtins.hash',\n arg_types=[object_rprimitive],\n return_type=int_rprimitive,\n c_function_name='CPyObject_Hash',\n error_kind=ERR_MAGIC)\n\n# getattr(obj, attr)\npy_getattr_op = function_op(\n name='builtins.getattr',\n arg_types=[object_rprimitive, object_rprimitive],\n return_type=object_rprimitive,\n c_function_name='CPyObject_GetAttr',\n error_kind=ERR_MAGIC)\n\n# getattr(obj, attr, default)\nfunction_op(\n name='builtins.getattr',\n arg_types=[object_rprimitive, object_rprimitive, object_rprimitive],\n return_type=object_rprimitive,\n c_function_name='CPyObject_GetAttr3',\n error_kind=ERR_MAGIC)\n\n# setattr(obj, attr, value)\npy_setattr_op = function_op(\n name='builtins.setattr',\n arg_types=[object_rprimitive, object_rprimitive, object_rprimitive],\n return_type=c_int_rprimitive,\n c_function_name='PyObject_SetAttr',\n error_kind=ERR_NEG_INT)\n\n# hasattr(obj, attr)\npy_hasattr_op = function_op(\n name='builtins.hasattr',\n arg_types=[object_rprimitive, object_rprimitive],\n return_type=bool_rprimitive,\n c_function_name='PyObject_HasAttr',\n error_kind=ERR_NEVER)\n\n# del obj.attr", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/generic_ops.py_py_delattr_op_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/generic_ops.py_py_delattr_op_", "embedding": null, "metadata": {"file_path": "mypyc/primitives/generic_ops.py", "file_name": "generic_ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 182, "end_line": 277, "span_ids": ["impl:13", "impl:38", "impl:26"], "tokens": 868}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "py_delattr_op = function_op(\n name='builtins.delattr',\n arg_types=[object_rprimitive, object_rprimitive],\n return_type=c_int_rprimitive,\n c_function_name='PyObject_DelAttr',\n error_kind=ERR_NEG_INT)\n\n# Call callable object with N positional arguments: func(arg1, ..., argN)\n# Arguments are (func, arg1, ..., argN).\npy_call_op = custom_op(\n arg_types=[],\n return_type=object_rprimitive,\n c_function_name='PyObject_CallFunctionObjArgs',\n error_kind=ERR_MAGIC,\n var_arg_type=object_rprimitive,\n extra_int_constants=[(0, pointer_rprimitive)])\n\n# Call callable object using positional and/or keyword arguments (Python 3.8+)\npy_vectorcall_op = custom_op(\n arg_types=[object_rprimitive, # Callable\n object_pointer_rprimitive, # Args (PyObject **)\n c_size_t_rprimitive, # Number of positional args\n object_rprimitive], # Keyword arg names tuple (or NULL)\n return_type=object_rprimitive,\n c_function_name='_PyObject_Vectorcall',\n error_kind=ERR_MAGIC)\n\n# Call method using positional and/or keyword arguments (Python 3.9+)\npy_vectorcall_method_op = custom_op(\n arg_types=[object_rprimitive, # Method name\n object_pointer_rprimitive, # Args, including self (PyObject **)\n c_size_t_rprimitive, # Number of positional args, including self\n object_rprimitive], # Keyword arg names tuple (or NULL)\n return_type=object_rprimitive,\n c_function_name='PyObject_VectorcallMethod',\n error_kind=ERR_MAGIC)\n\n# Call callable object with positional + keyword args: func(*args, **kwargs)\n# Arguments are (func, *args tuple, **kwargs dict).\npy_call_with_kwargs_op = custom_op(\n arg_types=[object_rprimitive, object_rprimitive, object_rprimitive],\n return_type=object_rprimitive,\n c_function_name='PyObject_Call',\n error_kind=ERR_MAGIC)\n\n# Call method with positional arguments: obj.method(arg1, ...)\n# Arguments are (object, attribute name, arg1, ...).\npy_method_call_op = custom_op(\n arg_types=[],\n return_type=object_rprimitive,\n c_function_name='CPyObject_CallMethodObjArgs',\n error_kind=ERR_MAGIC,\n var_arg_type=object_rprimitive,\n extra_int_constants=[(0, pointer_rprimitive)])\n\n# len(obj)\ngeneric_len_op = custom_op(\n arg_types=[object_rprimitive],\n return_type=int_rprimitive,\n c_function_name='CPyObject_Size',\n error_kind=ERR_MAGIC)\n\n# len(obj)\n# same as generic_len_op, however return py_ssize_t\ngeneric_ssize_t_len_op = custom_op(\n arg_types=[object_rprimitive],\n return_type=c_pyssize_t_rprimitive,\n c_function_name='PyObject_Size',\n error_kind=ERR_NEG_INT)\n\n# iter(obj)\niter_op = function_op(name='builtins.iter',\n arg_types=[object_rprimitive],\n return_type=object_rprimitive,\n c_function_name='PyObject_GetIter',\n error_kind=ERR_MAGIC)\n# next(iterator)\n#\n# Although the error_kind is set to be ERR_NEVER, this can actually\n# return NULL, and thus it must be checked using Branch.IS_ERROR.\nnext_op = custom_op(arg_types=[object_rprimitive],\n return_type=object_rprimitive,\n c_function_name='PyIter_Next',\n error_kind=ERR_NEVER)\n# next(iterator)\n#\n# Do a next, don't swallow StopIteration, but also don't propagate an\n# error. (N.B: This can still return NULL without an error to\n# represent an implicit StopIteration, but if StopIteration is\n# *explicitly* raised this will not swallow it.)\n# Can return NULL: see next_op.\nnext_raw_op = custom_op(arg_types=[object_rprimitive],\n return_type=object_rprimitive,\n c_function_name='CPyIter_Next',\n error_kind=ERR_NEVER)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor.test_branch_no_else_TestFunctionEmitterVisitor.test_branch_no_else.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor.test_branch_no_else_TestFunctionEmitterVisitor.test_branch_no_else.None_1", "embedding": null, "metadata": {"file_path": "mypyc/test/test_emitfunc.py", "file_name": "test_emitfunc.py", "file_type": "text/x-python", "category": "test", "start_line": 135, "end_line": 146, "span_ids": ["TestFunctionEmitterVisitor.test_branch_no_else"], "tokens": 138}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestFunctionEmitterVisitor(unittest.TestCase):\n\n def test_branch_no_else(self) -> None:\n next_block = BasicBlock(9)\n b = Branch(self.b, BasicBlock(8), next_block, Branch.BOOL)\n self.assert_emit(b,\n \"\"\"if (cpy_r_b) goto CPyL8;\"\"\",\n next_block=next_block)\n next_block = BasicBlock(9)\n b = Branch(self.b, BasicBlock(8), next_block, Branch.BOOL)\n b.negated = True\n self.assert_emit(b,\n \"\"\"if (!cpy_r_b) goto CPyL8;\"\"\",\n next_block=next_block)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor.test_branch_no_else_negated_TestFunctionEmitterVisitor.test_branch_no_else_negated.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor.test_branch_no_else_negated_TestFunctionEmitterVisitor.test_branch_no_else_negated.None_1", "embedding": null, "metadata": {"file_path": "mypyc/test/test_emitfunc.py", "file_name": "test_emitfunc.py", "file_type": "text/x-python", "category": "test", "start_line": 148, "end_line": 159, "span_ids": ["TestFunctionEmitterVisitor.test_branch_no_else_negated"], "tokens": 140}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestFunctionEmitterVisitor(unittest.TestCase):\n\n def test_branch_no_else_negated(self) -> None:\n next_block = BasicBlock(1)\n b = Branch(self.b, next_block, BasicBlock(2), Branch.BOOL)\n self.assert_emit(b,\n \"\"\"if (!cpy_r_b) goto CPyL2;\"\"\",\n next_block=next_block)\n next_block = BasicBlock(1)\n b = Branch(self.b, next_block, BasicBlock(2), Branch.BOOL)\n b.negated = True\n self.assert_emit(b,\n \"\"\"if (cpy_r_b) goto CPyL2;\"\"\",\n next_block=next_block)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor.test_branch_is_error_TestFunctionEmitterVisitor.test_branch_is_error.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor.test_branch_is_error_TestFunctionEmitterVisitor.test_branch_is_error.None_1", "embedding": null, "metadata": {"file_path": "mypyc/test/test_emitfunc.py", "file_name": "test_emitfunc.py", "file_type": "text/x-python", "category": "test", "start_line": 161, "end_line": 176, "span_ids": ["TestFunctionEmitterVisitor.test_branch_is_error"], "tokens": 146}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestFunctionEmitterVisitor(unittest.TestCase):\n\n def test_branch_is_error(self) -> None:\n b = Branch(self.b, BasicBlock(8), BasicBlock(9), Branch.IS_ERROR)\n self.assert_emit(b,\n \"\"\"if (cpy_r_b == 2) {\n goto CPyL8;\n } else\n goto CPyL9;\n \"\"\")\n b = Branch(self.b, BasicBlock(8), BasicBlock(9), Branch.IS_ERROR)\n b.negated = True\n self.assert_emit(b,\n \"\"\"if (cpy_r_b != 2) {\n goto CPyL8;\n } else\n goto CPyL9;\n \"\"\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor.test_branch_is_error_next_block_TestFunctionEmitterVisitor.test_branch_is_error_next_block.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor.test_branch_is_error_next_block_TestFunctionEmitterVisitor.test_branch_is_error_next_block.None_1", "embedding": null, "metadata": {"file_path": "mypyc/test/test_emitfunc.py", "file_name": "test_emitfunc.py", "file_type": "text/x-python", "category": "test", "start_line": 178, "end_line": 188, "span_ids": ["TestFunctionEmitterVisitor.test_branch_is_error_next_block"], "tokens": 137}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestFunctionEmitterVisitor(unittest.TestCase):\n\n def test_branch_is_error_next_block(self) -> None:\n next_block = BasicBlock(8)\n b = Branch(self.b, next_block, BasicBlock(9), Branch.IS_ERROR)\n self.assert_emit(b,\n \"\"\"if (cpy_r_b != 2) goto CPyL9;\"\"\",\n next_block=next_block)\n b = Branch(self.b, next_block, BasicBlock(9), Branch.IS_ERROR)\n b.negated = True\n self.assert_emit(b,\n \"\"\"if (cpy_r_b == 2) goto CPyL9;\"\"\",\n next_block=next_block)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor.test_load_mem_TestFunctionEmitterVisitor.test_get_element_ptr.None_2": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor.test_load_mem_TestFunctionEmitterVisitor.test_get_element_ptr.None_2", "embedding": null, "metadata": {"file_path": "mypyc/test/test_emitfunc.py", "file_name": "test_emitfunc.py", "file_type": "text/x-python", "category": "test", "start_line": 344, "end_line": 360, "span_ids": ["TestFunctionEmitterVisitor.test_set_mem", "TestFunctionEmitterVisitor.test_load_mem", "TestFunctionEmitterVisitor.test_get_element_ptr"], "tokens": 252}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestFunctionEmitterVisitor(unittest.TestCase):\n\n def test_load_mem(self) -> None:\n self.assert_emit(LoadMem(bool_rprimitive, self.ptr),\n \"\"\"cpy_r_r0 = *(char *)cpy_r_ptr;\"\"\")\n\n def test_set_mem(self) -> None:\n self.assert_emit(SetMem(bool_rprimitive, self.ptr, self.b),\n \"\"\"*(char *)cpy_r_ptr = cpy_r_b;\"\"\")\n\n def test_get_element_ptr(self) -> None:\n r = RStruct(\"Foo\", [\"b\", \"i32\", \"i64\"], [bool_rprimitive,\n int32_rprimitive, int64_rprimitive])\n self.assert_emit(GetElementPtr(self.o, r, \"b\"),\n \"\"\"cpy_r_r0 = (CPyPtr)&((Foo *)cpy_r_o)->b;\"\"\")\n self.assert_emit(GetElementPtr(self.o, r, \"i32\"),\n \"\"\"cpy_r_r0 = (CPyPtr)&((Foo *)cpy_r_o)->i32;\"\"\")\n self.assert_emit(GetElementPtr(self.o, r, \"i64\"),\n \"\"\"cpy_r_r0 = (CPyPtr)&((Foo *)cpy_r_o)->i64;\"\"\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor.test_load_address_TestFunctionEmitterVisitor.test_long_unsigned.None_1": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_emitfunc.py_TestFunctionEmitterVisitor.test_load_address_TestFunctionEmitterVisitor.test_long_unsigned.None_1", "embedding": null, "metadata": {"file_path": "mypyc/test/test_emitfunc.py", "file_name": "test_emitfunc.py", "file_type": "text/x-python", "category": "test", "start_line": 362, "end_line": 378, "span_ids": ["TestFunctionEmitterVisitor.test_load_address", "TestFunctionEmitterVisitor.test_assign_multi", "TestFunctionEmitterVisitor.test_long_unsigned"], "tokens": 226}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TestFunctionEmitterVisitor(unittest.TestCase):\n\n def test_load_address(self) -> None:\n self.assert_emit(LoadAddress(object_rprimitive, \"PyDict_Type\"),\n \"\"\"cpy_r_r0 = (PyObject *)&PyDict_Type;\"\"\")\n\n def test_assign_multi(self) -> None:\n t = RArray(object_rprimitive, 2)\n a = Register(t, 'a')\n self.registers.append(a)\n self.assert_emit(AssignMulti(a, [self.o, self.o2]),\n \"\"\"PyObject *cpy_r_a[2] = {cpy_r_o, cpy_r_o2};\"\"\")\n\n def test_long_unsigned(self) -> None:\n a = Register(int64_rprimitive, 'a')\n self.assert_emit(Assign(a, Integer(1 << 31, int64_rprimitive)),\n \"\"\"cpy_r_a = 2147483648U;\"\"\")\n self.assert_emit(Assign(a, Integer((1 << 31) - 1, int64_rprimitive)),\n \"\"\"cpy_r_a = 2147483647;\"\"\")", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_rarray.py__Unit_tests_for_RArray__": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/test_rarray.py__Unit_tests_for_RArray__", "embedding": null, "metadata": {"file_path": "mypyc/test/test_rarray.py", "file_name": "test_rarray.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 43, "span_ids": ["TestRArray.test_alignment", "TestRArray.test_hash", "TestRArray.test_size", "TestRArray.test_str_conversion", "TestRArray.test_eq", "docstring", "TestRArray", "TestRArray.test_basics"], "tokens": 382}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Unit tests for RArray types.\"\"\"\n\nimport unittest\n\nfrom mypyc.common import PLATFORM_SIZE\nfrom mypyc.ir.rtypes import (\n RArray, int_rprimitive, bool_rprimitive, compute_rtype_alignment, compute_rtype_size\n)\n\n\nclass TestRArray(unittest.TestCase):\n def test_basics(self) -> None:\n a = RArray(int_rprimitive, 10)\n assert a.item_type == int_rprimitive\n assert a.length == 10\n\n def test_str_conversion(self) -> None:\n a = RArray(int_rprimitive, 10)\n assert str(a) == 'int[10]'\n assert repr(a) == '[10]>'\n\n def test_eq(self) -> None:\n a = RArray(int_rprimitive, 10)\n assert a == RArray(int_rprimitive, 10)\n assert a != RArray(bool_rprimitive, 10)\n assert a != RArray(int_rprimitive, 9)\n\n def test_hash(self) -> None:\n assert hash(RArray(int_rprimitive, 10)) == hash(RArray(int_rprimitive, 10))\n assert hash(RArray(bool_rprimitive, 5)) == hash(RArray(bool_rprimitive, 5))\n\n def test_alignment(self) -> None:\n a = RArray(int_rprimitive, 10)\n assert compute_rtype_alignment(a) == PLATFORM_SIZE\n b = RArray(bool_rprimitive, 55)\n assert compute_rtype_alignment(b) == 1\n\n def test_size(self) -> None:\n a = RArray(int_rprimitive, 9)\n assert compute_rtype_size(a) == 9 * PLATFORM_SIZE\n b = RArray(bool_rprimitive, 3)\n assert compute_rtype_size(b) == 3", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/testutil.py_replace_word_size_replace_word_size.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/testutil.py_replace_word_size_replace_word_size.return.result", "embedding": null, "metadata": {"file_path": "mypyc/test/testutil.py", "file_name": "testutil.py", "file_type": "text/x-python", "category": "test", "start_line": 224, "end_line": 237, "span_ids": ["replace_word_size"], "tokens": 116}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def replace_word_size(text: List[str]) -> List[str]:\n \"\"\"Replace WORDSIZE with platform specific word sizes\"\"\"\n result = []\n for line in text:\n index = line.find('WORD_SIZE')\n if index != -1:\n # get 'WORDSIZE*n' token\n word_size_token = line[index:].split()[0]\n n = int(word_size_token[10:])\n replace_str = str(PLATFORM_SIZE * n)\n result.append(line.replace(word_size_token, replace_str))\n else:\n result.append(line)\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/testutil.py_infer_ir_build_options_from_test_name_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test/testutil.py_infer_ir_build_options_from_test_name_", "embedding": null, "metadata": {"file_path": "mypyc/test/testutil.py", "file_name": "testutil.py", "file_type": "text/x-python", "category": "test", "start_line": 240, "end_line": 270, "span_ids": ["infer_ir_build_options_from_test_name"], "tokens": 326}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def infer_ir_build_options_from_test_name(name: str) -> Optional[CompilerOptions]:\n \"\"\"Look for magic substrings in test case name to set compiler options.\n\n Return None if the test case should be skipped (always pass).\n\n Supported naming conventions:\n\n *_64bit*:\n Run test case only on 64-bit platforms\n *_32bit*:\n Run test caseonly on 32-bit platforms\n *_python3_8* (or for any Python version):\n Use Python 3.8+ C API features (default: lowest supported version)\n *StripAssert*:\n Don't generate code for assert statements\n \"\"\"\n # If this is specific to some bit width, always pass if platform doesn't match.\n if '_64bit' in name and IS_32_BIT_PLATFORM:\n return None\n if '_32bit' in name and not IS_32_BIT_PLATFORM:\n return None\n options = CompilerOptions(strip_asserts='StripAssert' in name,\n capi_version=(3, 5))\n # A suffix like _python3.8 is used to set the target C API version.\n m = re.search(r'_python([3-9]+)_([0-9]+)(_|\\b)', name)\n if m:\n options.capi_version = (int(m.group(1)), int(m.group(2)))\n elif '_py' in name or '_Python' in name:\n assert False, 'Invalid _py* suffix (should be _pythonX_Y): {}'.format(name)\n return options", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/reachability.py__Utilities_related_to_d_reverse_op._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/reachability.py__Utilities_related_to_d_reverse_op._", "embedding": null, "metadata": {"file_path": "mypy/reachability.py", "file_name": "reachability.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 36, "span_ids": ["docstring"], "tokens": 324}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Utilities related to determining the reachability of code (in semantic analysis).\"\"\"\n\nfrom typing import Tuple, TypeVar, Union, Optional\nfrom typing_extensions import Final\n\nfrom mypy.nodes import (\n Expression, IfStmt, Block, AssertStmt, NameExpr, UnaryExpr, MemberExpr, OpExpr, ComparisonExpr,\n StrExpr, UnicodeExpr, CallExpr, IntExpr, TupleExpr, IndexExpr, SliceExpr, Import, ImportFrom,\n ImportAll, LITERAL_YES\n)\nfrom mypy.options import Options\nfrom mypy.traverser import TraverserVisitor\nfrom mypy.literals import literal\n\n# Inferred truth value of an expression.\nALWAYS_TRUE = 1 # type: Final\nMYPY_TRUE = 2 # type: Final # True in mypy, False at runtime\nALWAYS_FALSE = 3 # type: Final\nMYPY_FALSE = 4 # type: Final # False in mypy, True at runtime\nTRUTH_VALUE_UNKNOWN = 5 # type: Final\n\ninverted_truth_mapping = {\n ALWAYS_TRUE: ALWAYS_FALSE,\n ALWAYS_FALSE: ALWAYS_TRUE,\n TRUTH_VALUE_UNKNOWN: TRUTH_VALUE_UNKNOWN,\n MYPY_TRUE: MYPY_FALSE,\n MYPY_FALSE: MYPY_TRUE,\n} # type: Final\n\nreverse_op = {\"==\": \"==\",\n \"!=\": \"!=\",\n \"<\": \">\",\n \">\": \"<\",\n \"<=\": \">=\",\n \">=\": \"<=\",\n }", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/reachability.py_None_8_assert_will_always_fail.return.infer_condition_value_s_e": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/reachability.py_None_8_assert_will_always_fail.return.infer_condition_value_s_e", "embedding": null, "metadata": {"file_path": "mypy/reachability.py", "file_name": "reachability.py", "file_type": "text/x-python", "category": "implementation", "start_line": 36, "end_line": 66, "span_ids": ["infer_reachability_of_if_statement", "assert_will_always_fail", "docstring"], "tokens": 293}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": " # type: Final\n\n\ndef infer_reachability_of_if_statement(s: IfStmt, options: Options) -> None:\n for i in range(len(s.expr)):\n result = infer_condition_value(s.expr[i], options)\n if result in (ALWAYS_FALSE, MYPY_FALSE):\n # The condition is considered always false, so we skip the if/elif body.\n mark_block_unreachable(s.body[i])\n elif result in (ALWAYS_TRUE, MYPY_TRUE):\n # This condition is considered always true, so all of the remaining\n # elif/else bodies should not be checked.\n if result == MYPY_TRUE:\n # This condition is false at runtime; this will affect\n # import priorities.\n mark_block_mypy_only(s.body[i])\n for body in s.body[i + 1:]:\n mark_block_unreachable(body)\n\n # Make sure else body always exists and is marked as\n # unreachable so the type checker always knows that\n # all control flow paths will flow through the if\n # statement body.\n if not s.else_body:\n s.else_body = Block([])\n mark_block_unreachable(s.else_body)\n break\n\n\ndef assert_will_always_fail(s: AssertStmt, options: Options) -> bool:\n return infer_condition_value(s.expr, options) in (ALWAYS_FALSE, MYPY_FALSE)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.find_type_equals_check_TypeChecker.find_type_equals_check.return.if_map_else_map": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/checker.py_TypeChecker.find_type_equals_check_TypeChecker.find_type_equals_check.return.if_map_else_map", "embedding": null, "metadata": {"file_path": "mypy/checker.py", "file_name": "checker.py", "file_type": "text/x-python", "category": "implementation", "start_line": 3960, "end_line": 4034, "span_ids": ["TypeChecker.find_type_equals_check"], "tokens": 712}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class TypeChecker(NodeVisitor[None], CheckerPluginInterface):\n\n def find_type_equals_check(self, node: ComparisonExpr, expr_indices: List[int]\n ) -> Tuple[TypeMap, TypeMap]:\n \"\"\"Narrow types based on any checks of the type ``type(x) == T``\n\n Args:\n node: The node that might contain the comparison\n expr_indices: The list of indices of expressions in ``node`` that are being\n compared\n \"\"\"\n type_map = self.type_map\n\n def is_type_call(expr: CallExpr) -> bool:\n \"\"\"Is expr a call to type with one argument?\"\"\"\n return (refers_to_fullname(expr.callee, 'builtins.type')\n and len(expr.args) == 1)\n # exprs that are being passed into type\n exprs_in_type_calls = [] # type: List[Expression]\n # type that is being compared to type(expr)\n type_being_compared = None # type: Optional[List[TypeRange]]\n # whether the type being compared to is final\n is_final = False\n\n for index in expr_indices:\n expr = node.operands[index]\n\n if isinstance(expr, CallExpr) and is_type_call(expr):\n exprs_in_type_calls.append(expr.args[0])\n else:\n current_type = get_isinstance_type(expr, type_map)\n if current_type is None:\n continue\n if type_being_compared is not None:\n # It doesn't really make sense to have several types being\n # compared to the output of type (like type(x) == int == str)\n # because whether that's true is solely dependent on what the\n # types being compared are, so we don't try to narrow types any\n # further because we can't really get any information about the\n # type of x from that check\n return {}, {}\n else:\n if isinstance(expr, RefExpr) and isinstance(expr.node, TypeInfo):\n is_final = expr.node.is_final\n type_being_compared = current_type\n\n if not exprs_in_type_calls:\n return {}, {}\n\n if_maps = [] # type: List[TypeMap]\n else_maps = [] # type: List[TypeMap]\n for expr in exprs_in_type_calls:\n current_if_map, current_else_map = self.conditional_type_map_with_intersection(\n expr,\n type_map[expr],\n type_being_compared\n )\n if_maps.append(current_if_map)\n else_maps.append(current_else_map)\n\n def combine_maps(list_maps: List[TypeMap]) -> TypeMap:\n \"\"\"Combine all typemaps in list_maps into one typemap\"\"\"\n result_map = {}\n for d in list_maps:\n if d is not None:\n result_map.update(d)\n return result_map\n if_map = combine_maps(if_maps)\n # type(x) == T is only true when x has the same type as T, meaning\n # that it can be false if x is an instance of a subclass of T. That means\n # we can't do any narrowing in the else case unless T is final, in which\n # case T can't be subclassed\n if is_final:\n else_map = combine_maps(else_maps)\n else:\n else_map = {}\n return if_map, else_map", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_make_inferred_type_note_make_inferred_type_note.return._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_make_inferred_type_note_make_inferred_type_note.return._", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2096, "end_line": 2124, "span_ids": ["make_inferred_type_note"], "tokens": 294}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def make_inferred_type_note(context: Context,\n subtype: Type,\n supertype: Type,\n supertype_str: str) -> str:\n \"\"\"Explain that the user may have forgotten to type a variable.\n\n The user does not expect an error if the inferred container type is the same as the return\n type of a function and the argument type(s) are a subtype of the argument type(s) of the\n return type. This note suggests that they add a type annotation with the return type instead\n of relying on the inferred type.\n \"\"\"\n subtype = get_proper_type(subtype)\n supertype = get_proper_type(supertype)\n if (isinstance(subtype, Instance) and\n isinstance(supertype, Instance) and\n subtype.type.fullname == supertype.type.fullname and\n subtype.args and\n supertype.args and\n isinstance(context, ReturnStmt) and\n isinstance(context.expr, NameExpr) and\n isinstance(context.expr.node, Var) and\n context.expr.node.is_inferred):\n for subtype_arg, supertype_arg in zip(subtype.args, supertype.args):\n if not is_subtype(subtype_arg, supertype_arg):\n return ''\n var_name = context.expr.name\n return 'Perhaps you need a type annotation for \"{}\"? Suggestion: {}'.format(\n var_name, supertype_str)\n return ''", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_format_key_list_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/messages.py_format_key_list_", "embedding": null, "metadata": {"file_path": "mypy/messages.py", "file_name": "messages.py", "file_type": "text/x-python", "category": "implementation", "start_line": 2127, "end_line": 2136, "span_ids": ["format_key_list"], "tokens": 108}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def format_key_list(keys: List[str], *, short: bool = False) -> str:\n formatted_keys = ['\"{}\"'.format(key) for key in keys]\n td = '' if short else 'TypedDict '\n if len(keys) == 0:\n return 'no {}keys'.format(td)\n elif len(keys) == 1:\n return '{}key {}'.format(td, formatted_keys[0])\n else:\n return '{}keys ({})'.format(td, ', '.join(formatted_keys))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/dataclasses.py_DataclassTransformer._freeze_DataclassTransformer._freeze.for_attr_in_attributes_.if_sym_node_is_not_None_.else_.info_names_var_name_Sy": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/dataclasses.py_DataclassTransformer._freeze_DataclassTransformer._freeze.for_attr_in_attributes_.if_sym_node_is_not_None_.else_.info_names_var_name_Sy", "embedding": null, "metadata": {"file_path": "mypy/plugins/dataclasses.py", "file_name": "dataclasses.py", "file_type": "text/x-python", "category": "implementation", "start_line": 343, "end_line": 359, "span_ids": ["DataclassTransformer._freeze"], "tokens": 149}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DataclassTransformer:\n\n def _freeze(self, attributes: List[DataclassAttribute]) -> None:\n \"\"\"Converts all attributes to @property methods in order to\n emulate frozen classes.\n \"\"\"\n info = self._ctx.cls.info\n for attr in attributes:\n sym_node = info.names.get(attr.name)\n if sym_node is not None:\n var = sym_node.node\n assert isinstance(var, Var)\n var.is_property = True\n else:\n var = attr.to_var()\n var.info = info\n var.is_property = True\n var._fullname = info.fullname + '.' + var.name\n info.names[var.name] = SymbolTableNode(MDEF, var)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/dataclasses.py_DataclassTransformer._propertize_callables_DataclassTransformer._propertize_callables.for_attr_in_attributes_.if_isinstance_get_proper_.info_names_var_name_Sy": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/dataclasses.py_DataclassTransformer._propertize_callables_DataclassTransformer._propertize_callables.for_attr_in_attributes_.if_isinstance_get_proper_.info_names_var_name_Sy", "embedding": null, "metadata": {"file_path": "mypy/plugins/dataclasses.py", "file_name": "dataclasses.py", "file_type": "text/x-python", "category": "implementation", "start_line": 361, "end_line": 377, "span_ids": ["DataclassTransformer._propertize_callables"], "tokens": 167}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class DataclassTransformer:\n\n def _propertize_callables(self, attributes: List[DataclassAttribute]) -> None:\n \"\"\"Converts all attributes with callable types to @property methods.\n\n This avoids the typechecker getting confused and thinking that\n `my_dataclass_instance.callable_attr(foo)` is going to receive a\n `self` argument (it is not).\n\n \"\"\"\n info = self._ctx.cls.info\n for attr in attributes:\n if isinstance(get_proper_type(attr.type), CallableType):\n var = attr.to_var()\n var.info = info\n var.is_property = True\n var.is_settable_property = True\n var._fullname = info.fullname + '.' + var.name\n info.names[var.name] = SymbolTableNode(MDEF, var)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/dataclasses.py_dataclass_class_maker_callback_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/dataclasses.py_dataclass_class_maker_callback_", "embedding": null, "metadata": {"file_path": "mypy/plugins/dataclasses.py", "file_name": "dataclasses.py", "file_type": "text/x-python", "category": "implementation", "start_line": 380, "end_line": 404, "span_ids": ["dataclass_class_maker_callback", "_collect_field_args"], "tokens": 198}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def dataclass_class_maker_callback(ctx: ClassDefContext) -> None:\n \"\"\"Hooks into the class typechecking process to add support for dataclasses.\n \"\"\"\n transformer = DataclassTransformer(ctx)\n transformer.transform()\n\n\ndef _collect_field_args(expr: Expression) -> Tuple[bool, Dict[str, Expression]]:\n \"\"\"Returns a tuple where the first value represents whether or not\n the expression is a call to dataclass.field and the second is a\n dictionary of the keyword arguments that field() was called with.\n \"\"\"\n if (\n isinstance(expr, CallExpr) and\n isinstance(expr.callee, RefExpr) and\n expr.callee.fullname == 'dataclasses.field'\n ):\n # field() only takes keyword arguments.\n args = {}\n for name, arg in zip(expr.arg_names, expr.args):\n assert name is not None\n args[name] = arg\n return True, args\n return False, {}", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/functools.py__Plugin_for_supporting___MethodInfo.NamedTuple__MethodInfo_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/functools.py__Plugin_for_supporting___MethodInfo.NamedTuple__MethodInfo_", "embedding": null, "metadata": {"file_path": "mypy/plugins/functools.py", "file_name": "functools.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 22, "span_ids": ["docstring"], "tokens": 150}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Plugin for supporting the functools standard library module.\"\"\"\nfrom typing import Dict, NamedTuple, Optional\n\nimport mypy.plugin\nfrom mypy.nodes import ARG_OPT, ARG_POS, ARG_STAR2, Argument, FuncItem, Var\nfrom mypy.plugins.common import add_method_to_class\nfrom mypy.types import AnyType, CallableType, get_proper_type, Type, TypeOfAny, UnboundType\n\n\nfunctools_total_ordering_makers = {\n 'functools.total_ordering',\n}\n\n_ORDERING_METHODS = {\n '__lt__',\n '__le__',\n '__gt__',\n '__ge__',\n}\n\n\n_MethodInfo = NamedTuple('_MethodInfo', [('is_static', bool), ('type', CallableType)])", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/functools.py_functools_total_ordering_maker_callback_functools_total_ordering_maker_callback.for_additional_op_in__ORD.if_not_comparison_methods.add_method_to_class_ctx_a": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/functools.py_functools_total_ordering_maker_callback_functools_total_ordering_maker_callback.for_additional_op_in__ORD.if_not_comparison_methods.add_method_to_class_ctx_a", "embedding": null, "metadata": {"file_path": "mypy/plugins/functools.py", "file_name": "functools.py", "file_type": "text/x-python", "category": "implementation", "start_line": 25, "end_line": 59, "span_ids": ["functools_total_ordering_maker_callback"], "tokens": 393}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def functools_total_ordering_maker_callback(ctx: mypy.plugin.ClassDefContext,\n auto_attribs_default: bool = False) -> None:\n \"\"\"Add dunder methods to classes decorated with functools.total_ordering.\"\"\"\n if ctx.api.options.python_version < (3,):\n # This plugin is not supported in Python 2 mode (it's a no-op).\n return\n\n comparison_methods = _analyze_class(ctx)\n if not comparison_methods:\n ctx.api.fail(\n 'No ordering operation defined when using \"functools.total_ordering\": < > <= >=',\n ctx.reason)\n return\n\n # prefer __lt__ to __le__ to __gt__ to __ge__\n root = max(comparison_methods, key=lambda k: (comparison_methods[k] is None, k))\n root_method = comparison_methods[root]\n if not root_method:\n # None of the defined comparison methods can be analysed\n return\n\n other_type = _find_other_type(root_method)\n bool_type = ctx.api.named_type('__builtins__.bool')\n ret_type = bool_type # type: Type\n if root_method.type.ret_type != ctx.api.named_type('__builtins__.bool'):\n proper_ret_type = get_proper_type(root_method.type.ret_type)\n if not (isinstance(proper_ret_type, UnboundType)\n and proper_ret_type.name.split('.')[-1] == 'bool'):\n ret_type = AnyType(TypeOfAny.implementation_artifact)\n for additional_op in _ORDERING_METHODS:\n # Either the method is not implemented\n # or has an unknown signature that we can now extrapolate.\n if not comparison_methods.get(additional_op):\n args = [Argument(Var('other', other_type), other_type, None, ARG_POS)]\n add_method_to_class(ctx.api, ctx.cls, additional_op, args, ret_type)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/functools.py__find_other_type__find_other_type.return.other_arg": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/functools.py__find_other_type__find_other_type.return.other_arg", "embedding": null, "metadata": {"file_path": "mypy/plugins/functools.py", "file_name": "functools.py", "file_type": "text/x-python", "category": "implementation", "start_line": 62, "end_line": 81, "span_ids": ["_find_other_type"], "tokens": 160}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _find_other_type(method: _MethodInfo) -> Type:\n \"\"\"Find the type of the ``other`` argument in a comparison method.\"\"\"\n first_arg_pos = 0 if method.is_static else 1\n cur_pos_arg = 0\n other_arg = None\n for arg_kind, arg_type in zip(method.type.arg_kinds, method.type.arg_types):\n if arg_kind in (ARG_POS, ARG_OPT):\n if cur_pos_arg == first_arg_pos:\n other_arg = arg_type\n break\n\n cur_pos_arg += 1\n elif arg_kind != ARG_STAR2:\n other_arg = arg_type\n break\n\n if other_arg is None:\n return AnyType(TypeOfAny.implementation_artifact)\n\n return other_arg", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/functools.py__analyze_class_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/functools.py__analyze_class_", "embedding": null, "metadata": {"file_path": "mypy/plugins/functools.py", "file_name": "functools.py", "file_type": "text/x-python", "category": "implementation", "start_line": 84, "end_line": 106, "span_ids": ["_analyze_class"], "tokens": 218}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _analyze_class(ctx: mypy.plugin.ClassDefContext) -> Dict[str, Optional[_MethodInfo]]:\n \"\"\"Analyze the class body, its parents, and return the comparison methods found.\"\"\"\n # Traverse the MRO and collect ordering methods.\n comparison_methods = {} # type: Dict[str, Optional[_MethodInfo]]\n # Skip object because total_ordering does not use methods from object\n for cls in ctx.cls.info.mro[:-1]:\n for name in _ORDERING_METHODS:\n if name in cls.names and name not in comparison_methods:\n node = cls.names[name].node\n if isinstance(node, FuncItem) and isinstance(node.type, CallableType):\n comparison_methods[name] = _MethodInfo(node.is_static, node.type)\n continue\n\n if isinstance(node, Var):\n proper_type = get_proper_type(node.type)\n if isinstance(proper_type, CallableType):\n comparison_methods[name] = _MethodInfo(node.is_staticmethod, proper_type)\n continue\n\n comparison_methods[name] = None\n\n return comparison_methods", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_is_protocol_implementation_is_protocol_implementation.for_l_r_in_reversed_as.if_mypy_sametypes_is_sam.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_is_protocol_implementation_is_protocol_implementation.for_l_r_in_reversed_as.if_mypy_sametypes_is_sam.return.True", "embedding": null, "metadata": {"file_path": "mypy/subtypes.py", "file_name": "subtypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 503, "end_line": 537, "span_ids": ["is_protocol_implementation"], "tokens": 386}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_protocol_implementation(left: Instance, right: Instance,\n proper_subtype: bool = False) -> bool:\n \"\"\"Check whether 'left' implements the protocol 'right'.\n\n If 'proper_subtype' is True, then check for a proper subtype.\n Treat recursive protocols by using the 'assuming' structural subtype matrix\n (in sparse representation, i.e. as a list of pairs (subtype, supertype)),\n see also comment in nodes.TypeInfo. When we enter a check for classes\n (A, P), defined as following::\n\n class P(Protocol):\n def f(self) -> P: ...\n class A:\n def f(self) -> A: ...\n\n this results in A being a subtype of P without infinite recursion.\n On every false result, we pop the assumption, thus avoiding an infinite recursion\n as well.\n \"\"\"\n assert right.type.is_protocol\n # We need to record this check to generate protocol fine-grained dependencies.\n TypeState.record_protocol_subtype_check(left.type, right.type)\n # nominal subtyping currently ignores '__init__' and '__new__' signatures\n members_not_to_check = {'__init__', '__new__'}\n # Trivial check that circumvents the bug described in issue 9771:\n if left.type.is_protocol:\n members_right = set(right.type.protocol_members) - members_not_to_check\n members_left = set(left.type.protocol_members) - members_not_to_check\n if not members_right.issubset(members_left):\n return False\n assuming = right.type.assuming_proper if proper_subtype else right.type.assuming\n for (l, r) in reversed(assuming):\n if (mypy.sametypes.is_same_type(l, left)\n and mypy.sametypes.is_same_type(r, right)):\n return True\n # ... other code", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_is_protocol_implementation.with_pop_on_exit_assuming_is_protocol_implementation.return.True": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/subtypes.py_is_protocol_implementation.with_pop_on_exit_assuming_is_protocol_implementation.return.True", "embedding": null, "metadata": {"file_path": "mypy/subtypes.py", "file_name": "subtypes.py", "file_type": "text/x-python", "category": "implementation", "start_line": 538, "end_line": 590, "span_ids": ["is_protocol_implementation"], "tokens": 611}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def is_protocol_implementation(left: Instance, right: Instance,\n proper_subtype: bool = False) -> bool:\n # ... other code\n with pop_on_exit(assuming, left, right):\n for member in right.type.protocol_members:\n if member in members_not_to_check:\n continue\n ignore_names = member != '__call__' # __call__ can be passed kwargs\n # The third argument below indicates to what self type is bound.\n # We always bind self to the subtype. (Similarly to nominal types).\n supertype = get_proper_type(find_member(member, right, left))\n assert supertype is not None\n subtype = get_proper_type(find_member(member, left, left))\n # Useful for debugging:\n # print(member, 'of', left, 'has type', subtype)\n # print(member, 'of', right, 'has type', supertype)\n if not subtype:\n return False\n if isinstance(subtype, PartialType):\n subtype = NoneType() if subtype.type is None else Instance(\n subtype.type, [AnyType(TypeOfAny.unannotated)] * len(subtype.type.type_vars)\n )\n if not proper_subtype:\n # Nominal check currently ignores arg names\n # NOTE: If we ever change this, be sure to also change the call to\n # SubtypeVisitor.build_subtype_kind(...) down below.\n is_compat = is_subtype(subtype, supertype, ignore_pos_arg_names=ignore_names)\n else:\n is_compat = is_proper_subtype(subtype, supertype)\n if not is_compat:\n return False\n if isinstance(subtype, NoneType) and isinstance(supertype, CallableType):\n # We want __hash__ = None idiom to work even without --strict-optional\n return False\n subflags = get_member_flags(member, left.type)\n superflags = get_member_flags(member, right.type)\n if IS_SETTABLE in superflags:\n # Check opposite direction for settable attributes.\n if not is_subtype(supertype, subtype):\n return False\n if (IS_CLASSVAR in subflags) != (IS_CLASSVAR in superflags):\n return False\n if IS_SETTABLE in superflags and IS_SETTABLE not in subflags:\n return False\n # This rule is copied from nominal check in checker.py\n if IS_CLASS_OR_STATIC in superflags and IS_CLASS_OR_STATIC not in subflags:\n return False\n\n if not proper_subtype:\n # Nominal check currently ignores arg names, but __call__ is special for protocols\n ignore_names = right.type.protocol_members != ['__call__']\n subtype_kind = SubtypeVisitor.build_subtype_kind(ignore_pos_arg_names=ignore_names)\n else:\n subtype_kind = ProperSubtypeVisitor.build_subtype_kind()\n TypeState.record_subtype_cache_entry(subtype_kind, left, right)\n return True", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testcheck.py__Type_checker_test_case_if_sys_version_info_3.typecheck_files_append_c": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testcheck.py__Type_checker_test_case_if_sys_version_info_3.typecheck_files_append_c", "embedding": null, "metadata": {"file_path": "mypy/test/testcheck.py", "file_name": "testcheck.py", "file_type": "text/x-python", "category": "test", "start_line": 1, "end_line": 102, "span_ids": ["docstring:3", "docstring"], "tokens": 744}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Type checker test cases\"\"\"\n\nimport os\nimport re\nimport shutil\nimport sys\n\nfrom typing import Dict, List, Set, Tuple\n\nfrom mypy import build\nfrom mypy.build import Graph\nfrom mypy.modulefinder import BuildSource, SearchPaths, FindModuleCache\nfrom mypy.test.config import test_temp_dir, test_data_prefix\nfrom mypy.test.data import (\n DataDrivenTestCase, DataSuite, FileOperation, UpdateFile, module_from_path\n)\nfrom mypy.test.helpers import (\n assert_string_arrays_equal, normalize_error_messages, assert_module_equivalence,\n retry_on_error, update_testcase_output, parse_options,\n copy_and_fudge_mtime, assert_target_equivalence, check_test_output_files\n)\nfrom mypy.errors import CompileError\nfrom mypy.semanal_main import core_modules\n\n\n# List of files that contain test case descriptions.\ntypecheck_files = [\n 'check-basic.test',\n 'check-union-or-syntax.test',\n 'check-callable.test',\n 'check-classes.test',\n 'check-statements.test',\n 'check-generics.test',\n 'check-dynamic-typing.test',\n 'check-inference.test',\n 'check-inference-context.test',\n 'check-kwargs.test',\n 'check-overloading.test',\n 'check-type-checks.test',\n 'check-abstract.test',\n 'check-multiple-inheritance.test',\n 'check-super.test',\n 'check-modules.test',\n 'check-typevar-values.test',\n 'check-unsupported.test',\n 'check-unreachable-code.test',\n 'check-unions.test',\n 'check-isinstance.test',\n 'check-lists.test',\n 'check-namedtuple.test',\n 'check-narrowing.test',\n 'check-typeddict.test',\n 'check-type-aliases.test',\n 'check-ignore.test',\n 'check-type-promotion.test',\n 'check-semanal-error.test',\n 'check-flags.test',\n 'check-incremental.test',\n 'check-serialize.test',\n 'check-bound.test',\n 'check-optional.test',\n 'check-fastparse.test',\n 'check-warnings.test',\n 'check-async-await.test',\n 'check-newtype.test',\n 'check-class-namedtuple.test',\n 'check-selftype.test',\n 'check-python2.test',\n 'check-columns.test',\n 'check-functions.test',\n 'check-tuples.test',\n 'check-expressions.test',\n 'check-generic-subtyping.test',\n 'check-varargs.test',\n 'check-newsyntax.test',\n 'check-protocols.test',\n 'check-underscores.test',\n 'check-classvar.test',\n 'check-enum.test',\n 'check-incomplete-fixture.test',\n 'check-custom-plugin.test',\n 'check-default-plugin.test',\n 'check-attr.test',\n 'check-ctypes.test',\n 'check-dataclasses.test',\n 'check-final.test',\n 'check-redefine.test',\n 'check-literal.test',\n 'check-newsemanal.test',\n 'check-inline-config.test',\n 'check-reports.test',\n 'check-errorcodes.test',\n 'check-annotated.test',\n 'check-parameter-specification.test',\n 'check-generic-alias.test',\n 'check-typeguard.test',\n 'check-functools.test',\n]\n\n# Tests that use Python 3.8-only AST features (like expression-scoped ignores):\nif sys.version_info >= (3, 8):\n typecheck_files.append('check-python38.test')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testcheck.py_None_1_TypeCheckSuite.run_case.if_incremental_.else_.self_run_case_once_testca": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/testcheck.py_None_1_TypeCheckSuite.run_case.if_incremental_.else_.self_run_case_once_testca", "embedding": null, "metadata": {"file_path": "mypy/test/testcheck.py", "file_name": "testcheck.py", "file_type": "text/x-python", "category": "test", "start_line": 103, "end_line": 136, "span_ids": ["TypeCheckSuite.run_case", "TypeCheckSuite", "docstring:3"], "tokens": 341}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "if sys.version_info >= (3, 9):\n typecheck_files.append('check-python39.test')\n\n# Special tests for platforms with case-insensitive filesystems.\nif sys.platform in ('darwin', 'win32'):\n typecheck_files.append('check-modules-case.test')\n\n\nclass TypeCheckSuite(DataSuite):\n files = typecheck_files\n\n def run_case(self, testcase: DataDrivenTestCase) -> None:\n incremental = ('incremental' in testcase.name.lower()\n or 'incremental' in testcase.file\n or 'serialize' in testcase.file)\n if incremental:\n # Incremental tests are run once with a cold cache, once with a warm cache.\n # Expect success on first run, errors from testcase.output (if any) on second run.\n num_steps = max([2] + list(testcase.output2.keys()))\n # Check that there are no file changes beyond the last run (they would be ignored).\n for dn, dirs, files in os.walk(os.curdir):\n for file in files:\n m = re.search(r'\\.([2-9])$', file)\n if m and int(m.group(1)) > num_steps:\n raise ValueError(\n 'Output file {} exists though test case only has {} runs'.format(\n file, num_steps))\n steps = testcase.find_steps()\n for step in range(1, num_steps + 1):\n idx = step - 2\n ops = steps[idx] if idx < len(steps) and idx >= 0 else []\n self.run_case_once(testcase, ops, step)\n else:\n self.run_case_once(testcase)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/classdef.py_allocate_class_MAGIC_TYPED_DICT_CLASSES._": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/classdef.py_allocate_class_MAGIC_TYPED_DICT_CLASSES._", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/classdef.py", "file_name": "classdef.py", "file_type": "text/x-python", "category": "implementation", "start_line": 162, "end_line": 208, "span_ids": ["allocate_class", "impl"], "tokens": 443}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def allocate_class(builder: IRBuilder, cdef: ClassDef) -> Value:\n # OK AND NOW THE FUN PART\n base_exprs = cdef.base_type_exprs + cdef.removed_base_type_exprs\n if base_exprs:\n bases = [builder.accept(x) for x in base_exprs]\n tp_bases = builder.new_tuple(bases, cdef.line)\n else:\n tp_bases = builder.add(LoadErrorValue(object_rprimitive, is_borrowed=True))\n modname = builder.load_str(builder.module_name)\n template = builder.add(LoadStatic(object_rprimitive, cdef.name + \"_template\",\n builder.module_name, NAMESPACE_TYPE))\n # Create the class\n tp = builder.call_c(pytype_from_template_op,\n [template, tp_bases, modname], cdef.line)\n # Immediately fix up the trait vtables, before doing anything with the class.\n ir = builder.mapper.type_to_ir[cdef.info]\n if not ir.is_trait and not ir.builtin_base:\n builder.add(Call(\n FuncDecl(cdef.name + '_trait_vtable_setup',\n None, builder.module_name,\n FuncSignature([], bool_rprimitive)), [], -1))\n # Populate a '__mypyc_attrs__' field containing the list of attrs\n builder.call_c(py_setattr_op, [\n tp, builder.load_str('__mypyc_attrs__'),\n create_mypyc_attrs_tuple(builder, builder.mapper.type_to_ir[cdef.info], cdef.line)],\n cdef.line)\n\n # Save the class\n builder.add(InitStatic(tp, cdef.name, builder.module_name, NAMESPACE_TYPE))\n\n # Add it to the dict\n builder.call_c(dict_set_item_op,\n [\n builder.load_globals_dict(),\n builder.load_str(cdef.name),\n tp,\n ], cdef.line)\n\n return tp\n\n\n# Mypy uses these internally as base classes of TypedDict classes. These are\n# lies and don't have any runtime equivalent.\nMAGIC_TYPED_DICT_CLASSES = (\n 'typing._TypedDict',\n 'typing_extensions._TypedDict',\n)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/classdef.py__type_Final_Tuple_str__populate_non_ext_bases.return.builder_new_tuple_bases_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/classdef.py__type_Final_Tuple_str__populate_non_ext_bases.return.builder_new_tuple_bases_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/classdef.py", "file_name": "classdef.py", "file_type": "text/x-python", "category": "implementation", "start_line": 208, "end_line": 258, "span_ids": ["populate_non_ext_bases", "impl"], "tokens": 506}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": " # type: Final[Tuple[str, ...]]\n\n\ndef populate_non_ext_bases(builder: IRBuilder, cdef: ClassDef) -> Value:\n \"\"\"Create base class tuple of a non-extension class.\n\n The tuple is passed to the metaclass constructor.\n \"\"\"\n is_named_tuple = cdef.info.is_named_tuple\n ir = builder.mapper.type_to_ir[cdef.info]\n bases = []\n for cls in cdef.info.mro[1:]:\n if cls.fullname == 'builtins.object':\n continue\n if is_named_tuple and cls.fullname in ('typing.Sequence', 'typing.Iterable'):\n # HAX: Synthesized base classes added by mypy don't exist at runtime, so skip them.\n # This could break if they were added explicitly, though...\n continue\n # Add the current class to the base classes list of concrete subclasses\n if cls in builder.mapper.type_to_ir:\n base_ir = builder.mapper.type_to_ir[cls]\n if base_ir.children is not None:\n base_ir.children.append(ir)\n\n if cls.fullname in MAGIC_TYPED_DICT_CLASSES:\n # HAX: Mypy internally represents TypedDict classes differently from what\n # should happen at runtime. Replace with something that works.\n module = 'typing'\n if builder.options.capi_version < (3, 9):\n name = 'TypedDict'\n if builder.options.capi_version < (3, 8):\n # TypedDict was added to typing in Python 3.8.\n module = 'typing_extensions'\n else:\n # In Python 3.9 TypedDict is not a real type.\n name = '_TypedDict'\n base = builder.get_module_attr(module, name, cdef.line)\n elif is_named_tuple and cls.fullname == 'builtins.tuple':\n if builder.options.capi_version < (3, 9):\n name = 'NamedTuple'\n else:\n # This was changed in Python 3.9.\n name = '_NamedTuple'\n base = builder.get_module_attr('typing', name, cdef.line)\n else:\n base = builder.load_global_str(cls.name, cdef.line)\n bases.append(base)\n if cls.fullname in MAGIC_TYPED_DICT_CLASSES:\n # The remaining base classes are synthesized by mypy and should be ignored.\n break\n return builder.new_tuple(bases, cdef.line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_sequence_from_generator_preallocate_helper_sequence_from_generator_preallocate_helper.return.None": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/for_helpers.py_sequence_from_generator_preallocate_helper_sequence_from_generator_preallocate_helper.return.None", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/for_helpers.py", "file_name": "for_helpers.py", "file_type": "text/x-python", "category": "implementation", "start_line": 135, "end_line": 179, "span_ids": ["sequence_from_generator_preallocate_helper"], "tokens": 446}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def sequence_from_generator_preallocate_helper(\n builder: IRBuilder,\n gen: GeneratorExpr,\n empty_op_llbuilder: Callable[[Value, int], Value],\n set_item_op: CFunctionDescription) -> Optional[Value]:\n \"\"\"Generate a new tuple or list from a simple generator expression.\n\n Currently we only optimize for simplest generator expression, which means that\n there is no condition list in the generator and only one original sequence with\n one index is allowed.\n\n e.g. (1) tuple(f(x) for x in a_list/a_tuple)\n (2) list(f(x) for x in a_list/a_tuple)\n (3) [f(x) for x in a_list/a_tuple]\n RTuple as an original sequence is not supported yet.\n\n Args:\n empty_op_llbuilder: A function that can generate an empty sequence op when\n passed in length. See `new_list_op_with_length` and `new_tuple_op_with_length`\n for detailed implementation.\n set_item_op: A primitive that can modify an arbitrary position of a sequence.\n The op should have three arguments:\n - Self\n - Target position\n - New Value\n See `new_list_set_item_op` and `new_tuple_set_item_op` for detailed\n implementation.\n \"\"\"\n if len(gen.sequences) == 1 and len(gen.indices) == 1 and len(gen.condlists[0]) == 0:\n rtype = builder.node_type(gen.sequences[0])\n if is_list_rprimitive(rtype) or is_tuple_rprimitive(rtype):\n\n length = builder.builder.builtin_len(builder.accept(gen.sequences[0]),\n gen.line, use_pyssize_t=True)\n target_op = empty_op_llbuilder(length, gen.line)\n\n def set_item(item_index: Value) -> None:\n e = builder.accept(gen.left_expr)\n builder.call_c(set_item_op, [target_op, item_index, e], gen.line)\n\n for_loop_helper_with_index(builder, gen.indices[0], gen.sequences[0],\n set_item, gen.line)\n\n return target_op\n return None", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py__A_low_level_IR_build_from_mypyc_primitives_exc": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py__A_low_level_IR_build_from_mypyc_primitives_exc", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/ll_builder.py", "file_name": "ll_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 65, "span_ids": ["imports:10", "docstring"], "tokens": 742}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"A \"low-level\" IR builder class.\n\nLowLevelIRBuilder provides core abstractions we use for constructing\nIR as well as a number of higher-level ones (accessing attributes,\ncalling functions and methods, and coercing between types, for\nexample). The core principle of the low-level IR builder is that all\nof its facilities operate solely on the IR level and not the AST\nlevel---it has *no knowledge* of mypy types or expressions.\n\"\"\"\n\nfrom typing import (\n Callable, List, Tuple, Optional, Union, Sequence, cast\n)\n\nfrom typing_extensions import Final\n\nfrom mypy.nodes import ARG_POS, ARG_NAMED, ARG_STAR, ARG_STAR2, op_methods\nfrom mypy.types import AnyType, TypeOfAny\nfrom mypy.checkexpr import map_actuals_to_formals\n\nfrom mypyc.ir.ops import (\n BasicBlock, Op, Integer, Value, Register, Assign, Branch, Goto, Call, Box, Unbox, Cast,\n GetAttr, LoadStatic, MethodCall, CallC, Truncate, LoadLiteral, AssignMulti,\n RaiseStandardError, Unreachable, LoadErrorValue,\n NAMESPACE_TYPE, NAMESPACE_MODULE, NAMESPACE_STATIC, IntOp, GetElementPtr,\n LoadMem, ComparisonOp, LoadAddress, TupleGet, SetMem, KeepAlive, ERR_NEVER, ERR_FALSE\n)\nfrom mypyc.ir.rtypes import (\n RType, RUnion, RInstance, RArray, optional_value_type, int_rprimitive, float_rprimitive,\n bool_rprimitive, list_rprimitive, str_rprimitive, is_none_rprimitive, object_rprimitive,\n c_pyssize_t_rprimitive, is_short_int_rprimitive, is_tagged, PyVarObject, short_int_rprimitive,\n is_list_rprimitive, is_tuple_rprimitive, is_dict_rprimitive, is_set_rprimitive, PySetObject,\n none_rprimitive, RTuple, is_bool_rprimitive, is_str_rprimitive, c_int_rprimitive,\n pointer_rprimitive, PyObject, PyListObject, bit_rprimitive, is_bit_rprimitive,\n object_pointer_rprimitive, c_size_t_rprimitive, dict_rprimitive\n)\nfrom mypyc.ir.func_ir import FuncDecl, FuncSignature\nfrom mypyc.ir.class_ir import ClassIR, all_concrete_classes\nfrom mypyc.common import (\n FAST_ISINSTANCE_MAX_SUBCLASSES, MAX_LITERAL_SHORT_INT, PLATFORM_SIZE, use_vectorcall,\n use_method_vectorcall\n)\nfrom mypyc.primitives.registry import (\n method_call_ops, CFunctionDescription, function_ops,\n binary_ops, unary_ops, ERR_NEG_INT\n)\nfrom mypyc.primitives.list_ops import (\n list_extend_op, new_list_op\n)\nfrom mypyc.primitives.tuple_ops import (\n list_tuple_op, new_tuple_op, new_tuple_with_length_op\n)\nfrom mypyc.primitives.dict_ops import (\n dict_update_in_display_op, dict_new_op, dict_build_op, dict_size_op\n)\nfrom mypyc.primitives.generic_ops import (\n py_getattr_op, py_call_op, py_call_with_kwargs_op, py_method_call_op,\n py_vectorcall_op, py_vectorcall_method_op,\n generic_len_op, generic_ssize_t_len_op\n)\nfrom mypyc.primitives.misc_ops import (\n none_object_op, fast_isinstance_op, bool_op\n)\nfrom mypyc.primitives.int_ops import int_comparison_op_mapping\nfrom mypyc.primitives.exc_ops import err_occurred_op, keep_propagating_op", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_from_mypyc_primitives_str_PY_VECTORCALL_ARGUMENTS_OFFSET.1_PLATFORM_SIZE_8_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_from_mypyc_primitives_str_PY_VECTORCALL_ARGUMENTS_OFFSET.1_PLATFORM_SIZE_8_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/ll_builder.py", "file_name": "ll_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 66, "end_line": 79, "span_ids": ["imports:10"], "tokens": 117}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "from mypyc.primitives.str_ops import unicode_compare, str_check_if_true\nfrom mypyc.primitives.set_ops import new_set_op\nfrom mypyc.rt_subtype import is_runtime_subtype\nfrom mypyc.subtype import is_subtype\nfrom mypyc.sametype import is_same_type\nfrom mypyc.irbuild.mapper import Mapper\nfrom mypyc.options import CompilerOptions\n\n\nDictEntry = Tuple[Optional[Value], Value]\n\n\n# From CPython\nPY_VECTORCALL_ARGUMENTS_OFFSET = 1 << (PLATFORM_SIZE * 8 - 1)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py__type_Final_LowLevelIRBuilder.unbox_or_cast.if_target_type_is_unboxed.else_.return.self_add_Cast_src_target": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py__type_Final_LowLevelIRBuilder.unbox_or_cast.if_target_type_is_unboxed.else_.return.self_add_Cast_src_target", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/ll_builder.py", "file_name": "ll_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 79, "end_line": 148, "span_ids": ["LowLevelIRBuilder.activate_block", "LowLevelIRBuilder.pop_error_handler", "LowLevelIRBuilder.goto_and_activate", "LowLevelIRBuilder", "LowLevelIRBuilder.goto", "LowLevelIRBuilder.push_error_handler", "LowLevelIRBuilder.self", "LowLevelIRBuilder.box", "LowLevelIRBuilder.__init__", "LowLevelIRBuilder.unbox_or_cast", "LowLevelIRBuilder.add", "imports:10"], "tokens": 494}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": " # type: Final\n\n\nclass LowLevelIRBuilder:\n def __init__(\n self,\n current_module: str,\n mapper: Mapper,\n options: CompilerOptions,\n ) -> None:\n self.current_module = current_module\n self.mapper = mapper\n self.options = options\n self.args = [] # type: List[Register]\n self.blocks = [] # type: List[BasicBlock]\n # Stack of except handler entry blocks\n self.error_handlers = [None] # type: List[Optional[BasicBlock]]\n\n # Basic operations\n\n def add(self, op: Op) -> Value:\n \"\"\"Add an op.\"\"\"\n assert not self.blocks[-1].terminated, \"Can't add to finished block\"\n self.blocks[-1].ops.append(op)\n return op\n\n def goto(self, target: BasicBlock) -> None:\n \"\"\"Add goto to a basic block.\"\"\"\n if not self.blocks[-1].terminated:\n self.add(Goto(target))\n\n def activate_block(self, block: BasicBlock) -> None:\n \"\"\"Add a basic block and make it the active one (target of adds).\"\"\"\n if self.blocks:\n assert self.blocks[-1].terminated\n\n block.error_handler = self.error_handlers[-1]\n self.blocks.append(block)\n\n def goto_and_activate(self, block: BasicBlock) -> None:\n \"\"\"Add goto a block and make it the active block.\"\"\"\n self.goto(block)\n self.activate_block(block)\n\n def push_error_handler(self, handler: Optional[BasicBlock]) -> None:\n self.error_handlers.append(handler)\n\n def pop_error_handler(self) -> Optional[BasicBlock]:\n return self.error_handlers.pop()\n\n def self(self) -> Register:\n \"\"\"Return reference to the 'self' argument.\n\n This only works in a method.\n \"\"\"\n return self.args[0]\n\n # Type conversions\n\n def box(self, src: Value) -> Value:\n if src.type.is_unboxed:\n return self.add(Box(src))\n else:\n return src\n\n def unbox_or_cast(self, src: Value, target_type: RType, line: int) -> Value:\n if target_type.is_unboxed:\n return self.add(Unbox(src, target_type, line))\n else:\n return self.add(Cast(src, target_type, line))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.new_list_op_with_length_LowLevelIRBuilder.new_list_op_with_length.return.self_call_c_new_list_op_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/irbuild/ll_builder.py_LowLevelIRBuilder.new_list_op_with_length_LowLevelIRBuilder.new_list_op_with_length.return.self_call_c_new_list_op_", "embedding": null, "metadata": {"file_path": "mypyc/irbuild/ll_builder.py", "file_name": "ll_builder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 894, "end_line": 906, "span_ids": ["LowLevelIRBuilder.new_list_op_with_length"], "tokens": 134}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class LowLevelIRBuilder:\n\n def new_list_op_with_length(self, length: Value, line: int) -> Value:\n \"\"\"This function returns an uninitialized list.\n\n If the length is non-zero, the caller must initialize the list, before\n it can be made visible to user code -- otherwise the list object is broken.\n You might need further initialization with `new_list_set_item_op` op.\n\n Args:\n length: desired length of the new list. The rtype should be\n c_pyssize_t_rprimitive\n line: line number\n \"\"\"\n return self.call_c(new_list_op, [length], line)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/dict_ops.py__Primitive_dict_ops___dict_update_obj_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/dict_ops.py__Primitive_dict_ops___dict_update_obj_", "embedding": null, "metadata": {"file_path": "mypyc/primitives/dict_ops.py", "file_name": "dict_ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 97, "span_ids": ["docstring:11", "docstring"], "tokens": 764}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"Primitive dict ops.\"\"\"\n\nfrom mypyc.ir.ops import ERR_FALSE, ERR_MAGIC, ERR_NEVER\nfrom mypyc.ir.rtypes import (\n dict_rprimitive, object_rprimitive, bool_rprimitive, int_rprimitive,\n list_rprimitive, dict_next_rtuple_single, dict_next_rtuple_pair, c_pyssize_t_rprimitive,\n c_int_rprimitive, bit_rprimitive\n)\n\nfrom mypyc.primitives.registry import (\n custom_op, method_op, function_op, binary_op, load_address_op, ERR_NEG_INT\n)\n\n# Get the 'dict' type object.\nload_address_op(\n name='builtins.dict',\n type=object_rprimitive,\n src='PyDict_Type')\n\n# Construct an empty dictionary.\ndict_new_op = custom_op(\n arg_types=[],\n return_type=dict_rprimitive,\n c_function_name='PyDict_New',\n error_kind=ERR_MAGIC)\n\n# Construct a dictionary from keys and values.\n# Positional argument is the number of key-value pairs\n# Variable arguments are (key1, value1, ..., keyN, valueN).\ndict_build_op = custom_op(\n arg_types=[c_pyssize_t_rprimitive],\n return_type=dict_rprimitive,\n c_function_name='CPyDict_Build',\n error_kind=ERR_MAGIC,\n var_arg_type=object_rprimitive)\n\n# Construct a dictionary from another dictionary.\nfunction_op(\n name='builtins.dict',\n arg_types=[dict_rprimitive],\n return_type=dict_rprimitive,\n c_function_name='PyDict_Copy',\n error_kind=ERR_MAGIC,\n priority=2)\n\n# Generic one-argument dict constructor: dict(obj)\nfunction_op(\n name='builtins.dict',\n arg_types=[object_rprimitive],\n return_type=dict_rprimitive,\n c_function_name='CPyDict_FromAny',\n error_kind=ERR_MAGIC)\n\n# dict[key]\ndict_get_item_op = method_op(\n name='__getitem__',\n arg_types=[dict_rprimitive, object_rprimitive],\n return_type=object_rprimitive,\n c_function_name='CPyDict_GetItem',\n error_kind=ERR_MAGIC)\n\n# dict[key] = value\ndict_set_item_op = method_op(\n name='__setitem__',\n arg_types=[dict_rprimitive, object_rprimitive, object_rprimitive],\n return_type=c_int_rprimitive,\n c_function_name='CPyDict_SetItem',\n error_kind=ERR_NEG_INT)\n\n# key in dict\nbinary_op(\n name='in',\n arg_types=[object_rprimitive, dict_rprimitive],\n return_type=c_int_rprimitive,\n c_function_name='PyDict_Contains',\n error_kind=ERR_NEG_INT,\n truncated_type=bool_rprimitive,\n ordering=[1, 0])\n\n# dict1.update(dict2)\ndict_update_op = method_op(\n name='update',\n arg_types=[dict_rprimitive, dict_rprimitive],\n return_type=c_int_rprimitive,\n c_function_name='CPyDict_Update',\n error_kind=ERR_NEG_INT,\n priority=2)\n\n# Operation used for **value in dict displays.\n# This is mostly like dict.update(obj), but has customized error handling.\ndict_update_in_display_op = custom_op(\n arg_types=[dict_rprimitive, dict_rprimitive],\n return_type=c_int_rprimitive,\n c_function_name='CPyDict_UpdateInDisplay',\n error_kind=ERR_NEG_INT)\n\n# dict.update(obj)\nmethod_op(\n name='get',\n arg_types=[dict_rprimitive, object_rprimitive],\n return_type=object_rprimitive,\n c_function_name='CPyDict_GetWithNone',\n error_kind=ERR_MAGIC)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/dict_ops.py_method_op__dict_value_iter_op.custom_op_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/dict_ops.py_method_op__dict_value_iter_op.custom_op_", "embedding": null, "metadata": {"file_path": "mypyc/primitives/dict_ops.py", "file_name": "dict_ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 98, "end_line": 210, "span_ids": ["impl:22", "docstring:11"], "tokens": 741}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "# Construct a dictionary from another dictionary.\nmethod_op(\n name='update',\n arg_types=[dict_rprimitive, object_rprimitive],\n return_type=c_int_rprimitive,\n c_function_name='CPyDict_UpdateFromAny',\n error_kind=ERR_NEG_INT)\n\n# dict.get(key, default)\nmethod_op(\n name='get',\n arg_types=[dict_rprimitive, object_rprimitive, object_rprimitive],\n return_type=object_rprimitive,\n c_function_name='CPyDict_Get',\n error_kind=ERR_MAGIC)\n\n# dict.get(key)\nmethod_op(\n name='get',\n arg_types=[dict_rprimitive, object_rprimitive],\n return_type=object_rprimitive,\n c_function_name='CPyDict_GetWithNone',\n error_kind=ERR_MAGIC)\n\n# dict.setdefault(key, default)\nmethod_op(\n name='setdefault',\n arg_types=[dict_rprimitive, object_rprimitive, object_rprimitive],\n return_type=object_rprimitive,\n c_function_name='CPyDict_SetDefault',\n error_kind=ERR_MAGIC)\n\n# dict.setdefault(key)\nmethod_op(\n name='setdefault',\n arg_types=[dict_rprimitive, object_rprimitive],\n return_type=object_rprimitive,\n c_function_name='CPyDict_SetDefaultWithNone',\n is_borrowed=True,\n error_kind=ERR_MAGIC)\n\n# dict.keys()\nmethod_op(\n name='keys',\n arg_types=[dict_rprimitive],\n return_type=object_rprimitive,\n c_function_name='CPyDict_KeysView',\n error_kind=ERR_MAGIC)\n\n# dict.values()\nmethod_op(\n name='values',\n arg_types=[dict_rprimitive],\n return_type=object_rprimitive,\n c_function_name='CPyDict_ValuesView',\n error_kind=ERR_MAGIC)\n\n# dict.items()\nmethod_op(\n name='items',\n arg_types=[dict_rprimitive],\n return_type=object_rprimitive,\n c_function_name='CPyDict_ItemsView',\n error_kind=ERR_MAGIC)\n\n# dict.clear()\nmethod_op(\n name='clear',\n arg_types=[dict_rprimitive],\n return_type=bit_rprimitive,\n c_function_name='CPyDict_Clear',\n error_kind=ERR_FALSE)\n\n# dict.copy()\nmethod_op(\n name='copy',\n arg_types=[dict_rprimitive],\n return_type=dict_rprimitive,\n c_function_name='CPyDict_Copy',\n error_kind=ERR_MAGIC)\n\n# list(dict.keys())\ndict_keys_op = custom_op(\n arg_types=[dict_rprimitive],\n return_type=list_rprimitive,\n c_function_name='CPyDict_Keys',\n error_kind=ERR_MAGIC)\n\n# list(dict.values())\ndict_values_op = custom_op(\n arg_types=[dict_rprimitive],\n return_type=list_rprimitive,\n c_function_name='CPyDict_Values',\n error_kind=ERR_MAGIC)\n\n# list(dict.items())\ndict_items_op = custom_op(\n arg_types=[dict_rprimitive],\n return_type=list_rprimitive,\n c_function_name='CPyDict_Items',\n error_kind=ERR_MAGIC)\n\n# PyDict_Next() fast iteration\ndict_key_iter_op = custom_op(\n arg_types=[dict_rprimitive],\n return_type=object_rprimitive,\n c_function_name='CPyDict_GetKeysIter',\n error_kind=ERR_MAGIC)\n\ndict_value_iter_op = custom_op(\n arg_types=[dict_rprimitive],\n return_type=object_rprimitive,\n c_function_name='CPyDict_GetValuesIter',\n error_kind=ERR_MAGIC)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/dict_ops.py_dict_item_iter_op_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/dict_ops.py_dict_item_iter_op_", "embedding": null, "metadata": {"file_path": "mypyc/primitives/dict_ops.py", "file_name": "dict_ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 212, "end_line": 248, "span_ids": ["impl:22", "impl:40"], "tokens": 289}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "dict_item_iter_op = custom_op(\n arg_types=[dict_rprimitive],\n return_type=object_rprimitive,\n c_function_name='CPyDict_GetItemsIter',\n error_kind=ERR_MAGIC)\n\ndict_next_key_op = custom_op(\n arg_types=[object_rprimitive, int_rprimitive],\n return_type=dict_next_rtuple_single,\n c_function_name='CPyDict_NextKey',\n error_kind=ERR_NEVER)\n\ndict_next_value_op = custom_op(\n arg_types=[object_rprimitive, int_rprimitive],\n return_type=dict_next_rtuple_single,\n c_function_name='CPyDict_NextValue',\n error_kind=ERR_NEVER)\n\ndict_next_item_op = custom_op(\n arg_types=[object_rprimitive, int_rprimitive],\n return_type=dict_next_rtuple_pair,\n c_function_name='CPyDict_NextItem',\n error_kind=ERR_NEVER)\n\n# check that len(dict) == const during iteration\ndict_check_size_op = custom_op(\n arg_types=[dict_rprimitive, int_rprimitive],\n return_type=bit_rprimitive,\n c_function_name='CPyDict_CheckSize',\n error_kind=ERR_FALSE)\n\ndict_size_op = custom_op(\n arg_types=[dict_rprimitive],\n return_type=c_pyssize_t_rprimitive,\n c_function_name='PyDict_Size',\n error_kind=ERR_NEVER)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/list_ops.py__List_primitive_ops___list_pop_index_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/list_ops.py__List_primitive_ops___list_pop_index_", "embedding": null, "metadata": {"file_path": "mypyc/primitives/list_ops.py", "file_name": "list_ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 1, "end_line": 101, "span_ids": ["docstring:9", "docstring"], "tokens": 761}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "\"\"\"List primitive ops.\"\"\"\n\nfrom mypyc.ir.ops import ERR_MAGIC, ERR_NEVER, ERR_FALSE\nfrom mypyc.ir.rtypes import (\n int_rprimitive, short_int_rprimitive, list_rprimitive, object_rprimitive, c_int_rprimitive,\n c_pyssize_t_rprimitive, bit_rprimitive\n)\nfrom mypyc.primitives.registry import (\n load_address_op, function_op, binary_op, method_op, custom_op, ERR_NEG_INT\n)\n\n\n# Get the 'builtins.list' type object.\nload_address_op(\n name='builtins.list',\n type=object_rprimitive,\n src='PyList_Type')\n\n# list(obj)\nto_list = function_op(\n name='builtins.list',\n arg_types=[object_rprimitive],\n return_type=list_rprimitive,\n c_function_name='PySequence_List',\n error_kind=ERR_MAGIC,\n)\n\nnew_list_op = custom_op(\n arg_types=[c_pyssize_t_rprimitive],\n return_type=list_rprimitive,\n c_function_name='PyList_New',\n error_kind=ERR_MAGIC)\n\n# list[index] (for an integer index)\nlist_get_item_op = method_op(\n name='__getitem__',\n arg_types=[list_rprimitive, int_rprimitive],\n return_type=object_rprimitive,\n c_function_name='CPyList_GetItem',\n error_kind=ERR_MAGIC)\n\n# Version with no int bounds check for when it is known to be short\nmethod_op(\n name='__getitem__',\n arg_types=[list_rprimitive, short_int_rprimitive],\n return_type=object_rprimitive,\n c_function_name='CPyList_GetItemShort',\n error_kind=ERR_MAGIC,\n priority=2)\n\n# This is unsafe because it assumes that the index is a non-negative short integer\n# that is in-bounds for the list.\nlist_get_item_unsafe_op = custom_op(\n arg_types=[list_rprimitive, short_int_rprimitive],\n return_type=object_rprimitive,\n c_function_name='CPyList_GetItemUnsafe',\n error_kind=ERR_NEVER)\n\n# list[index] = obj\nlist_set_item_op = method_op(\n name='__setitem__',\n arg_types=[list_rprimitive, int_rprimitive, object_rprimitive],\n return_type=bit_rprimitive,\n c_function_name='CPyList_SetItem',\n error_kind=ERR_FALSE,\n steals=[False, False, True])\n\n# PyList_SET_ITEM does no error checking,\n# and should only be used to fill in brand new lists.\nnew_list_set_item_op = custom_op(\n arg_types=[list_rprimitive, int_rprimitive, object_rprimitive],\n return_type=bit_rprimitive,\n c_function_name='CPyList_SetItemUnsafe',\n error_kind=ERR_FALSE,\n steals=[False, False, True])\n\n# list.append(obj)\nlist_append_op = method_op(\n name='append',\n arg_types=[list_rprimitive, object_rprimitive],\n return_type=c_int_rprimitive,\n c_function_name='PyList_Append',\n error_kind=ERR_NEG_INT)\n\n# list.extend(obj)\nlist_extend_op = method_op(\n name='extend',\n arg_types=[list_rprimitive, object_rprimitive],\n return_type=object_rprimitive,\n c_function_name='CPyList_Extend',\n error_kind=ERR_MAGIC)\n\n# list.pop()\nlist_pop_last = method_op(\n name='pop',\n arg_types=[list_rprimitive],\n return_type=object_rprimitive,\n c_function_name='CPyList_PopLast',\n error_kind=ERR_MAGIC)\n\n# list.pop(index)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/list_ops.py_list_pop_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/primitives/list_ops.py_list_pop_", "embedding": null, "metadata": {"file_path": "mypyc/primitives/list_ops.py", "file_name": "list_ops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 102, "end_line": 178, "span_ids": ["docstring:9", "docstring:19"], "tokens": 502}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "list_pop = method_op(\n name='pop',\n arg_types=[list_rprimitive, int_rprimitive],\n return_type=object_rprimitive,\n c_function_name='CPyList_Pop',\n error_kind=ERR_MAGIC)\n\n# list.count(obj)\nmethod_op(\n name='count',\n arg_types=[list_rprimitive, object_rprimitive],\n return_type=short_int_rprimitive,\n c_function_name='CPyList_Count',\n error_kind=ERR_MAGIC)\n\n# list.insert(index, obj)\nmethod_op(\n name='insert',\n arg_types=[list_rprimitive, int_rprimitive, object_rprimitive],\n return_type=c_int_rprimitive,\n c_function_name='CPyList_Insert',\n error_kind=ERR_NEG_INT)\n\n# list.sort()\nmethod_op(\n name='sort',\n arg_types=[list_rprimitive],\n return_type=c_int_rprimitive,\n c_function_name='PyList_Sort',\n error_kind=ERR_NEG_INT)\n\n# list.reverse()\nmethod_op(\n name='reverse',\n arg_types=[list_rprimitive],\n return_type=c_int_rprimitive,\n c_function_name='PyList_Reverse',\n error_kind=ERR_NEG_INT)\n\n# list.remove(obj)\nmethod_op(\n name='remove',\n arg_types=[list_rprimitive, object_rprimitive],\n return_type=c_int_rprimitive,\n c_function_name='CPyList_Remove',\n error_kind=ERR_NEG_INT)\n\n# list.index(obj)\nmethod_op(\n name='index',\n arg_types=[list_rprimitive, object_rprimitive],\n return_type=int_rprimitive,\n c_function_name='CPyList_Index',\n error_kind=ERR_MAGIC)\n\n# list * int\nbinary_op(\n name='*',\n arg_types=[list_rprimitive, int_rprimitive],\n return_type=list_rprimitive,\n c_function_name='CPySequence_Multiply',\n error_kind=ERR_MAGIC)\n\n# int * list\nbinary_op(name='*',\n arg_types=[int_rprimitive, list_rprimitive],\n return_type=list_rprimitive,\n c_function_name='CPySequence_RMultiply',\n error_kind=ERR_MAGIC)\n\n# list[begin:end]\nlist_slice_op = custom_op(\n arg_types=[list_rprimitive, int_rprimitive, int_rprimitive],\n return_type=object_rprimitive,\n c_function_name='CPyList_GetSlice',\n error_kind=ERR_MAGIC,)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test-data/fixtures/ir.py_dict_dict.setdefault.pass": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypyc/test-data/fixtures/ir.py_dict_dict.setdefault.pass", "embedding": null, "metadata": {"file_path": "mypyc/test-data/fixtures/ir.py", "file_name": "ir.py", "file_type": "text/x-python", "category": "implementation", "start_line": 154, "end_line": 179, "span_ids": ["dict.values", "dict.__iter__", "dict.__setitem__", "dict.update_7", "dict.update_8", "dict", "dict.keys", "dict.__delitem__", "dict.__init__", "dict.__getitem__", "dict.__contains__", "dict.clear", "dict.setdefault", "dict.__init___1", "dict.items", "dict.__init___2", "dict.update", "dict.copy", "dict.__len__", "dict.pop"], "tokens": 356}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class dict(Mapping[K, V]):\n @overload\n def __init__(self, **kwargs: K) -> None: ...\n @overload\n def __init__(self, map: Mapping[K, V], **kwargs: V) -> None: ...\n @overload\n def __init__(self, iterable: Iterable[Tuple[K, V]], **kwargs: V) -> None: ...\n def __getitem__(self, key: K) -> V: pass\n def __setitem__(self, k: K, v: V) -> None: pass\n def __delitem__(self, k: K) -> None: pass\n def __contains__(self, item: object) -> int: pass\n def __iter__(self) -> Iterator[K]: pass\n def __len__(self) -> int: pass\n @overload\n def update(self, __m: Mapping[K, V], **kwargs: V) -> None: pass\n @overload\n def update(self, __m: Iterable[Tuple[K, V]], **kwargs: V) -> None: ...\n @overload\n def update(self, **kwargs: V) -> None: ...\n def pop(self, x: int) -> K: pass\n def keys(self) -> Iterable[K]: pass\n def values(self) -> Iterable[V]: pass\n def items(self) -> Iterable[Tuple[K, V]]: pass\n def clear(self) -> None: pass\n def copy(self) -> Dict[K, V]: pass\n def setdefault(self, k: K, v: Optional[V] = None) -> Optional[V]: pass", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_try_contracting_literals_in_union_try_contracting_literals_in_union.return.list_itertools_compress_p": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/typeops.py_try_contracting_literals_in_union_try_contracting_literals_in_union.return.list_itertools_compress_p", "embedding": null, "metadata": {"file_path": "mypy/typeops.py", "file_name": "typeops.py", "file_type": "text/x-python", "category": "implementation", "start_line": 718, "end_line": 744, "span_ids": ["try_contracting_literals_in_union"], "tokens": 277}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def try_contracting_literals_in_union(types: Sequence[Type]) -> List[ProperType]:\n \"\"\"Contracts any literal types back into a sum type if possible.\n\n Will replace the first instance of the literal with the sum type and\n remove all others.\n\n if we call `try_contracting_union(Literal[Color.RED, Color.BLUE, Color.YELLOW])`,\n this function will return Color.\n \"\"\"\n proper_types = [get_proper_type(typ) for typ in types]\n sum_types = {} # type: Dict[str, Tuple[Set[Any], List[int]]]\n marked_for_deletion = set()\n for idx, typ in enumerate(proper_types):\n if isinstance(typ, LiteralType):\n fullname = typ.fallback.type.fullname\n if typ.fallback.type.is_enum:\n if fullname not in sum_types:\n sum_types[fullname] = (set(get_enum_values(typ.fallback)), [])\n literals, indexes = sum_types[fullname]\n literals.discard(typ.value)\n indexes.append(idx)\n if not literals:\n first, *rest = indexes\n proper_types[first] = typ.fallback\n marked_for_deletion |= set(rest)\n return list(itertools.compress(proper_types, [(i not in marked_for_deletion)\n for i in range(len(proper_types))]))", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py__parse_pth_file__parse_pth_file.with_f_.for_line_in_f_readlines_.yield__make_abspath_line_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py__parse_pth_file__parse_pth_file.with_f_.for_line_in_f_readlines_.yield__make_abspath_line_", "embedding": null, "metadata": {"file_path": "mypy/modulefinder.py", "file_name": "modulefinder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 599, "end_line": 619, "span_ids": ["_parse_pth_file"], "tokens": 162}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _parse_pth_file(dir: str, pth_filename: str) -> Iterator[str]:\n \"\"\"\n Mimics a subset of .pth import hook from Lib/site.py\n See https://github.com/python/cpython/blob/3.5/Lib/site.py#L146-L185\n \"\"\"\n\n pth_file = os.path.join(dir, pth_filename)\n try:\n f = open(pth_file, \"r\")\n except OSError:\n return\n with f:\n for line in f.readlines():\n if line.startswith(\"#\"):\n # Skip comment lines\n continue\n if line.startswith((\"import \", \"import\\t\")):\n # import statements in .pth files are not supported\n continue\n\n yield _make_abspath(line.rstrip(), dir)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py__make_abspath_add_py2_mypypath_entries.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py__make_abspath_add_py2_mypypath_entries.return.result", "embedding": null, "metadata": {"file_path": "mypy/modulefinder.py", "file_name": "modulefinder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 622, "end_line": 646, "span_ids": ["add_py2_mypypath_entries", "_make_abspath"], "tokens": 214}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _make_abspath(path: str, root: str) -> str:\n \"\"\"Take a path and make it absolute relative to root if not already absolute.\"\"\"\n if os.path.isabs(path):\n return os.path.normpath(path)\n else:\n return os.path.join(root, os.path.normpath(path))\n\n\ndef add_py2_mypypath_entries(mypypath: List[str]) -> List[str]:\n \"\"\"Add corresponding @python2 subdirectories to mypypath.\n\n For each path entry 'x', add 'x/@python2' before 'x' if the latter is\n a directory.\n \"\"\"\n result = []\n for item in mypypath:\n python2_dir = os.path.join(item, PYTHON2_STUB_DIR)\n if os.path.isdir(python2_dir):\n # @python2 takes precedence, but we also look into the parent\n # directory.\n result.append(python2_dir)\n result.append(item)\n else:\n result.append(item)\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_FindModuleCache.find_module_FindModuleCache._typeshed_has_version.return.version_min_version_an": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_FindModuleCache.find_module_FindModuleCache._typeshed_has_version.return.version_min_version_an", "embedding": null, "metadata": {"file_path": "mypy/modulefinder.py", "file_name": "modulefinder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 195, "end_line": 218, "span_ids": ["FindModuleCache.find_module", "FindModuleCache._typeshed_has_version"], "tokens": 252}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class FindModuleCache:\n\n def find_module(self, id: str, *, fast_path: bool = False) -> ModuleSearchResult:\n \"\"\"Return the path of the module source file or why it wasn't found.\n\n If fast_path is True, prioritize performance over generating detailed\n error descriptions.\n \"\"\"\n if id not in self.results:\n top_level = id.partition('.')[0]\n use_typeshed = True\n if top_level in self.stdlib_py_versions:\n use_typeshed = self._typeshed_has_version(top_level)\n self.results[id] = self._find_module(id, use_typeshed)\n if (not fast_path\n and self.results[id] is ModuleNotFoundReason.NOT_FOUND\n and self._can_find_module_in_parent_dir(id)):\n self.results[id] = ModuleNotFoundReason.WRONG_WORKING_DIRECTORY\n return self.results[id]\n\n def _typeshed_has_version(self, module: str) -> bool:\n if not self.options:\n return True\n version = typeshed_py_version(self.options)\n min_version, max_version = self.stdlib_py_versions[module]\n return version >= min_version and (max_version is None or version <= max_version)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_load_stdlib_py_versions_load_stdlib_py_versions.return.result": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_load_stdlib_py_versions_load_stdlib_py_versions.return.result", "embedding": null, "metadata": {"file_path": "mypy/modulefinder.py", "file_name": "modulefinder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 747, "end_line": 782, "span_ids": ["load_stdlib_py_versions"], "tokens": 398}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def load_stdlib_py_versions(custom_typeshed_dir: Optional[str]\n ) -> Dict[str, Tuple[Tuple[int, int], Optional[Tuple[int, int]]]]:\n \"\"\"Return dict with minimum and maximum Python versions of stdlib modules.\n\n The contents look like\n {..., 'secrets': ((3, 6), None), 'symbol': (2, 7), (3, 9)), ...}\n\n None means there is no maximum version.\n \"\"\"\n typeshed_dir = custom_typeshed_dir or os.path.join(os.path.dirname(__file__), \"typeshed\")\n stdlib_dir = os.path.join(typeshed_dir, \"stdlib\")\n result = {}\n\n versions_path = os.path.join(stdlib_dir, \"VERSIONS\")\n assert os.path.isfile(versions_path), (custom_typeshed_dir, versions_path, __file__)\n with open(versions_path) as f:\n for line in f:\n line = line.strip()\n if line.startswith(\"#\") or line == \"\":\n continue\n module, version_range = line.split(\":\")\n versions = version_range.split(\"-\")\n min_version = parse_version(versions[0])\n max_version = (parse_version(versions[1])\n if len(versions) >= 2 and versions[1].strip() else None)\n result[module] = min_version, max_version\n\n # Modules that are Python 2 only or have separate Python 2 stubs\n # have stubs in @python2/ and may need an override.\n python2_dir = os.path.join(stdlib_dir, PYTHON2_STUB_DIR)\n for fnam in os.listdir(python2_dir):\n fnam = fnam.replace(\".pyi\", \"\")\n max_version = result.get(fnam, ((2, 7), None))[1]\n result[fnam] = (2, 7), max_version\n\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_parse_version_typeshed_py_version.if_options_python_version.else_.return.options_python_version": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_parse_version_typeshed_py_version.if_options_python_version.else_.return.options_python_version", "embedding": null, "metadata": {"file_path": "mypy/modulefinder.py", "file_name": "modulefinder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 785, "end_line": 797, "span_ids": ["typeshed_py_version", "parse_version"], "tokens": 129}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def parse_version(version: str) -> Tuple[int, int]:\n major, minor = version.strip().split(\".\")\n return int(major), int(minor)\n\n\ndef typeshed_py_version(options: Options) -> Tuple[int, int]:\n \"\"\"Return Python version used for checking whether module supports typeshed.\"\"\"\n # Typeshed no longer covers Python 3.x versions before 3.6, so 3.6 is\n # the earliest we can support.\n if options.python_version[0] >= 3:\n return max(options.python_version, (3, 6))\n else:\n return options.python_version", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_filter_redundant_py2_dirs_": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/modulefinder.py_filter_redundant_py2_dirs_", "embedding": null, "metadata": {"file_path": "mypy/modulefinder.py", "file_name": "modulefinder.py", "file_type": "text/x-python", "category": "implementation", "start_line": 800, "end_line": 814, "span_ids": ["filter_redundant_py2_dirs"], "tokens": 134}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def filter_redundant_py2_dirs(dirs: List[str]) -> List[str]:\n \"\"\"If dirs has /@python2 followed by , filter out the latter.\"\"\"\n if len(dirs) <= 1 or not any(d.endswith(PYTHON2_STUB_DIR) for d in dirs):\n # Fast path -- nothing to do\n return dirs\n seen = []\n result = []\n for d in dirs:\n if d.endswith(PYTHON2_STUB_DIR):\n seen.append(os.path.dirname(d))\n result.append(d)\n elif d not in seen:\n result.append(d)\n return result", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/enums.py__implements_new__implements_new.return.type_with_new_fullname_no": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/plugins/enums.py__implements_new__implements_new.return.type_with_new_fullname_no", "embedding": null, "metadata": {"file_path": "mypy/plugins/enums.py", "file_name": "enums.py", "file_type": "text/x-python", "category": "implementation", "start_line": 107, "end_line": 119, "span_ids": ["_implements_new"], "tokens": 140}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def _implements_new(info: TypeInfo) -> bool:\n \"\"\"Check whether __new__ comes from enum.Enum or was implemented in a\n subclass. In the latter case, we must infer Any as long as mypy can't infer\n the type of _value_ from assignments in __new__.\n \"\"\"\n type_with_new = _first(\n ti\n for ti in info.mro\n if ti.names.get('__new__') and not ti.fullname.startswith('builtins.')\n )\n if type_with_new is None:\n return False\n return type_with_new.fullname not in ('enum.Enum', 'enum.IntEnum', 'enum.StrEnum')", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_run_stubtest_run_stubtest.with_use_tmp_dir_.return.output_getvalue_replace": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_run_stubtest_run_stubtest.with_use_tmp_dir_.return.output_getvalue_replace", "embedding": null, "metadata": {"file_path": "mypy/test/teststubtest.py", "file_name": "teststubtest.py", "file_type": "text/x-python", "category": "test", "start_line": 61, "end_line": 89, "span_ids": ["run_stubtest"], "tokens": 282}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "def run_stubtest(\n stub: str, runtime: str, options: List[str], config_file: Optional[str] = None,\n) -> str:\n with use_tmp_dir():\n with open(\"builtins.pyi\", \"w\") as f:\n f.write(stubtest_builtins_stub)\n with open(\"{}.pyi\".format(TEST_MODULE_NAME), \"w\") as f:\n f.write(stub)\n with open(\"{}.py\".format(TEST_MODULE_NAME), \"w\") as f:\n f.write(runtime)\n if config_file:\n with open(\"{}_config.ini\".format(TEST_MODULE_NAME), \"w\") as f:\n f.write(config_file)\n options = options + [\"--mypy-config-file\", \"{}_config.ini\".format(TEST_MODULE_NAME)]\n if sys.path[0] != \".\":\n sys.path.insert(0, \".\")\n if TEST_MODULE_NAME in sys.modules:\n del sys.modules[TEST_MODULE_NAME]\n\n output = io.StringIO()\n with contextlib.redirect_stdout(output):\n test_stubs(\n parse_options([TEST_MODULE_NAME] + options),\n use_builtins_fixtures=True\n )\n\n module_path = Path(os.getcwd()) / TEST_MODULE_NAME\n # remove cwd as it's not available from outside\n return output.getvalue().replace(str(module_path), TEST_MODULE_NAME)", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}, "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_Case_collect_cases.return.test": {"__data__": {"id_": "/home/jiayipan/code/24FA/temp/ml-01/moatless-tools/t/repos/swe-train_python__mypy/mypy/test/teststubtest.py_Case_collect_cases.return.test", "embedding": null, "metadata": {"file_path": "mypy/test/teststubtest.py", "file_name": "teststubtest.py", "file_type": "text/x-python", "category": "test", "start_line": 92, "end_line": 128, "span_ids": ["Case", "Case.__init__", "collect_cases"], "tokens": 302}, "excluded_embed_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date", "start_line", "end_line", "tokens"], "excluded_llm_metadata_keys": ["file_name", "file_type", "file_size", "creation_date", "last_modified_date", "last_accessed_date"], "relationships": {}, "text": "class Case:\n def __init__(self, stub: str, runtime: str, error: Optional[str]):\n self.stub = stub\n self.runtime = runtime\n self.error = error\n\n\ndef collect_cases(fn: Callable[..., Iterator[Case]]) -> Callable[..., None]:\n \"\"\"run_stubtest used to be slow, so we used this decorator to combine cases.\n\n If you're reading this and bored, feel free to refactor this and make it more like\n other mypy tests.\n\n \"\"\"\n\n def test(*args: Any, **kwargs: Any) -> None:\n cases = list(fn(*args, **kwargs))\n expected_errors = set()\n for c in cases:\n if c.error is None:\n continue\n expected_error = \"{}.{}\".format(TEST_MODULE_NAME, c.error)\n assert expected_error not in expected_errors, (\n \"collect_cases merges cases into a single stubtest invocation; we already \"\n \"expect an error for {}\".format(expected_error)\n )\n expected_errors.add(expected_error)\n output = run_stubtest(\n stub=\"\\n\\n\".join(textwrap.dedent(c.stub.lstrip(\"\\n\")) for c in cases),\n runtime=\"\\n\\n\".join(textwrap.dedent(c.runtime.lstrip(\"\\n\")) for c in cases),\n options=[\"--generate-allowlist\"],\n )\n\n actual_errors = set(output.splitlines())\n assert actual_errors == expected_errors, output\n\n return test", "start_char_idx": null, "end_char_idx": null, "text_template": "{metadata_str}\n\n{content}", "metadata_template": "{key}: {value}", "metadata_seperator": "\n", "class_name": "TextNode"}, "__type__": "1"}}}